Transfer token
Token μ μ‘μ μν λ©μλ
ν¨μμ΄λ¦
transferToken()
ν¨μ μ€ν μΈμκ°
Parameter | Type | Description |
---|---|---|
toAddress | string | ν ν°μ μ μ‘λ°μ μ§κ° μ£Όμ |
amount | number | μ μ‘ν ν ν° μλ |
password | string | μ§κ° λΉλ°λ²νΈ |
ν¨μ λ°νκ°
Object item name | Type | Description |
---|---|---|
from | string | λ°μ μ μ§κ° μ£Όμ |
hash | string | TransactionId, (TXID) |
ν¨μ μ€ν μμ
console.log( await x2easy.asset.transferToken('WALLET_ADDRESS', 'TRANSFER_AMOUNT', 'WALLET_PASSWORD'));/* { nonce: 50, gasPrice: BigNumber { _hex: '0x0784e02ece', _isBigNumber: true }, gasLimit: BigNumber { _hex: '0x0493e0', _isBigNumber: true }, to: '0xCeca5dE7bbB16C951D6c8F7A70ac7caA9E8d34af', value: BigNumber { _hex: '0x00', _isBigNumber: true }, data: '0xa9059cbb0000000000000000000000003af0a1d2c053ca2e6072015edb44bc57db63a9c60000000000000000000000000000000000000000000000000de0b6b3a7640000', chainId: 80001, v: 160038, r: '0x4a268a0a0ec7b42dbe08ce5860be68af46a77cce8f7ed9fe58d6964b26931cf9', s: '0x56d881bdacd5f71ebebae739da3a3cf11e96ec25cef4c00aabb2bd74918ed4ec', from: '0x6053858641cc482Ba3cf07a4Ce94c6CD4aF56473', // λ°μ μ μ§κ°μ£Όμ hash: '0x479aceb09528f075099bebafc7ba3ac85c8725d05a57a10742c5dc3cf0898e64', // TransactionID, TXID. type: null, confirmations: 0, wait: [Function (anonymous)] }*/
π‘
ν ν° μ μ‘ νΈλμμ
μ΄ λΈλ‘체μΈμ μ¬λΌκ°λ©΄ true
λ°ν, μ€ν¨μ μλ¬ λ΄μ©κ³Ό ν¨κ» μλ¬κ° λ°νλ©λλ€.
transferToken()
ν¨μλ μμ²λ νΈλμ μ
λ°μ΄ν°λ₯Ό JSON λ°μ΄ν°λ‘ λ³νν ν λ΄λΆμ signTransaction()
ν¨μλ₯Ό μ΄μ©ν΄ λ°μ΄ν°λ₯Ό privateKey
λ‘ μνΈνν λ€ sendTransaction()
ν¨μλ₯Ό μ΄μ©ν΄ νΈλμμ
μ λ°μμν΅λλ€.