Split class
Create custom royalty splits to distribute funds.
Example
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK("{{chainName}}");
const contract = await sdk.getContract("{{contract_address}}", "split");
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(network, address, storage, options, abi, chainId, contractWrapper) | Constructs a new instance of the Split class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
abi | Abi | ||
chainId | readonly | number | |
contractRoles | static | readonly ["admin"] | |
encoder | ContractEncoder<SplitContract> | ||
estimator | GasCostEstimator<SplitContract> | ||
events | ContractEvents<SplitContract> | ||
metadata | ContractMetadata<SplitContract, typeof SplitsContractSchema> | ||
roles | ContractRoles<SplitContract, typeof Split.contractRoles[number]> |
Methods
Method | Modifiers | Description |
---|---|---|
balanceOf(address) | Get Funds owed to a particular wallet | |
balanceOfAllRecipients() | Returns all the recipients and their balances in the native currency. | |
balanceOfToken(walletAddress, tokenAddress) | Get non-native Token Funds owed to a particular wallet | |
balanceOfTokenAllRecipients(tokenAddress) | Returns all the recipients and their balances in a non-native currency. | |
distribute() | Distribute Funds | |
distributeToken(tokenAddress) | Distribute Funds | |
getAddress() | ||
getAllRecipients() | Get Recipients of this splits contract | |
getRecipientSplitPercentage(address) | Get the % of funds owed to a given address | |
onNetworkUpdated(network) | ||
withdraw(walletAddress) | Withdraw Funds | |
withdrawToken(walletAddress, tokenAddress) | Triggers a transfer to account of the amount of a given currency they are owed. |
Signature:
export declare class Split implements UpdateableNetwork
Implements: UpdateableNetwork