Get transaction history
νΈλμμ νμ€ν 리λ₯Ό λΆλ¬μ€λ(load) ν¨μμ λλ€. λΆλ¬μ¨ νμ€ν 리λ₯Ό κ°μ Έμ€λ €λ©΄ μλμ κ°μ΄ μ¬μ© κ°λ₯ν©λλ€.
loadTokenHistory
ν¨μμ΄λ¦
loadTokenHistory()
ν ν° νΈλμμ νμ€ν 리λ₯Ό λΆλ¬μ€λ ν¨μμ λλ€.
ν¨μ μ€ν μΈμκ°
Parameter | Type | Description |
---|---|---|
page | number | λͺ νμ΄μ§κΉμ§ λ ΈμΆν κ²μΈμ§ μ€μ |
offset | number | ν νμ΄μ§λΉ λͺκ°μ λ°μ΄ν°λ₯Ό λΆλ¬μ¬ κ²μΈμ§ |
ν¨μ λ°νκ°
Object item name | Type | Description |
---|---|---|
blockNumber | string | νΈλμμ μ΄ λ°μν λΈλ‘μ λ²νΈ |
timeStamp | string | νΈλμμ μ΄ λ°μν μκ° |
hash | string | TransactionID, TXID. |
value | string | μ μ‘ν Matic μλ (Weiκ°, μ μ μκ² νκΈ° λ°©λ²: value / 10 ** 18) |
from | string | λ°μ μ μ§κ°μ£Όμ |
to | string | μμ μ μ§κ°μ£Όμ |
gasPrice | string | μ¬μ©λ κ°μ€ price (μ€ gas μ¬μ©λ = gasUsed * gasPrice) |
gasUsed | string | νΈλμμ μ μ¬μ©ν κ°μ€λ (μ€ gas μ¬μ©λ = gasUsed * gasPrice) |
confirmations | string | 컨ν μ |
ν¨μ μ€ν μμ
const hasLoaded = await x2easy.asset.loadTokenHistory(page, offset);console.log(hasLoaded); // μλ¬κ° μμΌλ©΄ trueλ₯Ό λ°νν©λλ€.console.log(x2easy.asset.history);/*[ { blockNumber: '27052063', // νΈλμμ
μ΄ λ°μν λΈλ‘μ λ²νΈμ
λλ€. timeStamp: '1657095942', // νΈλμμ
μ΄ λ°μν μκ°μ
λλ€. hash: '0xe4c71e029d91bd21bdbb4f79ff961e97b4e9c459de667819982c4cc7bf569b5a', // TransactionID, TXID. nonce: '18', blockHash: '0xde32352a3c7717f1422bd2ba3a242dfb8558d9f386912fed996f2c28d68e3b1c', transactionIndex: '18', from: '0x92029b49f67785cebe41a5e36b1a9afb4ac2497d', // λ°μ μ μ§κ°μ£Όμ to: '0x8f33f58a9886577d2a75034ffd17cc8e8fc9449c', // μμ μ μ§κ°μ£Όμ value: '1300000000000000000', // μ μ‘ν Matic μλ (Weiκ°, μ μ μκ² νκΈ° λ°©λ²: value / 10 ** 18) gas: '300000', gasPrice: '33995045369', // μ¬μ©λ κ°μ€ price (μ€ gas μ¬μ©λ = gasUsed * gasPrice) isError: '0', txreceipt_status: '1', input: '0x', contractAddress: '', cumulativeGasUsed: '1052207', gasUsed: '21000', // νΈλμμ
μ μ¬μ©ν κ°μ€λ (μ€ gas μ¬μ©λ = gasUsed * gasPrice) confirmations: '84748' // 컨ν μ }, ... ,]*/
loadMaticHistory
ν¨μμ΄λ¦
loadMaticHistory()
μΌλ° matic νΈλμμ νμ€ν 리λ₯Ό λΆλ¬μ€λ ν¨μμ λλ€. token νΈλμμ λ κ°μ΄ λΆλ¬μ¨ λ€μ matic κ±°λλ§ filterνλ λ°©μμ μ¬μ©μ€μ λλ€. offsetμ λΆλ¬μ¬ λ κΈ°μ€κ°μ΄λ―λ‘, μ€μ λ‘λ©λλ λ°μ΄ν°λ filterλ₯Ό κ±°μΉκΈ° λλ¬Έμ offsetλ³΄λ€ μμ μ μμ΅λλ€.
ν¨μ μ€ν μΈμκ°
Parameter | Type | Description |
---|---|---|
page | number | λͺ νμ΄μ§κΉμ§ λ ΈμΆν κ²μΈμ§ μ€μ |
offset | number | ν νμ΄μ§λΉ λͺκ°μ λ°μ΄ν°λ₯Ό λΆλ¬μ¬ κ²μΈμ§ |
ν¨μ λ°νκ°
Object item name | Type | Description |
---|---|---|
blockNumber | string | νΈλμμ μ΄ λ°μν λΈλ‘μ λ²νΈ |
timeStamp | string | νΈλμμ μ΄ λ°μν μκ° |
hash | string | TransactionID, TXID. |
value | string | μ μ‘ν Matic μλ (Weiκ°, μ μ μκ² νκΈ° λ°©λ²: value / 10 ** 18) |
from | string | λ°μ μ μ§κ°μ£Όμ |
to | string | μμ μ μ§κ°μ£Όμ |
gasPrice | string | μ¬μ©λ κ°μ€ price (μ€ gas μ¬μ©λ = gasUsed * gasPrice) |
gasUsed | string | νΈλμμ μ μ¬μ©ν κ°μ€λ (μ€ gas μ¬μ©λ = gasUsed * gasPrice) |
confirmations | string | 컨ν μ |
ν¨μ μ€ν μμ
const hasLoaded = await x2easy.asset.loadMaticHistory(page, offset);console.log(hasLoaded); // μλ¬κ° μμΌλ©΄ trueλ₯Ό λ°νν©λλ€.console.log(x2easy.asset.history);/*[ { blockNumber: '27066888', // νΈλμμ
μ΄ λ°μν λΈλ‘μ λ²νΈμ
λλ€. timeStamp: '1657185229', // νΈλμμ
μ΄ λ°μν μκ°μ
λλ€. hash: '0x2ae8b93f356f7db5cdd562e5fd659b2a085a398a5efc7cc1b7a0e87f3379def2', // TransactionID, TXID. nonce: '29', blockHash: '0xf26b014b76bef73d7c792463631072107c7e4d62858fc98372211d58e2dbdcb9', from: '0x92029b49f67785cebe41a5e36b1a9afb4ac2497d', // ν ν° λ°μ μ μ§κ°μ£Όμ contractAddress: '0xceca5de7bbb16c951d6c8f7a70ac7caa9e8d34af', // 컨νΈλνΈ μ£Όμ to: '0x8f33f58a9886577d2a75034ffd17cc8e8fc9449c', // ν ν° μμ μ μ§κ°μ£Όμ value: '22000000000000000000', // μ μ‘ν ν ν° μλ (μ μ μκ² νκΈ° λ°©λ²: value / 10 ** tokenDecimal) tokenName: 'mumbai bsangs token', // ν ν° μ΄λ¦ tokenSymbol: 'MBT', // ν ν° μ¬λ³Ό tokenDecimal: '18', // tokenμ μμμ μ리μ transactionIndex: '4', gas: '300000', gasPrice: '30512195925', // 1 κ°μ€λΉ Maticμ κ°κ²© (Wei) (μ€ gas μ¬μ©λ = gasUsed * gasPrice) gasUsed: '48364', // νΈλμμ
μ μλͺ¨ν κ°μ€μ μ (μ€ gas μ¬μ©λ = gasUsed * gasPrice) cumulativeGasUsed: '685032', input: 'deprecated', confirmations: '69923' // 컨ν μ }, ...]*/