@ledgerhq/coin-evm 10.1.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/docs/getBlock-internal-txs-schema.md +2 -2
- package/docs/network/node/index.md +1 -1
- package/lib/adapters/etherscan.d.ts +2 -1
- package/lib/adapters/etherscan.d.ts.map +1 -1
- package/lib/adapters/etherscan.js +16 -2
- package/lib/adapters/etherscan.js.map +1 -1
- package/lib/adapters/ledger.d.ts +2 -1
- package/lib/adapters/ledger.d.ts.map +1 -1
- package/lib/adapters/ledger.js +4 -2
- package/lib/adapters/ledger.js.map +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +1 -2
- package/lib/api/index.js.map +1 -1
- package/lib/chains.d.ts +95 -0
- package/lib/chains.d.ts.map +1 -0
- package/lib/chains.js +99 -0
- package/lib/chains.js.map +1 -0
- package/lib/config.d.ts +4 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -1
- package/lib/config.js.map +1 -1
- package/lib/logic/broadcast.js +2 -2
- package/lib/logic/broadcast.js.map +1 -1
- package/lib/logic/common.d.ts +1 -1
- package/lib/logic/common.d.ts.map +1 -1
- package/lib/logic/common.js +11 -11
- package/lib/logic/common.js.map +1 -1
- package/lib/logic/craftTransaction.d.ts.map +1 -1
- package/lib/logic/craftTransaction.js +3 -3
- package/lib/logic/craftTransaction.js.map +1 -1
- package/lib/logic/estimateFees.d.ts.map +1 -1
- package/lib/logic/estimateFees.js +7 -7
- package/lib/logic/estimateFees.js.map +1 -1
- package/lib/logic/getBalance.d.ts.map +1 -1
- package/lib/logic/getBalance.js +9 -9
- package/lib/logic/getBalance.js.map +1 -1
- package/lib/logic/getBlock.d.ts.map +1 -1
- package/lib/logic/getBlock.js +38 -21
- package/lib/logic/getBlock.js.map +1 -1
- package/lib/logic/getBlockInfo.js +2 -2
- package/lib/logic/getBlockInfo.js.map +1 -1
- package/lib/logic/getNextSequence.d.ts.map +1 -1
- package/lib/logic/getNextSequence.js +1 -1
- package/lib/logic/getNextSequence.js.map +1 -1
- package/lib/logic/getStakes.d.ts.map +1 -1
- package/lib/logic/getStakes.js +10 -10
- package/lib/logic/getStakes.js.map +1 -1
- package/lib/logic/internalTransactionsFetcher.d.ts +2 -2
- package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib/logic/internalTransactionsFetcher.js +8 -8
- package/lib/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib/logic/lastBlock.js +2 -2
- package/lib/logic/lastBlock.js.map +1 -1
- package/lib/logic/listOperations.d.ts.map +1 -1
- package/lib/logic/listOperations.js +3 -1
- package/lib/logic/listOperations.js.map +1 -1
- package/lib/logic/validateIntent.d.ts.map +1 -1
- package/lib/logic/validateIntent.js +9 -9
- package/lib/logic/validateIntent.js.map +1 -1
- package/lib/logic.d.ts +1 -1
- package/lib/logic.d.ts.map +1 -1
- package/lib/logic.js +14 -13
- package/lib/logic.js.map +1 -1
- package/lib/network/explorer/etherscan.d.ts +2 -3
- package/lib/network/explorer/etherscan.d.ts.map +1 -1
- package/lib/network/explorer/etherscan.js +6 -8
- package/lib/network/explorer/etherscan.js.map +1 -1
- package/lib/network/explorer/ledger.d.ts.map +1 -1
- package/lib/network/explorer/ledger.js +5 -5
- package/lib/network/explorer/ledger.js.map +1 -1
- package/lib/network/explorer/types.d.ts +2 -2
- package/lib/network/explorer/types.d.ts.map +1 -1
- package/lib/network/explorer/types.js.map +1 -1
- package/lib/network/node/explorerProxy.d.ts.map +1 -1
- package/lib/network/node/explorerProxy.js +14 -12
- package/lib/network/node/explorerProxy.js.map +1 -1
- package/lib/network/node/index.d.ts +1 -1
- package/lib/network/node/index.d.ts.map +1 -1
- package/lib/network/node/index.js +7 -7
- package/lib/network/node/index.js.map +1 -1
- package/lib/network/node/ledger.d.ts +3 -1
- package/lib/network/node/ledger.d.ts.map +1 -1
- package/lib/network/node/ledger.js +32 -22
- package/lib/network/node/ledger.js.map +1 -1
- package/lib/network/node/rpc.common.d.ts +1 -1
- package/lib/network/node/rpc.common.d.ts.map +1 -1
- package/lib/network/node/rpc.common.js +67 -39
- package/lib/network/node/rpc.common.js.map +1 -1
- package/lib/network/node/types.d.ts +18 -16
- package/lib/network/node/types.d.ts.map +1 -1
- package/lib/network/node/types.js.map +1 -1
- package/lib/network/node/withNodeSources.d.ts.map +1 -1
- package/lib/network/node/withNodeSources.js +15 -15
- package/lib/network/node/withNodeSources.js.map +1 -1
- package/lib/staking/abis.d.ts +3 -2
- package/lib/staking/abis.d.ts.map +1 -1
- package/lib/staking/abis.js +10 -9
- package/lib/staking/abis.js.map +1 -1
- package/lib/staking/contracts.d.ts +3 -2
- package/lib/staking/contracts.d.ts.map +1 -1
- package/lib/staking/contracts.js +11 -10
- package/lib/staking/contracts.js.map +1 -1
- package/lib/staking/detectOperationType.d.ts +2 -1
- package/lib/staking/detectOperationType.d.ts.map +1 -1
- package/lib/staking/detectOperationType.js +7 -7
- package/lib/staking/detectOperationType.js.map +1 -1
- package/lib/staking/encoder.d.ts +2 -1
- package/lib/staking/encoder.d.ts.map +1 -1
- package/lib/staking/encoder.js +8 -8
- package/lib/staking/encoder.js.map +1 -1
- package/lib/staking/fetchers.d.ts +2 -1
- package/lib/staking/fetchers.d.ts.map +1 -1
- package/lib/staking/fetchers.js +27 -27
- package/lib/staking/fetchers.js.map +1 -1
- package/lib/staking/logic.d.ts +6 -6
- package/lib/staking/logic.d.ts.map +1 -1
- package/lib/staking/logic.js +14 -13
- package/lib/staking/logic.js.map +1 -1
- package/lib/staking/operations/index.d.ts +2 -1
- package/lib/staking/operations/index.d.ts.map +1 -1
- package/lib/staking/operations/index.js +30 -28
- package/lib/staking/operations/index.js.map +1 -1
- package/lib/staking/prepareIntents.d.ts +1 -1
- package/lib/staking/prepareIntents.d.ts.map +1 -1
- package/lib/staking/prepareIntents.js +11 -10
- package/lib/staking/prepareIntents.js.map +1 -1
- package/lib/staking/redelegations.d.ts +4 -4
- package/lib/staking/redelegations.d.ts.map +1 -1
- package/lib/staking/redelegations.js +18 -20
- package/lib/staking/redelegations.js.map +1 -1
- package/lib/staking/rewards.d.ts +1 -1
- package/lib/staking/rewards.d.ts.map +1 -1
- package/lib/staking/rewards.js +2 -2
- package/lib/staking/rewards.js.map +1 -1
- package/lib/staking/rewardsFromReceipt.d.ts +2 -1
- package/lib/staking/rewardsFromReceipt.d.ts.map +1 -1
- package/lib/staking/rewardsFromReceipt.js +2 -2
- package/lib/staking/rewardsFromReceipt.js.map +1 -1
- package/lib/staking/transactionData.d.ts +2 -1
- package/lib/staking/transactionData.d.ts.map +1 -1
- package/lib/staking/transactionData.js +6 -6
- package/lib/staking/transactionData.js.map +1 -1
- package/lib/staking/unbondings.d.ts +1 -1
- package/lib/staking/unbondings.d.ts.map +1 -1
- package/lib/staking/unbondings.js +2 -2
- package/lib/staking/unbondings.js.map +1 -1
- package/lib/staking/validators/index.d.ts +14 -14
- package/lib/staking/validators/index.d.ts.map +1 -1
- package/lib/staking/validators/index.js +39 -38
- package/lib/staking/validators/index.js.map +1 -1
- package/lib/staking/validators/monad.d.ts +5 -5
- package/lib/staking/validators/monad.d.ts.map +1 -1
- package/lib/staking/validators/monad.js +31 -33
- package/lib/staking/validators/monad.js.map +1 -1
- package/lib/staking/validators/monadResolver.d.ts +1 -1
- package/lib/staking/validators/monadResolver.d.ts.map +1 -1
- package/lib/staking/validators/monadResolver.js +4 -4
- package/lib/staking/validators/monadResolver.js.map +1 -1
- package/lib/staking/validators/sei.js +2 -2
- package/lib/staking/validators/sei.js.map +1 -1
- package/lib/staking/validators/somnia.d.ts +4 -4
- package/lib/staking/validators/somnia.d.ts.map +1 -1
- package/lib/staking/validators/somnia.js +22 -22
- package/lib/staking/validators/somnia.js.map +1 -1
- package/lib/staking/validators/types.d.ts +1 -1
- package/lib/staking/validators/types.d.ts.map +1 -1
- package/lib/staking/validators/zero_gravity.d.ts +1 -1
- package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
- package/lib/staking/validators/zero_gravity.js +7 -7
- package/lib/staking/validators/zero_gravity.js.map +1 -1
- package/lib/types/staking.d.ts +5 -6
- package/lib/types/staking.d.ts.map +1 -1
- package/lib-es/adapters/etherscan.d.ts +2 -1
- package/lib-es/adapters/etherscan.d.ts.map +1 -1
- package/lib-es/adapters/etherscan.js +16 -2
- package/lib-es/adapters/etherscan.js.map +1 -1
- package/lib-es/adapters/ledger.d.ts +2 -1
- package/lib-es/adapters/ledger.d.ts.map +1 -1
- package/lib-es/adapters/ledger.js +4 -2
- package/lib-es/adapters/ledger.js.map +1 -1
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/api/index.js +1 -2
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/chains.d.ts +95 -0
- package/lib-es/chains.d.ts.map +1 -0
- package/lib-es/chains.js +96 -0
- package/lib-es/chains.js.map +1 -0
- package/lib-es/config.d.ts +4 -1
- package/lib-es/config.d.ts.map +1 -1
- package/lib-es/config.js +1 -0
- package/lib-es/config.js.map +1 -1
- package/lib-es/logic/broadcast.js +2 -2
- package/lib-es/logic/broadcast.js.map +1 -1
- package/lib-es/logic/common.d.ts +1 -1
- package/lib-es/logic/common.d.ts.map +1 -1
- package/lib-es/logic/common.js +11 -11
- package/lib-es/logic/common.js.map +1 -1
- package/lib-es/logic/craftTransaction.d.ts.map +1 -1
- package/lib-es/logic/craftTransaction.js +3 -3
- package/lib-es/logic/craftTransaction.js.map +1 -1
- package/lib-es/logic/estimateFees.d.ts.map +1 -1
- package/lib-es/logic/estimateFees.js +7 -7
- package/lib-es/logic/estimateFees.js.map +1 -1
- package/lib-es/logic/getBalance.d.ts.map +1 -1
- package/lib-es/logic/getBalance.js +9 -9
- package/lib-es/logic/getBalance.js.map +1 -1
- package/lib-es/logic/getBlock.d.ts.map +1 -1
- package/lib-es/logic/getBlock.js +39 -22
- package/lib-es/logic/getBlock.js.map +1 -1
- package/lib-es/logic/getBlockInfo.js +2 -2
- package/lib-es/logic/getBlockInfo.js.map +1 -1
- package/lib-es/logic/getNextSequence.d.ts.map +1 -1
- package/lib-es/logic/getNextSequence.js +1 -1
- package/lib-es/logic/getNextSequence.js.map +1 -1
- package/lib-es/logic/getStakes.d.ts.map +1 -1
- package/lib-es/logic/getStakes.js +10 -10
- package/lib-es/logic/getStakes.js.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.d.ts +2 -2
- package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.js +8 -8
- package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib-es/logic/lastBlock.js +2 -2
- package/lib-es/logic/lastBlock.js.map +1 -1
- package/lib-es/logic/listOperations.d.ts.map +1 -1
- package/lib-es/logic/listOperations.js +3 -1
- package/lib-es/logic/listOperations.js.map +1 -1
- package/lib-es/logic/validateIntent.d.ts.map +1 -1
- package/lib-es/logic/validateIntent.js +9 -9
- package/lib-es/logic/validateIntent.js.map +1 -1
- package/lib-es/logic.d.ts +1 -1
- package/lib-es/logic.d.ts.map +1 -1
- package/lib-es/logic.js +14 -13
- package/lib-es/logic.js.map +1 -1
- package/lib-es/network/explorer/etherscan.d.ts +2 -3
- package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
- package/lib-es/network/explorer/etherscan.js +6 -8
- package/lib-es/network/explorer/etherscan.js.map +1 -1
- package/lib-es/network/explorer/ledger.d.ts.map +1 -1
- package/lib-es/network/explorer/ledger.js +5 -5
- package/lib-es/network/explorer/ledger.js.map +1 -1
- package/lib-es/network/explorer/types.d.ts +2 -2
- package/lib-es/network/explorer/types.d.ts.map +1 -1
- package/lib-es/network/explorer/types.js.map +1 -1
- package/lib-es/network/node/explorerProxy.d.ts.map +1 -1
- package/lib-es/network/node/explorerProxy.js +14 -12
- package/lib-es/network/node/explorerProxy.js.map +1 -1
- package/lib-es/network/node/index.d.ts +1 -1
- package/lib-es/network/node/index.d.ts.map +1 -1
- package/lib-es/network/node/index.js +7 -7
- package/lib-es/network/node/index.js.map +1 -1
- package/lib-es/network/node/ledger.d.ts +3 -1
- package/lib-es/network/node/ledger.d.ts.map +1 -1
- package/lib-es/network/node/ledger.js +32 -22
- package/lib-es/network/node/ledger.js.map +1 -1
- package/lib-es/network/node/rpc.common.d.ts +1 -1
- package/lib-es/network/node/rpc.common.d.ts.map +1 -1
- package/lib-es/network/node/rpc.common.js +67 -39
- package/lib-es/network/node/rpc.common.js.map +1 -1
- package/lib-es/network/node/types.d.ts +18 -16
- package/lib-es/network/node/types.d.ts.map +1 -1
- package/lib-es/network/node/types.js.map +1 -1
- package/lib-es/network/node/withNodeSources.d.ts.map +1 -1
- package/lib-es/network/node/withNodeSources.js +15 -15
- package/lib-es/network/node/withNodeSources.js.map +1 -1
- package/lib-es/staking/abis.d.ts +3 -2
- package/lib-es/staking/abis.d.ts.map +1 -1
- package/lib-es/staking/abis.js +10 -9
- package/lib-es/staking/abis.js.map +1 -1
- package/lib-es/staking/contracts.d.ts +3 -2
- package/lib-es/staking/contracts.d.ts.map +1 -1
- package/lib-es/staking/contracts.js +11 -10
- package/lib-es/staking/contracts.js.map +1 -1
- package/lib-es/staking/detectOperationType.d.ts +2 -1
- package/lib-es/staking/detectOperationType.d.ts.map +1 -1
- package/lib-es/staking/detectOperationType.js +7 -7
- package/lib-es/staking/detectOperationType.js.map +1 -1
- package/lib-es/staking/encoder.d.ts +2 -1
- package/lib-es/staking/encoder.d.ts.map +1 -1
- package/lib-es/staking/encoder.js +8 -8
- package/lib-es/staking/encoder.js.map +1 -1
- package/lib-es/staking/fetchers.d.ts +2 -1
- package/lib-es/staking/fetchers.d.ts.map +1 -1
- package/lib-es/staking/fetchers.js +27 -27
- package/lib-es/staking/fetchers.js.map +1 -1
- package/lib-es/staking/logic.d.ts +6 -6
- package/lib-es/staking/logic.d.ts.map +1 -1
- package/lib-es/staking/logic.js +14 -13
- package/lib-es/staking/logic.js.map +1 -1
- package/lib-es/staking/operations/index.d.ts +2 -1
- package/lib-es/staking/operations/index.d.ts.map +1 -1
- package/lib-es/staking/operations/index.js +30 -28
- package/lib-es/staking/operations/index.js.map +1 -1
- package/lib-es/staking/prepareIntents.d.ts +1 -1
- package/lib-es/staking/prepareIntents.d.ts.map +1 -1
- package/lib-es/staking/prepareIntents.js +11 -10
- package/lib-es/staking/prepareIntents.js.map +1 -1
- package/lib-es/staking/redelegations.d.ts +4 -4
- package/lib-es/staking/redelegations.d.ts.map +1 -1
- package/lib-es/staking/redelegations.js +18 -20
- package/lib-es/staking/redelegations.js.map +1 -1
- package/lib-es/staking/rewards.d.ts +1 -1
- package/lib-es/staking/rewards.d.ts.map +1 -1
- package/lib-es/staking/rewards.js +2 -2
- package/lib-es/staking/rewards.js.map +1 -1
- package/lib-es/staking/rewardsFromReceipt.d.ts +2 -1
- package/lib-es/staking/rewardsFromReceipt.d.ts.map +1 -1
- package/lib-es/staking/rewardsFromReceipt.js +2 -2
- package/lib-es/staking/rewardsFromReceipt.js.map +1 -1
- package/lib-es/staking/transactionData.d.ts +2 -1
- package/lib-es/staking/transactionData.d.ts.map +1 -1
- package/lib-es/staking/transactionData.js +6 -6
- package/lib-es/staking/transactionData.js.map +1 -1
- package/lib-es/staking/unbondings.d.ts +1 -1
- package/lib-es/staking/unbondings.d.ts.map +1 -1
- package/lib-es/staking/unbondings.js +2 -2
- package/lib-es/staking/unbondings.js.map +1 -1
- package/lib-es/staking/validators/index.d.ts +14 -14
- package/lib-es/staking/validators/index.d.ts.map +1 -1
- package/lib-es/staking/validators/index.js +39 -38
- package/lib-es/staking/validators/index.js.map +1 -1
- package/lib-es/staking/validators/monad.d.ts +5 -5
- package/lib-es/staking/validators/monad.d.ts.map +1 -1
- package/lib-es/staking/validators/monad.js +31 -33
- package/lib-es/staking/validators/monad.js.map +1 -1
- package/lib-es/staking/validators/monadResolver.d.ts +1 -1
- package/lib-es/staking/validators/monadResolver.d.ts.map +1 -1
- package/lib-es/staking/validators/monadResolver.js +4 -4
- package/lib-es/staking/validators/monadResolver.js.map +1 -1
- package/lib-es/staking/validators/sei.js +2 -2
- package/lib-es/staking/validators/sei.js.map +1 -1
- package/lib-es/staking/validators/somnia.d.ts +4 -4
- package/lib-es/staking/validators/somnia.d.ts.map +1 -1
- package/lib-es/staking/validators/somnia.js +22 -22
- package/lib-es/staking/validators/somnia.js.map +1 -1
- package/lib-es/staking/validators/types.d.ts +1 -1
- package/lib-es/staking/validators/types.d.ts.map +1 -1
- package/lib-es/staking/validators/zero_gravity.d.ts +1 -1
- package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
- package/lib-es/staking/validators/zero_gravity.js +7 -7
- package/lib-es/staking/validators/zero_gravity.js.map +1 -1
- package/lib-es/types/staking.d.ts +5 -6
- package/lib-es/types/staking.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapters/etherscan.test.ts +91 -43
- package/src/adapters/etherscan.ts +18 -2
- package/src/adapters/ledger.test.ts +106 -31
- package/src/adapters/ledger.ts +5 -2
- package/src/api/index.ts +1 -2
- package/src/api/{getBlock.integ.test.ts → tests/getBlock.integ.test.ts} +5 -4
- package/src/api/{index.arbitrum.integ.test.ts → tests/index.arbitrum.integ.test.ts} +3 -3
- package/src/api/{index.arc.integ.test.ts → tests/index.arc.integ.test.ts} +3 -3
- package/src/api/{index.avalanche_c_chain_fuji.integ.test.ts → tests/index.avalanche_c_chain_fuji.integ.test.ts} +3 -3
- package/src/api/{index.cronos.integ.test.ts → tests/index.cronos.integ.test.ts} +3 -3
- package/src/api/{index.flare.integ.test.ts → tests/index.flare.integ.test.ts} +3 -3
- package/src/api/{index.integ.test.ts → tests/index.integ.test.ts} +3 -3
- package/src/api/{index.linea.integ.test.ts → tests/index.linea.integ.test.ts} +3 -3
- package/src/api/{index.monad_testnet.integ.test.ts → tests/index.monad_testnet.integ.test.ts} +6 -6
- package/src/api/{index.optimism.integ.test.ts → tests/index.optimism.integ.test.ts} +3 -3
- package/src/api/{index.rsk.integ.test.ts → tests/index.rsk.integ.test.ts} +3 -3
- package/src/api/{index.shape.integ.test.ts → tests/index.shape.integ.test.ts} +3 -3
- package/src/api/{index.somnia.integ.test.ts → tests/index.somnia.integ.test.ts} +3 -3
- package/src/api/{index.test.ts → tests/index.test.ts} +4 -4
- package/src/api/{index.zksync.integ.test.ts → tests/index.zksync.integ.test.ts} +2 -2
- package/src/chains.test.ts +12 -0
- package/src/chains.ts +98 -0
- package/src/config.ts +5 -1
- package/src/fixtures/staking.fixtures.ts +13 -0
- package/src/logic/broadcast.ts +2 -2
- package/src/logic/common.ts +10 -11
- package/src/logic/craftTransaction.ts +2 -3
- package/src/logic/estimateFees.ts +6 -23
- package/src/logic/getBalance.ts +7 -13
- package/src/logic/getBlock.ts +59 -23
- package/src/logic/getBlockInfo.ts +2 -2
- package/src/logic/getNextSequence.ts +1 -4
- package/src/logic/getStakes.ts +11 -12
- package/src/logic/internalTransactionsFetcher.ts +6 -8
- package/src/logic/lastBlock.ts +2 -2
- package/src/logic/listOperations.ts +2 -1
- package/src/logic/tests/broadcast.test.ts +5 -5
- package/src/logic/tests/broadcastSource.test.ts +1 -4
- package/src/logic/tests/common.test.ts +18 -34
- package/src/logic/tests/craftTransaction.test.ts +14 -7
- package/src/logic/tests/estimateFees.test.ts +17 -8
- package/src/logic/tests/getBalance.test.ts +18 -34
- package/src/logic/tests/getBlock.test.ts +195 -80
- package/src/logic/tests/getBlockInfo.test.ts +2 -2
- package/src/logic/tests/getNextSequence.test.ts +2 -2
- package/src/logic/tests/getStakes.test.ts +28 -16
- package/src/logic/tests/internalTransactionsFetcher.test.ts +6 -6
- package/src/logic/tests/lastBlock.test.ts +4 -7
- package/src/logic/tests/listOperations.test.ts +8 -7
- package/src/logic/tests/validateIntent.test.ts +49 -3
- package/src/logic/validateIntent.ts +8 -10
- package/src/logic.test.ts +13 -5
- package/src/logic.ts +13 -13
- package/src/network/explorer/etherscan.ts +8 -24
- package/src/network/explorer/ledger.ts +2 -5
- package/src/network/explorer/types.ts +0 -2
- package/src/network/node/explorerProxy.ts +14 -12
- package/src/network/node/index.ts +11 -8
- package/src/network/node/ledger.ts +32 -34
- package/src/network/node/rpc.common.ts +79 -86
- package/src/network/node/types.ts +16 -31
- package/src/network/node/withNodeSources.ts +23 -26
- package/src/network/{explorer → tests/explorer}/etherscan.test.ts +16 -65
- package/src/network/{explorer → tests/explorer}/index.test.ts +8 -8
- package/src/network/{explorer → tests/explorer}/ledger.test.ts +34 -142
- package/src/network/{explorer → tests/explorer}/types.test.ts +1 -1
- package/src/network/{gasTracker → tests/gasTracker}/index.test.ts +3 -3
- package/src/network/{gasTracker → tests/gasTracker}/ledger.test.ts +4 -4
- package/src/network/{gasTracker → tests/gasTracker}/types.test.ts +1 -1
- package/src/network/{node → tests/node}/explorerProxy.test.ts +22 -24
- package/src/network/{node → tests/node}/gethCallTracerToTraceBlockItems.test.ts +4 -4
- package/src/network/tests/node/index.memoization.test.ts +70 -0
- package/src/network/{node → tests/node}/index.test.ts +4 -6
- package/src/network/{node → tests/node}/ledger.test.ts +69 -74
- package/src/network/{node → tests/node}/node.fixtures.ts +1 -1
- package/src/network/{node → tests/node}/rpc.errors.test.ts +1 -1
- package/src/network/{node → tests/node}/rpc.test.ts +100 -119
- package/src/network/{node → tests/node}/types.test.ts +1 -1
- package/src/network/{node → tests/node}/withNodeSources.test.ts +10 -12
- package/src/network/{withRetries.test.ts → tests/withRetries.test.ts} +2 -2
- package/src/staking/abis.test.ts +24 -28
- package/src/staking/abis.ts +12 -10
- package/src/staking/contracts.test.ts +20 -8
- package/src/staking/contracts.ts +12 -11
- package/src/staking/detectOperationType.test.ts +16 -13
- package/src/staking/detectOperationType.ts +9 -8
- package/src/staking/encoder.test.ts +38 -27
- package/src/staking/encoder.ts +9 -8
- package/src/staking/fetchers.ts +28 -39
- package/src/staking/logic.test.ts +34 -32
- package/src/staking/logic.ts +14 -14
- package/src/staking/operations/index.test.ts +48 -39
- package/src/staking/operations/index.ts +31 -28
- package/src/staking/prepareIntents.test.ts +14 -34
- package/src/staking/prepareIntents.ts +10 -13
- package/src/staking/redelegations.test.ts +73 -131
- package/src/staking/redelegations.ts +12 -26
- package/src/staking/rewards.test.ts +19 -21
- package/src/staking/rewards.ts +1 -2
- package/src/staking/rewardsFromReceipt.test.ts +9 -8
- package/src/staking/rewardsFromReceipt.ts +3 -2
- package/src/staking/transactionData.test.ts +35 -25
- package/src/staking/transactionData.ts +7 -6
- package/src/staking/unbondings.test.ts +26 -20
- package/src/staking/unbondings.ts +1 -2
- package/src/staking/validators/index.ts +45 -51
- package/src/staking/validators/monad.test.ts +52 -54
- package/src/staking/validators/monad.ts +31 -37
- package/src/staking/validators/monadResolver.ts +2 -4
- package/src/staking/validators/sei.ts +2 -2
- package/src/staking/validators/somnia.test.ts +22 -19
- package/src/staking/validators/somnia.ts +20 -27
- package/src/staking/validators/types.ts +0 -1
- package/src/staking/validators/zero_gravity.test.ts +34 -49
- package/src/staking/validators/zero_gravity.ts +5 -11
- package/src/staking/validators.integ.test.ts +3 -5
- package/src/staking/validators.test.ts +56 -53
- package/src/types/staking.ts +3 -6
- package/src/network/node/index.memoization.test.ts +0 -63
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
deserializePagingToken,
|
|
22
22
|
serializePagingToken,
|
|
23
23
|
} from '../adapters'
|
|
24
|
+
import { CHAIN_ID } from '../config'
|
|
24
25
|
import { testLogger } from '../fixtures/context.fixtures'
|
|
25
26
|
import { NO_TOKEN } from '../network/explorer/types'
|
|
26
27
|
|
|
@@ -54,7 +55,6 @@ describe('EVM Family', () => {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
57
|
-
const currencyId = 'ethereum'
|
|
58
58
|
|
|
59
59
|
const expectedOperation = {
|
|
60
60
|
id: '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e-0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338-FEES',
|
|
@@ -77,6 +77,8 @@ describe('EVM Family', () => {
|
|
|
77
77
|
},
|
|
78
78
|
details: {
|
|
79
79
|
sequence: '7',
|
|
80
|
+
gasPrice: '125521409858',
|
|
81
|
+
gasLimit: '6000000',
|
|
80
82
|
contractInteraction: 'SmartContractDeployment',
|
|
81
83
|
contractAddress: '0x4969D9fD2542e71e6b3EA87bE54EA9a736bcC4E9',
|
|
82
84
|
contractPayload:
|
|
@@ -85,7 +87,7 @@ describe('EVM Family', () => {
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
expect(
|
|
88
|
-
etherscanOperationToOperations(address,
|
|
90
|
+
etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
|
|
89
91
|
).toEqual([expectedOperation])
|
|
90
92
|
})
|
|
91
93
|
|
|
@@ -115,7 +117,6 @@ describe('EVM Family', () => {
|
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
118
|
-
const currencyId = 'ethereum'
|
|
119
120
|
|
|
120
121
|
const expectedOperation = {
|
|
121
122
|
id: '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e-0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338-FEES',
|
|
@@ -138,6 +139,8 @@ describe('EVM Family', () => {
|
|
|
138
139
|
},
|
|
139
140
|
details: {
|
|
140
141
|
sequence: '7',
|
|
142
|
+
gasPrice: '125521409858',
|
|
143
|
+
gasLimit: '6000000',
|
|
141
144
|
contractInteraction: 'SmartContractInteraction',
|
|
142
145
|
contractAddress: '0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC',
|
|
143
146
|
contractPayload:
|
|
@@ -146,7 +149,7 @@ describe('EVM Family', () => {
|
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
expect(
|
|
149
|
-
etherscanOperationToOperations(address,
|
|
152
|
+
etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
|
|
150
153
|
).toEqual([expectedOperation])
|
|
151
154
|
})
|
|
152
155
|
|
|
@@ -175,7 +178,6 @@ describe('EVM Family', () => {
|
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
const address = '0x829BD824B016326A401d083B33D092293333A830'
|
|
178
|
-
const currencyId = 'ethereum'
|
|
179
181
|
|
|
180
182
|
const expectedOperation = {
|
|
181
183
|
id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-OUT',
|
|
@@ -196,11 +198,11 @@ describe('EVM Family', () => {
|
|
|
196
198
|
failed: false,
|
|
197
199
|
feesPayer: '0x829BD824B016326A401d083B33D092293333A830',
|
|
198
200
|
},
|
|
199
|
-
details: { sequence: '11898499' },
|
|
201
|
+
details: { sequence: '11898499', gasPrice: '68363841693', gasLimit: '210000' },
|
|
200
202
|
}
|
|
201
203
|
|
|
202
204
|
expect(
|
|
203
|
-
etherscanOperationToOperations(address,
|
|
205
|
+
etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
|
|
204
206
|
).toEqual([expectedOperation])
|
|
205
207
|
})
|
|
206
208
|
|
|
@@ -229,7 +231,6 @@ describe('EVM Family', () => {
|
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
const address = '0x829BD824B016326A401d083B33D092293333A830'
|
|
232
|
-
const currencyId = 'ethereum'
|
|
233
234
|
|
|
234
235
|
const expectedOperation = {
|
|
235
236
|
id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-IN',
|
|
@@ -250,11 +251,11 @@ describe('EVM Family', () => {
|
|
|
250
251
|
failed: false,
|
|
251
252
|
feesPayer: '0x26E3fd2dEc89bF645BA7b41c4DdFad8454Ee6245',
|
|
252
253
|
},
|
|
253
|
-
details: { sequence: '11898499' },
|
|
254
|
+
details: { sequence: '11898499', gasPrice: '68363841693', gasLimit: '210000' },
|
|
254
255
|
}
|
|
255
256
|
|
|
256
257
|
expect(
|
|
257
|
-
etherscanOperationToOperations(address,
|
|
258
|
+
etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
|
|
258
259
|
).toEqual([expectedOperation])
|
|
259
260
|
})
|
|
260
261
|
|
|
@@ -283,7 +284,6 @@ describe('EVM Family', () => {
|
|
|
283
284
|
}
|
|
284
285
|
|
|
285
286
|
const address = '0x829BD824B016326A401d083B33D092293333A830'
|
|
286
|
-
const currencyId = 'ethereum'
|
|
287
287
|
|
|
288
288
|
const expectedOperation = {
|
|
289
289
|
id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-NONE',
|
|
@@ -304,11 +304,11 @@ describe('EVM Family', () => {
|
|
|
304
304
|
failed: false,
|
|
305
305
|
feesPayer: '0x6bfD74C0996F269Bcece59191EFf667b3dFD73b9',
|
|
306
306
|
},
|
|
307
|
-
details: { sequence: '11898499' },
|
|
307
|
+
details: { sequence: '11898499', gasPrice: '68363841693', gasLimit: '210000' },
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
expect(
|
|
311
|
-
etherscanOperationToOperations(address,
|
|
311
|
+
etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
|
|
312
312
|
).toEqual([expectedOperation])
|
|
313
313
|
})
|
|
314
314
|
|
|
@@ -337,7 +337,6 @@ describe('EVM Family', () => {
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
340
|
-
const currencyId = 'ethereum'
|
|
341
340
|
|
|
342
341
|
const selfSendTx = {
|
|
343
342
|
hash: '0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338',
|
|
@@ -361,7 +360,7 @@ describe('EVM Family', () => {
|
|
|
361
360
|
value: 1000n,
|
|
362
361
|
asset: { type: 'native' },
|
|
363
362
|
tx: selfSendTx,
|
|
364
|
-
details: { sequence: '7' },
|
|
363
|
+
details: { sequence: '7', gasPrice: '125521409858', gasLimit: '21000' },
|
|
365
364
|
},
|
|
366
365
|
{
|
|
367
366
|
id: '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e-0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338-OUT',
|
|
@@ -371,18 +370,17 @@ describe('EVM Family', () => {
|
|
|
371
370
|
value: 1000n,
|
|
372
371
|
asset: { type: 'native' },
|
|
373
372
|
tx: selfSendTx,
|
|
374
|
-
details: { sequence: '7' },
|
|
373
|
+
details: { sequence: '7', gasPrice: '125521409858', gasLimit: '21000' },
|
|
375
374
|
},
|
|
376
375
|
]
|
|
377
376
|
|
|
378
377
|
expect(
|
|
379
|
-
etherscanOperationToOperations(address,
|
|
378
|
+
etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
|
|
380
379
|
).toEqual(expectedOperations)
|
|
381
380
|
})
|
|
382
381
|
|
|
383
382
|
it('should return an operation with the expected amount', () => {
|
|
384
383
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
385
|
-
const currencyId = 'ethereum'
|
|
386
384
|
|
|
387
385
|
const etherscanOpFees: EtherscanOperation = {
|
|
388
386
|
blockNumber: '14923692',
|
|
@@ -410,14 +408,18 @@ describe('EVM Family', () => {
|
|
|
410
408
|
|
|
411
409
|
// Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
|
|
412
410
|
expect(
|
|
413
|
-
etherscanOperationToOperations(
|
|
414
|
-
|
|
411
|
+
etherscanOperationToOperations(
|
|
412
|
+
address,
|
|
413
|
+
CHAIN_ID.ETHEREUM,
|
|
414
|
+
etherscanOpFees,
|
|
415
|
+
testLogger
|
|
416
|
+
)[0].value
|
|
415
417
|
).toEqual(BigInt(etherscanOpFees.value))
|
|
416
418
|
// Failing Op (value = tx value, same as success)
|
|
417
419
|
expect(
|
|
418
420
|
etherscanOperationToOperations(
|
|
419
421
|
address,
|
|
420
|
-
|
|
422
|
+
CHAIN_ID.ETHEREUM,
|
|
421
423
|
{
|
|
422
424
|
...etherscanOpFees,
|
|
423
425
|
isError: '1',
|
|
@@ -451,13 +453,18 @@ describe('EVM Family', () => {
|
|
|
451
453
|
|
|
452
454
|
// Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
|
|
453
455
|
expect(
|
|
454
|
-
etherscanOperationToOperations(
|
|
456
|
+
etherscanOperationToOperations(
|
|
457
|
+
address,
|
|
458
|
+
CHAIN_ID.ETHEREUM,
|
|
459
|
+
etherscanOpOut,
|
|
460
|
+
testLogger
|
|
461
|
+
)[0].value
|
|
455
462
|
).toEqual(BigInt(etherscanOpOut.value))
|
|
456
463
|
// Failing Op (value = tx value, same as success)
|
|
457
464
|
expect(
|
|
458
465
|
etherscanOperationToOperations(
|
|
459
466
|
address,
|
|
460
|
-
|
|
467
|
+
CHAIN_ID.ETHEREUM,
|
|
461
468
|
{
|
|
462
469
|
...etherscanOpOut,
|
|
463
470
|
isError: '1',
|
|
@@ -491,13 +498,14 @@ describe('EVM Family', () => {
|
|
|
491
498
|
|
|
492
499
|
// Successful Op
|
|
493
500
|
expect(
|
|
494
|
-
etherscanOperationToOperations(address,
|
|
501
|
+
etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOpIn, testLogger)[0]
|
|
502
|
+
.value
|
|
495
503
|
).toEqual(BigInt(etherscanOpIn.value))
|
|
496
504
|
// Failing Op
|
|
497
505
|
expect(
|
|
498
506
|
etherscanOperationToOperations(
|
|
499
507
|
address,
|
|
500
|
-
|
|
508
|
+
CHAIN_ID.ETHEREUM,
|
|
501
509
|
{
|
|
502
510
|
...etherscanOpIn,
|
|
503
511
|
isError: '1',
|
|
@@ -535,11 +543,10 @@ describe('EVM Family', () => {
|
|
|
535
543
|
|
|
536
544
|
it('should handle transaction with empty gasPrice without throwing (Blockscout Optimism)', () => {
|
|
537
545
|
const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
|
|
538
|
-
const currencyId = 'optimism'
|
|
539
546
|
|
|
540
547
|
const result = etherscanOperationToOperations(
|
|
541
548
|
address,
|
|
542
|
-
|
|
549
|
+
CHAIN_ID.OPTIMISM,
|
|
543
550
|
rawBlockscoutTransaction,
|
|
544
551
|
testLogger
|
|
545
552
|
)
|
|
@@ -551,11 +558,12 @@ describe('EVM Family', () => {
|
|
|
551
558
|
'0xea18d674a91c9b7459baad0e138bcca25fa342d8fa692c66489248a3ebb4ca9d'
|
|
552
559
|
)
|
|
553
560
|
expect(result[0].type).toBe('OUT')
|
|
561
|
+
expect(result[0].details).not.toHaveProperty('gasPrice')
|
|
562
|
+
expect(result[0].details).toHaveProperty('gasLimit', '163840')
|
|
554
563
|
})
|
|
555
564
|
|
|
556
565
|
it('should handle failed transaction with empty gasPrice', () => {
|
|
557
566
|
const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
|
|
558
|
-
const currencyId = 'optimism'
|
|
559
567
|
|
|
560
568
|
const failedTransaction: EtherscanOperation = {
|
|
561
569
|
...rawBlockscoutTransaction,
|
|
@@ -566,7 +574,7 @@ describe('EVM Family', () => {
|
|
|
566
574
|
|
|
567
575
|
const result = etherscanOperationToOperations(
|
|
568
576
|
address,
|
|
569
|
-
|
|
577
|
+
CHAIN_ID.OPTIMISM,
|
|
570
578
|
failedTransaction,
|
|
571
579
|
testLogger
|
|
572
580
|
)
|
|
@@ -579,7 +587,6 @@ describe('EVM Family', () => {
|
|
|
579
587
|
|
|
580
588
|
it('should handle transaction with both empty gasPrice and empty value', () => {
|
|
581
589
|
const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
|
|
582
|
-
const currencyId = 'optimism'
|
|
583
590
|
|
|
584
591
|
const txWithEmptyValue: EtherscanOperation = {
|
|
585
592
|
...rawBlockscoutTransaction,
|
|
@@ -588,7 +595,7 @@ describe('EVM Family', () => {
|
|
|
588
595
|
|
|
589
596
|
const result = etherscanOperationToOperations(
|
|
590
597
|
address,
|
|
591
|
-
|
|
598
|
+
CHAIN_ID.OPTIMISM,
|
|
592
599
|
txWithEmptyValue,
|
|
593
600
|
testLogger
|
|
594
601
|
)
|
|
@@ -598,6 +605,20 @@ describe('EVM Family', () => {
|
|
|
598
605
|
expect(result[0].value).toEqual(0n)
|
|
599
606
|
})
|
|
600
607
|
|
|
608
|
+
it('should omit an empty gas limit from details', () => {
|
|
609
|
+
const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
|
|
610
|
+
|
|
611
|
+
const [operation] = etherscanOperationToOperations(
|
|
612
|
+
address,
|
|
613
|
+
CHAIN_ID.OPTIMISM,
|
|
614
|
+
{ ...rawBlockscoutTransaction, gasPrice: '1000', gas: '' },
|
|
615
|
+
testLogger
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
expect(operation.details).toHaveProperty('gasPrice', '1000')
|
|
619
|
+
expect(operation.details).not.toHaveProperty('gasLimit')
|
|
620
|
+
})
|
|
621
|
+
|
|
601
622
|
it('should produce empty recipients when both to and contractAddress are empty strings', () => {
|
|
602
623
|
const etherscanOp: EtherscanOperation = {
|
|
603
624
|
blockNumber: '14923692',
|
|
@@ -622,11 +643,10 @@ describe('EVM Family', () => {
|
|
|
622
643
|
}
|
|
623
644
|
|
|
624
645
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
625
|
-
const currencyId = 'ethereum'
|
|
626
646
|
|
|
627
647
|
const result = etherscanOperationToOperations(
|
|
628
648
|
address,
|
|
629
|
-
|
|
649
|
+
CHAIN_ID.ETHEREUM,
|
|
630
650
|
etherscanOp,
|
|
631
651
|
testLogger
|
|
632
652
|
)
|
|
@@ -659,11 +679,10 @@ describe('EVM Family', () => {
|
|
|
659
679
|
}
|
|
660
680
|
|
|
661
681
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
662
|
-
const currencyId = 'ethereum'
|
|
663
682
|
|
|
664
683
|
const result = etherscanOperationToOperations(
|
|
665
684
|
address,
|
|
666
|
-
|
|
685
|
+
CHAIN_ID.ETHEREUM,
|
|
667
686
|
etherscanOp,
|
|
668
687
|
testLogger
|
|
669
688
|
)
|
|
@@ -701,7 +720,7 @@ describe('EVM Family', () => {
|
|
|
701
720
|
const address = '0x83802741df938c6cd94c46481cadba5b1b0c2f70'
|
|
702
721
|
const result = etherscanOperationToOperations(
|
|
703
722
|
address,
|
|
704
|
-
|
|
723
|
+
CHAIN_ID.OPTIMISM,
|
|
705
724
|
etherscanOp,
|
|
706
725
|
testLogger
|
|
707
726
|
)
|
|
@@ -737,7 +756,7 @@ describe('EVM Family', () => {
|
|
|
737
756
|
|
|
738
757
|
const result = etherscanOperationToOperations(
|
|
739
758
|
'0x9aa99c23f67c81701c772b106b4f83f6e858dd2e',
|
|
740
|
-
|
|
759
|
+
CHAIN_ID.ETHEREUM,
|
|
741
760
|
etherscanOp,
|
|
742
761
|
testLogger
|
|
743
762
|
)
|
|
@@ -796,6 +815,8 @@ describe('EVM Family', () => {
|
|
|
796
815
|
},
|
|
797
816
|
details: {
|
|
798
817
|
sequence: '53',
|
|
818
|
+
gasPrice: '24314367325',
|
|
819
|
+
gasLimit: '79381',
|
|
799
820
|
ledgerOpType: 'OUT',
|
|
800
821
|
assetAmount: '2000000',
|
|
801
822
|
assetSenders: ['0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d'],
|
|
@@ -857,6 +878,8 @@ describe('EVM Family', () => {
|
|
|
857
878
|
},
|
|
858
879
|
details: {
|
|
859
880
|
sequence: '53',
|
|
881
|
+
gasPrice: '24314367325',
|
|
882
|
+
gasLimit: '79381',
|
|
860
883
|
ledgerOpType: 'IN',
|
|
861
884
|
assetAmount: '2000000',
|
|
862
885
|
assetSenders: ['0xC2907EFccE4011C491BbedA8A0fA63BA7aab596C'],
|
|
@@ -949,6 +972,8 @@ describe('EVM Family', () => {
|
|
|
949
972
|
tx: sharedErc20Tx,
|
|
950
973
|
details: {
|
|
951
974
|
sequence: '53',
|
|
975
|
+
gasPrice: '24314367325',
|
|
976
|
+
gasLimit: '79381',
|
|
952
977
|
ledgerOpType: 'IN',
|
|
953
978
|
assetAmount: '2000000',
|
|
954
979
|
assetSenders: ['0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d'],
|
|
@@ -969,6 +994,8 @@ describe('EVM Family', () => {
|
|
|
969
994
|
tx: sharedErc20Tx,
|
|
970
995
|
details: {
|
|
971
996
|
sequence: '53',
|
|
997
|
+
gasPrice: '24314367325',
|
|
998
|
+
gasLimit: '79381',
|
|
972
999
|
ledgerOpType: 'OUT',
|
|
973
1000
|
assetAmount: '2000000',
|
|
974
1001
|
assetSenders: ['0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d'],
|
|
@@ -1012,6 +1039,8 @@ describe('EVM Family', () => {
|
|
|
1012
1039
|
expect(result).toHaveLength(1)
|
|
1013
1040
|
expect(result[0].tx.fees).toEqual(0n)
|
|
1014
1041
|
expect(result[0].value).toEqual(1000000000000000000n)
|
|
1042
|
+
expect(result[0].details).not.toHaveProperty('gasPrice')
|
|
1043
|
+
expect(result[0].details).toHaveProperty('gasLimit', '163840')
|
|
1015
1044
|
})
|
|
1016
1045
|
|
|
1017
1046
|
it('should produce empty recipients when to is an empty string', () => {
|
|
@@ -1095,6 +1124,8 @@ describe('EVM Family', () => {
|
|
|
1095
1124
|
},
|
|
1096
1125
|
details: {
|
|
1097
1126
|
sequence: '0',
|
|
1127
|
+
gasPrice: '40000000000',
|
|
1128
|
+
gasLimit: '158820',
|
|
1098
1129
|
tokenId: '202106',
|
|
1099
1130
|
ledgerOpType: 'NFT_OUT',
|
|
1100
1131
|
assetAmount: '1',
|
|
@@ -1153,6 +1184,8 @@ describe('EVM Family', () => {
|
|
|
1153
1184
|
},
|
|
1154
1185
|
details: {
|
|
1155
1186
|
sequence: '0',
|
|
1187
|
+
gasPrice: '40000000000',
|
|
1188
|
+
gasLimit: '158820',
|
|
1156
1189
|
tokenId: '202106',
|
|
1157
1190
|
ledgerOpType: 'NFT_IN',
|
|
1158
1191
|
assetAmount: '1',
|
|
@@ -1242,6 +1275,8 @@ describe('EVM Family', () => {
|
|
|
1242
1275
|
tx: sharedErc721Tx,
|
|
1243
1276
|
details: {
|
|
1244
1277
|
sequence: '0',
|
|
1278
|
+
gasPrice: '40000000000',
|
|
1279
|
+
gasLimit: '158820',
|
|
1245
1280
|
tokenId: '202106',
|
|
1246
1281
|
ledgerOpType: 'NFT_IN',
|
|
1247
1282
|
assetAmount: '1',
|
|
@@ -1259,6 +1294,8 @@ describe('EVM Family', () => {
|
|
|
1259
1294
|
tx: sharedErc721Tx,
|
|
1260
1295
|
details: {
|
|
1261
1296
|
sequence: '0',
|
|
1297
|
+
gasPrice: '40000000000',
|
|
1298
|
+
gasLimit: '158820',
|
|
1262
1299
|
tokenId: '202106',
|
|
1263
1300
|
ledgerOpType: 'NFT_OUT',
|
|
1264
1301
|
assetAmount: '1',
|
|
@@ -1355,6 +1392,8 @@ describe('EVM Family', () => {
|
|
|
1355
1392
|
},
|
|
1356
1393
|
details: {
|
|
1357
1394
|
sequence: '41',
|
|
1395
|
+
gasPrice: '52898577246',
|
|
1396
|
+
gasLimit: '140000',
|
|
1358
1397
|
tokenId: '10371',
|
|
1359
1398
|
ledgerOpType: 'NFT_OUT',
|
|
1360
1399
|
assetAmount: '1',
|
|
@@ -1413,6 +1452,8 @@ describe('EVM Family', () => {
|
|
|
1413
1452
|
},
|
|
1414
1453
|
details: {
|
|
1415
1454
|
sequence: '41',
|
|
1455
|
+
gasPrice: '52898577246',
|
|
1456
|
+
gasLimit: '140000',
|
|
1416
1457
|
tokenId: '10371',
|
|
1417
1458
|
ledgerOpType: 'NFT_IN',
|
|
1418
1459
|
assetAmount: '1',
|
|
@@ -1502,6 +1543,8 @@ describe('EVM Family', () => {
|
|
|
1502
1543
|
tx: sharedErc1155Tx,
|
|
1503
1544
|
details: {
|
|
1504
1545
|
sequence: '41',
|
|
1546
|
+
gasPrice: '52898577246',
|
|
1547
|
+
gasLimit: '140000',
|
|
1505
1548
|
tokenId: '10371',
|
|
1506
1549
|
ledgerOpType: 'NFT_IN',
|
|
1507
1550
|
assetAmount: '1',
|
|
@@ -1519,6 +1562,8 @@ describe('EVM Family', () => {
|
|
|
1519
1562
|
tx: sharedErc1155Tx,
|
|
1520
1563
|
details: {
|
|
1521
1564
|
sequence: '41',
|
|
1565
|
+
gasPrice: '52898577246',
|
|
1566
|
+
gasLimit: '140000',
|
|
1522
1567
|
tokenId: '10371',
|
|
1523
1568
|
ledgerOpType: 'NFT_OUT',
|
|
1524
1569
|
assetAmount: '1',
|
|
@@ -1853,7 +1898,6 @@ describe('EVM Family', () => {
|
|
|
1853
1898
|
}
|
|
1854
1899
|
|
|
1855
1900
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
1856
|
-
const currencyId = 'sei_evm'
|
|
1857
1901
|
|
|
1858
1902
|
const expectedOperation = {
|
|
1859
1903
|
id: `${address}-${stakingHash}-DELEGATE`,
|
|
@@ -1872,6 +1916,8 @@ describe('EVM Family', () => {
|
|
|
1872
1916
|
},
|
|
1873
1917
|
details: {
|
|
1874
1918
|
sequence: '7',
|
|
1919
|
+
gasPrice: '125521409858',
|
|
1920
|
+
gasLimit: '6000000',
|
|
1875
1921
|
contractInteraction: 'SmartContractInteraction',
|
|
1876
1922
|
contractAddress: '0x0000000000000000000000000000000000001005',
|
|
1877
1923
|
contractPayload:
|
|
@@ -1880,7 +1926,7 @@ describe('EVM Family', () => {
|
|
|
1880
1926
|
}
|
|
1881
1927
|
|
|
1882
1928
|
expect(
|
|
1883
|
-
etherscanOperationToOperations(address,
|
|
1929
|
+
etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
|
|
1884
1930
|
).toEqual([expectedOperation])
|
|
1885
1931
|
})
|
|
1886
1932
|
|
|
@@ -1910,7 +1956,6 @@ describe('EVM Family', () => {
|
|
|
1910
1956
|
}
|
|
1911
1957
|
|
|
1912
1958
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
1913
|
-
const currencyId = 'sei_evm'
|
|
1914
1959
|
|
|
1915
1960
|
const expectedOperation = {
|
|
1916
1961
|
id: `${address}-${stakingHash}-REDELEGATE`,
|
|
@@ -1929,6 +1974,8 @@ describe('EVM Family', () => {
|
|
|
1929
1974
|
},
|
|
1930
1975
|
details: {
|
|
1931
1976
|
sequence: '7',
|
|
1977
|
+
gasPrice: '125521409858',
|
|
1978
|
+
gasLimit: '6000000',
|
|
1932
1979
|
contractInteraction: 'SmartContractInteraction',
|
|
1933
1980
|
contractAddress: '0x0000000000000000000000000000000000001005',
|
|
1934
1981
|
contractPayload:
|
|
@@ -1937,7 +1984,7 @@ describe('EVM Family', () => {
|
|
|
1937
1984
|
}
|
|
1938
1985
|
|
|
1939
1986
|
expect(
|
|
1940
|
-
etherscanOperationToOperations(address,
|
|
1987
|
+
etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
|
|
1941
1988
|
).toEqual([expectedOperation])
|
|
1942
1989
|
})
|
|
1943
1990
|
|
|
@@ -1966,7 +2013,6 @@ describe('EVM Family', () => {
|
|
|
1966
2013
|
}
|
|
1967
2014
|
|
|
1968
2015
|
const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
|
|
1969
|
-
const currencyId = 'sei_evm'
|
|
1970
2016
|
|
|
1971
2017
|
const expectedOperation = {
|
|
1972
2018
|
id: `${address}-${stakingHash}-UNDELEGATE`,
|
|
@@ -1985,6 +2031,8 @@ describe('EVM Family', () => {
|
|
|
1985
2031
|
},
|
|
1986
2032
|
details: {
|
|
1987
2033
|
sequence: '7',
|
|
2034
|
+
gasPrice: '125521409858',
|
|
2035
|
+
gasLimit: '6000000',
|
|
1988
2036
|
contractInteraction: 'SmartContractInteraction',
|
|
1989
2037
|
contractAddress: '0x0000000000000000000000000000000000001005',
|
|
1990
2038
|
contractPayload: '0x8dfc88970000000000000000000000',
|
|
@@ -1992,7 +2040,7 @@ describe('EVM Family', () => {
|
|
|
1992
2040
|
}
|
|
1993
2041
|
|
|
1994
2042
|
expect(
|
|
1995
|
-
etherscanOperationToOperations(address,
|
|
2043
|
+
etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
|
|
1996
2044
|
).toEqual([expectedOperation])
|
|
1997
2045
|
})
|
|
1998
2046
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import type { ChainId } from '../config'
|
|
4
5
|
import type {
|
|
5
6
|
EtherscanERC1155Event,
|
|
6
7
|
EtherscanERC20Event,
|
|
@@ -59,7 +60,7 @@ export const safeDate = (op: { timeStamp?: string; timestamp?: string }): Date =
|
|
|
59
60
|
*/
|
|
60
61
|
export const etherscanOperationToOperations = (
|
|
61
62
|
address: string,
|
|
62
|
-
|
|
63
|
+
chainId: ChainId,
|
|
63
64
|
etherscanOp: EtherscanOperation,
|
|
64
65
|
logger: Logger
|
|
65
66
|
): Array<Operation<MemoNotSupported>> => {
|
|
@@ -82,7 +83,7 @@ export const etherscanOperationToOperations = (
|
|
|
82
83
|
if (from === checksummedAddress) {
|
|
83
84
|
const methodId = etherscanOp.methodId || etherscanOp.input?.slice(0, 10) || ''
|
|
84
85
|
const isContractInteraction = new RegExp(/0[xX][0-9a-fA-F]{8}/).test(methodId) // 0x + 4 bytes selector
|
|
85
|
-
const stakingType = detectEvmStakingOperationType(
|
|
86
|
+
const stakingType = detectEvmStakingOperationType(chainId, to, methodId)
|
|
86
87
|
types.push(stakingType ?? (isContractInteraction ? 'FEES' : 'OUT'))
|
|
87
88
|
}
|
|
88
89
|
if (!types.length) {
|
|
@@ -121,6 +122,7 @@ export const etherscanOperationToOperations = (
|
|
|
121
122
|
},
|
|
122
123
|
details: {
|
|
123
124
|
sequence: etherscanOp.nonce,
|
|
125
|
+
...gasDetails(etherscanOp.gasPrice, etherscanOp.gas),
|
|
124
126
|
...(contractExtra ?? {}),
|
|
125
127
|
},
|
|
126
128
|
}))
|
|
@@ -174,6 +176,7 @@ export const etherscanERC20EventToOperations = (
|
|
|
174
176
|
},
|
|
175
177
|
details: {
|
|
176
178
|
sequence: event.nonce,
|
|
179
|
+
...gasDetails(event.gasPrice, event.gas),
|
|
177
180
|
ledgerOpType: type,
|
|
178
181
|
assetAmount: event.value,
|
|
179
182
|
assetSenders: from ? [from] : [],
|
|
@@ -229,6 +232,7 @@ export const etherscanERC721EventToOperations = (
|
|
|
229
232
|
},
|
|
230
233
|
details: {
|
|
231
234
|
sequence: event.nonce,
|
|
235
|
+
...gasDetails(event.gasPrice, event.gas),
|
|
232
236
|
tokenId: event.tokenID,
|
|
233
237
|
ledgerOpType: type,
|
|
234
238
|
assetAmount: '1',
|
|
@@ -284,6 +288,7 @@ export const etherscanERC1155EventToOperations = (
|
|
|
284
288
|
},
|
|
285
289
|
details: {
|
|
286
290
|
sequence: event.nonce,
|
|
291
|
+
...gasDetails(event.gasPrice, event.gas),
|
|
287
292
|
tokenId: event.tokenID,
|
|
288
293
|
ledgerOpType: type,
|
|
289
294
|
assetAmount: event.tokenValue,
|
|
@@ -293,6 +298,17 @@ export const etherscanERC1155EventToOperations = (
|
|
|
293
298
|
}))
|
|
294
299
|
}
|
|
295
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Gas price and gas limit details of a transaction. Some Blockscout explorers (e.g. Optimism)
|
|
303
|
+
* report an empty `gasPrice`, so empty values are omitted rather than emitted as `''`.
|
|
304
|
+
*/
|
|
305
|
+
function gasDetails(gasPrice: string, gasLimit: string): Record<string, string> {
|
|
306
|
+
return {
|
|
307
|
+
...(gasPrice ? { gasPrice } : {}),
|
|
308
|
+
...(gasLimit ? { gasLimit } : {}),
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
296
312
|
/**
|
|
297
313
|
* `delegatecall`/`staticcall`/`callcode` cannot move native ETH, but both Blockscout and
|
|
298
314
|
* Etherscan still report a non-zero `value` on those entries (it's the `msg.value` inherited
|