Create a Drop contract for a standard crypto token or cryptocurrency.

Example

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

const sdk = new ThirdwebSDK("{{chainName}}");
const contract = await sdk.getContract("{{contract_address}}", "token-drop");

Hierarchy

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; }; });
          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<PrebuiltTokenDrop> = ...

    Returns TokenDrop

Properties

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<PrebuiltTokenDrop>
burnFrom: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Burn Tokens

      Parameters

      • Rest ...args: [holder: string, amount: string | number]

      Returns Promise<TResult>

      Remarks

      Burn tokens held by the specified wallet

      Example

      // Address of the wallet sending the tokens
      const holderAddress = "{{wallet_address}}";

      // The amount of this token you want to burn
      const amount = 1.2;

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

        • Rest ...args: [holder: string, amount: string | number]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Burn Tokens

      Parameters

      • Rest ...args: [amount: string | number]

      Returns Promise<TResult>

      Remarks

      Burn tokens held by the connected wallet

      Example

      // The amount of this token you want to burn
      const amount = 1.2;

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

        • Rest ...args: [amount: string | number]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Claim a certain amount of tokens

      Parameters

      • Rest ...args: [amount: string | number, checkERC20Allowance: any]

      Returns Promise<TResult>

      Remarks

      See TokenDrop.claimTo

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

        • Rest ...args: [amount: string | number, checkERC20Allowance: any]

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

claimConditions: DropClaimConditions<PrebuiltTokenDrop>

Configure claim conditions

Remarks

Define who can claim Tokens, when and how many.

Example

const presaleStartTime = new Date();
const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const claimConditions = [
{
startTime: presaleStartTime, // start the presale now
maxQuantity: 3117.42, // limit how many tokens are released in this presale
price: 0.001, // presale price per token
snapshot: ['0x...', '0x...'], // limit claiming to only certain addresses
},
{
startTime: publicSaleStartTime, // 24h after presale, start public sale
price: 0.008, // public sale price per token
}
]);
await contract.claimConditions.set(claimConditions);
claimTo: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Claim a certain amount of tokens to a specific Wallet

      Parameters

      • Rest ...args: [destinationAddress: string, amount: string | number, checkERC20Allowance: any]

      Returns Promise<TResult>

      • The transaction receipt

      Remarks

      Let the specified wallet claim Tokens.

      Example

      const address = "{{wallet_address}}"; // address of the wallet you want to claim the NFTs
      const quantity = 42.69; // how many tokens you want to claim

      const tx = await contract.claimTo(address, quantity);
      const receipt = tx.receipt; // the transaction receipt
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [destinationAddress: string, amount: string | number, checkERC20Allowance: any]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Alpha

      Lets you delegate your voting power to the delegateeAddress

      Parameters

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

      Returns Promise<TResult>

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

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

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

encoder: ContractEncoder<PrebuiltTokenDrop>
erc20: Erc20<PrebuiltTokenDrop>
estimator: GasCostEstimator<PrebuiltTokenDrop>
events: ContractEvents<PrebuiltTokenDrop>
metadata: ContractMetadata<PrebuiltTokenDrop, {
    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]>>;
        merkle: ZodDefault<ZodRecord<ZodString, ZodString>>;
        name: ZodString;
        platform_fee_basis_points: ZodDefault<ZodNumber>;
        platform_fee_recipient: ZodDefault<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>>;
        primary_sale_recipient: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        symbol: ZodDefault<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;
        merkle: Record<string, string>;
        name: string;
        platform_fee_basis_points: number;
        platform_fee_recipient: string;
        primary_sale_recipient: string;
        social_urls?: Record<string, string>;
        symbol: string;
        trusted_forwarders: string[];
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        merkle?: Record<string, string>;
        name: string;
        platform_fee_basis_points?: number;
        platform_fee_recipient?: string;
        primary_sale_recipient: string;
        social_urls?: Record<string, string>;
        symbol?: 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]>>;
        merkle: ZodDefault<ZodRecord<ZodString, ZodString>>;
        name: ZodString;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        symbol: ZodDefault<ZodString>;
    }, "strip", ZodTypeAny, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        merkle: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol: string;
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        merkle?: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol?: string;
    }>;
    output: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        merkle: ZodDefault<ZodRecord<ZodString, ZodString>>;
        name: ZodString;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        symbol: ZodDefault<ZodString>;
    }, "strip", ZodTypeAny, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: string;
        merkle: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol: string;
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: string;
        merkle?: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol?: string;
    }>;
}>

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]>>;
        merkle: ZodDefault<ZodRecord<ZodString, ZodString>>;
        name: ZodString;
        platform_fee_basis_points: ZodDefault<ZodNumber>;
        platform_fee_recipient: ZodDefault<ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>>;
        primary_sale_recipient: ZodUnion<[ZodType<string, ZodTypeDef, string>, ZodType<`0x${string}`, ZodTypeDef, `${string}.eth` | `${string}.cb.id`>]>;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        symbol: ZodDefault<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;
        merkle: Record<string, string>;
        name: string;
        platform_fee_basis_points: number;
        platform_fee_recipient: string;
        primary_sale_recipient: string;
        social_urls?: Record<string, string>;
        symbol: string;
        trusted_forwarders: string[];
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        merkle?: Record<string, string>;
        name: string;
        platform_fee_basis_points?: number;
        platform_fee_recipient?: string;
        primary_sale_recipient: string;
        social_urls?: Record<string, string>;
        symbol?: 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]>>;
        merkle: ZodDefault<ZodRecord<ZodString, ZodString>>;
        name: ZodString;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        symbol: ZodDefault<ZodString>;
    }, "strip", ZodTypeAny, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        merkle: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol: string;
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: any;
        merkle?: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol?: string;
    }>
  • output: ZodObject<{
        app_uri: ZodOptional<ZodString>;
        description: ZodOptional<ZodString>;
        external_link: ZodOptional<ZodString>;
        image: ZodOptional<ZodString>;
        merkle: ZodDefault<ZodRecord<ZodString, ZodString>>;
        name: ZodString;
        social_urls: ZodOptional<ZodRecord<ZodString, ZodString>>;
        symbol: ZodDefault<ZodString>;
    }, "strip", ZodTypeAny, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: string;
        merkle: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol: string;
    }, {
        app_uri?: string;
        description?: string;
        external_link?: string;
        image?: string;
        merkle?: Record<string, string>;
        name: string;
        social_urls?: Record<string, string>;
        symbol?: string;
    }>
