Acala Wiki
LearnBuildMaintain
  • Acala & Karura Wiki
  • Acala 2.0
    • Overview
    • Execution Roadmap
    • aUSD SEED (aSEED)
      • aSEED Integration Guide
    • ACA
      • ACA/KAR Staking
    • Universal Asset Hub (UAH)
    • Euphrates DApp
  • Learn
    • Acala Introduction
      • Acala Dollar
      • AcalaSwap
      • Homa Liquid Staking
      • Redenomination of ACA
    • Trilogy Networks
    • Flexible Fees
      • How to change default fee token
    • Governance Overivew
      • Participate in Democracy
      • How to Verify a Runtime Upgrade
      • How to Verify Referendum Proposal
    • Treasury
    • Acala EVM+
      • Why Acala EVM+
      • Existing Solutions
      • Acala EVM+
        • Composable DeFi Stack
        • Flexible Fees
        • EVM Account
        • On-chain Scheduler
        • Queryable & Lightweight
        • Upgradable Contracts
        • Compatible Toolings
        • No Dust Account
      • How does it work?
  • Get started
    • Acala Network
      • Acala Launch Phases
      • Wallet & Account
        • Account Generation
          • Polkadot{.js} Browser Extension
          • Polkawallet Mobile App
          • Ledger Hardware Wallet
        • Exchange Withdraw/Deposit
        • Balance Type and Vesting
        • Check Address for Different Chains
      • Acala's DOT Bridge
      • Acala Assets
      • Governance
      • Acala Web Apps
      • Acala Mobile
    • Karura Network
      • Karura Launch Phases
      • Check Distribution
      • Wallets & Account
        • Account Generation
          • Polkadot{.js} Browser Extension
          • Polkawallet Mobile App
          • Ledger Hardware Wallet
        • Exchange Withdraw/Deposit
        • Balance Type & Vesting
        • Check Address for Different Chains
      • Inter Kusama Transfer
      • Karura Assets
      • Karura Web Apps
      • Governance
      • Transaction Fees
    • Mandala Testnet
  • Integrate
    • Acala Network
      • Protocol Info
      • Token Transfer
      • Node Interaction
      • Full Node
      • Collator
    • Karura Network
      • Protocol Info
      • Token Transfer
      • Node Interaction
      • Full Node
      • Collator
  • Build
    • EVM+ documentation
    • SDKs
      • Acala Stablecoin
      • Homa Liquid Staking
      • AcalaSwap
      • Homa Staking
    • Guides
      • Node Interaction
      • Transaction Construction
    • Build DApps
      • Deploy Ecosystem Modules
      • Composable Chains
        • Open HRMP Channel
        • Bridge Tokens
        • Cross-chain Listing
      • Open-Web3-Stack & ORML
      • Smart Contracts
        • Acala EVM Overview
        • Get Started
          • Connect to a Node
            • Use MetaMask with EVM+
          • Setup EVM Account
          • Polkadot Explorer
          • EVM Playground
          • Use Remix
          • Use Waffle
          • Use Hardhat
          • Deploy Contracts
        • Advanced
          • Use Native & Cross-chain Tokens
          • Use On-chain Scheduler
            • Tutorial
          • Use Oracle Feeds
          • Upcoming Features
        • Acala EVM Hacker Guide
          • Try Acala DApp
    • Tools
    • Indexers
      • SubQuery
    • Miscellaneous
      • Runtime Events
      • Modules
    • Cross Chain DeFi
  • Ecosystem
    • General Info
    • Alliance
    • Community
    • Contribution & Rewards
      • Acala Old Friend NFT
    • Ecosystem
    • Media Kits
    • Ledger Generic App Migration
  • Crowdloans
    • What are crowdloans
    • Acala Crowdloan
      • Crowdloan Event
      • Crowdloan Rewards
      • Claim ACA
      • How to Crowdloan
      • FAQ
      • Acala Quests
        • Attaching Polkawallet to Polkadot.js Extension
      • DOT Address
        • Creating a New DOT Account
        • Becoming a DOT Holder
        • Unstaking Your DOT
          • Unstaking Your DOT Tokens on Polkadot.{js} Extension
          • Unstaking Your DOT Tokens on Polkawallet
    • Karura Crowdloan
      • Crowdloan Event
      • Crowdloan Rewards
      • Claim KAR
      • How to Crowdloan
      • FAQ
      • KSM Address
        • Creating a New KSM Account
        • Check KSM Address
        • Unstaking Your KSM
          • Unstaking Your KSM Tokens on Polkawallet
          • Unstaking Your KSM Tokens on Polkadot.{js} Extension
      • Finding Tokens and NFTs
  • Misc
    • aUSD Incident
    • Contributing
    • Glossary
