@ledgerhq/live-common 21.21.0-rc.2 → 21.21.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/lib/__tests__/cross.js +2 -2
- package/lib/__tests__/cross.js.map +1 -1
- package/lib/__tests__/csvExport.js +1 -1
- package/lib/__tests__/csvExport.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.reorg.integration.test.js +4 -4
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.reorg.integration.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.syncing.integration.test.js +2 -2
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.syncing.integration.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.NP2WPKH.integration.test.js +7 -7
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.NP2WPKH.integration.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.P2WPKH.integration.test.js +5 -5
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.P2WPKH.integration.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.integration.test.js +5 -5
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.integration.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.litecoin.test.js +4 -4
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.txs.litecoin.test.js.map +1 -1
- package/lib/__tests__/mocks/account.js +8 -8
- package/lib/__tests__/mocks/account.js.map +1 -1
- package/lib/__tests__/portfolio.v2.js +1 -1
- package/lib/__tests__/portfolio.v2.js.map +1 -1
- package/lib/__tests__/svg.js +3 -3
- package/lib/__tests__/svg.js.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +3 -3
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.js +1 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.android.js.map +1 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.js +1 -1
- package/lib/__tests__/test-helpers/implement-react-native-libcore/specific.ios.js.map +1 -1
- package/lib/__tests__/test-helpers/mockDevice.js +1 -1
- package/lib/__tests__/test-helpers/mockDevice.js.map +1 -1
- package/lib/__tests__/test-helpers/setup.js +2 -2
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/account/accountId.js +2 -2
- package/lib/account/accountId.js.map +1 -1
- package/lib/account/accountName.js +1 -1
- package/lib/account/accountName.js.map +1 -1
- package/lib/account/formatters.js +17 -17
- package/lib/account/formatters.js.map +1 -1
- package/lib/account/helpers.js +1 -1
- package/lib/account/helpers.js.map +1 -1
- package/lib/api/Ethereum.js +12 -12
- package/lib/api/Ethereum.js.map +1 -1
- package/lib/api/Fees.js +3 -3
- package/lib/api/Fees.js.map +1 -1
- package/lib/api/Ledger.js +2 -2
- package/lib/api/Ledger.js.map +1 -1
- package/lib/api/Manager.js +19 -19
- package/lib/api/Manager.js.map +1 -1
- package/lib/api/Ripple.js +2 -2
- package/lib/api/Ripple.js.map +1 -1
- package/lib/api/Tron.js +21 -21
- package/lib/api/Tron.js.map +1 -1
- package/lib/api/explorerConfig/generate-doc.test.js +1 -1
- package/lib/api/explorerConfig/generate-doc.test.js.map +1 -1
- package/lib/api/socket.js +1 -1
- package/lib/api/socket.js.map +1 -1
- package/lib/apps/filtering.js +1 -1
- package/lib/apps/filtering.js.map +1 -1
- package/lib/apps/formatting.js +1 -1
- package/lib/apps/formatting.js.map +1 -1
- package/lib/apps/hw.js +1 -1
- package/lib/apps/hw.js.map +1 -1
- package/lib/apps/support.js +1 -1
- package/lib/bot/engine.d.ts.map +1 -1
- package/lib/bot/engine.js +19 -18
- package/lib/bot/engine.js.map +1 -1
- package/lib/bot/formatters.d.ts +1 -0
- package/lib/bot/formatters.d.ts.map +1 -1
- package/lib/bot/formatters.js +32 -21
- package/lib/bot/formatters.js.map +1 -1
- package/lib/bot/index.js +36 -36
- package/lib/bot/index.js.map +1 -1
- package/lib/bot/specs.js +1 -1
- package/lib/bot/specs.js.map +1 -1
- package/lib/bridge/jsHelpers.js +7 -7
- package/lib/bridge/jsHelpers.js.map +1 -1
- package/lib/bridge/mockHelpers.js +1 -1
- package/lib/bridge/mockHelpers.js.map +1 -1
- package/lib/bridge/react/BridgeSync.js +1 -1
- package/lib/bridge/react/BridgeSync.js.map +1 -1
- package/lib/bridge/shared.js +1 -1
- package/lib/bridge/shared.js.map +1 -1
- package/lib/convert.js +1 -1
- package/lib/convert.js.map +1 -1
- package/lib/countervalues/api/api.js +3 -3
- package/lib/countervalues/api/api.js.map +1 -1
- package/lib/countervalues/api/api.legacy.js +3 -3
- package/lib/countervalues/api/api.legacy.js.map +1 -1
- package/lib/countervalues/helpers.js +1 -1
- package/lib/countervalues/helpers.js.map +1 -1
- package/lib/countervalues/logic.js +5 -5
- package/lib/countervalues/logic.js.map +1 -1
- package/lib/countervalues/react.js +1 -1
- package/lib/countervalues/react.js.map +1 -1
- package/lib/derivation.js +5 -5
- package/lib/derivation.js.map +1 -1
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +2 -3
- package/lib/env.js.map +1 -1
- package/lib/exchange/index.js +1 -1
- package/lib/exchange/index.js.map +1 -1
- package/lib/exchange/sell/index.js +1 -1
- package/lib/exchange/sell/index.js.map +1 -1
- package/lib/exchange/swap/getExchangeRates.js +1 -1
- package/lib/exchange/swap/getExchangeRates.js.map +1 -1
- package/lib/exchange/swap/getKYCStatus.js +1 -1
- package/lib/exchange/swap/getKYCStatus.js.map +1 -1
- package/lib/exchange/swap/getProviders.js +1 -1
- package/lib/exchange/swap/getProviders.js.map +1 -1
- package/lib/exchange/swap/getStatus.js +1 -1
- package/lib/exchange/swap/getStatus.js.map +1 -1
- package/lib/exchange/swap/hooks/usePickDefaultAccount.test.js +1 -1
- package/lib/exchange/swap/hooks/usePickDefaultAccount.test.js.map +1 -1
- package/lib/exchange/swap/index.js +1 -1
- package/lib/exchange/swap/index.js.map +1 -1
- package/lib/exchange/swap/initSwap.js +2 -2
- package/lib/exchange/swap/initSwap.js.map +1 -1
- package/lib/exchange/swap/logic.js +3 -3
- package/lib/exchange/swap/logic.js.map +1 -1
- package/lib/exchange/swap/startExchange.js +1 -1
- package/lib/exchange/swap/startExchange.js.map +1 -1
- package/lib/exchange/swap/submitKYC.js +1 -1
- package/lib/exchange/swap/submitKYC.js.map +1 -1
- package/lib/exchange/swap/utils/index.test.js +1 -1
- package/lib/exchange/swap/utils/index.test.js.map +1 -1
- package/lib/families/algorand/account.js +2 -2
- package/lib/families/algorand/account.js.map +1 -1
- package/lib/families/algorand/bridge/libcore.js +1 -1
- package/lib/families/algorand/bridge/libcore.js.map +1 -1
- package/lib/families/algorand/deviceTransactionConfig.js +2 -2
- package/lib/families/algorand/deviceTransactionConfig.js.map +1 -1
- package/lib/families/algorand/libcore-signOperation.js +2 -2
- package/lib/families/algorand/libcore-signOperation.js.map +1 -1
- package/lib/families/algorand/mock.js +1 -1
- package/lib/families/algorand/mock.js.map +1 -1
- package/lib/families/algorand/speculos-deviceActions.js +1 -1
- package/lib/families/algorand/speculos-deviceActions.js.map +1 -1
- package/lib/families/algorand/tokens.js +1 -1
- package/lib/families/algorand/tokens.js.map +1 -1
- package/lib/families/algorand/transaction.js +3 -3
- package/lib/families/algorand/transaction.js.map +1 -1
- package/lib/families/bitcoin/account.js +5 -5
- package/lib/families/bitcoin/account.js.map +1 -1
- package/lib/families/bitcoin/bridge/libcore.js +6 -6
- package/lib/families/bitcoin/bridge/libcore.js.map +1 -1
- package/lib/families/bitcoin/cache.js +5 -5
- package/lib/families/bitcoin/cache.js.map +1 -1
- package/lib/families/bitcoin/descriptor.js +5 -5
- package/lib/families/bitcoin/descriptor.js.map +1 -1
- package/lib/families/bitcoin/hw-getAddress.js +5 -5
- package/lib/families/bitcoin/hw-getAddress.js.map +1 -1
- package/lib/families/bitcoin/hw-signMessage.js +1 -1
- package/lib/families/bitcoin/hw-signMessage.js.map +1 -1
- package/lib/families/bitcoin/js-getTransactionStatus.js +3 -3
- package/lib/families/bitcoin/js-getTransactionStatus.js.map +1 -1
- package/lib/families/bitcoin/js-signOperation.js +1 -1
- package/lib/families/bitcoin/js-signOperation.js.map +1 -1
- package/lib/families/bitcoin/js-synchronisation.js +6 -6
- package/lib/families/bitcoin/js-synchronisation.js.map +1 -1
- package/lib/families/bitcoin/libcore-buildTransaction.js +1 -1
- package/lib/families/bitcoin/libcore-buildTransaction.js.map +1 -1
- package/lib/families/bitcoin/libcore-signOperation.js +2 -2
- package/lib/families/bitcoin/libcore-signOperation.js.map +1 -1
- package/lib/families/bitcoin/satstack.js +3 -3
- package/lib/families/bitcoin/satstack.js.map +1 -1
- package/lib/families/bitcoin/specs.js +1 -1
- package/lib/families/bitcoin/specs.js.map +1 -1
- package/lib/families/bitcoin/transaction.js +7 -7
- package/lib/families/bitcoin/transaction.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.js +15 -15
- package/lib/families/bitcoin/wallet-btc/crypto/base.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js +6 -6
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js +4 -4
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js +3 -3
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/factory.js +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/factory.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js +3 -3
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js +3 -3
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js +3 -3
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/explorer/index.js +3 -3
- package/lib/families/bitcoin/wallet-btc/explorer/index.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/storage/index.js +4 -4
- package/lib/families/bitcoin/wallet-btc/storage/index.js.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/bitcoin/wallet-btc/wallet.js +4 -4
- package/lib/families/bitcoin/wallet-btc/wallet.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/xpub.js +4 -4
- package/lib/families/bitcoin/wallet-btc/xpub.js.map +1 -1
- package/lib/families/cosmos/account.js +7 -7
- package/lib/families/cosmos/account.js.map +1 -1
- package/lib/families/cosmos/cli-transaction.js +1 -1
- package/lib/families/cosmos/cli-transaction.js.map +1 -1
- package/lib/families/cosmos/libcore-buildTransaction.js +3 -3
- package/lib/families/cosmos/libcore-buildTransaction.js.map +1 -1
- package/lib/families/cosmos/libcore-signOperation.js +1 -1
- package/lib/families/cosmos/libcore-signOperation.js.map +1 -1
- package/lib/families/cosmos/logic.js +2 -2
- package/lib/families/cosmos/logic.js.map +1 -1
- package/lib/families/cosmos/message.js +1 -1
- package/lib/families/cosmos/message.js.map +1 -1
- package/lib/families/cosmos/mock.js +1 -1
- package/lib/families/cosmos/mock.js.map +1 -1
- package/lib/families/cosmos/transaction.js +3 -3
- package/lib/families/cosmos/transaction.js.map +1 -1
- package/lib/families/cosmos/validators.js +7 -7
- package/lib/families/cosmos/validators.js.map +1 -1
- package/lib/families/crypto_org/api/sdk.js +2 -2
- package/lib/families/crypto_org/api/sdk.js.map +1 -1
- package/lib/families/crypto_org/js-broadcast.js +1 -1
- package/lib/families/crypto_org/js-broadcast.js.map +1 -1
- package/lib/families/crypto_org/js-buildTransaction.js +2 -2
- package/lib/families/crypto_org/js-buildTransaction.js.map +1 -1
- package/lib/families/crypto_org/transaction.js +2 -2
- package/lib/families/crypto_org/transaction.js.map +1 -1
- package/lib/families/elrond/api/apiCalls.js +7 -7
- package/lib/families/elrond/api/apiCalls.js.map +1 -1
- package/lib/families/elrond/hw-app-elrond/index.js +2 -2
- package/lib/families/elrond/hw-app-elrond/index.js.map +1 -1
- package/lib/families/elrond/preload.js +1 -1
- package/lib/families/elrond/preload.js.map +1 -1
- package/lib/families/elrond/test-dataset.js +4 -4
- package/lib/families/elrond/test-dataset.js.map +1 -1
- package/lib/families/elrond/transaction.js +2 -2
- package/lib/families/elrond/transaction.js.map +1 -1
- package/lib/families/ethereum/hw-signMessage.js +1 -1
- package/lib/families/ethereum/hw-signMessage.js.map +1 -1
- package/lib/families/ethereum/modules/compound.js +4 -4
- package/lib/families/ethereum/modules/compound.js.map +1 -1
- package/lib/families/ethereum/modules/send.js +2 -2
- package/lib/families/ethereum/modules/send.js.map +1 -1
- package/lib/families/ethereum/signOperation.js +2 -2
- package/lib/families/ethereum/signOperation.js.map +1 -1
- package/lib/families/ethereum/synchronisation.js +13 -13
- package/lib/families/ethereum/synchronisation.js.map +1 -1
- package/lib/families/ethereum/transaction.js +10 -10
- package/lib/families/ethereum/transaction.js.map +1 -1
- package/lib/families/filecoin/bridge/account.d.ts.map +1 -1
- package/lib/families/filecoin/bridge/account.js +4 -6
- package/lib/families/filecoin/bridge/account.js.map +1 -1
- package/lib/families/filecoin/bridge/utils/addresses.js +4 -4
- package/lib/families/filecoin/bridge/utils/addresses.js.map +1 -1
- package/lib/families/filecoin/bridge/utils/api.js +3 -3
- package/lib/families/filecoin/bridge/utils/api.js.map +1 -1
- package/lib/families/filecoin/bridge/utils/types.d.ts +1 -0
- package/lib/families/filecoin/bridge/utils/types.d.ts.map +1 -1
- package/lib/families/filecoin/bridge/utils/utils.d.ts +1 -0
- package/lib/families/filecoin/bridge/utils/utils.d.ts.map +1 -1
- package/lib/families/filecoin/bridge/utils/utils.js +30 -11
- package/lib/families/filecoin/bridge/utils/utils.js.map +1 -1
- package/lib/families/filecoin/hw-signMessage.js +1 -1
- package/lib/families/filecoin/hw-signMessage.js.map +1 -1
- package/lib/families/filecoin/test-dataset.d.ts.map +1 -1
- package/lib/families/filecoin/test-dataset.js +1 -22
- package/lib/families/filecoin/test-dataset.js.map +1 -1
- package/lib/families/filecoin/transaction.js +2 -2
- package/lib/families/filecoin/transaction.js.map +1 -1
- package/lib/families/filecoin/utils.js +2 -2
- package/lib/families/filecoin/utils.js.map +1 -1
- package/lib/families/neo/bridge/js.js +4 -4
- package/lib/families/neo/bridge/js.js.map +1 -1
- package/lib/families/neo/transaction.js +2 -2
- package/lib/families/neo/transaction.js.map +1 -1
- package/lib/families/polkadot/account.js +7 -7
- package/lib/families/polkadot/account.js.map +1 -1
- package/lib/families/polkadot/api/bisontrails.js +6 -6
- package/lib/families/polkadot/api/bisontrails.js.map +1 -1
- package/lib/families/polkadot/api/common.js +1 -1
- package/lib/families/polkadot/api/common.js.map +1 -1
- package/lib/families/polkadot/api/sidecar.js +8 -8
- package/lib/families/polkadot/api/sidecar.js.map +1 -1
- package/lib/families/polkadot/api/sidecar.types.d.ts +2 -1
- package/lib/families/polkadot/api/sidecar.types.d.ts.map +1 -1
- package/lib/families/polkadot/api/subscan.js +9 -9
- package/lib/families/polkadot/api/subscan.js.map +1 -1
- package/lib/families/polkadot/api/websocket.js +1 -1
- package/lib/families/polkadot/api/websocket.js.map +1 -1
- package/lib/families/polkadot/cache.js +10 -10
- package/lib/families/polkadot/cache.js.map +1 -1
- package/lib/families/polkadot/cli-transaction.js +7 -7
- package/lib/families/polkadot/cli-transaction.js.map +1 -1
- package/lib/families/polkadot/js-buildTransaction.js +1 -1
- package/lib/families/polkadot/js-buildTransaction.js.map +1 -1
- package/lib/families/polkadot/platformAdapter.js +1 -1
- package/lib/families/polkadot/platformAdapter.js.map +1 -1
- package/lib/families/polkadot/react.js +1 -1
- package/lib/families/polkadot/react.js.map +1 -1
- package/lib/families/polkadot/test-dataset.js +3 -3
- package/lib/families/polkadot/test-dataset.js.map +1 -1
- package/lib/families/polkadot/transaction.js +2 -2
- package/lib/families/polkadot/transaction.js.map +1 -1
- package/lib/families/ripple/bridge/js.js +8 -8
- package/lib/families/ripple/bridge/js.js.map +1 -1
- package/lib/families/ripple/transaction.js +3 -3
- package/lib/families/ripple/transaction.js.map +1 -1
- package/lib/families/solana/api/cached.js +1 -1
- package/lib/families/solana/api/cached.js.map +1 -1
- package/lib/families/solana/bridge/bridge.js +1 -1
- package/lib/families/solana/bridge/bridge.js.map +1 -1
- package/lib/families/solana/bridge/mock.js +2 -2
- package/lib/families/solana/bridge/mock.js.map +1 -1
- package/lib/families/solana/cli-transaction.js +3 -3
- package/lib/families/solana/cli-transaction.js.map +1 -1
- package/lib/families/solana/errors.d.ts +0 -3
- package/lib/families/solana/errors.d.ts.map +1 -1
- package/lib/families/solana/errors.js +1 -2
- package/lib/families/solana/errors.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 +51 -12
- package/lib/families/solana/js-getTransactionStatus.js.map +1 -1
- package/lib/families/solana/js-prepareTransaction.d.ts.map +1 -1
- package/lib/families/solana/js-prepareTransaction.js +8 -4
- 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 +19 -9
- package/lib/families/solana/js-signOperation.js.map +1 -1
- package/lib/families/solana/js-synchronization.js +9 -6
- package/lib/families/solana/js-synchronization.js.map +1 -1
- package/lib/families/solana/logic.js +2 -2
- package/lib/families/solana/logic.js.map +1 -1
- package/lib/families/solana/speculos-deviceActions.js +1 -1
- package/lib/families/solana/speculos-deviceActions.js.map +1 -1
- package/lib/families/solana/test-dataset.js +7 -7
- package/lib/families/solana/test-dataset.js.map +1 -1
- package/lib/families/solana/transaction.js +7 -7
- package/lib/families/solana/transaction.js.map +1 -1
- package/lib/families/solana/utils.js +1 -1
- package/lib/families/solana/utils.js.map +1 -1
- package/lib/families/stellar/js-signOperation.js +1 -1
- package/lib/families/stellar/js-signOperation.js.map +1 -1
- package/lib/families/stellar/transaction.js +3 -3
- package/lib/families/stellar/transaction.js.map +1 -1
- package/lib/families/tezos/api/tzkt.js +3 -3
- package/lib/families/tezos/api/tzkt.js.map +1 -1
- package/lib/families/tezos/bakers.js +1 -1
- package/lib/families/tezos/bakers.js.map +1 -1
- package/lib/families/tezos/bridge/libcore.js +1 -1
- package/lib/families/tezos/bridge/libcore.js.map +1 -1
- package/lib/families/tezos/cli-transaction.js +1 -1
- package/lib/families/tezos/cli-transaction.js.map +1 -1
- package/lib/families/tezos/libcore-buildSubAccounts.js +1 -1
- package/lib/families/tezos/libcore-buildSubAccounts.js.map +1 -1
- package/lib/families/tezos/libcore-signOperation.js +3 -3
- package/lib/families/tezos/libcore-signOperation.js.map +1 -1
- package/lib/families/tezos/signOperation.js +1 -1
- package/lib/families/tezos/signOperation.js.map +1 -1
- package/lib/families/tezos/synchronisation.test.js +2 -2
- package/lib/families/tezos/synchronisation.test.js.map +1 -1
- package/lib/families/tezos/test-dataset.js +1 -1
- package/lib/families/tezos/test-dataset.js.map +1 -1
- package/lib/families/tezos/transaction.js +2 -2
- package/lib/families/tezos/transaction.js.map +1 -1
- package/lib/families/tron/bridge/js.js +7 -7
- package/lib/families/tron/bridge/js.js.map +1 -1
- package/lib/families/tron/cli-transaction.js +6 -6
- package/lib/families/tron/cli-transaction.js.map +1 -1
- package/lib/families/tron/react.js +1 -1
- package/lib/families/tron/react.js.map +1 -1
- package/lib/families/tron/specs.js +3 -3
- package/lib/families/tron/specs.js.map +1 -1
- package/lib/families/tron/speculos-deviceActions.js +1 -1
- package/lib/families/tron/speculos-deviceActions.js.map +1 -1
- package/lib/families/tron/transaction.js +3 -3
- package/lib/families/tron/transaction.js.map +1 -1
- package/lib/families/tron/utils.js +1 -1
- package/lib/families/tron/utils.js.map +1 -1
- package/lib/hw/actions/app.d.ts.map +1 -1
- package/lib/hw/actions/app.js +4 -5
- package/lib/hw/actions/app.js.map +1 -1
- package/lib/hw/checkAccountApp.js +1 -1
- package/lib/hw/checkAccountApp.js.map +1 -1
- package/lib/hw/checkCurrencyApp.js +1 -1
- package/lib/hw/checkCurrencyApp.js.map +1 -1
- package/lib/hw/connectApp.d.ts +1 -0
- package/lib/hw/connectApp.d.ts.map +1 -1
- package/lib/hw/connectApp.js +2 -1
- package/lib/hw/connectApp.js.map +1 -1
- package/lib/hw/flash.js +2 -2
- package/lib/hw/flash.js.map +1 -1
- package/lib/hw/getAddress/index.js +3 -3
- package/lib/hw/getAddress/index.js.map +1 -1
- package/lib/hw/index.js +3 -3
- package/lib/hw/index.js.map +1 -1
- package/lib/hw/signMessage/index.js +3 -3
- package/lib/hw/signMessage/index.js.map +1 -1
- package/lib/hw/signTransaction/index.js +1 -1
- package/lib/hw/signTransaction/index.js.map +1 -1
- package/lib/libcore/buildAccount/buildOperation.js +3 -3
- package/lib/libcore/buildAccount/buildOperation.js.map +1 -1
- package/lib/libcore/buildAccount/index.js +7 -7
- package/lib/libcore/buildAccount/index.js.map +1 -1
- package/lib/libcore/platforms/nodejs.js +5 -5
- package/lib/libcore/platforms/nodejs.js.map +1 -1
- package/lib/libcore/platforms/react-native.js +6 -6
- package/lib/libcore/platforms/react-native.js.map +1 -1
- package/lib/libcore/scanAccounts.js +4 -4
- package/lib/libcore/scanAccounts.js.map +1 -1
- package/lib/libcore/signOperation.js +1 -1
- package/lib/libcore/signOperation.js.map +1 -1
- package/lib/libcore/syncAccount.js +4 -4
- package/lib/libcore/syncAccount.js.map +1 -1
- package/lib/load/speculos.js +19 -19
- package/lib/load/speculos.js.map +1 -1
- package/lib/logs/simple.js +2 -2
- package/lib/logs/simple.js.map +1 -1
- package/lib/manager/index.js +2 -2
- package/lib/manager/index.js.map +1 -1
- package/lib/migrations/accounts.js +1 -1
- package/lib/migrations/accounts.js.map +1 -1
- package/lib/mock/account.js +4 -4
- package/lib/mock/account.js.map +1 -1
- package/lib/mock/helpers.js +2 -2
- package/lib/mock/helpers.js.map +1 -1
- package/lib/network.js +5 -5
- package/lib/network.js.map +1 -1
- package/lib/nft/helpers.js +1 -1
- package/lib/nft/helpers.js.map +1 -1
- package/lib/nft/nftId.js +1 -1
- package/lib/nft/nftId.js.map +1 -1
- package/lib/notifications/AnnouncementProvider/api/api.js +1 -1
- package/lib/notifications/AnnouncementProvider/api/api.js.map +1 -1
- package/lib/notifications/AnnouncementProvider/helpers.js +2 -2
- package/lib/notifications/AnnouncementProvider/helpers.js.map +1 -1
- package/lib/notifications/ServiceStatusProvider/api/api.js +1 -1
- package/lib/notifications/ServiceStatusProvider/api/api.js.map +1 -1
- package/lib/operation.js +1 -1
- package/lib/operation.js.map +1 -1
- package/lib/platform/PlatformAppProvider/api/api.js +1 -1
- package/lib/platform/PlatformAppProvider/api/api.js.map +1 -1
- package/lib/platform/PlatformAppProvider/providers.js +1 -1
- package/lib/platform/PlatformAppProvider/providers.js.map +1 -1
- package/lib/platform/converters.test.js +1 -1
- package/lib/platform/converters.test.js.map +1 -1
- package/lib/portfolio/index.js +3 -3
- package/lib/portfolio/index.js.map +1 -1
- package/lib/react.js +2 -2
- package/lib/react.js.map +1 -1
- package/lib/reactNative.js +2 -2
- package/lib/reactNative.js.map +1 -1
- package/lib/sanityChecks.js +1 -1
- package/lib/sanityChecks.js.map +1 -1
- package/lib/transaction/status.js +4 -4
- package/lib/transaction/status.js.map +1 -1
- package/package.json +26 -26
- package/src/__tests__/.DS_Store +0 -0
- package/src/__tests__/__snapshots__/all.libcore.ts.snap +9 -13
- package/src/apps/support.ts +1 -1
- package/src/bot/engine.ts +3 -1
- package/src/bot/formatters.ts +11 -1
- package/src/bot/index.ts +5 -5
- package/src/env.ts +1 -2
- package/src/families/crypto_org/js-buildTransaction.ts +2 -2
- package/src/families/filecoin/bridge/account.ts +0 -3
- package/src/families/filecoin/bridge/utils/types.ts +1 -0
- package/src/families/filecoin/bridge/utils/utils.ts +39 -7
- package/src/families/filecoin/test-dataset.ts +0 -22
- package/src/families/polkadot/api/sidecar.types.ts +3 -1
- package/src/families/solana/errors.ts +0 -4
- package/src/families/solana/js-getTransactionStatus.ts +65 -12
- package/src/families/solana/js-prepareTransaction.ts +7 -4
- package/src/families/solana/js-signOperation.ts +21 -9
- package/src/families/solana/js-synchronization.ts +11 -6
- package/src/families/solana/test-dataset.ts +6 -6
- package/src/families/tezos/synchronisation.test.ts +2 -2
- package/src/hw/actions/app.ts +5 -6
- package/src/hw/connectApp.ts +2 -0
package/src/bot/formatters.ts
CHANGED
|
@@ -18,6 +18,16 @@ const formatDt = (from, to) => (from && to ? formatTime(to - from) : "?");
|
|
|
18
18
|
export function formatAppCandidate(appCandidate: AppCandidate) {
|
|
19
19
|
return `${appCandidate.appName} ${appCandidate.appVersion} on ${appCandidate.model} ${appCandidate.firmware}`;
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
export function formatError(e: any) {
|
|
23
|
+
if (!e || typeof e !== "object" || e instanceof Error) return String(e);
|
|
24
|
+
try {
|
|
25
|
+
return "raw object: " + JSON.stringify(e).slice(0, 400);
|
|
26
|
+
} catch (_e) {
|
|
27
|
+
return String(e);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
export function formatReportForConsole<T extends Transaction>({
|
|
22
32
|
syncAllAccountsTime,
|
|
23
33
|
appCandidate,
|
|
@@ -137,7 +147,7 @@ export function formatReportForConsole<T extends Transaction>({
|
|
|
137
147
|
}
|
|
138
148
|
|
|
139
149
|
if (error) {
|
|
140
|
-
str += `⚠️ ${
|
|
150
|
+
str += `⚠️ ${formatError(error)}\n`;
|
|
141
151
|
}
|
|
142
152
|
|
|
143
153
|
return str;
|
package/src/bot/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "../currencies";
|
|
19
19
|
import { isAccountEmpty } from "../account";
|
|
20
20
|
import { runWithAppSpec } from "./engine";
|
|
21
|
-
import { formatReportForConsole } from "./formatters";
|
|
21
|
+
import { formatReportForConsole, formatError } from "./formatters";
|
|
22
22
|
import {
|
|
23
23
|
initialState,
|
|
24
24
|
calculate,
|
|
@@ -230,7 +230,7 @@ export async function bot({ currency, family, mutation }: Arg = {}) {
|
|
|
230
230
|
let subtitle = "";
|
|
231
231
|
|
|
232
232
|
if (countervaluesError) {
|
|
233
|
-
subtitle += `> ${
|
|
233
|
+
subtitle += `> ${formatError(countervaluesError)}`;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
let slackBody = "";
|
|
@@ -254,8 +254,8 @@ export async function bot({ currency, family, mutation }: Arg = {}) {
|
|
|
254
254
|
body += `<summary>${specFatals.length} critical spec errors</summary>\n\n`;
|
|
255
255
|
specFatals.forEach(({ spec, fatalError }) => {
|
|
256
256
|
body += `**Spec ${spec.name} failed!**\n`;
|
|
257
|
-
body += "```\n" +
|
|
258
|
-
slackBody += `❌ *Spec ${spec.name}*: \`${
|
|
257
|
+
body += "```\n" + formatError(fatalError) + "\n```\n\n";
|
|
258
|
+
slackBody += `❌ *Spec ${spec.name}*: \`${formatError(fatalError)}\`\n`;
|
|
259
259
|
});
|
|
260
260
|
body += "</details>\n\n";
|
|
261
261
|
}
|
|
@@ -268,7 +268,7 @@ export async function bot({ currency, family, mutation }: Arg = {}) {
|
|
|
268
268
|
"```\n" +
|
|
269
269
|
formatReportForConsole(c) +
|
|
270
270
|
"\n" +
|
|
271
|
-
|
|
271
|
+
formatError(c.error) +
|
|
272
272
|
"\n```\n\n";
|
|
273
273
|
});
|
|
274
274
|
body += "</details>\n\n";
|
package/src/env.ts
CHANGED
|
@@ -387,8 +387,7 @@ const envDefinitions = {
|
|
|
387
387
|
desc: "set the currencies where NFT is active",
|
|
388
388
|
},
|
|
389
389
|
NFT_ETH_METADATA_SERVICE: {
|
|
390
|
-
|
|
391
|
-
def: "https://nft.staging.aws.ledger.fr/v1/ethereum/1/contracts/tokens/infos",
|
|
390
|
+
def: "https://nft.api.live.ledger.com/v1/ethereum/1/contracts/tokens/infos",
|
|
392
391
|
parser: stringParser,
|
|
393
392
|
desc: "service uri used to get the metadata of an nft",
|
|
394
393
|
},
|
|
@@ -10,8 +10,8 @@ const getTransactionAmount = (a: Account, t: Transaction) => {
|
|
|
10
10
|
switch (t.mode) {
|
|
11
11
|
case "send":
|
|
12
12
|
if (t.useAllAmount) {
|
|
13
|
-
const
|
|
14
|
-
return new croSdk.Coin(
|
|
13
|
+
const balanceMinusFee = a.balance.minus(t.fees || 0);
|
|
14
|
+
return new croSdk.Coin(balanceMinusFee.toString(), Units.BASE);
|
|
15
15
|
} else {
|
|
16
16
|
return new croSdk.Coin(t.amount.toString(), Units.BASE);
|
|
17
17
|
}
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
AmountRequired,
|
|
3
3
|
FeeNotLoaded,
|
|
4
4
|
InvalidAddress,
|
|
5
|
-
InvalidAddressBecauseDestinationIsAlsoSource,
|
|
6
5
|
NotEnoughBalance,
|
|
7
6
|
RecipientRequired,
|
|
8
7
|
} from "@ledgerhq/errors";
|
|
@@ -71,8 +70,6 @@ const getTransactionStatus = async (
|
|
|
71
70
|
const { recipient, amount, gasPremium, gasFeeCap, gasLimit } = t;
|
|
72
71
|
|
|
73
72
|
if (!recipient) errors.recipient = new RecipientRequired();
|
|
74
|
-
else if (address === recipient)
|
|
75
|
-
errors.recipient = new InvalidAddressBecauseDestinationIsAlsoSource();
|
|
76
73
|
else if (!validateAddress(recipient).isValid)
|
|
77
74
|
errors.recipient = new InvalidAddress();
|
|
78
75
|
else if (!validateAddress(address).isValid)
|
|
@@ -14,27 +14,59 @@ import { encodeAccountId } from "../../../../account";
|
|
|
14
14
|
import flatMap from "lodash/flatMap";
|
|
15
15
|
import { Transaction } from "../../types";
|
|
16
16
|
|
|
17
|
+
type TxsById = {
|
|
18
|
+
[id: string]: {
|
|
19
|
+
Send: TransactionResponse;
|
|
20
|
+
Fee?: TransactionResponse;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
17
24
|
export const getUnit = () => getCryptoCurrencyById("filecoin").units[0];
|
|
18
25
|
|
|
26
|
+
export const processTxs = (
|
|
27
|
+
txs: TransactionResponse[]
|
|
28
|
+
): TransactionResponse[] => {
|
|
29
|
+
const txsById = txs.reduce((result: TxsById, currentTx) => {
|
|
30
|
+
const { hash, type } = currentTx;
|
|
31
|
+
const txById = result[hash] || {};
|
|
32
|
+
|
|
33
|
+
if (type == "Send" || type == "Fee") txById[type] = currentTx;
|
|
34
|
+
|
|
35
|
+
result[hash] = txById;
|
|
36
|
+
return result;
|
|
37
|
+
}, {});
|
|
38
|
+
|
|
39
|
+
const processedTxs: TransactionResponse[] = [];
|
|
40
|
+
for (const txId in txsById) {
|
|
41
|
+
const { Fee: feeTx, Send: sendTx } = txsById[txId];
|
|
42
|
+
|
|
43
|
+
if (feeTx) sendTx.fee = feeTx.amount.toString();
|
|
44
|
+
|
|
45
|
+
processedTxs.push(sendTx);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return processedTxs;
|
|
49
|
+
};
|
|
50
|
+
|
|
19
51
|
export const mapTxToOps =
|
|
20
52
|
(id, { address }: GetAccountShapeArg0) =>
|
|
21
53
|
(tx: TransactionResponse): Operation[] => {
|
|
22
|
-
const { to, from, hash, timestamp, amount } = tx;
|
|
54
|
+
const { to, from, hash, timestamp, amount, fee } = tx;
|
|
23
55
|
const ops: Operation[] = [];
|
|
24
56
|
const date = new Date(timestamp * 1000);
|
|
25
57
|
const value = parseCurrencyUnit(getUnit(), amount.toString());
|
|
26
58
|
|
|
27
59
|
const isSending = address === from;
|
|
28
60
|
const isReceiving = address === to;
|
|
29
|
-
const
|
|
61
|
+
const feeToUse = new BigNumber(fee || 0);
|
|
30
62
|
|
|
31
63
|
if (isSending) {
|
|
32
64
|
ops.push({
|
|
33
65
|
id: `${id}-${hash}-OUT`,
|
|
34
66
|
hash,
|
|
35
67
|
type: "OUT",
|
|
36
|
-
value: value.plus(
|
|
37
|
-
fee,
|
|
68
|
+
value: value.plus(feeToUse),
|
|
69
|
+
fee: feeToUse,
|
|
38
70
|
blockHeight: tx.height,
|
|
39
71
|
blockHash: null,
|
|
40
72
|
accountId: id,
|
|
@@ -51,7 +83,7 @@ export const mapTxToOps =
|
|
|
51
83
|
hash,
|
|
52
84
|
type: "IN",
|
|
53
85
|
value,
|
|
54
|
-
fee,
|
|
86
|
+
fee: feeToUse,
|
|
55
87
|
blockHeight: tx.height,
|
|
56
88
|
blockHash: null,
|
|
57
89
|
accountId: id,
|
|
@@ -120,13 +152,13 @@ export const getAccountShape: GetAccountShape = async (info) => {
|
|
|
120
152
|
|
|
121
153
|
const blockHeight = await fetchBlockHeight();
|
|
122
154
|
const balance = await fetchBalances(address);
|
|
123
|
-
const
|
|
155
|
+
const rawTxs = await fetchTxs(address);
|
|
124
156
|
|
|
125
157
|
const result = {
|
|
126
158
|
id: accountId,
|
|
127
159
|
balance: new BigNumber(balance.total_balance),
|
|
128
160
|
spendableBalance: new BigNumber(balance.spendable_balance),
|
|
129
|
-
operations: flatMap(
|
|
161
|
+
operations: flatMap(processTxs(rawTxs), mapTxToOps(accountId, info)),
|
|
130
162
|
blockHeight: blockHeight.current_block_identifier.index,
|
|
131
163
|
};
|
|
132
164
|
|
|
@@ -2,7 +2,6 @@ import { BigNumber } from "bignumber.js";
|
|
|
2
2
|
import {
|
|
3
3
|
AmountRequired,
|
|
4
4
|
InvalidAddress,
|
|
5
|
-
InvalidAddressBecauseDestinationIsAlsoSource,
|
|
6
5
|
NotEnoughBalance,
|
|
7
6
|
} from "@ledgerhq/errors";
|
|
8
7
|
|
|
@@ -56,27 +55,6 @@ const filecoin = {
|
|
|
56
55
|
balance: "1000",
|
|
57
56
|
},
|
|
58
57
|
transactions: [
|
|
59
|
-
{
|
|
60
|
-
name: "recipient and sender must not be the same",
|
|
61
|
-
transaction: fromTransactionRaw({
|
|
62
|
-
family: "filecoin",
|
|
63
|
-
method: 1,
|
|
64
|
-
version: 1,
|
|
65
|
-
nonce: 100,
|
|
66
|
-
gasFeeCap: "1000",
|
|
67
|
-
gasLimit: 100,
|
|
68
|
-
gasPremium: "200",
|
|
69
|
-
recipient: SEED_IDENTIFIER,
|
|
70
|
-
amount: "100000000",
|
|
71
|
-
}),
|
|
72
|
-
expectedStatus: {
|
|
73
|
-
amount: new BigNumber("100000000"),
|
|
74
|
-
errors: {
|
|
75
|
-
recipient: new InvalidAddressBecauseDestinationIsAlsoSource(),
|
|
76
|
-
},
|
|
77
|
-
warnings: {},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
58
|
{
|
|
81
59
|
name: "Not a valid address",
|
|
82
60
|
transaction: fromTransactionRaw({
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { HexString } from "@polkadot/util/types";
|
|
2
|
+
|
|
1
3
|
interface IAt {
|
|
2
4
|
hash: string;
|
|
3
5
|
height: string;
|
|
@@ -137,7 +139,7 @@ export interface SidecarTransactionMaterial {
|
|
|
137
139
|
specName: string;
|
|
138
140
|
specVersion: string;
|
|
139
141
|
txVersion: string;
|
|
140
|
-
metadata?:
|
|
142
|
+
metadata?: HexString;
|
|
141
143
|
}
|
|
142
144
|
export interface SidecarTransactionBroadcast {
|
|
143
145
|
hash: string;
|
|
@@ -4,10 +4,6 @@ export const SolanaAccountNotFunded = createCustomErrorClass(
|
|
|
4
4
|
"SolanaAccountNotFunded"
|
|
5
5
|
);
|
|
6
6
|
|
|
7
|
-
export const SolanaNotEnoughBalanceToPayFees = createCustomErrorClass(
|
|
8
|
-
"SolanaNotEnoughBalanceToPayFees"
|
|
9
|
-
);
|
|
10
|
-
|
|
11
7
|
export const SolanaRecipientAssociatedTokenAccountWillBeFunded =
|
|
12
8
|
createCustomErrorClass("SolanaAssociatedTokenAccountWillBeFunded");
|
|
13
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
import type { Account, TransactionStatus } from "../../types";
|
|
3
|
-
import type { Command, Transaction } from "./types";
|
|
3
|
+
import type { Command, Transaction, TransactionModel } 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
10
|
const txFees = new BigNumber(tx.feeCalculator?.lamportsPerSignature ?? 0);
|
|
@@ -12,28 +12,37 @@ const getTransactionStatus = async (
|
|
|
12
12
|
const { commandDescriptor } = tx.model;
|
|
13
13
|
|
|
14
14
|
if (commandDescriptor === undefined) {
|
|
15
|
+
const amount = getAmountForModel(account, tx, txFees);
|
|
16
|
+
const totalSpent = getTotalSpentForModel(tx.model, amount, txFees);
|
|
15
17
|
return {
|
|
16
|
-
amount
|
|
18
|
+
amount,
|
|
17
19
|
errors: {},
|
|
18
20
|
warnings: {},
|
|
19
21
|
estimatedFees: txFees,
|
|
20
|
-
totalSpent
|
|
22
|
+
totalSpent,
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
switch (commandDescriptor.status) {
|
|
24
|
-
case "invalid":
|
|
26
|
+
case "invalid": {
|
|
27
|
+
const amount = getAmountForModel(account, tx, txFees);
|
|
28
|
+
const totalSpent = getTotalSpentForModel(tx.model, amount, txFees);
|
|
25
29
|
return {
|
|
26
|
-
amount
|
|
30
|
+
amount,
|
|
27
31
|
errors: commandDescriptor.errors,
|
|
28
32
|
warnings: commandDescriptor.warnings ?? {},
|
|
29
33
|
estimatedFees: txFees,
|
|
30
|
-
totalSpent
|
|
34
|
+
totalSpent,
|
|
31
35
|
};
|
|
36
|
+
}
|
|
32
37
|
case "valid": {
|
|
33
38
|
const { command } = commandDescriptor;
|
|
34
39
|
const estimatedFees = txFees.plus(commandDescriptor.fees ?? 0);
|
|
35
|
-
const amount =
|
|
36
|
-
const totalSpent =
|
|
40
|
+
const amount = getAmountForCommand(command);
|
|
41
|
+
const totalSpent = getTotalSpentForCommand(
|
|
42
|
+
command,
|
|
43
|
+
amount,
|
|
44
|
+
estimatedFees
|
|
45
|
+
);
|
|
37
46
|
|
|
38
47
|
return {
|
|
39
48
|
amount,
|
|
@@ -48,17 +57,61 @@ const getTransactionStatus = async (
|
|
|
48
57
|
}
|
|
49
58
|
};
|
|
50
59
|
|
|
51
|
-
function
|
|
60
|
+
function getAmountForModel(
|
|
61
|
+
account: Account,
|
|
62
|
+
tx: Transaction,
|
|
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
|
+
}
|
|
84
|
+
|
|
85
|
+
function getTotalSpentForModel(
|
|
86
|
+
model: TransactionModel,
|
|
87
|
+
amount: BigNumber,
|
|
88
|
+
estimatedFees: BigNumber
|
|
89
|
+
) {
|
|
90
|
+
switch (model.kind) {
|
|
91
|
+
case "transfer":
|
|
92
|
+
return amount.plus(estimatedFees);
|
|
93
|
+
case "token.transfer":
|
|
94
|
+
return amount;
|
|
95
|
+
case "token.createATA":
|
|
96
|
+
return estimatedFees;
|
|
97
|
+
default:
|
|
98
|
+
return assertUnreachable(model);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function getAmountForCommand(command: Command) {
|
|
52
103
|
switch (command.kind) {
|
|
53
104
|
case "transfer":
|
|
54
105
|
case "token.transfer":
|
|
55
106
|
return new BigNumber(command.amount);
|
|
107
|
+
case "token.createATA":
|
|
108
|
+
return new BigNumber(0);
|
|
56
109
|
default:
|
|
57
|
-
return
|
|
110
|
+
return assertUnreachable(command);
|
|
58
111
|
}
|
|
59
112
|
}
|
|
60
113
|
|
|
61
|
-
function
|
|
114
|
+
function getTotalSpentForCommand(
|
|
62
115
|
command: Command,
|
|
63
116
|
amount: BigNumber,
|
|
64
117
|
estimatedFees: BigNumber
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
SolanaMemoIsTooLong,
|
|
18
18
|
SolanaTokenAccountHoldsAnotherToken,
|
|
19
19
|
SolanaRecipientAssociatedTokenAccountWillBeFunded,
|
|
20
|
-
SolanaNotEnoughBalanceToPayFees,
|
|
21
20
|
SolanaTokenRecipientIsSenderATA,
|
|
22
21
|
SolanaTokenAccounNotInitialized,
|
|
23
22
|
} from "./errors";
|
|
@@ -64,11 +63,13 @@ async function deriveCommandDescriptor(
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
if (model.uiState.memo) {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
66
|
+
const memoBytes = Buffer.from(model.uiState.memo, "utf-8");
|
|
67
|
+
if (memoBytes.byteLength > MAX_MEMO_LENGTH) {
|
|
69
68
|
errors.memo = errors.memo = new SolanaMemoIsTooLong(undefined, {
|
|
70
69
|
maxLength: MAX_MEMO_LENGTH,
|
|
71
70
|
});
|
|
71
|
+
// LLM expects <transaction> as error key to disable continue button
|
|
72
|
+
errors.transaction = errors.memo;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -102,6 +103,8 @@ const prepareTransaction = async (
|
|
|
102
103
|
|
|
103
104
|
if (tx.feeCalculator === undefined) {
|
|
104
105
|
patch.feeCalculator = feeCalculator;
|
|
106
|
+
// LLM requires this field to be truthy to show fees
|
|
107
|
+
(patch as any).networkInfo = true;
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
const txToDeriveFrom = {
|
|
@@ -137,7 +140,7 @@ const prepareTransaction = async (
|
|
|
137
140
|
const totalFees =
|
|
138
141
|
feeCalculator.lamportsPerSignature + (commandDescriptor.fees ?? 0);
|
|
139
142
|
if (mainAccount.balance.lt(totalFees)) {
|
|
140
|
-
errors.amount = new
|
|
143
|
+
errors.amount = new NotEnoughBalance();
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
}
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
} from "../../types";
|
|
8
8
|
import { open, close } from "../../hw";
|
|
9
9
|
import type {
|
|
10
|
+
Command,
|
|
10
11
|
TokenCreateATACommand,
|
|
11
12
|
TokenTransferCommand,
|
|
12
13
|
Transaction,
|
|
@@ -147,9 +148,7 @@ function optimisticOpForTransfer(
|
|
|
147
148
|
senders: [account.freshAddress],
|
|
148
149
|
recipients: [transaction.recipient],
|
|
149
150
|
value: new BigNumber(command.amount).plus(commons.fee),
|
|
150
|
-
extra:
|
|
151
|
-
memo: command.memo,
|
|
152
|
-
},
|
|
151
|
+
extra: getOpExtras(command),
|
|
153
152
|
};
|
|
154
153
|
}
|
|
155
154
|
|
|
@@ -170,9 +169,7 @@ function optimisticOpForTokenTransfer(
|
|
|
170
169
|
senders: [account.freshAddress],
|
|
171
170
|
recipients: [transaction.recipient],
|
|
172
171
|
value: new BigNumber(command.amount),
|
|
173
|
-
extra:
|
|
174
|
-
memo: command.memo,
|
|
175
|
-
},
|
|
172
|
+
extra: getOpExtras(command),
|
|
176
173
|
subOperations: [
|
|
177
174
|
{
|
|
178
175
|
...optimisticOpcommons(transaction, commandDescriptor),
|
|
@@ -182,9 +179,7 @@ function optimisticOpForTokenTransfer(
|
|
|
182
179
|
senders: [account.freshAddress],
|
|
183
180
|
recipients: [transaction.recipient],
|
|
184
181
|
value: new BigNumber(command.amount),
|
|
185
|
-
extra:
|
|
186
|
-
memo: command.memo,
|
|
187
|
-
},
|
|
182
|
+
extra: getOpExtras(command),
|
|
188
183
|
},
|
|
189
184
|
],
|
|
190
185
|
};
|
|
@@ -228,3 +223,20 @@ function optimisticOpcommons(
|
|
|
228
223
|
extra: {},
|
|
229
224
|
};
|
|
230
225
|
}
|
|
226
|
+
|
|
227
|
+
function getOpExtras(command: Command): Record<string, any> {
|
|
228
|
+
const extra: Record<string, any> = {};
|
|
229
|
+
switch (command.kind) {
|
|
230
|
+
case "transfer":
|
|
231
|
+
case "token.transfer":
|
|
232
|
+
if (command.memo !== undefined) {
|
|
233
|
+
extra.memo = command.memo;
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
case "token.createATA":
|
|
237
|
+
break;
|
|
238
|
+
default:
|
|
239
|
+
return assertUnreachable(command);
|
|
240
|
+
}
|
|
241
|
+
return extra;
|
|
242
|
+
}
|
|
@@ -299,9 +299,7 @@ function txToMainAccOperation(
|
|
|
299
299
|
hasFailed: !!tx.info.err,
|
|
300
300
|
blockHeight: tx.info.slot,
|
|
301
301
|
blockHash: message.recentBlockhash,
|
|
302
|
-
extra:
|
|
303
|
-
memo: tx.info.memo ? dropMemoLengthPrefixIfAny(tx.info.memo) : undefined,
|
|
304
|
-
},
|
|
302
|
+
extra: getOpExtra(tx),
|
|
305
303
|
type: opType,
|
|
306
304
|
senders,
|
|
307
305
|
recipients,
|
|
@@ -311,6 +309,15 @@ function txToMainAccOperation(
|
|
|
311
309
|
};
|
|
312
310
|
}
|
|
313
311
|
|
|
312
|
+
function getOpExtra(tx: TransactionDescriptor): Record<string, any> {
|
|
313
|
+
const extra: Record<string, any> = {};
|
|
314
|
+
if (tx.info.memo !== null) {
|
|
315
|
+
extra.memo = dropMemoLengthPrefixIfAny(tx.info.memo);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return extra;
|
|
319
|
+
}
|
|
320
|
+
|
|
314
321
|
function txToTokenAccOperation(
|
|
315
322
|
tx: TransactionDescriptor,
|
|
316
323
|
assocTokenAcc: OnChainTokenAccount,
|
|
@@ -364,9 +371,7 @@ function txToTokenAccOperation(
|
|
|
364
371
|
senders,
|
|
365
372
|
value: delta.abs(),
|
|
366
373
|
hasFailed: !!tx.info.err,
|
|
367
|
-
extra:
|
|
368
|
-
memo: tx.info.memo ? dropMemoLengthPrefixIfAny(tx.info.memo) : undefined,
|
|
369
|
-
},
|
|
374
|
+
extra: getOpExtra(tx),
|
|
370
375
|
blockHash: tx.parsed.transaction.message.recentBlockhash,
|
|
371
376
|
};
|
|
372
377
|
}
|
|
@@ -110,7 +110,7 @@ const dataset: DatasetTest<Transaction> = {
|
|
|
110
110
|
warnings: {},
|
|
111
111
|
estimatedFees: fees(1),
|
|
112
112
|
amount: zero,
|
|
113
|
-
totalSpent:
|
|
113
|
+
totalSpent: fees(1),
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
116
|
{
|
|
@@ -175,7 +175,7 @@ const dataset: DatasetTest<Transaction> = {
|
|
|
175
175
|
warnings: {},
|
|
176
176
|
estimatedFees: fees(1),
|
|
177
177
|
amount: testOnChainData.fundedSenderBalance,
|
|
178
|
-
totalSpent:
|
|
178
|
+
totalSpent: testOnChainData.fundedSenderBalance.plus(fees(1)),
|
|
179
179
|
},
|
|
180
180
|
},
|
|
181
181
|
{
|
|
@@ -204,7 +204,7 @@ const dataset: DatasetTest<Transaction> = {
|
|
|
204
204
|
warnings: {},
|
|
205
205
|
estimatedFees: testOnChainData.fundedSenderBalance.plus(1),
|
|
206
206
|
amount: zero,
|
|
207
|
-
totalSpent:
|
|
207
|
+
totalSpent: testOnChainData.fundedSenderBalance.plus(1),
|
|
208
208
|
},
|
|
209
209
|
},
|
|
210
210
|
{
|
|
@@ -226,7 +226,7 @@ const dataset: DatasetTest<Transaction> = {
|
|
|
226
226
|
warnings: {},
|
|
227
227
|
estimatedFees: fees(1),
|
|
228
228
|
amount: zero,
|
|
229
|
-
totalSpent:
|
|
229
|
+
totalSpent: fees(1),
|
|
230
230
|
},
|
|
231
231
|
},
|
|
232
232
|
{
|
|
@@ -248,7 +248,7 @@ const dataset: DatasetTest<Transaction> = {
|
|
|
248
248
|
warnings: {},
|
|
249
249
|
estimatedFees: fees(1),
|
|
250
250
|
amount: new BigNumber(-1),
|
|
251
|
-
totalSpent:
|
|
251
|
+
totalSpent: new BigNumber(-1).plus(fees(1)),
|
|
252
252
|
},
|
|
253
253
|
},
|
|
254
254
|
{
|
|
@@ -497,7 +497,7 @@ function recipientRequired(): TransactionTestSpec[] {
|
|
|
497
497
|
warnings: {},
|
|
498
498
|
estimatedFees: fees(1),
|
|
499
499
|
amount: zero,
|
|
500
|
-
totalSpent: zero,
|
|
500
|
+
totalSpent: model.kind === "transfer" ? fees(1) : zero,
|
|
501
501
|
},
|
|
502
502
|
};
|
|
503
503
|
});
|
|
@@ -9,8 +9,8 @@ import { makeSync } from "../../bridge/jsHelpers";
|
|
|
9
9
|
import { getAccountShape } from "./synchronisation";
|
|
10
10
|
|
|
11
11
|
const accounts = [
|
|
12
|
-
"tz1cf8diKsP1WoeucTQm1BcVfdyrmaBnL4nC",
|
|
13
|
-
"tz1ZshTmtorFVkcZ7CpceCAxCn7HBJqTfmpk",
|
|
12
|
+
// "tz1cf8diKsP1WoeucTQm1BcVfdyrmaBnL4nC", // FIXME
|
|
13
|
+
// "tz1ZshTmtorFVkcZ7CpceCAxCn7HBJqTfmpk", // FIXME
|
|
14
14
|
"tz1ZL36Xw6LJ9RK6tb7QW85o7SVYfFKSMw8c",
|
|
15
15
|
"tz1VacAyLcnHU3pEY3VNNK45F1CvVyTYXA3z",
|
|
16
16
|
"tz1hpWkvAVVgftPy4CW8rD3u6tdVd8g1RU58",
|
package/src/hw/actions/app.ts
CHANGED
|
@@ -2,6 +2,7 @@ import invariant from "invariant";
|
|
|
2
2
|
import {
|
|
3
3
|
concat,
|
|
4
4
|
of,
|
|
5
|
+
timer,
|
|
5
6
|
interval,
|
|
6
7
|
Observable,
|
|
7
8
|
throwError,
|
|
@@ -11,7 +12,6 @@ import {
|
|
|
11
12
|
import {
|
|
12
13
|
scan,
|
|
13
14
|
debounce,
|
|
14
|
-
debounceTime,
|
|
15
15
|
catchError,
|
|
16
16
|
timeout,
|
|
17
17
|
switchMap,
|
|
@@ -161,7 +161,7 @@ const reducer = (state: State, e: Event): State => {
|
|
|
161
161
|
return { ...state, unresponsive: true };
|
|
162
162
|
|
|
163
163
|
case "disconnected":
|
|
164
|
-
return getInitialState();
|
|
164
|
+
return { ...getInitialState(), isLoading: !!e.expected };
|
|
165
165
|
|
|
166
166
|
case "deviceChange":
|
|
167
167
|
return { ...getInitialState(e.device), device: e.device };
|
|
@@ -384,13 +384,14 @@ function inferCommandParams(appRequest: AppRequest) {
|
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
const DISCONNECT_DEBOUNCE = 5000;
|
|
387
388
|
const implementations = {
|
|
388
389
|
// in this paradigm, we know that deviceSubject is reflecting the device events
|
|
389
390
|
// so we just trust deviceSubject to reflect the device context (switch between apps, dashboard,...)
|
|
390
391
|
event: ({ deviceSubject, connectApp, params }) =>
|
|
391
392
|
deviceSubject.pipe(
|
|
392
|
-
// debounce a bit the
|
|
393
|
-
|
|
393
|
+
// debounce a bit the disconnect events that we don't need
|
|
394
|
+
debounce((device) => timer(!device ? DISCONNECT_DEBOUNCE : 0)),
|
|
394
395
|
switchMap((device) =>
|
|
395
396
|
concat(
|
|
396
397
|
of({
|
|
@@ -406,7 +407,6 @@ const implementations = {
|
|
|
406
407
|
Observable.create((o) => {
|
|
407
408
|
const POLLING = 2000;
|
|
408
409
|
const INIT_DEBOUNCE = 5000;
|
|
409
|
-
const DISCONNECT_DEBOUNCE = 5000;
|
|
410
410
|
const DEVICE_POLLING_TIMEOUT = 20000;
|
|
411
411
|
// this pattern allows to actually support events based (like if deviceSubject emits new device changes) but inside polling paradigm
|
|
412
412
|
let pollingOnDevice;
|
|
@@ -486,7 +486,6 @@ const implementations = {
|
|
|
486
486
|
device,
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
-
|
|
490
489
|
o.next(event);
|
|
491
490
|
}
|
|
492
491
|
},
|
package/src/hw/connectApp.ts
CHANGED
|
@@ -53,6 +53,7 @@ export type ConnectAppEvent =
|
|
|
53
53
|
}
|
|
54
54
|
| {
|
|
55
55
|
type: "disconnected";
|
|
56
|
+
expected?: boolean;
|
|
56
57
|
}
|
|
57
58
|
| {
|
|
58
59
|
type: "device-permission-requested";
|
|
@@ -144,6 +145,7 @@ const attemptToQuitApp = (
|
|
|
144
145
|
concatMap(() =>
|
|
145
146
|
of<ConnectAppEvent>({
|
|
146
147
|
type: "disconnected",
|
|
148
|
+
expected: true,
|
|
147
149
|
})
|
|
148
150
|
),
|
|
149
151
|
catchError((e) => throwError(e))
|