Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Latest commit

 

History

History
28 lines (19 loc) · 2.25 KB

File metadata and controls

28 lines (19 loc) · 2.25 KB

getFlow

Get information regarding a stream going from a sender to a receiver for a specified Super Token

//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");

let res = await daix.getFlow({
  sender: string,
  receiver: string,
  providerOrSigner: ethers.providers.Provider | ethers.Signer
});

Parameters

ParameterTypeDescription
senderstringAddress of sender
receiverstringAddress of receiver
providerOrSignerethers.providers.Provider or ethers.Signerethers provider or ethers signer object

Return Value(s)

Returns a JSON object literal with the below info:

KeyValue TypeValue Description
timestampDateTimestamp when the stream of superToken was last updated by the account
flowRatestringFlow rate (wei/second) of the stream. Always zero or positive.
depositstringBuffer deposit held for the stream
owedDepositstringAdditional deposit if the stream is to a Super App

Example Usage

{% embed url="https://github.com/superfluid-finance/super-examples/blob/311e5a95d3505dc8c5d8afd420e9edc8b5a57426/projects/borrow-against-salary/test/EmploymentLoan.test.js#L186" %}