Transfer Matic
Matic μ μ‘μ μν λ©μλ
transferMatic()
ν¨μλ μμ²λ νΈλμ μ
λ°μ΄ν°λ₯Ό JSON λ°μ΄ν°λ‘ λ³νν ν λ΄λΆμ signTransaction()
ν¨μλ₯Ό μ΄μ©ν΄ λ°μ΄ν°λ₯Ό Wallet key
λ‘ μνΈνν λ€ sendTransaction()
ν¨μλ₯Ό μ΄μ©ν΄ νΈλμμ
μ λ°μμν΅λλ€.
ν¨μμ΄λ¦
transferMatic()
ν¨μ μ€ν μΈμκ°
Parameter | Type | Description |
---|---|---|
toAddress | string | Maticμ μ μ‘λ°μ μ§κ° μ£Όμ |
amount | number | μ μ‘ν ν ν° μλ |
password | string | μ§κ° λΉλ°λ²νΈ |
ν¨μ λ°νκ°
Object item name | Type | Description |
---|---|---|
to | string | λ°λ μ¬λ μ£Όμ |
value | BigNumber | 보λ΄λ μλ (wei) |
from | string | λ°μ μ μ§κ° μ£Όμ |
hash | string | TransactionId, (TXID) |
ν¨μ μ€ν μμ
console.log( await x2easy.asset.transferMatic('WALLET_ADDRESS', 'TRANSFER_AMOUNT', 'WALLET_PASSWORD'));/* { nonce: 49, gasPrice: BigNumber { _hex: '0x73f543cd', _isBigNumber: true }, gasLimit: BigNumber { _hex: '0x0493e0', _isBigNumber: true }, to: '0x3af0A1d2c053ca2e6072015EdB44Bc57db63a9c6', // μμ μ μ§κ°μ£Όμ value: BigNumber { _hex: '0x2386f26fc10000', _isBigNumber: true }, // 보λ΄λ Matic μλ (Weiκ°, μ μ μκ² νκΈ° λ°©λ²: value / 10 ** 18) data: '0x', chainId: 80001, v: 160038, r: '0x76b655f4752a29b122fb8556fa357ada2ab8b1468cf0b2076f26cbb079150a4c', s: '0x6a7646c35ac8d56fb6db3126d92b65b18fd22eaaffa3a039950d8bab7a4c9a7c', from: '0x6053858641cc482Ba3cf07a4Ce94c6CD4aF56473', // λ°μ μ μ§κ°μ£Όμ hash: '0xf55dc90f80c142436d56c6e542a5a8f5c6849d1aa917625a2dd930efc469dfd5', // TransactionId, (TXID) type: null, confirmations: 0, wait: [Function (anonymous)] }*/