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");

Hierarchy

  • Split

Implements

  • UpdateableNetwork

Constructors

  • Parameters

    • network: NetworkInput
    • address: string
    • storage: ThirdwebStorage<IpfsUploadBatchOptions>
    • options: undefined | {
          clientId?: string;
          gasSettings?: { maxPriceInGwei?: number | undefined; speed?: "standard" | "fast" | "fastest" | undefined; };
          gasless?: ({ openzeppelin: { relayerUrl: string; relayerForwarderAddress?: string | undefined; useEOAForwarder?: boolean | undefined; domainName?: string | undefined; domainVersion?: string | undefined; }; experimentalChainlessSupport?: boolean | undefined; }) | ({ biconomy: { apiId: string; apiKey: string; deadlineSeconds?: number | undefined; }; }) | ({ engine: { relayerUrl: string; }; });
          gatewayUrls?: string[];
          readonlySettings?: { rpcUrl: string; chainId?: number | undefined; };
          secretKey?: string;
          supportedChains?: ({ rpc: string[]; chainId: number; nativeCurrency: { symbol: string; name: string; decimals: number; }; slug: string; })[];
      } = {}
    • abi: objectInputType<{
          inputs: ZodDefault<ZodArray<ZodObject<{
              components: ZodOptional<ZodArray<ZodObject<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, "strip", ZodAny, objectOutputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">, objectInputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">>, "many">>;
              name: ZodDefault<ZodString>;
              stateMutability: ZodOptional<ZodString>;
              type: ZodString;
          }, "strip", ZodAny, objectOutputType<{
              components: ZodOptional<ZodArray<ZodObject<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, "strip", ZodAny, objectOutputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">, objectInputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">>, "many">>;
              name: ZodDefault<ZodString>;
              stateMutability: ZodOptional<ZodString>;
              type: ZodString;
          }, ZodAny, "strip">, objectInputType<{
              components: ZodOptional<ZodArray<ZodObject<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, "strip", ZodAny, objectOutputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">, objectInputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">>, "many">>;
              name: ZodDefault<ZodString>;
              stateMutability: ZodOptional<ZodString>;
              type: ZodString;
          }, ZodAny, "strip">>, "many">>;
          name: ZodDefault<ZodString>;
          outputs: ZodDefault<ZodArray<ZodObject<{
              components: ZodOptional<ZodArray<ZodObject<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, "strip", ZodAny, objectOutputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">, objectInputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">>, "many">>;
              name: ZodDefault<ZodString>;
              stateMutability: ZodOptional<ZodString>;
              type: ZodString;
          }, "strip", ZodAny, objectOutputType<{
              components: ZodOptional<ZodArray<ZodObject<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, "strip", ZodAny, objectOutputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">, objectInputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">>, "many">>;
              name: ZodDefault<ZodString>;
              stateMutability: ZodOptional<ZodString>;
              type: ZodString;
          }, ZodAny, "strip">, objectInputType<{
              components: ZodOptional<ZodArray<ZodObject<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, "strip", ZodAny, objectOutputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">, objectInputType<{
                  name: ZodDefault<ZodString>;
                  type: ZodString;
              }, ZodAny, "strip">>, "many">>;
              name: ZodDefault<ZodString>;
              stateMutability: ZodOptional<ZodString>;
              type: ZodString;
          }, ZodAny, "strip">>, "many">>;
          type: ZodString;
      }, ZodAny, "strip">[]
    • chainId: number
    • contractWrapper: ContractWrapper<Split> = ...

    Returns Split

Properties

