Write Methods

Using SDK Core Write Operations

Write operations are instantiated and then executed with the exec function. See below πŸ‘‡

//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!

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

Method Catalog

Last updated

Was this helpful?