Constant Flow Agreement V1 Helper Class

Description

A helper class to interact with the CFAV1 contract.

Hierarchy

  • default
    • ConstantFlowAgreementV1

Constructors

  • Parameters

    • hostAddress: string
    • cfaV1Address: string
    • cfaV1ForwarderAddress: string

    Returns _sdkCore.ConstantFlowAgreementV1

Properties

_getCallAgreementOperation: ((callAgreementOperation, forwarderPopulatedTransactionPromise?, shouldUseCallAgreement?) => Operation)

Returns the desired Operation based on shouldUseCallAgreement.

Type declaration

    • (callAgreementOperation, forwarderPopulatedTransactionPromise?, shouldUseCallAgreement?): Operation
    • Returns the desired Operation based on shouldUseCallAgreement.

      Parameters

      • callAgreementOperation: Operation

        the host.callAgreement created Operation

      • Optional forwarderPopulatedTransactionPromise: Promise<PopulatedTransaction>

        the populated forwarder transaction promise

      • Optional shouldUseCallAgreement: boolean

        whether or not to use host.callAgreement

      Returns Operation

Param: shouldUseCallAgreement

whether or not to use host.callAgreement

Param: callAgreementOperation

the host.callAgreement created Operation

Param: forwarderPopulatedTransactionPromise

the populated forwarder transaction promise

_sanitizeFlowInfo: ((params) => IWeb3FlowInfo)

Sanitizes flow info, converting BigNumber to string.

Type declaration

Param: timestamp

last updated timestamp of flow

Param: flowRate

the current flow rate

Param: deposit

the deposit amount

Param: owedDeposit

any owed deposit

Returns

sanitized web3 flow info

_sanitizeFlowOperatorData: ((params) => IWeb3FlowOperatorData)

Sanitizes flow operator data, converting BigNumber to string.

Type declaration

Param: flowOperatorId

The keccak256 hash of encoded string "flowOperator", sender and flowOperator

Param: permissions

the permissions

Param: flowRateAllowance

the flow rate allowance granted to the flow operator

Returns

sanitized web3 flow info

createFlow: ((params) => Operation)

Create a flow.

Type declaration

Param: flowRate

The specified flow rate.

Param: sender

The sender of the flow

Param: receiver

The receiver of the flow.

Param: superToken

The token to be flowed.

Param: userData

Extra user data provided.

Param: overrides

ethers overrides object for more control over the transaction sent.

Param: shouldUseCallAgreement

Whether to use callAgreement, or the CFAv1Forwarder

Returns

An instance of Operation which can be executed or batched.

createFlowByOperator: ((params) => Operation)

Create a flow as an operator

Type declaration

Param: flowRate

The specified flow rate.

Param: sender

The sender of the flow.

Param: receiver

The receiver of the flow.

Param: superToken

The token to be flowed.

Param: userData

Extra user data provided.

Param: overrides

ethers overrides object for more control over the transaction sent.

Returns

An instance of Operation which can be executed or batched.

deleteFlow: ((params) => Operation)

Delete a flow.

Type declaration

Param: superToken

The token to be flowed.

Param: sender

The sender of the flow.

Param: receiver

The receiver of the flow.

Param: userData

Extra user data provided.

Param: overrides

ethers overrides object for more control over the transaction sent.

Returns

An instance of Operation which can be executed or batched.

deleteFlowByOperator: ((params) => Operation)

Delete a flow as an operator.

Type declaration

Param: sender

The sender of the flow.

Param: receiver

The receiver of the flow.

Param: superToken

The token to be flowed.

Param: userData

Extra user data provided.

Param: overrides

ethers overrides object for more control over the transaction sent.

Returns

An instance of Operation which can be executed or batched.

forwarder: CFAv1Forwarder
getAccountFlowInfo: ((params) => Promise<IWeb3FlowInfo>)

Get the flow info of an account (net flow).

Type declaration

Param: superToken

the superToken of the agreement

Param: account

the account we're querying

Param: providerOrSigner

a provider or signer object

Returns

Web3 Flow info object

getFlow: ((params) => Promise<IWeb3FlowInfo>)

Get the details of a flow.

Type declaration

Param: superToken

the superToken of the agreement

Param: sender

the sender of the flow

Param: receiver

the receiver of the flow

Param: providerOrSigner

a provider or signer object

Returns

Web3 Flow info object

getFlowOperatorData: ((params) => Promise<IWeb3FlowOperatorData>)

Get flow operator data.

Type declaration

Param: superToken

the superToken of the agreement

Param: sender

the sender

Param: flowOperator

the flowOperator

Param: providerOrSigner

a provider or signer object

Returns

Web3 Flow info object

getFlowOperatorDataByID: ((params) => Promise<IWeb3FlowOperatorData>)

Get flow operator data using the flowOperatorId.

Type declaration

Param: superToken

the superToken of the agreement

Param: flowOperatorId

The keccak256 hash of encoded string "flowOperator", sender and flowOperator

Param: providerOrSigner

a provider or signer object

Returns

Web3 Flow info object

getNetFlow: ((params) => Promise<string>)

Get the net flow of an account.

Type declaration

    • (params): Promise<string>
    • Get the net flow of an account.

      Parameters

      Returns Promise<string>

      Web3 Flow info object

Param: superToken

the superToken of the agreement

Param: account

the account we're querying

Param: providerOrSigner

a provider or signer object

Returns

Web3 Flow info object

host: Host
updateFlow: ((params) => Operation)

Update a flow.

Type declaration

Param: flowRate

The specified flow rate.

Param: sender

The sender of the flow

Param: receiver

The receiver of the flow.

Param: superToken

The token to be flowed.

Param: userData

Extra user data provided.

Param: overrides

ethers overrides object for more control over the transaction sent.

Returns

An instance of Operation which can be executed or batched.

updateFlowByOperator: ((params) => Operation)

Update a flow as an operator.

Type declaration

Param: flowRate

The specified flow rate.

Param: sender

The sender of the flow.

Param: receiver

The receiver of the flow.

Param: superToken

The token to be flowed.

Param: userData

Extra user data provided.

Param: overrides

ethers overrides object for more control over the transaction sent.

Returns

An instance of Operation which can be executed or batched.

Methods

  • Give flow operator full control - max flow rate and create/update/delete permissions.

    Parameters

    Returns Operation

  • Decrease the flow rate allowance for an ACL operator.

    Parameters

    Returns Operation

    An instance of Operation which can be executed or batched.

  • Decrease the flow rate allowance and sets permissions for an ACL operator.

    Returns Operation

    An instance of Operation which can be executed or batched.

  • Increase the flow rate allowance for an ACL operator.

    Parameters

    Returns Operation

    An instance of Operation which can be executed or batched.

  • Increase the flow rate allowance and sets permissions for an ACL operator.

    Returns Operation

    An instance of Operation which can be executed or batched.

  • Revoke flow operator control - set flow rate to 0 with no permissions.

    Parameters

    Returns Operation

  • Update permissions for a flow operator as a sender.

    Returns Operation

    An instance of Operation which can be executed or batched.

Generated using TypeDoc