Returns the DripsHub
's address to which the DripsHubClient
is connected.
Returns the DripsHubClient
's provider
.
Returns the DripsHubClient
's signer
.
This is the user to which the DripsHubClient
is linked and manages Drips.
Note that for read-only client instances created with the {@link createReadonly} method it returns undefined
.
Returns the cycle length in seconds.
A Promise
which resolves to the cycle seconds.
Returns the user's drips state.
The user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
A Promise which resolves to the DripsState.
Returns the user's collectable balance. Collectable balance contains the user's funds that are already split and ready to be collected.
user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
A Promise
which resolves to the the collectable balance.
Returns the user's drips balance at a given timestamp. Drips balance contains the funds the user can stream to other users.
The user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
The users's current drips receivers.
The timestamp for which the balance should be calculated. It can't be lower than the timestamp of the last call to setDrips
.
If it's bigger than block.timestamp
, then it's a prediction assuming that setDrips
won't be called before timestamp
.
A Promise which resolves to the user balance on timestamp
.
Calculates the user's receivable balance for the given token. Receivable balance contains the funds other users drip to and is updated once every cycle.
The user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
The maximum number of received drips cycles. Must be greater than 0
.
If too low, receiving will be cheap, but may not cover many cycles.
If too high, receiving may become too expensive to fit in a single transaction.
A Promise
which resolves to the receivable balance.
Calculates the result of splitting an amount using the user's current splits configuration.
The user ID.
The current splits receivers.
The amount being split. It must be greater than 0
.
A Promise
which resolves to the split result.
Returns the user's splittable balance for the given token. Splittable balance contains the user's received but not split yet funds.
user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
A Promise
which resolves to the the splittable balance.
Calculates the user's squeezable balance. Squeezable balance contains the funds that can be received from the currently running cycle from a single sender.
The ID of the user receiving drips to squeeze funds for.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
The ID of the user sending drips to squeeze funds from.
The sender's history hash which was valid right before
they set up the sequence of configurations described by dripsHistory
.
The sequence of the sender's drips configurations.
A Promise
which resolves to the the squeezable balance.
Returns the total amount currently stored in DripsHub
for the given token.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
A Promise
which resolves to the balance of the token.
Returns the count of cycles from which drips can be collected. This method can be used to detect if there are too many cycles to analyze in a single transaction.
The user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
A Promise
which resolves to the number of receivable cycles.
Receives user's drips. Calling this function does not collect but makes the funds ready to split and collect.
The user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
The maximum number of received drips cycles. Must be greater than 0
.
If too low, receiving will be cheap, but may not cover many cycles.
If too high, receiving may become too expensive to fit in a single transaction.
A Promise
which resolves to the contract transaction.
Splits user's received but not split yet funds among receivers.
The user ID.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
The current splits receivers.
A Promise
which resolves to the contract transaction.
Receives drips from the currently running cycle from a single sender.
It doesn't receive drips from the previous, finished cycles, to do that use receiveDrips
.
Squeezed funds won't be received in the next calls to squeezeDrips
or receiveDrips
.
Only funds dripped before block.timestamp
can be squeezed.
Tip: you might want to use DripsSubgraphClient.getArgsForSqueezingAllDrips
to easily populate the arguments for squeezing all Drips up to "now".
The ID of the user receiving drips to squeeze funds for.
The ERC20 token address.
It must preserve amounts, so if some amount of tokens is transferred to an address, then later the same amount must be transferrable from that address. Tokens which rebase the holders' balances, collect taxes on transfers, or impose any restrictions on holding or transferring tokens are not supported. If you use such tokens in the protocol, they can get stuck or lost.
The ID of the user sending drips to squeeze funds from.
The sender's history hash which was valid right before they set up the sequence of configurations described by dripsHistory
.
The sequence of the sender's drips configurations.
It can start at an arbitrary past configuration, but must describe all the configurations
which have been used since then including the current one, in the chronological order.
Only drips described by dripsHistory
will be squeezed.
If dripsHistory
entries have no receivers, they won't be squeezed.
A Promise
which resolves to the contract transaction.
Creates a new immutable DripsHubClient
instance.
The network provider. It cannot be changed after creation.
The provider
must be connected to one of the following supported networks:
1
5
80001
The singer used to sign transactions. It cannot be changed after creation.
Important: If the signer
is not connected to a provider it will try to connect to the provider
, else it will use the signer.provider
.
Overrides the NFTDriver
contract address.
If it's undefined
(default value), the address will be automatically selected based on the provider
's network.
A Promise
which resolves to the new client instance.
Generated using TypeDoc
A client for interacting with the DripsHub.