_chainId: number
abi: objectOutputType<{
    inputs: ZodDefault<ZodArray<ZodObject<{
        components: ZodOptional<ZodArray<ZodObject<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, "strip", ZodAny, objectOutputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">, objectInputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">>, "many">>;
        name: ZodDefault<ZodString>;
        stateMutability: ZodOptional<ZodString>;
        type: ZodString;
    }, "strip", ZodAny, objectOutputType<{
        components: ZodOptional<ZodArray<ZodObject<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, "strip", ZodAny, objectOutputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">, objectInputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">>, "many">>;
        name: ZodDefault<ZodString>;
        stateMutability: ZodOptional<ZodString>;
        type: ZodString;
    }, ZodAny, "strip">, objectInputType<{
        components: ZodOptional<ZodArray<ZodObject<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, "strip", ZodAny, objectOutputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">, objectInputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">>, "many">>;
        name: ZodDefault<ZodString>;
        stateMutability: ZodOptional<ZodString>;
        type: ZodString;
    }, ZodAny, "strip">>, "many">>;
    name: ZodDefault<ZodString>;
    outputs: ZodDefault<ZodArray<ZodObject<{
        components: ZodOptional<ZodArray<ZodObject<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, "strip", ZodAny, objectOutputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">, objectInputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">>, "many">>;
        name: ZodDefault<ZodString>;
        stateMutability: ZodOptional<ZodString>;
        type: ZodString;
    }, "strip", ZodAny, objectOutputType<{
        components: ZodOptional<ZodArray<ZodObject<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, "strip", ZodAny, objectOutputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">, objectInputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">>, "many">>;
        name: ZodDefault<ZodString>;
        stateMutability: ZodOptional<ZodString>;
        type: ZodString;
    }, ZodAny, "strip">, objectInputType<{
        components: ZodOptional<ZodArray<ZodObject<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, "strip", ZodAny, objectOutputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">, objectInputType<{
            name: ZodDefault<ZodString>;
            type: ZodString;
        }, ZodAny, "strip">>, "many">>;
        name: ZodDefault<ZodString>;
        stateMutability: ZodOptional<ZodString>;
        type: ZodString;
    }, ZodAny, "strip">>, "many">>;
    type: ZodString;
}, ZodAny, "strip">[]
app: ContractAppURI<Split>
contractWrapper: ContractWrapper<Split>
distribute: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Distribute Funds

      Parameters

      • Rest ...args: []

      Returns Promise<TResult>

      Remarks

      Distribute funds held by the contract in the native currency to all recipients.

      Example

      await contract.distribute();
      
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: []

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

distributeToken: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Distribute Funds

      Parameters

      • Rest ...args: [tokenAddress: string]

      Returns Promise<TResult>

      Remarks

      Distribute funds held by the contract in the native currency to all recipients.

      Example

      // The address of the currency to distribute funds
      const tokenAddress = "0x..."
      await contract.distributeToken(tokenAddress);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [tokenAddress: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

encoder: ContractEncoder<Split>
estimator: GasCostEstimator<Split>
events: ContractEvents<Split>
metadata: ContractMetadata<Split, {
    deploy: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        trusted_forwarders: ZodDefault<ZodArray<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>, "many">>;
    }, "strip", ZodTypeAny, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        name: string;
        recipients: {
            address: string;
            sharesBps: number;
        }[];
        social_urls?: Record<string, string>;
        trusted_forwarders: string[];
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        name: string;
        recipients?: {
            address: string;
            sharesBps: number;
        }[];
        social_urls?: Record<string, string>;
        trusted_forwarders?: string[];
    }>;
    input: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, "strip", ZodUnknown, objectOutputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">, objectInputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">>;
    output: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        name: ZodString;
        recipients: ZodArray<ZodObject<({ address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>; sharesBps: ZodNumber; }), "strip", ZodTypeAny, ({ address: string; sharesBps: number; }), ({ address: string; sharesBps: number; })>, "many">;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, "strip", ZodUnknown, objectOutputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        name: ZodString;
        recipients: ZodArray<ZodObject<({ address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>; sharesBps: ZodNumber; }), "strip", ZodTypeAny, ({ address: string; sharesBps: number; }), ({ address: string; sharesBps: number; })>, "many">;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">, objectInputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        name: ZodString;
        recipients: ZodArray<ZodObject<({ address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>; sharesBps: ZodNumber; }), "strip", ZodTypeAny, ({ address: string; sharesBps: number; }), ({ address: string; sharesBps: number; })>, "many">;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">>;
}>

