@circle-fin/usdckit - v0.18.0
    Preparing search index...

    Function transfer

    • Transfers tokens or native currency from one account to another.

      Parameters

      Returns Promise<TransferReturnType>

      An array of transfer return types containing transaction hashes.

      Transferring native tokens

      await client.transfer({
      from: '0x0000000000000000000000000000000000000000',
      to: '0x0000000000000000000000000000000000000000',
      amount: 1n,
      })

      Transferring USDC tokens on default chain

      await client.transfer({
      from: '0x0000000000000000000000000000000000000000',
      to: '0x0000000000000000000000000000000000000000',
      amount: 1n,
      token: client.chain.contracts.USDC,
      })

      Specifying gas fees. Default is to use HIGH fee level

      await client.transfer({
      from: '0x0000000000000000000000000000000000000000',
      to: '0x0000000000000000000000000000000000000000',
      amount: 1n,
      gas: 100n,
      fees: { maxFeePerGas: 200n, maxPriorityFeePerGas: 300n },
      })

      Usage with FEE_LEVEL

      await client.transfer({
      from: '0x0000000000000000000000000000000000000000',
      to: '0x0000000000000000000000000000000000000000',
      amount: 1n,
      fees: FEE_LEVEL('LOW'),
      })

      Transfer USDC cross-chain using CCTP

      const [ account_1 ] = await client.getAccounts({ address: '0x123', chain: ETH_SEPOLIA })
      const [ account_2 ] = await client.getAccounts({ address: '0x321', chain: MATIC_AMOY })

      await client.transfer({
      from: account_1,
      to: account_2,
      amount: '20',
      token: ETH_SEPOLIA.contracts.USDC,
      })