CDP SDK TypeScript - v1.31.0
    Preparing search index...

    Type Alias Actions

    type Actions = {
        listTokenBalances: (
            options: Omit<ListTokenBalancesOptions, "address">,
        ) => Promise<ListTokenBalancesResult>;
        requestFaucet: (
            options: Omit<RequestFaucetOptions, "address">,
        ) => Promise<RequestFaucetResult>;
        quoteFund: (
            options: Omit<EvmQuoteFundOptions, "address">,
        ) => Promise<EvmQuote>;
        fund: (
            options: Omit<EvmFundOptions, "address">,
        ) => Promise<FundOperationResult>;
        waitForFundOperationReceipt(
            options: WaitForFundOperationOptions,
        ): Promise<WaitForFundOperationResult>;
    }
    Index

    Properties

    listTokenBalances: (
        options: Omit<ListTokenBalancesOptions, "address">,
    ) => Promise<ListTokenBalancesResult>

    List the token balances of an account.

    Type declaration

      • (
            options: Omit<ListTokenBalancesOptions, "address">,
        ): Promise<ListTokenBalancesResult>
      • Parameters

        • options: Omit<ListTokenBalancesOptions, "address">

          The options for the list token balances.

          • network

            The network to list the token balances on.

        Returns Promise<ListTokenBalancesResult>

        The result of the list token balances.

    const balances = await account.listTokenBalances({
    network: "base-sepolia",
    });
    requestFaucet: (
        options: Omit<RequestFaucetOptions, "address">,
    ) => Promise<RequestFaucetResult>

    Requests funds from an EVM faucet.

    Type declaration

      • (options: Omit<RequestFaucetOptions, "address">): Promise<RequestFaucetResult>
      • Parameters

        • options: Omit<RequestFaucetOptions, "address">

          Parameters for requesting funds from the EVM faucet.

          • network

            The network to request funds from.

          • token

            The token to request funds for.

          • idempotencyKey

            An idempotency key.

        Returns Promise<RequestFaucetResult>

        A promise that resolves to the transaction hash.

    const result = await account.requestFaucet({
    network: "base-sepolia",
    token: "eth",
    });
    quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>

    Gets a quote to fund an EVM account.

    Type declaration

      • (options: Omit<EvmQuoteFundOptions, "address">): Promise<EvmQuote>
      • Parameters

        • options: Omit<EvmQuoteFundOptions, "address">

          The options for the quote fund.

          • network

            The network to fund the account on.

          • token

            The token to fund the account with.

          • amount

            The amount of the token to fund represented as an atomic unit. It's common to use parseUnits utils from viem to convert to atomic units. Otherwise, you can pass atomic units directly.

        Returns Promise<EvmQuote>

        A promise that resolves to a Quote object containing details about the funding operation.

    const quote = await account.quoteFund({
    network: "base",
    token: "usdc",
    amount: 1000000n,
    });
    fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>

    Funds an EVM account with the specified token amount.

    Type declaration

      • (options: Omit<EvmFundOptions, "address">): Promise<FundOperationResult>
      • Parameters

        • options: Omit<EvmFundOptions, "address">

          The options for the fund operation.

          • network

            The network to fund the account on.

          • token

            The token to fund the account with (e.g., 'usdc').

          • amount

            The amount of the token to fund represented as an atomic unit. It's common to use parseUnits utils from viem to convert to atomic units. Otherwise, you can pass atomic units directly.

        Returns Promise<FundOperationResult>

        A promise that resolves to the fund operation result containing the transfer details.

    const fundOperation = await account.fund({
    network: "base",
    token: "usdc",
    amount: 1000000n,
    });

    Methods

    • Waits for a fund operation to complete and returns the transfer receipt.

      Parameters

      • options: WaitForFundOperationOptions

        The options for the wait for fund operation.

        • transferId

          The ID of the transfer to wait for.

      Returns Promise<WaitForFundOperationResult>

      A promise that resolves to the completed transfer receipt containing details about the funding operation.

      const completedTransfer = await account.waitForFundOperationReceipt({
      transferId: "transfer_123",
      });