@ledgerhq/live-common 34.52.0 → 34.53.0-nightly.20251108023448
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/DataModel.d.ts +2 -2
- package/lib/DataModel.d.ts.map +1 -1
- package/lib/DataModel.js +2 -2
- package/lib/DataModel.js.map +1 -1
- package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +103 -47
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/setup.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/setup.js +6 -5
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/account/serialization.d.ts +1 -1
- package/lib/account/serialization.d.ts.map +1 -1
- package/lib/account/serialization.js +2 -2
- package/lib/account/serialization.js.map +1 -1
- package/lib/api/ofacGeoBlockApi.d.ts +4 -0
- package/lib/api/ofacGeoBlockApi.d.ts.map +1 -0
- package/lib/api/ofacGeoBlockApi.js +21 -0
- package/lib/api/ofacGeoBlockApi.js.map +1 -0
- package/lib/apps/config.d.ts.map +1 -1
- package/lib/apps/config.js +1 -0
- package/lib/apps/config.js.map +1 -1
- package/lib/bot/engine.d.ts +5 -5
- package/lib/bot/engine.d.ts.map +1 -1
- package/lib/bot/engine.js.map +1 -1
- package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +2 -2
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -2
- package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/createTransaction.js +6 -1
- package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +1 -0
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +2 -2
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +30 -26
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js +6 -4
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts +2 -1
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js +2 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -1
- package/lib/bridge/generic-alpaca/types.d.ts +61 -2
- package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +121 -7
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/index.d.ts +1 -1
- package/lib/bridge/index.d.ts.map +1 -1
- package/lib/bridge/index.js +2 -2
- package/lib/bridge/index.js.map +1 -1
- package/lib/currencies/index.d.ts +1 -1
- package/lib/currencies/index.d.ts.map +1 -1
- package/lib/currencies/index.js +1 -4
- package/lib/currencies/index.js.map +1 -1
- package/lib/dada-client/__mocks__/assets.mock.d.ts +383 -0
- package/lib/dada-client/__mocks__/assets.mock.d.ts.map +1 -0
- package/lib/dada-client/__mocks__/assets.mock.js +260 -0
- package/lib/dada-client/__mocks__/assets.mock.js.map +1 -0
- package/lib/dada-client/hooks/useAssetsData.d.ts +2 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +2 -2
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/dada-client/hooks/useLazyLedgerCurrency.d.ts +13 -0
- package/lib/dada-client/hooks/useLazyLedgerCurrency.d.ts.map +1 -0
- package/lib/dada-client/hooks/useLazyLedgerCurrency.js +34 -0
- package/lib/dada-client/hooks/useLazyLedgerCurrency.js.map +1 -0
- package/lib/dada-client/index.d.ts +2 -0
- package/lib/dada-client/index.d.ts.map +1 -0
- package/lib/dada-client/index.js +18 -0
- package/lib/dada-client/index.js.map +1 -0
- package/lib/dada-client/state-manager/api.js +1 -1
- package/lib/dada-client/state-manager/api.js.map +1 -1
- package/lib/dada-client/utils/currencySelection.d.ts +10 -0
- package/lib/dada-client/utils/currencySelection.d.ts.map +1 -0
- package/lib/dada-client/utils/currencySelection.js +34 -0
- package/lib/dada-client/utils/currencySelection.js.map +1 -0
- package/lib/deposit/helper.d.ts +1 -1
- package/lib/deposit/helper.d.ts.map +1 -1
- package/lib/deposit/helper.js +3 -2
- package/lib/deposit/helper.js.map +1 -1
- package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +2 -1
- package/lib/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +5 -1
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +4 -0
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/index.d.ts +4 -8
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +24 -5
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib/e2e/speculosAppVersion.js +1 -0
- package/lib/e2e/speculosAppVersion.js.map +1 -1
- package/lib/families/cosmos/datasets/coreum.d.ts.map +1 -1
- package/lib/families/cosmos/datasets/coreum.js +2 -1
- package/lib/families/cosmos/datasets/coreum.js.map +1 -1
- package/lib/families/near/config.d.ts.map +1 -1
- package/lib/families/near/config.js +1 -0
- package/lib/families/near/config.js.map +1 -1
- package/lib/families/solana/setup.d.ts +1 -1
- package/lib/families/tron/data.mock.d.ts +4 -4
- package/lib/families/tron/data.mock.d.ts.map +1 -1
- package/lib/families/tron/data.mock.js +27 -13
- package/lib/families/tron/data.mock.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +3 -4
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/stakePrograms/index.d.ts +1 -0
- package/lib/featureFlags/stakePrograms/index.d.ts.map +1 -1
- package/lib/featureFlags/stakePrograms/index.js +13 -1
- package/lib/featureFlags/stakePrograms/index.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/generated/cli-transaction.d.ts +1 -1
- package/lib/generated/transaction.d.ts +1 -1
- package/lib/hw/actions/implementations.d.ts.map +1 -1
- package/lib/hw/actions/implementations.js +13 -7
- package/lib/hw/actions/implementations.js.map +1 -1
- package/lib/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib/hw/connectAppEventMapper.js +2 -2
- package/lib/hw/connectAppEventMapper.js.map +1 -1
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts +1 -1
- package/lib/market/hooks/useMarketDataProvider.d.ts +2 -2
- package/lib/market/hooks/useMarketDataProvider.d.ts.map +1 -1
- package/lib/market/hooks/useMarketDataProvider.js +4 -7
- package/lib/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib/market/utils/currencyFormatter.d.ts +3 -4
- package/lib/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib/market/utils/currencyFormatter.js +3 -6
- package/lib/market/utils/currencyFormatter.js.map +1 -1
- package/lib/market/utils/queryKeys.d.ts +0 -1
- package/lib/market/utils/queryKeys.d.ts.map +1 -1
- package/lib/market/utils/queryKeys.js +0 -1
- package/lib/market/utils/queryKeys.js.map +1 -1
- package/lib/market/utils/types.d.ts +6 -8
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/market/utils/types.js.map +1 -1
- package/lib/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
- package/lib/mock/fixtures/cryptoCurrencies.js +10 -1
- package/lib/mock/fixtures/cryptoCurrencies.js.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.d.ts +3 -3
- package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.js +8 -8
- package/lib/modularDrawer/utils/currencyUtils.js.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js +13 -4
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib/postOnboarding/mock.d.ts +1 -0
- package/lib/postOnboarding/mock.d.ts.map +1 -1
- package/lib/postOnboarding/mock.js +3 -1
- package/lib/postOnboarding/mock.js.map +1 -1
- package/lib/postOnboarding/reducer.d.ts +16 -14
- package/lib/postOnboarding/reducer.d.ts.map +1 -1
- package/lib/transaction/index.d.ts +1 -1
- package/lib/transaction/index.d.ts.map +1 -1
- package/lib/transaction/index.js +2 -2
- package/lib/transaction/index.js.map +1 -1
- package/lib/utils/addressUtils.d.ts +15 -0
- package/lib/utils/addressUtils.d.ts.map +1 -0
- package/lib/utils/addressUtils.js +39 -0
- package/lib/utils/addressUtils.js.map +1 -0
- package/lib/wallet-api/ACRE/server.d.ts.map +1 -1
- package/lib/wallet-api/ACRE/server.js +19 -15
- package/lib/wallet-api/ACRE/server.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +8 -5
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/logic.d.ts.map +1 -1
- package/lib/wallet-api/logic.js +29 -29
- package/lib/wallet-api/logic.js.map +1 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +37 -29
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib/wallet-api/useDappLogic.js +76 -60
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/DataModel.d.ts +2 -2
- package/lib-es/DataModel.d.ts.map +1 -1
- package/lib-es/DataModel.js +2 -2
- package/lib-es/DataModel.js.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js +103 -47
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/__tests__/test-helpers/setup.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/setup.js +6 -5
- package/lib-es/__tests__/test-helpers/setup.js.map +1 -1
- package/lib-es/account/serialization.d.ts +1 -1
- package/lib-es/account/serialization.d.ts.map +1 -1
- package/lib-es/account/serialization.js +2 -2
- package/lib-es/account/serialization.js.map +1 -1
- package/lib-es/api/ofacGeoBlockApi.d.ts +4 -0
- package/lib-es/api/ofacGeoBlockApi.d.ts.map +1 -0
- package/lib-es/api/ofacGeoBlockApi.js +18 -0
- package/lib-es/api/ofacGeoBlockApi.js.map +1 -0
- package/lib-es/apps/config.d.ts.map +1 -1
- package/lib-es/apps/config.js +1 -0
- package/lib-es/apps/config.js.map +1 -1
- package/lib-es/bot/engine.d.ts +5 -5
- package/lib-es/bot/engine.d.ts.map +1 -1
- package/lib-es/bot/engine.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +1 -1
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -2
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.js +6 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +1 -0
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +2 -2
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +30 -26
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +6 -4
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +2 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.js +2 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts +61 -2
- package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +121 -7
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/index.d.ts +1 -1
- package/lib-es/bridge/index.d.ts.map +1 -1
- package/lib-es/bridge/index.js +2 -2
- package/lib-es/bridge/index.js.map +1 -1
- package/lib-es/currencies/index.d.ts +1 -1
- package/lib-es/currencies/index.d.ts.map +1 -1
- package/lib-es/currencies/index.js +1 -1
- package/lib-es/currencies/index.js.map +1 -1
- package/lib-es/dada-client/__mocks__/assets.mock.d.ts +383 -0
- package/lib-es/dada-client/__mocks__/assets.mock.d.ts.map +1 -0
- package/lib-es/dada-client/__mocks__/assets.mock.js +257 -0
- package/lib-es/dada-client/__mocks__/assets.mock.js.map +1 -0
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +2 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +2 -2
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.d.ts +13 -0
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.d.ts.map +1 -0
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.js +27 -0
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.js.map +1 -0
- package/lib-es/dada-client/index.d.ts +2 -0
- package/lib-es/dada-client/index.d.ts.map +1 -0
- package/lib-es/dada-client/index.js +2 -0
- package/lib-es/dada-client/index.js.map +1 -0
- package/lib-es/dada-client/state-manager/api.js +1 -1
- package/lib-es/dada-client/state-manager/api.js.map +1 -1
- package/lib-es/dada-client/utils/currencySelection.d.ts +10 -0
- package/lib-es/dada-client/utils/currencySelection.d.ts.map +1 -0
- package/lib-es/dada-client/utils/currencySelection.js +30 -0
- package/lib-es/dada-client/utils/currencySelection.js.map +1 -0
- package/lib-es/deposit/helper.d.ts +1 -1
- package/lib-es/deposit/helper.d.ts.map +1 -1
- package/lib-es/deposit/helper.js +4 -3
- package/lib-es/deposit/helper.js.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.js +2 -1
- package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +5 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +4 -0
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/index.d.ts +4 -8
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +24 -5
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib-es/e2e/speculosAppVersion.js +1 -0
- package/lib-es/e2e/speculosAppVersion.js.map +1 -1
- package/lib-es/families/cosmos/datasets/coreum.d.ts.map +1 -1
- package/lib-es/families/cosmos/datasets/coreum.js +2 -1
- package/lib-es/families/cosmos/datasets/coreum.js.map +1 -1
- package/lib-es/families/near/config.d.ts.map +1 -1
- package/lib-es/families/near/config.js +1 -0
- package/lib-es/families/near/config.js.map +1 -1
- package/lib-es/families/solana/setup.d.ts +1 -1
- package/lib-es/families/tron/data.mock.d.ts +4 -4
- package/lib-es/families/tron/data.mock.d.ts.map +1 -1
- package/lib-es/families/tron/data.mock.js +22 -12
- package/lib-es/families/tron/data.mock.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +3 -4
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.d.ts +1 -0
- package/lib-es/featureFlags/stakePrograms/index.d.ts.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.js +11 -0
- package/lib-es/featureFlags/stakePrograms/index.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/generated/cli-transaction.d.ts +1 -1
- package/lib-es/generated/transaction.d.ts +1 -1
- package/lib-es/hw/actions/implementations.d.ts.map +1 -1
- package/lib-es/hw/actions/implementations.js +15 -9
- package/lib-es/hw/actions/implementations.js.map +1 -1
- package/lib-es/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib-es/hw/connectAppEventMapper.js +3 -3
- package/lib-es/hw/connectAppEventMapper.js.map +1 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts +1 -1
- package/lib-es/market/hooks/useMarketDataProvider.d.ts +2 -2
- package/lib-es/market/hooks/useMarketDataProvider.d.ts.map +1 -1
- package/lib-es/market/hooks/useMarketDataProvider.js +2 -5
- package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib-es/market/utils/currencyFormatter.d.ts +3 -4
- package/lib-es/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib-es/market/utils/currencyFormatter.js +3 -6
- package/lib-es/market/utils/currencyFormatter.js.map +1 -1
- package/lib-es/market/utils/queryKeys.d.ts +0 -1
- package/lib-es/market/utils/queryKeys.d.ts.map +1 -1
- package/lib-es/market/utils/queryKeys.js +0 -1
- package/lib-es/market/utils/queryKeys.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +6 -8
- package/lib-es/market/utils/types.d.ts.map +1 -1
- package/lib-es/market/utils/types.js.map +1 -1
- package/lib-es/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
- package/lib-es/mock/fixtures/cryptoCurrencies.js +11 -2
- package/lib-es/mock/fixtures/cryptoCurrencies.js.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts +3 -3
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/currencyUtils.js +8 -8
- package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js +13 -4
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib-es/postOnboarding/mock.d.ts +1 -0
- package/lib-es/postOnboarding/mock.d.ts.map +1 -1
- package/lib-es/postOnboarding/mock.js +2 -0
- package/lib-es/postOnboarding/mock.js.map +1 -1
- package/lib-es/postOnboarding/reducer.d.ts +16 -14
- package/lib-es/postOnboarding/reducer.d.ts.map +1 -1
- package/lib-es/transaction/index.d.ts +1 -1
- package/lib-es/transaction/index.d.ts.map +1 -1
- package/lib-es/transaction/index.js +2 -2
- package/lib-es/transaction/index.js.map +1 -1
- package/lib-es/utils/addressUtils.d.ts +15 -0
- package/lib-es/utils/addressUtils.d.ts.map +1 -0
- package/lib-es/utils/addressUtils.js +35 -0
- package/lib-es/utils/addressUtils.js.map +1 -0
- package/lib-es/wallet-api/ACRE/server.d.ts.map +1 -1
- package/lib-es/wallet-api/ACRE/server.js +19 -15
- package/lib-es/wallet-api/ACRE/server.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +9 -6
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/logic.d.ts.map +1 -1
- package/lib-es/wallet-api/logic.js +26 -26
- package/lib-es/wallet-api/logic.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +38 -30
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib-es/wallet-api/useDappLogic.js +74 -58
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/package.json +51 -47
- package/src/DataModel.test.ts +74 -24
- package/src/DataModel.ts +4 -4
- package/src/__tests__/accounts/groupPerDay.ts +182 -177
- package/src/__tests__/csvExport.ts +3 -0
- package/src/__tests__/migration/account-migration.ts +2 -2
- package/src/__tests__/test-helpers/bridge.ts +426 -358
- package/src/__tests__/test-helpers/setup.ts +7 -6
- package/src/account/serialization.test.ts +6 -6
- package/src/account/serialization.ts +2 -2
- package/src/api/ofacGeoBlockApi.ts +19 -0
- package/src/apps/config.ts +1 -0
- package/src/bot/engine.ts +5 -5
- package/src/bridge/cache.test.ts +2 -0
- package/src/bridge/crypto-assets/index.test.ts +3 -9
- package/src/bridge/crypto-assets/index.ts +1 -1
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +3 -3
- package/src/bridge/generic-alpaca/createTransaction.ts +6 -1
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +1 -0
- package/src/bridge/generic-alpaca/prepareTransaction.ts +36 -41
- package/src/bridge/generic-alpaca/signOperation.ts +10 -4
- package/src/bridge/generic-alpaca/signer/Eth.ts +4 -2
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +29 -76
- package/src/bridge/generic-alpaca/tests/signOperation.test.ts +10 -2
- package/src/bridge/generic-alpaca/types.ts +80 -2
- package/src/bridge/generic-alpaca/utils.test.ts +58 -2
- package/src/bridge/generic-alpaca/utils.ts +151 -10
- package/src/bridge/index.ts +2 -2
- package/src/bridge/useBridgeTransaction.test.ts +9 -6
- package/src/currencies/cryptoIcons.test.ts +10 -5
- package/src/currencies/index.ts +0 -3
- package/src/currencies/sortByMarketcap.test.ts +4 -1
- package/src/dada-client/README.md +38 -0
- package/src/dada-client/__mocks__/assets.mock.ts +264 -0
- package/src/dada-client/hooks/__tests__/useLazyLedgerCurrency.test.ts +155 -0
- package/src/dada-client/hooks/useAssetsData.ts +14 -9
- package/src/dada-client/hooks/useLazyLedgerCurrency.ts +46 -0
- package/src/dada-client/index.ts +1 -0
- package/src/dada-client/state-manager/api.ts +1 -1
- package/src/dada-client/utils/__test__/currencySelection.test.ts +16 -0
- package/src/dada-client/utils/currencySelection.ts +33 -0
- package/src/deposit/deposit.integration.test.ts +15 -0
- package/src/deposit/deposit.test.ts +60 -40
- package/src/deposit/helper.ts +4 -8
- package/src/domain/getTokensWithFunds.test.ts +4 -0
- package/src/e2e/data/deviceLabelsData.ts +2 -1
- package/src/e2e/enum/DeviceLabels.ts +4 -0
- package/src/e2e/speculos.ts +26 -6
- package/src/e2e/speculosAppVersion.ts +1 -0
- package/src/families/aptos/__snapshots__/bridge.integration.test.ts.snap +12 -12
- package/src/families/bitcoin/__snapshots__/bridge.integration.test.ts.snap +1482 -843
- package/src/families/bitcoin/satstack.test.ts +33 -20
- package/src/families/cosmos/datasets/__snapshots__/babylon.integration.test.ts.snap +1 -1
- package/src/families/cosmos/datasets/__snapshots__/coreum.integration.test.ts.snap +4 -4
- package/src/families/cosmos/datasets/__snapshots__/cosmos.integration.test.ts.snap +251 -209
- package/src/families/cosmos/datasets/coreum.ts +2 -1
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +675 -37
- package/src/families/multiversx/__snapshots__/bridge.integration.test.ts.snap +3 -3
- package/src/families/near/config.ts +1 -0
- package/src/families/polkadot/__snapshots__/bridge.integration.test.ts.snap +34 -34
- package/src/families/solana/__snapshots__/bridge.integration.test.ts.snap +3 -3
- package/src/families/stacks/__snapshots__/bridge.integration.test.ts.snap +10 -10
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +1183 -625
- package/src/families/sui/__snapshots__/bridge.integration.test.ts.snap +428 -0
- package/src/families/tron/data.mock.ts +32 -16
- package/src/families/tron/react.test.ts +16 -4
- package/src/featureFlags/defaultFeatures.ts +3 -4
- package/src/featureFlags/stakePrograms/index.ts +14 -0
- package/src/hw/actions/implementations.ts +22 -11
- package/src/hw/connectAppEventMapper.ts +2 -4
- package/src/market/hooks/useMarketDataProvider.ts +4 -8
- package/src/market/utils/currencyFormatter.ts +4 -18
- package/src/market/utils/queryKeys.ts +0 -1
- package/src/market/utils/types.ts +6 -8
- package/src/mock/fixtures/cryptoCurrencies.ts +11 -2
- package/src/modularDrawer/__mocks__/currencies.mock.ts +1 -1
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +10 -10
- package/src/modularDrawer/utils/currencyUtils.ts +11 -10
- package/src/platform/serializers.test.ts +2 -2
- package/src/postOnboarding/hooks/usePostOnboardingHubState.test.ts +30 -3
- package/src/postOnboarding/hooks/usePostOnboardingHubState.ts +20 -6
- package/src/postOnboarding/mock.ts +2 -0
- package/src/transaction/index.ts +2 -2
- package/src/utils/__tests__/addressUtils.test.ts +229 -0
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +15 -4
- package/src/utils/addressUtils.ts +40 -0
- package/src/wallet-api/ACRE/server.test.ts +11 -8
- package/src/wallet-api/ACRE/server.ts +25 -22
- package/src/wallet-api/Exchange/server.ts +11 -8
- package/src/wallet-api/logic.test.ts +4 -0
- package/src/wallet-api/logic.ts +28 -32
- package/src/wallet-api/react.ts +37 -34
- package/src/wallet-api/useDappLogic.ts +103 -82
- package/lib/hooks/useOFACGeoBlockCheck.d.ts +0 -8
- package/lib/hooks/useOFACGeoBlockCheck.d.ts.map +0 -1
- package/lib/hooks/useOFACGeoBlockCheck.js +0 -32
- package/lib/hooks/useOFACGeoBlockCheck.js.map +0 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.d.ts +0 -8
- package/lib-es/hooks/useOFACGeoBlockCheck.d.ts.map +0 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js +0 -28
- package/lib-es/hooks/useOFACGeoBlockCheck.js.map +0 -1
- package/src/hooks/useOFACGeoBlockCheck.ts +0 -37
|
@@ -31,7 +31,6 @@ import type {
|
|
|
31
31
|
} from "@ledgerhq/types-live";
|
|
32
32
|
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
33
33
|
import { firstValueFrom } from "rxjs";
|
|
34
|
-
import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
|
|
35
34
|
|
|
36
35
|
const warnDev = process.env.CI ? (..._args) => {} : (...msg) => console.warn(...msg);
|
|
37
36
|
// FIXME move out into DatasetTest to be defined in
|
|
@@ -68,17 +67,19 @@ export function testBridge<T extends TransactionCommon>(data: DatasetTest<T>): v
|
|
|
68
67
|
// covers all bridges through many different accounts
|
|
69
68
|
// to test the common shared properties of bridges.
|
|
70
69
|
const accountsRelated: Array<{
|
|
71
|
-
|
|
70
|
+
accountRaw: any;
|
|
72
71
|
currencyData: CurrenciesData<T>;
|
|
73
72
|
accountData: any;
|
|
74
73
|
impl: string;
|
|
74
|
+
currency: CryptoCurrency;
|
|
75
75
|
}> = [];
|
|
76
76
|
const currenciesRelated: Array<{
|
|
77
77
|
currencyData: CurrenciesData<T>;
|
|
78
78
|
currency: CryptoCurrency;
|
|
79
79
|
}> = [];
|
|
80
80
|
const { implementations, currencies } = data;
|
|
81
|
-
|
|
81
|
+
|
|
82
|
+
for (const currencyId of Object.keys(currencies)) {
|
|
82
83
|
const currencyData = currencies[currencyId];
|
|
83
84
|
const currency = getCryptoCurrencyById(currencyId);
|
|
84
85
|
currenciesRelated.push({
|
|
@@ -87,31 +88,32 @@ export function testBridge<T extends TransactionCommon>(data: DatasetTest<T>): v
|
|
|
87
88
|
});
|
|
88
89
|
|
|
89
90
|
const accounts = currencyData.accounts || [];
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
for (const accountData of accounts) {
|
|
92
|
+
for (const impl of implementations) {
|
|
92
93
|
if (accountData.implementations && !accountData.implementations.includes(impl)) {
|
|
93
|
-
|
|
94
|
+
continue;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
const
|
|
97
|
+
const accountRaw = {
|
|
97
98
|
...accountData.raw,
|
|
98
99
|
id: encodeAccountId({
|
|
99
100
|
...decodeAccountId(accountData.raw.id),
|
|
100
101
|
type: impl,
|
|
101
102
|
}),
|
|
102
|
-
}
|
|
103
|
+
};
|
|
103
104
|
accountsRelated.push({
|
|
104
105
|
currencyData,
|
|
105
106
|
accountData,
|
|
106
|
-
|
|
107
|
+
accountRaw,
|
|
107
108
|
impl,
|
|
109
|
+
currency,
|
|
108
110
|
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
112
114
|
const accountsFoundInScanAccountsMap = {};
|
|
113
115
|
|
|
114
|
-
currenciesRelated.
|
|
116
|
+
currenciesRelated.forEach(({ currencyData, currency }) => {
|
|
115
117
|
const bridge = getCurrencyBridge(currency);
|
|
116
118
|
|
|
117
119
|
const scanAccounts = async apdus => {
|
|
@@ -337,29 +339,67 @@ export function testBridge<T extends TransactionCommon>(data: DatasetTest<T>): v
|
|
|
337
339
|
});
|
|
338
340
|
|
|
339
341
|
accountsRelated
|
|
340
|
-
.map(({
|
|
341
|
-
|
|
342
|
-
|
|
342
|
+
.map(({ accountRaw, ...rest }) => {
|
|
343
|
+
let accountPromise;
|
|
344
|
+
let bridgePromise;
|
|
343
345
|
let accountSyncedPromise;
|
|
344
346
|
|
|
345
347
|
// lazy eval so we don't run this yet
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
+
const getAccount = () => accountPromise || (accountPromise = fromAccountRaw(accountRaw));
|
|
349
|
+
|
|
350
|
+
const getBridge = async () => {
|
|
351
|
+
if (!bridgePromise) {
|
|
352
|
+
bridgePromise = getAccount().then(account => {
|
|
353
|
+
const bridge = getAccountBridge(account, null);
|
|
354
|
+
if (!bridge) throw new Error("no bridge for " + account.id);
|
|
355
|
+
return bridge;
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
return bridgePromise;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
const getSynced = async () => {
|
|
362
|
+
if (!accountSyncedPromise) {
|
|
363
|
+
const account = await getAccount();
|
|
364
|
+
const bridge = await getBridge();
|
|
365
|
+
accountSyncedPromise = syncAccount(bridge, account);
|
|
366
|
+
}
|
|
367
|
+
return accountSyncedPromise;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
const currency = rest.currency;
|
|
348
371
|
|
|
349
372
|
return {
|
|
350
373
|
getSynced,
|
|
351
|
-
|
|
352
|
-
|
|
374
|
+
getBridge,
|
|
375
|
+
getAccount,
|
|
376
|
+
initialAccountRaw: accountRaw,
|
|
377
|
+
initialAccountId: accountRaw.id,
|
|
378
|
+
initialAccountCurrency: currency,
|
|
353
379
|
...rest,
|
|
354
380
|
};
|
|
355
381
|
})
|
|
356
382
|
.forEach(arg => {
|
|
357
|
-
const {
|
|
383
|
+
const {
|
|
384
|
+
getSynced,
|
|
385
|
+
getBridge,
|
|
386
|
+
getAccount,
|
|
387
|
+
initialAccountId,
|
|
388
|
+
initialAccountCurrency,
|
|
389
|
+
accountData,
|
|
390
|
+
impl,
|
|
391
|
+
} = arg;
|
|
358
392
|
|
|
359
393
|
const makeTest = (name, fn) => {
|
|
360
394
|
if (accountData.FIXME_tests && accountData.FIXME_tests.some(r => name.match(r))) {
|
|
361
395
|
warnDev(
|
|
362
|
-
"FIXME test was skipped. " +
|
|
396
|
+
"FIXME test was skipped. " +
|
|
397
|
+
name +
|
|
398
|
+
" for " +
|
|
399
|
+
initialAccountCurrency.name +
|
|
400
|
+
" (" +
|
|
401
|
+
initialAccountId +
|
|
402
|
+
")",
|
|
363
403
|
);
|
|
364
404
|
return;
|
|
365
405
|
}
|
|
@@ -367,389 +407,417 @@ export function testBridge<T extends TransactionCommon>(data: DatasetTest<T>): v
|
|
|
367
407
|
test(name, fn);
|
|
368
408
|
};
|
|
369
409
|
|
|
370
|
-
describe(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
if (impl !== "mock") {
|
|
378
|
-
const accFromScanAccounts = accountsFoundInScanAccountsMap[initialAccount.id];
|
|
379
|
-
|
|
380
|
-
if (accFromScanAccounts) {
|
|
381
|
-
makeTest("matches the same account from scanAccounts", async () => {
|
|
382
|
-
const acc = await getSynced();
|
|
383
|
-
expect(acc).toMatchObject(accFromScanAccounts);
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
makeTest("account have no NaN values", async () => {
|
|
388
|
-
const account = await getSynced();
|
|
389
|
-
[account, ...(account.subAccounts || [])].forEach(a => {
|
|
390
|
-
expect(a.balance.isNaN()).toBe(false);
|
|
391
|
-
expect(a.operations.find(op => op.value.isNaN())).toBe(undefined);
|
|
392
|
-
expect(a.operations.find(op => op.fee.isNaN())).toBe(undefined);
|
|
410
|
+
describe(
|
|
411
|
+
impl + " bridge on account " + initialAccountCurrency.name + " (" + initialAccountId + ")",
|
|
412
|
+
() => {
|
|
413
|
+
describe("sync", () => {
|
|
414
|
+
makeTest("succeed", async () => {
|
|
415
|
+
const account = await getSynced();
|
|
416
|
+
expect(fromAccountRaw(toAccountRaw(account))).toBeDefined();
|
|
393
417
|
});
|
|
394
|
-
});
|
|
395
418
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
!blacklistOpsSumEq.impls.includes(impl)
|
|
399
|
-
) {
|
|
400
|
-
makeTest("balance is sum of ops", async () => {
|
|
401
|
-
const account = await getSynced();
|
|
402
|
-
expectBalanceIsOpsSum(account);
|
|
419
|
+
if (impl !== "mock") {
|
|
420
|
+
const accFromScanAccounts = accountsFoundInScanAccountsMap[initialAccountId];
|
|
403
421
|
|
|
404
|
-
if (
|
|
405
|
-
account
|
|
422
|
+
if (accFromScanAccounts) {
|
|
423
|
+
makeTest("matches the same account from scanAccounts", async () => {
|
|
424
|
+
const acc = await getSynced();
|
|
425
|
+
expect(acc).toMatchObject(accFromScanAccounts);
|
|
426
|
+
});
|
|
406
427
|
}
|
|
407
|
-
}
|
|
408
|
-
makeTest("
|
|
428
|
+
}
|
|
429
|
+
makeTest("account have no NaN values", async () => {
|
|
409
430
|
const account = await getSynced();
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
431
|
+
[account, ...(account.subAccounts || [])].forEach(a => {
|
|
432
|
+
expect(a.balance.isNaN()).toBe(false);
|
|
433
|
+
expect(a.operations.find(op => op.value.isNaN())).toBe(undefined);
|
|
434
|
+
expect(a.operations.find(op => op.fee.isNaN())).toBe(undefined);
|
|
435
|
+
});
|
|
415
436
|
});
|
|
416
|
-
}
|
|
417
437
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
blockHeight: 0,
|
|
426
|
-
};
|
|
427
|
-
const synced = await syncAccount(bridge, copy);
|
|
428
|
-
if (initialAccount.id.includes("ripple")) return; // ripple wont work because of the current implementation of pagination
|
|
429
|
-
expect(synced.operations.length).toBe(account.operations.length);
|
|
430
|
-
// same ops are restored
|
|
431
|
-
expect(synced.operations).toEqual(account.operations);
|
|
432
|
-
if (initialAccount.id.startsWith("ethereumjs")) return; // ethereumjs seems to have a bug on this, we ignore because the impl will be dropped.
|
|
433
|
-
|
|
434
|
-
// existing ops are keeping refs
|
|
435
|
-
synced.operations.slice(count).forEach((op, i) => {
|
|
436
|
-
expect(op).toStrictEqual(operations[i]);
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
makeTest("pendingOperations are cleaned up", async () => {
|
|
440
|
-
const account = await getSynced();
|
|
441
|
-
if (initialAccount.id.includes("ripple")) return; // ripple wont work because of the current implementation of pagination
|
|
438
|
+
if (
|
|
439
|
+
!blacklistOpsSumEq.currencies.includes(initialAccountCurrency.id) &&
|
|
440
|
+
!blacklistOpsSumEq.impls.includes(impl)
|
|
441
|
+
) {
|
|
442
|
+
makeTest("balance is sum of ops", async () => {
|
|
443
|
+
const account = await getSynced();
|
|
444
|
+
expectBalanceIsOpsSum(account);
|
|
442
445
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
+
if (account.subAccounts) {
|
|
447
|
+
account.subAccounts.forEach(expectBalanceIsOpsSum);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
makeTest("balance and spendableBalance boundaries", async () => {
|
|
451
|
+
const account = await getSynced();
|
|
452
|
+
expect(account.balance).toBeInstanceOf(BigNumber);
|
|
453
|
+
expect(account.spendableBalance).toBeInstanceOf(BigNumber);
|
|
454
|
+
expect(account.balance.lt(0)).toBe(false);
|
|
455
|
+
expect(account.spendableBalance.lt(0)).toBe(false);
|
|
456
|
+
expect(account.spendableBalance.lte(account.balance)).toBe(true);
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
makeTest("existing operations object refs are preserved", async () => {
|
|
461
|
+
const account = await getSynced();
|
|
462
|
+
const count = Math.floor(account.operations.length / 2);
|
|
463
|
+
const operations = account.operations.slice(count);
|
|
446
464
|
const copy = {
|
|
447
465
|
...account,
|
|
448
466
|
operations,
|
|
449
|
-
pendingOperations,
|
|
450
467
|
blockHeight: 0,
|
|
451
468
|
};
|
|
469
|
+
const bridge = await getBridge();
|
|
452
470
|
const synced = await syncAccount(bridge, copy);
|
|
471
|
+
if (initialAccountId.includes("ripple")) return; // ripple wont work because of the current implementation of pagination
|
|
472
|
+
expect(synced.operations.length).toBe(account.operations.length);
|
|
453
473
|
// same ops are restored
|
|
454
474
|
expect(synced.operations).toEqual(account.operations);
|
|
455
|
-
//
|
|
456
|
-
expect(synced.pendingOperations).toEqual([]);
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
makeTest("there are no Operation dups (by id)", async () => {
|
|
460
|
-
const account = await getSynced();
|
|
461
|
-
const seen = {};
|
|
462
|
-
account.operations.forEach(op => {
|
|
463
|
-
expect(seen[op.id]).toBeUndefined();
|
|
464
|
-
seen[op.id] = op.id;
|
|
465
|
-
});
|
|
466
|
-
});
|
|
467
|
-
});
|
|
475
|
+
if (initialAccountId.startsWith("ethereumjs")) return; // ethereumjs seems to have a bug on this, we ignore because the impl will be dropped.
|
|
468
476
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
477
|
+
// existing ops are keeping refs
|
|
478
|
+
synced.operations.slice(count).forEach((op, i) => {
|
|
479
|
+
expect(op).toStrictEqual(operations[i]);
|
|
480
|
+
});
|
|
481
|
+
});
|
|
482
|
+
makeTest("pendingOperations are cleaned up", async () => {
|
|
483
|
+
const account = await getSynced();
|
|
484
|
+
if (initialAccountId.includes("ripple")) return; // ripple wont work because of the current implementation of pagination
|
|
485
|
+
|
|
486
|
+
if (account.operations.length) {
|
|
487
|
+
const operations = account.operations.slice(1);
|
|
488
|
+
const pendingOperations = [account.operations[0]];
|
|
489
|
+
const copy = {
|
|
490
|
+
...account,
|
|
491
|
+
operations,
|
|
492
|
+
pendingOperations,
|
|
493
|
+
blockHeight: 0,
|
|
494
|
+
};
|
|
495
|
+
const bridge = await getBridge();
|
|
496
|
+
const synced = await syncAccount(bridge, copy);
|
|
497
|
+
// same ops are restored
|
|
498
|
+
expect(synced.operations).toEqual(account.operations);
|
|
499
|
+
// pendingOperations is empty
|
|
500
|
+
expect(synced.pendingOperations).toEqual([]);
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
makeTest("there are no Operation dups (by id)", async () => {
|
|
504
|
+
const account = await getSynced();
|
|
505
|
+
const seen = {};
|
|
506
|
+
account.operations.forEach(op => {
|
|
507
|
+
expect(seen[op.id]).toBeUndefined();
|
|
508
|
+
seen[op.id] = op.id;
|
|
509
|
+
});
|
|
474
510
|
});
|
|
475
511
|
});
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
512
|
+
|
|
513
|
+
describe("createTransaction", () => {
|
|
514
|
+
makeTest(
|
|
515
|
+
"empty transaction is an object with empty recipient and zero amount",
|
|
516
|
+
async () => {
|
|
517
|
+
const account = await getAccount();
|
|
518
|
+
const bridge = await getBridge();
|
|
519
|
+
expect(bridge.createTransaction(account)).toMatchObject({
|
|
520
|
+
amount: new BigNumber(0),
|
|
521
|
+
recipient: "",
|
|
522
|
+
});
|
|
523
|
+
},
|
|
479
524
|
);
|
|
525
|
+
makeTest("empty transaction is equals to itself", async () => {
|
|
526
|
+
const account = await getAccount();
|
|
527
|
+
const bridge = await getBridge();
|
|
528
|
+
expect(bridge.createTransaction(account)).toEqual(bridge.createTransaction(account));
|
|
529
|
+
});
|
|
530
|
+
makeTest("empty transaction correctly serialize", async () => {
|
|
531
|
+
const account = await getAccount();
|
|
532
|
+
const bridge = await getBridge();
|
|
533
|
+
const t = bridge.createTransaction(account);
|
|
534
|
+
expect(fromTransactionRaw(toTransactionRaw(t))).toEqual(t);
|
|
535
|
+
});
|
|
536
|
+
makeTest("transaction with amount and recipient correctly serialize", async () => {
|
|
537
|
+
const account = await getSynced();
|
|
538
|
+
const bridge = await getBridge();
|
|
539
|
+
const t = {
|
|
540
|
+
...bridge.createTransaction(account),
|
|
541
|
+
amount: new BigNumber(1000),
|
|
542
|
+
recipient: account.freshAddress,
|
|
543
|
+
};
|
|
544
|
+
expect(fromTransactionRaw(toTransactionRaw(t))).toEqual(t);
|
|
545
|
+
});
|
|
480
546
|
});
|
|
481
|
-
makeTest("empty transaction correctly serialize", () => {
|
|
482
|
-
const t = bridge.createTransaction(initialAccount);
|
|
483
|
-
expect(fromTransactionRaw(toTransactionRaw(t))).toEqual(t);
|
|
484
|
-
});
|
|
485
|
-
makeTest("transaction with amount and recipient correctly serialize", async () => {
|
|
486
|
-
const account = await getSynced();
|
|
487
|
-
const t = {
|
|
488
|
-
...bridge.createTransaction(account),
|
|
489
|
-
amount: new BigNumber(1000),
|
|
490
|
-
recipient: account.freshAddress,
|
|
491
|
-
};
|
|
492
|
-
expect(fromTransactionRaw(toTransactionRaw(t))).toEqual(t);
|
|
493
|
-
});
|
|
494
|
-
});
|
|
495
547
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
548
|
+
describe("updateTransaction", () => {
|
|
549
|
+
// stability: function called twice will return the same object reference
|
|
550
|
+
// (=== convergence so we can stop looping, typically because transaction will be a hook effect dependency of prepareTransaction)
|
|
551
|
+
async function expectStability(t, patch) {
|
|
552
|
+
const bridge = await getBridge();
|
|
553
|
+
const t2 = bridge.updateTransaction(t, patch);
|
|
554
|
+
const t3 = bridge.updateTransaction(t2, patch);
|
|
555
|
+
expect(t2).toBe(t3);
|
|
556
|
+
}
|
|
504
557
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
558
|
+
makeTest("ref stability on empty transaction", async () => {
|
|
559
|
+
const account = await getSynced();
|
|
560
|
+
const bridge = await getBridge();
|
|
561
|
+
const tx = bridge.createTransaction(account);
|
|
562
|
+
await expectStability(tx, {});
|
|
563
|
+
});
|
|
510
564
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
565
|
+
makeTest("ref stability on self transaction", async () => {
|
|
566
|
+
const account = await getSynced();
|
|
567
|
+
const bridge = await getBridge();
|
|
568
|
+
const tx = bridge.createTransaction(account);
|
|
569
|
+
await expectStability(tx, {
|
|
570
|
+
amount: new BigNumber(1000),
|
|
571
|
+
recipient: account.freshAddress,
|
|
572
|
+
});
|
|
517
573
|
});
|
|
518
574
|
});
|
|
519
|
-
});
|
|
520
575
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
576
|
+
describe("prepareTransaction", () => {
|
|
577
|
+
// stability: function called twice will return the same object reference
|
|
578
|
+
// (=== convergence so we can stop looping, typically because transaction will be a hook effect dependency of prepareTransaction)
|
|
579
|
+
async function expectStability(account, t) {
|
|
580
|
+
const bridge = await getBridge();
|
|
581
|
+
let t2 = await bridge.prepareTransaction(account, t);
|
|
582
|
+
let t3 = await bridge.prepareTransaction(account, t2);
|
|
583
|
+
t2 = omit(t2, arg.currencyData.IgnorePrepareTransactionFields || []);
|
|
584
|
+
t3 = omit(t3, arg.currencyData.IgnorePrepareTransactionFields || []);
|
|
585
|
+
expect(t2).toStrictEqual(t3);
|
|
586
|
+
}
|
|
531
587
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
makeTest("ref stability on self transaction", async () => {
|
|
537
|
-
const account = await getSynced();
|
|
538
|
-
await expectStability(account, {
|
|
539
|
-
...bridge.createTransaction(account),
|
|
540
|
-
amount: new BigNumber(1000),
|
|
541
|
-
recipient: account.freshAddress,
|
|
588
|
+
makeTest("ref stability on empty transaction", async () => {
|
|
589
|
+
const account = await getSynced();
|
|
590
|
+
const bridge = await getBridge();
|
|
591
|
+
await expectStability(account, bridge.createTransaction(account));
|
|
542
592
|
});
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
await
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
593
|
+
makeTest("ref stability on self transaction", async () => {
|
|
594
|
+
const account = await getSynced();
|
|
595
|
+
const bridge = await getBridge();
|
|
596
|
+
await expectStability(account, {
|
|
597
|
+
...bridge.createTransaction(account),
|
|
598
|
+
amount: new BigNumber(1000),
|
|
599
|
+
recipient: account.freshAddress,
|
|
600
|
+
});
|
|
601
|
+
});
|
|
602
|
+
makeTest("can be run in parallel and all yield same results", async () => {
|
|
603
|
+
const account = await getSynced();
|
|
604
|
+
const bridge = await getBridge();
|
|
605
|
+
const t = {
|
|
606
|
+
...bridge.createTransaction(account),
|
|
607
|
+
amount: new BigNumber(1000),
|
|
608
|
+
recipient: account.freshAddress,
|
|
609
|
+
};
|
|
610
|
+
const stable = await bridge.prepareTransaction(account, t);
|
|
611
|
+
const first = omit(
|
|
612
|
+
await bridge.prepareTransaction(account, stable),
|
|
613
|
+
arg.currencyData.IgnorePrepareTransactionFields || [],
|
|
614
|
+
);
|
|
615
|
+
const concur = await Promise.all(
|
|
616
|
+
Array(3)
|
|
617
|
+
.fill(null)
|
|
618
|
+
.map(() => bridge.prepareTransaction(account, stable)),
|
|
619
|
+
);
|
|
620
|
+
concur.forEach(r => {
|
|
621
|
+
r = omit(r, arg.currencyData.IgnorePrepareTransactionFields || []);
|
|
622
|
+
expect(r).toEqual(first);
|
|
623
|
+
});
|
|
564
624
|
});
|
|
565
625
|
});
|
|
566
|
-
});
|
|
567
626
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
makeTest("can be called on an empty prepared transaction", async () => {
|
|
587
|
-
const account = await getSynced();
|
|
588
|
-
const t = await bridge.prepareTransaction(account, {
|
|
589
|
-
...bridge.createTransaction(account),
|
|
590
|
-
feePerByte: new BigNumber(0.0001),
|
|
627
|
+
describe("getTransactionStatus", () => {
|
|
628
|
+
makeTest("can be called on an empty transaction", async () => {
|
|
629
|
+
const account = await getSynced();
|
|
630
|
+
const bridge = await getBridge();
|
|
631
|
+
const t = {
|
|
632
|
+
...bridge.createTransaction(account),
|
|
633
|
+
feePerByte: new BigNumber(0.0001),
|
|
634
|
+
};
|
|
635
|
+
const s = await bridge.getTransactionStatus(account, t);
|
|
636
|
+
expect(s).toBeDefined();
|
|
637
|
+
expect(s.errors).toHaveProperty("recipient");
|
|
638
|
+
expect(s).toHaveProperty("totalSpent");
|
|
639
|
+
expect(s.totalSpent).toBeInstanceOf(BigNumber);
|
|
640
|
+
expect(s).toHaveProperty("estimatedFees");
|
|
641
|
+
expect(s.estimatedFees).toBeInstanceOf(BigNumber);
|
|
642
|
+
expect(s).toHaveProperty("amount");
|
|
643
|
+
expect(s.amount).toBeInstanceOf(BigNumber);
|
|
644
|
+
expect(s.amount).toEqual(new BigNumber(0));
|
|
591
645
|
});
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
646
|
+
makeTest("can be called on an empty prepared transaction", async () => {
|
|
647
|
+
const bridge = await getBridge();
|
|
648
|
+
const account = await getSynced();
|
|
649
|
+
const t = await bridge.prepareTransaction(account, {
|
|
650
|
+
...bridge.createTransaction(account),
|
|
651
|
+
feePerByte: new BigNumber(0.0001),
|
|
652
|
+
});
|
|
653
|
+
const s = await bridge.getTransactionStatus(account, t);
|
|
654
|
+
expect(s).toBeDefined(); // FIXME i'm not sure if we can establish more shared properties
|
|
655
|
+
});
|
|
656
|
+
makeTest("Default empty recipient have a recipientError", async () => {
|
|
657
|
+
const bridge = await getBridge();
|
|
658
|
+
const account = await getSynced();
|
|
659
|
+
const t = {
|
|
660
|
+
...bridge.createTransaction(account),
|
|
661
|
+
feePerByte: new BigNumber(0.0001),
|
|
662
|
+
};
|
|
663
|
+
const status = await bridge.getTransactionStatus(account, t);
|
|
664
|
+
expect(status.errors.recipient).toBeInstanceOf(RecipientRequired);
|
|
665
|
+
});
|
|
666
|
+
makeTest("invalid recipient have a recipientError", async () => {
|
|
667
|
+
const bridge = await getBridge();
|
|
668
|
+
const account = await getSynced();
|
|
669
|
+
const t = {
|
|
670
|
+
...bridge.createTransaction(account),
|
|
671
|
+
feePerByte: new BigNumber(0.0001),
|
|
672
|
+
recipient: "invalidADDRESS",
|
|
673
|
+
};
|
|
674
|
+
const status = await bridge.getTransactionStatus(account, t);
|
|
675
|
+
expect(status.errors.recipient).toBeInstanceOf(InvalidAddress);
|
|
676
|
+
});
|
|
677
|
+
makeTest("Default empty amount has an amount error", async () => {
|
|
678
|
+
const bridge = await getBridge();
|
|
679
|
+
const account = await getSynced();
|
|
680
|
+
const t = await bridge.prepareTransaction(account, {
|
|
681
|
+
...bridge.createTransaction(account),
|
|
682
|
+
feePerByte: new BigNumber(0.0001),
|
|
683
|
+
});
|
|
684
|
+
const status = await bridge.getTransactionStatus(account, t);
|
|
685
|
+
expect(status.errors.amount).toBeInstanceOf(AmountRequired);
|
|
619
686
|
});
|
|
620
|
-
const status = await bridge.getTransactionStatus(account, t);
|
|
621
|
-
expect(status.errors.amount).toBeInstanceOf(AmountRequired);
|
|
622
|
-
});
|
|
623
687
|
|
|
624
|
-
|
|
688
|
+
const accountDataTest = accountData.test;
|
|
625
689
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
690
|
+
if (accountDataTest) {
|
|
691
|
+
makeTest("account specific test", async () => {
|
|
692
|
+
const bridge = await getBridge();
|
|
693
|
+
return accountDataTest(expect, await getSynced(), bridge);
|
|
694
|
+
});
|
|
695
|
+
}
|
|
631
696
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
697
|
+
(accountData.transactions || []).forEach(
|
|
698
|
+
({ name, transaction, expectedStatus, apdus, testSignedOperation, test: testFn }) => {
|
|
699
|
+
makeTest("transaction " + name, async () => {
|
|
700
|
+
const bridge = await getBridge();
|
|
701
|
+
const account: Account = await getSynced();
|
|
702
|
+
let t =
|
|
703
|
+
typeof transaction === "function"
|
|
704
|
+
? transaction(bridge.createTransaction(account), account, bridge)
|
|
705
|
+
: transaction;
|
|
706
|
+
t = await bridge.prepareTransaction(account, {
|
|
707
|
+
feePerByte: new BigNumber(0.0001),
|
|
708
|
+
...t,
|
|
709
|
+
});
|
|
710
|
+
const s = await bridge.getTransactionStatus(account, t);
|
|
711
|
+
|
|
712
|
+
if (expectedStatus) {
|
|
713
|
+
const es =
|
|
714
|
+
typeof expectedStatus === "function"
|
|
715
|
+
? expectedStatus(account, t, s)
|
|
716
|
+
: expectedStatus;
|
|
717
|
+
const { errors, warnings } = es;
|
|
718
|
+
|
|
719
|
+
// we match errors and warnings
|
|
720
|
+
errors && expect(s.errors).toMatchObject(errors);
|
|
721
|
+
warnings && expect(s.warnings).toMatchObject(warnings);
|
|
722
|
+
// now we match rest of fields but using the raw version for better readability
|
|
723
|
+
const restRaw: Record<string, any> = toTransactionStatusRaw(
|
|
724
|
+
{
|
|
725
|
+
...s,
|
|
726
|
+
...es,
|
|
727
|
+
},
|
|
728
|
+
account.currency.family,
|
|
729
|
+
);
|
|
730
|
+
delete restRaw.errors;
|
|
731
|
+
delete restRaw.warnings;
|
|
666
732
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
733
|
+
for (const k in restRaw) {
|
|
734
|
+
if (!(k in es)) {
|
|
735
|
+
delete restRaw[k];
|
|
736
|
+
}
|
|
670
737
|
}
|
|
671
|
-
}
|
|
672
738
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
739
|
+
expect(
|
|
740
|
+
toTransactionStatusRaw(s as TransactionStatusCommon, account.currency.family),
|
|
741
|
+
).toMatchObject(restRaw);
|
|
742
|
+
}
|
|
677
743
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
744
|
+
if (testFn) {
|
|
745
|
+
await testFn(expect, t, s, bridge);
|
|
746
|
+
}
|
|
681
747
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
748
|
+
if (Object.keys(s.errors).length === 0) {
|
|
749
|
+
const { subAccountId } = t;
|
|
750
|
+
const { subAccounts } = account;
|
|
751
|
+
|
|
752
|
+
const inferSubAccount = () => {
|
|
753
|
+
invariant(subAccounts, "sub accounts available");
|
|
754
|
+
const a = (subAccounts as TokenAccount[]).find(a => a.id === subAccountId);
|
|
755
|
+
invariant(a, "sub account not found");
|
|
756
|
+
return a;
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
const obj = subAccountId
|
|
760
|
+
? {
|
|
761
|
+
transaction: t as TransactionCommon,
|
|
762
|
+
account: inferSubAccount() as AccountLike,
|
|
763
|
+
parentAccount: account,
|
|
764
|
+
}
|
|
765
|
+
: {
|
|
766
|
+
transaction: t as TransactionCommon,
|
|
767
|
+
account: account as AccountLike,
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
if (
|
|
771
|
+
(typeof t.mode !== "string" || t.mode === "send") &&
|
|
772
|
+
t.model &&
|
|
773
|
+
t.model.kind !== "stake.createAccount"
|
|
774
|
+
) {
|
|
775
|
+
const estimation = await bridge.estimateMaxSpendable(obj);
|
|
776
|
+
expect(estimation.gte(0)).toBe(true);
|
|
777
|
+
expect(estimation.lte(obj.account.balance)).toBe(true);
|
|
778
|
+
|
|
779
|
+
if (t.useAllAmount) {
|
|
780
|
+
expect(estimation.toString()).toBe(s.amount.toString());
|
|
698
781
|
}
|
|
699
|
-
: {
|
|
700
|
-
transaction: t as TransactionCommon,
|
|
701
|
-
account: account as AccountLike,
|
|
702
|
-
};
|
|
703
|
-
|
|
704
|
-
if (
|
|
705
|
-
(typeof t.mode !== "string" || t.mode === "send") &&
|
|
706
|
-
t.model &&
|
|
707
|
-
t.model.kind !== "stake.createAccount"
|
|
708
|
-
) {
|
|
709
|
-
const estimation = await bridge.estimateMaxSpendable(obj);
|
|
710
|
-
expect(estimation.gte(0)).toBe(true);
|
|
711
|
-
expect(estimation.lte(obj.account.balance)).toBe(true);
|
|
712
|
-
|
|
713
|
-
if (t.useAllAmount) {
|
|
714
|
-
expect(estimation.toString()).toBe(s.amount.toString());
|
|
715
782
|
}
|
|
716
783
|
}
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
if (apdus && impl !== "mock") {
|
|
720
|
-
const deviceId = await mockDeviceWithAPDUs(apdus);
|
|
721
|
-
|
|
722
|
-
try {
|
|
723
|
-
const signedOperation = await firstValueFrom(
|
|
724
|
-
bridge
|
|
725
|
-
.signOperation({
|
|
726
|
-
account,
|
|
727
|
-
deviceId,
|
|
728
|
-
transaction: t,
|
|
729
|
-
})
|
|
730
|
-
.pipe(
|
|
731
|
-
filter(e => e.type === "signed"),
|
|
732
|
-
map((e: any) => e.signedOperation),
|
|
733
|
-
),
|
|
734
|
-
);
|
|
735
784
|
|
|
736
|
-
|
|
737
|
-
|
|
785
|
+
if (apdus && impl !== "mock") {
|
|
786
|
+
const deviceId = await mockDeviceWithAPDUs(apdus);
|
|
787
|
+
|
|
788
|
+
try {
|
|
789
|
+
const signedOperation = await firstValueFrom(
|
|
790
|
+
bridge
|
|
791
|
+
.signOperation({
|
|
792
|
+
account,
|
|
793
|
+
deviceId,
|
|
794
|
+
transaction: t,
|
|
795
|
+
})
|
|
796
|
+
.pipe(
|
|
797
|
+
filter((e: any) => e.type === "signed"),
|
|
798
|
+
map((e: any) => e.signedOperation),
|
|
799
|
+
),
|
|
800
|
+
);
|
|
801
|
+
|
|
802
|
+
if (testSignedOperation) {
|
|
803
|
+
await testSignedOperation(expect, signedOperation, account, t, s, bridge);
|
|
804
|
+
}
|
|
805
|
+
} finally {
|
|
806
|
+
releaseMockDevice(deviceId);
|
|
738
807
|
}
|
|
739
|
-
} finally {
|
|
740
|
-
releaseMockDevice(deviceId);
|
|
741
808
|
}
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
);
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
809
|
+
});
|
|
810
|
+
},
|
|
811
|
+
);
|
|
812
|
+
});
|
|
813
|
+
describe("signOperation and broadcast", () => {
|
|
814
|
+
makeTest("method is available on bridge", async () => {
|
|
815
|
+
const bridge = await getBridge();
|
|
816
|
+
expect(typeof bridge.signOperation).toBe("function");
|
|
817
|
+
expect(typeof bridge.broadcast).toBe("function");
|
|
818
|
+
}); // NB for now we are not going farther because most is covered by bash tests
|
|
819
|
+
});
|
|
820
|
+
},
|
|
821
|
+
);
|
|
754
822
|
});
|
|
755
823
|
}
|