Etherspot
These are our V1 docs and will be deprecated soon. Please visit https://etherspot.fyi/introduction to use our new version of the SDK.
  • Welcome to Etherspot
    • Chains, Bridges & DEXes
    • Social Logins
    • Web3 Logins
  • Transaction Kit
    • Introduction
    • Code Sandboxes
    • Quick Start
    • React Hooks
      • useEtherspotAssets()
      • useEtherspotNfts()
      • useEtherspotHistory()
        • getAccountTransactions()
        • getAccountTransaction()
      • useEtherspotTransactions()
        • estimate()
        • send()
      • useEtherspotAddresses()
      • useEtherspotBalances()
    • React Components
      • <EtherspotTransactionKit />
      • <EtherspotBatches />
      • <EtherspotBatch />
      • <EtherspotTransaction />
      • <EtherspotContractTransaction />
      • <EtherspotApprovalTransaction />
      • <EtherspotTokenTransferTransaction />
  • BUIDLER React Component
    • Introduction
    • Installation
    • Integrate React Component
    • Shared Sessions
    • Wallet Connectors
    • Blocks
      • Send
      • Batching Transaction
      • Multicall Transaction
      • Swaps
      • Bridges
      • Custom Contract Interactions
      • Styling
    • Build Your Own Block
      • Cross-chain KLIMA DAO Staking
  • Etherspot SDK Guides
    • Requirements
    • Install Etherspot SDK
    • Bootstrap Etherspot SDK
      • Instantiate Etherspot SDK
    • Events
    • Etherspot Block Explorer
    • Etherspot Playground
    • Social Login using Etherspot SDK
    • Sponsored Transactions
  • Use Cases & Guides
    • Crosschain Streaming
    • Token Swaps
    • Transactions
      • Historical
      • Sending
    • Multi-chain Bridges
      • ERC20 Bridge
      • DAI - xDai Bridge
      • xDai - DAI Bridge
      • Native Token Bridge
    • Custom Contract Interaction
    • Multi-chain Assets
    • Multi-chain Gas Prices
    • Peer-to-Peer Payments
  • Reference
    • Etherspot SDK API Docs
    • Etherspot SDK on Github
    • Etherspot on NPM
    • Etherspot Playground
    • Etherspot Block Explorer
    • Etherspot Architecture
    • EIP-1271
    • Etherspot/Pillar Audit
  • Brand Assets
    • Etherspot Brand Assets
  • Security
    • Security
  • Get in touch
    • ⚒️Discord
    • Twitter
    • Telegram
Powered by GitBook
On this page
  • Introduction
  • Component Properties
  • How to use
  • Congratulations!

Was this helpful?

  1. Transaction Kit
  2. React Components

<EtherspotTokenTransferTransaction />

Introduction

The <EtherspotTokenTransferTransaction /> React Component helps you facilitate the transfer of an asset (such as PLR. USDC or SHIB) to another account.

You just need to provide the token address, the destination address and the amount of tokens you want to transfer to the destination address, and we'll take it from there.

About token addresses

Remember to research the correct token address on the correct blockchain you are sending to. Do not send tokens to another blockchain as it will be lost.

Keep transfers on the same blockchain.

The <EtherspotTokenTransferTransaction /> component assumes that a transfer function exists on the Smart Contract being called.

Component Properties

Property
Description

tokenAddress

The destination token address

receiverAddress

The blockchain address that will receive the token

value

How much of the token you want to send to the receiver address

How to use

Below is an example of how to use the <EtherspotTokenTransferTransaction /> component.

// In your functional component or elsehwere
const onEstimateReceiver = (estimationData) => {
  console.log(
    'This is the cost estimate for all the batches',
    estimationData,
  );
}

// In your render or as a component...
<EtherspotBatches onEstimated={onEstimateReceiver}>
  <EtherspotBatch>
    {/*
      The following <EtherspotTokenTransferTransaction />
      component will transfer 5 USDC from the built-in
      Etherspot Smart Wallet account to the receiverAddress.
      
      In the example below:
      
      - The tokenAddress is the USDC contract address
        on Ethereum
      - The receiverAddress is the destination of the
        token amount being transferred
      - The value determines how much of the USDC is
        being transferred to the receiverAddress
    */}
    <EtherspotTokenTransferTransaction
      tokenAddress={'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'}
      receiverAddress={'0x0763d68dd586AB1DD8Be2e00c514B2ac8757453b'}
      value={'5'}
    />
    {/*
      You can add more <Etherspot*Transaction />
      components here, and they will all be executed
      together and at the same time (i.e. as part of
      this batch).
    */}
  </EtherspotBatch>
</EtherspotBatches>

And that is how we use the <EtherspotTokenTransferTransaction /> component. Transaction Kit has simplified the whole process of sending tokens to another bblockchain account.

Be sure that the the token address is the correct address for the blockchain you are working on.

Previous<EtherspotApprovalTransaction />NextIntroduction

Last updated 2 years ago

Was this helpful?

Congratulations!

🎉