交易所集成
本指南说明 Aptos 交易所集成的关键数据模型和操作流程。示例中的地址、私钥和金额仅用于演示;生产环境必须使用受管密钥、最小权限和独立的充值、提币风控。
本指南面向需要支持 Aptos 充值、提币、余额和交易处理的交易所。上线前请确认网络、节点提供商、密钥保管和监控策略。
生产系统应使用可靠的 Fullnode、Indexer API 与交易流服务,并实现重试、幂等处理、账本版本跟踪和告警。
Aptos 地址是 32 字节十六进制值。接收用户输入时应先规范化地址并在内部使用长格式比较。
使用 SDK 的地址类型解析并输出长地址,避免不同短地址表示导致重复账户。
示例:
import { AccountAddress } from "@aptos-labs/ts-sdk";const address = AccountAddress.from("0x1");address.toStringLong(); // 0x00000000000000000000000000000001账户由地址、认证密钥和公钥组成。账户可在首次收款时自动创建;不要把认证密钥当作不变的公钥标识。
以下示例创建账户、构造转账并等待交易提交完成:
import { Aptos, Ed25519Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
const aptos = new Aptos();const account = new Ed25519Account({privateKey: new Ed25519PrivateKey("private key")})const transaction = await aptos.transferCoinTransaction({sender: account.accountAddress, recipient: "receiver address", amount: 100000000})const pendingTransaction = await aptos.transaction.signAndSubmitTransaction({signer: account, transaction})const committedTransaction = await aptos.waitForTransaction({transactionHash: pendingTransaction.hash});Aptos 同时支持传统 Coin 和 Fungible Asset。新资产通常应优先按 Fungible Asset 标准处理,并识别已迁移的 Coin。
Coin 标准(简述)
Section titled “Coin 标准(简述)”Coin 使用模块地址、模块名和结构体名作为类型标识。
Fungible Asset 标准(简述)
Section titled “Fungible Asset 标准(简述)”Fungible Asset 通过 metadata 对象标识;余额与活动应按 metadata 地址聚合。
余额查询必须区分 Coin、Fungible Asset 与已迁移资产,并以链上最终账本状态为准。
Coin(及已迁移 Coin)余额
Section titled “Coin(及已迁移 Coin)余额”对于 Coin 及迁移中的 Coin,请结合资源和 Indexer 数据查询余额。
示例:
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.DEVNET });const aptos = new Aptos(config);
const coinType = "0x1::aptos_coin::AptosCoin";const account = "0x00000000000000000000000000000001";const [balanceStr] = await aptos.view<[string]>({ payload: { function: "0x1::coin::balance", typeArguments: [coinType], functionArguments: [account] }});const balance = parseInt(balanceStr, 10);继续参考以下示例:
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.DEVNET });const aptos = new Aptos(config);
const coinType = "0x1::aptos_coin::AptosCoin";const account = "0x00000000000000000000000000000001";const [balanceStr] = await aptos.view<[string]>({ payload: { function: "0x1::coin::balance", typeArguments: [coinType], functionArguments: [account], options: { ledgerVersion: 1_000_000 } }});const balance = parseInt(balanceStr, 10);Fungible Asset 余额
Section titled “Fungible Asset 余额”Fungible Asset 余额来自其存储对象及相应的 Indexer 记录。
示例:
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.DEVNET });const aptos = new Aptos(config);
const faMetadataAddress = "0xA";const account = "0x00000000000000000000000000000001";const [balanceStr] = await aptos.view<[string]>({ payload: { function: "0x1::primary_fungible_store::balance", typeArguments: ["0x1::object::ObjectCore"], functionArguments: [account, faMetadataAddress] }});const balance = parseInt(balanceStr, 10);继续参考以下示例:
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.DEVNET });const aptos = new Aptos(config);
const faMetadataAddress = "0xA";const account = "0x00000000000000000000000000000001";const [balanceStr] = await aptos.view<[string]>({ payload: { function: "0x1::primary_fungible_store::balance", typeArguments: ["0x1::object::ObjectCore"], functionArguments: [account, faMetadataAddress] }, options: { ledgerVersion: 1_000_000 }});const balance = parseInt(balanceStr, 10);跟踪余额变更
Section titled “跟踪余额变更”通过事件、交易变更或 Indexer 数据跟踪入账与出账。保存交易版本、事件索引和资产标识以避免重复记账。
Coin 余额变更
Section titled “Coin 余额变更”Coin 余额变更可从交易写集和事件中识别。
示例:
{ "version": "1747361321", "hash": "0x7c56ad56c7d02bb11887e535b9f1b221626d5b0d4cb5a1ffbadc358c1db515ea", "state_change_hash": "0xc901b5e9e0965201e8205977720d7dea8a3709ee0d818fd5ec752cac13eaf18a", "event_root_hash": "0x0077cb7df9db9ee7194c489db177fe9a325bcf3f1309ea99ed934085e5592041", "state_checkpoint_hash": null, "gas_used": "999", "success": true, "vm_status": "Executed successfully", "accumulator_root_hash": "0xb531e918441ff0a37b49856e0f1b80c329146461582287cf9788964d25e31a68", }继续参考以下示例:
"changes": [ { "address": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "state_key_hash": "0xb2bfa7198457291a0e582b912be2bf8577feff08e352c9f16935a55ebd202dcc", "data": { "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", "data": { "coin": { "value": "903837250" }, "deposit_events": { "counter": "10", "guid": { "id": { "addr": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "creation_num": "2" } } }, "frozen": false, "withdraw_events": { "counter": "52485", "guid": { "id": { "addr": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "creation_num": "3" } } } } }, "type": "write_resource" }, { "address": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "state_key_hash": "0xa45b7cfe18cc0ef1d6588f0f548a6a6a260d5e6bbab174507ed40cd21b7bd082", "data": { "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", "data": { "coin": { "value": "10" }, "deposit_events": { "counter": "1", "guid": { "id": { "addr": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "creation_num": "2" } } }, "frozen": false, "withdraw_events": { "counter": "0", "guid": { "id": { "addr": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "creation_num": "3" } } } } }, "type": "write_resource" }],继续参考以下示例:
{ "events": [ { "guid": { "creation_number": "3", "account_address": "0xf8e25f6c8ce40a15107fb4b4d288ca03dd434d057392f2ccb5fde505a300a0bf" }, "sequence_number": "0", "type": "0x1::coin::WithdrawEvent", "data": { "amount": "100000" } }, ] }继续参考以下示例:
{ "events": [ { "guid": { "creation_number": "0", "account_address": "0x0" }, "sequence_number": "0", "type": "0x1::coin::CoinStoreDeletion", "data": { "coin_type": "0x1::aptos_coin::AptosCoin", "deleted_deposit_event_handle_creation_number": "2", "deleted_withdraw_event_handle_creation_number": "3", "event_handle_creation_address": "0xf8e25f6c8ce40a15107fb4b4d288ca03dd434d057392f2ccb5fde505a300a0bf" } } ] }继续参考以下示例:
{ "events": [{ "guid": { "creation_number": "2", "account_address": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28" }, "sequence_number": "0", "type": "0x1::coin::DepositEvent", "data": { "amount": "10" } }] }继续参考以下示例:
{ "gas_used": "999", "max_gas_amount": "100000", "gas_unit_price": "100", "sender": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", }继续参考以下示例:
{ "version": "1747361321", "hash": "0x7c56ad56c7d02bb11887e535b9f1b221626d5b0d4cb5a1ffbadc358c1db515ea", "state_change_hash": "0xc901b5e9e0965201e8205977720d7dea8a3709ee0d818fd5ec752cac13eaf18a", "event_root_hash": "0x0077cb7df9db9ee7194c489db177fe9a325bcf3f1309ea99ed934085e5592041", "state_checkpoint_hash": null, "gas_used": "999", "success": true, "vm_status": "Executed successfully", "accumulator_root_hash": "0xb531e918441ff0a37b49856e0f1b80c329146461582287cf9788964d25e31a68", "changes": [ { "address": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "state_key_hash": "0xb2bfa7198457291a0e582b912be2bf8577feff08e352c9f16935a55ebd202dcc", "data": { "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", "data": { "coin": { "value": "903837250" }, "deposit_events": { "counter": "10", "guid": { "id": { "addr": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "creation_num": "2" } } }, "frozen": false, "withdraw_events": { "counter": "52485", "guid": { "id": { "addr": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "creation_num": "3" } } } } }, "type": "write_resource" }, { "address": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "state_key_hash": "0xa3f2635d084b3cc01ae545c96ee15901549dab594363a46bf18e3d575c83102d", "data": { "type": "0x1::account::Account", "data": { "authentication_key": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "coin_register_events": { "counter": "1", "guid": { "id": { "addr": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "creation_num": "0" } } }, "guid_creation_num": "4", "key_rotation_events": { "counter": "0", "guid": { "id": { "addr": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "creation_num": "1" } } }, "rotation_capability_offer": { "for": { "vec": [] } }, "sequence_number": "104628", "signer_capability_offer": { "for": { "vec": [] } } } }, "type": "write_resource" }, { "address": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "state_key_hash": "0xa45b7cfe18cc0ef1d6588f0f548a6a6a260d5e6bbab174507ed40cd21b7bd082", "data": { "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", "data": { "coin": { "value": "10" }, "deposit_events": { "counter": "1", "guid": { "id": { "addr": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "creation_num": "2" } } }, "frozen": false, "withdraw_events": { "counter": "0", "guid": { "id": { "addr": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "creation_num": "3" } } } } }, "type": "write_resource" }, { "address": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "state_key_hash": "0xba04f5a13812778031f67322e9801be65a846224e46f1360a6008402fcd0e0e0", "data": { "type": "0x1::account::Account", "data": { "authentication_key": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "coin_register_events": { "counter": "1", "guid": { "id": { "addr": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "creation_num": "0" } } }, "guid_creation_num": "4", "key_rotation_events": { "counter": "0", "guid": { "id": { "addr": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "creation_num": "1" } } }, "rotation_capability_offer": { "for": { "vec": [] } }, "sequence_number": "0", "signer_capability_offer": { "for": { "vec": [] } } } }, "type": "write_resource" }, { "state_key_hash": "0x6e4b28d40f98a106a65163530924c0dcb40c1349d3aa915d108b4d6cfc1ddb19", "handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca", "key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935", "value": "0x9f9835f429758d010000000000000000", "data": null, "type": "write_table_item" } ], "sender": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0", "sequence_number": "104627", "max_gas_amount": "100000", "gas_unit_price": "100", "expiration_timestamp_secs": "1727826277", "payload": { "function": "0x1::aptos_account::transfer", "type_arguments": [], "arguments": [ "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28", "10" ], "type": "entry_function_payload" }, "signature": { "public_key": "0xfd448fada2bac29c5f3213277e001ca8851d5644578e79484b0426c41357a457", "signature": "0x40d8a6ee9150aa5736bee23ce1b1b851790bc0aa7e2485c0760d5808027040a2ef4170b88962867b045197576c5e89a4c640bf43586e6b3ead2b510b59acc20a", "type": "ed25519_signature" }, "events": [ { "guid": { "creation_number": "0", "account_address": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28" }, "sequence_number": "0", "type": "0x1::account::CoinRegisterEvent", "data": { "type_info": { "account_address": "0x1", "module_name": "0x6170746f735f636f696e", "struct_name": "0x4170746f73436f696e" } } }, { "guid": { "creation_number": "3", "account_address": "0x559d4f690c683fca7c539237aa8dc4c6ec09886b7016bf66f2cdeffef55468f0" }, "sequence_number": "52484", "type": "0x1::coin::WithdrawEvent", "data": { "amount": "10" } }, { "guid": { "creation_number": "2", "account_address": "0x5d6233bb8d7f8bd714af196339e9fb3104c9d66f38867b2a0585c4f7b9d04d28" }, "sequence_number": "0", "type": "0x1::coin::DepositEvent", "data": { "amount": "10" } }, { "guid": { "creation_number": "0", "account_address": "0x0" }, "sequence_number": "0", "type": "0x1::transaction_fee::FeeStatement", "data": { "execution_gas_units": "6", "io_gas_units": "5", "storage_fee_octas": "98800", "storage_fee_refund_octas": "0", "total_charge_gas_units": "999" } } ], "timestamp": "1727825677775812", "type": "user_transaction" }Fungible Asset 余额变更
Section titled “Fungible Asset 余额变更”Fungible Asset 变更应以资产活动记录和 metadata 为准。
示例:
{ "events": [ { "type": "0x1::fungible_asset::Withdraw", "data": { "amount": "1", "store": "0x8a9d57692a9d4deb1680eaf107b83c152436e10f7bb521143fa403fa95ef76a" } }, { "type": "0x1::fungible_asset::Deposit", "data": { "amount": "1", "store": "0x8a9d57692a9d4deb1680eaf107b83c152436e10f7bb521143fa403fa95ef76a" } } ] }继续参考以下示例:
{ "changes":[ { "address": "0x8a9d57692a9d4deb1680eaf107b83c152436e10f7bb521143fa403fa95ef76a", "state_key_hash": "0x5b587931247dd5b43874ab29c3305c0ee7d26e7571fed3aea409375530e3a62c", "data": { "type": "0x1::fungible_asset::FungibleStore", "data": { "balance": "126691270443", "frozen": false, "metadata": { "inner": "0x2ebb2ccac5e027a87fa0e2e5f656a3a4238d6a48d93ec9b610d570fc0aa0df12" } } }, "type": "write_resource" }, { "address": "0x8a9d57692a9d4deb1680eaf107b83c152436e10f7bb521143fa403fa95ef76a", "state_key_hash": "0x5b587931247dd5b43874ab29c3305c0ee7d26e7571fed3aea409375530e3a62c", "data": { "type": "0x1::object::ObjectCore", "data": { "allow_ungated_transfer": false, "guid_creation_num": "1125899906842628", "owner": "0xc67545d6f3d36ed01efc9b28cbfd0c1ae326d5d262dd077a29539bcee0edce9e", "transfer_events": { "counter": "0", "guid": { "id": { "addr": "0x8a9d57692a9d4deb1680eaf107b83c152436e10f7bb521143fa403fa95ef76a", "creation_num": "1125899906842624" } } } } }, "type": "write_resource" } ] }继续参考以下示例:
{ "guid": { "creation_number": "0", "account_address": "0x0" }, "sequence_number": "0", "type": "0x1::fungible_asset::FungibleStoreDeletion", "data": { "metadata": "0x2ebb2ccac5e027a87fa0e2e5f656a3a4238d6a48d93ec9b610d570fc0aa0df12", "owner": "0xcf3906e2c9bc7e489c3b09d5ed5d90d8d403a68a50fe52932116b26e5878af26", "store": "0xa6ab8518e5f28a5f27247a895aa8b3de4a917209c6841b16187e8d64a67de242" } }已迁移到 Fungible Asset 的 Coin 余额变更
Section titled “已迁移到 Fungible Asset 的 Coin 余额变更”迁移资产可能同时出现 Coin 与 Fungible Asset 记录;应使用迁移关系避免重复入账。
示例:
address = sha3_256(0xA | coin_type | 0xFE)继续参考以下示例:
{ "version": "1642580695", "hash": "0xe67ba1c4242d5c1de42eb8419558c4edf2318e185a3940a00f4150b519d06508", "state_change_hash": "0x07c5ec97afdf731c2778fccb37fe209369b28dcf6dcf11c3cf13b83c962f7f96", "event_root_hash": "0xad349cbea90bef601dfae9df822f5698af296951fc5f94359fcacc1e69e9fa3d", "state_checkpoint_hash": null, "gas_used": "545", "success": true, "vm_status": "Executed successfully", "accumulator_root_hash": "0x88e81bde70f32a86e46b288a917a44b2868a46973fac7fad16b5e780f48b0e67", "changes": [ { "address": "0xa", "state_key_hash": "0x1db5441d8fa4229c5844f73fd66da4ad8176cb8793d8b3a7f6ca858722030043", "data": { "type": "0x1::coin::PairedCoinType", "data": { "type": { "account_address": "0x1", "module_name": "0x6170746f735f636f696e", "struct_name": "0x4170746f73436f696e" } } }, "type": "write_resource" }, { "address": "0xa", "state_key_hash": "0x1db5441d8fa4229c5844f73fd66da4ad8176cb8793d8b3a7f6ca858722030043", "data": { "type": "0x1::coin::PairedFungibleAssetRefs", "data": { "burn_ref_opt": { "vec": [ { "metadata": { "inner": "0xa" } } ] }, "mint_ref_opt": { "vec": [ { "metadata": { "inner": "0xa" } } ] }, "transfer_ref_opt": { "vec": [ { "metadata": { "inner": "0xa" } } ] } } }, "type": "write_resource" }, { "address": "0xa", "state_key_hash": "0x1db5441d8fa4229c5844f73fd66da4ad8176cb8793d8b3a7f6ca858722030043", "data": { "type": "0x1::fungible_asset::ConcurrentSupply", "data": { "current": { "max_value": "340282366920938463463374607431768211455", "value": "47948384" } } }, "type": "write_resource" }, { "address": "0xa", "state_key_hash": "0x1db5441d8fa4229c5844f73fd66da4ad8176cb8793d8b3a7f6ca858722030043", "data": { "type": "0x1::fungible_asset::Metadata", "data": { "decimals": 8, "icon_uri": "", "name": "Aptos Coin", "project_uri": "", "symbol": "APT" } }, "type": "write_resource" }, { "address": "0xa", "state_key_hash": "0x1db5441d8fa4229c5844f73fd66da4ad8176cb8793d8b3a7f6ca858722030043", "data": { "type": "0x1::object::ObjectCore", "data": { "allow_ungated_transfer": true, "guid_creation_num": "1125899906842625", "owner": "0x1", "transfer_events": { "counter": "0", "guid": { "id": { "addr": "0xa", "creation_num": "1125899906842624" } } } } }, "type": "write_resource" }, { "address": "0xa", "state_key_hash": "0x1db5441d8fa4229c5844f73fd66da4ad8176cb8793d8b3a7f6ca858722030043", "data": { "type": "0x1::primary_fungible_store::DeriveRefPod", "data": { "metadata_derive_ref": { "self": "0xa" } } }, "type": "write_resource" }, { "address": "0x7ed92ce166e251fc133f6b4d46a6b41307962e3b6864c2231110b3808648188", "state_key_hash": "0x5ce89e323a23fb5570694dfb687d474d44563638c5ef774a2364d8347f5732b8", "data": { "type": "0x1::coin::MigrationFlag", "data": { "dummy_field": false } }, "type": "write_resource" }, { "address": "0x7ed92ce166e251fc133f6b4d46a6b41307962e3b6864c2231110b3808648188", "state_key_hash": "0x5ce89e323a23fb5570694dfb687d474d44563638c5ef774a2364d8347f5732b8", "data": { "type": "0x1::fungible_asset::FungibleStore", "data": { "balance": "37949184", "frozen": false, "metadata": { "inner": "0xa" } } }, "type": "write_resource" }, { "address": "0x7ed92ce166e251fc133f6b4d46a6b41307962e3b6864c2231110b3808648188", "state_key_hash": "0x5ce89e323a23fb5570694dfb687d474d44563638c5ef774a2364d8347f5732b8", "data": { "type": "0x1::object::ObjectCore", "data": { "allow_ungated_transfer": false, "guid_creation_num": "1125899906842625", "owner": "0xa746e980ae21949a4f084db7403430f00bce3c9a1da4101ffcf0bf45ebd35e7e", "transfer_events": { "counter": "0", "guid": { "id": { "addr": "0x7ed92ce166e251fc133f6b4d46a6b41307962e3b6864c2231110b3808648188", "creation_num": "1125899906842624" } } } } }, "type": "write_resource" }, { "address": "0x8a4613c356c21a45045e06dcc404bfee363aabd65a774d4d43defd71289239b2", "state_key_hash": "0x7c2d6e31d4ac5bbf93e19412437c0c288766b240674f71f457b9e3ef68be5003", "data": { "type": "0x1::fungible_asset::FungibleStore", "data": { "balance": "10000", "frozen": false, "metadata": { "inner": "0xa" } } }, "type": "write_resource" }, { "address": "0x8a4613c356c21a45045e06dcc404bfee363aabd65a774d4d43defd71289239b2", "state_key_hash": "0x7c2d6e31d4ac5bbf93e19412437c0c288766b240674f71f457b9e3ef68be5003", "data": { "type": "0x1::object::ObjectCore", "data": { "allow_ungated_transfer": false, "guid_creation_num": "1125899906842625", "owner": "0x5", "transfer_events": { "counter": "0", "guid": { "id": { "addr": "0x8a4613c356c21a45045e06dcc404bfee363aabd65a774d4d43defd71289239b2", "creation_num": "1125899906842624" } } } } }, "type": "write_resource" }, { "address": "0xa746e980ae21949a4f084db7403430f00bce3c9a1da4101ffcf0bf45ebd35e7e", "state_key_hash": "0xfb7c1f2762da89f00a222f93bd771b478edb4361475c4a518178564be8616dd6", "data": { "type": "0x1::account::Account", "data": { "authentication_key": "0xa746e980ae21949a4f084db7403430f00bce3c9a1da4101ffcf0bf45ebd35e7e", "coin_register_events": { "counter": "14", "guid": { "id": { "addr": "0xa746e980ae21949a4f084db7403430f00bce3c9a1da4101ffcf0bf45ebd35e7e", "creation_num": "0" } } }, "guid_creation_num": "44", "key_rotation_events": { "counter": "0", "guid": { "id": { "addr": "0xa746e980ae21949a4f084db7403430f00bce3c9a1da4101ffcf0bf45ebd35e7e", "creation_num": "1" } } }, "rotation_capability_offer": { "for": { "vec": [] } }, "sequence_number": "52", "signer_capability_offer": { "for": { "vec": [] } } } }, "type": "write_resource" } ], "sender": "0xa746e980ae21949a4f084db7403430f00bce3c9a1da4101ffcf0bf45ebd35e7e", "sequence_number": "51", "max_gas_amount": "817", "gas_unit_price": "100", "expiration_timestamp_secs": "1724196316", "payload": { "function": "0x1::primary_fungible_store::transfer", "type_arguments": [ "0x1::fungible_asset::Metadata" ], "arguments": [ { "inner": "0xa" }, "0x5", "10000" ], "type": "entry_function_payload" }, "signature": { "public_key": "0x330e75a102e37270b788caee8dd819e5badedd5fa17fe9f72017732e9bb98c60", "signature": "0xd4666df2887cf2d8192230e4a03d842ea75a86ffbc46a9a16a9baede6ff646c6b2bcafc524d3a4a7a66c223b5db576beb5cfefbd549620e69097c0a364c7a800", "type": "ed25519_signature" }, "events": [ { "guid": { "creation_number": "0", "account_address": "0x0" }, "sequence_number": "0", "type": "0x1::fungible_asset::Withdraw", "data": { "amount": "10000", "store": "0x7ed92ce166e251fc133f6b4d46a6b41307962e3b6864c2231110b3808648188" } }, { "guid": { "creation_number": "0", "account_address": "0x0" }, "sequence_number": "0", "type": "0x1::fungible_asset::Deposit", "data": { "amount": "10000", "store": "0x8a4613c356c21a45045e06dcc404bfee363aabd65a774d4d43defd71289239b2" } }, { "guid": { "creation_number": "0", "account_address": "0x0" }, "sequence_number": "0", "type": "0x1::fungible_asset::Withdraw", "data": { "amount": "54500", "store": "0x7ed92ce166e251fc133f6b4d46a6b41307962e3b6864c2231110b3808648188" } }, { "guid": { "creation_number": "0", "account_address": "0x0" }, "sequence_number": "0", "type": "0x1::transaction_fee::FeeStatement", "data": { "execution_gas_units": "6", "io_gas_units": "7", "storage_fee_octas": "53240", "storage_fee_refund_octas": "0", "total_charge_gas_units": "545" } } ], "timestamp": "1724196287102837", "type": "user_transaction" }提交转账前验证地址、资产类型、余额和手续费,并在链上确认后更新内部账本。
Coin(或已迁移 Coin)转账
Section titled “Coin(或已迁移 Coin)转账”提交 Coin 转账后等待交易成功并核对实际变更。
Fungible Asset 转账
Section titled “Fungible Asset 转账”Fungible Asset 转账使用对应标准的入口函数和 metadata。
在 Devnet 或 Testnet 运行端到端测试,覆盖余额读取、充值检测、提币、失败交易和重试。
断言充值后余额和资产标识符合预期。
余额变更与转账检查
Section titled “余额变更与转账检查”确认转账双方余额变动、交易状态和事件均正确。
检查 Coin 转账
Section titled “检查 Coin 转账”创建一笔向其他账户转移 0.001 APT 的交易。交易应成功,余额应减少 0.001 APT 及相应的 Gas 费用。
检查 Fungible Asset 转账
Section titled “检查 Fungible Asset 转账”可以从测试代币水龙头为账户充值 Fungible Asset,然后将其转给其他账户。余额应根据变更正确更新,并且可以在网站上跟踪铸造记录。
稳定币地址会随网络和发行方变化。仅使用官方或发行方公布的地址,并在上线前复核。
| 代币名称 | 代币符号 | 代币地址 | 地址来源 |
|---|---|---|---|
| Tether USD | USDt | 0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b | Aptos Foundation |
| USDC | USDC | 0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b | Circle |
| Ondo US Dollar Yield | USDY | 0xcfea864b32833f157f042618bd845145256b1bf4c0da34a7013b76e42daa53cc::usdy::USDY | Ondo Finance |
以下说明交易最终性和费用处理的常见问题。
交易何时具有终局性?
Section titled “交易何时具有终局性?”交易在共识确认并执行成功后可视为最终;服务应等待确认而非只依赖提交响应。
交易手续费是多少?
Section titled “交易手续费是多少?”手续费取决于执行、存储和载荷 Gas;以实际链上执行结果中的 Gas 用量和 Gas 单价为准。