Cross-chain Metaspace Interface
Import Public Chain AssetsTry API
POST
chain_dexSwap
(Import Public Chain Assets)
description:The import process transfers assets from the local public-chain account address to the VoidChain public-chain robot address, and maps the asset in the cross-chain metaspace. Public-chain asset imports use unified parameters.
Importing public chain assets is serialized per user. Only one import can be in progress at a time; wait until the previous import finishes.
Parameters
chain: public chainname
Content: importcontent, withbase64 encoded
{
"chain_symbol": "ETH",//importchainID
"coin_symbol": "USDT", //importcoinID
"coin_name": "USDT", //importcoinname
"amount": "0x333", //amount
"remote_rpc": "https://holesky.gateway.tenderly.co"
}
forjsonperformbase64encoded
Example Code
{
"jsonrpc": "3.0",
"method": "chain_dexSwap",
"params": [
"opcode=Assets&subcode=Import&content=",
"encryp=none"
],
"id": "aa80aa0c6bb0c7d81ac7e5b3"
}Import is an asynchronous task. Query import status periodically to confirm the result.