Powered by GitBook
On this page
  • Token Types
  • Token
  • DexShare
  • Erc20
  • LiquidCrowdloan
  • ForeignAsset
  • Query token's metadata on assetRegistry
  • Tools
  • Token balances
  • Native token (ACA) balances
  • Other tokens
  • Send Tokens
  • Transactions
  • Receive Tokens
  • Monitor Events
  • Storage changes RPC
  • Monitor Transactions
  • Transfer Code Samples

Was this helpful?

Edit on GitHub
  1. Integrate
  2. Acala Network

Token Transfer

PreviousProtocol InfoNextNode Interaction

Last updated 1 year ago

Was this helpful?

Acala supports different types of tokens than Polkadot, and allows various ways to transfer tokens. This guide will walk through tokens available on Acala, tools can be used for transfers, how to send transfer transactions, monitor and track these transactions.

Token Types

Token

Symbol
Description
CurrencyId
Decimals
Minimal Balance

ACA

native token of Acala network

Token(ACA)

12

0.1 ACA

aSEED

multi-collateralized stablecoin

Token(AUSD)

12

0.1 aUSD

DOT

crossed to Acala from Polkadot Relay Chain

Token(DOT)

10

0.01 DOT

LDOT

tokenized staked DOT from the Liquid Staking protocol

Token(LDOT)

10

0.05 LDOT

aUSD is converted to on July 20 2023

AssetRegistry registered the metadata info of this type token.

DexShare

The lp share token for the trading pair of Acala DEX. The CurrencyId type of Acala DEX's lp token are CurrencyId::DexShare, and the decimals and minimal balance of lp token are same as the first token in DexShare. For example, CurrencyId::DexShare(Token(ACA), Token(AUSD)) is the CurrencyId of lp token of ACA/aSEED pair, its decimal is 12, and minimal balance is 0.1, these are same as ACA.

Currently, AssetRegistry does not register metadata info of any lp token.

Erc20

Token issued by ERC20 contracts deployed in Acala EVM+. The CurrencyId type is Erc20(Address), Address is the ERC20 contract address on EVM+.

LiquidCrowdloan

Symbol
Description
CurrencyId
Decimals
Minimal Balance

LcDOT

tokenized liquid receipt of crowdloaned DOT

LiquidCrowdloan(13)

10

0.01 LcDOT

AssetRegistry registered the metadata info of this type token.

ForeignAsset

Tokens originated from other parachains.

AssetRegistry registered the metadata info of this type token.

Query token's metadata on assetRegistry

Tools

Token balances

Query chain state to get token balances.

Native token (ACA) balances

Query system module to get native token (ACA) balances data.

system.account

  • Returns the AccountInfo of given account. For different types of balances, check the fields in AccountInfo.data

    • free: the free balance.

    • reserve: the reserved balance.

Other tokens

For non-native tokens, like DOT, LDOT, aUSD, query tokens module to get balances info.

tokens.accounts

  • Returns the OrmlAccountData of given account and currency ID. For different types of balances, check the fields:

    • free: the free balance.

    • reserved: the reserved balance.

tokens.lock

  • Returns the BalanceLock of given account and currency ID. BalanceLock has two fields:

    • id: the lock identifier.

    • amount. the locked amount.

  • Note locks could be overlapped, and the same amount of tokens could be under locked by multiple locks.

Send Tokens

Transactions

currencies.transfer

  • This can be used to send any supported tokens in the network, including ACA, DOT, LDOT, LCDOT, aUSD etc.

