@ledgerhq/live-common 21.36.3 → 22.0.2
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/README.md +1 -3
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js +5 -5
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js.map +1 -1
- package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +11 -9
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/libcore-setup.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/libcore-setup.js +0 -6
- package/lib/__tests__/test-helpers/libcore-setup.js.map +1 -1
- package/lib/__tests__/test-helpers/libcore-setup.native.d.ts +0 -1
- package/lib/__tests__/test-helpers/libcore-setup.native.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/libcore-setup.native.js +0 -1
- package/lib/__tests__/test-helpers/libcore-setup.native.js.map +1 -1
- package/lib/__tests__/test-helpers/setup.js +2 -1
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/account/formatters.d.ts.map +1 -1
- package/lib/account/formatters.js +22 -7
- package/lib/account/formatters.js.map +1 -1
- package/lib/account/pending.d.ts +2 -1
- package/lib/account/pending.d.ts.map +1 -1
- package/lib/account/serialization.d.ts +6 -4
- package/lib/account/serialization.d.ts.map +1 -1
- package/lib/account/serialization.js +22 -7
- package/lib/account/serialization.js.map +1 -1
- package/lib/account/support.d.ts +0 -2
- package/lib/account/support.d.ts.map +1 -1
- package/lib/account/support.js +1 -22
- package/lib/account/support.js.map +1 -1
- package/lib/api/Ethereum.d.ts +6 -2
- package/lib/api/Ethereum.d.ts.map +1 -1
- package/lib/api/Ethereum.js +19 -3
- package/lib/api/Ethereum.js.map +1 -1
- package/lib/api/Ledger.d.ts.map +1 -1
- package/lib/api/Ledger.js +0 -9
- package/lib/api/Ledger.js.map +1 -1
- package/lib/api/explorerConfig/index.d.ts.map +1 -1
- package/lib/api/explorerConfig/index.js +7 -0
- package/lib/api/explorerConfig/index.js.map +1 -1
- package/lib/appSupportsQuitApp.d.ts +1 -0
- package/lib/appSupportsQuitApp.d.ts.map +1 -1
- package/lib/appSupportsQuitApp.js +1 -0
- package/lib/appSupportsQuitApp.js.map +1 -1
- package/lib/apps/support.d.ts.map +1 -1
- package/lib/apps/support.js +2 -1
- package/lib/apps/support.js.map +1 -1
- package/lib/bot/index.d.ts.map +1 -1
- package/lib/bot/index.js +16 -23
- package/lib/bot/index.js.map +1 -1
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/bridge/impl.js +3 -13
- package/lib/bridge/impl.js.map +1 -1
- package/lib/bridge/jsHelpers.d.ts +2 -2
- package/lib/bridge/jsHelpers.d.ts.map +1 -1
- package/lib/bridge/jsHelpers.js.map +1 -1
- package/lib/cross.d.ts.map +1 -1
- package/lib/cross.js +6 -7
- package/lib/cross.js.map +1 -1
- package/lib/derivation.d.ts +0 -39
- package/lib/derivation.d.ts.map +1 -1
- package/lib/derivation.js +5 -86
- package/lib/derivation.js.map +1 -1
- package/lib/env.d.ts +15 -25
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +12 -23
- package/lib/env.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/families/algorand/types.d.ts +0 -78
- package/lib/families/algorand/types.d.ts.map +1 -1
- package/lib/families/algorand/types.js +1 -154
- package/lib/families/algorand/types.js.map +1 -1
- package/lib/families/bitcoin/account.d.ts.map +1 -1
- package/lib/families/bitcoin/account.js +0 -1
- package/lib/families/bitcoin/account.js.map +1 -1
- package/lib/families/bitcoin/bridge.test.d.ts +2 -0
- package/lib/families/bitcoin/bridge.test.d.ts.map +1 -0
- package/lib/families/bitcoin/bridge.test.js +11 -0
- package/lib/families/bitcoin/bridge.test.js.map +1 -0
- package/lib/families/bitcoin/js-signOperation.d.ts.map +1 -1
- package/lib/families/bitcoin/js-signOperation.js.map +1 -1
- package/lib/families/bitcoin/js-synchronisation.d.ts.map +1 -1
- package/lib/families/bitcoin/js-synchronisation.js +6 -7
- package/lib/families/bitcoin/js-synchronisation.js.map +1 -1
- package/lib/families/bitcoin/logic.d.ts +2 -5
- package/lib/families/bitcoin/logic.d.ts.map +1 -1
- package/lib/families/bitcoin/logic.js +4 -123
- package/lib/families/bitcoin/logic.js.map +1 -1
- package/lib/families/bitcoin/networks.js +1 -1
- package/lib/families/bitcoin/networks.js.map +1 -1
- package/lib/families/bitcoin/serialization.d.ts +2 -2
- package/lib/families/bitcoin/serialization.d.ts.map +1 -1
- package/lib/families/bitcoin/serialization.js +2 -4
- package/lib/families/bitcoin/serialization.js.map +1 -1
- package/lib/families/bitcoin/specs.d.ts.map +1 -1
- package/lib/families/bitcoin/specs.js +8 -7
- package/lib/families/bitcoin/specs.js.map +1 -1
- package/lib/families/bitcoin/transaction.d.ts +1 -26
- package/lib/families/bitcoin/transaction.d.ts.map +1 -1
- package/lib/families/bitcoin/transaction.js +1 -239
- package/lib/families/bitcoin/transaction.js.map +1 -1
- package/lib/families/bitcoin/types.d.ts +0 -82
- package/lib/families/bitcoin/types.d.ts.map +1 -1
- package/lib/families/bitcoin/types.js +1 -118
- package/lib/families/bitcoin/types.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/explorer/index.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/explorer/index.js +12 -5
- package/lib/families/bitcoin/wallet-btc/explorer/index.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/storage/index.d.ts +1 -1
- package/lib/families/bitcoin/wallet-btc/storage/index.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/storage/index.js +6 -7
- package/lib/families/bitcoin/wallet-btc/storage/index.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/storage/types.d.ts +2 -2
- package/lib/families/bitcoin/wallet-btc/storage/types.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/utils.js +1 -1
- package/lib/families/bitcoin/wallet-btc/utils.js.map +1 -1
- package/lib/families/celo/js-getTransactionStatus.d.ts.map +1 -1
- package/lib/families/celo/js-getTransactionStatus.js +2 -0
- package/lib/families/celo/js-getTransactionStatus.js.map +1 -1
- package/lib/families/celo/types.d.ts +0 -5
- package/lib/families/celo/types.d.ts.map +1 -1
- package/lib/families/celo/types.js +0 -3
- package/lib/families/celo/types.js.map +1 -1
- package/lib/families/cosmos/api/Cosmos.js +1 -1
- package/lib/families/cosmos/api/Cosmos.js.map +1 -1
- package/lib/families/cosmos/bridge.test.d.ts +2 -0
- package/lib/families/cosmos/bridge.test.d.ts.map +1 -0
- package/lib/families/cosmos/bridge.test.js +11 -0
- package/lib/families/cosmos/bridge.test.js.map +1 -0
- package/lib/families/cosmos/js-signOperation.d.ts.map +1 -1
- package/lib/families/cosmos/js-signOperation.js.map +1 -1
- package/lib/families/cosmos/js-synchronisation.d.ts.map +1 -1
- package/lib/families/cosmos/js-synchronisation.js +2 -1
- package/lib/families/cosmos/js-synchronisation.js.map +1 -1
- package/lib/families/cosmos/logic.d.ts +0 -9
- package/lib/families/cosmos/logic.d.ts.map +1 -1
- package/lib/families/cosmos/logic.js +5 -20
- package/lib/families/cosmos/logic.js.map +1 -1
- package/lib/families/cosmos/types.d.ts +0 -190
- package/lib/families/cosmos/types.d.ts.map +1 -1
- package/lib/families/cosmos/types.js +0 -370
- package/lib/families/cosmos/types.js.map +1 -1
- package/lib/families/crypto_org/js-buildTransaction.js +1 -1
- package/lib/families/crypto_org/js-buildTransaction.js.map +1 -1
- package/lib/families/crypto_org/js-signOperation.d.ts.map +1 -1
- package/lib/families/crypto_org/js-signOperation.js +3 -4
- package/lib/families/crypto_org/js-signOperation.js.map +1 -1
- package/lib/families/crypto_org/types.d.ts +0 -5
- package/lib/families/crypto_org/types.d.ts.map +1 -1
- package/lib/families/crypto_org/types.js +0 -3
- package/lib/families/crypto_org/types.js.map +1 -1
- package/lib/families/elrond/types.d.ts +1 -6
- package/lib/families/elrond/types.d.ts.map +1 -1
- package/lib/families/elrond/types.js +0 -3
- package/lib/families/elrond/types.js.map +1 -1
- package/lib/families/ethereum/bridge/js.d.ts.map +1 -1
- package/lib/families/ethereum/bridge/js.js +6 -1
- package/lib/families/ethereum/bridge/js.js.map +1 -1
- package/lib/families/ethereum/bridge.test.d.ts +2 -0
- package/lib/families/ethereum/bridge.test.d.ts.map +1 -0
- package/lib/families/ethereum/bridge.test.js +11 -0
- package/lib/families/ethereum/bridge.test.js.map +1 -0
- package/lib/families/ethereum/modules/erc1155.js +9 -9
- package/lib/families/ethereum/modules/erc1155.js.map +1 -1
- package/lib/families/ethereum/modules/erc721.d.ts.map +1 -1
- package/lib/families/ethereum/modules/erc721.js +12 -16
- package/lib/families/ethereum/modules/erc721.js.map +1 -1
- package/lib/families/ethereum/nft.unit.test.d.ts +2 -0
- package/lib/families/ethereum/nft.unit.test.d.ts.map +1 -0
- package/lib/families/ethereum/{nft.merging.unit.test.js → nft.unit.test.js} +61 -6
- package/lib/families/ethereum/nft.unit.test.js.map +1 -0
- package/lib/families/ethereum/nftResolvers.d.ts +19 -0
- package/lib/families/ethereum/nftResolvers.d.ts.map +1 -0
- package/lib/families/ethereum/nftResolvers.js +121 -0
- package/lib/families/ethereum/nftResolvers.js.map +1 -0
- package/lib/families/ethereum/synchronisation.js +2 -2
- package/lib/families/ethereum/synchronisation.js.map +1 -1
- package/lib/families/ethereum/types.d.ts +0 -5
- package/lib/families/ethereum/types.d.ts.map +1 -1
- package/lib/families/ethereum/types.js +0 -3
- package/lib/families/ethereum/types.js.map +1 -1
- package/lib/families/filecoin/types.d.ts +0 -5
- package/lib/families/filecoin/types.d.ts.map +1 -1
- package/lib/families/filecoin/types.js +0 -3
- package/lib/families/filecoin/types.js.map +1 -1
- package/lib/families/neo/types.d.ts +0 -5
- package/lib/families/neo/types.d.ts.map +1 -1
- package/lib/families/neo/types.js +0 -3
- package/lib/families/neo/types.js.map +1 -1
- package/lib/families/polkadot/bridge.test.d.ts +2 -0
- package/lib/families/polkadot/bridge.test.d.ts.map +1 -0
- package/lib/families/polkadot/bridge.test.js +145 -0
- package/lib/families/polkadot/bridge.test.js.map +1 -0
- package/lib/families/polkadot/types.d.ts +0 -5
- package/lib/families/polkadot/types.d.ts.map +1 -1
- package/lib/families/polkadot/types.js +0 -3
- package/lib/families/polkadot/types.js.map +1 -1
- package/lib/families/ripple/bridge.test.d.ts +2 -0
- package/lib/families/ripple/bridge.test.d.ts.map +1 -0
- package/lib/{libcore/buildAccount/buildSubAccounts.js → families/ripple/bridge.test.js} +17 -20
- package/lib/families/ripple/bridge.test.js.map +1 -0
- package/lib/families/ripple/types.d.ts +0 -59
- package/lib/families/ripple/types.d.ts.map +1 -1
- package/lib/families/ripple/types.js +0 -87
- package/lib/families/ripple/types.js.map +1 -1
- package/lib/families/solana/api/cached.d.ts.map +1 -1
- package/lib/families/solana/api/cached.js +10 -0
- package/lib/families/solana/api/cached.js.map +1 -1
- package/lib/families/solana/api/chain/account/index.d.ts +1 -1
- package/lib/families/solana/api/chain/account/index.d.ts.map +1 -1
- package/lib/families/solana/api/chain/account/index.js +2 -1
- package/lib/families/solana/api/chain/account/index.js.map +1 -1
- package/lib/families/solana/api/chain/account/parser.d.ts +5 -0
- package/lib/families/solana/api/chain/account/parser.d.ts.map +1 -1
- package/lib/families/solana/api/chain/account/parser.js +24 -1
- package/lib/families/solana/api/chain/account/parser.js.map +1 -1
- package/lib/families/solana/api/chain/account/stake.d.ts +5 -5
- package/lib/families/solana/api/chain/account/token.d.ts +5 -5
- package/lib/families/solana/api/chain/account/vote.d.ts +252 -0
- package/lib/families/solana/api/chain/account/vote.d.ts.map +1 -0
- package/lib/families/solana/api/chain/account/vote.js +44 -0
- package/lib/families/solana/api/chain/account/vote.js.map +1 -0
- package/lib/families/solana/api/chain/index.d.ts +7 -0
- package/lib/families/solana/api/chain/index.d.ts.map +1 -1
- package/lib/families/solana/api/chain/index.js +35 -0
- package/lib/families/solana/api/chain/index.js.map +1 -1
- package/lib/families/solana/api/chain/instruction/stake/types.d.ts +7 -7
- package/lib/families/solana/api/chain/instruction/system/index.d.ts +15 -0
- package/lib/families/solana/api/chain/instruction/system/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/system/index.js +20 -0
- package/lib/families/solana/api/chain/instruction/system/index.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/system/types.d.ts +298 -0
- package/lib/families/solana/api/chain/instruction/system/types.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/system/types.js +117 -0
- package/lib/families/solana/api/chain/instruction/system/types.js.map +1 -0
- package/lib/families/solana/api/chain/program/parser.d.ts +5 -0
- package/lib/families/solana/api/chain/program/parser.d.ts.map +1 -1
- package/lib/families/solana/api/chain/program/parser.js +7 -0
- package/lib/families/solana/api/chain/program/parser.js.map +1 -1
- package/lib/families/solana/api/chain/web3.d.ts +20 -1
- package/lib/families/solana/api/chain/web3.d.ts.map +1 -1
- package/lib/families/solana/api/chain/web3.js +122 -1
- package/lib/families/solana/api/chain/web3.js.map +1 -1
- package/lib/families/solana/api/logged.d.ts.map +1 -1
- package/lib/families/solana/api/logged.js +5 -0
- package/lib/families/solana/api/logged.js.map +1 -1
- package/lib/families/solana/bridge/bridge.d.ts.map +1 -1
- package/lib/families/solana/bridge/bridge.js +16 -7
- package/lib/families/solana/bridge/bridge.js.map +1 -1
- package/lib/families/solana/bridge/mock-data.d.ts +116 -11
- package/lib/families/solana/bridge/mock-data.d.ts.map +1 -1
- package/lib/families/solana/bridge/mock-data.js +19 -493
- package/lib/families/solana/bridge/mock-data.js.map +1 -1
- package/lib/families/solana/bridge/mock.d.ts.map +1 -1
- package/lib/families/solana/bridge/mock.js +1 -0
- package/lib/families/solana/bridge/mock.js.map +1 -1
- package/lib/families/solana/bridge.test.d.ts +2 -0
- package/lib/families/solana/bridge.test.d.ts.map +1 -0
- package/lib/families/solana/bridge.test.js +11 -0
- package/lib/families/solana/bridge.test.js.map +1 -0
- package/lib/families/solana/cli-transaction.d.ts +5 -1
- package/lib/families/solana/cli-transaction.d.ts.map +1 -1
- package/lib/families/solana/cli-transaction.js +72 -4
- package/lib/families/solana/cli-transaction.js.map +1 -1
- package/lib/families/solana/deviceTransactionConfig.d.ts +3 -3
- package/lib/families/solana/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/families/solana/deviceTransactionConfig.js +128 -20
- package/lib/families/solana/deviceTransactionConfig.js.map +1 -1
- package/lib/families/solana/errors.d.ts +30 -0
- package/lib/families/solana/errors.d.ts.map +1 -1
- package/lib/families/solana/errors.js +11 -1
- package/lib/families/solana/errors.js.map +1 -1
- package/lib/families/solana/js-buildTransaction.d.ts.map +1 -1
- package/lib/families/solana/js-buildTransaction.js +13 -7
- package/lib/families/solana/js-buildTransaction.js.map +1 -1
- package/lib/families/solana/js-estimateMaxSpendable.d.ts.map +1 -1
- package/lib/families/solana/js-estimateMaxSpendable.js +26 -17
- package/lib/families/solana/js-estimateMaxSpendable.js.map +1 -1
- package/lib/families/solana/js-getTransactionStatus.d.ts +1 -1
- package/lib/families/solana/js-getTransactionStatus.d.ts.map +1 -1
- package/lib/families/solana/js-getTransactionStatus.js +36 -79
- package/lib/families/solana/js-getTransactionStatus.js.map +1 -1
- package/lib/families/solana/js-preload-data.d.ts +7 -0
- package/lib/families/solana/js-preload-data.d.ts.map +1 -0
- package/lib/families/solana/js-preload-data.js +45 -0
- package/lib/families/solana/js-preload-data.js.map +1 -0
- package/lib/families/solana/js-preload.d.ts +6 -0
- package/lib/families/solana/js-preload.d.ts.map +1 -0
- package/lib/{libcore/buildBigNumber.js → families/solana/js-preload.js} +60 -28
- package/lib/families/solana/js-preload.js.map +1 -0
- package/lib/families/solana/js-prepareTransaction.d.ts.map +1 -1
- package/lib/families/solana/js-prepareTransaction.js +453 -142
- package/lib/families/solana/js-prepareTransaction.js.map +1 -1
- package/lib/families/solana/js-signOperation.d.ts.map +1 -1
- package/lib/families/solana/js-signOperation.js +90 -68
- package/lib/families/solana/js-signOperation.js.map +1 -1
- package/lib/families/solana/js-synchronization.d.ts.map +1 -1
- package/lib/families/solana/js-synchronization.js +159 -57
- package/lib/families/solana/js-synchronization.js.map +1 -1
- package/lib/families/solana/logic.d.ts +16 -0
- package/lib/families/solana/logic.d.ts.map +1 -1
- package/lib/families/solana/logic.js +59 -1
- package/lib/families/solana/logic.js.map +1 -1
- package/lib/families/solana/react.d.ts +7 -0
- package/lib/families/solana/react.d.ts.map +1 -0
- package/lib/families/solana/react.js +56 -0
- package/lib/families/solana/react.js.map +1 -0
- package/lib/families/solana/serialization.d.ts +4 -0
- package/lib/families/solana/serialization.d.ts.map +1 -0
- package/lib/families/solana/serialization.js +16 -0
- package/lib/families/solana/serialization.js.map +1 -0
- package/lib/families/solana/specs.d.ts.map +1 -1
- package/lib/families/solana/specs.js +320 -0
- package/lib/families/solana/specs.js.map +1 -1
- package/lib/families/solana/speculos-deviceActions.d.ts +5 -0
- package/lib/families/solana/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/solana/speculos-deviceActions.js +189 -14
- package/lib/families/solana/speculos-deviceActions.js.map +1 -1
- package/lib/families/solana/test-dataset.d.ts +18 -0
- package/lib/families/solana/test-dataset.d.ts.map +1 -1
- package/lib/families/solana/test-dataset.js +694 -202
- package/lib/families/solana/test-dataset.js.map +1 -1
- package/lib/families/solana/test-specifics.d.ts +9 -0
- package/lib/families/solana/test-specifics.d.ts.map +1 -0
- package/lib/families/solana/test-specifics.js +238 -0
- package/lib/families/solana/test-specifics.js.map +1 -0
- package/lib/families/solana/transaction.d.ts.map +1 -1
- package/lib/families/solana/transaction.js +69 -13
- package/lib/families/solana/transaction.js.map +1 -1
- package/lib/families/solana/types.d.ts +129 -21
- package/lib/families/solana/types.d.ts.map +1 -1
- package/lib/families/solana/types.js +0 -3
- package/lib/families/solana/types.js.map +1 -1
- package/lib/families/solana/utils.d.ts +6 -0
- package/lib/families/solana/utils.d.ts.map +1 -1
- package/lib/families/solana/utils.js +76 -4
- package/lib/families/solana/utils.js.map +1 -1
- package/lib/families/solana/validator-app/index.d.ts +22 -0
- package/lib/families/solana/validator-app/index.d.ts.map +1 -0
- package/lib/families/{algorand/libcore-getFeesForTransaction.js → solana/validator-app/index.js} +45 -28
- package/lib/families/solana/validator-app/index.js.map +1 -0
- package/lib/families/stellar/api/horizon.d.ts +2 -1
- package/lib/families/stellar/api/horizon.d.ts.map +1 -1
- package/lib/families/stellar/api/horizon.js.map +1 -1
- package/lib/families/stellar/bridge.test.d.ts +2 -0
- package/lib/families/stellar/bridge.test.d.ts.map +1 -0
- package/lib/families/stellar/bridge.test.js +11 -0
- package/lib/families/stellar/bridge.test.js.map +1 -0
- package/lib/families/stellar/test-dataset.d.ts.map +1 -1
- package/lib/families/stellar/test-dataset.js +2 -4
- package/lib/families/stellar/test-dataset.js.map +1 -1
- package/lib/families/stellar/types.d.ts +0 -5
- package/lib/families/stellar/types.d.ts.map +1 -1
- package/lib/families/stellar/types.js +1 -3
- package/lib/families/stellar/types.js.map +1 -1
- package/lib/families/tezos/bridge/js.d.ts.map +1 -1
- package/lib/families/tezos/bridge/js.js +16 -3
- package/lib/families/tezos/bridge/js.js.map +1 -1
- package/lib/families/tezos/bridge.test.d.ts +2 -0
- package/lib/families/tezos/bridge.test.d.ts.map +1 -0
- package/lib/families/tezos/{test-specifics.js → bridge.test.js} +36 -33
- package/lib/families/tezos/bridge.test.js.map +1 -0
- package/lib/families/tezos/types.d.ts +0 -86
- package/lib/families/tezos/types.d.ts.map +1 -1
- package/lib/families/tezos/types.js +0 -138
- package/lib/families/tezos/types.js.map +1 -1
- package/lib/families/tron/types.d.ts +0 -6
- package/lib/families/tron/types.d.ts.map +1 -1
- package/lib/families/tron/types.js +0 -4
- package/lib/families/tron/types.js.map +1 -1
- package/lib/generated/cli-transaction.d.ts +5 -1
- package/lib/generated/cli-transaction.d.ts.map +1 -1
- package/lib/generated/customAddressValidation.d.ts +1 -10
- package/lib/generated/customAddressValidation.d.ts.map +1 -1
- package/lib/generated/customAddressValidation.js +1 -9
- package/lib/generated/customAddressValidation.js.map +1 -1
- package/lib/generated/speculos-deviceActions.d.ts +1 -0
- package/lib/generated/speculos-deviceActions.d.ts.map +1 -1
- package/lib/generated/types.d.ts +0 -92
- package/lib/generated/types.d.ts.map +1 -1
- package/lib/generated/types.js +0 -34
- package/lib/generated/types.js.map +1 -1
- package/lib/mock/account.d.ts.map +1 -1
- package/lib/mock/account.js +7 -1
- package/lib/mock/account.js.map +1 -1
- package/lib/nft/NftMetadataProvider/index.d.ts +9 -8
- package/lib/nft/NftMetadataProvider/index.d.ts.map +1 -1
- package/lib/nft/NftMetadataProvider/index.js +135 -69
- package/lib/nft/NftMetadataProvider/index.js.map +1 -1
- package/lib/nft/NftMetadataProvider/types.d.ts +13 -7
- package/lib/nft/NftMetadataProvider/types.d.ts.map +1 -1
- package/lib/nft/helpers.d.ts +24 -8
- package/lib/nft/helpers.d.ts.map +1 -1
- package/lib/nft/helpers.js +125 -40
- package/lib/nft/helpers.js.map +1 -1
- package/lib/nft/nftId.d.ts +7 -2
- package/lib/nft/nftId.d.ts.map +1 -1
- package/lib/nft/nftId.js +5 -4
- package/lib/nft/nftId.js.map +1 -1
- package/lib/nft/support.d.ts +2 -1
- package/lib/nft/support.d.ts.map +1 -1
- package/lib/nft/support.js +39 -1
- package/lib/nft/support.js.map +1 -1
- package/lib/reconciliation.d.ts.map +1 -1
- package/lib/reconciliation.js +8 -5
- package/lib/reconciliation.js.map +1 -1
- package/lib/types/account.d.ts +7 -3
- package/lib/types/account.d.ts.map +1 -1
- package/lib/types/bridge.d.ts +16 -1
- package/lib/types/bridge.d.ts.map +1 -1
- package/lib/types/nft.d.ts +28 -6
- package/lib/types/nft.d.ts.map +1 -1
- package/lib/walletconnect/index.d.ts.map +1 -1
- package/lib/walletconnect/index.js +7 -6
- package/lib/walletconnect/index.js.map +1 -1
- package/package.json +3 -4
- package/src/.DS_Store +0 -0
- package/src/{data/flags → __tests__}/.DS_Store +0 -0
- package/src/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.ts +5 -5
- package/src/__tests__/test-helpers/bridge.ts +11 -7
- package/src/__tests__/test-helpers/libcore-setup.native.ts +0 -1
- package/src/__tests__/test-helpers/libcore-setup.ts +1 -7
- package/src/__tests__/test-helpers/setup.ts +2 -1
- package/src/account/formatters.ts +6 -8
- package/src/account/serialization.ts +46 -6
- package/src/account/support.ts +2 -19
- package/src/api/Ethereum.ts +36 -6
- package/src/api/Ledger.ts +1 -12
- package/src/api/explorerConfig/index.ts +8 -0
- package/src/appSupportsQuitApp.ts +1 -0
- package/src/apps/support.ts +1 -0
- package/src/bot/index.ts +1 -6
- package/src/bridge/impl.ts +5 -17
- package/src/bridge/jsHelpers.ts +6 -3
- package/src/cross.ts +2 -4
- package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +6290 -0
- package/src/derivation.ts +1 -85
- package/src/env.ts +12 -23
- package/src/families/algorand/types.ts +2 -255
- package/src/{__tests__/__snapshots__/all.libcore.ts.snap → families/bitcoin/__snapshots__/bridge.test.ts.snap} +7085 -14082
- package/src/families/bitcoin/account.ts +0 -1
- package/src/families/bitcoin/bridge.test.ts +6 -0
- package/src/families/bitcoin/js-signOperation.ts +0 -5
- package/src/families/bitcoin/js-synchronisation.ts +5 -6
- package/src/families/bitcoin/logic.ts +2 -77
- package/src/families/bitcoin/networks.ts +1 -1
- package/src/families/bitcoin/serialization.ts +0 -4
- package/src/families/bitcoin/specs.ts +14 -7
- package/src/families/bitcoin/transaction.ts +0 -191
- package/src/families/bitcoin/types.ts +0 -225
- package/src/families/bitcoin/wallet-btc/explorer/index.ts +23 -23
- package/src/families/bitcoin/wallet-btc/storage/index.ts +6 -9
- package/src/families/bitcoin/wallet-btc/storage/types.ts +2 -2
- package/src/families/bitcoin/wallet-btc/utils.ts +1 -1
- package/src/families/celo/js-getTransactionStatus.ts +3 -1
- package/src/families/celo/types.ts +0 -6
- package/src/families/cosmos/__snapshots__/bridge.test.ts.snap +1156 -0
- package/src/families/cosmos/api/Cosmos.ts +1 -1
- package/src/families/cosmos/bridge.test.ts +6 -0
- package/src/families/cosmos/js-signOperation.ts +8 -0
- package/src/families/cosmos/js-synchronisation.ts +3 -1
- package/src/families/cosmos/logic.ts +4 -37
- package/src/families/cosmos/types.ts +1 -619
- package/src/families/crypto_org/js-buildTransaction.ts +1 -1
- package/src/families/crypto_org/js-signOperation.ts +2 -3
- package/src/families/crypto_org/types.ts +1 -5
- package/src/families/elrond/types.ts +2 -6
- package/src/families/ethereum/__snapshots__/bridge.test.ts.snap +3263 -0
- package/src/families/ethereum/bridge/js.ts +5 -0
- package/src/families/ethereum/bridge.test.ts +6 -0
- package/src/families/ethereum/modules/erc1155.ts +9 -9
- package/src/families/ethereum/modules/erc721.ts +11 -11
- package/src/families/ethereum/nft.unit.test.ts +147 -0
- package/src/families/ethereum/nftResolvers.ts +79 -0
- package/src/families/ethereum/synchronisation.ts +7 -2
- package/src/families/ethereum/types.ts +1 -6
- package/src/families/filecoin/types.ts +0 -6
- package/src/families/neo/types.ts +1 -5
- package/src/families/polkadot/bridge.test.ts +81 -0
- package/src/families/polkadot/types.ts +1 -5
- package/src/families/ripple/bridge.test.ts +12 -0
- package/src/families/ripple/types.ts +0 -143
- package/src/families/solana/__snapshots__/bridge.test.ts.snap +116 -0
- package/src/families/solana/api/cached.ts +40 -0
- package/src/families/solana/api/chain/account/index.ts +5 -1
- package/src/families/solana/api/chain/account/parser.ts +28 -0
- package/src/families/solana/api/chain/account/vote.ts +63 -0
- package/src/families/solana/api/chain/index.ts +63 -0
- package/src/families/solana/api/chain/instruction/system/index.ts +30 -0
- package/src/families/solana/api/chain/instruction/system/types.ts +141 -0
- package/src/families/solana/api/chain/program/parser.ts +18 -0
- package/src/families/solana/api/chain/web3.ts +173 -1
- package/src/families/solana/api/logged.ts +5 -0
- package/src/families/solana/bridge/bridge.ts +27 -4
- package/src/families/solana/bridge/mock-data.ts +19 -588
- package/src/families/solana/bridge/mock.ts +1 -0
- package/src/families/solana/bridge.test.ts +6 -0
- package/src/families/solana/cli-transaction.ts +87 -3
- package/src/families/solana/deviceTransactionConfig.ts +180 -24
- package/src/families/solana/errors.ts +40 -0
- package/src/families/solana/js-buildTransaction.ts +19 -8
- package/src/families/solana/js-estimateMaxSpendable.ts +20 -7
- package/src/families/solana/js-getTransactionStatus.ts +34 -93
- package/src/families/solana/js-preload-data.ts +53 -0
- package/src/families/solana/js-preload.ts +66 -0
- package/src/families/solana/js-prepareTransaction.ts +471 -148
- package/src/families/solana/js-signOperation.ts +177 -74
- package/src/families/solana/js-synchronization.ts +195 -54
- package/src/families/solana/logic.ts +80 -0
- package/src/families/solana/react.ts +81 -0
- package/src/families/solana/serialization.ts +17 -0
- package/src/families/solana/specs.ts +411 -1
- package/src/families/solana/speculos-deviceActions.ts +192 -15
- package/src/families/solana/test-dataset.ts +707 -327
- package/src/families/solana/test-specifics.ts +171 -0
- package/src/families/solana/transaction.ts +93 -16
- package/src/families/solana/types.ts +158 -27
- package/src/families/solana/utils.ts +52 -1
- package/src/families/solana/validator-app/index.ts +106 -0
- package/src/families/stellar/__snapshots__/bridge.test.ts.snap +2570 -0
- package/src/families/stellar/api/horizon.ts +2 -1
- package/src/families/stellar/bridge.test.ts +6 -0
- package/src/families/stellar/test-dataset.ts +2 -4
- package/src/families/stellar/types.ts +0 -5
- package/src/families/tezos/bridge/js.ts +16 -1
- package/src/families/tezos/bridge.test.ts +24 -0
- package/src/families/tezos/types.ts +0 -224
- package/src/families/tron/types.ts +1 -6
- package/src/generated/customAddressValidation.ts +0 -6
- package/src/generated/types.ts +0 -202
- package/src/mock/account.ts +7 -1
- package/src/nft/NftMetadataProvider/index.tsx +163 -75
- package/src/nft/NftMetadataProvider/types.ts +31 -8
- package/src/nft/helpers.ts +169 -35
- package/src/nft/nftId.ts +13 -4
- package/src/nft/support.ts +14 -1
- package/src/reconciliation.ts +10 -5
- package/src/types/account.ts +7 -3
- package/src/types/bridge.ts +20 -0
- package/src/types/nft.ts +32 -9
- package/src/walletconnect/index.ts +3 -1
- package/lib/__tests__/all.libcore.d.ts +0 -2
- package/lib/__tests__/all.libcore.d.ts.map +0 -1
- package/lib/__tests__/all.libcore.js +0 -203
- package/lib/__tests__/all.libcore.js.map +0 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/index.d.ts +0 -2
- package/lib/__tests__/test-helpers/implement-react-native-libcore/index.d.ts.map +0 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/index.js +0 -12
- package/lib/__tests__/test-helpers/implement-react-native-libcore/index.js.map +0 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.d.ts +0 -2
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.d.ts.map +0 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.js +0 -10
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.js.map +0 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.d.ts +0 -2
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.d.ts.map +0 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.js +0 -10
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.js.map +0 -1
- package/lib/bridge/shared.d.ts +0 -6
- package/lib/bridge/shared.d.ts.map +0 -1
- package/lib/bridge/shared.js +0 -78
- package/lib/bridge/shared.js.map +0 -1
- package/lib/families/algorand/bridge/libcore.d.ts +0 -17
- package/lib/families/algorand/bridge/libcore.d.ts.map +0 -1
- package/lib/families/algorand/bridge/libcore.js +0 -404
- package/lib/families/algorand/bridge/libcore.js.map +0 -1
- package/lib/families/algorand/buildASAOperation.d.ts +0 -8
- package/lib/families/algorand/buildASAOperation.d.ts.map +0 -1
- package/lib/families/algorand/buildASAOperation.js +0 -140
- package/lib/families/algorand/buildASAOperation.js.map +0 -1
- package/lib/families/algorand/libcore-broadcast.d.ts +0 -3
- package/lib/families/algorand/libcore-broadcast.d.ts.map +0 -1
- package/lib/families/algorand/libcore-broadcast.js +0 -63
- package/lib/families/algorand/libcore-broadcast.js.map +0 -1
- package/lib/families/algorand/libcore-buildOperation.d.ts +0 -7
- package/lib/families/algorand/libcore-buildOperation.d.ts.map +0 -1
- package/lib/families/algorand/libcore-buildOperation.js +0 -131
- package/lib/families/algorand/libcore-buildOperation.js.map +0 -1
- package/lib/families/algorand/libcore-buildSubAccounts.d.ts +0 -11
- package/lib/families/algorand/libcore-buildSubAccounts.d.ts.map +0 -1
- package/lib/families/algorand/libcore-buildSubAccounts.js +0 -221
- package/lib/families/algorand/libcore-buildSubAccounts.js.map +0 -1
- package/lib/families/algorand/libcore-buildTransaction.d.ts +0 -13
- package/lib/families/algorand/libcore-buildTransaction.d.ts.map +0 -1
- package/lib/families/algorand/libcore-buildTransaction.js +0 -144
- package/lib/families/algorand/libcore-buildTransaction.js.map +0 -1
- package/lib/families/algorand/libcore-getFeesForTransaction.d.ts +0 -17
- package/lib/families/algorand/libcore-getFeesForTransaction.d.ts.map +0 -1
- package/lib/families/algorand/libcore-getFeesForTransaction.js.map +0 -1
- package/lib/families/algorand/libcore-postBuildAccount.d.ts +0 -8
- package/lib/families/algorand/libcore-postBuildAccount.d.ts.map +0 -1
- package/lib/families/algorand/libcore-postBuildAccount.js +0 -99
- package/lib/families/algorand/libcore-postBuildAccount.js.map +0 -1
- package/lib/families/algorand/libcore-signOperation.d.ts +0 -4
- package/lib/families/algorand/libcore-signOperation.d.ts.map +0 -1
- package/lib/families/algorand/libcore-signOperation.js +0 -146
- package/lib/families/algorand/libcore-signOperation.js.map +0 -1
- package/lib/families/bitcoin/bridge/libcore.d.ts +0 -8
- package/lib/families/bitcoin/bridge/libcore.d.ts.map +0 -1
- package/lib/families/bitcoin/bridge/libcore.js +0 -333
- package/lib/families/bitcoin/bridge/libcore.js.map +0 -1
- package/lib/families/bitcoin/customAddressValidation.d.ts +0 -8
- package/lib/families/bitcoin/customAddressValidation.d.ts.map +0 -1
- package/lib/families/bitcoin/customAddressValidation.js +0 -67
- package/lib/families/bitcoin/customAddressValidation.js.map +0 -1
- package/lib/families/bitcoin/libcore-broadcast.d.ts +0 -3
- package/lib/families/bitcoin/libcore-broadcast.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-broadcast.js +0 -61
- package/lib/families/bitcoin/libcore-broadcast.js.map +0 -1
- package/lib/families/bitcoin/libcore-buildOperation.d.ts +0 -9
- package/lib/families/bitcoin/libcore-buildOperation.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-buildOperation.js +0 -74
- package/lib/families/bitcoin/libcore-buildOperation.js.map +0 -1
- package/lib/families/bitcoin/libcore-buildTransaction.d.ts +0 -14
- package/lib/families/bitcoin/libcore-buildTransaction.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-buildTransaction.js +0 -199
- package/lib/families/bitcoin/libcore-buildTransaction.js.map +0 -1
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.d.ts +0 -12
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.js +0 -87
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.js.map +0 -1
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.test.d.ts +0 -2
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.test.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.test.js +0 -71
- package/lib/families/bitcoin/libcore-getAccountNetworkInfo.test.js.map +0 -1
- package/lib/families/bitcoin/libcore-getFeesForTransaction.d.ts +0 -10
- package/lib/families/bitcoin/libcore-getFeesForTransaction.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-getFeesForTransaction.js +0 -110
- package/lib/families/bitcoin/libcore-getFeesForTransaction.js.map +0 -1
- package/lib/families/bitcoin/libcore-postBuildAccount.d.ts +0 -8
- package/lib/families/bitcoin/libcore-postBuildAccount.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-postBuildAccount.js +0 -108
- package/lib/families/bitcoin/libcore-postBuildAccount.js.map +0 -1
- package/lib/families/bitcoin/libcore-signOperation.d.ts +0 -4
- package/lib/families/bitcoin/libcore-signOperation.d.ts.map +0 -1
- package/lib/families/bitcoin/libcore-signOperation.js +0 -328
- package/lib/families/bitcoin/libcore-signOperation.js.map +0 -1
- package/lib/families/cosmos/bridge/libcore.d.ts +0 -8
- package/lib/families/cosmos/bridge/libcore.d.ts.map +0 -1
- package/lib/families/cosmos/bridge/libcore.js +0 -216
- package/lib/families/cosmos/bridge/libcore.js.map +0 -1
- package/lib/families/cosmos/libcore-broadcast.d.ts +0 -3
- package/lib/families/cosmos/libcore-broadcast.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-broadcast.js +0 -66
- package/lib/families/cosmos/libcore-broadcast.js.map +0 -1
- package/lib/families/cosmos/libcore-buildOperation.d.ts +0 -8
- package/lib/families/cosmos/libcore-buildOperation.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-buildOperation.js +0 -217
- package/lib/families/cosmos/libcore-buildOperation.js.map +0 -1
- package/lib/families/cosmos/libcore-buildTransaction.d.ts +0 -14
- package/lib/families/cosmos/libcore-buildTransaction.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-buildTransaction.js +0 -275
- package/lib/families/cosmos/libcore-buildTransaction.js.map +0 -1
- package/lib/families/cosmos/libcore-getFeesForTransaction.d.ts +0 -18
- package/lib/families/cosmos/libcore-getFeesForTransaction.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-getFeesForTransaction.js +0 -84
- package/lib/families/cosmos/libcore-getFeesForTransaction.js.map +0 -1
- package/lib/families/cosmos/libcore-getTransactionStatus.d.ts +0 -5
- package/lib/families/cosmos/libcore-getTransactionStatus.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-getTransactionStatus.js +0 -272
- package/lib/families/cosmos/libcore-getTransactionStatus.js.map +0 -1
- package/lib/families/cosmos/libcore-mergeOperations.d.ts +0 -4
- package/lib/families/cosmos/libcore-mergeOperations.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-mergeOperations.js +0 -49
- package/lib/families/cosmos/libcore-mergeOperations.js.map +0 -1
- package/lib/families/cosmos/libcore-postBuildAccount.d.ts +0 -8
- package/lib/families/cosmos/libcore-postBuildAccount.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-postBuildAccount.js +0 -313
- package/lib/families/cosmos/libcore-postBuildAccount.js.map +0 -1
- package/lib/families/cosmos/libcore-signOperation.d.ts +0 -4
- package/lib/families/cosmos/libcore-signOperation.d.ts.map +0 -1
- package/lib/families/cosmos/libcore-signOperation.js +0 -142
- package/lib/families/cosmos/libcore-signOperation.js.map +0 -1
- package/lib/families/cosmos/message.d.ts +0 -5
- package/lib/families/cosmos/message.d.ts.map +0 -1
- package/lib/families/cosmos/message.js +0 -233
- package/lib/families/cosmos/message.js.map +0 -1
- package/lib/families/cosmos/test-specifics.d.ts +0 -3
- package/lib/families/cosmos/test-specifics.d.ts.map +0 -1
- package/lib/families/cosmos/test-specifics.js +0 -307
- package/lib/families/cosmos/test-specifics.js.map +0 -1
- package/lib/families/ethereum/nft.merging.unit.test.d.ts +0 -2
- package/lib/families/ethereum/nft.merging.unit.test.d.ts.map +0 -1
- package/lib/families/ethereum/nft.merging.unit.test.js.map +0 -1
- package/lib/families/filecoin/customAddressValidation.d.ts +0 -8
- package/lib/families/filecoin/customAddressValidation.d.ts.map +0 -1
- package/lib/families/filecoin/customAddressValidation.js +0 -50
- package/lib/families/filecoin/customAddressValidation.js.map +0 -1
- package/lib/families/polkadot/test-specifics.d.ts +0 -3
- package/lib/families/polkadot/test-specifics.d.ts.map +0 -1
- package/lib/families/polkadot/test-specifics.js +0 -91
- package/lib/families/polkadot/test-specifics.js.map +0 -1
- package/lib/families/tezos/bridge/libcore.d.ts +0 -14
- package/lib/families/tezos/bridge/libcore.d.ts.map +0 -1
- package/lib/families/tezos/bridge/libcore.js +0 -336
- package/lib/families/tezos/bridge/libcore.js.map +0 -1
- package/lib/families/tezos/libcore-broadcast.d.ts +0 -3
- package/lib/families/tezos/libcore-broadcast.d.ts.map +0 -1
- package/lib/families/tezos/libcore-broadcast.js +0 -61
- package/lib/families/tezos/libcore-broadcast.js.map +0 -1
- package/lib/families/tezos/libcore-buildOperation.d.ts +0 -7
- package/lib/families/tezos/libcore-buildOperation.d.ts.map +0 -1
- package/lib/families/tezos/libcore-buildOperation.js +0 -93
- package/lib/families/tezos/libcore-buildOperation.js.map +0 -1
- package/lib/families/tezos/libcore-buildSubAccounts.d.ts +0 -11
- package/lib/families/tezos/libcore-buildSubAccounts.d.ts.map +0 -1
- package/lib/families/tezos/libcore-buildSubAccounts.js +0 -214
- package/lib/families/tezos/libcore-buildSubAccounts.js.map +0 -1
- package/lib/families/tezos/libcore-buildTransaction.d.ts +0 -14
- package/lib/families/tezos/libcore-buildTransaction.d.ts.map +0 -1
- package/lib/families/tezos/libcore-buildTransaction.js +0 -225
- package/lib/families/tezos/libcore-buildTransaction.js.map +0 -1
- package/lib/families/tezos/libcore-getAccountNetworkInfo.d.ts +0 -11
- package/lib/families/tezos/libcore-getAccountNetworkInfo.d.ts.map +0 -1
- package/lib/families/tezos/libcore-getAccountNetworkInfo.js +0 -66
- package/lib/families/tezos/libcore-getAccountNetworkInfo.js.map +0 -1
- package/lib/families/tezos/libcore-getFeesForTransaction.d.ts +0 -18
- package/lib/families/tezos/libcore-getFeesForTransaction.d.ts.map +0 -1
- package/lib/families/tezos/libcore-getFeesForTransaction.js +0 -73
- package/lib/families/tezos/libcore-getFeesForTransaction.js.map +0 -1
- package/lib/families/tezos/libcore-signOperation.d.ts +0 -4
- package/lib/families/tezos/libcore-signOperation.d.ts.map +0 -1
- package/lib/families/tezos/libcore-signOperation.js +0 -187
- package/lib/families/tezos/libcore-signOperation.js.map +0 -1
- package/lib/families/tezos/test-specifics.d.ts +0 -3
- package/lib/families/tezos/test-specifics.d.ts.map +0 -1
- package/lib/families/tezos/test-specifics.js.map +0 -1
- package/lib/families/tron/test-specifics.d.ts +0 -3
- package/lib/families/tron/test-specifics.d.ts.map +0 -1
- package/lib/families/tron/test-specifics.js +0 -205
- package/lib/families/tron/test-specifics.js.map +0 -1
- package/lib/generated/bridge/libcore.d.ts +0 -20
- package/lib/generated/bridge/libcore.d.ts.map +0 -1
- package/lib/generated/bridge/libcore.js +0 -16
- package/lib/generated/bridge/libcore.js.map +0 -1
- package/lib/generated/libcore-buildOperation.d.ts +0 -12
- package/lib/generated/libcore-buildOperation.d.ts.map +0 -1
- package/lib/generated/libcore-buildOperation.js +0 -16
- package/lib/generated/libcore-buildOperation.js.map +0 -1
- package/lib/generated/libcore-buildSubAccounts.d.ts +0 -8
- package/lib/generated/libcore-buildSubAccounts.d.ts.map +0 -1
- package/lib/generated/libcore-buildSubAccounts.js +0 -12
- package/lib/generated/libcore-buildSubAccounts.js.map +0 -1
- package/lib/generated/libcore-getAccountNetworkInfo.d.ts +0 -8
- package/lib/generated/libcore-getAccountNetworkInfo.d.ts.map +0 -1
- package/lib/generated/libcore-getAccountNetworkInfo.js +0 -12
- package/lib/generated/libcore-getAccountNetworkInfo.js.map +0 -1
- package/lib/generated/libcore-getFeesForTransaction.d.ts +0 -12
- package/lib/generated/libcore-getFeesForTransaction.d.ts.map +0 -1
- package/lib/generated/libcore-getFeesForTransaction.js +0 -16
- package/lib/generated/libcore-getFeesForTransaction.js.map +0 -1
- package/lib/generated/libcore-mergeOperations.d.ts +0 -5
- package/lib/generated/libcore-mergeOperations.d.ts.map +0 -1
- package/lib/generated/libcore-mergeOperations.js +0 -10
- package/lib/generated/libcore-mergeOperations.js.map +0 -1
- package/lib/generated/libcore-postBuildAccount.d.ts +0 -16
- package/lib/generated/libcore-postBuildAccount.d.ts.map +0 -1
- package/lib/generated/libcore-postBuildAccount.js +0 -14
- package/lib/generated/libcore-postBuildAccount.js.map +0 -1
- package/lib/generated/libcore-postSyncPatch.d.ts +0 -3
- package/lib/generated/libcore-postSyncPatch.d.ts.map +0 -1
- package/lib/generated/libcore-postSyncPatch.js +0 -4
- package/lib/generated/libcore-postSyncPatch.js.map +0 -1
- package/lib/generated/test-specifics.d.ts +0 -8
- package/lib/generated/test-specifics.d.ts.map +0 -1
- package/lib/generated/test-specifics.js +0 -16
- package/lib/generated/test-specifics.js.map +0 -1
- package/lib/libcore/access.d.ts +0 -11
- package/lib/libcore/access.d.ts.map +0 -1
- package/lib/libcore/access.js +0 -229
- package/lib/libcore/access.js.map +0 -1
- package/lib/libcore/broadcast.d.ts +0 -14
- package/lib/libcore/broadcast.d.ts.map +0 -1
- package/lib/libcore/broadcast.js +0 -68
- package/lib/libcore/broadcast.js.map +0 -1
- package/lib/libcore/buildAccount/buildOperation.d.ts +0 -15
- package/lib/libcore/buildAccount/buildOperation.d.ts.map +0 -1
- package/lib/libcore/buildAccount/buildOperation.js +0 -162
- package/lib/libcore/buildAccount/buildOperation.js.map +0 -1
- package/lib/libcore/buildAccount/buildSubAccounts.d.ts +0 -12
- package/lib/libcore/buildAccount/buildSubAccounts.d.ts.map +0 -1
- package/lib/libcore/buildAccount/buildSubAccounts.js.map +0 -1
- package/lib/libcore/buildAccount/index.d.ts +0 -15
- package/lib/libcore/buildAccount/index.d.ts.map +0 -1
- package/lib/libcore/buildAccount/index.js +0 -339
- package/lib/libcore/buildAccount/index.js.map +0 -1
- package/lib/libcore/buildBigNumber.d.ts +0 -7
- package/lib/libcore/buildBigNumber.d.ts.map +0 -1
- package/lib/libcore/buildBigNumber.js.map +0 -1
- package/lib/libcore/createAccountFromDevice.d.ts +0 -23
- package/lib/libcore/createAccountFromDevice.d.ts.map +0 -1
- package/lib/libcore/createAccountFromDevice.js +0 -143
- package/lib/libcore/createAccountFromDevice.js.map +0 -1
- package/lib/libcore/errors.d.ts +0 -6
- package/lib/libcore/errors.d.ts.map +0 -1
- package/lib/libcore/errors.js +0 -27
- package/lib/libcore/errors.js.map +0 -1
- package/lib/libcore/getAccountBalanceHistory.d.ts +0 -5
- package/lib/libcore/getAccountBalanceHistory.d.ts.map +0 -1
- package/lib/libcore/getAccountBalanceHistory.js +0 -87
- package/lib/libcore/getAccountBalanceHistory.js.map +0 -1
- package/lib/libcore/getAccountNetworkInfo.d.ts +0 -6
- package/lib/libcore/getAccountNetworkInfo.d.ts.map +0 -1
- package/lib/libcore/getAccountNetworkInfo.js +0 -91
- package/lib/libcore/getAccountNetworkInfo.js.map +0 -1
- package/lib/libcore/getCoreAccount.d.ts +0 -8
- package/lib/libcore/getCoreAccount.d.ts.map +0 -1
- package/lib/libcore/getCoreAccount.js +0 -78
- package/lib/libcore/getCoreAccount.js.map +0 -1
- package/lib/libcore/getFeesForTransaction.d.ts +0 -17
- package/lib/libcore/getFeesForTransaction.d.ts.map +0 -1
- package/lib/libcore/getFeesForTransaction.js +0 -87
- package/lib/libcore/getFeesForTransaction.js.map +0 -1
- package/lib/libcore/getOrCreateAccount.d.ts +0 -11
- package/lib/libcore/getOrCreateAccount.d.ts.map +0 -1
- package/lib/libcore/getOrCreateAccount.js +0 -142
- package/lib/libcore/getOrCreateAccount.js.map +0 -1
- package/lib/libcore/getOrCreateWallet.d.ts +0 -12
- package/lib/libcore/getOrCreateWallet.d.ts.map +0 -1
- package/lib/libcore/getOrCreateWallet.js +0 -138
- package/lib/libcore/getOrCreateWallet.js.map +0 -1
- package/lib/libcore/isValidRecipient.d.ts +0 -8
- package/lib/libcore/isValidRecipient.d.ts.map +0 -1
- package/lib/libcore/isValidRecipient.js +0 -78
- package/lib/libcore/isValidRecipient.js.map +0 -1
- package/lib/libcore/nativeSegwitAppsVersionsMap.d.ts +0 -6
- package/lib/libcore/nativeSegwitAppsVersionsMap.d.ts.map +0 -1
- package/lib/libcore/nativeSegwitAppsVersionsMap.js +0 -7
- package/lib/libcore/nativeSegwitAppsVersionsMap.js.map +0 -1
- package/lib/libcore/platforms/nodejs.d.ts +0 -7
- package/lib/libcore/platforms/nodejs.d.ts.map +0 -1
- package/lib/libcore/platforms/nodejs.js +0 -613
- package/lib/libcore/platforms/nodejs.js.map +0 -1
- package/lib/libcore/platforms/react-native.d.ts +0 -5
- package/lib/libcore/platforms/react-native.d.ts.map +0 -1
- package/lib/libcore/platforms/react-native.js +0 -286
- package/lib/libcore/platforms/react-native.js.map +0 -1
- package/lib/libcore/scanAccounts.d.ts +0 -12
- package/lib/libcore/scanAccounts.d.ts.map +0 -1
- package/lib/libcore/scanAccounts.js +0 -285
- package/lib/libcore/scanAccounts.js.map +0 -1
- package/lib/libcore/signOperation.d.ts +0 -38
- package/lib/libcore/signOperation.d.ts.map +0 -1
- package/lib/libcore/signOperation.js +0 -149
- package/lib/libcore/signOperation.js.map +0 -1
- package/lib/libcore/syncAccount.d.ts +0 -18
- package/lib/libcore/syncAccount.d.ts.map +0 -1
- package/lib/libcore/syncAccount.js +0 -165
- package/lib/libcore/syncAccount.js.map +0 -1
- package/lib/libcore/types/index.d.ts +0 -185
- package/lib/libcore/types/index.d.ts.map +0 -1
- package/lib/libcore/types/index.js +0 -359
- package/lib/libcore/types/index.js.map +0 -1
- package/src/__tests__/all.libcore.ts +0 -90
- package/src/__tests__/test-helpers/implement-react-native-libcore/index.ts +0 -6
- package/src/__tests__/test-helpers/implement-react-native-libcore/specific.android.ts +0 -4
- package/src/__tests__/test-helpers/implement-react-native-libcore/specific.ios.ts +0 -4
- package/src/bridge/shared.ts +0 -38
- package/src/families/algorand/bridge/libcore.ts +0 -345
- package/src/families/algorand/buildASAOperation.ts +0 -66
- package/src/families/algorand/libcore-broadcast.ts +0 -18
- package/src/families/algorand/libcore-buildOperation.ts +0 -69
- package/src/families/algorand/libcore-buildSubAccounts.ts +0 -132
- package/src/families/algorand/libcore-buildTransaction.ts +0 -115
- package/src/families/algorand/libcore-getFeesForTransaction.ts +0 -25
- package/src/families/algorand/libcore-postBuildAccount.ts +0 -42
- package/src/families/algorand/libcore-signOperation.ts +0 -104
- package/src/families/bitcoin/bridge/libcore.ts +0 -297
- package/src/families/bitcoin/customAddressValidation.ts +0 -30
- package/src/families/bitcoin/libcore-broadcast.ts +0 -15
- package/src/families/bitcoin/libcore-buildOperation.ts +0 -38
- package/src/families/bitcoin/libcore-buildTransaction.ts +0 -118
- package/src/families/bitcoin/libcore-getAccountNetworkInfo.test.ts +0 -27
- package/src/families/bitcoin/libcore-getAccountNetworkInfo.ts +0 -50
- package/src/families/bitcoin/libcore-getFeesForTransaction.ts +0 -67
- package/src/families/bitcoin/libcore-postBuildAccount.ts +0 -70
- package/src/families/bitcoin/libcore-signOperation.ts +0 -227
- package/src/families/cosmos/bridge/libcore.ts +0 -177
- package/src/families/cosmos/libcore-broadcast.ts +0 -24
- package/src/families/cosmos/libcore-buildOperation.ts +0 -121
- package/src/families/cosmos/libcore-buildTransaction.ts +0 -212
- package/src/families/cosmos/libcore-getFeesForTransaction.ts +0 -27
- package/src/families/cosmos/libcore-getTransactionStatus.ts +0 -299
- package/src/families/cosmos/libcore-mergeOperations.ts +0 -43
- package/src/families/cosmos/libcore-postBuildAccount.ts +0 -177
- package/src/families/cosmos/libcore-signOperation.ts +0 -96
- package/src/families/cosmos/message.ts +0 -155
- package/src/families/cosmos/test-specifics.ts +0 -225
- package/src/families/ethereum/nft.merging.unit.test.ts +0 -78
- package/src/families/filecoin/customAddressValidation.ts +0 -19
- package/src/families/polkadot/test-specifics.ts +0 -70
- package/src/families/tezos/bridge/libcore.ts +0 -312
- package/src/families/tezos/libcore-broadcast.ts +0 -16
- package/src/families/tezos/libcore-buildOperation.ts +0 -52
- package/src/families/tezos/libcore-buildSubAccounts.ts +0 -137
- package/src/families/tezos/libcore-buildTransaction.ts +0 -154
- package/src/families/tezos/libcore-getAccountNetworkInfo.ts +0 -25
- package/src/families/tezos/libcore-getFeesForTransaction.ts +0 -27
- package/src/families/tezos/libcore-signOperation.ts +0 -122
- package/src/families/tezos/test-specifics.ts +0 -19
- package/src/families/tron/test-specifics.ts +0 -137
- package/src/generated/bridge/libcore.ts +0 -15
- package/src/generated/libcore-buildOperation.ts +0 -15
- package/src/generated/libcore-buildSubAccounts.ts +0 -9
- package/src/generated/libcore-getAccountNetworkInfo.ts +0 -9
- package/src/generated/libcore-getFeesForTransaction.ts +0 -15
- package/src/generated/libcore-mergeOperations.ts +0 -6
- package/src/generated/libcore-postBuildAccount.ts +0 -12
- package/src/generated/libcore-postSyncPatch.ts +0 -3
- package/src/generated/test-specifics.ts +0 -15
- package/src/libcore/access.ts +0 -135
- package/src/libcore/broadcast.ts +0 -34
- package/src/libcore/buildAccount/buildOperation.ts +0 -96
- package/src/libcore/buildAccount/buildSubAccounts.ts +0 -24
- package/src/libcore/buildAccount/index.ts +0 -259
- package/src/libcore/buildBigNumber.ts +0 -28
- package/src/libcore/createAccountFromDevice.ts +0 -108
- package/src/libcore/errors.ts +0 -20
- package/src/libcore/getAccountBalanceHistory.ts +0 -56
- package/src/libcore/getAccountNetworkInfo.ts +0 -46
- package/src/libcore/getCoreAccount.ts +0 -37
- package/src/libcore/getFeesForTransaction.ts +0 -46
- package/src/libcore/getOrCreateAccount.ts +0 -93
- package/src/libcore/getOrCreateWallet.ts +0 -91
- package/src/libcore/isValidRecipient.ts +0 -36
- package/src/libcore/nativeSegwitAppsVersionsMap.ts +0 -4
- package/src/libcore/platforms/nodejs.ts +0 -627
- package/src/libcore/platforms/react-native.ts +0 -242
- package/src/libcore/scanAccounts.ts +0 -280
- package/src/libcore/signOperation.ts +0 -141
- package/src/libcore/syncAccount.ts +0 -152
- package/src/libcore/types/index.ts +0 -645
|
@@ -10,12 +10,31 @@ import type {
|
|
|
10
10
|
import { Transaction as SolanaTransaction } from "./types";
|
|
11
11
|
import { assertUnreachable } from "./utils";
|
|
12
12
|
|
|
13
|
-
const modes = [
|
|
13
|
+
const modes = [
|
|
14
|
+
"send",
|
|
15
|
+
"optIn",
|
|
16
|
+
"stake.createAccount",
|
|
17
|
+
"stake.delegate",
|
|
18
|
+
"stake.undelegate",
|
|
19
|
+
"stake.withdraw",
|
|
20
|
+
"stake.split",
|
|
21
|
+
] as const;
|
|
14
22
|
type Mode = typeof modes[number];
|
|
15
23
|
|
|
16
|
-
// options already specified
|
|
24
|
+
// some options already specified for other blockchains like ethereum.
|
|
17
25
|
// trying to reuse existing ones like <token>, <mode>, etc.
|
|
18
|
-
const options = [
|
|
26
|
+
const options = [
|
|
27
|
+
{
|
|
28
|
+
name: "solanaValidator",
|
|
29
|
+
type: String,
|
|
30
|
+
desc: "validator address to delegate to",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "solanaStakeAccount",
|
|
34
|
+
type: String,
|
|
35
|
+
desc: "stake account address to use in the transaction",
|
|
36
|
+
},
|
|
37
|
+
];
|
|
19
38
|
|
|
20
39
|
function inferTransactions(
|
|
21
40
|
transactions: Array<{
|
|
@@ -99,6 +118,65 @@ function inferTransactions(
|
|
|
99
118
|
};
|
|
100
119
|
return solanaTx;
|
|
101
120
|
}
|
|
121
|
+
case "stake.createAccount": {
|
|
122
|
+
const validator = opts.solanaValidator;
|
|
123
|
+
return {
|
|
124
|
+
...transaction,
|
|
125
|
+
model: {
|
|
126
|
+
kind: "stake.createAccount",
|
|
127
|
+
uiState: {
|
|
128
|
+
delegate: {
|
|
129
|
+
voteAccAddress: validator ?? "",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
case "stake.delegate":
|
|
136
|
+
return {
|
|
137
|
+
...transaction,
|
|
138
|
+
model: {
|
|
139
|
+
kind: "stake.delegate",
|
|
140
|
+
uiState: {
|
|
141
|
+
stakeAccAddr: opts.solanaStakeAccount ?? "",
|
|
142
|
+
voteAccAddr: opts.solanaValidator ?? "",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
case "stake.undelegate":
|
|
147
|
+
return {
|
|
148
|
+
...transaction,
|
|
149
|
+
model: {
|
|
150
|
+
kind: "stake.undelegate",
|
|
151
|
+
uiState: {
|
|
152
|
+
stakeAccAddr: opts.solanaStakeAccount ?? "",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
case "stake.withdraw":
|
|
157
|
+
return {
|
|
158
|
+
...transaction,
|
|
159
|
+
model: {
|
|
160
|
+
kind: "stake.withdraw",
|
|
161
|
+
uiState: {
|
|
162
|
+
stakeAccAddr: opts.solanaStakeAccount ?? "",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
case "stake.split":
|
|
167
|
+
if (opts.solanaStakeAccount === undefined) {
|
|
168
|
+
throw new Error("stake account is required");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return {
|
|
172
|
+
...transaction,
|
|
173
|
+
model: {
|
|
174
|
+
kind: "stake.split",
|
|
175
|
+
uiState: {
|
|
176
|
+
stakeAccAddr: opts.solanaStakeAccount,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
102
180
|
default:
|
|
103
181
|
return assertUnreachable(mode);
|
|
104
182
|
}
|
|
@@ -146,6 +224,12 @@ function inferAccounts(
|
|
|
146
224
|
return [subAccount];
|
|
147
225
|
}
|
|
148
226
|
case "optIn":
|
|
227
|
+
case "stake.createAccount":
|
|
228
|
+
case "stake.delegate":
|
|
229
|
+
case "stake.undelegate":
|
|
230
|
+
case "stake.withdraw":
|
|
231
|
+
case "stake.split":
|
|
232
|
+
// TODO: infer stake account for stake ops
|
|
149
233
|
return [mainAccount];
|
|
150
234
|
default:
|
|
151
235
|
return assertUnreachable(mode);
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import { formatCurrencyUnit } from "../../currencies";
|
|
3
|
+
import type { DeviceTransactionField } from "../../transaction";
|
|
4
|
+
import type { Account, AccountLike } from "../../types";
|
|
2
5
|
import type {
|
|
6
|
+
CommandDescriptor,
|
|
7
|
+
StakeCreateAccountCommand,
|
|
8
|
+
StakeDelegateCommand,
|
|
9
|
+
StakeSplitCommand,
|
|
10
|
+
StakeUndelegateCommand,
|
|
11
|
+
StakeWithdrawCommand,
|
|
3
12
|
TokenCreateATACommand,
|
|
4
13
|
TokenTransferCommand,
|
|
5
14
|
Transaction,
|
|
6
15
|
TransferCommand,
|
|
7
|
-
ValidCommandDescriptor,
|
|
8
16
|
} from "./types";
|
|
9
|
-
import type { DeviceTransactionField } from "../../transaction";
|
|
10
17
|
import { assertUnreachable } from "./utils";
|
|
11
18
|
|
|
12
19
|
// do not show fields like 'To', 'Recipient', etc., as per Ledger policy
|
|
13
20
|
|
|
14
21
|
function getDeviceTransactionConfig({
|
|
22
|
+
account,
|
|
15
23
|
transaction,
|
|
16
24
|
}: {
|
|
17
25
|
account: AccountLike;
|
|
@@ -22,19 +30,18 @@ function getDeviceTransactionConfig({
|
|
|
22
30
|
if (commandDescriptor === undefined) {
|
|
23
31
|
throw new Error("missing command descriptor");
|
|
24
32
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return fieldsForCommand(commandDescriptor);
|
|
28
|
-
case "invalid":
|
|
29
|
-
throw new Error("unexpected invalid command");
|
|
30
|
-
default:
|
|
31
|
-
return assertUnreachable(commandDescriptor);
|
|
33
|
+
if (Object.keys(commandDescriptor.errors).length > 0) {
|
|
34
|
+
throw new Error("unexpected invalid command");
|
|
32
35
|
}
|
|
36
|
+
|
|
37
|
+
return fieldsForCommand(commandDescriptor, account);
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
export default getDeviceTransactionConfig;
|
|
41
|
+
|
|
36
42
|
function fieldsForCommand(
|
|
37
|
-
commandDescriptor:
|
|
43
|
+
commandDescriptor: CommandDescriptor,
|
|
44
|
+
account: AccountLike
|
|
38
45
|
): DeviceTransactionField[] {
|
|
39
46
|
const { command } = commandDescriptor;
|
|
40
47
|
switch (command.kind) {
|
|
@@ -44,12 +51,24 @@ function fieldsForCommand(
|
|
|
44
51
|
return fieldsForTokenTransfer(command);
|
|
45
52
|
case "token.createATA":
|
|
46
53
|
return fieldsForCreateATA(command);
|
|
54
|
+
case "stake.createAccount":
|
|
55
|
+
return fieldsForStakeCreateAccount(command, account);
|
|
56
|
+
case "stake.delegate":
|
|
57
|
+
return fieldsForStakeDelegate(command);
|
|
58
|
+
case "stake.undelegate":
|
|
59
|
+
return fieldsForStakeUndelegate(command);
|
|
60
|
+
case "stake.withdraw":
|
|
61
|
+
return fieldsForStakeWithdraw(command);
|
|
62
|
+
case "stake.split":
|
|
63
|
+
return fieldsForStakeSplit(command);
|
|
47
64
|
default:
|
|
48
65
|
return assertUnreachable(command);
|
|
49
66
|
}
|
|
50
67
|
}
|
|
51
68
|
|
|
52
|
-
function fieldsForTransfer(
|
|
69
|
+
function fieldsForTransfer(
|
|
70
|
+
_command: TransferCommand
|
|
71
|
+
): DeviceTransactionField[] {
|
|
53
72
|
const fields: Array<DeviceTransactionField> = [];
|
|
54
73
|
|
|
55
74
|
fields.push({
|
|
@@ -57,18 +76,6 @@ function fieldsForTransfer(command: TransferCommand): DeviceTransactionField[] {
|
|
|
57
76
|
label: "Transfer",
|
|
58
77
|
});
|
|
59
78
|
|
|
60
|
-
fields.push({
|
|
61
|
-
type: "address",
|
|
62
|
-
address: command.sender,
|
|
63
|
-
label: "Sender",
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
fields.push({
|
|
67
|
-
type: "text",
|
|
68
|
-
label: "Fee payer",
|
|
69
|
-
value: "Sender",
|
|
70
|
-
});
|
|
71
|
-
|
|
72
79
|
return fields;
|
|
73
80
|
}
|
|
74
81
|
function fieldsForTokenTransfer(
|
|
@@ -158,3 +165,152 @@ function fieldsForCreateATA(
|
|
|
158
165
|
|
|
159
166
|
return fields;
|
|
160
167
|
}
|
|
168
|
+
function fieldsForStakeCreateAccount(
|
|
169
|
+
command: StakeCreateAccountCommand,
|
|
170
|
+
account: AccountLike
|
|
171
|
+
): DeviceTransactionField[] {
|
|
172
|
+
if (account.type !== "Account") {
|
|
173
|
+
throw new Error("unsupported account type");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const unit = account.currency.units[0];
|
|
177
|
+
|
|
178
|
+
const fields: Array<DeviceTransactionField> = [];
|
|
179
|
+
|
|
180
|
+
fields.push({
|
|
181
|
+
type: "address",
|
|
182
|
+
label: "Delegate from",
|
|
183
|
+
address: command.stakeAccAddress,
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// not using 'amount' field here because the field should
|
|
187
|
+
// show sum of amount and rent exempt amount
|
|
188
|
+
fields.push({
|
|
189
|
+
type: "text",
|
|
190
|
+
label: "Deposit",
|
|
191
|
+
value: formatCurrencyUnit(
|
|
192
|
+
unit,
|
|
193
|
+
new BigNumber(command.amount + command.stakeAccRentExemptAmount),
|
|
194
|
+
{
|
|
195
|
+
disableRounding: true,
|
|
196
|
+
showCode: true,
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
fields.push({
|
|
202
|
+
type: "address",
|
|
203
|
+
label: "New authority",
|
|
204
|
+
address: command.fromAccAddress,
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
fields.push({
|
|
208
|
+
type: "address",
|
|
209
|
+
label: "Vote account",
|
|
210
|
+
address: command.delegate.voteAccAddress,
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
return fields;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function fieldsForStakeDelegate(
|
|
217
|
+
command: StakeDelegateCommand
|
|
218
|
+
): DeviceTransactionField[] {
|
|
219
|
+
const fields: Array<DeviceTransactionField> = [];
|
|
220
|
+
|
|
221
|
+
fields.push({
|
|
222
|
+
type: "address",
|
|
223
|
+
label: "Delegate from",
|
|
224
|
+
address: command.stakeAccAddr,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
fields.push({
|
|
228
|
+
type: "address",
|
|
229
|
+
label: "Vote account",
|
|
230
|
+
address: command.voteAccAddr,
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
return fields;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function fieldsForStakeUndelegate(
|
|
237
|
+
command: StakeUndelegateCommand
|
|
238
|
+
): DeviceTransactionField[] {
|
|
239
|
+
const fields: Array<DeviceTransactionField> = [];
|
|
240
|
+
|
|
241
|
+
fields.push({
|
|
242
|
+
type: "address",
|
|
243
|
+
label: "Deactivate stake",
|
|
244
|
+
address: command.stakeAccAddr,
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
return fields;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function fieldsForStakeWithdraw(
|
|
251
|
+
command: StakeWithdrawCommand
|
|
252
|
+
): DeviceTransactionField[] {
|
|
253
|
+
const fields: Array<DeviceTransactionField> = [];
|
|
254
|
+
|
|
255
|
+
fields.push({
|
|
256
|
+
type: "amount",
|
|
257
|
+
label: "Stake withdraw",
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
fields.push({
|
|
261
|
+
type: "address",
|
|
262
|
+
label: "From",
|
|
263
|
+
address: command.stakeAccAddr,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
return fields;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function fieldsForStakeSplit(
|
|
270
|
+
command: StakeSplitCommand
|
|
271
|
+
): DeviceTransactionField[] {
|
|
272
|
+
const fields: Array<DeviceTransactionField> = [];
|
|
273
|
+
|
|
274
|
+
fields.push({
|
|
275
|
+
type: "amount",
|
|
276
|
+
label: "Split stake",
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
fields.push({
|
|
280
|
+
type: "address",
|
|
281
|
+
label: "From",
|
|
282
|
+
address: command.stakeAccAddr,
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
fields.push({
|
|
286
|
+
type: "address",
|
|
287
|
+
label: "To",
|
|
288
|
+
address: command.splitStakeAccAddr,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
fields.push({
|
|
292
|
+
type: "address",
|
|
293
|
+
label: "Base",
|
|
294
|
+
address: command.authorizedAccAddr,
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
fields.push({
|
|
298
|
+
type: "text",
|
|
299
|
+
label: "Seed",
|
|
300
|
+
value: command.seed,
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
fields.push({
|
|
304
|
+
type: "address",
|
|
305
|
+
label: "Authorized by",
|
|
306
|
+
address: command.authorizedAccAddr,
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
fields.push({
|
|
310
|
+
type: "address",
|
|
311
|
+
label: "Fee payer",
|
|
312
|
+
address: command.authorizedAccAddr,
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
return fields;
|
|
316
|
+
}
|
|
@@ -26,3 +26,43 @@ export const SolanaAddressOffEd25519 = createCustomErrorClass(
|
|
|
26
26
|
export const SolanaTokenRecipientIsSenderATA = createCustomErrorClass(
|
|
27
27
|
"SolanaTokenRecipientIsSenderATA"
|
|
28
28
|
);
|
|
29
|
+
|
|
30
|
+
export const SolanaValidatorRequired = createCustomErrorClass(
|
|
31
|
+
"SolanaValidatorRequired"
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const SolanaInvalidValidator = createCustomErrorClass(
|
|
35
|
+
"SolanaInvalidValidator"
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export const SolanaStakeAccountRequired = createCustomErrorClass(
|
|
39
|
+
"SolanaStakeAccountRequired"
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const SolanaStakeAccountNotFound = createCustomErrorClass(
|
|
43
|
+
"SolanaStakeAccountNotFound"
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export const SolanaStakeAccountNothingToWithdraw = createCustomErrorClass(
|
|
47
|
+
"SolanaStakeAccountNothingToWithdraw"
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export const SolanaStakeAccountIsNotDelegatable = createCustomErrorClass(
|
|
51
|
+
"SolanaStakeAccountIsNotDelegatable"
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
export const SolanaStakeAccountIsNotUndelegatable = createCustomErrorClass(
|
|
55
|
+
"SolanaStakeAccountIsNotUndelegatable"
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
export const SolanaStakeAccountValidatorIsUnchangeable = createCustomErrorClass(
|
|
59
|
+
"SolanaStakeAccountValidatorIsUnchangeable"
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
export const SolanaStakeNoWithdrawAuth = createCustomErrorClass(
|
|
63
|
+
"SolanaStakeNoWithdrawAuth"
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export const SolanaStakeNoStakeAuth = createCustomErrorClass(
|
|
67
|
+
"SolanaStakeNoStakeAuth"
|
|
68
|
+
);
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
buildTransferInstructions,
|
|
6
6
|
buildTokenTransferInstructions,
|
|
7
7
|
buildCreateAssociatedTokenAccountInstruction,
|
|
8
|
+
buildStakeCreateAccountInstructions,
|
|
9
|
+
buildStakeDelegateInstructions,
|
|
10
|
+
buildStakeUndelegateInstructions,
|
|
11
|
+
buildStakeWithdrawInstructions,
|
|
12
|
+
buildStakeSplitInstructions,
|
|
8
13
|
} from "./api/chain/web3";
|
|
9
14
|
import { assertUnreachable } from "./utils";
|
|
10
15
|
import {
|
|
@@ -44,19 +49,15 @@ export const buildTransactionWithAPI = async (
|
|
|
44
49
|
] as const;
|
|
45
50
|
};
|
|
46
51
|
|
|
47
|
-
function buildInstructions(tx: Transaction) {
|
|
52
|
+
function buildInstructions(tx: Transaction): TransactionInstruction[] {
|
|
48
53
|
const { commandDescriptor } = tx.model;
|
|
49
54
|
if (commandDescriptor === undefined) {
|
|
50
55
|
throw new Error("missing command descriptor");
|
|
51
56
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return buildInstructionsForCommand(commandDescriptor.command);
|
|
55
|
-
case "invalid":
|
|
56
|
-
throw new Error("can not build invalid command");
|
|
57
|
-
default:
|
|
58
|
-
return assertUnreachable(commandDescriptor);
|
|
57
|
+
if (Object.keys(commandDescriptor.errors).length > 0) {
|
|
58
|
+
throw new Error("can not build invalid command");
|
|
59
59
|
}
|
|
60
|
+
return buildInstructionsForCommand(commandDescriptor.command);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function buildInstructionsForCommand(
|
|
@@ -69,6 +70,16 @@ function buildInstructionsForCommand(
|
|
|
69
70
|
return buildTokenTransferInstructions(command);
|
|
70
71
|
case "token.createATA":
|
|
71
72
|
return buildCreateAssociatedTokenAccountInstruction(command);
|
|
73
|
+
case "stake.createAccount":
|
|
74
|
+
return buildStakeCreateAccountInstructions(command);
|
|
75
|
+
case "stake.delegate":
|
|
76
|
+
return buildStakeDelegateInstructions(command);
|
|
77
|
+
case "stake.undelegate":
|
|
78
|
+
return buildStakeUndelegateInstructions(command);
|
|
79
|
+
case "stake.withdraw":
|
|
80
|
+
return buildStakeWithdrawInstructions(command);
|
|
81
|
+
case "stake.split":
|
|
82
|
+
return buildStakeSplitInstructions(command);
|
|
72
83
|
default:
|
|
73
84
|
return assertUnreachable(command);
|
|
74
85
|
}
|
|
@@ -2,6 +2,7 @@ import type { AccountBridge } from "../../types";
|
|
|
2
2
|
import type { Transaction } from "./types";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
4
|
import { ChainAPI } from "./api";
|
|
5
|
+
import { getStakeAccountMinimumBalanceForRentExemption } from "./api/chain/web3";
|
|
5
6
|
|
|
6
7
|
const estimateMaxSpendableWithAPI = async (
|
|
7
8
|
{
|
|
@@ -10,15 +11,27 @@ const estimateMaxSpendableWithAPI = async (
|
|
|
10
11
|
}: Parameters<AccountBridge<Transaction>["estimateMaxSpendable"]>[0],
|
|
11
12
|
api: ChainAPI
|
|
12
13
|
): Promise<BigNumber> => {
|
|
13
|
-
const
|
|
14
|
-
transaction?.feeCalculator ?? (await api.getTxFeeCalculator());
|
|
14
|
+
const txFee = (await api.getTxFeeCalculator()).lamportsPerSignature;
|
|
15
15
|
|
|
16
16
|
switch (account.type) {
|
|
17
|
-
case "Account":
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
case "Account": {
|
|
18
|
+
const forTransfer = BigNumber.max(account.balance.minus(txFee), 0);
|
|
19
|
+
if (!transaction) {
|
|
20
|
+
return forTransfer;
|
|
21
|
+
}
|
|
22
|
+
switch (transaction.model.kind) {
|
|
23
|
+
case "stake.createAccount": {
|
|
24
|
+
const stakeAccRentExempt =
|
|
25
|
+
await getStakeAccountMinimumBalanceForRentExemption(api);
|
|
26
|
+
return BigNumber.max(
|
|
27
|
+
account.balance.minus(txFee).minus(stakeAccRentExempt),
|
|
28
|
+
0
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
default:
|
|
32
|
+
return forTransfer;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
22
35
|
case "TokenAccount":
|
|
23
36
|
return account.balance;
|
|
24
37
|
}
|
|
@@ -1,128 +1,69 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
import type { Account, TransactionStatus } from "../../types";
|
|
3
|
-
import type { Command,
|
|
3
|
+
import type { Command, CommandDescriptor, Transaction } from "./types";
|
|
4
4
|
import { assertUnreachable } from "./utils";
|
|
5
5
|
|
|
6
6
|
const getTransactionStatus = async (
|
|
7
|
-
|
|
7
|
+
_account: Account,
|
|
8
8
|
tx: Transaction
|
|
9
9
|
): Promise<TransactionStatus> => {
|
|
10
|
-
const txFees = new BigNumber(tx.feeCalculator?.lamportsPerSignature ?? 0);
|
|
11
|
-
|
|
12
10
|
const { commandDescriptor } = tx.model;
|
|
13
11
|
|
|
14
12
|
if (commandDescriptor === undefined) {
|
|
15
|
-
const amount = getAmountForModel(account, tx, txFees);
|
|
16
|
-
const totalSpent = getTotalSpentForModel(tx.model, amount, txFees);
|
|
17
13
|
return {
|
|
18
|
-
amount,
|
|
14
|
+
amount: tx.amount,
|
|
15
|
+
estimatedFees: new BigNumber(0),
|
|
16
|
+
totalSpent: tx.amount,
|
|
19
17
|
errors: {},
|
|
20
18
|
warnings: {},
|
|
21
|
-
estimatedFees: txFees,
|
|
22
|
-
totalSpent,
|
|
23
19
|
};
|
|
24
20
|
}
|
|
25
|
-
switch (commandDescriptor.status) {
|
|
26
|
-
case "invalid": {
|
|
27
|
-
const amount = getAmountForModel(account, tx, txFees);
|
|
28
|
-
const totalSpent = getTotalSpentForModel(tx.model, amount, txFees);
|
|
29
|
-
return {
|
|
30
|
-
amount,
|
|
31
|
-
errors: commandDescriptor.errors,
|
|
32
|
-
warnings: commandDescriptor.warnings ?? {},
|
|
33
|
-
estimatedFees: txFees,
|
|
34
|
-
totalSpent,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
case "valid": {
|
|
38
|
-
const { command } = commandDescriptor;
|
|
39
|
-
const estimatedFees = txFees.plus(commandDescriptor.fees ?? 0);
|
|
40
|
-
const amount = getAmountForCommand(command);
|
|
41
|
-
const totalSpent = getTotalSpentForCommand(
|
|
42
|
-
command,
|
|
43
|
-
amount,
|
|
44
|
-
estimatedFees
|
|
45
|
-
);
|
|
46
21
|
|
|
47
|
-
|
|
48
|
-
amount,
|
|
49
|
-
estimatedFees,
|
|
50
|
-
totalSpent,
|
|
51
|
-
warnings: commandDescriptor.warnings ?? {},
|
|
52
|
-
errors: {},
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
default:
|
|
56
|
-
return assertUnreachable(commandDescriptor);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
22
|
+
const { command, fee, errors, warnings } = commandDescriptor;
|
|
59
23
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
estimatedFees: BigNumber
|
|
64
|
-
) {
|
|
65
|
-
const { model } = tx;
|
|
66
|
-
switch (model.kind) {
|
|
67
|
-
case "transfer": {
|
|
68
|
-
if (tx.amount.lte(0)) {
|
|
69
|
-
return tx.amount;
|
|
70
|
-
}
|
|
71
|
-
const amount = tx.useAllAmount
|
|
72
|
-
? account.balance.minus(estimatedFees)
|
|
73
|
-
: BigNumber.max(tx.amount, 0);
|
|
74
|
-
return amount.gte(0) ? amount : account.balance;
|
|
75
|
-
}
|
|
76
|
-
case "token.transfer":
|
|
77
|
-
return tx.useAllAmount ? account.balance : tx.amount;
|
|
78
|
-
case "token.createATA":
|
|
79
|
-
return new BigNumber(0);
|
|
80
|
-
default:
|
|
81
|
-
return assertUnreachable(model);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
24
|
+
const amount = new BigNumber(getAmount(command));
|
|
25
|
+
const estimatedFees = new BigNumber(fee);
|
|
26
|
+
const totalSpent = new BigNumber(getTotalSpent(commandDescriptor));
|
|
84
27
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
case "token.transfer":
|
|
94
|
-
return amount;
|
|
95
|
-
case "token.createATA":
|
|
96
|
-
return estimatedFees;
|
|
97
|
-
default:
|
|
98
|
-
return assertUnreachable(model);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
28
|
+
return {
|
|
29
|
+
amount,
|
|
30
|
+
estimatedFees,
|
|
31
|
+
totalSpent,
|
|
32
|
+
warnings,
|
|
33
|
+
errors,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
101
36
|
|
|
102
|
-
function
|
|
37
|
+
function getAmount(command: Command) {
|
|
103
38
|
switch (command.kind) {
|
|
104
39
|
case "transfer":
|
|
105
40
|
case "token.transfer":
|
|
106
|
-
|
|
41
|
+
case "stake.createAccount":
|
|
42
|
+
case "stake.withdraw":
|
|
43
|
+
return command.amount;
|
|
107
44
|
case "token.createATA":
|
|
108
|
-
|
|
45
|
+
case "stake.delegate":
|
|
46
|
+
case "stake.undelegate":
|
|
47
|
+
case "stake.split":
|
|
48
|
+
return 0;
|
|
109
49
|
default:
|
|
110
50
|
return assertUnreachable(command);
|
|
111
51
|
}
|
|
112
52
|
}
|
|
113
53
|
|
|
114
|
-
function
|
|
115
|
-
command: Command,
|
|
116
|
-
amount: BigNumber,
|
|
117
|
-
estimatedFees: BigNumber
|
|
118
|
-
) {
|
|
54
|
+
function getTotalSpent({ command, fee }: CommandDescriptor) {
|
|
119
55
|
switch (command.kind) {
|
|
120
56
|
case "transfer":
|
|
121
|
-
|
|
57
|
+
case "stake.createAccount":
|
|
58
|
+
return command.amount < 0 ? 0 : command.amount + fee;
|
|
122
59
|
case "token.transfer":
|
|
123
|
-
return amount;
|
|
60
|
+
return Math.max(command.amount, 0);
|
|
124
61
|
case "token.createATA":
|
|
125
|
-
|
|
62
|
+
case "stake.delegate":
|
|
63
|
+
case "stake.undelegate":
|
|
64
|
+
case "stake.withdraw":
|
|
65
|
+
case "stake.split":
|
|
66
|
+
return fee;
|
|
126
67
|
default:
|
|
127
68
|
return assertUnreachable(command);
|
|
128
69
|
}
|