Skip to main content

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

ConstructorModifiersDescription
(constructor)(network, address, storage, options, contractWrapper)Constructs a new instance of the Split class

Properties

PropertyModifiersTypeDescription
contractAbistaticany
contractTypestatic"split"
encoderContractEncoder<SplitContract>
estimatorGasCostEstimator<SplitContract>
eventsContractEvents<SplitContract>
metadataContractMetadata<SplitContract, typeof Split.schema>

Methods

MethodModifiersDescription
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