@ledgerhq/live-common 34.52.0 → 34.53.0-nightly.20251107095716
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 +56 -52
- 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
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
Operation,
|
|
3
|
+
OperationRaw,
|
|
4
|
+
TransactionCommon,
|
|
5
|
+
TransactionCommonRaw,
|
|
6
|
+
} from "@ledgerhq/types-live";
|
|
2
7
|
import BigNumber from "bignumber.js";
|
|
3
8
|
import type { Unit } from "@ledgerhq/types-cryptoassets";
|
|
4
9
|
|
|
@@ -6,6 +11,34 @@ type NetworkInfo = {
|
|
|
6
11
|
fees: BigNumber;
|
|
7
12
|
};
|
|
8
13
|
|
|
14
|
+
type NetworkInfoRaw = {
|
|
15
|
+
fees: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type Strategy = "slow" | "medium" | "fast";
|
|
19
|
+
|
|
20
|
+
export type FeeData = {
|
|
21
|
+
maxFeePerGas: BigNumber | null;
|
|
22
|
+
maxPriorityFeePerGas: BigNumber | null;
|
|
23
|
+
gasPrice: BigNumber | null;
|
|
24
|
+
nextBaseFee: BigNumber | null;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type FeeDataRaw = {
|
|
28
|
+
maxFeePerGas: string | null;
|
|
29
|
+
maxPriorityFeePerGas: string | null;
|
|
30
|
+
gasPrice: string | null;
|
|
31
|
+
nextBaseFee: string | null;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type GasOptions = {
|
|
35
|
+
[key in Strategy]: FeeData;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type GasOptionsRaw = {
|
|
39
|
+
[key in Strategy]: FeeDataRaw;
|
|
40
|
+
};
|
|
41
|
+
|
|
9
42
|
export type GenericTransaction = TransactionCommon & {
|
|
10
43
|
family: string;
|
|
11
44
|
fees?: BigNumber | null;
|
|
@@ -14,6 +47,7 @@ export type GenericTransaction = TransactionCommon & {
|
|
|
14
47
|
parameters: { fees?: BigNumber | null };
|
|
15
48
|
};
|
|
16
49
|
tag?: number | null | undefined;
|
|
50
|
+
nonce?: BigNumber | null | undefined;
|
|
17
51
|
feeCustomUnit?: Unit | null | undefined;
|
|
18
52
|
memoType?: string | null;
|
|
19
53
|
memoValue?: string | null;
|
|
@@ -27,12 +61,56 @@ export type GenericTransaction = TransactionCommon & {
|
|
|
27
61
|
| "stake"
|
|
28
62
|
| "undelegate"
|
|
29
63
|
| "unstake";
|
|
30
|
-
type?: number;
|
|
64
|
+
type?: number | null;
|
|
31
65
|
assetReference?: string;
|
|
32
66
|
assetOwner?: string;
|
|
33
67
|
networkInfo?: NetworkInfo | null;
|
|
68
|
+
chainId?: number | null;
|
|
69
|
+
gasLimit?: BigNumber | null;
|
|
70
|
+
gasPrice?: BigNumber | null;
|
|
71
|
+
maxFeePerGas?: BigNumber | null;
|
|
72
|
+
maxPriorityFeePerGas?: BigNumber | null;
|
|
73
|
+
gasOptions?: GasOptions;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type GenericTransactionRaw = TransactionCommonRaw & {
|
|
77
|
+
family: string;
|
|
78
|
+
fees?: string | null;
|
|
79
|
+
storageLimit?: string | null;
|
|
80
|
+
customFees?: {
|
|
81
|
+
parameters: { fees?: string | null };
|
|
82
|
+
};
|
|
83
|
+
tag?: number | null | undefined;
|
|
84
|
+
nonce?: string | null | undefined;
|
|
85
|
+
feeCustomUnit?: Unit | null | undefined;
|
|
86
|
+
memoType?: string | null;
|
|
87
|
+
memoValue?: string | null;
|
|
88
|
+
data?: string;
|
|
89
|
+
mode?:
|
|
90
|
+
| "send"
|
|
91
|
+
| "changeTrust"
|
|
92
|
+
| "send-legacy"
|
|
93
|
+
| "send-eip1559"
|
|
94
|
+
| "delegate"
|
|
95
|
+
| "stake"
|
|
96
|
+
| "undelegate"
|
|
97
|
+
| "unstake";
|
|
98
|
+
type?: number | null;
|
|
99
|
+
assetReference?: string | null;
|
|
100
|
+
assetOwner?: string | null;
|
|
101
|
+
networkInfo?: NetworkInfoRaw | null;
|
|
102
|
+
chainId?: number | null;
|
|
103
|
+
gasLimit?: string | null;
|
|
104
|
+
gasPrice?: string | null;
|
|
105
|
+
maxFeePerGas?: string | null;
|
|
106
|
+
maxPriorityFeePerGas?: string | null;
|
|
107
|
+
gasOptions?: GasOptionsRaw;
|
|
34
108
|
};
|
|
35
109
|
|
|
36
110
|
export interface OperationCommon extends Operation {
|
|
37
111
|
extra: Record<string, any>;
|
|
38
112
|
}
|
|
113
|
+
|
|
114
|
+
export interface OperationCommonRaw extends OperationRaw {
|
|
115
|
+
extra: Record<string, any>;
|
|
116
|
+
}
|
|
@@ -22,6 +22,7 @@ describe("Alpaca utils", () => {
|
|
|
22
22
|
parentType: "OPT_IN",
|
|
23
23
|
subType: undefined,
|
|
24
24
|
parentValue: new BigNumber(50),
|
|
25
|
+
parentRecipient: "recipient-address",
|
|
25
26
|
},
|
|
26
27
|
],
|
|
27
28
|
[
|
|
@@ -32,6 +33,7 @@ describe("Alpaca utils", () => {
|
|
|
32
33
|
parentType: "DELEGATE",
|
|
33
34
|
subType: undefined,
|
|
34
35
|
parentValue: new BigNumber(50),
|
|
36
|
+
parentRecipient: "recipient-address",
|
|
35
37
|
},
|
|
36
38
|
],
|
|
37
39
|
[
|
|
@@ -42,6 +44,7 @@ describe("Alpaca utils", () => {
|
|
|
42
44
|
parentType: "DELEGATE",
|
|
43
45
|
subType: undefined,
|
|
44
46
|
parentValue: new BigNumber(50),
|
|
47
|
+
parentRecipient: "recipient-address",
|
|
45
48
|
},
|
|
46
49
|
],
|
|
47
50
|
[
|
|
@@ -52,6 +55,7 @@ describe("Alpaca utils", () => {
|
|
|
52
55
|
parentType: "UNDELEGATE",
|
|
53
56
|
subType: undefined,
|
|
54
57
|
parentValue: new BigNumber(50),
|
|
58
|
+
parentRecipient: "recipient-address",
|
|
55
59
|
},
|
|
56
60
|
],
|
|
57
61
|
[
|
|
@@ -62,6 +66,7 @@ describe("Alpaca utils", () => {
|
|
|
62
66
|
parentType: "UNDELEGATE",
|
|
63
67
|
subType: undefined,
|
|
64
68
|
parentValue: new BigNumber(50),
|
|
69
|
+
parentRecipient: "recipient-address",
|
|
65
70
|
},
|
|
66
71
|
],
|
|
67
72
|
[
|
|
@@ -72,6 +77,7 @@ describe("Alpaca utils", () => {
|
|
|
72
77
|
parentType: "OUT",
|
|
73
78
|
subType: undefined,
|
|
74
79
|
parentValue: new BigNumber(50),
|
|
80
|
+
parentRecipient: "recipient-address",
|
|
75
81
|
},
|
|
76
82
|
],
|
|
77
83
|
[
|
|
@@ -82,6 +88,7 @@ describe("Alpaca utils", () => {
|
|
|
82
88
|
parentType: "FEES",
|
|
83
89
|
subType: "OPT_IN",
|
|
84
90
|
parentValue: new BigNumber(12),
|
|
91
|
+
parentRecipient: "contract-address",
|
|
85
92
|
},
|
|
86
93
|
],
|
|
87
94
|
[
|
|
@@ -92,6 +99,7 @@ describe("Alpaca utils", () => {
|
|
|
92
99
|
parentType: "FEES",
|
|
93
100
|
subType: "DELEGATE",
|
|
94
101
|
parentValue: new BigNumber(12),
|
|
102
|
+
parentRecipient: "contract-address",
|
|
95
103
|
},
|
|
96
104
|
],
|
|
97
105
|
[
|
|
@@ -102,6 +110,7 @@ describe("Alpaca utils", () => {
|
|
|
102
110
|
parentType: "FEES",
|
|
103
111
|
subType: "DELEGATE",
|
|
104
112
|
parentValue: new BigNumber(12),
|
|
113
|
+
parentRecipient: "contract-address",
|
|
105
114
|
},
|
|
106
115
|
],
|
|
107
116
|
[
|
|
@@ -112,6 +121,7 @@ describe("Alpaca utils", () => {
|
|
|
112
121
|
parentType: "FEES",
|
|
113
122
|
subType: "UNDELEGATE",
|
|
114
123
|
parentValue: new BigNumber(12),
|
|
124
|
+
parentRecipient: "contract-address",
|
|
115
125
|
},
|
|
116
126
|
],
|
|
117
127
|
[
|
|
@@ -122,26 +132,38 @@ describe("Alpaca utils", () => {
|
|
|
122
132
|
parentType: "FEES",
|
|
123
133
|
subType: "UNDELEGATE",
|
|
124
134
|
parentValue: new BigNumber(12),
|
|
135
|
+
parentRecipient: "contract-address",
|
|
125
136
|
},
|
|
126
137
|
],
|
|
127
138
|
[
|
|
128
139
|
"token",
|
|
129
140
|
"send",
|
|
130
141
|
{ subAccountId: "sub-account-id" },
|
|
131
|
-
{
|
|
142
|
+
{
|
|
143
|
+
parentType: "FEES",
|
|
144
|
+
subType: "OUT",
|
|
145
|
+
parentValue: new BigNumber(12),
|
|
146
|
+
parentRecipient: "contract-address",
|
|
147
|
+
},
|
|
132
148
|
],
|
|
133
149
|
])("builds an optimistic %s operation with %s mode ", (_s, mode, params, expected) => {
|
|
134
150
|
const operation = buildOptimisticOperation(
|
|
135
151
|
{
|
|
136
152
|
id: "parent-account-id",
|
|
137
153
|
freshAddress: "account-address",
|
|
138
|
-
subAccounts: [{ id: "sub-account-id" }],
|
|
154
|
+
subAccounts: [{ id: "sub-account-id", token: { contractAddress: "contract-address" } }],
|
|
139
155
|
} as Account,
|
|
140
156
|
{
|
|
141
157
|
mode,
|
|
142
158
|
amount: new BigNumber(50),
|
|
143
159
|
fees: new BigNumber(12),
|
|
144
160
|
recipient: "recipient-address",
|
|
161
|
+
recipientDomain: {
|
|
162
|
+
registry: "ens",
|
|
163
|
+
domain: "recipient.eth",
|
|
164
|
+
address: "recipient-address",
|
|
165
|
+
type: "forward",
|
|
166
|
+
},
|
|
145
167
|
...params,
|
|
146
168
|
} as GenericTransaction,
|
|
147
169
|
);
|
|
@@ -156,6 +178,17 @@ describe("Alpaca utils", () => {
|
|
|
156
178
|
fee: new BigNumber(12),
|
|
157
179
|
blockHash: null,
|
|
158
180
|
blockHeight: null,
|
|
181
|
+
transactionRaw: {
|
|
182
|
+
amount: expected.subType ? "0" : expected.parentValue.toFixed(),
|
|
183
|
+
fees: "12",
|
|
184
|
+
recipient: expected.parentRecipient,
|
|
185
|
+
recipientDomain: {
|
|
186
|
+
registry: "ens",
|
|
187
|
+
domain: "recipient.eth",
|
|
188
|
+
address: "recipient-address",
|
|
189
|
+
type: "forward",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
159
192
|
...(expected.subType
|
|
160
193
|
? {
|
|
161
194
|
subOperations: [
|
|
@@ -168,6 +201,11 @@ describe("Alpaca utils", () => {
|
|
|
168
201
|
value: new BigNumber(50),
|
|
169
202
|
blockHash: null,
|
|
170
203
|
blockHeight: null,
|
|
204
|
+
transactionRaw: {
|
|
205
|
+
amount: "50",
|
|
206
|
+
fees: "12",
|
|
207
|
+
recipient: "recipient-address",
|
|
208
|
+
},
|
|
171
209
|
},
|
|
172
210
|
],
|
|
173
211
|
}
|
|
@@ -420,5 +458,23 @@ describe("Alpaca utils", () => {
|
|
|
420
458
|
|
|
421
459
|
expect(result.value.toString()).toEqual("50");
|
|
422
460
|
});
|
|
461
|
+
|
|
462
|
+
it("shows fees in value when transaction has failed", () => {
|
|
463
|
+
const failedOp = {
|
|
464
|
+
...baseOp,
|
|
465
|
+
type: "OUT",
|
|
466
|
+
value: BigInt(100),
|
|
467
|
+
tx: { ...baseOp.tx, fees: BigInt(25) },
|
|
468
|
+
details: { status: "failed" },
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
const result = adaptCoreOperationToLiveOperation(accountId, failedOp);
|
|
472
|
+
|
|
473
|
+
expect(result).toMatchObject({
|
|
474
|
+
hasFailed: true,
|
|
475
|
+
value: new BigNumber(25),
|
|
476
|
+
fee: new BigNumber(25),
|
|
477
|
+
});
|
|
478
|
+
});
|
|
423
479
|
});
|
|
424
480
|
});
|
|
@@ -9,7 +9,15 @@ import {
|
|
|
9
9
|
} from "@ledgerhq/coin-framework/api/types";
|
|
10
10
|
import { findCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
|
11
11
|
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
FeeData,
|
|
14
|
+
FeeDataRaw,
|
|
15
|
+
GasOptions,
|
|
16
|
+
GasOptionsRaw,
|
|
17
|
+
GenericTransaction,
|
|
18
|
+
GenericTransactionRaw,
|
|
19
|
+
OperationCommon,
|
|
20
|
+
} from "./types";
|
|
13
21
|
|
|
14
22
|
export function findCryptoCurrencyByNetwork(network: string): CryptoCurrency | undefined {
|
|
15
23
|
const networksRemap = {
|
|
@@ -99,23 +107,36 @@ export function adaptCoreOperationToLiveOperation(accountId: string, op: CoreOpe
|
|
|
99
107
|
extra.memo = op.details.memo as string;
|
|
100
108
|
}
|
|
101
109
|
const bnFees = new BigNumber(op.tx.fees.toString());
|
|
110
|
+
const hasFailed = op.details?.status === "failed";
|
|
111
|
+
|
|
112
|
+
let value: BigNumber;
|
|
113
|
+
if (hasFailed) {
|
|
114
|
+
value = bnFees;
|
|
115
|
+
} else if (
|
|
116
|
+
op.asset.type === "native" &&
|
|
117
|
+
["OUT", "FEES", "DELEGATE", "UNDELEGATE"].includes(opType)
|
|
118
|
+
) {
|
|
119
|
+
value = new BigNumber(op.value.toString()).plus(bnFees);
|
|
120
|
+
} else {
|
|
121
|
+
value = new BigNumber(op.value.toString());
|
|
122
|
+
}
|
|
123
|
+
|
|
102
124
|
const res = {
|
|
103
125
|
id: encodeOperationId(accountId, op.tx.hash, op.type),
|
|
104
126
|
hash: op.tx.hash,
|
|
105
127
|
accountId,
|
|
106
128
|
type: opType,
|
|
107
|
-
value
|
|
108
|
-
op.asset.type === "native" && ["OUT", "FEES", "DELEGATE", "UNDELEGATE"].includes(opType)
|
|
109
|
-
? new BigNumber(op.value.toString()).plus(bnFees)
|
|
110
|
-
: new BigNumber(op.value.toString()),
|
|
129
|
+
value,
|
|
111
130
|
fee: bnFees,
|
|
112
131
|
blockHash: op.tx.block.hash,
|
|
113
132
|
blockHeight: op.tx.block.height,
|
|
114
133
|
senders: extra.parentSenders ?? op.senders,
|
|
115
134
|
recipients: extra.parentRecipients ?? op.recipients,
|
|
116
135
|
date: op.tx.date,
|
|
117
|
-
transactionSequenceNumber: op.details?.sequence
|
|
118
|
-
|
|
136
|
+
transactionSequenceNumber: op.details?.sequence
|
|
137
|
+
? new BigNumber(op.details?.sequence.toString())
|
|
138
|
+
: undefined,
|
|
139
|
+
hasFailed,
|
|
119
140
|
extra,
|
|
120
141
|
};
|
|
121
142
|
|
|
@@ -189,6 +210,10 @@ export function transactionToIntent(
|
|
|
189
210
|
data: Buffer.isBuffer(transaction.data)
|
|
190
211
|
? { type: "buffer", value: transaction.data }
|
|
191
212
|
: { type: "none" },
|
|
213
|
+
sequence:
|
|
214
|
+
transaction.nonce !== null && transaction.nonce !== undefined
|
|
215
|
+
? BigInt(transaction.nonce.toString())
|
|
216
|
+
: undefined,
|
|
192
217
|
};
|
|
193
218
|
if (transaction.assetReference && transaction.assetOwner) {
|
|
194
219
|
const { subAccountId } = transaction;
|
|
@@ -216,10 +241,114 @@ export function transactionToIntent(
|
|
|
216
241
|
return res;
|
|
217
242
|
}
|
|
218
243
|
|
|
244
|
+
function toFeeDataRaw(data: FeeData): FeeDataRaw {
|
|
245
|
+
return {
|
|
246
|
+
gasPrice: data.gasPrice?.toFixed() ?? null,
|
|
247
|
+
maxFeePerGas: data.maxFeePerGas?.toFixed() ?? null,
|
|
248
|
+
maxPriorityFeePerGas: data.maxPriorityFeePerGas?.toFixed() ?? null,
|
|
249
|
+
nextBaseFee: data.nextBaseFee?.toFixed() ?? null,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function toGasOptionRaw(options: GasOptions): GasOptionsRaw {
|
|
254
|
+
return {
|
|
255
|
+
fast: toFeeDataRaw(options.fast),
|
|
256
|
+
medium: toFeeDataRaw(options.medium),
|
|
257
|
+
slow: toFeeDataRaw(options.slow),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function toGenericTransactionRaw(transaction: GenericTransaction): GenericTransactionRaw {
|
|
262
|
+
const raw: GenericTransactionRaw = {
|
|
263
|
+
amount: transaction.amount.toString(),
|
|
264
|
+
recipient: transaction.recipient,
|
|
265
|
+
family: transaction.family,
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
if ("useAllAmount" in transaction) {
|
|
269
|
+
raw.useAllAmount = transaction.useAllAmount;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const stringFieldsToPropagate = [
|
|
273
|
+
"memoType",
|
|
274
|
+
"memoValue",
|
|
275
|
+
"assetReference",
|
|
276
|
+
"assetOwner",
|
|
277
|
+
] as const;
|
|
278
|
+
for (const field of stringFieldsToPropagate) {
|
|
279
|
+
if (field in transaction) {
|
|
280
|
+
raw[field] = transaction[field];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const numberFieldsToPropagate = ["tag", "type", "chainId"] as const;
|
|
285
|
+
for (const field of numberFieldsToPropagate) {
|
|
286
|
+
if (field in transaction) {
|
|
287
|
+
raw[field] = transaction[field];
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const bigNumberFieldsToPropagate = [
|
|
292
|
+
"fees",
|
|
293
|
+
"storageLimit",
|
|
294
|
+
"nonce",
|
|
295
|
+
"gasLimit",
|
|
296
|
+
"gasPrice",
|
|
297
|
+
"maxFeePerGas",
|
|
298
|
+
"maxPriorityFeePerGas",
|
|
299
|
+
] as const;
|
|
300
|
+
for (const field of bigNumberFieldsToPropagate) {
|
|
301
|
+
if (field in transaction) {
|
|
302
|
+
raw[field] = transaction[field]?.toFixed();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if ("customFees" in transaction) {
|
|
307
|
+
raw.customFees =
|
|
308
|
+
transaction.customFees && "fees" in transaction.customFees.parameters
|
|
309
|
+
? {
|
|
310
|
+
parameters: { fees: transaction.customFees.parameters.fees?.toFixed() },
|
|
311
|
+
}
|
|
312
|
+
: { parameters: {} };
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if ("feesStrategy" in transaction) {
|
|
316
|
+
raw.feesStrategy = transaction.feesStrategy;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if ("mode" in transaction) {
|
|
320
|
+
raw.mode = transaction.mode;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if ("feeCustomUnit" in transaction) {
|
|
324
|
+
raw.feeCustomUnit = transaction.feeCustomUnit;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if ("data" in transaction) {
|
|
328
|
+
raw.data = transaction.data?.toString("hex");
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if ("networkInfo" in transaction) {
|
|
332
|
+
raw.networkInfo = transaction.networkInfo && {
|
|
333
|
+
fees: transaction.networkInfo.fees.toFixed(),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if ("gasOptions" in transaction) {
|
|
338
|
+
raw.gasOptions = transaction.gasOptions && toGasOptionRaw(transaction.gasOptions);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if ("recipientDomain" in transaction) {
|
|
342
|
+
raw.recipientDomain = transaction.recipientDomain;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return raw;
|
|
346
|
+
}
|
|
347
|
+
|
|
219
348
|
export const buildOptimisticOperation = (
|
|
220
349
|
account: Account,
|
|
221
350
|
transaction: GenericTransaction,
|
|
222
|
-
sequenceNumber?:
|
|
351
|
+
sequenceNumber?: bigint,
|
|
223
352
|
): Operation => {
|
|
224
353
|
let type: OperationType;
|
|
225
354
|
switch (transaction.mode) {
|
|
@@ -242,6 +371,7 @@ export const buildOptimisticOperation = (
|
|
|
242
371
|
const { subAccountId } = transaction;
|
|
243
372
|
const { subAccounts } = account;
|
|
244
373
|
const parentType = subAccountId ? "FEES" : type;
|
|
374
|
+
const tokenAccount = subAccountId ? subAccounts?.find(ta => ta.id === subAccountId) : null;
|
|
245
375
|
|
|
246
376
|
const operation: Operation = {
|
|
247
377
|
id: encodeOperationId(account.id, "", parentType),
|
|
@@ -253,9 +383,16 @@ export const buildOptimisticOperation = (
|
|
|
253
383
|
blockHeight: null,
|
|
254
384
|
senders: [account.freshAddress.toString()],
|
|
255
385
|
recipients: [transaction.recipient],
|
|
256
|
-
transactionSequenceNumber: sequenceNumber ?? 0,
|
|
386
|
+
transactionSequenceNumber: new BigNumber(sequenceNumber?.toString() ?? 0),
|
|
257
387
|
accountId: account.id,
|
|
258
388
|
date: new Date(),
|
|
389
|
+
transactionRaw: toGenericTransactionRaw({
|
|
390
|
+
...transaction,
|
|
391
|
+
nonce: sequenceNumber !== undefined ? new BigNumber(sequenceNumber.toString()) : undefined,
|
|
392
|
+
...(tokenAccount
|
|
393
|
+
? { recipient: tokenAccount.token.contractAddress, amount: new BigNumber(0) }
|
|
394
|
+
: {}),
|
|
395
|
+
}),
|
|
259
396
|
extra: {
|
|
260
397
|
ledgerOpType: type,
|
|
261
398
|
blockTime: new Date(),
|
|
@@ -263,7 +400,6 @@ export const buildOptimisticOperation = (
|
|
|
263
400
|
},
|
|
264
401
|
};
|
|
265
402
|
|
|
266
|
-
const tokenAccount = subAccountId ? subAccounts?.find(ta => ta.id === subAccountId) : null;
|
|
267
403
|
if (tokenAccount && subAccountId) {
|
|
268
404
|
operation.subOperations = [
|
|
269
405
|
{
|
|
@@ -278,6 +414,11 @@ export const buildOptimisticOperation = (
|
|
|
278
414
|
recipients: [transaction.recipient],
|
|
279
415
|
accountId: subAccountId,
|
|
280
416
|
date: new Date(),
|
|
417
|
+
transactionRaw: toGenericTransactionRaw({
|
|
418
|
+
...transaction,
|
|
419
|
+
nonce:
|
|
420
|
+
sequenceNumber !== undefined ? new BigNumber(sequenceNumber.toString()) : undefined,
|
|
421
|
+
}),
|
|
281
422
|
extra: {
|
|
282
423
|
ledgerOpType: type,
|
|
283
424
|
},
|
package/src/bridge/index.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { ScanAccountEvent, ScanAccountEventRaw } from "@ledgerhq/types-live
|
|
|
2
2
|
import { fromAccountRaw, toAccountRaw } from "../account";
|
|
3
3
|
export { getCurrencyBridge, getAccountBridge } from "./impl";
|
|
4
4
|
|
|
5
|
-
export function fromScanAccountEventRaw(raw: ScanAccountEventRaw): ScanAccountEvent {
|
|
5
|
+
export async function fromScanAccountEventRaw(raw: ScanAccountEventRaw): Promise<ScanAccountEvent> {
|
|
6
6
|
switch (raw.type) {
|
|
7
7
|
case "discovered":
|
|
8
8
|
return {
|
|
9
9
|
type: raw.type,
|
|
10
|
-
account: fromAccountRaw(raw.account),
|
|
10
|
+
account: await fromAccountRaw(raw.account),
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
default:
|
|
@@ -31,12 +31,15 @@ describe("useBridgeTransaction", () => {
|
|
|
31
31
|
const mainAccount = genAccount("mocked-account-1", { currency: BTC });
|
|
32
32
|
const { result } = renderHook(() => useBridgeTransaction(() => ({ account: mainAccount })));
|
|
33
33
|
|
|
34
|
-
await waitFor(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
await waitFor(
|
|
35
|
+
() => {
|
|
36
|
+
expect(result.current.bridgePending).toBeFalsy();
|
|
37
|
+
expect(result.current.bridgeError).toBeFalsy();
|
|
38
|
+
expect(result.current.transaction).not.toBeFalsy();
|
|
39
|
+
expect(result.current.account).not.toBeFalsy();
|
|
40
|
+
},
|
|
41
|
+
{ timeout: 10000 },
|
|
42
|
+
);
|
|
40
43
|
});
|
|
41
44
|
|
|
42
45
|
test("bridgeError go through", async () => {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
|
2
|
+
import { initializeLegacyTokens } from "@ledgerhq/cryptoassets/legacy/legacy-data";
|
|
3
|
+
import { addTokens as addTokensLegacy } from "@ledgerhq/cryptoassets/legacy/legacy-utils";
|
|
2
4
|
import { inferCryptoCurrencyIcon } from "./cryptoIcons";
|
|
3
|
-
import {
|
|
5
|
+
import { getCryptoAssetsStore } from "../bridge/crypto-assets/index";
|
|
6
|
+
|
|
7
|
+
beforeAll(() => {
|
|
8
|
+
initializeLegacyTokens(addTokensLegacy);
|
|
9
|
+
});
|
|
4
10
|
|
|
5
11
|
describe("inferCryptoCurrencyIcon", () => {
|
|
6
12
|
const registryMock = {
|
|
@@ -22,9 +28,8 @@ describe("inferCryptoCurrencyIcon", () => {
|
|
|
22
28
|
expect(inferCryptoCurrencyIcon(registryMock, getCryptoCurrencyById("arbitrum"))).toBe(3);
|
|
23
29
|
});
|
|
24
30
|
|
|
25
|
-
test("USDT is inferred properly", () => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
expect(inferCryptoCurrencyIcon(registryMock, usdt)).toBe(4);
|
|
31
|
+
test("USDT is inferred properly", async () => {
|
|
32
|
+
const token = await getCryptoAssetsStore().findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
33
|
+
expect(inferCryptoCurrencyIcon(registryMock, token!)).toBe(4);
|
|
29
34
|
});
|
|
30
35
|
});
|
package/src/currencies/index.ts
CHANGED
|
@@ -4,9 +4,12 @@ import { getBTCValues } from "@ledgerhq/live-countervalues/mock";
|
|
|
4
4
|
import { CURRENCIES_LIST, IDS } from "./mock";
|
|
5
5
|
import { findCryptoCurrencyByTicker, findFiatCurrencyByTicker } from "@ledgerhq/cryptoassets/index";
|
|
6
6
|
import { getCryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/index";
|
|
7
|
-
import { legacyCryptoAssetsStore } from "@ledgerhq/cryptoassets/
|
|
7
|
+
import { legacyCryptoAssetsStore } from "@ledgerhq/cryptoassets/legacy/legacy-store";
|
|
8
|
+
import { initializeLegacyTokens } from "@ledgerhq/cryptoassets/legacy/legacy-data";
|
|
9
|
+
import { addTokens } from "@ledgerhq/cryptoassets/legacy/legacy-utils";
|
|
8
10
|
import { setup } from "../bridge/impl";
|
|
9
11
|
|
|
12
|
+
initializeLegacyTokens(addTokens);
|
|
10
13
|
setup(legacyCryptoAssetsStore);
|
|
11
14
|
|
|
12
15
|
test("sortCurrenciesByIds snapshot", async () => {
|
|
@@ -24,6 +24,14 @@ const { data, isLoading, error } = useAssetsData({
|
|
|
24
24
|
search: "bitcoin",
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
// You can control the fetching with the skip parameter
|
|
28
|
+
const { data, isLoading, error } = useAssetsData({
|
|
29
|
+
product: "llm",
|
|
30
|
+
version: "1.0.0",
|
|
31
|
+
search: "bitcoin",
|
|
32
|
+
skip: true, // true: no fetch
|
|
33
|
+
});
|
|
34
|
+
|
|
27
35
|
// Get interest rates for currencies
|
|
28
36
|
const currencies = [bitcoinCurrency, ethereumCurrency];
|
|
29
37
|
const interestRates = useInterestRatesByCurrencies(currencies);
|
|
@@ -79,6 +87,35 @@ const MarketComponent = () => {
|
|
|
79
87
|
};
|
|
80
88
|
```
|
|
81
89
|
|
|
90
|
+
### Lazy Currency Fetching
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { useLazyLedgerCurrency } from '@ledgerhq/live-common/dada-client/hooks/useLazyLedgerCurrency';
|
|
94
|
+
|
|
95
|
+
const CurrencyComponent = ({ currency }) => {
|
|
96
|
+
const { getLedgerCurrency } = useLazyLedgerCurrency(
|
|
97
|
+
{
|
|
98
|
+
product: 'lld',
|
|
99
|
+
version: '2.0.0',
|
|
100
|
+
},
|
|
101
|
+
currency
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const handleFetchCurrency = async () => {
|
|
105
|
+
const ledgerCurrency = await getLedgerCurrency();
|
|
106
|
+
if (ledgerCurrency) {
|
|
107
|
+
console.log('Ledger currency data:', ledgerCurrency);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<button onClick={handleFetchCurrency}>
|
|
113
|
+
Fetch Currency Data
|
|
114
|
+
</button>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
```
|
|
118
|
+
|
|
82
119
|
## API Reference
|
|
83
120
|
|
|
84
121
|
### Hooks
|
|
@@ -87,6 +124,7 @@ const MarketComponent = () => {
|
|
|
87
124
|
- `useAssetData()` - Fetch specific asset data
|
|
88
125
|
- `useInterestRatesByCurrencies()` - Get interest rates for currencies
|
|
89
126
|
- `useMarketByCurrencies()` - Get market data for currencies
|
|
127
|
+
- `useLazyLedgerCurrency()` - Lazy hook to fetch ledger currency data on demand
|
|
90
128
|
|
|
91
129
|
## Integration
|
|
92
130
|
|