Returns the NFTDriver
contract address to which the client is connected.
Returns the client's provider
.
Returns the client's signer
.
The signer
is the provider
's signer.
Sets the maximum allowance value for the NFTDriver
contract over the client's signer
tokens for the given ERC20 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 contract transaction.
Collects the received and already split funds and transfers them from the DripsHub
contract to an address.
The caller (client's signer
) must be the owner of the tokenId
or be approved to use it.
The ID of the token representing the collecting account.
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 address to send collected funds to.
A Promise
which resolves to the contract transaction.
Usage of this method is discouraged; use safeCreateAccount whenever possible.
Creates a new Drips account.
It will mint a new NFT controlling a new Drips account and transfer its ownership to an address. It also emits user metadata for the new token.
Important: In Drips, an account "is" a user ID at the protocol level. The minted NFT's ID (token ID) and the user ID controlled by it are always equal.
This means that anywhere in the SDK, a method expects a user ID parameter, and a token ID is a valid argument.
The address to transfer the minted token to.
The name/ID of the app that is associated with the new account.
If provided, the following user metadata entry will be appended to the userMetadata
list:
associatedApp
.The list of user metadata. Note that a metadata key
needs to be 32bytes.
Tip: you might want to use Utils.UserMetadata.createFromStrings
to easily create metadata instances from string
inputs.
A Promise
which resolves to minted token ID. It's equal to the user ID controlled by it.
Emits the account's metadata. The key and the value are not standardized by the protocol, it's up to the caller to establish and follow conventions to ensure compatibility with the consumers.
The caller (client's signer
) must be the owner of the tokenId
or be approved to use it.
The ID of the token representing the emitting account.
The list of user metadata. Note that a metadata key
needs to be 32bytes.
Tip: you might want to use Utils.UserMetadata.createFromStrings
to easily create metadata instances from string
inputs.
A Promise
which resolves to the contract transaction.
Returns the remaining number of tokens the NFTDriver
contract is allowed to spend on behalf of the client's signer
for the given ERC20 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 remaining number of tokens.
Gives funds to the receiver. The receiver can collect them immediately.
The caller (client's signer
) must be the owner of the tokenId
or be approved to use it.
The ID of the token representing the giving account.
The receiver 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 amount to give (in the smallest unit, e.g., Wei). It must be greater than 0
.
A Promise
which resolves to the contract transaction.
Creates a new Drips account.
It will safely mint a new NFT controlling a new Drips account and transfer its ownership to an address. It also emits user metadata for the new token.
Important: In Drips, an account "is" a user ID at the protocol level. The minted NFT's ID (token ID) and the user ID controlled by it are always equal.
This means that anywhere in the SDK, a method expects a user ID parameter, and a token ID is a valid argument.
The address to transfer the minted token to.
The name/ID of the app that is associated with the new account.
If provided, the following user metadata entry will be appended to the userMetadata
list:
associatedApp
.The list of user metadata. Note that a metadata key
needs to be 32bytes.
Tip: you might want to use Utils.UserMetadata.createFromStrings
to easily create metadata instances from string
inputs.
A Promise
which resolves to minted token ID. It's equal to the user ID controlled by it.
Sets a Drips configuration for the given account.
It will transfer funds from the client's signer
wallet to the DripsHub
contract to fulfill the change of the drips balance.
The caller (client's signer
) must be the owner of the tokenId
or be approved to use it.
The ID of the token representing the configured account.
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 drips receivers that were set in the last drips update. Pass an empty array if this is the first update.
Tip: you might want to use DripsSubgraphClient.getCurrentDripsReceivers
to easily retrieve the list of current receivers.
The new drips receivers (max 100
).
Duplicate receivers are not allowed and will only be processed once.
Pass an empty array if you want to clear all receivers.
The address to send funds to in case of decreasing balance.
The drips balance change to be applied:
0
to leave drips balance as is (default value).A Promise
which resolves to the contract transaction.
Sets the account's Splits configuration.
The caller (client's signer
) must be the owner of the tokenId
or be approved to use it.
The ID of the token representing the configured account.
The splits receivers (max 200
).
Each splits receiver will be getting weight / TOTAL_SPLITS_WEIGHT
share of the funds.
Duplicate receivers are not allowed and will only be processed once.
Pass an empty array if you want to clear all receivers.
A Promise
which resolves to the contract transaction.
Creates a new immutable NFTDriverClient
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 managing Drips accounts identified by NFTs.
NFTDriver contract.