currencies.transferNativeCurrency

  • This can be used to send native token (ACA). It has slightly cheaper transaction fees compare to currencies.transfer

balances.transfer

  • Same as currencies.transferNativeCurrency, only for native token (ACA).

  • Compatible with Polkadot / Polkadot and most other Substrate-based chains.

xtokens transfer by XCM

  • xtokens transfer functions: xtokens.transfer xtokens.transfer_multiasset xtokens.transfer_with_fee

    xtokens.transfer_multiasset_with_fee

    xtokens.transfer_multicurrencies

    xtokens.transfer_multiassets

  • Can be used to send any supported tokens in the source and destination networks, including ERC20 tokens.

Receive Tokens

There are multiple ways to detect incoming balance transfers:

  • Monitor events

  • Subscribe storage changes

  • Monitor transactions

Monitor Events

Monitoring events is a recommended way to track incoming balance transfers. It can handle ALL types of transfer transactions including the one that is not initiated by a transaction directly (e.g. delayed proxy).

balances.transfer

  • Emitted when a native token (ACA) transfer happened.

currencies.transfer

  • Emitted when a token transfer happened.

  • NOTE: This is not emitted when balances.transfer is used to make a transfer.

currencies.deposit

  • Emitted when a token is minted to an account. This could happen when it is a cross-chain transfer or it is a transaction minting stablecoins.

xtokens.transferredmultiassets

  • Emitted when a cross-chain transfer happened from Karura to other chains.

  • Triggered byxtokens.transfer, xtokens.transfer_multiasset, xtokens.transfer_with_fee, xtokens.transfer_multiasset_with_fee, xtokens.transfer_multicurrencies, xtokens.transfer_multiassets extrinsics .

Storage changes RPC

    • Subscribe to a list of account balances. However, it does not guarantee subscription delivery due to connection errors or blockchain reorg.

Monitor Transactions

It is possible to fetch transactions in every block, check for transfer transactions, and check if the transfer transaction is successful. However, this may likely yield false-negative results i.e. deposit received but failed to recognize, due to the various ways for transfer.

Refer to Send Tokens section for direct transfer transactions. In additional, to sending transfer transactions individually, there are common utility methods to batch send transfer transactions:

utility.batch

  • This can be used to send batch transaction

  • NOTE: batched transactions will always emit success events.

    • utility.BatchCompleted event indicates that all transactions are successful

    • utility.BatchInterrupted event indicates which transaction failed. Transactions before the failed transaction are executed successfully and will not be reverted.

utility.batchAll

  • This is similar to utility.batch but will revert all transactions upon failed transaction.

JS/TS SDK:

Blockchain explorer:

api-sidecar:

txwrapper:

SubQuery:

ORML's supports token transfer by cross-consensus messages (XCM), and has a number of dispatchable functions to support different use cases.

For cross-chain transfer, there would be ExecutedDownward event along with the deposit.

aSEED
https://github.com/AcalaNetwork/acala.js
http://acala.subscan.io
https://github.com/paritytech/substrate-api-sidecar
https://github.com/AcalaNetwork/txwrapper
https://github.com/AcalaNetwork/acala-subql-services
https://acala.subscan.io/extrinsic?module=Currencies&call=transfer
https://acala.subscan.io/extrinsic?module=Currencies&call=transfer_native_currency
https://acala.subscan.io/extrinsic?module=Balances&call=transfer
Xtokens Module
https://acala.subscan.io/extrinsic?address=&module=xtokens
https://acala.subscan.io/event?module=Balances&event=Transfer
https://acala.subscan.io/event?module=Currencies&event=Transferred
https://acala.subscan.io/event?module=Currencies&event=Deposited
https://acala.subscan.io/event?address=&module=dmpqueue&event=executeddownward
https://acala.subscan.io/event?address=&module=xtokens&event=transferredmultiassets
state_subscribeStorage
https://acala.subscan.io/extrinsic?module=Utility&call=batch
https://acala.subscan.io/extrinsic?module=Utility&call=batch_all
Transfer Code Samples
query asset metadata