@ledgerhq/coin-evm 10.0.0 → 15.0.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/.oxlintrc.json +2 -6
- package/CHANGELOG.md +54 -0
- package/docs/getBlock-internal-txs-schema.md +2 -2
- package/docs/network/node/index.md +1 -1
- package/lib/abis/index.d.ts +8 -0
- package/lib/abis/index.d.ts.map +1 -1
- package/lib/abis/index.js +30 -0
- package/lib/abis/index.js.map +1 -1
- package/lib/adapters/blockOperations.js +2 -2
- package/lib/adapters/blockOperations.js.map +1 -1
- package/lib/adapters/etherscan.d.ts +2 -1
- package/lib/adapters/etherscan.d.ts.map +1 -1
- package/lib/adapters/etherscan.js +2 -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 +2 -2
- package/lib/adapters/ledger.js.map +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +3 -2
- package/lib/api/index.js.map +1 -1
- package/lib/chains.d.ts +94 -0
- package/lib/chains.d.ts.map +1 -0
- package/lib/chains.js +98 -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/internalTxSources.d.ts.map +1 -1
- package/lib/internalTxSources.js +21 -3
- package/lib/internalTxSources.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 +22 -14
- package/lib/logic/common.js.map +1 -1
- package/lib/logic/craftTransaction.d.ts.map +1 -1
- package/lib/logic/craftTransaction.js +7 -4
- package/lib/logic/craftTransaction.js.map +1 -1
- package/lib/logic/estimateFees.d.ts.map +1 -1
- package/lib/logic/estimateFees.js +11 -8
- 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 +17 -17
- 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 +9 -9
- 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 +1 -1
- package/lib/logic/listOperations.js.map +1 -1
- package/lib/logic/predicates.d.ts +17 -0
- package/lib/logic/predicates.d.ts.map +1 -0
- package/lib/logic/predicates.js +126 -0
- package/lib/logic/predicates.js.map +1 -0
- 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 +11 -1
- package/lib/network/explorer/types.js.map +1 -1
- package/lib/network/gasTracker/ledger.d.ts.map +1 -1
- package/lib/network/gasTracker/ledger.js +1 -3
- package/lib/network/gasTracker/ledger.js.map +1 -1
- package/lib/network/node/explorerProxy.d.ts.map +1 -1
- package/lib/network/node/explorerProxy.js +22 -17
- package/lib/network/node/explorerProxy.js.map +1 -1
- package/lib/network/node/gethCallTracerToTraceBlockItems.d.ts.map +1 -1
- package/lib/network/node/gethCallTracerToTraceBlockItems.js +10 -12
- package/lib/network/node/gethCallTracerToTraceBlockItems.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 +38 -24
- 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 +104 -103
- package/lib/network/node/rpc.common.js.map +1 -1
- package/lib/network/node/types.d.ts +21 -22
- package/lib/network/node/types.d.ts.map +1 -1
- package/lib/network/node/types.js +0 -27
- 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/nodeSources.d.ts.map +1 -1
- package/lib/nodeSources.js +11 -3
- package/lib/nodeSources.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 +12 -13
- package/lib/staking/contracts.js.map +1 -1
- package/lib/staking/detectOperationType.d.ts +2 -4
- package/lib/staking/detectOperationType.d.ts.map +1 -1
- package/lib/staking/detectOperationType.js +22 -21
- 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 +39 -20
- 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 +14 -12
- 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 +22 -27
- 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/utils.d.ts.map +1 -1
- package/lib/staking/utils.js +22 -27
- package/lib/staking/utils.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 +44 -37
- 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 +7 -6
- 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 +25 -24
- 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 +10 -9
- 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/abis/index.d.ts +8 -0
- package/lib-es/abis/index.d.ts.map +1 -1
- package/lib-es/abis/index.js +29 -0
- package/lib-es/abis/index.js.map +1 -1
- package/lib-es/adapters/blockOperations.js +1 -1
- package/lib-es/adapters/blockOperations.js.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 +2 -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 +2 -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 +3 -2
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/chains.d.ts +94 -0
- package/lib-es/chains.d.ts.map +1 -0
- package/lib-es/chains.js +95 -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/internalTxSources.d.ts.map +1 -1
- package/lib-es/internalTxSources.js +21 -3
- package/lib-es/internalTxSources.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 +22 -14
- 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 +7 -4
- 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 +11 -8
- 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 +18 -18
- 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 +9 -9
- 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 +1 -1
- package/lib-es/logic/listOperations.js.map +1 -1
- package/lib-es/logic/predicates.d.ts +17 -0
- package/lib-es/logic/predicates.d.ts.map +1 -0
- package/lib-es/logic/predicates.js +114 -0
- package/lib-es/logic/predicates.js.map +1 -0
- 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 +11 -1
- package/lib-es/network/explorer/types.js.map +1 -1
- package/lib-es/network/gasTracker/ledger.d.ts.map +1 -1
- package/lib-es/network/gasTracker/ledger.js +1 -3
- package/lib-es/network/gasTracker/ledger.js.map +1 -1
- package/lib-es/network/node/explorerProxy.d.ts.map +1 -1
- package/lib-es/network/node/explorerProxy.js +22 -17
- package/lib-es/network/node/explorerProxy.js.map +1 -1
- package/lib-es/network/node/gethCallTracerToTraceBlockItems.d.ts.map +1 -1
- package/lib-es/network/node/gethCallTracerToTraceBlockItems.js +4 -6
- package/lib-es/network/node/gethCallTracerToTraceBlockItems.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 +38 -24
- 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 +102 -101
- package/lib-es/network/node/rpc.common.js.map +1 -1
- package/lib-es/network/node/types.d.ts +21 -22
- package/lib-es/network/node/types.d.ts.map +1 -1
- package/lib-es/network/node/types.js +0 -25
- 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/nodeSources.d.ts.map +1 -1
- package/lib-es/nodeSources.js +11 -3
- package/lib-es/nodeSources.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 +12 -13
- package/lib-es/staking/contracts.js.map +1 -1
- package/lib-es/staking/detectOperationType.d.ts +2 -4
- package/lib-es/staking/detectOperationType.d.ts.map +1 -1
- package/lib-es/staking/detectOperationType.js +22 -21
- 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 +39 -20
- 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 +13 -11
- 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 +19 -24
- 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/utils.d.ts.map +1 -1
- package/lib-es/staking/utils.js +20 -25
- package/lib-es/staking/utils.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 +43 -36
- 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 +6 -5
- 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 +24 -23
- 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 +9 -8
- 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/abis/index.test.ts +36 -0
- package/src/abis/index.ts +30 -0
- package/src/adapters/blockOperations.ts +1 -1
- package/src/adapters/etherscan.test.ts +34 -38
- package/src/adapters/etherscan.ts +3 -2
- package/src/adapters/ledger.test.ts +49 -22
- package/src/adapters/ledger.ts +3 -2
- package/src/api/getBlock.integ.test.ts +2 -1
- package/src/api/index.monad_testnet.integ.test.ts +2 -2
- package/src/api/index.ts +4 -3
- package/src/chains.test.ts +12 -0
- package/src/chains.ts +97 -0
- package/src/config.ts +5 -1
- package/src/fixtures/staking.fixtures.ts +13 -0
- package/src/internalTxSources.ts +20 -3
- package/src/logic/broadcast.ts +2 -2
- package/src/logic/common.ts +23 -14
- package/src/logic/craftTransaction.ts +6 -5
- package/src/logic/estimateFees.ts +10 -25
- package/src/logic/getBalance.ts +7 -13
- package/src/logic/getBlock.ts +22 -19
- 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 +7 -9
- package/src/logic/lastBlock.ts +2 -2
- package/src/logic/listOperations.ts +0 -1
- package/src/logic/predicates.ts +124 -0
- package/src/logic/tests/broadcast.test.ts +4 -4
- package/src/logic/tests/broadcastSource.test.ts +0 -3
- package/src/logic/tests/common.test.ts +17 -33
- package/src/logic/tests/craftTransaction.test.ts +13 -6
- package/src/logic/tests/estimateFees.test.ts +16 -7
- package/src/logic/tests/getBalance.test.ts +17 -33
- package/src/logic/tests/getBlock.test.ts +69 -75
- package/src/logic/tests/getBlockInfo.test.ts +1 -1
- package/src/logic/tests/getNextSequence.test.ts +1 -1
- package/src/logic/tests/getStakes.test.ts +28 -16
- package/src/logic/tests/internalTransactionsFetcher.test.ts +5 -5
- package/src/logic/tests/lastBlock.test.ts +3 -6
- package/src/logic/tests/listOperations.test.ts +3 -4
- package/src/logic/tests/validateIntent.test.ts +16 -3
- package/src/logic/validateIntent.ts +8 -10
- package/src/logic.test.ts +12 -4
- package/src/logic.ts +13 -13
- package/src/network/explorer/etherscan.test.ts +9 -58
- package/src/network/explorer/etherscan.ts +8 -24
- package/src/network/explorer/index.test.ts +1 -1
- package/src/network/explorer/ledger.test.ts +44 -146
- package/src/network/explorer/ledger.ts +2 -5
- package/src/network/explorer/types.ts +12 -5
- package/src/network/gasTracker/ledger.ts +1 -4
- package/src/network/node/explorerProxy.test.ts +17 -22
- package/src/network/node/explorerProxy.ts +23 -20
- package/src/network/node/gethCallTracerToTraceBlockItems.test.ts +1 -1
- package/src/network/node/gethCallTracerToTraceBlockItems.ts +6 -9
- package/src/network/node/index.memoization.test.ts +29 -22
- package/src/network/node/index.test.ts +1 -3
- package/src/network/node/index.ts +11 -8
- package/src/network/node/ledger.test.ts +63 -69
- package/src/network/node/ledger.ts +39 -38
- package/src/network/node/rpc.common.ts +134 -158
- package/src/network/node/rpc.test.ts +201 -110
- package/src/network/node/types.ts +17 -64
- package/src/network/node/withNodeSources.test.ts +7 -9
- package/src/network/node/withNodeSources.ts +23 -26
- package/src/nodeSources.ts +11 -3
- 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 +13 -14
- package/src/staking/detectOperationType.test.ts +16 -13
- package/src/staking/detectOperationType.ts +24 -22
- 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 +43 -21
- package/src/staking/prepareIntents.test.ts +14 -34
- package/src/staking/prepareIntents.ts +12 -14
- package/src/staking/redelegations.test.ts +73 -131
- package/src/staking/redelegations.ts +13 -31
- 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/utils.ts +19 -26
- package/src/staking/validators/index.ts +45 -51
- package/src/staking/validators/monad.test.ts +52 -54
- package/src/staking/validators/monad.ts +42 -40
- package/src/staking/validators/monadResolver.ts +4 -5
- package/src/staking/validators/sei.ts +2 -2
- package/src/staking/validators/somnia.test.ts +22 -19
- package/src/staking/validators/somnia.ts +23 -29
- 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 +7 -12
- package/src/staking/validators.integ.test.ts +3 -5
- package/src/staking/validators.test.ts +56 -53
- package/src/types/staking.ts +3 -6
|
@@ -1,63 +1,85 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import type { ChainId, EvmConfigInfo } from '../../config'
|
|
4
5
|
import type { StakingOperation } from '../../types/staking'
|
|
5
6
|
import type { OperationParams, StakingProtocol } from './types'
|
|
7
|
+
import { CHAIN_ID } from '../../config'
|
|
6
8
|
import celoProtocol from './celo'
|
|
7
9
|
import monadProtocol from './monad'
|
|
8
10
|
import seiProtocol from './sei'
|
|
9
11
|
import somniaProtocol from './somnia'
|
|
10
12
|
import zeroGravityProtocol from './zero_gravity'
|
|
11
13
|
|
|
12
|
-
const STAKING_PROTOCOLS
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const STAKING_PROTOCOLS = {
|
|
15
|
+
[CHAIN_ID.SEI_EVM]: seiProtocol,
|
|
16
|
+
[CHAIN_ID.CELO]: celoProtocol,
|
|
17
|
+
[CHAIN_ID.MONAD]: monadProtocol,
|
|
18
|
+
[CHAIN_ID.ZERO_GRAVITY]: zeroGravityProtocol,
|
|
19
|
+
[CHAIN_ID.SOMNIA]: somniaProtocol,
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
function isStakingProtocol(value: object): value is StakingProtocol {
|
|
23
|
+
return Object.values(value).every((entry) => typeof entry === 'function')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function stakingProtocolFor(chainId: ChainId): StakingProtocol | undefined {
|
|
27
|
+
switch (chainId) {
|
|
28
|
+
case CHAIN_ID.SEI_EVM:
|
|
29
|
+
case CHAIN_ID.CELO:
|
|
30
|
+
case CHAIN_ID.MONAD:
|
|
31
|
+
case CHAIN_ID.ZERO_GRAVITY:
|
|
32
|
+
case CHAIN_ID.SOMNIA: {
|
|
33
|
+
const protocol = STAKING_PROTOCOLS[chainId]
|
|
34
|
+
return isStakingProtocol(protocol) ? protocol : undefined
|
|
35
|
+
}
|
|
36
|
+
default:
|
|
37
|
+
return undefined
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const REQUIRES_VAL_ADDRESS = new Set<ChainId>([CHAIN_ID.CELO, CHAIN_ID.SEI_EVM, CHAIN_ID.SOMNIA])
|
|
21
42
|
|
|
22
43
|
export const buildTransactionParams = (
|
|
23
|
-
|
|
44
|
+
evmConfig: EvmConfigInfo,
|
|
24
45
|
transactionType: StakingOperation,
|
|
25
46
|
params: OperationParams
|
|
26
47
|
): Array<string | bigint> => {
|
|
27
|
-
const
|
|
48
|
+
const { chainId, name } = evmConfig
|
|
49
|
+
const protocol = stakingProtocolFor(chainId)
|
|
28
50
|
if (!protocol) {
|
|
29
|
-
throw new Error(`Unsupported staking currency: ${
|
|
51
|
+
throw new Error(`Unsupported staking currency: ${name}`)
|
|
30
52
|
}
|
|
31
53
|
|
|
32
54
|
const operation = protocol[transactionType]
|
|
33
55
|
if (!operation) {
|
|
34
|
-
throw new Error(`Unsupported transaction type for ${
|
|
56
|
+
throw new Error(`Unsupported transaction type for ${name}: ${transactionType}`)
|
|
35
57
|
}
|
|
36
58
|
|
|
37
|
-
if (!params.valAddress && REQUIRES_VAL_ADDRESS.has(
|
|
38
|
-
throw new Error(`${
|
|
59
|
+
if (!params.valAddress && REQUIRES_VAL_ADDRESS.has(chainId)) {
|
|
60
|
+
throw new Error(`${name} staking requires valAddress`)
|
|
39
61
|
}
|
|
40
62
|
|
|
41
|
-
if (!params.valId &&
|
|
42
|
-
throw new Error(`${
|
|
63
|
+
if (!params.valId && chainId === CHAIN_ID.MONAD) {
|
|
64
|
+
throw new Error(`${name} staking requires valId`)
|
|
43
65
|
}
|
|
44
66
|
|
|
45
|
-
if (!params.delegator &&
|
|
46
|
-
throw new Error(`${
|
|
67
|
+
if (!params.delegator && chainId === CHAIN_ID.ZERO_GRAVITY) {
|
|
68
|
+
throw new Error(`${name} staking requires delegator`)
|
|
47
69
|
}
|
|
48
70
|
|
|
49
|
-
if (
|
|
71
|
+
if (chainId === CHAIN_ID.ZERO_GRAVITY && transactionType === 'undelegate') {
|
|
50
72
|
if (params.shares === undefined || params.shares < 1_000_000_000n) {
|
|
51
|
-
throw new Error(`${
|
|
73
|
+
throw new Error(`${name} undelegate requires shares`)
|
|
52
74
|
}
|
|
53
75
|
}
|
|
54
76
|
|
|
55
77
|
if (
|
|
56
78
|
params.withdrawId === undefined &&
|
|
57
|
-
|
|
79
|
+
chainId === CHAIN_ID.MONAD &&
|
|
58
80
|
(transactionType === 'undelegate' || transactionType === 'withdraw')
|
|
59
81
|
) {
|
|
60
|
-
throw new Error(`${
|
|
82
|
+
throw new Error(`${name} ${transactionType} requires withdrawId`)
|
|
61
83
|
}
|
|
62
84
|
|
|
63
85
|
return operation(params)
|
|
@@ -7,6 +7,7 @@ import type { TransactionRequest } from 'ethers'
|
|
|
7
7
|
import { createStakingTransactionIntentMockData } from '@ledgerhq/coin-module-framework/test-utils'
|
|
8
8
|
import { ethers } from 'ethers'
|
|
9
9
|
import zeroGravityAbi from '../abis/zero_gravity-validator.abi.json'
|
|
10
|
+
import { CHAIN_ID } from '../config'
|
|
10
11
|
import { createMockEvmConfigInfo, mkExternalNode, testLogger } from '../fixtures/context.fixtures'
|
|
11
12
|
import { withApi } from '../network/node/rpc.common'
|
|
12
13
|
import { isExternalNodeConfig } from '../network/node/types'
|
|
@@ -20,7 +21,7 @@ const mockedWithApi = jest.mocked(withApi)
|
|
|
20
21
|
const mockedIsExternalNodeConfig = jest.mocked(isExternalNodeConfig)
|
|
21
22
|
|
|
22
23
|
const mockConfig = createMockEvmConfigInfo({
|
|
23
|
-
chainId:
|
|
24
|
+
chainId: CHAIN_ID.ZERO_GRAVITY,
|
|
24
25
|
node: mkExternalNode({ uri: 'https://zero-gravity.coin.ledger.com' }),
|
|
25
26
|
})
|
|
26
27
|
|
|
@@ -65,7 +66,7 @@ function makeCallHandler(options: {
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
function setupProvider(callHandler: ReturnType<typeof jest.fn>) {
|
|
68
|
-
mockedWithApi.mockImplementation(async (_config,
|
|
69
|
+
mockedWithApi.mockImplementation(async (_config, fn) =>
|
|
69
70
|
fn(Object.assign(Object.create(null), { call: callHandler }))
|
|
70
71
|
)
|
|
71
72
|
}
|
|
@@ -87,7 +88,6 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
87
88
|
|
|
88
89
|
const result = await prepareStakingIntent(
|
|
89
90
|
mockConfig,
|
|
90
|
-
'zero_gravity',
|
|
91
91
|
makeIntent({ useAllAmount: false }),
|
|
92
92
|
testLogger
|
|
93
93
|
)
|
|
@@ -99,12 +99,7 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
99
99
|
setupProvider(makeCallHandler({ getDelegationShares: 0n }))
|
|
100
100
|
|
|
101
101
|
await expect(
|
|
102
|
-
prepareStakingIntent(
|
|
103
|
-
mockConfig,
|
|
104
|
-
'zero_gravity',
|
|
105
|
-
makeIntent({ useAllAmount: false }),
|
|
106
|
-
testLogger
|
|
107
|
-
)
|
|
102
|
+
prepareStakingIntent(mockConfig, makeIntent({ useAllAmount: false }), testLogger)
|
|
108
103
|
).rejects.toThrow('no shares to undelegate from this validator')
|
|
109
104
|
})
|
|
110
105
|
|
|
@@ -119,7 +114,6 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
119
114
|
|
|
120
115
|
const result = await prepareStakingIntent(
|
|
121
116
|
mockConfig,
|
|
122
|
-
'zero_gravity',
|
|
123
117
|
makeIntent({ useAllAmount: false }),
|
|
124
118
|
testLogger
|
|
125
119
|
)
|
|
@@ -138,7 +132,6 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
138
132
|
|
|
139
133
|
const result = await prepareStakingIntent(
|
|
140
134
|
mockConfig,
|
|
141
|
-
'zero_gravity',
|
|
142
135
|
makeIntent({ useAllAmount: false }),
|
|
143
136
|
testLogger
|
|
144
137
|
)
|
|
@@ -156,12 +149,7 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
156
149
|
)
|
|
157
150
|
|
|
158
151
|
await expect(
|
|
159
|
-
prepareStakingIntent(
|
|
160
|
-
mockConfig,
|
|
161
|
-
'zero_gravity',
|
|
162
|
-
makeIntent({ useAllAmount: false }),
|
|
163
|
-
testLogger
|
|
164
|
-
)
|
|
152
|
+
prepareStakingIntent(mockConfig, makeIntent({ useAllAmount: false }), testLogger)
|
|
165
153
|
).rejects.toThrow('requested amount exceeds delegated shares')
|
|
166
154
|
})
|
|
167
155
|
|
|
@@ -175,12 +163,7 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
175
163
|
)
|
|
176
164
|
|
|
177
165
|
await expect(
|
|
178
|
-
prepareStakingIntent(
|
|
179
|
-
mockConfig,
|
|
180
|
-
'zero_gravity',
|
|
181
|
-
makeIntent({ useAllAmount: false }),
|
|
182
|
-
testLogger
|
|
183
|
-
)
|
|
166
|
+
prepareStakingIntent(mockConfig, makeIntent({ useAllAmount: false }), testLogger)
|
|
184
167
|
).rejects.toThrow('shares below 0G contract minimum')
|
|
185
168
|
})
|
|
186
169
|
|
|
@@ -189,7 +172,6 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
189
172
|
|
|
190
173
|
const result = await prepareStakingIntent(
|
|
191
174
|
mockConfig,
|
|
192
|
-
'zero_gravity',
|
|
193
175
|
makeIntent({ useAllAmount: true }),
|
|
194
176
|
testLogger
|
|
195
177
|
)
|
|
@@ -198,12 +180,7 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
198
180
|
})
|
|
199
181
|
|
|
200
182
|
it('is a no-op when shares is already set', async () => {
|
|
201
|
-
const result = await prepareStakingIntent(
|
|
202
|
-
mockConfig,
|
|
203
|
-
'zero_gravity',
|
|
204
|
-
makeIntent({ shares: 42n }),
|
|
205
|
-
testLogger
|
|
206
|
-
)
|
|
183
|
+
const result = await prepareStakingIntent(mockConfig, makeIntent({ shares: 42n }), testLogger)
|
|
207
184
|
|
|
208
185
|
expect(result).toMatchObject({
|
|
209
186
|
mode: 'undelegate',
|
|
@@ -216,7 +193,6 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
216
193
|
it('is a no-op when mode is not undelegate', async () => {
|
|
217
194
|
const result = await prepareStakingIntent(
|
|
218
195
|
mockConfig,
|
|
219
|
-
'zero_gravity',
|
|
220
196
|
makeIntent({ mode: 'delegate' }),
|
|
221
197
|
testLogger
|
|
222
198
|
)
|
|
@@ -231,7 +207,7 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
231
207
|
it('is a no-op when node is not external', async () => {
|
|
232
208
|
mockedIsExternalNodeConfig.mockReturnValue(false)
|
|
233
209
|
|
|
234
|
-
const result = await prepareStakingIntent(mockConfig,
|
|
210
|
+
const result = await prepareStakingIntent(mockConfig, makeIntent(), testLogger)
|
|
235
211
|
|
|
236
212
|
expect(result).toMatchObject({
|
|
237
213
|
mode: 'undelegate',
|
|
@@ -240,8 +216,12 @@ describe('prepareStakingIntent / zero_gravity', () => {
|
|
|
240
216
|
expect(mockedWithApi).not.toHaveBeenCalled()
|
|
241
217
|
})
|
|
242
218
|
|
|
243
|
-
it('is a no-op for
|
|
244
|
-
const result = await prepareStakingIntent(
|
|
219
|
+
it('is a no-op for chains without an intent preparer', async () => {
|
|
220
|
+
const result = await prepareStakingIntent(
|
|
221
|
+
{ ...mockConfig, chainId: CHAIN_ID.ETHEREUM },
|
|
222
|
+
makeIntent(),
|
|
223
|
+
testLogger
|
|
224
|
+
)
|
|
245
225
|
|
|
246
226
|
expect(result).toMatchObject({
|
|
247
227
|
mode: 'undelegate',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import type { EvmConfigInfo } from '../config'
|
|
4
|
+
import type { ChainId, EvmConfigInfo } from '../config'
|
|
5
5
|
import type {
|
|
6
6
|
BufferTxData,
|
|
7
7
|
MemoNotSupported,
|
|
@@ -9,6 +9,8 @@ import type {
|
|
|
9
9
|
} from '@ledgerhq/coin-module-framework/api/index'
|
|
10
10
|
import type { Logger } from '@ledgerhq/coin-module-framework/config'
|
|
11
11
|
import { ethers } from 'ethers'
|
|
12
|
+
import { toInterfaceAbi } from '../abis'
|
|
13
|
+
import { CHAIN_ID } from '../config'
|
|
12
14
|
import { isStakingIntent } from '../logic-public'
|
|
13
15
|
import { withApi } from '../network/node/rpc.common'
|
|
14
16
|
import { isExternalNodeConfig } from '../network/node/types'
|
|
@@ -40,12 +42,11 @@ function isWithdrawalFeeInGweiResult(value: unknown): value is WithdrawalFeeInGw
|
|
|
40
42
|
*/
|
|
41
43
|
type IntentPreparer = (
|
|
42
44
|
config: EvmConfigInfo,
|
|
43
|
-
currencyId: string,
|
|
44
45
|
intent: StakingIntent,
|
|
45
46
|
logger: Logger
|
|
46
47
|
) => Promise<StakingIntent>
|
|
47
48
|
|
|
48
|
-
const prepareMonadIntent: IntentPreparer = async (config,
|
|
49
|
+
const prepareMonadIntent: IntentPreparer = async (config, intent, logger) => {
|
|
49
50
|
if (!isStakingIntent(intent)) return intent
|
|
50
51
|
if (intent.mode !== 'undelegate' || intent.withdrawId !== undefined || !intent.valId) {
|
|
51
52
|
return intent
|
|
@@ -53,7 +54,6 @@ const prepareMonadIntent: IntentPreparer = async (config, _currencyId, intent, l
|
|
|
53
54
|
|
|
54
55
|
const withdrawId = await findFirstFreeWithdrawId(
|
|
55
56
|
config,
|
|
56
|
-
'monad',
|
|
57
57
|
BigInt(intent.valId),
|
|
58
58
|
intent.sender,
|
|
59
59
|
logger
|
|
@@ -71,26 +71,25 @@ const prepareMonadIntent: IntentPreparer = async (config, _currencyId, intent, l
|
|
|
71
71
|
return enriched
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
const prepareZeroGravityIntent: IntentPreparer = async (config,
|
|
74
|
+
const prepareZeroGravityIntent: IntentPreparer = async (config, intent) => {
|
|
75
75
|
if (!isStakingIntent(intent)) return intent
|
|
76
76
|
if (intent.mode !== 'undelegate' || intent.shares !== undefined || !intent.valAddress) {
|
|
77
77
|
return intent
|
|
78
78
|
}
|
|
79
79
|
if (!intent.useAllAmount && intent.amount <= 0n) return intent
|
|
80
80
|
|
|
81
|
-
const abi = getStakingABI(
|
|
81
|
+
const abi = getStakingABI(config.chainId)
|
|
82
82
|
if (!abi) return intent
|
|
83
83
|
|
|
84
84
|
const node = config.node
|
|
85
85
|
if (!isExternalNodeConfig(node)) return intent
|
|
86
86
|
|
|
87
|
-
const iface = new ethers.Interface(abi
|
|
87
|
+
const iface = new ethers.Interface(toInterfaceAbi(abi))
|
|
88
88
|
const valAddress = intent.valAddress
|
|
89
89
|
const delegator = intent.sender
|
|
90
90
|
|
|
91
91
|
const { shares, txValue } = await withApi(
|
|
92
92
|
config,
|
|
93
|
-
currencyId,
|
|
94
93
|
async (provider) => {
|
|
95
94
|
const rawDelegation = await provider.call({
|
|
96
95
|
to: valAddress,
|
|
@@ -143,9 +142,9 @@ const prepareZeroGravityIntent: IntentPreparer = async (config, currencyId, inte
|
|
|
143
142
|
return enriched
|
|
144
143
|
}
|
|
145
144
|
|
|
146
|
-
const STAKING_INTENT_PREPARERS: Record<
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
const STAKING_INTENT_PREPARERS: Partial<Record<ChainId, IntentPreparer>> = {
|
|
146
|
+
[CHAIN_ID.MONAD]: prepareMonadIntent,
|
|
147
|
+
[CHAIN_ID.ZERO_GRAVITY]: prepareZeroGravityIntent,
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
/**
|
|
@@ -155,10 +154,9 @@ const STAKING_INTENT_PREPARERS: Record<string, IntentPreparer> = {
|
|
|
155
154
|
*/
|
|
156
155
|
export const prepareStakingIntent = async (
|
|
157
156
|
config: EvmConfigInfo,
|
|
158
|
-
currencyId: string,
|
|
159
157
|
intent: StakingIntent,
|
|
160
158
|
logger: Logger
|
|
161
159
|
): Promise<StakingIntent> => {
|
|
162
|
-
const prepare = STAKING_INTENT_PREPARERS[
|
|
163
|
-
return prepare ? prepare(config,
|
|
160
|
+
const prepare = STAKING_INTENT_PREPARERS[config.chainId]
|
|
161
|
+
return prepare ? prepare(config, intent, logger) : intent
|
|
164
162
|
}
|