Type declaration

  • deploy: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        trusted_forwarders: ZodDefault<ZodArray<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>, "many">>;
    }, "strip", ZodTypeAny, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        name: string;
        recipients: {
            address: string;
            sharesBps: number;
        }[];
        social_urls?: Record<string, string>;
        trusted_forwarders: string[];
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        name: string;
        recipients?: {
            address: string;
            sharesBps: number;
        }[];
        social_urls?: Record<string, string>;
        trusted_forwarders?: string[];
    }>
  • input: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, "strip", ZodUnknown, objectOutputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">, objectInputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
            data: ZodUnion<[ZodTypeAny, ZodString]>;
            name: ZodString;
        }, "strip", ZodTypeAny, {
            data?: any;
            name: string;
        }, {
            data?: any;
            name: string;
        }>]>, ZodString]>>;
        name: ZodString;
        recipients: ZodEffects<ZodDefault<ZodArray<ZodObject<{
            address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
            sharesBps: ZodNumber;
        }, "strip", ZodTypeAny, {
            address: string;
            sharesBps: number;
        }, {
            address: string;
            sharesBps: number;
        }>, "many">>, {
            address: string;
            sharesBps: number;
        }[], undefined | {
            address: string;
            sharesBps: number;
        }[]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">>
  • output: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        name: ZodString;
        recipients: ZodArray<ZodObject<({ address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>; sharesBps: ZodNumber; }), "strip", ZodTypeAny, ({ address: string; sharesBps: number; }), ({ address: string; sharesBps: number; })>, "many">;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, "strip", ZodUnknown, objectOutputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        name: ZodString;
        recipients: ZodArray<ZodObject<({ address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>; sharesBps: ZodNumber; }), "strip", ZodTypeAny, ({ address: string; sharesBps: number; }), ({ address: string; sharesBps: number; })>, "many">;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">, objectInputType<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        name: ZodString;
        recipients: ZodArray<ZodObject<({ address: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>; sharesBps: ZodNumber; }), "strip", ZodTypeAny, ({ address: string; sharesBps: number; }), ({ address: string; sharesBps: number; })>, "many">;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
    }, ZodUnknown, "strip">>
roles: ContractRoles<Split, "admin">
storage: ThirdwebStorage<IpfsUploadBatchOptions>
withdraw: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Withdraw Funds

      Parameters

      • Rest ...args: [walletAddress: string]

      Returns Promise<TResult>

      Remarks

      Triggers a transfer to account of the amount of native currency they are owed.

      Example

      // the wallet address that wants to withdraw their funds
      const walletAddress = "{{wallet_address}}"
      await contract.withdraw(walletAddress);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [walletAddress: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

withdrawToken: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Triggers a transfer to account of the amount of a given currency they are owed.

      Parameters

      • Rest ...args: [walletAddress: string, tokenAddress: string]

      Returns Promise<TResult>

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [walletAddress: string, tokenAddress: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

contractRoles: readonly ["admin"] = ADMIN_ROLE

Accessors

Methods

  • Get Funds owed to a particular wallet

    Parameters

    • address: string

    Returns Promise<BigNumber>

    Remarks

    Get the amount of funds in the native currency held by the contract that is owed to a specific recipient.

    Example

    // The address to check the funds of
    const address = "{{wallet_address}}";
    const funds = await contract.balanceOf(address);
    console.log(funds);
  • Returns all the recipients and their balances in the native currency.

    Returns Promise<{
        [key: string]: BigNumber;
    }>

    A map of recipient addresses to their balances in the native currency.

  • Get non-native Token Funds owed to a particular wallet

    Parameters

    • walletAddress: string
    • tokenAddress: string

    Returns Promise<{
        decimals: number;
        displayValue: string;
        name: string;
        symbol: string;
        value: BigNumber;
    }>

    Remarks

    Get the amount of funds in the non-native tokens held by the contract that is owed to a specific recipient.

    Example

    // The address to check the funds of
    const address = "{{wallet_address}}";
    // The address of the currency to check the contracts funds of
    const tokenAddress = "0x..."
    const funds = await contract.balanceOfToken(address, tokenAddress);
    console.log(funds);
  • Returns all the recipients and their balances in a non-native currency.

    Parameters

    • tokenAddress: string

      The address of the currency to check the balances in.

    Returns Promise<{
        [key: string]: CurrencyValue;
    }>

    A map of recipient addresses to their balances in the specified currency.

Generated using TypeDoc