@ledgerhq/live-common 31.0.0 → 31.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/countervalues/api/api.d.ts.map +1 -1
- package/lib/countervalues/api/api.js +12 -18
- package/lib/countervalues/api/api.js.map +1 -1
- package/lib/countervalues/helpers.d.ts +2 -0
- package/lib/countervalues/helpers.d.ts.map +1 -1
- package/lib/countervalues/helpers.js +19 -5
- package/lib/countervalues/helpers.js.map +1 -1
- package/lib/countervalues/logic.d.ts.map +1 -1
- package/lib/countervalues/logic.integration.test.js.map +1 -1
- package/lib/countervalues/logic.js +1 -0
- package/lib/countervalues/logic.js.map +1 -1
- package/lib/countervalues/react.d.ts.map +1 -1
- package/lib/countervalues/react.js +9 -7
- package/lib/countervalues/react.js.map +1 -1
- package/lib/countervalues/react.test.d.ts +2 -0
- package/lib/countervalues/react.test.d.ts.map +1 -0
- package/lib/countervalues/react.test.js +107 -0
- package/lib/countervalues/react.test.js.map +1 -0
- package/lib/data/icons/react/euroc.d.ts +8 -0
- package/lib/data/icons/react/euroc.d.ts.map +1 -0
- package/lib/data/icons/react/euroc.js +36 -0
- package/lib/data/icons/react/euroc.js.map +1 -0
- package/lib/data/icons/react/index.d.ts +1 -0
- package/lib/data/icons/react/index.d.ts.map +1 -1
- package/lib/data/icons/react/index.js +9 -7
- package/lib/data/icons/react/index.js.map +1 -1
- package/lib/data/icons/reactNative/euroc.d.ts +8 -0
- package/lib/data/icons/reactNative/euroc.d.ts.map +1 -0
- package/lib/data/icons/reactNative/euroc.js +37 -0
- package/lib/data/icons/reactNative/euroc.js.map +1 -0
- package/lib/data/icons/reactNative/index.d.ts +1 -0
- package/lib/data/icons/reactNative/index.d.ts.map +1 -1
- package/lib/data/icons/reactNative/index.js +9 -7
- package/lib/data/icons/reactNative/index.js.map +1 -1
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +32 -0
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -0
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js +39 -0
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts +27 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts.map +1 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.js +37 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.js.map +1 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts +2 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js +81 -0
- package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js.map +1 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +33 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +53 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts +2 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts.map +1 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js +93 -0
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js.map +1 -0
- package/lib/deviceSDK/tasks/core.js.map +1 -1
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +30 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +64 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts +2 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js +100 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js.map +1 -0
- package/lib/families/bitcoin/descriptor.d.ts.map +1 -1
- package/lib/families/bitcoin/descriptor.js.map +1 -1
- package/lib/families/bitcoin/satstack.d.ts +1 -0
- package/lib/families/bitcoin/satstack.d.ts.map +1 -1
- package/lib/families/bitcoin/satstack.js.map +1 -1
- package/lib/families/bitcoin/walletApiAdapter.js +4 -4
- package/lib/families/bitcoin/walletApiAdapter.js.map +1 -1
- package/lib/families/bitcoin/walletApiAdapter.test.js +9 -2
- package/lib/families/bitcoin/walletApiAdapter.test.js.map +1 -1
- package/lib/families/cosmos/api/Cosmos.d.ts +2 -0
- package/lib/families/cosmos/api/Cosmos.d.ts.map +1 -1
- package/lib/families/cosmos/api/Cosmos.js +34 -10
- package/lib/families/cosmos/api/Cosmos.js.map +1 -1
- package/lib/families/cosmos/helpers.d.ts +2 -8
- package/lib/families/cosmos/helpers.d.ts.map +1 -1
- package/lib/families/cosmos/helpers.js.map +1 -1
- package/lib/families/cosmos/helpers.unit.test.js +8 -8
- package/lib/families/cosmos/js-synchronisation.d.ts.map +1 -1
- package/lib/families/cosmos/js-synchronisation.js +40 -22
- package/lib/families/cosmos/js-synchronisation.js.map +1 -1
- package/lib/families/cosmos/js-synchronisation.unit.test.d.ts +2 -0
- package/lib/families/cosmos/js-synchronisation.unit.test.d.ts.map +1 -0
- package/lib/families/cosmos/js-synchronisation.unit.test.js +309 -0
- package/lib/families/cosmos/js-synchronisation.unit.test.js.map +1 -0
- package/lib/families/cosmos/react.d.ts +1 -1
- package/lib/families/cosmos/react.d.ts.map +1 -1
- package/lib/families/cosmos/react.js +7 -3
- package/lib/families/cosmos/react.js.map +1 -1
- package/lib/families/cosmos/types.d.ts +9 -8
- package/lib/families/cosmos/types.d.ts.map +1 -1
- package/lib/families/ethereum/walletApiAdapter.d.ts +3 -1
- package/lib/families/ethereum/walletApiAdapter.d.ts.map +1 -1
- package/lib/families/ethereum/walletApiAdapter.js +24 -6
- package/lib/families/ethereum/walletApiAdapter.js.map +1 -1
- package/lib/families/ethereum/walletApiAdapter.test.js +10 -3
- package/lib/families/ethereum/walletApiAdapter.test.js.map +1 -1
- package/lib/families/near/api/archive-node-sdk.d.ts.map +1 -1
- package/lib/families/near/api/archive-node-sdk.js +1 -2
- package/lib/families/near/api/archive-node-sdk.js.map +1 -1
- package/lib/families/polkadot/walletApiAdapter.js +3 -3
- package/lib/families/polkadot/walletApiAdapter.js.map +1 -1
- package/lib/families/polkadot/walletApiAdapter.test.js +10 -3
- package/lib/families/polkadot/walletApiAdapter.test.js.map +1 -1
- package/lib/families/ripple/walletApiAdapter.d.ts.map +1 -1
- package/lib/families/ripple/walletApiAdapter.js +2 -5
- package/lib/families/ripple/walletApiAdapter.js.map +1 -1
- package/lib/families/ripple/walletApiAdapter.test.js +10 -3
- package/lib/families/ripple/walletApiAdapter.test.js.map +1 -1
- package/lib/families/solana/api/chain/account/stake.d.ts +0 -1
- package/lib/families/solana/api/chain/account/stake.d.ts.map +1 -1
- package/lib/families/solana/api/chain/account/token.d.ts +0 -1
- package/lib/families/solana/api/chain/account/token.d.ts.map +1 -1
- package/lib/families/solana/api/chain/account/vote.d.ts +0 -1
- package/lib/families/solana/api/chain/account/vote.d.ts.map +1 -1
- package/lib/families/solana/api/chain/index.d.ts +2 -2
- package/lib/families/solana/api/chain/index.d.ts.map +1 -1
- package/lib/families/solana/api/chain/index.js +5 -1
- package/lib/families/solana/api/chain/index.js.map +1 -1
- package/lib/families/solana/api/chain/instruction/associated-token-account/types.d.ts +0 -1
- package/lib/families/solana/api/chain/instruction/associated-token-account/types.d.ts.map +1 -1
- package/lib/families/solana/api/chain/instruction/stake/types.d.ts +0 -1
- package/lib/families/solana/api/chain/instruction/stake/types.d.ts.map +1 -1
- package/lib/families/solana/api/chain/instruction/system/types.d.ts +0 -1
- package/lib/families/solana/api/chain/instruction/system/types.d.ts.map +1 -1
- package/lib/families/solana/api/chain/instruction/token/types.d.ts +0 -1
- package/lib/families/solana/api/chain/instruction/token/types.d.ts.map +1 -1
- package/lib/families/solana/js-buildTransaction.d.ts +1 -1
- package/lib/families/solana/js-buildTransaction.d.ts.map +1 -1
- package/lib/families/solana/js-buildTransaction.js +4 -3
- package/lib/families/solana/js-buildTransaction.js.map +1 -1
- package/lib/families/solana/js-signOperation.js +2 -2
- package/lib/families/solana/js-signOperation.js.map +1 -1
- package/lib/families/solana/tx-fees.js +4 -4
- package/lib/families/solana/tx-fees.js.map +1 -1
- package/lib/generated/walletApiAdapter.d.ts +1 -1
- package/lib/hw/actions/implementations.d.ts.map +1 -1
- package/lib/hw/actions/implementations.js +16 -2
- package/lib/hw/actions/implementations.js.map +1 -1
- package/lib/hw/extractOnboardingState.d.ts +2 -1
- package/lib/hw/extractOnboardingState.d.ts.map +1 -1
- package/lib/hw/extractOnboardingState.js +3 -1
- package/lib/hw/extractOnboardingState.js.map +1 -1
- package/lib/hw/extractOnboardingState.test.js +10 -0
- package/lib/hw/extractOnboardingState.test.js.map +1 -1
- package/lib/hw/staxRemoveImage.d.ts.map +1 -1
- package/lib/hw/staxRemoveImage.js +4 -0
- package/lib/hw/staxRemoveImage.js.map +1 -1
- package/lib/hw/staxRemoveImage.test.js +5 -0
- package/lib/hw/staxRemoveImage.test.js.map +1 -1
- package/lib/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
- package/lib/mock/fixtures/cryptoCurrencies.js +0 -1
- package/lib/mock/fixtures/cryptoCurrencies.js.map +1 -1
- package/lib/platform/logic.d.ts +2 -2
- package/lib/platform/logic.d.ts.map +1 -1
- package/lib/platform/logic.js +2 -1
- package/lib/platform/logic.js.map +1 -1
- package/lib/wallet-api/converters.d.ts.map +1 -1
- package/lib/wallet-api/converters.js +7 -3
- package/lib/wallet-api/converters.js.map +1 -1
- package/lib/wallet-api/converters.test.d.ts.map +1 -1
- package/lib/wallet-api/converters.test.js +3 -2
- package/lib/wallet-api/converters.test.js.map +1 -1
- package/lib/wallet-api/helpers.d.ts.map +1 -1
- package/lib/wallet-api/helpers.js +1 -1
- package/lib/wallet-api/helpers.js.map +1 -1
- package/lib/wallet-api/logic.d.ts +1 -1
- package/lib/wallet-api/logic.d.ts.map +1 -1
- package/lib/wallet-api/logic.js +12 -3
- package/lib/wallet-api/logic.js.map +1 -1
- package/lib/wallet-api/react.js +1 -1
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/types.d.ts +11 -3
- package/lib/wallet-api/types.d.ts.map +1 -1
- package/lib-es/countervalues/api/api.d.ts.map +1 -1
- package/lib-es/countervalues/api/api.js +13 -19
- package/lib-es/countervalues/api/api.js.map +1 -1
- package/lib-es/countervalues/helpers.d.ts +2 -0
- package/lib-es/countervalues/helpers.d.ts.map +1 -1
- package/lib-es/countervalues/helpers.js +16 -4
- package/lib-es/countervalues/helpers.js.map +1 -1
- package/lib-es/countervalues/logic.d.ts.map +1 -1
- package/lib-es/countervalues/logic.integration.test.js.map +1 -1
- package/lib-es/countervalues/logic.js +1 -0
- package/lib-es/countervalues/logic.js.map +1 -1
- package/lib-es/countervalues/react.d.ts.map +1 -1
- package/lib-es/countervalues/react.js +10 -8
- package/lib-es/countervalues/react.js.map +1 -1
- package/lib-es/countervalues/react.test.d.ts +2 -0
- package/lib-es/countervalues/react.test.d.ts.map +1 -0
- package/lib-es/countervalues/react.test.js +105 -0
- package/lib-es/countervalues/react.test.js.map +1 -0
- package/lib-es/data/icons/react/euroc.d.ts +8 -0
- package/lib-es/data/icons/react/euroc.d.ts.map +1 -0
- package/lib-es/data/icons/react/euroc.js +11 -0
- package/lib-es/data/icons/react/euroc.js.map +1 -0
- package/lib-es/data/icons/react/index.d.ts +1 -0
- package/lib-es/data/icons/react/index.d.ts.map +1 -1
- package/lib-es/data/icons/react/index.js +1 -0
- package/lib-es/data/icons/react/index.js.map +1 -1
- package/lib-es/data/icons/reactNative/euroc.d.ts +8 -0
- package/lib-es/data/icons/reactNative/euroc.d.ts.map +1 -0
- package/lib-es/data/icons/reactNative/euroc.js +12 -0
- package/lib-es/data/icons/reactNative/euroc.js.map +1 -0
- package/lib-es/data/icons/reactNative/index.d.ts +1 -0
- package/lib-es/data/icons/reactNative/index.d.ts.map +1 -1
- package/lib-es/data/icons/reactNative/index.js +1 -0
- package/lib-es/data/icons/reactNative/index.js.map +1 -1
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +32 -0
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -0
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js +35 -0
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts +27 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts.map +1 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.js +33 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.js.map +1 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts +2 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js +79 -0
- package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js.map +1 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +33 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +49 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts +2 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts.map +1 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js +91 -0
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js.map +1 -0
- package/lib-es/deviceSDK/tasks/core.js.map +1 -1
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +30 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +60 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts +2 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js +98 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js.map +1 -0
- package/lib-es/families/bitcoin/descriptor.d.ts.map +1 -1
- package/lib-es/families/bitcoin/descriptor.js.map +1 -1
- package/lib-es/families/bitcoin/satstack.d.ts +1 -0
- package/lib-es/families/bitcoin/satstack.d.ts.map +1 -1
- package/lib-es/families/bitcoin/satstack.js.map +1 -1
- package/lib-es/families/bitcoin/walletApiAdapter.js +4 -4
- package/lib-es/families/bitcoin/walletApiAdapter.js.map +1 -1
- package/lib-es/families/bitcoin/walletApiAdapter.test.js +9 -2
- package/lib-es/families/bitcoin/walletApiAdapter.test.js.map +1 -1
- package/lib-es/families/cosmos/api/Cosmos.d.ts +2 -0
- package/lib-es/families/cosmos/api/Cosmos.d.ts.map +1 -1
- package/lib-es/families/cosmos/api/Cosmos.js +34 -10
- package/lib-es/families/cosmos/api/Cosmos.js.map +1 -1
- package/lib-es/families/cosmos/helpers.d.ts +2 -8
- package/lib-es/families/cosmos/helpers.d.ts.map +1 -1
- package/lib-es/families/cosmos/helpers.js.map +1 -1
- package/lib-es/families/cosmos/helpers.unit.test.js +8 -8
- package/lib-es/families/cosmos/js-synchronisation.d.ts.map +1 -1
- package/lib-es/families/cosmos/js-synchronisation.js +40 -22
- package/lib-es/families/cosmos/js-synchronisation.js.map +1 -1
- package/lib-es/families/cosmos/js-synchronisation.unit.test.d.ts +2 -0
- package/lib-es/families/cosmos/js-synchronisation.unit.test.d.ts.map +1 -0
- package/lib-es/families/cosmos/js-synchronisation.unit.test.js +281 -0
- package/lib-es/families/cosmos/js-synchronisation.unit.test.js.map +1 -0
- package/lib-es/families/cosmos/react.d.ts +1 -1
- package/lib-es/families/cosmos/react.d.ts.map +1 -1
- package/lib-es/families/cosmos/react.js +7 -3
- package/lib-es/families/cosmos/react.js.map +1 -1
- package/lib-es/families/cosmos/types.d.ts +9 -8
- package/lib-es/families/cosmos/types.d.ts.map +1 -1
- package/lib-es/families/ethereum/walletApiAdapter.d.ts +3 -1
- package/lib-es/families/ethereum/walletApiAdapter.d.ts.map +1 -1
- package/lib-es/families/ethereum/walletApiAdapter.js +24 -6
- package/lib-es/families/ethereum/walletApiAdapter.js.map +1 -1
- package/lib-es/families/ethereum/walletApiAdapter.test.js +10 -3
- package/lib-es/families/ethereum/walletApiAdapter.test.js.map +1 -1
- package/lib-es/families/near/api/archive-node-sdk.d.ts.map +1 -1
- package/lib-es/families/near/api/archive-node-sdk.js +1 -2
- package/lib-es/families/near/api/archive-node-sdk.js.map +1 -1
- package/lib-es/families/polkadot/walletApiAdapter.js +3 -3
- package/lib-es/families/polkadot/walletApiAdapter.js.map +1 -1
- package/lib-es/families/polkadot/walletApiAdapter.test.js +10 -3
- package/lib-es/families/polkadot/walletApiAdapter.test.js.map +1 -1
- package/lib-es/families/ripple/walletApiAdapter.d.ts.map +1 -1
- package/lib-es/families/ripple/walletApiAdapter.js +2 -5
- package/lib-es/families/ripple/walletApiAdapter.js.map +1 -1
- package/lib-es/families/ripple/walletApiAdapter.test.js +10 -3
- package/lib-es/families/ripple/walletApiAdapter.test.js.map +1 -1
- package/lib-es/families/solana/api/chain/account/stake.d.ts +0 -1
- package/lib-es/families/solana/api/chain/account/stake.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/account/token.d.ts +0 -1
- package/lib-es/families/solana/api/chain/account/token.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/account/vote.d.ts +0 -1
- package/lib-es/families/solana/api/chain/account/vote.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/index.d.ts +2 -2
- package/lib-es/families/solana/api/chain/index.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/index.js +5 -1
- package/lib-es/families/solana/api/chain/index.js.map +1 -1
- package/lib-es/families/solana/api/chain/instruction/associated-token-account/types.d.ts +0 -1
- package/lib-es/families/solana/api/chain/instruction/associated-token-account/types.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/instruction/stake/types.d.ts +0 -1
- package/lib-es/families/solana/api/chain/instruction/stake/types.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/instruction/system/types.d.ts +0 -1
- package/lib-es/families/solana/api/chain/instruction/system/types.d.ts.map +1 -1
- package/lib-es/families/solana/api/chain/instruction/token/types.d.ts +0 -1
- package/lib-es/families/solana/api/chain/instruction/token/types.d.ts.map +1 -1
- package/lib-es/families/solana/js-buildTransaction.d.ts +1 -1
- package/lib-es/families/solana/js-buildTransaction.d.ts.map +1 -1
- package/lib-es/families/solana/js-buildTransaction.js +5 -4
- package/lib-es/families/solana/js-buildTransaction.js.map +1 -1
- package/lib-es/families/solana/js-signOperation.js +2 -2
- package/lib-es/families/solana/js-signOperation.js.map +1 -1
- package/lib-es/families/solana/tx-fees.js +4 -4
- package/lib-es/families/solana/tx-fees.js.map +1 -1
- package/lib-es/generated/walletApiAdapter.d.ts +1 -1
- package/lib-es/hw/actions/implementations.d.ts.map +1 -1
- package/lib-es/hw/actions/implementations.js +18 -4
- package/lib-es/hw/actions/implementations.js.map +1 -1
- package/lib-es/hw/extractOnboardingState.d.ts +2 -1
- package/lib-es/hw/extractOnboardingState.d.ts.map +1 -1
- package/lib-es/hw/extractOnboardingState.js +3 -1
- package/lib-es/hw/extractOnboardingState.js.map +1 -1
- package/lib-es/hw/extractOnboardingState.test.js +10 -0
- package/lib-es/hw/extractOnboardingState.test.js.map +1 -1
- package/lib-es/hw/staxRemoveImage.d.ts.map +1 -1
- package/lib-es/hw/staxRemoveImage.js +4 -0
- package/lib-es/hw/staxRemoveImage.js.map +1 -1
- package/lib-es/hw/staxRemoveImage.test.js +5 -0
- package/lib-es/hw/staxRemoveImage.test.js.map +1 -1
- package/lib-es/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
- package/lib-es/mock/fixtures/cryptoCurrencies.js +0 -1
- package/lib-es/mock/fixtures/cryptoCurrencies.js.map +1 -1
- package/lib-es/platform/logic.d.ts +2 -2
- package/lib-es/platform/logic.d.ts.map +1 -1
- package/lib-es/platform/logic.js +2 -1
- package/lib-es/platform/logic.js.map +1 -1
- package/lib-es/wallet-api/converters.d.ts.map +1 -1
- package/lib-es/wallet-api/converters.js +7 -3
- package/lib-es/wallet-api/converters.js.map +1 -1
- package/lib-es/wallet-api/converters.test.d.ts.map +1 -1
- package/lib-es/wallet-api/converters.test.js +3 -2
- package/lib-es/wallet-api/converters.test.js.map +1 -1
- package/lib-es/wallet-api/helpers.d.ts.map +1 -1
- package/lib-es/wallet-api/helpers.js +1 -1
- package/lib-es/wallet-api/helpers.js.map +1 -1
- package/lib-es/wallet-api/logic.d.ts +1 -1
- package/lib-es/wallet-api/logic.d.ts.map +1 -1
- package/lib-es/wallet-api/logic.js +12 -3
- package/lib-es/wallet-api/logic.js.map +1 -1
- package/lib-es/wallet-api/react.js +1 -1
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/types.d.ts +11 -3
- package/lib-es/wallet-api/types.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/countervalues/api/api.ts +25 -23
- package/src/countervalues/helpers.ts +21 -3
- package/src/countervalues/logic.integration.test.ts +1 -0
- package/src/countervalues/logic.ts +1 -0
- package/src/countervalues/react.test.ts +120 -0
- package/src/countervalues/react.tsx +10 -13
- package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +44 -4
- package/src/data/icons/react/euroc.tsx +12 -0
- package/src/data/icons/react/index.tsx +1 -0
- package/src/data/icons/reactNative/euroc.tsx +13 -0
- package/src/data/icons/reactNative/index.tsx +1 -0
- package/src/data/icons/svg/EUROC.svg +5 -0
- package/src/deviceSDK/actions/toggleOnboardingEarlyCheck.ts +86 -0
- package/src/deviceSDK/commands/toggleOnboardingEarlyCheck.test.ts +85 -0
- package/src/deviceSDK/commands/toggleOnboardingEarlyCheck.ts +42 -0
- package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.ts +125 -0
- package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.ts +71 -0
- package/src/deviceSDK/tasks/core.ts +1 -1
- package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.ts +111 -0
- package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.ts +92 -0
- package/src/families/bitcoin/descriptor.ts +5 -2
- package/src/families/bitcoin/satstack.ts +1 -0
- package/src/families/bitcoin/walletApiAdapter.test.ts +11 -2
- package/src/families/bitcoin/walletApiAdapter.ts +4 -4
- package/src/families/cosmos/__snapshots__/bridge.integration.test.ts.snap +664 -19
- package/src/families/cosmos/api/Cosmos.ts +34 -6
- package/src/families/cosmos/helpers.ts +2 -5
- package/src/families/cosmos/helpers.unit.test.ts +8 -8
- package/src/families/cosmos/js-synchronisation.ts +74 -27
- package/src/families/cosmos/js-synchronisation.unit.test.ts +339 -0
- package/src/families/cosmos/react.ts +8 -6
- package/src/families/cosmos/types.ts +6 -4
- package/src/families/ethereum/walletApiAdapter.test.ts +12 -3
- package/src/families/ethereum/walletApiAdapter.ts +44 -13
- package/src/families/near/api/archive-node-sdk.ts +2 -3
- package/src/families/polkadot/walletApiAdapter.test.ts +13 -4
- package/src/families/polkadot/walletApiAdapter.ts +3 -3
- package/src/families/ripple/walletApiAdapter.test.ts +12 -3
- package/src/families/ripple/walletApiAdapter.ts +2 -10
- package/src/families/solana/api/chain/index.ts +8 -4
- package/src/families/solana/js-buildTransaction.ts +6 -4
- package/src/families/solana/js-signOperation.ts +2 -2
- package/src/families/solana/tx-fees.ts +6 -6
- package/src/hw/actions/implementations.ts +20 -0
- package/src/hw/extractOnboardingState.test.ts +15 -0
- package/src/hw/extractOnboardingState.ts +3 -1
- package/src/hw/staxRemoveImage.test.ts +10 -0
- package/src/hw/staxRemoveImage.ts +4 -0
- package/src/mock/fixtures/cryptoCurrencies.ts +0 -1
- package/src/platform/logic.ts +5 -3
- package/src/wallet-api/converters.test.ts +5 -2
- package/src/wallet-api/converters.ts +8 -3
- package/src/wallet-api/helpers.ts +2 -1
- package/src/wallet-api/logic.ts +15 -4
- package/src/wallet-api/react.ts +1 -1
- package/src/wallet-api/types.ts +19 -3
- package/lib/countervalues/api/api.legacy.d.ts +0 -4
- package/lib/countervalues/api/api.legacy.d.ts.map +0 -1
- package/lib/countervalues/api/api.legacy.js +0 -96
- package/lib/countervalues/api/api.legacy.js.map +0 -1
- package/lib-es/countervalues/api/api.legacy.d.ts +0 -4
- package/lib-es/countervalues/api/api.legacy.d.ts.map +0 -1
- package/lib-es/countervalues/api/api.legacy.js +0 -91
- package/lib-es/countervalues/api/api.legacy.js.map +0 -1
- package/src/countervalues/api/api.legacy.ts +0 -91
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import eth from "./walletApiAdapter";
|
|
2
1
|
import { EthereumTransaction as WalletAPITransaction } from "@ledgerhq/wallet-api-core";
|
|
2
|
+
import { Account } from "@ledgerhq/types-live";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
|
+
import eth from "./walletApiAdapter";
|
|
4
5
|
import { Transaction } from "./types";
|
|
5
6
|
|
|
6
7
|
describe("getPlatformTransactionSignFlowInfos", () => {
|
|
7
8
|
describe("should properly get infos for ETH platform tx", () => {
|
|
9
|
+
const dummyAccount = { currency: { family: "ethereum" } } as Account;
|
|
10
|
+
|
|
8
11
|
test("without fees provided", () => {
|
|
9
12
|
const ethPlatformTx: WalletAPITransaction = {
|
|
10
13
|
family: "ethereum",
|
|
@@ -19,7 +22,10 @@ describe("getPlatformTransactionSignFlowInfos", () => {
|
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
const { canEditFees, hasFeesProvided, liveTx } =
|
|
22
|
-
eth.getWalletAPITransactionSignFlowInfos(
|
|
25
|
+
eth.getWalletAPITransactionSignFlowInfos({
|
|
26
|
+
tx: ethPlatformTx,
|
|
27
|
+
account: dummyAccount,
|
|
28
|
+
});
|
|
23
29
|
|
|
24
30
|
expect(canEditFees).toBe(true);
|
|
25
31
|
|
|
@@ -47,7 +53,10 @@ describe("getPlatformTransactionSignFlowInfos", () => {
|
|
|
47
53
|
};
|
|
48
54
|
|
|
49
55
|
const { canEditFees, hasFeesProvided, liveTx } =
|
|
50
|
-
eth.getWalletAPITransactionSignFlowInfos(
|
|
56
|
+
eth.getWalletAPITransactionSignFlowInfos({
|
|
57
|
+
tx: ethPlatformTx,
|
|
58
|
+
account: dummyAccount,
|
|
59
|
+
});
|
|
51
60
|
|
|
52
61
|
expect(canEditFees).toBe(true);
|
|
53
62
|
|
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
import { EthereumTransaction as WalletAPIEthereumTransaction } from "@ledgerhq/wallet-api-core";
|
|
2
|
+
import { Account } from "@ledgerhq/types-live";
|
|
3
|
+
import { Transaction as EvmTx } from "@ledgerhq/coin-evm/types";
|
|
2
4
|
import {
|
|
3
5
|
AreFeesProvided,
|
|
4
6
|
ConvertToLiveTransaction,
|
|
5
7
|
GetWalletAPITransactionSignFlowInfos,
|
|
6
8
|
} from "../../wallet-api/types";
|
|
7
|
-
import { Transaction } from "./types";
|
|
9
|
+
import { Transaction as EthTx } from "./types";
|
|
10
|
+
import { isTokenAccount } from "../../account";
|
|
8
11
|
|
|
9
12
|
const CAN_EDIT_FEES = true;
|
|
10
13
|
|
|
14
|
+
type Transaction = EthTx | EvmTx;
|
|
15
|
+
|
|
11
16
|
const areFeesProvided: AreFeesProvided<WalletAPIEthereumTransaction> = (tx) =>
|
|
12
|
-
!!(
|
|
17
|
+
!!(
|
|
18
|
+
(tx.gasLimit && tx.gasPrice) ||
|
|
19
|
+
(tx.gasLimit && tx.maxFeePerGas && tx.maxPriorityFeePerGas)
|
|
20
|
+
);
|
|
13
21
|
|
|
14
22
|
const convertToLiveTransaction: ConvertToLiveTransaction<
|
|
15
23
|
WalletAPIEthereumTransaction,
|
|
16
24
|
Transaction
|
|
17
|
-
> = (tx) => {
|
|
25
|
+
> = ({ tx, account, parentAccount }) => {
|
|
18
26
|
const hasFeesProvided = areFeesProvided(tx);
|
|
19
27
|
|
|
28
|
+
const accountFamily = isTokenAccount(account)
|
|
29
|
+
? (parentAccount as Account).currency.family
|
|
30
|
+
: account.currency.family;
|
|
20
31
|
const { gasLimit, ...restTx } = tx;
|
|
21
32
|
|
|
22
|
-
const liveTx: Partial<Transaction> =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
const liveTx: Partial<Transaction> =
|
|
34
|
+
accountFamily === "ethereum"
|
|
35
|
+
? {
|
|
36
|
+
...restTx,
|
|
37
|
+
userGasLimit: gasLimit,
|
|
38
|
+
}
|
|
39
|
+
: convertToEvmLiveTransaction(tx);
|
|
29
40
|
|
|
30
41
|
return hasFeesProvided ? { ...liveTx, feesStrategy: "custom" } : liveTx;
|
|
31
42
|
};
|
|
@@ -33,12 +44,32 @@ const convertToLiveTransaction: ConvertToLiveTransaction<
|
|
|
33
44
|
const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
|
|
34
45
|
WalletAPIEthereumTransaction,
|
|
35
46
|
Transaction
|
|
36
|
-
> = (
|
|
47
|
+
> = (params) => {
|
|
37
48
|
return {
|
|
38
49
|
canEditFees: CAN_EDIT_FEES,
|
|
39
|
-
liveTx: convertToLiveTransaction(
|
|
40
|
-
hasFeesProvided: areFeesProvided(tx),
|
|
50
|
+
liveTx: convertToLiveTransaction(params),
|
|
51
|
+
hasFeesProvided: areFeesProvided(params.tx),
|
|
41
52
|
};
|
|
42
53
|
};
|
|
43
54
|
|
|
44
55
|
export default { getWalletAPITransactionSignFlowInfos };
|
|
56
|
+
|
|
57
|
+
function convertToEvmLiveTransaction(
|
|
58
|
+
tx: WalletAPIEthereumTransaction
|
|
59
|
+
): Partial<EvmTx> {
|
|
60
|
+
const params = {
|
|
61
|
+
family: "evm" as const,
|
|
62
|
+
nonce: tx.nonce,
|
|
63
|
+
amount: tx.amount,
|
|
64
|
+
recipient: tx.recipient,
|
|
65
|
+
data: tx.data,
|
|
66
|
+
gasLimit: tx.gasLimit,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return tx.maxPriorityFeePerGas || tx.maxFeePerGas
|
|
70
|
+
? {
|
|
71
|
+
...params,
|
|
72
|
+
type: 2,
|
|
73
|
+
}
|
|
74
|
+
: { ...params, type: 0 };
|
|
75
|
+
}
|
|
@@ -294,9 +294,8 @@ export const getCommission = async (
|
|
|
294
294
|
if (Array.isArray(result) && result.length) {
|
|
295
295
|
const parsedResult = JSON.parse(Buffer.from(result).toString());
|
|
296
296
|
|
|
297
|
-
return (
|
|
298
|
-
|
|
299
|
-
100
|
|
297
|
+
return Math.round(
|
|
298
|
+
(parsedResult.numerator / parsedResult.denominator) * 100
|
|
300
299
|
);
|
|
301
300
|
}
|
|
302
301
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Account } from "@ledgerhq/types-live";
|
|
2
2
|
import { PolkadotTransaction as PlatformTransaction } from "@ledgerhq/wallet-api-core";
|
|
3
|
-
import BigNumber from "bignumber.js";
|
|
4
3
|
import { Transaction } from "@ledgerhq/coin-polkadot/types";
|
|
4
|
+
import BigNumber from "bignumber.js";
|
|
5
|
+
import dot from "./walletApiAdapter";
|
|
5
6
|
|
|
6
7
|
describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
7
8
|
describe("should properly get infos for DOT platform tx", () => {
|
|
9
|
+
const dummyAccount = {} as Account;
|
|
10
|
+
|
|
8
11
|
it("with most basic tx", () => {
|
|
9
12
|
const dotPlatformTx: PlatformTransaction = {
|
|
10
13
|
family: "polkadot",
|
|
@@ -21,7 +24,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
const { canEditFees, hasFeesProvided, liveTx } =
|
|
24
|
-
dot.getWalletAPITransactionSignFlowInfos(
|
|
27
|
+
dot.getWalletAPITransactionSignFlowInfos({
|
|
28
|
+
tx: dotPlatformTx,
|
|
29
|
+
account: dummyAccount,
|
|
30
|
+
});
|
|
25
31
|
|
|
26
32
|
expect(canEditFees).toBe(false);
|
|
27
33
|
|
|
@@ -48,7 +54,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
|
48
54
|
};
|
|
49
55
|
|
|
50
56
|
const { canEditFees, hasFeesProvided, liveTx } =
|
|
51
|
-
dot.getWalletAPITransactionSignFlowInfos(
|
|
57
|
+
dot.getWalletAPITransactionSignFlowInfos({
|
|
58
|
+
tx: dotPlatformTx,
|
|
59
|
+
account: dummyAccount,
|
|
60
|
+
});
|
|
52
61
|
|
|
53
62
|
expect(canEditFees).toBe(false);
|
|
54
63
|
|
|
@@ -11,7 +11,7 @@ const CAN_EDIT_FEES = false;
|
|
|
11
11
|
const convertToLiveTransaction: ConvertToLiveTransaction<
|
|
12
12
|
WalletAPIPolkadotTransaction,
|
|
13
13
|
Transaction
|
|
14
|
-
> = (tx) => ({
|
|
14
|
+
> = ({ tx }) => ({
|
|
15
15
|
...tx,
|
|
16
16
|
era: tx.era ? `${tx.era}` : undefined,
|
|
17
17
|
});
|
|
@@ -19,10 +19,10 @@ const convertToLiveTransaction: ConvertToLiveTransaction<
|
|
|
19
19
|
const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
|
|
20
20
|
WalletAPIPolkadotTransaction,
|
|
21
21
|
Transaction
|
|
22
|
-
> = (
|
|
22
|
+
> = (params) => {
|
|
23
23
|
return {
|
|
24
24
|
canEditFees: CAN_EDIT_FEES,
|
|
25
|
-
liveTx: convertToLiveTransaction(
|
|
25
|
+
liveTx: convertToLiveTransaction(params),
|
|
26
26
|
hasFeesProvided: false,
|
|
27
27
|
};
|
|
28
28
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Account } from "@ledgerhq/types-live";
|
|
2
2
|
import { RippleTransaction as WalletAPITransaction } from "@ledgerhq/wallet-api-core";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
|
+
import xrp from "./walletApiAdapter";
|
|
4
5
|
import { Transaction } from "./types";
|
|
5
6
|
|
|
6
7
|
describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
7
8
|
describe("should properly get infos for XRP platform tx", () => {
|
|
9
|
+
const dummyAccount = {} as Account;
|
|
10
|
+
|
|
8
11
|
it("without fees provided", () => {
|
|
9
12
|
const xrpPlatformTx: WalletAPITransaction = {
|
|
10
13
|
family: "ripple",
|
|
@@ -18,7 +21,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
const { canEditFees, hasFeesProvided, liveTx } =
|
|
21
|
-
xrp.getWalletAPITransactionSignFlowInfos(
|
|
24
|
+
xrp.getWalletAPITransactionSignFlowInfos({
|
|
25
|
+
tx: xrpPlatformTx,
|
|
26
|
+
account: dummyAccount,
|
|
27
|
+
});
|
|
22
28
|
|
|
23
29
|
expect(canEditFees).toBe(true);
|
|
24
30
|
|
|
@@ -41,7 +47,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
|
41
47
|
};
|
|
42
48
|
|
|
43
49
|
const { canEditFees, hasFeesProvided, liveTx } =
|
|
44
|
-
xrp.getWalletAPITransactionSignFlowInfos(
|
|
50
|
+
xrp.getWalletAPITransactionSignFlowInfos({
|
|
51
|
+
tx: xrpPlatformTx,
|
|
52
|
+
account: dummyAccount,
|
|
53
|
+
});
|
|
45
54
|
|
|
46
55
|
expect(canEditFees).toBe(true);
|
|
47
56
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RippleTransaction as WalletAPIRippleTransaction } from "@ledgerhq/wallet-api-core";
|
|
2
2
|
import {
|
|
3
3
|
AreFeesProvided,
|
|
4
|
-
ConvertToLiveTransaction,
|
|
5
4
|
GetWalletAPITransactionSignFlowInfos,
|
|
6
5
|
} from "../../wallet-api/types";
|
|
7
6
|
|
|
@@ -12,20 +11,13 @@ const CAN_EDIT_FEES = true;
|
|
|
12
11
|
const areFeesProvided: AreFeesProvided<WalletAPIRippleTransaction> = (tx) =>
|
|
13
12
|
!!tx.fee;
|
|
14
13
|
|
|
15
|
-
const convertToLiveTransaction: ConvertToLiveTransaction<
|
|
16
|
-
WalletAPIRippleTransaction,
|
|
17
|
-
Transaction
|
|
18
|
-
> = (tx) => {
|
|
19
|
-
return tx;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
14
|
const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
|
|
23
15
|
WalletAPIRippleTransaction,
|
|
24
16
|
Transaction
|
|
25
|
-
> = (tx) => {
|
|
17
|
+
> = ({ tx }) => {
|
|
26
18
|
return {
|
|
27
19
|
canEditFees: CAN_EDIT_FEES,
|
|
28
|
-
liveTx:
|
|
20
|
+
liveTx: tx,
|
|
29
21
|
hasFeesProvided: areFeesProvided(tx),
|
|
30
22
|
};
|
|
31
23
|
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
Connection,
|
|
8
8
|
FetchMiddleware,
|
|
9
|
-
|
|
9
|
+
VersionedMessage,
|
|
10
10
|
PublicKey,
|
|
11
11
|
sendAndConfirmRawTransaction,
|
|
12
12
|
SignaturesForAddressOptions,
|
|
@@ -25,7 +25,7 @@ export type ChainAPI = Readonly<{
|
|
|
25
25
|
|
|
26
26
|
getLatestBlockhash: () => Promise<string>;
|
|
27
27
|
|
|
28
|
-
getFeeForMessage: (message:
|
|
28
|
+
getFeeForMessage: (message: VersionedMessage) => Promise<number | null>;
|
|
29
29
|
|
|
30
30
|
getBalanceAndContext: (
|
|
31
31
|
address: string
|
|
@@ -120,7 +120,7 @@ export function getChainAPI(
|
|
|
120
120
|
.then((r) => r.blockhash)
|
|
121
121
|
.catch(remapErrors),
|
|
122
122
|
|
|
123
|
-
getFeeForMessage: (msg:
|
|
123
|
+
getFeeForMessage: (msg: VersionedMessage) =>
|
|
124
124
|
connection()
|
|
125
125
|
.getFeeForMessage(msg)
|
|
126
126
|
.then((r) => r.value)
|
|
@@ -187,7 +187,11 @@ export function getChainAPI(
|
|
|
187
187
|
.catch(remapErrors),
|
|
188
188
|
|
|
189
189
|
getParsedTransactions: (signatures: string[]) =>
|
|
190
|
-
connection()
|
|
190
|
+
connection()
|
|
191
|
+
.getParsedTransactions(signatures, {
|
|
192
|
+
maxSupportedTransactionVersion: 0,
|
|
193
|
+
})
|
|
194
|
+
.catch(remapErrors),
|
|
191
195
|
|
|
192
196
|
getAccountInfo: (address: string) =>
|
|
193
197
|
connection()
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
import { assertUnreachable } from "./utils";
|
|
14
14
|
import {
|
|
15
15
|
PublicKey,
|
|
16
|
-
|
|
16
|
+
VersionedTransaction as OnChainTransaction,
|
|
17
17
|
TransactionInstruction,
|
|
18
|
+
TransactionMessage,
|
|
18
19
|
} from "@solana/web3.js";
|
|
19
20
|
import { ChainAPI } from "./api";
|
|
20
21
|
|
|
@@ -31,12 +32,13 @@ export const buildTransactionWithAPI = async (
|
|
|
31
32
|
|
|
32
33
|
const feePayer = new PublicKey(account.freshAddress);
|
|
33
34
|
|
|
34
|
-
const
|
|
35
|
-
feePayer,
|
|
35
|
+
const tm = new TransactionMessage({
|
|
36
|
+
payerKey: feePayer,
|
|
36
37
|
recentBlockhash,
|
|
38
|
+
instructions,
|
|
37
39
|
});
|
|
38
40
|
|
|
39
|
-
tx.
|
|
41
|
+
const tx = new OnChainTransaction(tm.compileToLegacyMessage());
|
|
40
42
|
|
|
41
43
|
return [
|
|
42
44
|
tx,
|
|
@@ -85,7 +85,7 @@ export const signOperationWithAPI = (
|
|
|
85
85
|
|
|
86
86
|
const { signature } = await hwApp.signTransaction(
|
|
87
87
|
account.freshAddressPath,
|
|
88
|
-
|
|
88
|
+
Buffer.from(tx.message.serialize())
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
subscriber.next({
|
|
@@ -98,7 +98,7 @@ export const signOperationWithAPI = (
|
|
|
98
98
|
type: "signed",
|
|
99
99
|
signedOperation: {
|
|
100
100
|
operation: buildOptimisticOperation(account, transaction),
|
|
101
|
-
signature: signedTx.serialize().toString("hex"),
|
|
101
|
+
signature: Buffer.from(signedTx.serialize()).toString("hex"),
|
|
102
102
|
expirationDate: null,
|
|
103
103
|
},
|
|
104
104
|
});
|
|
@@ -4,7 +4,7 @@ import { buildTransactionWithAPI } from "./js-buildTransaction";
|
|
|
4
4
|
import createTransaction from "./js-createTransaction";
|
|
5
5
|
import { Transaction, TransactionModel } from "./types";
|
|
6
6
|
import { assertUnreachable } from "./utils";
|
|
7
|
-
import {
|
|
7
|
+
import { VersionedTransaction as OnChainTransaction } from "@solana/web3.js";
|
|
8
8
|
import { log } from "@ledgerhq/logs";
|
|
9
9
|
|
|
10
10
|
export async function estimateTxFee(
|
|
@@ -15,7 +15,7 @@ export async function estimateTxFee(
|
|
|
15
15
|
const tx = createDummyTx(account, kind);
|
|
16
16
|
const [onChainTx] = await buildTransactionWithAPI(account, tx, api);
|
|
17
17
|
|
|
18
|
-
const fee = await api.getFeeForMessage(onChainTx.
|
|
18
|
+
const fee = await api.getFeeForMessage(onChainTx.message);
|
|
19
19
|
|
|
20
20
|
if (typeof fee !== "number") {
|
|
21
21
|
log("error", `api.getFeeForMessage returned invalid fee: <${fee}>`);
|
|
@@ -165,16 +165,16 @@ async function retryWithNewBlockhash(
|
|
|
165
165
|
api: ChainAPI,
|
|
166
166
|
onChainTx: OnChainTransaction
|
|
167
167
|
) {
|
|
168
|
-
if (onChainTx.recentBlockhash === undefined) {
|
|
168
|
+
if (onChainTx.message.recentBlockhash === undefined) {
|
|
169
169
|
throw new Error("expected recentBlockhash");
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
onChainTx.recentBlockhash = await waitNextBlockhash(
|
|
172
|
+
onChainTx.message.recentBlockhash = await waitNextBlockhash(
|
|
173
173
|
api,
|
|
174
|
-
onChainTx.recentBlockhash
|
|
174
|
+
onChainTx.message.recentBlockhash
|
|
175
175
|
);
|
|
176
176
|
|
|
177
|
-
const fee = await api.getFeeForMessage(onChainTx.
|
|
177
|
+
const fee = await api.getFeeForMessage(onChainTx.message);
|
|
178
178
|
|
|
179
179
|
if (typeof fee !== "number") {
|
|
180
180
|
throw new Error(
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Subscription,
|
|
7
7
|
TimeoutError,
|
|
8
8
|
concat,
|
|
9
|
+
interval,
|
|
9
10
|
of,
|
|
10
11
|
timer,
|
|
11
12
|
} from "rxjs";
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
import {
|
|
17
18
|
catchError,
|
|
18
19
|
debounce,
|
|
20
|
+
delayWhen,
|
|
19
21
|
filter,
|
|
20
22
|
switchMap,
|
|
21
23
|
tap,
|
|
@@ -188,6 +190,15 @@ const pollingImplementation: Implementation = <
|
|
|
188
190
|
// All other events pass through.
|
|
189
191
|
return EMPTY;
|
|
190
192
|
}
|
|
193
|
+
),
|
|
194
|
+
// NB An error is a dead-end as far as the task is concerned, and by delaying
|
|
195
|
+
// the emission of the event we prevent instant failures from showing flashing
|
|
196
|
+
// UI that looks like a glitch. For instance, if the device is locked and we retry
|
|
197
|
+
// this would allow a better UX, 800ms before a failure is totally acceptable.
|
|
198
|
+
delayWhen((e: any) =>
|
|
199
|
+
e.type === "error" || e.type === "lockedDevice"
|
|
200
|
+
? interval(800)
|
|
201
|
+
: interval(0)
|
|
191
202
|
)
|
|
192
203
|
)
|
|
193
204
|
.subscribe({
|
|
@@ -260,6 +271,15 @@ const eventImplementation: Implementation = <SpecificType, GenericRequestType>(
|
|
|
260
271
|
type: "error",
|
|
261
272
|
error,
|
|
262
273
|
})
|
|
274
|
+
),
|
|
275
|
+
// NB An error is a dead-end as far as the task is concerned, and by delaying
|
|
276
|
+
// the emission of the event we prevent instant failures from showing flashing
|
|
277
|
+
// UI that looks like a glitch. For instance, if the device is locked and we retry
|
|
278
|
+
// this would allow a better UX, 800ms before a failure is totally acceptable.
|
|
279
|
+
delayWhen((e: any) =>
|
|
280
|
+
e.type === "error" || e.type === "lockedDevice"
|
|
281
|
+
? interval(800)
|
|
282
|
+
: interval(0)
|
|
263
283
|
)
|
|
264
284
|
)
|
|
265
285
|
.subscribe({
|
|
@@ -77,6 +77,21 @@ describe("@hw/extractOnboardingState", () => {
|
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
+
describe("and the user is on the onboarding early check screen", () => {
|
|
81
|
+
beforeEach(() => {
|
|
82
|
+
flagsBytes[3] = 15;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("should return an onboarding step that is set at the onboarding early check screen", () => {
|
|
86
|
+
const onboardingState = extractOnboardingState(flagsBytes);
|
|
87
|
+
|
|
88
|
+
expect(onboardingState).not.toBeNull();
|
|
89
|
+
expect(onboardingState?.currentOnboardingStep).toBe(
|
|
90
|
+
OnboardingStep.OnboardingEarlyCheck
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
80
95
|
describe("and the user is on 'choose name' step", () => {
|
|
81
96
|
beforeEach(() => {
|
|
82
97
|
flagsBytes[3] = 12;
|
|
@@ -30,6 +30,7 @@ export enum OnboardingStep {
|
|
|
30
30
|
WelcomeScreen3 = "WELCOME_SCREEN_3",
|
|
31
31
|
WelcomeScreen4 = "WELCOME_SCREEN_4",
|
|
32
32
|
WelcomeScreenReminder = "WELCOME_SCREEN_REMINDER",
|
|
33
|
+
OnboardingEarlyCheck = "ONBOARDING_EARLY_CHECK",
|
|
33
34
|
ChooseName = "CHOOSE_NAME",
|
|
34
35
|
Pin = "PIN",
|
|
35
36
|
SetupChoice = "SETUP_CHOICE",
|
|
@@ -58,6 +59,7 @@ const fromBitsToOnboardingStep = new Map<number, OnboardingStep>([
|
|
|
58
59
|
[12, OnboardingStep.ChooseName],
|
|
59
60
|
[13, OnboardingStep.RecoverRestore],
|
|
60
61
|
[14, OnboardingStep.SetupChoiceRestore],
|
|
62
|
+
[15, OnboardingStep.OnboardingEarlyCheck],
|
|
61
63
|
]);
|
|
62
64
|
|
|
63
65
|
export type OnboardingState = {
|
|
@@ -74,7 +76,7 @@ export type OnboardingState = {
|
|
|
74
76
|
|
|
75
77
|
/**
|
|
76
78
|
* Extracts the onboarding state of the device
|
|
77
|
-
* @param flagsBytes Buffer of bytes of length onboardingFlagsBytesLength
|
|
79
|
+
* @param flagsBytes Buffer of bytes of length onboardingFlagsBytesLength representing the device state flags
|
|
78
80
|
* @returns An OnboardingState
|
|
79
81
|
*/
|
|
80
82
|
export const extractOnboardingState = (flagsBytes: Buffer): OnboardingState => {
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "@ledgerhq/errors";
|
|
6
6
|
import { command as staxRemoveImage } from "./staxRemoveImage";
|
|
7
7
|
import Transport from "@ledgerhq/hw-transport";
|
|
8
|
+
import { ImageDoesNotExistOnDevice } from "../errors";
|
|
8
9
|
|
|
9
10
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
11
|
// @ts-ignore next-line
|
|
@@ -34,6 +35,15 @@ describe("staxRemoveImage", () => {
|
|
|
34
35
|
await expect(staxRemoveImage(mockedTransport)).rejects.toThrow(Error);
|
|
35
36
|
});
|
|
36
37
|
|
|
38
|
+
test("missing image, should throw", async () => {
|
|
39
|
+
const mockedTransport = mockTransportGenerator(
|
|
40
|
+
Buffer.from(StatusCodes.CUSTOM_IMAGE_EMPTY.toString(16), "hex")
|
|
41
|
+
);
|
|
42
|
+
await expect(staxRemoveImage(mockedTransport)).rejects.toThrow(
|
|
43
|
+
ImageDoesNotExistOnDevice
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
37
47
|
test("unexpected bootloader or any other code, should throw", async () => {
|
|
38
48
|
const mockedTransport = mockTransportGenerator(
|
|
39
49
|
Buffer.from(StatusCodes.CUSTOM_IMAGE_BOOTLOADER.toString(16), "hex")
|
|
@@ -9,6 +9,7 @@ import { Observable, from, of } from "rxjs";
|
|
|
9
9
|
import { withDevice } from "./deviceAccess";
|
|
10
10
|
import { delay, mergeMap } from "rxjs/operators";
|
|
11
11
|
import getDeviceInfo from "./getDeviceInfo";
|
|
12
|
+
import { ImageDoesNotExistOnDevice } from "../errors";
|
|
12
13
|
|
|
13
14
|
export type RemoveImageEvent =
|
|
14
15
|
| {
|
|
@@ -36,6 +37,7 @@ export const command = async (transport: Transport): Promise<void> => {
|
|
|
36
37
|
StatusCodes.OK,
|
|
37
38
|
StatusCodes.CUSTOM_IMAGE_BOOTLOADER,
|
|
38
39
|
StatusCodes.USER_REFUSED_ON_DEVICE,
|
|
40
|
+
StatusCodes.CUSTOM_IMAGE_EMPTY,
|
|
39
41
|
StatusCodes.UNKNOWN_APDU,
|
|
40
42
|
]);
|
|
41
43
|
|
|
@@ -44,6 +46,8 @@ export const command = async (transport: Transport): Promise<void> => {
|
|
|
44
46
|
switch (status) {
|
|
45
47
|
case StatusCodes.OK:
|
|
46
48
|
return;
|
|
49
|
+
case StatusCodes.CUSTOM_IMAGE_EMPTY:
|
|
50
|
+
throw new ImageDoesNotExistOnDevice();
|
|
47
51
|
case StatusCodes.CUSTOM_IMAGE_BOOTLOADER:
|
|
48
52
|
throw new UnexpectedBootloader();
|
|
49
53
|
case StatusCodes.USER_REFUSED_ON_DEVICE:
|
package/src/platform/logic.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
AccountLike,
|
|
4
4
|
Operation,
|
|
5
5
|
SignedOperation,
|
|
6
|
-
TransactionCommon,
|
|
7
6
|
} from "@ledgerhq/types-live";
|
|
8
7
|
|
|
9
8
|
import {
|
|
@@ -113,7 +112,10 @@ export function signTransactionLogic(
|
|
|
113
112
|
? parentAccount?.currency.family
|
|
114
113
|
: account.currency.family;
|
|
115
114
|
|
|
116
|
-
if (
|
|
115
|
+
if (
|
|
116
|
+
accountFamily !== platformTransaction.family &&
|
|
117
|
+
!(accountFamily === "evm" && transaction.family === "ethereum")
|
|
118
|
+
) {
|
|
117
119
|
return Promise.reject(
|
|
118
120
|
new Error(`Transaction family not matching account currency family. Account family: ${accountFamily}, Transaction family: ${platformTransaction.family}
|
|
119
121
|
`)
|
|
@@ -174,7 +176,7 @@ export type CompleteExchangeRequest = {
|
|
|
174
176
|
export type CompleteExchangeUiRequest = {
|
|
175
177
|
provider: string;
|
|
176
178
|
exchange: Exchange;
|
|
177
|
-
transaction:
|
|
179
|
+
transaction: Transaction;
|
|
178
180
|
binaryPayload: string;
|
|
179
181
|
signature: string;
|
|
180
182
|
feesStrategy: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Account } from "@ledgerhq/types-live";
|
|
1
2
|
import BigNumber from "bignumber.js";
|
|
2
3
|
import "../__tests__/test-helpers/setup";
|
|
3
4
|
|
|
@@ -21,6 +22,8 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
|
21
22
|
ethBridge.mockClear();
|
|
22
23
|
});
|
|
23
24
|
|
|
25
|
+
const dummyAccount = {} as Account;
|
|
26
|
+
|
|
24
27
|
it("calls the bridge if the implementation exists", () => {
|
|
25
28
|
// Given
|
|
26
29
|
const tx: WalletAPITransaction = {
|
|
@@ -30,7 +33,7 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
// When
|
|
33
|
-
getWalletAPITransactionSignFlowInfos(tx);
|
|
36
|
+
getWalletAPITransactionSignFlowInfos({ tx, account: dummyAccount });
|
|
34
37
|
|
|
35
38
|
// Then
|
|
36
39
|
expect(ethBridge).toBeCalledTimes(1);
|
|
@@ -54,7 +57,7 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
|
|
|
54
57
|
|
|
55
58
|
// When
|
|
56
59
|
const { canEditFees, hasFeesProvided, liveTx } =
|
|
57
|
-
getWalletAPITransactionSignFlowInfos(tx);
|
|
60
|
+
getWalletAPITransactionSignFlowInfos({ tx, account: dummyAccount });
|
|
58
61
|
|
|
59
62
|
// Then
|
|
60
63
|
expect(ethBridge).toBeCalledTimes(0);
|
|
@@ -86,7 +86,8 @@ export function currencyToWalletAPICurrency(
|
|
|
86
86
|
id: currency.id,
|
|
87
87
|
ticker: currency.ticker,
|
|
88
88
|
name: currency.name,
|
|
89
|
-
family:
|
|
89
|
+
family:
|
|
90
|
+
currency.family === "evm" ? "ethereum" : (currency.family as Families),
|
|
90
91
|
color: currency.color,
|
|
91
92
|
decimals: currency.units[0].magnitude,
|
|
92
93
|
};
|
|
@@ -95,11 +96,15 @@ export function currencyToWalletAPICurrency(
|
|
|
95
96
|
export const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
|
|
96
97
|
WalletAPITransaction,
|
|
97
98
|
Transaction
|
|
98
|
-
> = (tx) => {
|
|
99
|
+
> = ({ tx, account, parentAccount }) => {
|
|
99
100
|
const family = byFamily[tx.family];
|
|
100
101
|
|
|
101
102
|
if (family) {
|
|
102
|
-
return family.getWalletAPITransactionSignFlowInfos(
|
|
103
|
+
return family.getWalletAPITransactionSignFlowInfos({
|
|
104
|
+
tx,
|
|
105
|
+
account,
|
|
106
|
+
parentAccount,
|
|
107
|
+
});
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
return {
|
|
@@ -13,8 +13,9 @@ export function isWalletAPISupportedCurrency(
|
|
|
13
13
|
currency: Currency
|
|
14
14
|
): currency is WalletAPISupportedCurrency {
|
|
15
15
|
if (isCryptoCurrency(currency)) {
|
|
16
|
-
return includes(WALLET_API_FAMILIES, currency.family);
|
|
16
|
+
return includes([...WALLET_API_FAMILIES, "evm"], currency.family);
|
|
17
17
|
}
|
|
18
|
+
|
|
18
19
|
if (isTokenCurrency(currency)) {
|
|
19
20
|
return includes(WALLET_API_FAMILIES, currency.parentCurrency.family);
|
|
20
21
|
}
|