# Write Methods

## Using SDK Core Write Operations

Write operations are instantiated and then executed with the `exec` function. See below 👇

```javascript
//load the token you'd like to use like this 
//note that tokens may be loaded by symbol or by address
const daix = await sf.loadSuperToken("DAIx");

// 1) Instantiate operation to create a 100,000 wei/second stream
let createFlowOp = daix.createFlow({
  sender: "0xAbC...",    // Alice's address
  receiver: "0xXyZ...",
  flowRate: "100000",
});

// 2) Execute operation on aliceSigner
await createFlowOp.exec(aliceSigner);
```

Conveniently, this lets you recycle the operation. Say you want to call the same `createFlow` operation again - you can reuse the operation object on `aliceSigner`!

```javascript
// 3) Use the same operation object to create 100,000 wei/second stream again
await createFlowOp.exec(aliceSigner);
```

## Method Catalog

```javascript
// Regular Usage

//load the token you'd like to use like this 
//note that tokens may be loaded by symbol or by address
const daix = await sf.loadSuperToken("DAIx");

daix.createFlow({
  sender: string,
  receiver: string,
  flowRate: string,
  userData?: string
});

daix.updateFlow({
  sender: string,
  receiver: string,
  flowRate: string,
  userData?: string
});

daix.deleteFlow({
  sender: string,
  receiver: string,
  userData?: string
});

// Flow Operator Usage

daix.updateFlowOperatorPermissions({
  flowOperator: string,
  permissions: number, // should enter 1-7
  flowRateAllowance: string
});

daix.revokeFlowOperatorPermissions({
  flowOperator: string
})

daix.createFlowByOperator({
  sender: string,
  receiver: string,
  flowRate: string,
  userData?: string
});

daix.updateFlowByOperator({
  sender: string,
  receiver: string,
  flowRate: string,
  userData?: string
});

daix.deleteFlowByOperator({
  sender: string,
  receiver: string,
  userData?: string
})
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://superfluid.gitbook.io/superfluid/developers/constant-flow-agreement-cfa/cfa-operations/write-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