platformFees: ContractPlatformFee<PrebuiltTokenDrop>
roles: ContractRoles<PrebuiltTokenDrop, "transfer" | "admin">
setAllowance: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Allows the specified spender wallet to transfer the given amount of tokens to another wallet

      Parameters

      • Rest ...args: [spender: string, amount: string | number]

      Returns Promise<TResult>

      Example

      // Address of the wallet to allow transfers from
      const spenderAddress = "0x...";
      // The number of tokens to give as allowance
      const amount = 100
      await contract.setAllowance(spenderAddress, amount);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [spender: string, amount: string | number]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Transfer Tokens

      Parameters

      • Rest ...args: [to: string, amount: string | number]

      Returns Promise<TResult>

      Remarks

      Transfer tokens from the connected wallet to another wallet.

      Example

      // Address of the wallet you want to send the tokens to
      const toAddress = "0x...";
      // The amount of tokens you want to send
      const amount = 0.1;
      await contract.transfer(toAddress, amount);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [to: string, amount: string | number]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Transfer Tokens To Many Wallets

      Parameters

      • Rest ...args: [args: {
            amount: string | number;
            toAddress: string;
        }[]]

      Returns Promise<TResult>

      Remarks

      Mint tokens from the connected wallet to many wallets

      Example

      // Data of the tokens you want to mint
      const data = [
      {
      toAddress: "{{wallet_address}}", // Address to mint tokens to
      amount: 100, // How many tokens to mint to specified address
      },
      {
      toAddress: "0x...",
      amount: 100,
      }
      ]

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

        • Rest ...args: [args: {
              amount: string | number;
              toAddress: string;
          }[]]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Transfer Tokens From Address

      Parameters

      • Rest ...args: [from: string, to: string, amount: string | number]

      Returns Promise<TResult>

      Remarks

      Transfer tokens from one wallet to another

      Example

      // Address of the wallet sending the tokens
      const fromAddress = "{{wallet_address}}";
      // Address of the wallet you want to send the tokens to
      const toAddress = "0x...";
      // The number of tokens you want to send
      const amount = 1.2
      // Note that the connected wallet must have approval to transfer the tokens of the fromAddress
      await contract.transferFrom(fromAddress, toAddress, amount);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [from: string, to: string, amount: string | number]

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

contractRoles: readonly ["admin", "transfer"] = TOKEN_DROP_CONTRACT_ROLES

Accessors

Methods

  • Get Token Allowance

    Parameters

    • spender: string

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

    The allowance of one wallet over anothers funds.

    Remarks

    Get the allowance of a 'spender' wallet over the connected wallet's funds - the allowance of a different address for a token is the amount of tokens that the spender wallet is allowed to spend on behalf of the connected wallet.

    Example

    // Address of the wallet to check token allowance
    const spenderAddress = "0x...";
    const allowance = await contract.allowance(spenderAddress);
  • Get Token Allowance

    Parameters

    • owner: string
    • spender: string

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

    The allowance of one wallet over anothers funds.

    Remarks

    Get the allowance of one wallet over another wallet's funds - the allowance of a different address for a token is the amount of tokens that the wallet is allowed to spend on behalf of the specified wallet.

    Example

    // Address of the wallet who owns the funds
    const owner = "{{wallet_address}}";
    // Address of the wallet to check token allowance
    const spender = "0x...";
    const allowance = await contract.allowanceOf(owner, spender);
  • Get Token Balance for the currently connected wallet

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

    The balance of a specific wallet.

    Remarks

    Get a wallets token balance.

    Example

    const balance = await contract.balance();
    
  • Get Token Balance

    Parameters

    • address: string

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

    The balance of a specific wallet.

    Remarks

    Get a wallets token balance.

    Example

    // Address of the wallet to check token balance
    const walletAddress = "{{wallet_address}}";
    const balance = await contract.balanceOf(walletAddress);
  • Get the token Metadata (name, symbol, etc...)

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

    The token metadata

    Example

    const token = await contract.get();
    
  • Get your wallet voting power for the current checkpoints

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

    the amount of voting power in tokens

  • Parameters

    • account: string

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

  • The total supply for this token

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

    Remarks

    Get how much supply has been minted

    Example

    const balance = await contract.totalSupply();
    

Generated using TypeDoc