Split
Create custom royalty splits to distribute funds.
import { ThirdwebSDK } from "@thirdweb-dev/sdk"; const sdk = new ThirdwebSDK("{{chainName}}");const contract = await sdk.getContract( "{{contract_address}}", "split",);
class Split implements UpdateableNetwork {}
function constructor(network: NetworkInput, address: string, storage: ThirdwebStorage<IpfsUploadBatchOptions>, options: undefined | ({ clientId?: string; gasSettings?: { maxPriceInGwei?: number; speed?: "standard" | "fast" | "fastest" }; gasless?: ({ experimentalChainlessSupport?: boolean; openzeppelin: { domainName?: string; domainSeparatorVersion?: string; domainVersion?: string; relayerForwarderAddress?: string; relayerUrl: string; useEOAForwarder?: boolean } }) | ({ biconomy: { apiId: string; apiKey: string; deadlineSeconds?: number } }) | ({ engine: { domainName?: string; domainSeparatorVersion?: string; domainVersion?: string; relayerForwarderAddress?: string; relayerUrl: string }; experimentalChainlessSupport?: boolean }); gatewayUrls?: Array<string>; readonlySettings?: { chainId?: number; rpcUrl: string }; rpcBatchSettings?: { sizeLimit?: number; timeLimit?: number }; secretKey?: string; supportedChains?: Array<{ chainId: number; nativeCurrency: { decimals: number; name: string; symbol: string }; rpc: Array<string>; slug: string }> }), abi: Array<objectInputType<{ inputs: ZodDefault<ZodArray<ZodObject<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; stateMutability: ZodOptional<ZodString> }>, "strip", ZodAny, objectOutputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">, objectInputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">>, "many">>; name: ZodDefault<ZodString>; outputs: ZodDefault<ZodArray<ZodObject<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; stateMutability: ZodOptional<ZodString> }>, "strip", ZodAny, objectOutputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">, objectInputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">>, "many">>; type: ZodString }, ZodAny, "strip">>, chainId: number, contractWrapper: ContractWrapper<Split>) : Split
let options: | undefined | { clientId?: string; gasSettings?: { maxPriceInGwei?: number; speed?: "standard" | "fast" | "fastest"; }; gasless?: | { experimentalChainlessSupport?: boolean; openzeppelin: { domainName?: string; domainSeparatorVersion?: string; domainVersion?: string; relayerForwarderAddress?: string; relayerUrl: string; useEOAForwarder?: boolean; }; } | { biconomy: { apiId: string; apiKey: string; deadlineSeconds?: number; }; } | { engine: { domainName?: string; domainSeparatorVersion?: string; domainVersion?: string; relayerForwarderAddress?: string; relayerUrl: string; }; experimentalChainlessSupport?: boolean; }; gatewayUrls?: Array<string>; readonlySettings?: { chainId?: number; rpcUrl: string }; rpcBatchSettings?: { sizeLimit?: number; timeLimit?: number }; secretKey?: string; supportedChains?: Array<{ chainId: number; nativeCurrency: { decimals: number; name: string; symbol: string; }; rpc: Array<string>; slug: string; }>; };
let abi: Array<objectInputType<{ inputs: ZodDefault<ZodArray<ZodObject<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; stateMutability: ZodOptional<ZodString> }>, "strip", ZodAny, objectOutputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">, objectInputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">>, "many">>; name: ZodDefault<ZodString>; outputs: ZodDefault<ZodArray<ZodObject<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; stateMutability: ZodOptional<ZodString> }>, "strip", ZodAny, objectOutputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">, objectInputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">>, "many">>; type: ZodString }, ZodAny, "strip">>
Get Funds owed to a particular wallet
Get the amount of funds in the native currency held by the contract that is owed to a specific recipient.
// The address to check the funds ofconst address = "{{wallet_address}}";const funds = await contract.balanceOf(address);console.log(funds);
function balanceOf(address: string): Promise<BigNumber>;
Returns all the recipients and their balances in the native currency.
function balanceOfAllRecipients(): Promise<{}>;
Get non-native Token Funds owed to a particular wallet
Get the amount of funds in the non-native tokens held by the contract that is owed to a specific recipient.
// The address to check the funds ofconst address = "{{wallet_address}}";// The address of the currency to check the contracts funds ofconst tokenAddress = "0x...";const funds = await contract.balanceOfToken(address, tokenAddress);console.log(funds);
function balanceOfToken( walletAddress: string, tokenAddress: string,): Promise<{ decimals: number; displayValue: string; name: string; symbol: string; value: BigNumber;}>;
Returns all the recipients and their balances in a non-native currency.
function balanceOfTokenAllRecipients( tokenAddress: string,): Promise<{}>;
Get Recipients of this splits contract
Get the data about the shares of every split recipient on the contract
const recipients = await contract.getAllRecipients();console.log(recipients);
Get the % of funds owed to a given address
function getRecipientSplitPercentage( address: string,
function distribute(...args: []): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling distribute.prepare()
with same arguments. Learn more
function distributeToken(tokenAddress: string): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling distributeToken.prepare()
with same arguments. Learn more
function withdraw(walletAddress: string): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling withdraw.prepare()
with same arguments. Learn more
function withdrawToken( walletAddress: string, tokenAddress: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling withdrawToken.prepare()
with same arguments. Learn more
let abi: Array<objectOutputType<{ inputs: ZodDefault<ZodArray<ZodObject<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; stateMutability: ZodOptional<ZodString> }>, "strip", ZodAny, objectOutputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">, objectInputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">>, "many">>; name: ZodDefault<ZodString>; outputs: ZodDefault<ZodArray<ZodObject<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; stateMutability: ZodOptional<ZodString> }>, "strip", ZodAny, objectOutputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">, objectInputType<extendShape<{ name: ZodDefault<ZodString>; type: ZodString }, { components: ZodOptional<ZodArray<..., ...>>; stateMutability: ZodOptional<ZodString> }>, ZodAny, "strip">>, "many">>; type: ZodString }, ZodAny, "strip">>
let metadata: ContractMetadata<Split, { deploy: ZodObject<extendShape<extendShape<extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<..., ..., ...>, ZodType<..., ..., ...>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>, Array<{ address: string; sharesBps: number }>, undefined | (Array<{ address: ...; sharesBps: ... }>)> }>, extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<..., ..., ...>, ZodType<..., ..., ...>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>, Array<{ address: string; sharesBps: number }>, undefined | (Array<{ address: ...; sharesBps: ... }>)> }>>, { trusted_forwarders: ZodDefault<ZodArray<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${...}`, ZodTypeDef, (...) | (...)>]>, "many">> }>, "strip", ZodTypeAny, { app_uri?: string; defaultAdmin?: string; description?: string; external_link?: string; image?: any; name: string; recipients: Array<{ address: string; sharesBps: number }>; social_urls?: Record<string, string>; trusted_forwarders: Array<string> }, { app_uri?: string; defaultAdmin?: string; description?: string; external_link?: string; image?: any; name: string; recipients?: Array<{ address: string; sharesBps: number }>; social_urls?: Record<string, string>; trusted_forwarders?: Array<string> }>; input: ZodObject<extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, (`${...}.eth`) | (`${...}.cb.id`)>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<..., ..., ..., ..., ...>]>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{ address: ZodUnion<...>; sharesBps: ZodNumber }, "strip", ZodTypeAny, { address: string; sharesBps: number }, { address: string; sharesBps: number }>, "many">>, Array<{ address: string; sharesBps: number }>, undefined | (Array<{ address: string; sharesBps: number }>)> }>, "strip", ZodUnknown, objectOutputType<extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${...}`, ZodTypeDef, (...) | (...)>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{ address: ...; sharesBps: ... }, "strip", ZodTypeAny, { address: ...; sharesBps: ... }, { address: ...; sharesBps: ... }>, "many">>, Array<{ address: string; sharesBps: number }>, undefined | (Array<{ address: string; sharesBps: number }>)> }>, ZodUnknown, "strip">, objectInputType<extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${...}`, ZodTypeDef, (...) | (...)>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{ address: ...; sharesBps: ... }, "strip", ZodTypeAny, { address: ...; sharesBps: ... }, { address: ...; sharesBps: ... }>, "many">>, Array<{ address: string; sharesBps: number }>, undefined | (Array<{ address: string; sharesBps: number }>)> }>, ZodUnknown, "strip">>; output: ZodObject<extendShape<extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${...}`, ZodTypeDef, (...) | (...)>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { image: ZodOptional<ZodString> }>, { recipients: ZodArray<ZodObject<extendShape<{ address: ZodUnion<[..., ...]>; sharesBps: ZodNumber }, { address: ZodUnion<[..., ...]>; sharesBps: ZodNumber }>, "strip", ZodTypeAny, { address: string; sharesBps: number }, { address: string; sharesBps: number }>, "many"> }>, "strip", ZodUnknown, objectOutputType<extendShape<extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<..., ..., ...>, ZodType<..., ..., ...>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { image: ZodOptional<ZodString> }>, { recipients: ZodArray<ZodObject<extendShape<{ address: ZodUnion<...>; sharesBps: ZodNumber }, { address: ZodUnion<...>; sharesBps: ZodNumber }>, "strip", ZodTypeAny, { address: string; sharesBps: number }, { address: string; sharesBps: number }>, "many"> }>, ZodUnknown, "strip">, objectInputType<extendShape<extendShape<{ app_uri: ZodOptional<ZodString>; defaultAdmin: ZodOptional<ZodUnion<[ZodType<..., ..., ...>, ZodType<..., ..., ...>]>>; description: ZodOptional<ZodString>; external_link: ZodOptional<ZodString>; image: ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>; name: ZodString; social_urls: ZodOptional<ZodRecord<ZodString, ZodString>> }, { image: ZodOptional<ZodString> }>, { recipients: ZodArray<ZodObject<extendShape<{ address: ZodUnion<...>; sharesBps: ZodNumber }, { address: ZodUnion<...>; sharesBps: ZodNumber }>, "strip", ZodTypeAny, { address: string; sharesBps: number }, { address: string; sharesBps: number }>, "many"> }>, ZodUnknown, "strip">> }>
let contractRoles: readonly ["admin"];
let chainId: number;