@ledgerhq/live-common 21.29.0 → 21.32.0-hotfix.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/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.js +1 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.d.ts +2 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.d.ts.map +1 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.js +126 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.js.map +1 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js +0 -10
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +1 -1
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/setup.js +1 -0
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/account/support.d.ts.map +1 -1
- package/lib/account/support.js.map +1 -1
- package/lib/api/Ethereum.d.ts.map +1 -1
- package/lib/api/Ethereum.js +1 -0
- package/lib/api/Ethereum.js.map +1 -1
- package/lib/apps/hw.d.ts.map +1 -1
- package/lib/apps/hw.js +8 -3
- package/lib/apps/hw.js.map +1 -1
- package/lib/apps/logic.d.ts.map +1 -1
- package/lib/apps/logic.js +7 -5
- package/lib/apps/logic.js.map +1 -1
- package/lib/apps/polyfill.d.ts.map +1 -1
- package/lib/apps/polyfill.js +1 -0
- package/lib/apps/polyfill.js.map +1 -1
- package/lib/bot/engine.d.ts.map +1 -1
- package/lib/bot/engine.js +4 -1
- package/lib/bot/engine.js.map +1 -1
- package/lib/bridge/jsHelpers.js +1 -1
- package/lib/data/icons/react/celo.d.ts +8 -0
- package/lib/data/icons/react/celo.d.ts.map +1 -0
- package/lib/data/icons/react/celo.js +32 -0
- package/lib/data/icons/react/celo.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 +11 -8
- package/lib/data/icons/react/index.js.map +1 -1
- package/lib/data/icons/reactNative/celo.d.ts +8 -0
- package/lib/data/icons/reactNative/celo.d.ts.map +1 -0
- package/lib/data/icons/reactNative/celo.js +33 -0
- package/lib/data/icons/reactNative/celo.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 +11 -8
- package/lib/data/icons/reactNative/index.js.map +1 -1
- package/lib/env.d.ts +25 -5
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +20 -0
- package/lib/env.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +3 -2
- package/lib/errors.js.map +1 -1
- package/lib/exchange/platform/transfer/index.d.ts.map +1 -1
- package/lib/exchange/platform/transfer/index.js +15 -1
- package/lib/exchange/platform/transfer/index.js.map +1 -1
- package/lib/families/algorand/buildTransaction.d.ts +2 -2
- package/lib/families/algorand/buildTransaction.d.ts.map +1 -1
- package/lib/families/algorand/buildTransaction.js +13 -19
- package/lib/families/algorand/buildTransaction.js.map +1 -1
- package/lib/families/algorand/js-getFeesForTransaction.js +4 -6
- package/lib/families/algorand/js-getFeesForTransaction.js.map +1 -1
- package/lib/families/algorand/js-signOperation.js +3 -7
- package/lib/families/algorand/js-signOperation.js.map +1 -1
- package/lib/families/algorand/js-synchronization.d.ts.map +1 -1
- package/lib/families/algorand/js-synchronization.js +1 -0
- package/lib/families/algorand/js-synchronization.js.map +1 -1
- package/lib/families/bitcoin/js-signOperation.d.ts.map +1 -1
- package/lib/families/bitcoin/js-signOperation.js +3 -5
- package/lib/families/bitcoin/js-signOperation.js.map +1 -1
- package/lib/families/bitcoin/js-synchronisation.js +4 -4
- package/lib/families/bitcoin/js-synchronisation.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts +4 -3
- package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.js +8 -7
- package/lib/families/bitcoin/wallet-btc/crypto/base.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bip32.js +2 -2
- package/lib/families/bitcoin/wallet-btc/crypto/bip32.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.d.ts +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js +3 -7
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.d.ts +3 -4
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js +27 -53
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js +2 -7
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.d.ts +1 -6
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js +0 -51
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts +1 -0
- package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.d.ts +5 -6
- package/lib/families/bitcoin/wallet-btc/crypto/zec.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js +63 -33
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.d.ts +3 -5
- package/lib/families/bitcoin/wallet-btc/crypto/zen.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js +77 -46
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/explorer/index.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/explorer/index.js +20 -0
- package/lib/families/bitcoin/wallet-btc/explorer/index.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/storage/types.d.ts +0 -1
- package/lib/families/bitcoin/wallet-btc/storage/types.d.ts.map +1 -1
- package/lib/families/celo/api/hubble.d.ts +8 -0
- package/lib/families/celo/api/hubble.d.ts.map +1 -0
- package/lib/families/celo/api/hubble.js +144 -0
- package/lib/families/celo/api/hubble.js.map +1 -0
- package/lib/families/celo/api/index.d.ts +2 -0
- package/lib/families/celo/api/index.d.ts.map +1 -0
- package/lib/families/celo/api/index.js +13 -0
- package/lib/families/celo/api/index.js.map +1 -0
- package/lib/families/celo/api/sdk.d.ts +3 -0
- package/lib/families/celo/api/sdk.d.ts.map +1 -0
- package/lib/families/celo/api/sdk.js +13 -0
- package/lib/families/celo/api/sdk.js.map +1 -0
- package/lib/families/celo/bridge/js.d.ts +8 -0
- package/lib/families/celo/bridge/js.d.ts.map +1 -0
- package/lib/families/celo/bridge/js.js +87 -0
- package/lib/families/celo/bridge/js.js.map +1 -0
- package/lib/families/celo/cli-transaction.d.ts +14 -0
- package/lib/families/celo/cli-transaction.d.ts.map +1 -0
- package/lib/families/celo/cli-transaction.js +37 -0
- package/lib/families/celo/cli-transaction.js.map +1 -0
- package/lib/families/celo/datasets/celo.scanAccounts.1.d.ts +5 -0
- package/lib/families/celo/datasets/celo.scanAccounts.1.d.ts.map +1 -0
- package/lib/families/celo/datasets/celo.scanAccounts.1.js +12 -0
- package/lib/families/celo/datasets/celo.scanAccounts.1.js.map +1 -0
- package/lib/families/celo/deviceTransactionConfig.d.ts +4 -0
- package/lib/families/celo/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/families/celo/deviceTransactionConfig.js +16 -0
- package/lib/families/celo/deviceTransactionConfig.js.map +1 -0
- package/lib/families/celo/hw-app-celo.d.ts +19 -0
- package/lib/families/celo/hw-app-celo.d.ts.map +1 -0
- package/lib/families/celo/hw-app-celo.js +147 -0
- package/lib/families/celo/hw-app-celo.js.map +1 -0
- package/lib/families/celo/hw-getAddress.d.ts +2 -0
- package/lib/families/celo/hw-getAddress.d.ts.map +1 -0
- package/lib/families/celo/hw-getAddress.js +13 -0
- package/lib/families/celo/hw-getAddress.js.map +1 -0
- package/lib/families/celo/js-broadcast.d.ts +8 -0
- package/lib/families/celo/js-broadcast.d.ts.map +1 -0
- package/lib/families/celo/js-broadcast.js +58 -0
- package/lib/families/celo/js-broadcast.js.map +1 -0
- package/lib/families/celo/js-buildTransaction.d.ts +6 -0
- package/lib/families/celo/js-buildTransaction.d.ts.map +1 -0
- package/lib/families/celo/js-buildTransaction.js +89 -0
- package/lib/families/celo/js-buildTransaction.js.map +1 -0
- package/lib/families/celo/js-createTransaction.d.ts +4 -0
- package/lib/families/celo/js-createTransaction.d.ts.map +1 -0
- package/lib/families/celo/js-createTransaction.js +12 -0
- package/lib/families/celo/js-createTransaction.js.map +1 -0
- package/lib/families/celo/js-estimateMaxSpendable.d.ts +10 -0
- package/lib/families/celo/js-estimateMaxSpendable.d.ts.map +1 -0
- package/lib/families/celo/js-estimateMaxSpendable.js +77 -0
- package/lib/families/celo/js-estimateMaxSpendable.js.map +1 -0
- package/lib/families/celo/js-getFeesForTransaction.d.ts +8 -0
- package/lib/families/celo/js-getFeesForTransaction.d.ts.map +1 -0
- package/lib/families/celo/js-getFeesForTransaction.js +76 -0
- package/lib/families/celo/js-getFeesForTransaction.js.map +1 -0
- package/lib/families/celo/js-getTransactionStatus.d.ts +5 -0
- package/lib/families/celo/js-getTransactionStatus.d.ts.map +1 -0
- package/lib/families/celo/js-getTransactionStatus.js +86 -0
- package/lib/families/celo/js-getTransactionStatus.js.map +1 -0
- package/lib/families/celo/js-prepareTransaction.d.ts +5 -0
- package/lib/families/celo/js-prepareTransaction.d.ts.map +1 -0
- package/lib/families/celo/js-prepareTransaction.js +76 -0
- package/lib/families/celo/js-prepareTransaction.js.map +1 -0
- package/lib/families/celo/js-signOperation.d.ts +13 -0
- package/lib/families/celo/js-signOperation.d.ts.map +1 -0
- package/lib/families/celo/js-signOperation.js +150 -0
- package/lib/families/celo/js-signOperation.js.map +1 -0
- package/lib/families/celo/js-synchronisation.d.ts +10 -0
- package/lib/families/celo/js-synchronisation.d.ts.map +1 -0
- package/lib/families/celo/js-synchronisation.js +88 -0
- package/lib/families/celo/js-synchronisation.js.map +1 -0
- package/lib/families/celo/specs.d.ts +7 -0
- package/lib/families/celo/specs.d.ts.map +1 -0
- package/lib/families/celo/specs.js +56 -0
- package/lib/families/celo/specs.js.map +1 -0
- package/lib/families/celo/speculos-deviceActions.d.ts +7 -0
- package/lib/families/celo/speculos-deviceActions.d.ts.map +1 -0
- package/lib/families/celo/speculos-deviceActions.js +52 -0
- package/lib/families/celo/speculos-deviceActions.js.map +1 -0
- package/lib/families/celo/transaction.d.ts +11 -0
- package/lib/families/celo/transaction.d.ts.map +1 -0
- package/lib/families/celo/transaction.js +39 -0
- package/lib/families/celo/transaction.js.map +1 -0
- package/lib/families/celo/types.d.ts +16 -0
- package/lib/families/celo/types.d.ts.map +1 -0
- package/lib/families/celo/types.js +6 -0
- package/lib/families/celo/types.js.map +1 -0
- package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.d.ts +1 -0
- package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.d.ts.map +1 -1
- package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.js +1 -0
- package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.js.map +1 -1
- package/lib/families/ethereum/modules/erc1155.d.ts.map +1 -1
- package/lib/families/ethereum/modules/erc1155.js +8 -2
- package/lib/families/ethereum/modules/erc1155.js.map +1 -1
- package/lib/families/ethereum/signOperation.d.ts.map +1 -1
- package/lib/families/ethereum/signOperation.js +26 -15
- package/lib/families/ethereum/signOperation.js.map +1 -1
- package/lib/families/ethereum/specs.d.ts.map +1 -1
- package/lib/families/ethereum/specs.js +2 -4
- package/lib/families/ethereum/specs.js.map +1 -1
- package/lib/families/ethereum/transaction.d.ts +4 -1
- package/lib/families/ethereum/transaction.d.ts.map +1 -1
- package/lib/families/ethereum/transaction.js +15 -27
- package/lib/families/ethereum/transaction.js.map +1 -1
- package/lib/families/polkadot/cache.d.ts +1 -1
- package/lib/families/polkadot/cache.js +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 +1 -3
- package/lib/families/solana/api/chain/index.js.map +1 -1
- package/lib/families/solana/api/chain/instruction/token/types.d.ts +1 -1
- package/lib/families/solana/bridge/bridge.js +5 -5
- package/lib/families/solana/bridge/bridge.js.map +1 -1
- package/lib/families/solana/bridge/js.js +3 -3
- package/lib/families/solana/bridge/js.js.map +1 -1
- package/lib/families/solana/bridge/mock.js +1 -1
- package/lib/families/solana/bridge/mock.js.map +1 -1
- package/lib/families/solana/specs.js +1 -1
- package/lib/families/solana/specs.js.map +1 -1
- package/lib/families/solana/test-dataset.d.ts.map +1 -1
- package/lib/families/solana/test-dataset.js +210 -209
- package/lib/families/solana/test-dataset.js.map +1 -1
- package/lib/families/solana/utils.d.ts +1 -2
- package/lib/families/solana/utils.d.ts.map +1 -1
- package/lib/families/solana/utils.js +11 -9
- package/lib/families/solana/utils.js.map +1 -1
- package/lib/families/tezos/bakers.whitelist-default.d.ts.map +1 -1
- package/lib/families/tezos/bakers.whitelist-default.js +1 -1
- package/lib/families/tezos/bakers.whitelist-default.js.map +1 -1
- package/lib/families/tezos/bridge/js.d.ts.map +1 -1
- package/lib/families/tezos/bridge/js.js +2 -1
- package/lib/families/tezos/bridge/js.js.map +1 -1
- package/lib/families/tezos/synchronisation.d.ts.map +1 -1
- package/lib/families/tezos/synchronisation.js +2 -0
- package/lib/families/tezos/synchronisation.js.map +1 -1
- package/lib/families/tezos/test-specifics.d.ts.map +1 -1
- package/lib/families/tezos/test-specifics.js +1 -0
- package/lib/families/tezos/test-specifics.js.map +1 -1
- package/lib/families/tron/synchronisation.test.js +1 -0
- package/lib/families/tron/synchronisation.test.js.map +1 -1
- package/lib/featureFlags/FeatureToggle.d.ts +10 -0
- package/lib/featureFlags/FeatureToggle.d.ts.map +1 -0
- package/lib/featureFlags/FeatureToggle.js +17 -0
- package/lib/featureFlags/FeatureToggle.js.map +1 -0
- package/lib/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -0
- package/lib/featureFlags/defaultFeatures.js +9 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -0
- package/lib/featureFlags/index.d.ts +5 -0
- package/lib/featureFlags/index.d.ts.map +1 -0
- package/lib/featureFlags/index.js +17 -0
- package/lib/featureFlags/index.js.map +1 -0
- package/lib/featureFlags/provider.d.ts +13 -0
- package/lib/featureFlags/provider.d.ts.map +1 -0
- package/lib/featureFlags/provider.js +68 -0
- package/lib/featureFlags/provider.js.map +1 -0
- package/lib/featureFlags/types.d.ts +8 -0
- package/lib/featureFlags/types.d.ts.map +1 -0
- package/lib/featureFlags/types.js +3 -0
- package/lib/featureFlags/types.js.map +1 -0
- package/lib/featureFlags/useFeature.d.ts +3 -0
- package/lib/featureFlags/useFeature.d.ts.map +1 -0
- package/lib/featureFlags/useFeature.js +9 -0
- package/lib/featureFlags/useFeature.js.map +1 -0
- package/lib/generated/bridge/js.d.ts +4 -0
- package/lib/generated/bridge/js.d.ts.map +1 -1
- package/lib/generated/bridge/js.js +24 -22
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/generated/cli-transaction.d.ts +9 -0
- package/lib/generated/cli-transaction.d.ts.map +1 -1
- package/lib/generated/cli-transaction.js +24 -22
- package/lib/generated/cli-transaction.js.map +1 -1
- package/lib/generated/deviceTransactionConfig.d.ts +2 -0
- package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/generated/deviceTransactionConfig.js +22 -20
- package/lib/generated/deviceTransactionConfig.js.map +1 -1
- package/lib/generated/hw-getAddress.d.ts +1 -0
- package/lib/generated/hw-getAddress.d.ts.map +1 -1
- package/lib/generated/hw-getAddress.js +26 -24
- package/lib/generated/hw-getAddress.js.map +1 -1
- package/lib/generated/specs.d.ts +3 -0
- package/lib/generated/specs.d.ts.map +1 -1
- package/lib/generated/specs.js +24 -22
- package/lib/generated/specs.js.map +1 -1
- package/lib/generated/speculos-deviceActions.d.ts +3 -0
- package/lib/generated/speculos-deviceActions.d.ts.map +1 -1
- package/lib/generated/speculos-deviceActions.js +24 -22
- package/lib/generated/speculos-deviceActions.js.map +1 -1
- package/lib/generated/transaction.d.ts +5 -0
- package/lib/generated/transaction.d.ts.map +1 -1
- package/lib/generated/transaction.js +26 -24
- package/lib/generated/transaction.js.map +1 -1
- package/lib/generated/types.d.ts +12 -6
- package/lib/generated/types.d.ts.map +1 -1
- package/lib/generated/types.js +14 -12
- package/lib/generated/types.js.map +1 -1
- package/lib/load/speculos.d.ts +7 -0
- package/lib/load/speculos.d.ts.map +1 -1
- package/lib/load/speculos.js +27 -11
- package/lib/load/speculos.js.map +1 -1
- package/lib/platform/PlatformAppProvider/helpers.d.ts +1 -0
- package/lib/platform/PlatformAppProvider/helpers.d.ts.map +1 -1
- package/lib/platform/PlatformAppProvider/helpers.js +23 -1
- package/lib/platform/PlatformAppProvider/helpers.js.map +1 -1
- package/lib/platform/PlatformAppProvider/index.d.ts.map +1 -1
- package/lib/platform/PlatformAppProvider/index.js +2 -1
- package/lib/platform/PlatformAppProvider/index.js.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/manager.d.ts +7 -0
- package/lib/types/manager.d.ts.map +1 -1
- package/lib/types/manager.js +7 -0
- package/lib/types/manager.js.map +1 -1
- package/package.json +24 -21
- package/src/.DS_Store +0 -0
- package/src/__tests__/.DS_Store +0 -0
- package/src/__tests__/__snapshots__/all.libcore.ts.snap +457 -33597
- package/src/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.ts +2 -0
- package/src/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.ts +78 -0
- package/src/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.ts +0 -11
- package/src/__tests__/test-helpers/bridge.ts +1 -1
- package/src/__tests__/test-helpers/setup.ts +1 -0
- package/src/account/support.ts +1 -0
- package/src/api/Ethereum.ts +1 -0
- package/src/apps/hw.ts +7 -0
- package/src/apps/logic.ts +6 -3
- package/src/apps/polyfill.ts +1 -0
- package/src/bot/engine.ts +4 -1
- package/src/bridge/jsHelpers.ts +1 -1
- package/src/data/icons/react/celo.tsx +12 -0
- package/src/data/icons/react/index.tsx +1 -0
- package/src/data/icons/reactNative/celo.tsx +13 -0
- package/src/data/icons/reactNative/index.tsx +1 -0
- package/src/data/icons/svg/CELO.svg +5 -0
- package/src/env.ts +20 -0
- package/src/errors.ts +3 -0
- package/src/exchange/platform/transfer/index.ts +21 -1
- package/src/families/algorand/buildTransaction.ts +4 -8
- package/src/families/algorand/js-getFeesForTransaction.ts +1 -1
- package/src/families/algorand/js-signOperation.ts +2 -2
- package/src/families/algorand/js-synchronization.ts +1 -0
- package/src/families/bitcoin/js-signOperation.ts +3 -5
- package/src/families/bitcoin/js-synchronisation.ts +4 -4
- package/src/families/bitcoin/wallet-btc/crypto/base.ts +31 -18
- package/src/families/bitcoin/wallet-btc/crypto/bip32.ts +2 -2
- package/src/families/bitcoin/wallet-btc/crypto/bitcoin.ts +3 -17
- package/src/families/bitcoin/wallet-btc/crypto/bitcoincash.ts +5 -39
- package/src/families/bitcoin/wallet-btc/crypto/decred.ts +2 -15
- package/src/families/bitcoin/wallet-btc/crypto/litecoin.ts +1 -71
- package/src/families/bitcoin/wallet-btc/crypto/types.ts +7 -0
- package/src/families/bitcoin/wallet-btc/crypto/zec.ts +23 -41
- package/src/families/bitcoin/wallet-btc/crypto/zen.ts +30 -49
- package/src/families/bitcoin/wallet-btc/explorer/index.ts +20 -0
- package/src/families/bitcoin/wallet-btc/storage/types.ts +0 -1
- package/src/families/celo/api/hubble.ts +93 -0
- package/src/families/celo/api/index.ts +1 -0
- package/src/families/celo/api/sdk.ts +8 -0
- package/src/families/celo/bridge/js.ts +38 -0
- package/src/families/celo/cli-transaction.ts +41 -0
- package/src/families/celo/datasets/celo.scanAccounts.1.ts +20 -0
- package/src/families/celo/deviceTransactionConfig.ts +19 -0
- package/src/families/celo/hw-app-celo.ts +108 -0
- package/src/families/celo/hw-getAddress.ts +1 -0
- package/src/families/celo/js-broadcast.ts +12 -0
- package/src/families/celo/js-buildTransaction.ts +32 -0
- package/src/families/celo/js-createTransaction.ts +12 -0
- package/src/families/celo/js-estimateMaxSpendable.ts +28 -0
- package/src/families/celo/js-getFeesForTransaction.ts +38 -0
- package/src/families/celo/js-getTransactionStatus.ts +67 -0
- package/src/families/celo/js-prepareTransaction.ts +28 -0
- package/src/families/celo/js-signOperation.ts +149 -0
- package/src/families/celo/js-synchronisation.ts +40 -0
- package/src/families/celo/specs.ts +53 -0
- package/src/families/celo/speculos-deviceActions.ts +50 -0
- package/src/families/celo/transaction.ts +39 -0
- package/src/families/celo/types.ts +20 -0
- package/src/families/ethereum/datasets/ethereum.scanAccounts.1.ts +1 -0
- package/src/families/ethereum/modules/erc1155.ts +9 -0
- package/src/families/ethereum/signOperation.ts +21 -20
- package/src/families/ethereum/specs.ts +0 -2
- package/src/families/ethereum/transaction.ts +10 -24
- package/src/families/polkadot/cache.ts +1 -1
- package/src/families/solana/api/chain/index.ts +2 -5
- package/src/families/solana/bridge/bridge.ts +11 -11
- package/src/families/solana/bridge/js.ts +3 -3
- package/src/families/solana/bridge/mock.ts +1 -1
- package/src/families/solana/specs.ts +1 -1
- package/src/families/solana/test-dataset.ts +340 -338
- package/src/families/solana/utils.ts +9 -8
- package/src/families/tezos/bakers.whitelist-default.ts +0 -2
- package/src/families/tezos/bridge/js.ts +6 -1
- package/src/families/tezos/synchronisation.ts +2 -0
- package/src/families/tezos/test-specifics.ts +1 -0
- package/src/families/tron/synchronisation.test.ts +2 -0
- package/src/featureFlags/FeatureToggle.tsx +24 -0
- package/src/featureFlags/defaultFeatures.ts +7 -0
- package/src/featureFlags/index.ts +4 -0
- package/src/featureFlags/provider.tsx +48 -0
- package/src/featureFlags/types.ts +9 -0
- package/src/featureFlags/useFeature.ts +8 -0
- package/src/generated/bridge/js.ts +3 -0
- package/src/generated/cli-transaction.ts +3 -0
- package/src/generated/deviceTransactionConfig.ts +3 -0
- package/src/generated/hw-getAddress.ts +3 -0
- package/src/generated/specs.ts +3 -0
- package/src/generated/speculos-deviceActions.ts +3 -0
- package/src/generated/transaction.ts +3 -0
- package/src/generated/types.ts +14 -0
- package/src/load/speculos.ts +23 -10
- package/src/platform/PlatformAppProvider/helpers.ts +29 -0
- package/src/platform/PlatformAppProvider/index.tsx +3 -2
- package/src/types/index.ts +1 -0
- package/src/types/manager.ts +7 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { clusterApiUrl } from "@solana/web3.js";
|
|
2
|
+
import { getEnv } from "../../env";
|
|
2
3
|
|
|
3
4
|
export const assertUnreachable = (_: never): never => {
|
|
4
5
|
throw new Error("unreachable assertion failed");
|
|
@@ -16,15 +17,15 @@ export async function drainSeqAsyncGen<T>(
|
|
|
16
17
|
return items;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
export function
|
|
20
|
-
const
|
|
21
|
-
solana: "
|
|
22
|
-
solana_devnet: "devnet",
|
|
23
|
-
solana_testnet: "testnet",
|
|
20
|
+
export function endpointByCurrencyId(currencyId: string): string {
|
|
21
|
+
const endpoints: Record<string, string> = {
|
|
22
|
+
solana: getEnv("API_SOLANA_PROXY"),
|
|
23
|
+
solana_devnet: clusterApiUrl("devnet"),
|
|
24
|
+
solana_testnet: clusterApiUrl("testnet"),
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
if (currencyId in
|
|
27
|
-
return
|
|
27
|
+
if (currencyId in endpoints) {
|
|
28
|
+
return endpoints[currencyId];
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
throw Error(
|
|
@@ -17,8 +17,6 @@ tz1RCFbB9GpALpsZtu6J58sb74dm8qe6XBzv
|
|
|
17
17
|
tz1dbfppLAAxXZNtf2SDps7rch3qfUznKSoK
|
|
18
18
|
tz1Q8QkSBS63ZQnH3fBTiAMPes9R666Rn6Sc
|
|
19
19
|
tz2FCNBrERXtaTtNX6iimR1UJ5JSDxvdHM93
|
|
20
|
-
tz1Vyuu4EJ5Nym4JcrfRLnp3hpaq1DSEp1Ke
|
|
21
|
-
tz1S1Aew75hMrPUymqenKfHo8FspppXKpW7h
|
|
22
20
|
tz1SohptP53wDPZhzTWzDUFAUcWF6DMBpaJV
|
|
23
21
|
tz1P2Po7YM526ughEsRbY4oR9zaUPDZjxFrb
|
|
24
22
|
tz1KzSC1J9aBxKp7u8TUnpN8L7S65PBRkgdF
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
TezosToolkit,
|
|
5
|
+
DEFAULT_FEE,
|
|
6
|
+
DEFAULT_STORAGE_LIMIT,
|
|
7
|
+
} from "@taquito/taquito";
|
|
4
8
|
import {
|
|
5
9
|
AmountRequired,
|
|
6
10
|
NotEnoughBalance,
|
|
@@ -201,6 +205,7 @@ const prepareTransaction = async (
|
|
|
201
205
|
mutez: true,
|
|
202
206
|
to: transaction.recipient,
|
|
203
207
|
amount: amount.toNumber(),
|
|
208
|
+
storageLimit: DEFAULT_STORAGE_LIMIT.ORIGINATION, // https://github.com/TezTech/eztz/blob/master/PROTO_003_FEES.md for originating an account
|
|
204
209
|
});
|
|
205
210
|
break;
|
|
206
211
|
case "delegate":
|
|
@@ -74,6 +74,7 @@ export const getAccountShape: GetAccountShape = async (infoInput) => {
|
|
|
74
74
|
if (apiAccount.type === "empty") {
|
|
75
75
|
return {
|
|
76
76
|
id: accountId,
|
|
77
|
+
xpub: address,
|
|
77
78
|
blockHeight,
|
|
78
79
|
lastSyncDate: new Date(),
|
|
79
80
|
tezosResources: {
|
|
@@ -110,6 +111,7 @@ export const getAccountShape: GetAccountShape = async (infoInput) => {
|
|
|
110
111
|
|
|
111
112
|
const accountShape = {
|
|
112
113
|
id: accountId,
|
|
114
|
+
xpub: address,
|
|
113
115
|
operations,
|
|
114
116
|
balance,
|
|
115
117
|
subAccounts,
|
|
@@ -4,6 +4,7 @@ import { loadAccountDelegation, listBakers } from "./bakers";
|
|
|
4
4
|
import whitelist from "./bakers.whitelist-default";
|
|
5
5
|
export default () => {
|
|
6
6
|
describe("tezos bakers", () => {
|
|
7
|
+
// FIXME Flaky test that will fail every time a Tezos baker is discontinued
|
|
7
8
|
test("getting the bakers", async () => {
|
|
8
9
|
const list = await listBakers(whitelist);
|
|
9
10
|
expect(list.map((o) => o.address)).toEqual(whitelist);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import useFeature from "./useFeature";
|
|
4
|
+
import { FeatureId } from "./types";
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
feature: FeatureId;
|
|
8
|
+
fallback?: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const FeatureToggle = ({
|
|
13
|
+
feature: featureId,
|
|
14
|
+
fallback,
|
|
15
|
+
children,
|
|
16
|
+
}: Props): ReactNode => {
|
|
17
|
+
const feature = useFeature(featureId);
|
|
18
|
+
|
|
19
|
+
if (!feature || !feature.enabled) {
|
|
20
|
+
return fallback;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return children;
|
|
24
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
createContext,
|
|
3
|
+
ReactNode,
|
|
4
|
+
useContext,
|
|
5
|
+
useEffect,
|
|
6
|
+
useState,
|
|
7
|
+
} from "react";
|
|
8
|
+
|
|
9
|
+
import { FeatureId, Feature } from "./types";
|
|
10
|
+
|
|
11
|
+
type State = {
|
|
12
|
+
getFeature: (_: FeatureId) => Feature | null;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const initialState: State = {
|
|
16
|
+
getFeature: (_) => ({ enabled: false }),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const FeatureFlagsContext = createContext<State>(initialState);
|
|
20
|
+
|
|
21
|
+
export function useFeatureFlags(): State {
|
|
22
|
+
return useContext<State>(FeatureFlagsContext);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type Props = {
|
|
26
|
+
getFeature: (_: FeatureId) => Feature | null;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export function FeatureFlagsProvider({
|
|
31
|
+
getFeature,
|
|
32
|
+
children,
|
|
33
|
+
}: Props): JSX.Element {
|
|
34
|
+
const [state, setState] = useState<State>(initialState);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
setState((prev) => ({
|
|
38
|
+
...prev,
|
|
39
|
+
getFeature,
|
|
40
|
+
}));
|
|
41
|
+
}, [getFeature]);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<FeatureFlagsContext.Provider value={state}>
|
|
45
|
+
{children}
|
|
46
|
+
</FeatureFlagsContext.Provider>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type FeatureId = "market"; // Add others with union
|
|
2
|
+
|
|
3
|
+
// We use objects instead of direct booleans for potential future improvements
|
|
4
|
+
// like feature versioning etc
|
|
5
|
+
export type Feature = {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type DefaultFeatures = { [key in FeatureId]: Feature };
|
|
@@ -2,6 +2,8 @@ import algorand from "../../families/algorand/bridge/js";
|
|
|
2
2
|
|
|
3
3
|
import bitcoin from "../../families/bitcoin/bridge/js";
|
|
4
4
|
|
|
5
|
+
import celo from "../../families/celo/bridge/js";
|
|
6
|
+
|
|
5
7
|
import crypto_org from "../../families/crypto_org/bridge/js";
|
|
6
8
|
|
|
7
9
|
import elrond from "../../families/elrond/bridge/js";
|
|
@@ -28,6 +30,7 @@ import tron from "../../families/tron/bridge/js";
|
|
|
28
30
|
export default {
|
|
29
31
|
algorand,
|
|
30
32
|
bitcoin,
|
|
33
|
+
celo,
|
|
31
34
|
crypto_org,
|
|
32
35
|
elrond,
|
|
33
36
|
ethereum,
|
|
@@ -2,6 +2,8 @@ import algorand from "../families/algorand/cli-transaction";
|
|
|
2
2
|
|
|
3
3
|
import bitcoin from "../families/bitcoin/cli-transaction";
|
|
4
4
|
|
|
5
|
+
import celo from "../families/celo/cli-transaction";
|
|
6
|
+
|
|
5
7
|
import cosmos from "../families/cosmos/cli-transaction";
|
|
6
8
|
|
|
7
9
|
import crypto_org from "../families/crypto_org/cli-transaction";
|
|
@@ -28,6 +30,7 @@ import tron from "../families/tron/cli-transaction";
|
|
|
28
30
|
export default {
|
|
29
31
|
algorand,
|
|
30
32
|
bitcoin,
|
|
33
|
+
celo,
|
|
31
34
|
cosmos,
|
|
32
35
|
crypto_org,
|
|
33
36
|
elrond,
|
|
@@ -2,6 +2,8 @@ import algorand from "../families/algorand/deviceTransactionConfig";
|
|
|
2
2
|
|
|
3
3
|
import bitcoin from "../families/bitcoin/deviceTransactionConfig";
|
|
4
4
|
|
|
5
|
+
import celo from "../families/celo/deviceTransactionConfig";
|
|
6
|
+
|
|
5
7
|
import cosmos from "../families/cosmos/deviceTransactionConfig";
|
|
6
8
|
|
|
7
9
|
import crypto_org from "../families/crypto_org/deviceTransactionConfig";
|
|
@@ -26,6 +28,7 @@ import tron from "../families/tron/deviceTransactionConfig";
|
|
|
26
28
|
export default {
|
|
27
29
|
algorand,
|
|
28
30
|
bitcoin,
|
|
31
|
+
celo,
|
|
29
32
|
cosmos,
|
|
30
33
|
crypto_org,
|
|
31
34
|
elrond,
|
|
@@ -2,6 +2,8 @@ import algorand from "../families/algorand/hw-getAddress";
|
|
|
2
2
|
|
|
3
3
|
import bitcoin from "../families/bitcoin/hw-getAddress";
|
|
4
4
|
|
|
5
|
+
import celo from "../families/celo/hw-getAddress";
|
|
6
|
+
|
|
5
7
|
import cosmos from "../families/cosmos/hw-getAddress";
|
|
6
8
|
|
|
7
9
|
import crypto_org from "../families/crypto_org/hw-getAddress";
|
|
@@ -30,6 +32,7 @@ import tron from "../families/tron/hw-getAddress";
|
|
|
30
32
|
export default {
|
|
31
33
|
algorand,
|
|
32
34
|
bitcoin,
|
|
35
|
+
celo,
|
|
33
36
|
cosmos,
|
|
34
37
|
crypto_org,
|
|
35
38
|
elrond,
|
package/src/generated/specs.ts
CHANGED
|
@@ -2,6 +2,8 @@ import algorand from "../families/algorand/specs";
|
|
|
2
2
|
|
|
3
3
|
import bitcoin from "../families/bitcoin/specs";
|
|
4
4
|
|
|
5
|
+
import celo from "../families/celo/specs";
|
|
6
|
+
|
|
5
7
|
import cosmos from "../families/cosmos/specs";
|
|
6
8
|
|
|
7
9
|
import crypto_org from "../families/crypto_org/specs";
|
|
@@ -28,6 +30,7 @@ import tron from "../families/tron/specs";
|
|
|
28
30
|
export default {
|
|
29
31
|
algorand,
|
|
30
32
|
bitcoin,
|
|
33
|
+
celo,
|
|
31
34
|
cosmos,
|
|
32
35
|
crypto_org,
|
|
33
36
|
elrond,
|
|
@@ -2,6 +2,8 @@ import algorand from "../families/algorand/speculos-deviceActions";
|
|
|
2
2
|
|
|
3
3
|
import bitcoin from "../families/bitcoin/speculos-deviceActions";
|
|
4
4
|
|
|
5
|
+
import celo from "../families/celo/speculos-deviceActions";
|
|
6
|
+
|
|
5
7
|
import cosmos from "../families/cosmos/speculos-deviceActions";
|
|
6
8
|
|
|
7
9
|
import crypto_org from "../families/crypto_org/speculos-deviceActions";
|
|
@@ -28,6 +30,7 @@ import tron from "../families/tron/speculos-deviceActions";
|
|
|
28
30
|
export default {
|
|
29
31
|
algorand,
|
|
30
32
|
bitcoin,
|
|
33
|
+
celo,
|
|
31
34
|
cosmos,
|
|
32
35
|
crypto_org,
|
|
33
36
|
elrond,
|
|
@@ -2,6 +2,8 @@ import algorand from "../families/algorand/transaction";
|
|
|
2
2
|
|
|
3
3
|
import bitcoin from "../families/bitcoin/transaction";
|
|
4
4
|
|
|
5
|
+
import celo from "../families/celo/transaction";
|
|
6
|
+
|
|
5
7
|
import cosmos from "../families/cosmos/transaction";
|
|
6
8
|
|
|
7
9
|
import crypto_org from "../families/crypto_org/transaction";
|
|
@@ -30,6 +32,7 @@ import tron from "../families/tron/transaction";
|
|
|
30
32
|
export default {
|
|
31
33
|
algorand,
|
|
32
34
|
bitcoin,
|
|
35
|
+
celo,
|
|
33
36
|
cosmos,
|
|
34
37
|
crypto_org,
|
|
35
38
|
elrond,
|
package/src/generated/types.ts
CHANGED
|
@@ -14,6 +14,13 @@ import { Transaction as bitcoinTransaction } from "../families/bitcoin/types";
|
|
|
14
14
|
import { TransactionRaw as bitcoinTransactionRaw } from "../families/bitcoin/types";
|
|
15
15
|
import { NetworkInfo as bitcoinNetworkInfo } from "../families/bitcoin/types";
|
|
16
16
|
import { NetworkInfoRaw as bitcoinNetworkInfoRaw } from "../families/bitcoin/types";
|
|
17
|
+
import { reflect as celoReflect } from "../families/celo/types";
|
|
18
|
+
import { CoreStatics as CoreStatics_celo } from "../families/celo/types";
|
|
19
|
+
import { CoreAccountSpecifics as CoreAccountSpecifics_celo } from "../families/celo/types";
|
|
20
|
+
import { CoreOperationSpecifics as CoreOperationSpecifics_celo } from "../families/celo/types";
|
|
21
|
+
import { CoreCurrencySpecifics as CoreCurrencySpecifics_celo } from "../families/celo/types";
|
|
22
|
+
import { Transaction as celoTransaction } from "../families/celo/types";
|
|
23
|
+
import { TransactionRaw as celoTransactionRaw } from "../families/celo/types";
|
|
17
24
|
import { reflect as cosmosReflect } from "../families/cosmos/types";
|
|
18
25
|
import { CoreStatics as CoreStatics_cosmos } from "../families/cosmos/types";
|
|
19
26
|
import { CoreAccountSpecifics as CoreAccountSpecifics_cosmos } from "../families/cosmos/types";
|
|
@@ -122,6 +129,7 @@ import { NetworkInfoRaw as tronNetworkInfoRaw } from "../families/tron/types";
|
|
|
122
129
|
export type SpecificStatics = {}
|
|
123
130
|
& CoreStatics_algorand
|
|
124
131
|
& CoreStatics_bitcoin
|
|
132
|
+
& CoreStatics_celo
|
|
125
133
|
& CoreStatics_cosmos
|
|
126
134
|
& CoreStatics_crypto_org
|
|
127
135
|
& CoreStatics_elrond
|
|
@@ -137,6 +145,7 @@ export type SpecificStatics = {}
|
|
|
137
145
|
export type CoreAccountSpecifics = {}
|
|
138
146
|
& CoreAccountSpecifics_algorand
|
|
139
147
|
& CoreAccountSpecifics_bitcoin
|
|
148
|
+
& CoreAccountSpecifics_celo
|
|
140
149
|
& CoreAccountSpecifics_cosmos
|
|
141
150
|
& CoreAccountSpecifics_crypto_org
|
|
142
151
|
& CoreAccountSpecifics_elrond
|
|
@@ -152,6 +161,7 @@ export type CoreAccountSpecifics = {}
|
|
|
152
161
|
export type CoreOperationSpecifics = {}
|
|
153
162
|
& CoreOperationSpecifics_algorand
|
|
154
163
|
& CoreOperationSpecifics_bitcoin
|
|
164
|
+
& CoreOperationSpecifics_celo
|
|
155
165
|
& CoreOperationSpecifics_cosmos
|
|
156
166
|
& CoreOperationSpecifics_crypto_org
|
|
157
167
|
& CoreOperationSpecifics_elrond
|
|
@@ -167,6 +177,7 @@ export type CoreOperationSpecifics = {}
|
|
|
167
177
|
export type CoreCurrencySpecifics = {}
|
|
168
178
|
& CoreCurrencySpecifics_algorand
|
|
169
179
|
& CoreCurrencySpecifics_bitcoin
|
|
180
|
+
& CoreCurrencySpecifics_celo
|
|
170
181
|
& CoreCurrencySpecifics_cosmos
|
|
171
182
|
& CoreCurrencySpecifics_crypto_org
|
|
172
183
|
& CoreCurrencySpecifics_elrond
|
|
@@ -182,6 +193,7 @@ export type CoreCurrencySpecifics = {}
|
|
|
182
193
|
export type Transaction =
|
|
183
194
|
| algorandTransaction
|
|
184
195
|
| bitcoinTransaction
|
|
196
|
+
| celoTransaction
|
|
185
197
|
| cosmosTransaction
|
|
186
198
|
| crypto_orgTransaction
|
|
187
199
|
| elrondTransaction
|
|
@@ -197,6 +209,7 @@ export type Transaction =
|
|
|
197
209
|
export type TransactionRaw =
|
|
198
210
|
| algorandTransactionRaw
|
|
199
211
|
| bitcoinTransactionRaw
|
|
212
|
+
| celoTransactionRaw
|
|
200
213
|
| cosmosTransactionRaw
|
|
201
214
|
| crypto_orgTransactionRaw
|
|
202
215
|
| elrondTransactionRaw
|
|
@@ -236,6 +249,7 @@ export type NetworkInfoRaw =
|
|
|
236
249
|
export const reflectSpecifics = (declare: any): Array<{ OperationMethods: Record<string, unknown>, AccountMethods: Record<string, unknown> }> => [
|
|
237
250
|
algorandReflect(declare),
|
|
238
251
|
bitcoinReflect(declare),
|
|
252
|
+
celoReflect(declare),
|
|
239
253
|
cosmosReflect(declare),
|
|
240
254
|
crypto_orgReflect(declare),
|
|
241
255
|
elrondReflect(declare),
|
package/src/load/speculos.ts
CHANGED
|
@@ -412,7 +412,13 @@ function parseAppSearch(query: string):
|
|
|
412
412
|
};
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
async function
|
|
415
|
+
export async function createImplicitSpeculos(query: string): Promise<{
|
|
416
|
+
device: {
|
|
417
|
+
transport: SpeculosTransport;
|
|
418
|
+
id: string;
|
|
419
|
+
};
|
|
420
|
+
appCandidate: AppCandidate;
|
|
421
|
+
} | null> {
|
|
416
422
|
const coinapps = getEnv("COINAPPS");
|
|
417
423
|
invariant(coinapps, "COINAPPS folder is missing!");
|
|
418
424
|
const seed = getEnv("SEED");
|
|
@@ -438,16 +444,23 @@ async function openImplicitSpeculos(query: string) {
|
|
|
438
444
|
"speculos",
|
|
439
445
|
"using app " + formatAppCandidate(appCandidate as AppCandidate)
|
|
440
446
|
);
|
|
441
|
-
|
|
442
|
-
?
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
447
|
+
return appCandidate
|
|
448
|
+
? {
|
|
449
|
+
device: await createSpeculosDevice({
|
|
450
|
+
...appCandidate,
|
|
451
|
+
coinapps,
|
|
452
|
+
appName,
|
|
453
|
+
dependency,
|
|
454
|
+
seed,
|
|
455
|
+
}),
|
|
456
|
+
appCandidate,
|
|
457
|
+
}
|
|
449
458
|
: null;
|
|
450
|
-
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
async function openImplicitSpeculos(query: string) {
|
|
462
|
+
const r = await createImplicitSpeculos(query);
|
|
463
|
+
return r?.device.transport;
|
|
451
464
|
}
|
|
452
465
|
|
|
453
466
|
registerTransportModule({
|
|
@@ -6,6 +6,7 @@ export type FilterParams = {
|
|
|
6
6
|
private?: boolean;
|
|
7
7
|
version?: string;
|
|
8
8
|
};
|
|
9
|
+
import { getEnv } from "../../env";
|
|
9
10
|
|
|
10
11
|
function matchVersion(filterParams: FilterParams, manifest: AppManifest) {
|
|
11
12
|
return (
|
|
@@ -52,3 +53,31 @@ export function mergeManifestLists(
|
|
|
52
53
|
const newIds = new Set(list2.map((elem) => elem.id));
|
|
53
54
|
return [...list1.filter((elem) => !newIds.has(elem.id)), ...list2];
|
|
54
55
|
}
|
|
56
|
+
|
|
57
|
+
export const initializeLocalManifest = (): Map<string, AppManifest> => {
|
|
58
|
+
const localManifestJsonRaw: string | null | undefined = getEnv(
|
|
59
|
+
"PLATFORM_LOCAL_MANIFEST_JSON"
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
if (!localManifestJsonRaw) {
|
|
63
|
+
return new Map();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
const manifest: AppManifest | [AppManifest] =
|
|
68
|
+
JSON.parse(localManifestJsonRaw);
|
|
69
|
+
|
|
70
|
+
const manifestArray = Array.isArray(manifest) ? manifest : [manifest];
|
|
71
|
+
|
|
72
|
+
const map = new Map(manifestArray.map((m) => [m.id, m]));
|
|
73
|
+
|
|
74
|
+
return map;
|
|
75
|
+
} catch (error) {
|
|
76
|
+
/**
|
|
77
|
+
* Probable error during `JSON.parse` call, log error and return empty map
|
|
78
|
+
* as if env variable was not defined
|
|
79
|
+
*/
|
|
80
|
+
console.error(error);
|
|
81
|
+
return new Map();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
@@ -9,11 +9,12 @@ import React, {
|
|
|
9
9
|
import type { PlatformAppContextType, Props, State } from "./types";
|
|
10
10
|
import api from "./api";
|
|
11
11
|
import type { AppManifest } from "../types";
|
|
12
|
+
import { initializeLocalManifest } from "./helpers";
|
|
12
13
|
|
|
13
14
|
// @ts-expect-error empty object creates an error
|
|
14
15
|
const PlatformAppContext = createContext<PlatformAppContextType>({});
|
|
15
16
|
const initialState: State = {
|
|
16
|
-
localManifests:
|
|
17
|
+
localManifests: initializeLocalManifest(),
|
|
17
18
|
remoteManifests: new Map(),
|
|
18
19
|
isLoading: false,
|
|
19
20
|
lastUpdateTime: undefined,
|
|
@@ -28,7 +29,7 @@ export function PlatformAppProvider({
|
|
|
28
29
|
autoUpdateDelay,
|
|
29
30
|
platformAppsServerURL,
|
|
30
31
|
children,
|
|
31
|
-
}: Props) {
|
|
32
|
+
}: Props): JSX.Element {
|
|
32
33
|
const [state, setState] = useState<State>(initialState);
|
|
33
34
|
|
|
34
35
|
const addLocalManifest = useCallback((manifest: AppManifest) => {
|
package/src/types/index.ts
CHANGED
package/src/types/manager.ts
CHANGED
|
@@ -130,6 +130,7 @@ export type ApplicationVersion = {
|
|
|
130
130
|
providers: Array<Id>;
|
|
131
131
|
date_creation: string;
|
|
132
132
|
date_last_modified: string;
|
|
133
|
+
type?: AppType;
|
|
133
134
|
// dependencies: Id[],
|
|
134
135
|
bytes: number | null | undefined;
|
|
135
136
|
warning: string | null | undefined;
|
|
@@ -153,6 +154,11 @@ export type Application = {
|
|
|
153
154
|
sourceURL: string | null | undefined;
|
|
154
155
|
compatibleWalletsJSON: string | null | undefined;
|
|
155
156
|
};
|
|
157
|
+
export enum AppType {
|
|
158
|
+
APP = "app",
|
|
159
|
+
PLUGIN = "plugin",
|
|
160
|
+
TOOL = "tool", // Nb not used for now
|
|
161
|
+
}
|
|
156
162
|
// App is higher level on top of Application and ApplicationVersion
|
|
157
163
|
// with all fields Live needs and in normalized form (but still serializable)
|
|
158
164
|
export type App = {
|
|
@@ -185,6 +191,7 @@ export type App = {
|
|
|
185
191
|
// -1 if coin not in marketcap, otherwise index in the tickers list of https://countervalues.api.live.ledger.com/tickers
|
|
186
192
|
indexOfMarketCap: number;
|
|
187
193
|
isDevTools: boolean;
|
|
194
|
+
type: AppType;
|
|
188
195
|
};
|
|
189
196
|
export type Category = {
|
|
190
197
|
id: Id;
|