Split class
Create custom royalty splits to distribute funds.
Example
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK("{{chainName}}");
const contract = sdk.getSplit("{{contract_address}}");
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(network, address, storage, options, contractWrapper) | Constructs a new instance of the Split class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
contractAbi | static | any | |
contractType | static | "split" | |
encoder | ContractEncoder<SplitContract> | ||
estimator | GasCostEstimator<SplitContract> | ||
events | ContractEvents<SplitContract> | ||
metadata | ContractMetadata<SplitContract, typeof Split.schema> |
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