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 = await sdk.getContract("{{contract_address}}", "split");

Constructors

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

Properties

PropertyModifiersTypeDescription
abiAbi
chainIdreadonlynumber
contractRolesstaticreadonly ["admin"]
encoderContractEncoder<SplitContract>
estimatorGasCostEstimator<SplitContract>
eventsContractEvents<SplitContract>
metadataContractMetadata<SplitContract, typeof SplitsContractSchema>
rolesContractRoles<SplitContract, typeof Split.contractRoles[number]>

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