@ledgerhq/live-common 34.53.0-nightly.20251120023735 → 34.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +4 -0
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/environment.js +0 -3
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +10 -12
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/currencies/helpers.d.ts +3 -1
- package/lib/currencies/helpers.d.ts.map +1 -1
- package/lib/currencies/helpers.js +27 -1
- package/lib/currencies/helpers.js.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts +0 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +0 -1
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/deposit/helper.d.ts +8 -0
- package/lib/deposit/helper.d.ts.map +1 -0
- package/lib/deposit/helper.js +125 -0
- package/lib/deposit/helper.js.map +1 -0
- package/lib/deposit/index.d.ts +3 -0
- package/lib/deposit/index.d.ts.map +1 -0
- package/lib/deposit/index.js +6 -0
- package/lib/deposit/index.js.map +1 -0
- package/lib/deposit/mock.d.ts +75 -0
- package/lib/deposit/mock.d.ts.map +1 -0
- package/lib/deposit/mock.js +15111 -0
- package/lib/deposit/mock.js.map +1 -0
- package/lib/deposit/type.d.ts +17 -0
- package/lib/deposit/type.d.ts.map +1 -1
- package/lib/deposit/type.js.map +1 -1
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts +3 -0
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -0
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.js +40 -0
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -0
- package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts +1 -2
- package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
- package/lib/deviceSDK/hooks/useBatteryStatuses.js +2 -4
- package/lib/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
- package/lib/deviceSDK/tasks/core.d.ts +1 -1
- package/lib/deviceSDK/tasks/core.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/core.js +1 -1
- package/lib/deviceSDK/tasks/core.js.map +1 -1
- package/lib/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/getDeviceInfo.js +0 -2
- package/lib/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
- package/lib/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/getLatestFirmware.js +2 -2
- package/lib/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
- package/lib/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/updateFirmware.js +0 -1
- package/lib/deviceSDK/tasks/updateFirmware.js.map +1 -1
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +3 -0
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +1 -0
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js +26 -0
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +1 -0
- package/lib/e2e/enum/Account.d.ts +1 -0
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +1 -0
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +1 -0
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +6 -2
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/families/algorand.d.ts +1 -1
- package/lib/e2e/families/algorand.d.ts.map +1 -1
- package/lib/e2e/families/algorand.js +5 -5
- package/lib/e2e/families/algorand.js.map +1 -1
- package/lib/e2e/families/aptos.d.ts +2 -2
- package/lib/e2e/families/aptos.d.ts.map +1 -1
- package/lib/e2e/families/aptos.js +9 -9
- package/lib/e2e/families/aptos.js.map +1 -1
- package/lib/e2e/families/bitcoin.d.ts +2 -2
- package/lib/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib/e2e/families/bitcoin.js +11 -11
- package/lib/e2e/families/bitcoin.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts +0 -6
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +26 -28
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/celo.d.ts +1 -1
- package/lib/e2e/families/celo.d.ts.map +1 -1
- package/lib/e2e/families/celo.js +5 -5
- package/lib/e2e/families/celo.js.map +1 -1
- package/lib/e2e/families/cosmos.d.ts +2 -2
- package/lib/e2e/families/cosmos.d.ts.map +1 -1
- package/lib/e2e/families/cosmos.js +9 -9
- package/lib/e2e/families/cosmos.js.map +1 -1
- package/lib/e2e/families/evm.d.ts +0 -2
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +12 -13
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/hedera.d.ts +1 -1
- package/lib/e2e/families/hedera.d.ts.map +1 -1
- package/lib/e2e/families/hedera.js +5 -5
- package/lib/e2e/families/hedera.js.map +1 -1
- package/lib/e2e/families/kaspa.d.ts +2 -2
- package/lib/e2e/families/kaspa.d.ts.map +1 -1
- package/lib/e2e/families/kaspa.js +9 -9
- package/lib/e2e/families/kaspa.js.map +1 -1
- package/lib/e2e/families/multiversX.d.ts +1 -1
- package/lib/e2e/families/multiversX.d.ts.map +1 -1
- package/lib/e2e/families/multiversX.js +5 -5
- package/lib/e2e/families/multiversX.js.map +1 -1
- package/lib/e2e/families/near.d.ts +1 -1
- package/lib/e2e/families/near.d.ts.map +1 -1
- package/lib/e2e/families/near.js +6 -6
- package/lib/e2e/families/near.js.map +1 -1
- package/lib/e2e/families/osmosis.d.ts +1 -1
- package/lib/e2e/families/osmosis.d.ts.map +1 -1
- package/lib/e2e/families/osmosis.js +5 -5
- package/lib/e2e/families/osmosis.js.map +1 -1
- package/lib/e2e/families/polkadot.d.ts +1 -1
- package/lib/e2e/families/polkadot.d.ts.map +1 -1
- package/lib/e2e/families/polkadot.js +5 -5
- package/lib/e2e/families/polkadot.js.map +1 -1
- package/lib/e2e/families/solana.d.ts +2 -2
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +9 -9
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/families/stellar.d.ts +1 -1
- package/lib/e2e/families/stellar.d.ts.map +1 -1
- package/lib/e2e/families/stellar.js +5 -5
- package/lib/e2e/families/stellar.js.map +1 -1
- package/lib/e2e/families/sui.d.ts +1 -1
- package/lib/e2e/families/sui.d.ts.map +1 -1
- package/lib/e2e/families/sui.js +5 -5
- package/lib/e2e/families/sui.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +8 -7
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/families/tron.d.ts +1 -1
- package/lib/e2e/families/tron.d.ts.map +1 -1
- package/lib/e2e/families/tron.js +5 -5
- package/lib/e2e/families/tron.js.map +1 -1
- package/lib/e2e/families/xrp.d.ts +1 -1
- package/lib/e2e/families/xrp.d.ts.map +1 -1
- package/lib/e2e/families/xrp.js +5 -5
- package/lib/e2e/families/xrp.js.map +1 -1
- package/lib/e2e/index.d.ts +0 -15
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +11 -11
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +78 -78
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/exchange/providers/swap.d.ts +0 -1
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.js +1 -5
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js +3 -2
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.js +10 -15
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +0 -1
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +0 -49
- package/lib/families/evm/config.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +0 -3
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +0 -6
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/market/hooks/useMarketDataProvider.js +0 -1
- package/lib/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib/market/utils/types.d.ts +0 -1
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/market/utils/types.js.map +1 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +22 -0
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +1 -0
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +41 -0
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +0 -11
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts +5 -1
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.js +2 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.d.ts +10 -0
- package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
- package/lib/modularDrawer/utils/currencyUtils.js +74 -0
- package/lib/modularDrawer/utils/currencyUtils.js.map +1 -0
- package/lib/modularDrawer/utils/{groupCurrenciesByAsset.d.ts → groupCurrenciesByProvider.d.ts} +2 -2
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.js +21 -0
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.js.map +1 -0
- package/lib/modularDrawer/utils/index.d.ts +1 -1
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +3 -3
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/modularDrawer/utils/type.d.ts +5 -0
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/platform/filters.d.ts +2 -1
- package/lib/platform/filters.d.ts.map +1 -1
- package/lib/platform/filters.js +17 -1
- package/lib/platform/filters.js.map +1 -1
- package/lib/platform/helpers.d.ts +5 -1
- package/lib/platform/helpers.d.ts.map +1 -1
- package/lib/platform/helpers.js +33 -1
- package/lib/platform/helpers.js.map +1 -1
- package/lib/platform/react.d.ts +3 -2
- package/lib/platform/react.d.ts.map +1 -1
- package/lib/platform/react.js +16 -66
- package/lib/platform/react.js.map +1 -1
- package/lib/platform/types.d.ts +3 -3
- package/lib/platform/types.d.ts.map +1 -1
- package/lib/postOnboarding/reducer.d.ts +0 -2
- package/lib/postOnboarding/reducer.d.ts.map +1 -1
- package/lib/utils/getAccountTuplesForCurrency.d.ts +1 -1
- package/lib/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
- package/lib/utils/getAccountTuplesForCurrency.js +3 -2
- package/lib/utils/getAccountTuplesForCurrency.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +4 -5
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/converters.d.ts +0 -1
- package/lib/wallet-api/converters.d.ts.map +1 -1
- package/lib/wallet-api/converters.js +2 -7
- package/lib/wallet-api/converters.js.map +1 -1
- package/lib/wallet-api/react.d.ts +11 -6
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +135 -293
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/tracking.d.ts +0 -6
- package/lib/wallet-api/tracking.d.ts.map +1 -1
- package/lib/wallet-api/tracking.js +0 -20
- package/lib/wallet-api/tracking.js.map +1 -1
- package/lib/wallet-api/types.d.ts +0 -3
- package/lib/wallet-api/types.d.ts.map +1 -1
- package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib/wallet-api/useDappLogic.js +80 -65
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts +0 -6
- package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
- package/lib/wallet-api/utils/deriveAccountIdForManifest.js +3 -13
- package/lib/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js +4 -0
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +0 -3
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +11 -13
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/currencies/helpers.d.ts +3 -1
- package/lib-es/currencies/helpers.d.ts.map +1 -1
- package/lib-es/currencies/helpers.js +24 -0
- package/lib-es/currencies/helpers.js.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +0 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +0 -1
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/deposit/helper.d.ts +8 -0
- package/lib-es/deposit/helper.d.ts.map +1 -0
- package/lib-es/deposit/helper.js +117 -0
- package/lib-es/deposit/helper.js.map +1 -0
- package/lib-es/deposit/index.d.ts +3 -0
- package/lib-es/deposit/index.d.ts.map +1 -0
- package/lib-es/deposit/index.js +3 -0
- package/lib-es/deposit/index.js.map +1 -0
- package/lib-es/deposit/mock.d.ts +75 -0
- package/lib-es/deposit/mock.d.ts.map +1 -0
- package/lib-es/deposit/mock.js +15108 -0
- package/lib-es/deposit/mock.js.map +1 -0
- package/lib-es/deposit/type.d.ts +17 -0
- package/lib-es/deposit/type.d.ts.map +1 -1
- package/lib-es/deposit/type.js.map +1 -1
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts +3 -0
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -0
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js +36 -0
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -0
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts +1 -2
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.js +2 -4
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
- package/lib-es/deviceSDK/tasks/core.d.ts +1 -1
- package/lib-es/deviceSDK/tasks/core.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/core.js +1 -1
- package/lib-es/deviceSDK/tasks/core.js.map +1 -1
- package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/getDeviceInfo.js +0 -2
- package/lib-es/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
- package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/getLatestFirmware.js +2 -2
- package/lib-es/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
- package/lib-es/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/updateFirmware.js +1 -2
- package/lib-es/deviceSDK/tasks/updateFirmware.js.map +1 -1
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +3 -0
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +1 -0
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js +18 -0
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +1 -0
- package/lib-es/e2e/enum/Account.d.ts +1 -0
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +1 -0
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +1 -0
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +6 -2
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/families/algorand.d.ts +1 -1
- package/lib-es/e2e/families/algorand.d.ts.map +1 -1
- package/lib-es/e2e/families/algorand.js +4 -5
- package/lib-es/e2e/families/algorand.js.map +1 -1
- package/lib-es/e2e/families/aptos.d.ts +2 -2
- package/lib-es/e2e/families/aptos.d.ts.map +1 -1
- package/lib-es/e2e/families/aptos.js +7 -9
- package/lib-es/e2e/families/aptos.js.map +1 -1
- package/lib-es/e2e/families/bitcoin.d.ts +2 -2
- package/lib-es/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib-es/e2e/families/bitcoin.js +9 -11
- package/lib-es/e2e/families/bitcoin.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts +0 -6
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +21 -23
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/celo.d.ts +1 -1
- package/lib-es/e2e/families/celo.d.ts.map +1 -1
- package/lib-es/e2e/families/celo.js +4 -5
- package/lib-es/e2e/families/celo.js.map +1 -1
- package/lib-es/e2e/families/cosmos.d.ts +2 -2
- package/lib-es/e2e/families/cosmos.d.ts.map +1 -1
- package/lib-es/e2e/families/cosmos.js +7 -9
- package/lib-es/e2e/families/cosmos.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts +0 -2
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +9 -10
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/hedera.d.ts +1 -1
- package/lib-es/e2e/families/hedera.d.ts.map +1 -1
- package/lib-es/e2e/families/hedera.js +4 -5
- package/lib-es/e2e/families/hedera.js.map +1 -1
- package/lib-es/e2e/families/kaspa.d.ts +2 -2
- package/lib-es/e2e/families/kaspa.d.ts.map +1 -1
- package/lib-es/e2e/families/kaspa.js +7 -9
- package/lib-es/e2e/families/kaspa.js.map +1 -1
- package/lib-es/e2e/families/multiversX.d.ts +1 -1
- package/lib-es/e2e/families/multiversX.d.ts.map +1 -1
- package/lib-es/e2e/families/multiversX.js +4 -5
- package/lib-es/e2e/families/multiversX.js.map +1 -1
- package/lib-es/e2e/families/near.d.ts +1 -1
- package/lib-es/e2e/families/near.d.ts.map +1 -1
- package/lib-es/e2e/families/near.js +5 -6
- package/lib-es/e2e/families/near.js.map +1 -1
- package/lib-es/e2e/families/osmosis.d.ts +1 -1
- package/lib-es/e2e/families/osmosis.d.ts.map +1 -1
- package/lib-es/e2e/families/osmosis.js +4 -5
- package/lib-es/e2e/families/osmosis.js.map +1 -1
- package/lib-es/e2e/families/polkadot.d.ts +1 -1
- package/lib-es/e2e/families/polkadot.d.ts.map +1 -1
- package/lib-es/e2e/families/polkadot.js +4 -5
- package/lib-es/e2e/families/polkadot.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts +2 -2
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +7 -9
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/families/stellar.d.ts +1 -1
- package/lib-es/e2e/families/stellar.d.ts.map +1 -1
- package/lib-es/e2e/families/stellar.js +4 -5
- package/lib-es/e2e/families/stellar.js.map +1 -1
- package/lib-es/e2e/families/sui.d.ts +1 -1
- package/lib-es/e2e/families/sui.d.ts.map +1 -1
- package/lib-es/e2e/families/sui.js +4 -5
- package/lib-es/e2e/families/sui.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +8 -8
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/families/tron.d.ts +1 -1
- package/lib-es/e2e/families/tron.d.ts.map +1 -1
- package/lib-es/e2e/families/tron.js +4 -5
- package/lib-es/e2e/families/tron.js.map +1 -1
- package/lib-es/e2e/families/xrp.d.ts +1 -1
- package/lib-es/e2e/families/xrp.d.ts.map +1 -1
- package/lib-es/e2e/families/xrp.js +4 -5
- package/lib-es/e2e/families/xrp.js.map +1 -1
- package/lib-es/e2e/index.d.ts +0 -15
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +11 -11
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +43 -54
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/exchange/providers/swap.d.ts +0 -1
- package/lib-es/exchange/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.js +0 -3
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js +3 -2
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js +12 -17
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +0 -1
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +0 -49
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +0 -3
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +0 -6
- package/lib-es/featureFlags/defaultFeatures.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/market/hooks/useMarketDataProvider.js +0 -1
- package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +0 -1
- package/lib-es/market/utils/types.d.ts.map +1 -1
- package/lib-es/market/utils/types.js.map +1 -1
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +22 -0
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +1 -0
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +38 -0
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +0 -11
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts +5 -1
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +2 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts +10 -0
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/currencyUtils.js +65 -0
- package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -0
- package/lib-es/modularDrawer/utils/{groupCurrenciesByAsset.d.ts → groupCurrenciesByProvider.d.ts} +2 -2
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/{groupCurrenciesByAsset.js → groupCurrenciesByProvider.js} +6 -6
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.js.map +1 -0
- package/lib-es/modularDrawer/utils/index.d.ts +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +1 -1
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/utils/type.d.ts +5 -0
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/platform/filters.d.ts +2 -1
- package/lib-es/platform/filters.d.ts.map +1 -1
- package/lib-es/platform/filters.js +15 -0
- package/lib-es/platform/filters.js.map +1 -1
- package/lib-es/platform/helpers.d.ts +5 -1
- package/lib-es/platform/helpers.d.ts.map +1 -1
- package/lib-es/platform/helpers.js +30 -1
- package/lib-es/platform/helpers.js.map +1 -1
- package/lib-es/platform/react.d.ts +3 -2
- package/lib-es/platform/react.d.ts.map +1 -1
- package/lib-es/platform/react.js +16 -67
- package/lib-es/platform/react.js.map +1 -1
- package/lib-es/platform/types.d.ts +3 -3
- package/lib-es/platform/types.d.ts.map +1 -1
- package/lib-es/postOnboarding/reducer.d.ts +0 -2
- package/lib-es/postOnboarding/reducer.d.ts.map +1 -1
- package/lib-es/utils/getAccountTuplesForCurrency.d.ts +1 -1
- package/lib-es/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
- package/lib-es/utils/getAccountTuplesForCurrency.js +3 -2
- package/lib-es/utils/getAccountTuplesForCurrency.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +4 -5
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/converters.d.ts +0 -1
- package/lib-es/wallet-api/converters.d.ts.map +1 -1
- package/lib-es/wallet-api/converters.js +1 -5
- package/lib-es/wallet-api/converters.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +11 -6
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +131 -291
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/tracking.d.ts +0 -6
- package/lib-es/wallet-api/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/tracking.js +0 -20
- package/lib-es/wallet-api/tracking.js.map +1 -1
- package/lib-es/wallet-api/types.d.ts +0 -3
- package/lib-es/wallet-api/types.d.ts.map +1 -1
- package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib-es/wallet-api/useDappLogic.js +77 -62
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts +0 -6
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js +2 -11
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
- package/package.json +58 -59
- package/src/__tests__/migration/account-migration.ts +0 -3
- package/src/__tests__/test-helpers/bridge.ts +2 -0
- package/src/__tests__/test-helpers/environment.ts +0 -3
- package/src/bridge/generic-alpaca/getAccountShape.ts +12 -15
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +101 -142
- package/src/currencies/helpers.test.ts +20 -0
- package/src/currencies/helpers.ts +42 -1
- package/src/dada-client/hooks/useAssetsData.ts +0 -1
- package/src/deposit/deposit.integration.test.ts +88 -0
- package/src/deposit/deposit.test.ts +684 -0
- package/src/deposit/helper.ts +143 -0
- package/src/deposit/index.ts +3 -0
- package/src/deposit/mock.ts +15112 -0
- package/src/deposit/type.ts +21 -0
- package/src/deposit/useGroupedCurrenciesByProvider.hook.ts +46 -0
- package/src/deviceSDK/hooks/useBatteryStatuses.test.ts +1 -3
- package/src/deviceSDK/hooks/useBatteryStatuses.ts +1 -4
- package/src/deviceSDK/tasks/core.test.ts +0 -20
- package/src/deviceSDK/tasks/core.ts +1 -2
- package/src/deviceSDK/tasks/getDeviceInfo.ts +0 -2
- package/src/deviceSDK/tasks/getLatestFirmware.ts +4 -4
- package/src/deviceSDK/tasks/updateFirmware.ts +0 -2
- package/src/e2e/deviceInteraction/ButtonDeviceSimulator.ts +23 -0
- package/src/e2e/enum/Account.ts +6 -0
- package/src/e2e/enum/Currency.ts +6 -2
- package/src/e2e/families/algorand.ts +13 -20
- package/src/e2e/families/aptos.ts +16 -28
- package/src/e2e/families/bitcoin.ts +39 -53
- package/src/e2e/families/cardano.ts +36 -47
- package/src/e2e/families/celo.ts +12 -18
- package/src/e2e/families/cosmos.ts +23 -35
- package/src/e2e/families/evm.ts +13 -24
- package/src/e2e/families/hedera.ts +4 -6
- package/src/e2e/families/kaspa.ts +16 -28
- package/src/e2e/families/multiversX.ts +10 -16
- package/src/e2e/families/near.ts +17 -23
- package/src/e2e/families/osmosis.ts +13 -19
- package/src/e2e/families/polkadot.ts +13 -19
- package/src/e2e/families/solana.ts +23 -35
- package/src/e2e/families/stellar.ts +13 -18
- package/src/e2e/families/sui.ts +9 -15
- package/src/e2e/families/tezos.ts +18 -25
- package/src/e2e/families/tron.ts +13 -19
- package/src/e2e/families/xrp.ts +13 -19
- package/src/e2e/speculos.ts +140 -168
- package/src/exchange/providers/swap.ts +0 -4
- package/src/exchange/swap/hooks/v5/useFetchCurrencyAll.ts +3 -2
- package/src/exchange/swap/hooks/v5/useFilteredProviders.ts +12 -37
- package/src/families/canton/bridge/mock.ts +0 -1
- package/src/families/evm/config.ts +0 -49
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +12 -84
- package/src/featureFlags/defaultFeatures.ts +0 -6
- package/src/market/hooks/useMarketDataProvider.ts +0 -1
- package/src/market/utils/types.ts +0 -1
- package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +49 -0
- package/src/modularDrawer/hooks/__test__/useAssetAccountCounts.test.ts +5 -0
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +0 -11
- package/src/modularDrawer/hooks/useNetworkAccountCounts.tsx +6 -1
- package/src/modularDrawer/modules/__test__/createAssetConfiguration.test.tsx +2 -2
- package/src/modularDrawer/modules/__test__/createNetworkConfiguration.test.ts +342 -0
- package/src/modularDrawer/modules/createNetworkConfiguration.ts +2 -1
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +126 -0
- package/src/modularDrawer/utils/currencyUtils.ts +95 -0
- package/src/modularDrawer/utils/{groupCurrenciesByAsset.ts → groupCurrenciesByProvider.ts} +5 -5
- package/src/modularDrawer/utils/index.ts +1 -1
- package/src/modularDrawer/utils/type.ts +5 -0
- package/src/platform/filters.ts +23 -1
- package/src/platform/helpers.ts +49 -2
- package/src/platform/react.ts +22 -86
- package/src/platform/types.ts +1 -1
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +30 -0
- package/src/utils/getAccountTuplesForCurrency.ts +6 -1
- package/src/wallet-api/Exchange/server.test.ts +5 -0
- package/src/wallet-api/Exchange/server.ts +6 -7
- package/src/wallet-api/converters.ts +1 -6
- package/src/wallet-api/react.ts +137 -312
- package/src/wallet-api/tracking.ts +0 -22
- package/src/wallet-api/types.ts +0 -5
- package/src/wallet-api/useDappLogic.ts +106 -91
- package/src/wallet-api/utils/deriveAccountIdForManifest.ts +2 -14
- package/lib/device/use-cases/getDeviceHasBattery.d.ts +0 -2
- package/lib/device/use-cases/getDeviceHasBattery.d.ts.map +0 -1
- package/lib/device/use-cases/getDeviceHasBattery.js +0 -6
- package/lib/device/use-cases/getDeviceHasBattery.js.map +0 -1
- package/lib/e2e/deviceInteraction/DeviceController.d.ts +0 -41
- package/lib/e2e/deviceInteraction/DeviceController.d.ts.map +0 -1
- package/lib/e2e/deviceInteraction/DeviceController.js +0 -68
- package/lib/e2e/deviceInteraction/DeviceController.js.map +0 -1
- package/lib/e2e/enum/ReceiveFundsOptions.d.ts +0 -6
- package/lib/e2e/enum/ReceiveFundsOptions.d.ts.map +0 -1
- package/lib/e2e/enum/ReceiveFundsOptions.js +0 -8
- package/lib/e2e/enum/ReceiveFundsOptions.js.map +0 -1
- package/lib/families/canton/react.d.ts +0 -15
- package/lib/families/canton/react.d.ts.map +0 -1
- package/lib/families/canton/react.js +0 -14
- package/lib/families/canton/react.js.map +0 -1
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +0 -1
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.js +0 -21
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.js.map +0 -1
- package/lib-es/device/use-cases/getDeviceHasBattery.d.ts +0 -2
- package/lib-es/device/use-cases/getDeviceHasBattery.d.ts.map +0 -1
- package/lib-es/device/use-cases/getDeviceHasBattery.js +0 -2
- package/lib-es/device/use-cases/getDeviceHasBattery.js.map +0 -1
- package/lib-es/e2e/deviceInteraction/DeviceController.d.ts +0 -41
- package/lib-es/e2e/deviceInteraction/DeviceController.d.ts.map +0 -1
- package/lib-es/e2e/deviceInteraction/DeviceController.js +0 -63
- package/lib-es/e2e/deviceInteraction/DeviceController.js.map +0 -1
- package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts +0 -6
- package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts.map +0 -1
- package/lib-es/e2e/enum/ReceiveFundsOptions.js +0 -5
- package/lib-es/e2e/enum/ReceiveFundsOptions.js.map +0 -1
- package/lib-es/families/canton/react.d.ts +0 -15
- package/lib-es/families/canton/react.d.ts.map +0 -1
- package/lib-es/families/canton/react.js +0 -10
- package/lib-es/families/canton/react.js.map +0 -1
- package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.js.map +0 -1
- package/src/device/use-cases/getDeviceHasBattery.ts +0 -1
- package/src/e2e/deviceInteraction/DeviceController.ts +0 -85
- package/src/e2e/enum/ReceiveFundsOptions.ts +0 -7
- package/src/families/canton/react.ts +0 -50
- package/src/modularDrawer/utils/__tests__/groupCurrenciesByAsset.test.ts +0 -88
|
@@ -8,15 +8,16 @@ import { getAccountBridge } from "../bridge";
|
|
|
8
8
|
import { getEnv } from "@ledgerhq/live-env";
|
|
9
9
|
import network from "@ledgerhq/live-network/network";
|
|
10
10
|
import { getWalletAPITransactionSignFlowInfos } from "./converters";
|
|
11
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/index";
|
|
12
|
+
import { getCryptoAssetsStore } from "../bridge/crypto-assets/index";
|
|
11
13
|
import { prepareMessageToSign } from "../hw/signMessage/index";
|
|
12
|
-
import { CurrentAccountHistDB, UiHook } from "./react";
|
|
14
|
+
import { CurrentAccountHistDB, UiHook, usePermission } from "./react";
|
|
13
15
|
import BigNumber from "bignumber.js";
|
|
14
16
|
import { safeEncodeEIP55 } from "@ledgerhq/coin-evm/utils";
|
|
15
17
|
import { SmartWebsocket } from "./SmartWebsocket";
|
|
16
18
|
import { stripHexPrefix } from "./helpers";
|
|
17
19
|
import { getTxType } from "./utils/txTrackingHelper";
|
|
18
20
|
import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
|
|
19
|
-
import { getCryptoAssetsStore } from "../bridge/crypto-assets";
|
|
20
21
|
|
|
21
22
|
type MessageId = number | string | null;
|
|
22
23
|
|
|
@@ -87,8 +88,6 @@ export function useDappCurrentAccount(currentAccountHistDb?: CurrentAccountHistD
|
|
|
87
88
|
return { currentAccount, setCurrentAccount, setCurrentAccountHist };
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
const globCurrencies = ["**"];
|
|
91
|
-
|
|
92
91
|
function useDappAccountLogic({
|
|
93
92
|
manifest,
|
|
94
93
|
accounts,
|
|
@@ -101,7 +100,7 @@ function useDappAccountLogic({
|
|
|
101
100
|
initialAccountId?: string;
|
|
102
101
|
}) {
|
|
103
102
|
const [initialAccountSelected, setInitialAccountSelected] = useState(false);
|
|
104
|
-
const currencyIds = manifest
|
|
103
|
+
const { currencyIds } = usePermission(manifest);
|
|
105
104
|
const { currentAccount, setCurrentAccount, setCurrentAccountHist } =
|
|
106
105
|
useDappCurrentAccount(currentAccountHistDb);
|
|
107
106
|
const currentParentAccount = useMemo(() => {
|
|
@@ -435,8 +434,7 @@ export function useDappLogic({
|
|
|
435
434
|
try {
|
|
436
435
|
await new Promise<void>((resolve, reject) =>
|
|
437
436
|
uiHook["account.request"]({
|
|
438
|
-
|
|
439
|
-
areCurrenciesFiltered: true,
|
|
437
|
+
currencies: [getCryptoCurrencyById(requestedCurrency.currency)],
|
|
440
438
|
onSuccess: account => {
|
|
441
439
|
setCurrentAccountHist(manifest.id, account);
|
|
442
440
|
setCurrentAccount(account);
|
|
@@ -476,95 +474,108 @@ export function useDappLogic({
|
|
|
476
474
|
: currentParentAccount.freshAddress;
|
|
477
475
|
|
|
478
476
|
if (address.toLowerCase() === ethTX.from.toLowerCase()) {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
});
|
|
485
|
-
|
|
486
|
-
const transactionType = getTxType(signFlowInfos.liveTx as EvmTransaction);
|
|
487
|
-
|
|
488
|
-
const accountCurrencyName =
|
|
489
|
-
currentAccount.type === "TokenAccount"
|
|
490
|
-
? currentAccount.token.name
|
|
491
|
-
: currentAccount.currency.name;
|
|
492
|
-
|
|
493
|
-
const accountNetwork =
|
|
494
|
-
currentAccount.type === "TokenAccount"
|
|
495
|
-
? currentAccount.token.parentCurrency.id
|
|
496
|
-
: currentAccount.currency.id;
|
|
497
|
-
|
|
498
|
-
const token = await getCryptoAssetsStore().findTokenByAddressInCurrency(
|
|
499
|
-
tx.recipient,
|
|
500
|
-
accountNetwork,
|
|
501
|
-
);
|
|
502
|
-
|
|
503
|
-
trackingData = {
|
|
504
|
-
type: transactionType,
|
|
505
|
-
currency: token ? token.name : accountCurrencyName,
|
|
506
|
-
network: token ? token.parentCurrency.id : accountNetwork,
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
const options = nanoApp
|
|
510
|
-
? { hwAppId: nanoApp, dependencies: dependencies }
|
|
511
|
-
: undefined;
|
|
512
|
-
tracking.dappSendTransactionRequested(manifest, trackingData);
|
|
513
|
-
|
|
514
|
-
const signedTransaction = await new Promise<SignedOperation>((resolve, reject) =>
|
|
515
|
-
uiHook["transaction.sign"]({
|
|
477
|
+
(async () => {
|
|
478
|
+
let trackingData: DAppTrackingData | undefined;
|
|
479
|
+
try {
|
|
480
|
+
const signFlowInfos = getWalletAPITransactionSignFlowInfos({
|
|
481
|
+
walletApiTransaction: tx,
|
|
516
482
|
account: currentAccount,
|
|
517
|
-
parentAccount: undefined,
|
|
518
|
-
signFlowInfos,
|
|
519
|
-
options,
|
|
520
|
-
onSuccess: signedOperation => {
|
|
521
|
-
resolve(signedOperation);
|
|
522
|
-
},
|
|
523
|
-
onError: error => {
|
|
524
|
-
reject(error);
|
|
525
|
-
},
|
|
526
|
-
}),
|
|
527
|
-
);
|
|
528
|
-
|
|
529
|
-
const bridge = getAccountBridge(currentAccount, undefined);
|
|
530
|
-
const mainAccount = getMainAccount(currentAccount, undefined);
|
|
531
|
-
|
|
532
|
-
let optimisticOperation: Operation = signedTransaction.operation;
|
|
533
|
-
|
|
534
|
-
if (!getEnv("DISABLE_TRANSACTION_BROADCAST")) {
|
|
535
|
-
optimisticOperation = await bridge.broadcast({
|
|
536
|
-
account: mainAccount,
|
|
537
|
-
signedOperation: signedTransaction,
|
|
538
|
-
broadcastConfig: { mevProtected: !!mevProtected },
|
|
539
483
|
});
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
uiHook["transaction.broadcast"](
|
|
543
|
-
currentAccount,
|
|
544
|
-
undefined,
|
|
545
|
-
mainAccount,
|
|
546
|
-
optimisticOperation,
|
|
547
|
-
);
|
|
548
484
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
485
|
+
const transactionType = getTxType(signFlowInfos.liveTx as EvmTransaction);
|
|
486
|
+
|
|
487
|
+
const token = await getCryptoAssetsStore().findTokenByAddressInCurrency(
|
|
488
|
+
tx.recipient,
|
|
489
|
+
currentAccount.type === "TokenAccount"
|
|
490
|
+
? currentAccount.token.parentCurrency.id
|
|
491
|
+
: currentAccount.currency.id,
|
|
492
|
+
);
|
|
493
|
+
|
|
494
|
+
const accountCurrencyName =
|
|
495
|
+
currentAccount.type === "TokenAccount"
|
|
496
|
+
? currentAccount.token.name
|
|
497
|
+
: currentAccount.currency.name;
|
|
498
|
+
|
|
499
|
+
const accountNetwork =
|
|
500
|
+
currentAccount.type === "TokenAccount"
|
|
501
|
+
? currentAccount.token.parentCurrency.id
|
|
502
|
+
: currentAccount.currency.id;
|
|
503
|
+
|
|
504
|
+
trackingData = {
|
|
505
|
+
type: transactionType,
|
|
506
|
+
currency: token ? token.name : accountCurrencyName,
|
|
507
|
+
network: token ? token.parentCurrency.id : accountNetwork,
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
const options = nanoApp
|
|
511
|
+
? { hwAppId: nanoApp, dependencies: dependencies }
|
|
512
|
+
: undefined;
|
|
513
|
+
tracking.dappSendTransactionRequested(manifest, trackingData);
|
|
514
|
+
|
|
515
|
+
const signedTransaction = await new Promise<SignedOperation>((resolve, reject) =>
|
|
516
|
+
uiHook["transaction.sign"]({
|
|
517
|
+
account: currentAccount,
|
|
518
|
+
parentAccount: undefined,
|
|
519
|
+
signFlowInfos,
|
|
520
|
+
options,
|
|
521
|
+
onSuccess: signedOperation => {
|
|
522
|
+
resolve(signedOperation);
|
|
523
|
+
},
|
|
524
|
+
onError: error => {
|
|
525
|
+
reject(error);
|
|
526
|
+
},
|
|
527
|
+
}),
|
|
528
|
+
);
|
|
529
|
+
|
|
530
|
+
const bridge = getAccountBridge(currentAccount, undefined);
|
|
531
|
+
const mainAccount = getMainAccount(currentAccount, undefined);
|
|
532
|
+
|
|
533
|
+
let optimisticOperation: Operation = signedTransaction.operation;
|
|
534
|
+
|
|
535
|
+
if (!getEnv("DISABLE_TRANSACTION_BROADCAST")) {
|
|
536
|
+
optimisticOperation = await bridge.broadcast({
|
|
537
|
+
account: mainAccount,
|
|
538
|
+
signedOperation: signedTransaction,
|
|
539
|
+
broadcastConfig: { mevProtected: !!mevProtected },
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
uiHook["transaction.broadcast"](
|
|
544
|
+
currentAccount,
|
|
545
|
+
undefined,
|
|
546
|
+
mainAccount,
|
|
547
|
+
optimisticOperation,
|
|
548
|
+
);
|
|
549
|
+
|
|
550
|
+
tracking.dappSendTransactionSuccess(manifest, trackingData);
|
|
551
|
+
|
|
552
|
+
postMessage(
|
|
553
|
+
JSON.stringify({
|
|
554
|
+
id: data.id,
|
|
555
|
+
jsonrpc: "2.0",
|
|
556
|
+
result: optimisticOperation.hash,
|
|
557
|
+
}),
|
|
558
|
+
);
|
|
559
|
+
} catch (error) {
|
|
560
|
+
tracking.dappSendTransactionFail(manifest, trackingData);
|
|
561
|
+
postMessage(
|
|
562
|
+
JSON.stringify({
|
|
563
|
+
id: data.id,
|
|
564
|
+
jsonrpc: "2.0",
|
|
565
|
+
error: rejectedError("Transaction declined"),
|
|
566
|
+
}),
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
})().catch(error => {
|
|
570
|
+
console.error("Error in eth_sendTransaction handler:", error);
|
|
560
571
|
postMessage(
|
|
561
572
|
JSON.stringify({
|
|
562
573
|
id: data.id,
|
|
563
574
|
jsonrpc: "2.0",
|
|
564
|
-
error: rejectedError("Transaction
|
|
575
|
+
error: rejectedError("Transaction processing failed"),
|
|
565
576
|
}),
|
|
566
577
|
);
|
|
567
|
-
}
|
|
578
|
+
});
|
|
568
579
|
}
|
|
569
580
|
break;
|
|
570
581
|
}
|
|
@@ -673,13 +684,17 @@ export function useDappLogic({
|
|
|
673
684
|
if (ws.current) {
|
|
674
685
|
ws.current.send(data);
|
|
675
686
|
} else if (currentNetwork.nodeURL?.startsWith("https:")) {
|
|
676
|
-
|
|
687
|
+
network({
|
|
677
688
|
method: "POST",
|
|
678
689
|
url: currentNetwork.nodeURL,
|
|
679
690
|
data,
|
|
680
|
-
})
|
|
681
|
-
|
|
682
|
-
|
|
691
|
+
})
|
|
692
|
+
.then(res => {
|
|
693
|
+
postMessage(JSON.stringify(res.data));
|
|
694
|
+
})
|
|
695
|
+
.catch(() => {
|
|
696
|
+
// Silently ignore network errors
|
|
697
|
+
});
|
|
683
698
|
}
|
|
684
699
|
break;
|
|
685
700
|
}
|
|
@@ -4,26 +4,14 @@ import { TokenAccount, Account, AccountLike } from "@ledgerhq/types-live";
|
|
|
4
4
|
import { LiveAppManifest } from "../../platform/types";
|
|
5
5
|
import semver from "semver";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Determines if a manifest uses (Ledger Live) account ID format or UUID (Wallet API) format.
|
|
9
|
-
* @param manifest - The live app manifest to check
|
|
10
|
-
* @returns true if the manifest uses encoded format (v3+ dapp), false otherwise
|
|
11
|
-
*/
|
|
12
|
-
export function usesEncodedAccountIdFormat(manifest: LiveAppManifest): boolean {
|
|
13
|
-
return (
|
|
14
|
-
"dapp" in manifest &&
|
|
15
|
-
!!manifest.apiVersion &&
|
|
16
|
-
semver.satisfies(WALLET_API_VERSION, manifest.apiVersion)
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
7
|
/** The dapp connector "v3" uses the ledger live account ID to find the correct account. Live app and dapp browser manifests require wallet API ID. */
|
|
21
8
|
export function deriveAccountIdForManifest(
|
|
22
9
|
accountId: Account["id"] | TokenAccount["id"] | AccountLike["id"],
|
|
23
10
|
walletApiAccountId: WalletAPIAccount["id"] | string,
|
|
24
11
|
manifest: LiveAppManifest,
|
|
25
12
|
) {
|
|
26
|
-
|
|
13
|
+
const isDapp = "dapp" in manifest;
|
|
14
|
+
if (isDapp && manifest.apiVersion && semver.satisfies(WALLET_API_VERSION, manifest.apiVersion)) {
|
|
27
15
|
return accountId;
|
|
28
16
|
}
|
|
29
17
|
/** Assume dapp browser <=v2 or live app, fallback to wallet ID. */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceHasBattery.d.ts","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDeviceHasBattery = void 0;
|
|
4
|
-
var device_core_1 = require("@ledgerhq/device-core");
|
|
5
|
-
Object.defineProperty(exports, "getDeviceHasBattery", { enumerable: true, get: function () { return device_core_1.getDeviceHasBattery; } });
|
|
6
|
-
//# sourceMappingURL=getDeviceHasBattery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceHasBattery.js","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAAnD,kHAAA,mBAAmB,OAAA"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type DeviceControllerClient, type ButtonKey } from "@ledgerhq/speculos-device-controller";
|
|
2
|
-
type ButtonsController = {
|
|
3
|
-
left(): Promise<void>;
|
|
4
|
-
right(): Promise<void>;
|
|
5
|
-
both(): Promise<void>;
|
|
6
|
-
pressSequence(keys: ButtonKey[], delayMs?: number): Promise<void>;
|
|
7
|
-
};
|
|
8
|
-
type DeviceControllerContext = {
|
|
9
|
-
getDeviceController: () => DeviceControllerClient;
|
|
10
|
-
getButtonsController: () => ButtonsController;
|
|
11
|
-
};
|
|
12
|
-
export declare const getDeviceControllerWithMemo: () => DeviceControllerClient;
|
|
13
|
-
export declare const getButtonsWithMemo: (getController: () => DeviceControllerClient) => () => ButtonsController;
|
|
14
|
-
/**
|
|
15
|
-
* Wraps a function with access to speculos-device-controller via a tiny DI context.
|
|
16
|
-
*
|
|
17
|
-
* @description
|
|
18
|
-
* Pass a factory that receives a context exposing `getDeviceController()` and `getButtonsController()`.
|
|
19
|
-
* The factory returns the actual implementation. The returned wrapper preserves the implementation’s
|
|
20
|
-
* parameter and return types.
|
|
21
|
-
*
|
|
22
|
-
* Both accessors are lazy, they get or refresh the underlying controller only when called.
|
|
23
|
-
*
|
|
24
|
-
* @param factory - Function invoked immediately with the device context, must return the implementation.
|
|
25
|
-
* @returns A function with the same parameters and return type as the implementation returned by `factory`.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```ts
|
|
29
|
-
* const accept = withDeviceController(({ getButtonsController }) => async (timeoutMS: number) => {
|
|
30
|
-
* const buttons = getButtonsController();
|
|
31
|
-
* await waitFor(timeoutMS);
|
|
32
|
-
* await buttons.both();
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* await accept(1000);
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
export declare function withDeviceController<A extends unknown[], R>(factory: (ctx: DeviceControllerContext) => (...args: A) => R | Promise<R>): (...args: A) => R | Promise<R>;
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=DeviceController.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceController.d.ts","sourceRoot":"","sources":["../../../src/e2e/deviceInteraction/DeviceController.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACf,MAAM,sCAAsC,CAAC;AAG9C,KAAK,iBAAiB,GAAG;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;IAClD,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;CAC/C,CAAC;AAIF,eAAO,MAAM,2BAA2B,8BAcpC,CAAC;AAEL,eAAO,MAAM,kBAAkB,kBAAmB,MAAM,sBAAsB,4BAS7E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,EACzD,OAAO,EAAE,CAAC,GAAG,EAAE,uBAAuB,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACxE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOhC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withDeviceController = exports.getButtonsWithMemo = exports.getDeviceControllerWithMemo = void 0;
|
|
4
|
-
const live_env_1 = require("@ledgerhq/live-env");
|
|
5
|
-
const speculos_1 = require("../speculos");
|
|
6
|
-
const speculos_device_controller_1 = require("@ledgerhq/speculos-device-controller");
|
|
7
|
-
const endpointKey = () => `${(0, speculos_1.getSpeculosAddress)()}:${(0, live_env_1.getEnv)("SPECULOS_API_PORT")}`;
|
|
8
|
-
exports.getDeviceControllerWithMemo = (() => {
|
|
9
|
-
let cache = null;
|
|
10
|
-
return () => {
|
|
11
|
-
const key = endpointKey();
|
|
12
|
-
if (!cache || cache.key !== key) {
|
|
13
|
-
cache = {
|
|
14
|
-
key,
|
|
15
|
-
client: (0, speculos_device_controller_1.deviceControllerClientFactory)(key, {
|
|
16
|
-
timeoutMs: 10000,
|
|
17
|
-
}),
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return cache.client;
|
|
21
|
-
};
|
|
22
|
-
})();
|
|
23
|
-
const getButtonsWithMemo = (getController) => {
|
|
24
|
-
let cache = null;
|
|
25
|
-
return () => {
|
|
26
|
-
const ctrl = getController();
|
|
27
|
-
if (!cache || cache.ctrl !== ctrl) {
|
|
28
|
-
cache = { ctrl, buttons: ctrl.buttonFactory() };
|
|
29
|
-
}
|
|
30
|
-
return cache.buttons;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
exports.getButtonsWithMemo = getButtonsWithMemo;
|
|
34
|
-
/**
|
|
35
|
-
* Wraps a function with access to speculos-device-controller via a tiny DI context.
|
|
36
|
-
*
|
|
37
|
-
* @description
|
|
38
|
-
* Pass a factory that receives a context exposing `getDeviceController()` and `getButtonsController()`.
|
|
39
|
-
* The factory returns the actual implementation. The returned wrapper preserves the implementation’s
|
|
40
|
-
* parameter and return types.
|
|
41
|
-
*
|
|
42
|
-
* Both accessors are lazy, they get or refresh the underlying controller only when called.
|
|
43
|
-
*
|
|
44
|
-
* @param factory - Function invoked immediately with the device context, must return the implementation.
|
|
45
|
-
* @returns A function with the same parameters and return type as the implementation returned by `factory`.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* const accept = withDeviceController(({ getButtonsController }) => async (timeoutMS: number) => {
|
|
50
|
-
* const buttons = getButtonsController();
|
|
51
|
-
* await waitFor(timeoutMS);
|
|
52
|
-
* await buttons.both();
|
|
53
|
-
* });
|
|
54
|
-
*
|
|
55
|
-
* await accept(1000);
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
|
-
function withDeviceController(factory) {
|
|
60
|
-
const ctx = {
|
|
61
|
-
getDeviceController: exports.getDeviceControllerWithMemo,
|
|
62
|
-
getButtonsController: (0, exports.getButtonsWithMemo)(exports.getDeviceControllerWithMemo),
|
|
63
|
-
};
|
|
64
|
-
const implementation = factory(ctx);
|
|
65
|
-
return (...args) => implementation(...args);
|
|
66
|
-
}
|
|
67
|
-
exports.withDeviceController = withDeviceController;
|
|
68
|
-
//# sourceMappingURL=DeviceController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceController.js","sourceRoot":"","sources":["../../../src/e2e/deviceInteraction/DeviceController.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,0CAAiD;AACjD,qFAI8C;AAe9C,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,GAAG,IAAA,6BAAkB,GAAE,IAAI,IAAA,iBAAM,EAAC,mBAAmB,CAAC,EAAE,CAAC;AAEtE,QAAA,2BAA2B,GAAG,CAAC,GAAG,EAAE;IAC/C,IAAI,KAAK,GAA2D,IAAI,CAAC;IACzE,OAAO,GAAG,EAAE;QACV,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;YAC/B,KAAK,GAAG;gBACN,GAAG;gBACH,MAAM,EAAE,IAAA,0DAA6B,EAAC,GAAG,EAAE;oBACzC,SAAS,EAAE,KAAK;iBACjB,CAAC;aACH,CAAC;SACH;QACD,OAAO,KAAK,CAAC,MAAM,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAEE,MAAM,kBAAkB,GAAG,CAAC,aAA2C,EAAE,EAAE;IAChF,IAAI,KAAK,GAAwE,IAAI,CAAC;IACtF,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;QAC7B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;YACjC,KAAK,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;SACjD;QACD,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,oBAAoB,CAClC,OAAyE;IAEzE,MAAM,GAAG,GAA4B;QACnC,mBAAmB,EAAE,mCAA2B;QAChD,oBAAoB,EAAE,IAAA,0BAAkB,EAAC,mCAA2B,CAAC;KACtE,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,IAAO,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;AACjD,CAAC;AATD,oDASC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReceiveFundsOptions.d.ts","sourceRoot":"","sources":["../../../src/e2e/enum/ReceiveFundsOptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReceiveFundsOptions.js","sourceRoot":"","sources":["../../../src/e2e/enum/ReceiveFundsOptions.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
|
-
import { Account } from "@ledgerhq/types-live";
|
|
3
|
-
export type UseCantonAcceptOrRejectOfferOptions = {
|
|
4
|
-
currency: CryptoCurrency;
|
|
5
|
-
account: Account;
|
|
6
|
-
partyId: string;
|
|
7
|
-
};
|
|
8
|
-
export type TransferInstructionParams = {
|
|
9
|
-
contractId: string;
|
|
10
|
-
deviceId: string;
|
|
11
|
-
reason?: string;
|
|
12
|
-
};
|
|
13
|
-
export type TransferInstructionType = "accept-transfer-instruction" | "reject-transfer-instruction" | "withdraw-transfer-instruction";
|
|
14
|
-
export declare function useCantonAcceptOrRejectOffer({ currency, account, partyId, }: UseCantonAcceptOrRejectOfferOptions): ({ contractId, deviceId, reason }: TransferInstructionParams, type: TransferInstructionType) => Promise<void>;
|
|
15
|
-
//# sourceMappingURL=react.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/families/canton/react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,6BAA6B,GAC7B,6BAA6B,GAC7B,+BAA+B,CAAC;AAEpC,wBAAgB,4BAA4B,CAAC,EAC3C,QAAQ,EACR,OAAO,EACP,OAAO,GACR,EAAE,mCAAmC,sCAKE,yBAAyB,QACrD,uBAAuB,mBAgBlC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCantonAcceptOrRejectOffer = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const bridge_1 = require("../../bridge");
|
|
6
|
-
function useCantonAcceptOrRejectOffer({ currency, account, partyId, }) {
|
|
7
|
-
const cantonBridge = (0, bridge_1.getCurrencyBridge)(currency);
|
|
8
|
-
const transferInstruction = (0, react_1.useCallback)(({ contractId, deviceId, reason }, type) => {
|
|
9
|
-
return cantonBridge.transferInstruction(currency, deviceId, account, partyId, contractId, type, reason);
|
|
10
|
-
}, [cantonBridge, currency, account, partyId]);
|
|
11
|
-
return transferInstruction;
|
|
12
|
-
}
|
|
13
|
-
exports.useCantonAcceptOrRejectOffer = useCantonAcceptOrRejectOffer;
|
|
14
|
-
//# sourceMappingURL=react.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/families/canton/react.ts"],"names":[],"mappings":";;;AAAA,iCAAoC;AACpC,yCAAiD;AAsBjD,SAAgB,4BAA4B,CAAC,EAC3C,QAAQ,EACR,OAAO,EACP,OAAO,GAC6B;IACpC,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,QAAQ,CAAyB,CAAC;IAEzE,MAAM,mBAAmB,GAAG,IAAA,mBAAW,EACrC,CACE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAA6B,EAC3D,IAA6B,EAC7B,EAAE;QACF,OAAO,YAAY,CAAC,mBAAmB,CACrC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,IAAI,EACJ,MAAM,CACP,CAAC;IACJ,CAAC,EACD,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAC3C,CAAC;IAEF,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AA1BD,oEA0BC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupCurrenciesByAsset.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/utils/groupCurrenciesByAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,eAAO,MAAM,sBAAsB,iBAAkB,SAAS,EAAE;kBAG5C,qBAAqB;gBAAc,qBAAqB,EAAE;EAoB7E,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.groupCurrenciesByAsset = void 0;
|
|
4
|
-
const groupCurrenciesByAsset = (assetsSorted) => {
|
|
5
|
-
const assetMap = new Map();
|
|
6
|
-
if (assetsSorted) {
|
|
7
|
-
for (const item of assetsSorted) {
|
|
8
|
-
const { asset: { id: assetId }, networks = [], } = item;
|
|
9
|
-
if (networks?.length > 0) {
|
|
10
|
-
const mainCurrency = networks.find(c => c.id === assetId) ?? networks[0];
|
|
11
|
-
assetMap.set(assetId, {
|
|
12
|
-
mainCurrency,
|
|
13
|
-
currencies: networks,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return assetMap;
|
|
19
|
-
};
|
|
20
|
-
exports.groupCurrenciesByAsset = groupCurrenciesByAsset;
|
|
21
|
-
//# sourceMappingURL=groupCurrenciesByAsset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupCurrenciesByAsset.js","sourceRoot":"","sources":["../../../src/modularDrawer/utils/groupCurrenciesByAsset.ts"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,GAAG,CAAC,YAAyB,EAAE,EAAE;IAClE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAGrB,CAAC;IAEJ,IAAI,YAAY,EAAE;QAChB,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC/B,MAAM,EACJ,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EACtB,QAAQ,GAAG,EAAE,GACd,GAAG,IAAI,CAAC;YACT,IAAI,QAAQ,EAAE,MAAM,GAAG,CAAC,EAAE;gBACxB,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACzE,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE;oBACpB,YAAY;oBACZ,UAAU,EAAE,QAAQ;iBACrB,CAAC,CAAC;aACJ;SACF;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAvBW,QAAA,sBAAsB,0BAuBjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceHasBattery.d.ts","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceHasBattery.js","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type DeviceControllerClient, type ButtonKey } from "@ledgerhq/speculos-device-controller";
|
|
2
|
-
type ButtonsController = {
|
|
3
|
-
left(): Promise<void>;
|
|
4
|
-
right(): Promise<void>;
|
|
5
|
-
both(): Promise<void>;
|
|
6
|
-
pressSequence(keys: ButtonKey[], delayMs?: number): Promise<void>;
|
|
7
|
-
};
|
|
8
|
-
type DeviceControllerContext = {
|
|
9
|
-
getDeviceController: () => DeviceControllerClient;
|
|
10
|
-
getButtonsController: () => ButtonsController;
|
|
11
|
-
};
|
|
12
|
-
export declare const getDeviceControllerWithMemo: () => DeviceControllerClient;
|
|
13
|
-
export declare const getButtonsWithMemo: (getController: () => DeviceControllerClient) => () => ButtonsController;
|
|
14
|
-
/**
|
|
15
|
-
* Wraps a function with access to speculos-device-controller via a tiny DI context.
|
|
16
|
-
*
|
|
17
|
-
* @description
|
|
18
|
-
* Pass a factory that receives a context exposing `getDeviceController()` and `getButtonsController()`.
|
|
19
|
-
* The factory returns the actual implementation. The returned wrapper preserves the implementation’s
|
|
20
|
-
* parameter and return types.
|
|
21
|
-
*
|
|
22
|
-
* Both accessors are lazy, they get or refresh the underlying controller only when called.
|
|
23
|
-
*
|
|
24
|
-
* @param factory - Function invoked immediately with the device context, must return the implementation.
|
|
25
|
-
* @returns A function with the same parameters and return type as the implementation returned by `factory`.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```ts
|
|
29
|
-
* const accept = withDeviceController(({ getButtonsController }) => async (timeoutMS: number) => {
|
|
30
|
-
* const buttons = getButtonsController();
|
|
31
|
-
* await waitFor(timeoutMS);
|
|
32
|
-
* await buttons.both();
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* await accept(1000);
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
export declare function withDeviceController<A extends unknown[], R>(factory: (ctx: DeviceControllerContext) => (...args: A) => R | Promise<R>): (...args: A) => R | Promise<R>;
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=DeviceController.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceController.d.ts","sourceRoot":"","sources":["../../../src/e2e/deviceInteraction/DeviceController.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACf,MAAM,sCAAsC,CAAC;AAG9C,KAAK,iBAAiB,GAAG;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;IAClD,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;CAC/C,CAAC;AAIF,eAAO,MAAM,2BAA2B,8BAcpC,CAAC;AAEL,eAAO,MAAM,kBAAkB,kBAAmB,MAAM,sBAAsB,4BAS7E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,EACzD,OAAO,EAAE,CAAC,GAAG,EAAE,uBAAuB,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACxE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOhC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { getEnv } from "@ledgerhq/live-env";
|
|
2
|
-
import { getSpeculosAddress } from "../speculos";
|
|
3
|
-
import { deviceControllerClientFactory, } from "@ledgerhq/speculos-device-controller";
|
|
4
|
-
const endpointKey = () => `${getSpeculosAddress()}:${getEnv("SPECULOS_API_PORT")}`;
|
|
5
|
-
export const getDeviceControllerWithMemo = (() => {
|
|
6
|
-
let cache = null;
|
|
7
|
-
return () => {
|
|
8
|
-
const key = endpointKey();
|
|
9
|
-
if (!cache || cache.key !== key) {
|
|
10
|
-
cache = {
|
|
11
|
-
key,
|
|
12
|
-
client: deviceControllerClientFactory(key, {
|
|
13
|
-
timeoutMs: 10000,
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return cache.client;
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
export const getButtonsWithMemo = (getController) => {
|
|
21
|
-
let cache = null;
|
|
22
|
-
return () => {
|
|
23
|
-
const ctrl = getController();
|
|
24
|
-
if (!cache || cache.ctrl !== ctrl) {
|
|
25
|
-
cache = { ctrl, buttons: ctrl.buttonFactory() };
|
|
26
|
-
}
|
|
27
|
-
return cache.buttons;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Wraps a function with access to speculos-device-controller via a tiny DI context.
|
|
32
|
-
*
|
|
33
|
-
* @description
|
|
34
|
-
* Pass a factory that receives a context exposing `getDeviceController()` and `getButtonsController()`.
|
|
35
|
-
* The factory returns the actual implementation. The returned wrapper preserves the implementation’s
|
|
36
|
-
* parameter and return types.
|
|
37
|
-
*
|
|
38
|
-
* Both accessors are lazy, they get or refresh the underlying controller only when called.
|
|
39
|
-
*
|
|
40
|
-
* @param factory - Function invoked immediately with the device context, must return the implementation.
|
|
41
|
-
* @returns A function with the same parameters and return type as the implementation returned by `factory`.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* const accept = withDeviceController(({ getButtonsController }) => async (timeoutMS: number) => {
|
|
46
|
-
* const buttons = getButtonsController();
|
|
47
|
-
* await waitFor(timeoutMS);
|
|
48
|
-
* await buttons.both();
|
|
49
|
-
* });
|
|
50
|
-
*
|
|
51
|
-
* await accept(1000);
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
export function withDeviceController(factory) {
|
|
56
|
-
const ctx = {
|
|
57
|
-
getDeviceController: getDeviceControllerWithMemo,
|
|
58
|
-
getButtonsController: getButtonsWithMemo(getDeviceControllerWithMemo),
|
|
59
|
-
};
|
|
60
|
-
const implementation = factory(ctx);
|
|
61
|
-
return (...args) => implementation(...args);
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=DeviceController.js.map
|