@ledgerhq/live-common 34.48.0-nightly.9 → 34.48.1
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/environment.js +0 -1
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/apps/inlineAppInstall.d.ts +3 -1
- package/lib/apps/inlineAppInstall.d.ts.map +1 -1
- package/lib/apps/inlineAppInstall.js +2 -2
- package/lib/apps/inlineAppInstall.js.map +1 -1
- package/lib/apps/react.d.ts +2 -1
- package/lib/apps/react.d.ts.map +1 -1
- package/lib/apps/react.js +2 -2
- package/lib/apps/react.js.map +1 -1
- package/lib/apps/runner.d.ts +4 -2
- package/lib/apps/runner.d.ts.map +1 -1
- package/lib/apps/runner.js +4 -3
- package/lib/apps/runner.js.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.d.ts +1 -2
- package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.js +2 -2
- package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.js +6 -10
- package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +9 -37
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/createTransaction.d.ts +1 -1
- package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/createTransaction.js +0 -8
- package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts +1 -2
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/currencyBridge.js +2 -3
- package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.d.ts +10 -2
- package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.js +2 -2
- package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +3 -2
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/types.d.ts +0 -11
- package/lib/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +0 -2
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +1 -15
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.test.js +0 -21
- package/lib/bridge/generic-alpaca/utils.test.js.map +1 -1
- package/lib/config/sharedConfig.d.ts.map +1 -1
- package/lib/config/sharedConfig.js +28 -30
- package/lib/config/sharedConfig.js.map +1 -1
- package/lib/e2e/enum/Account.d.ts +0 -2
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +0 -2
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/AppInfos.d.ts +0 -1
- package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib/e2e/enum/AppInfos.js +0 -1
- package/lib/e2e/enum/AppInfos.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +0 -1
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +0 -1
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +1 -2
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +0 -1
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/enum/Network.d.ts +1 -2
- package/lib/e2e/enum/Network.d.ts.map +1 -1
- package/lib/e2e/enum/Network.js +0 -1
- package/lib/e2e/enum/Network.js.map +1 -1
- package/lib/e2e/index.d.ts +4 -1
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +0 -13
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/swap/transactionStrategies.d.ts +11 -38
- package/lib/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib/exchange/swap/transactionStrategies.js +47 -93
- package/lib/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +5 -3
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/canton/setup.d.ts.map +1 -1
- package/lib/families/canton/setup.js +5 -5
- package/lib/families/canton/setup.js.map +1 -1
- package/lib/families/evm/config.js +2 -2
- package/lib/families/evm/config.js.map +1 -1
- package/lib/families/xrp/setup.d.ts +2 -2
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +2 -4
- 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/generated/bridge/js.d.ts +0 -1
- package/lib/generated/bridge/js.d.ts.map +1 -1
- package/lib/generated/bridge/js.js +22 -24
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/generated/bridge/mock.d.ts +1 -1
- package/lib/generated/cli-transaction.d.ts +2 -13
- package/lib/generated/cli-transaction.d.ts.map +1 -1
- package/lib/generated/cli-transaction.js +26 -28
- package/lib/generated/cli-transaction.js.map +1 -1
- package/lib/generated/deviceTransactionConfig.d.ts +0 -2
- package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/generated/deviceTransactionConfig.js +22 -24
- package/lib/generated/deviceTransactionConfig.js.map +1 -1
- package/lib/generated/hw-getAddress.d.ts +0 -1
- package/lib/generated/hw-getAddress.d.ts.map +1 -1
- package/lib/generated/hw-getAddress.js +26 -28
- package/lib/generated/hw-getAddress.js.map +1 -1
- package/lib/generated/platformAdapter.d.ts +1 -1
- package/lib/generated/specs.d.ts +1 -1
- package/lib/generated/transaction.d.ts +3 -11
- package/lib/generated/transaction.d.ts.map +1 -1
- package/lib/generated/transaction.js +26 -28
- package/lib/generated/transaction.js.map +1 -1
- package/lib/generated/types.d.ts +4 -5
- package/lib/generated/types.d.ts.map +1 -1
- package/lib/generated/walletApiAdapter.d.ts +1 -1
- package/lib/hw/actions/app.d.ts.map +1 -1
- package/lib/hw/actions/app.js.map +1 -1
- package/lib/hw/getDeviceNameMaxLength.d.ts.map +1 -1
- package/lib/hw/getDeviceNameMaxLength.js +0 -2
- package/lib/hw/getDeviceNameMaxLength.js.map +1 -1
- package/lib/hw/getDeviceNameMaxLength.test.js +0 -12
- package/lib/hw/getDeviceNameMaxLength.test.js.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.js +2 -3
- package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib/modularDrawer/data/state-manager/types.d.ts +0 -1
- package/lib/modularDrawer/data/state-manager/types.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.d.ts +1 -3
- package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.js +3 -6
- package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib/notifications/ServiceStatusProvider/index.d.ts +1 -16
- package/lib/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib/notifications/ServiceStatusProvider/index.js +7 -31
- package/lib/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib/wallet-api/ACRE/server.d.ts +6 -13
- package/lib/wallet-api/ACRE/server.d.ts.map +1 -1
- package/lib/wallet-api/ACRE/server.js +1 -142
- 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 +13 -16
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +0 -1
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/apps/inlineAppInstall.d.ts +3 -1
- package/lib-es/apps/inlineAppInstall.d.ts.map +1 -1
- package/lib-es/apps/inlineAppInstall.js +2 -2
- package/lib-es/apps/inlineAppInstall.js.map +1 -1
- package/lib-es/apps/react.d.ts +2 -1
- package/lib-es/apps/react.d.ts.map +1 -1
- package/lib-es/apps/react.js +2 -2
- package/lib-es/apps/react.js.map +1 -1
- package/lib-es/apps/runner.d.ts +4 -2
- package/lib-es/apps/runner.d.ts.map +1 -1
- package/lib-es/apps/runner.js +4 -3
- package/lib-es/apps/runner.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +1 -2
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -2
- package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.js +6 -10
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +9 -37
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +1 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.js +0 -8
- package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +1 -2
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.js +2 -3
- package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +4 -4
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts +10 -2
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/index.js +2 -2
- package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +3 -2
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/types.d.ts +0 -11
- package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +0 -2
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +0 -13
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.test.js +1 -22
- package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -1
- package/lib-es/config/sharedConfig.d.ts.map +1 -1
- package/lib-es/config/sharedConfig.js +0 -2
- package/lib-es/config/sharedConfig.js.map +1 -1
- package/lib-es/e2e/enum/Account.d.ts +0 -2
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +0 -2
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/AppInfos.d.ts +0 -1
- package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib-es/e2e/enum/AppInfos.js +0 -1
- package/lib-es/e2e/enum/AppInfos.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +0 -1
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +0 -1
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +1 -2
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +0 -1
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/enum/Network.d.ts +1 -2
- package/lib-es/e2e/enum/Network.d.ts.map +1 -1
- package/lib-es/e2e/enum/Network.js +0 -1
- package/lib-es/e2e/enum/Network.js.map +1 -1
- package/lib-es/e2e/index.d.ts +4 -1
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +0 -13
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.d.ts +11 -38
- package/lib-es/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.js +44 -87
- package/lib-es/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +5 -3
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/canton/setup.d.ts.map +1 -1
- package/lib-es/families/canton/setup.js +5 -5
- package/lib-es/families/canton/setup.js.map +1 -1
- package/lib-es/families/evm/config.js +2 -2
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/families/xrp/setup.d.ts +2 -2
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +2 -4
- 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/generated/bridge/js.d.ts +0 -1
- package/lib-es/generated/bridge/js.d.ts.map +1 -1
- package/lib-es/generated/bridge/js.js +0 -2
- package/lib-es/generated/bridge/js.js.map +1 -1
- package/lib-es/generated/bridge/mock.d.ts +1 -1
- package/lib-es/generated/cli-transaction.d.ts +2 -13
- package/lib-es/generated/cli-transaction.d.ts.map +1 -1
- package/lib-es/generated/cli-transaction.js +0 -2
- package/lib-es/generated/cli-transaction.js.map +1 -1
- package/lib-es/generated/deviceTransactionConfig.d.ts +0 -2
- package/lib-es/generated/deviceTransactionConfig.d.ts.map +1 -1
- package/lib-es/generated/deviceTransactionConfig.js +0 -2
- package/lib-es/generated/deviceTransactionConfig.js.map +1 -1
- package/lib-es/generated/hw-getAddress.d.ts +0 -1
- package/lib-es/generated/hw-getAddress.d.ts.map +1 -1
- package/lib-es/generated/hw-getAddress.js +0 -2
- package/lib-es/generated/hw-getAddress.js.map +1 -1
- package/lib-es/generated/platformAdapter.d.ts +1 -1
- package/lib-es/generated/specs.d.ts +1 -1
- package/lib-es/generated/transaction.d.ts +3 -11
- package/lib-es/generated/transaction.d.ts.map +1 -1
- package/lib-es/generated/transaction.js +0 -2
- package/lib-es/generated/transaction.js.map +1 -1
- package/lib-es/generated/types.d.ts +4 -5
- package/lib-es/generated/types.d.ts.map +1 -1
- package/lib-es/generated/walletApiAdapter.d.ts +1 -1
- package/lib-es/hw/actions/app.d.ts.map +1 -1
- package/lib-es/hw/actions/app.js.map +1 -1
- package/lib-es/hw/getDeviceNameMaxLength.d.ts.map +1 -1
- package/lib-es/hw/getDeviceNameMaxLength.js +0 -2
- package/lib-es/hw/getDeviceNameMaxLength.js.map +1 -1
- package/lib-es/hw/getDeviceNameMaxLength.test.js +0 -12
- package/lib-es/hw/getDeviceNameMaxLength.test.js.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.js +2 -3
- package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/types.d.ts +0 -1
- package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +1 -3
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.js +3 -6
- package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts +1 -16
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.js +7 -31
- package/lib-es/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib-es/wallet-api/ACRE/server.d.ts +6 -13
- package/lib-es/wallet-api/ACRE/server.d.ts.map +1 -1
- package/lib-es/wallet-api/ACRE/server.js +2 -140
- 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 +13 -16
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/package.json +55 -58
- package/src/__tests__/test-helpers/environment.ts +0 -1
- package/src/apps/inlineAppInstall.ts +4 -1
- package/src/apps/react.ts +3 -1
- package/src/apps/runner.ts +8 -1
- package/src/bridge/generic-alpaca/accountBridge.ts +3 -8
- package/src/bridge/generic-alpaca/alpaca/index.ts +18 -13
- package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +10 -38
- package/src/bridge/generic-alpaca/createTransaction.ts +1 -9
- package/src/bridge/generic-alpaca/currencyBridge.ts +2 -8
- package/src/bridge/generic-alpaca/getAccountShape.ts +5 -4
- package/src/bridge/generic-alpaca/signer/index.ts +15 -5
- package/src/bridge/generic-alpaca/signer/signTransaction.ts +3 -4
- package/src/bridge/generic-alpaca/signer/types.ts +0 -14
- package/src/bridge/generic-alpaca/utils.test.ts +1 -29
- package/src/bridge/generic-alpaca/utils.ts +0 -15
- package/src/config/sharedConfig.ts +0 -2
- package/src/e2e/enum/Account.ts +0 -14
- package/src/e2e/enum/AppInfos.ts +0 -2
- package/src/e2e/enum/Currency.ts +0 -2
- package/src/e2e/enum/DeviceLabels.ts +0 -1
- package/src/e2e/enum/Network.ts +0 -1
- package/src/e2e/speculos.ts +0 -13
- package/src/exchange/swap/transactionStrategies.ts +73 -121
- package/src/families/canton/config.ts +6 -3
- package/src/families/canton/setup.ts +5 -6
- package/src/families/evm/config.ts +2 -2
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +2 -2
- package/src/featureFlags/defaultFeatures.ts +2 -4
- package/src/generated/bridge/js.ts +0 -2
- package/src/generated/cli-transaction.ts +0 -2
- package/src/generated/deviceTransactionConfig.ts +0 -2
- package/src/generated/hw-getAddress.ts +0 -2
- package/src/generated/transaction.ts +0 -2
- package/src/generated/types.ts +0 -10
- package/src/hw/actions/app.ts +1 -0
- package/src/hw/getDeviceNameMaxLength.test.ts +0 -16
- package/src/hw/getDeviceNameMaxLength.ts +0 -2
- package/src/modularDrawer/data/state-manager/api.ts +2 -4
- package/src/modularDrawer/data/state-manager/types.ts +0 -1
- package/src/modularDrawer/hooks/useAssetsData.ts +9 -24
- package/src/notifications/ServiceStatusProvider/index.tsx +12 -37
- package/src/wallet-api/ACRE/server.ts +14 -202
- package/src/wallet-api/Exchange/server.ts +14 -17
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts +0 -8
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js +0 -51
- package/lib/bridge/generic-alpaca/signer/Eth.js.map +0 -1
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.d.ts +0 -2
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js +0 -144
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js.map +0 -1
- package/lib/e2e/families/kaspa.d.ts +0 -4
- package/lib/e2e/families/kaspa.d.ts.map +0 -1
- package/lib/e2e/families/kaspa.js +0 -23
- package/lib/e2e/families/kaspa.js.map +0 -1
- package/lib/families/kaspa/bridge.integration.test.d.ts +0 -2
- package/lib/families/kaspa/bridge.integration.test.d.ts.map +0 -1
- package/lib/families/kaspa/bridge.integration.test.js +0 -7
- package/lib/families/kaspa/bridge.integration.test.js.map +0 -1
- package/lib/families/kaspa/config.d.ts +0 -3
- package/lib/families/kaspa/config.d.ts.map +0 -1
- package/lib/families/kaspa/config.js +0 -14
- package/lib/families/kaspa/config.js.map +0 -1
- package/lib/families/kaspa/react.d.ts +0 -4
- package/lib/families/kaspa/react.d.ts.map +0 -1
- package/lib/families/kaspa/react.js +0 -18
- package/lib/families/kaspa/react.js.map +0 -1
- package/lib/families/kaspa/setup.d.ts +0 -18
- package/lib/families/kaspa/setup.d.ts.map +0 -1
- package/lib/families/kaspa/setup.js +0 -24
- package/lib/families/kaspa/setup.js.map +0 -1
- package/lib/families/kaspa/types.d.ts +0 -2
- package/lib/families/kaspa/types.d.ts.map +0 -1
- package/lib/families/kaspa/types.js +0 -18
- package/lib/families/kaspa/types.js.map +0 -1
- package/lib/modularDrawer/hooks/useSearch.d.ts +0 -16
- package/lib/modularDrawer/hooks/useSearch.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useSearch.js +0 -24
- package/lib/modularDrawer/hooks/useSearch.js.map +0 -1
- package/lib/notifications/ServiceStatusProvider/index.test.d.ts +0 -2
- package/lib/notifications/ServiceStatusProvider/index.test.d.ts.map +0 -1
- package/lib/notifications/ServiceStatusProvider/index.test.js +0 -88
- package/lib/notifications/ServiceStatusProvider/index.test.js.map +0 -1
- package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts +0 -2
- package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts.map +0 -1
- package/lib/notifications/ServiceStatusProvider/ledger-components.js +0 -16
- package/lib/notifications/ServiceStatusProvider/ledger-components.js.map +0 -1
- package/lib/wallet-api/ACRE/server.test.d.ts +0 -2
- package/lib/wallet-api/ACRE/server.test.d.ts.map +0 -1
- package/lib/wallet-api/ACRE/server.test.js +0 -393
- package/lib/wallet-api/ACRE/server.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +0 -8
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.js +0 -47
- package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.d.ts +0 -2
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js +0 -139
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js.map +0 -1
- package/lib-es/e2e/families/kaspa.d.ts +0 -4
- package/lib-es/e2e/families/kaspa.d.ts.map +0 -1
- package/lib-es/e2e/families/kaspa.js +0 -15
- package/lib-es/e2e/families/kaspa.js.map +0 -1
- package/lib-es/families/kaspa/bridge.integration.test.d.ts +0 -2
- package/lib-es/families/kaspa/bridge.integration.test.d.ts.map +0 -1
- package/lib-es/families/kaspa/bridge.integration.test.js +0 -5
- package/lib-es/families/kaspa/bridge.integration.test.js.map +0 -1
- package/lib-es/families/kaspa/config.d.ts +0 -3
- package/lib-es/families/kaspa/config.d.ts.map +0 -1
- package/lib-es/families/kaspa/config.js +0 -11
- package/lib-es/families/kaspa/config.js.map +0 -1
- package/lib-es/families/kaspa/react.d.ts +0 -4
- package/lib-es/families/kaspa/react.d.ts.map +0 -1
- package/lib-es/families/kaspa/react.js +0 -14
- package/lib-es/families/kaspa/react.js.map +0 -1
- package/lib-es/families/kaspa/setup.d.ts +0 -18
- package/lib-es/families/kaspa/setup.d.ts.map +0 -1
- package/lib-es/families/kaspa/setup.js +0 -16
- package/lib-es/families/kaspa/setup.js.map +0 -1
- package/lib-es/families/kaspa/types.d.ts +0 -2
- package/lib-es/families/kaspa/types.d.ts.map +0 -1
- package/lib-es/families/kaspa/types.js +0 -2
- package/lib-es/families/kaspa/types.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useSearch.d.ts +0 -16
- package/lib-es/modularDrawer/hooks/useSearch.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useSearch.js +0 -20
- package/lib-es/modularDrawer/hooks/useSearch.js.map +0 -1
- package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts +0 -2
- package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts.map +0 -1
- package/lib-es/notifications/ServiceStatusProvider/index.test.js +0 -86
- package/lib-es/notifications/ServiceStatusProvider/index.test.js.map +0 -1
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts +0 -2
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts.map +0 -1
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.js +0 -13
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.js.map +0 -1
- package/lib-es/wallet-api/ACRE/server.test.d.ts +0 -2
- package/lib-es/wallet-api/ACRE/server.test.d.ts.map +0 -1
- package/lib-es/wallet-api/ACRE/server.test.js +0 -388
- package/lib-es/wallet-api/ACRE/server.test.js.map +0 -1
- package/src/bridge/generic-alpaca/signer/Eth.ts +0 -70
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +0 -173
- package/src/e2e/families/kaspa.ts +0 -17
- package/src/families/kaspa/__snapshots__/bridge.integration.test.ts.snap +0 -66
- package/src/families/kaspa/bridge.integration.test.ts +0 -5
- package/src/families/kaspa/config.ts +0 -12
- package/src/families/kaspa/react.ts +0 -19
- package/src/families/kaspa/setup.ts +0 -27
- package/src/families/kaspa/types.ts +0 -1
- package/src/modularDrawer/hooks/useSearch.ts +0 -52
- package/src/notifications/ServiceStatusProvider/index.test.ts +0 -102
- package/src/notifications/ServiceStatusProvider/ledger-components.ts +0 -12
- package/src/wallet-api/ACRE/server.test.ts +0 -470
@@ -24,7 +24,6 @@ export function useAssetsData({
|
|
24
24
|
areCurrenciesFiltered,
|
25
25
|
product,
|
26
26
|
version,
|
27
|
-
isStaging,
|
28
27
|
}: {
|
29
28
|
search?: string;
|
30
29
|
currencyIds?: string[];
|
@@ -32,26 +31,15 @@ export function useAssetsData({
|
|
32
31
|
areCurrenciesFiltered?: boolean;
|
33
32
|
product: "llm" | "lld";
|
34
33
|
version: string;
|
35
|
-
isStaging?: boolean;
|
36
34
|
}) {
|
37
|
-
const {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
isError,
|
46
|
-
isFetchingNextPage,
|
47
|
-
} = useGetAssetsDataInfiniteQuery({
|
48
|
-
search,
|
49
|
-
useCase,
|
50
|
-
currencyIds: areCurrenciesFiltered ? currencyIds : undefined,
|
51
|
-
product,
|
52
|
-
version,
|
53
|
-
isStaging,
|
54
|
-
});
|
35
|
+
const { data, isLoading, error, fetchNextPage, isSuccess, refetch } =
|
36
|
+
useGetAssetsDataInfiniteQuery({
|
37
|
+
search,
|
38
|
+
useCase,
|
39
|
+
currencyIds: areCurrenciesFiltered ? currencyIds : undefined,
|
40
|
+
product,
|
41
|
+
version,
|
42
|
+
});
|
55
43
|
|
56
44
|
const joinedPages = useMemo(() => {
|
57
45
|
return data?.pages.reduce<AssetsDataWithPagination>((acc, page) => {
|
@@ -74,15 +62,12 @@ export function useAssetsData({
|
|
74
62
|
|
75
63
|
const hasMore = Boolean(joinedPages?.pagination.nextCursor);
|
76
64
|
|
77
|
-
const isInitialLoading = isLoading || (isFetching && !isFetchingNextPage);
|
78
|
-
|
79
65
|
return {
|
80
66
|
data: joinedPages,
|
81
|
-
isLoading
|
67
|
+
isLoading,
|
82
68
|
error,
|
83
69
|
loadNext: hasMore ? fetchNextPage : undefined,
|
84
70
|
isSuccess,
|
85
|
-
isError,
|
86
71
|
refetch,
|
87
72
|
};
|
88
73
|
}
|
@@ -4,7 +4,6 @@ import defaultNetworkApi from "./api";
|
|
4
4
|
import { fromPromise } from "xstate";
|
5
5
|
import { useMachine } from "@xstate/react";
|
6
6
|
import { serviceStatusMachine } from "./machine";
|
7
|
-
import { LEDGER_COMPONENTS } from "./ledger-components";
|
8
7
|
type Props = {
|
9
8
|
children: React.ReactNode;
|
10
9
|
autoUpdateDelay: number;
|
@@ -34,51 +33,27 @@ function escapeRegExp(string) {
|
|
34
33
|
return string.replace(/[.*+?^${}()[\]\\]/g, "\\$&"); // $& means the whole matched string
|
35
34
|
}
|
36
35
|
|
37
|
-
function sanitizeName(name: string): string {
|
38
|
-
return name.toLowerCase().trim().replace(/\s+/g, " "); // collapse multiple spaces
|
39
|
-
}
|
40
|
-
|
41
|
-
/**
|
42
|
-
* Filters service status incidents based on related tickers or Ledger components.
|
43
|
-
*
|
44
|
-
* ## Behavior:
|
45
|
-
* - If there are no `tickers` or no `incidents`, returns an empty list.
|
46
|
-
* - For each incident:
|
47
|
-
* 1. ✅ If the incident has no components → keep it (always relevant).
|
48
|
-
* 2. ✅ If at least one component name matches a known **Ledger component** → keep it.
|
49
|
-
* 3. ✅ If at least one component name contains a **currency ticker** → keep it.
|
50
|
-
* 4. ❌ Otherwise, the incident is discarded.
|
51
|
-
*
|
52
|
-
* @param {Incident[]} [incidents=[]] - List of incidents to filter.
|
53
|
-
* @param {string[]} [tickers=[]] - List of currency tickers to match against incident components.
|
54
|
-
* @returns {Incident[]} The list of incidents relevant to the provided tickers or Ledger components.
|
55
|
-
*/
|
56
|
-
|
57
36
|
export function filterServiceStatusIncidents(
|
58
|
-
incidents: Incident[]
|
37
|
+
incidents: Incident[],
|
59
38
|
tickers: string[] = [],
|
60
39
|
): Incident[] {
|
61
|
-
if (!tickers.length || !incidents.length)
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
const
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
return ledgerComponentsSet.has(sanitizedName) || tickerRegex.test(sanitizedName);
|
73
|
-
});
|
74
|
-
});
|
40
|
+
if (!tickers || tickers.length === 0 || !incidents || incidents.length === 0) {
|
41
|
+
return [];
|
42
|
+
}
|
43
|
+
|
44
|
+
const tickersRegex = new RegExp(escapeRegExp(tickers.join("|")), "i");
|
45
|
+
return incidents.filter(
|
46
|
+
({ components }) =>
|
47
|
+
!components || // dont filter out if no components
|
48
|
+
components.length === 0 ||
|
49
|
+
components.some(({ name }) => tickersRegex.test(name)), // component name should hold currency ticker
|
50
|
+
);
|
75
51
|
}
|
76
52
|
|
77
53
|
// filter out service status incidents by given currencies or fallback on context currencies
|
78
54
|
export function useFilteredServiceStatus(filters?: ServiceStatusUserSettings): StatusContextType {
|
79
55
|
const stateData = useContext(ServiceStatusContext);
|
80
56
|
const { incidents, context } = stateData;
|
81
|
-
|
82
57
|
const filteredIncidents = useMemo(() => {
|
83
58
|
return filterServiceStatusIncidents(incidents, filters?.tickers || context?.tickers);
|
84
59
|
}, [incidents, context, filters?.tickers]);
|
@@ -8,8 +8,7 @@ import {
|
|
8
8
|
isTokenAccount,
|
9
9
|
} from "@ledgerhq/coin-framework/account/index";
|
10
10
|
import { Account, AccountLike, AnyMessage, Operation, SignedOperation } from "@ledgerhq/types-live";
|
11
|
-
import { findTokenById
|
12
|
-
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
11
|
+
import { findTokenById } from "@ledgerhq/cryptoassets";
|
13
12
|
import {
|
14
13
|
MessageSignParams,
|
15
14
|
MessageSignResult,
|
@@ -19,21 +18,17 @@ import {
|
|
19
18
|
TransactionSignAndBroadcastResult,
|
20
19
|
TransactionSignParams,
|
21
20
|
TransactionSignResult,
|
22
|
-
RegisterYieldBearingEthereumAddressParams,
|
23
|
-
RegisterYieldBearingEthereumAddressResult,
|
24
21
|
} from "@ledgerhq/wallet-api-acre-module";
|
25
|
-
import { Transaction } from "../../generated/types";
|
26
|
-
import { AppManifest } from "../types";
|
27
22
|
import { TrackingAPI } from "./tracking";
|
23
|
+
import { AppManifest } from "../types";
|
28
24
|
import {
|
29
25
|
getAccountIdFromWalletAccountId,
|
30
26
|
getWalletAPITransactionSignFlowInfos,
|
31
27
|
} from "../converters";
|
32
28
|
import { getAccountBridge } from "../../bridge";
|
29
|
+
import { Transaction } from "../../generated/types";
|
33
30
|
import { UserRefusedOnDevice } from "@ledgerhq/errors";
|
34
31
|
import { getEnv } from "@ledgerhq/live-env";
|
35
|
-
import BigNumber from "bignumber.js";
|
36
|
-
import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
37
32
|
|
38
33
|
type Handlers = {
|
39
34
|
"custom.acre.messageSign": RPCHandler<MessageSignResult, MessageSignParams>;
|
@@ -42,13 +37,9 @@ type Handlers = {
|
|
42
37
|
TransactionSignAndBroadcastResult,
|
43
38
|
TransactionSignAndBroadcastParams
|
44
39
|
>;
|
45
|
-
"custom.acre.registerYieldBearingEthereumAddress": RPCHandler<
|
46
|
-
RegisterYieldBearingEthereumAddressResult,
|
47
|
-
RegisterYieldBearingEthereumAddressParams
|
48
|
-
>;
|
49
40
|
};
|
50
41
|
|
51
|
-
|
42
|
+
type ACREUiHooks = {
|
52
43
|
"custom.acre.messageSign": (params: {
|
53
44
|
account: AccountLike;
|
54
45
|
message: AnyMessage;
|
@@ -75,117 +66,8 @@ export type ACREUiHooks = {
|
|
75
66
|
mainAccount: Account,
|
76
67
|
optimisticOperation: Operation,
|
77
68
|
) => void;
|
78
|
-
"custom.acre.registerAccount": (params: {
|
79
|
-
parentAccount: Account;
|
80
|
-
accountName: string;
|
81
|
-
existingAccounts: Account[];
|
82
|
-
onSuccess: () => void;
|
83
|
-
onError: (error: Error) => void;
|
84
|
-
}) => void;
|
85
69
|
};
|
86
70
|
|
87
|
-
// Helper function to validate Ethereum address format
|
88
|
-
function isValidEthereumAddress(address: string): boolean {
|
89
|
-
return /^0x[a-fA-F0-9]{40}$/.test(address);
|
90
|
-
}
|
91
|
-
|
92
|
-
// Helper function to validate all inputs before account creation
|
93
|
-
function validateInputs(params: RegisterYieldBearingEthereumAddressParams): {
|
94
|
-
ethereumAddress: string;
|
95
|
-
tokenContractAddress?: string;
|
96
|
-
tokenTicker?: string;
|
97
|
-
meta?: Record<string, unknown>;
|
98
|
-
} {
|
99
|
-
const { ethereumAddress, tokenContractAddress, tokenTicker, meta } = params;
|
100
|
-
|
101
|
-
// Validate Ethereum address format
|
102
|
-
if (!ethereumAddress) {
|
103
|
-
throw new Error("Ethereum address is required");
|
104
|
-
}
|
105
|
-
if (!isValidEthereumAddress(ethereumAddress)) {
|
106
|
-
throw new Error("Invalid Ethereum address format");
|
107
|
-
}
|
108
|
-
|
109
|
-
// Validate that at least one token identifier is provided
|
110
|
-
if (!tokenContractAddress && !tokenTicker) {
|
111
|
-
throw new Error("Either tokenContractAddress or tokenTicker must be provided");
|
112
|
-
}
|
113
|
-
|
114
|
-
return { ethereumAddress, tokenContractAddress, tokenTicker, meta };
|
115
|
-
}
|
116
|
-
|
117
|
-
// Helper function to find acreToken by address or token id
|
118
|
-
function findAcreToken(
|
119
|
-
tokenContractAddress?: string,
|
120
|
-
tokenTicker?: string,
|
121
|
-
): { token: TokenCurrency; contractAddress: string } {
|
122
|
-
let foundToken: TokenCurrency | undefined;
|
123
|
-
// Try to find token by contract address first (if provided)
|
124
|
-
if (tokenContractAddress) {
|
125
|
-
foundToken = findTokenByAddressInCurrency(tokenContractAddress, "ethereum");
|
126
|
-
} else if (tokenTicker) {
|
127
|
-
foundToken = findTokenById(tokenTicker.toLowerCase());
|
128
|
-
}
|
129
|
-
if (!foundToken) {
|
130
|
-
throw new Error(
|
131
|
-
`Token not found. Tried contract address: ${tokenContractAddress || "not provided"}, ticker: ${tokenTicker || "not provided"}`,
|
132
|
-
);
|
133
|
-
}
|
134
|
-
return { token: foundToken, contractAddress: foundToken.contractAddress };
|
135
|
-
}
|
136
|
-
|
137
|
-
// Helper function to generate unique account names with suffixes
|
138
|
-
// This is clearly a hack as we do not have account name on Account type, we leverage on how many accounts have acreBTC as token sub account to define the name
|
139
|
-
// This is made to help user to identify different ACRE account but not resilient to token account being wiped, emptied
|
140
|
-
// (empty subAccount would not been included in the list therefore parent account not considered as an acre account anymore).
|
141
|
-
function generateUniqueAccountName(
|
142
|
-
existingAccounts: Account[],
|
143
|
-
baseName: string,
|
144
|
-
tokenAddress: string,
|
145
|
-
): string {
|
146
|
-
const existingAccountWithAcreToken = existingAccounts.flatMap(
|
147
|
-
account =>
|
148
|
-
account.subAccounts?.filter(
|
149
|
-
subAccount => subAccount.token.contractAddress.toLowerCase() === tokenAddress.toLowerCase(),
|
150
|
-
) || [],
|
151
|
-
);
|
152
|
-
return existingAccountWithAcreToken.length > 0
|
153
|
-
? `${baseName} ${existingAccountWithAcreToken.length}`
|
154
|
-
: baseName;
|
155
|
-
}
|
156
|
-
|
157
|
-
// Helper function to create parent Ethereum account
|
158
|
-
function createParentAccount(ethereumAddress: string, ethereumCurrency: CryptoCurrency): Account {
|
159
|
-
return {
|
160
|
-
type: "Account" as const,
|
161
|
-
id: `js:2:ethereum:${ethereumAddress}:`,
|
162
|
-
seedIdentifier: `04${ethereumAddress.slice(2)}`,
|
163
|
-
derivationMode: "" as any,
|
164
|
-
index: 0,
|
165
|
-
freshAddress: ethereumAddress,
|
166
|
-
freshAddressPath: "44'/60'/0'/0/0",
|
167
|
-
used: false,
|
168
|
-
blockHeight: 0,
|
169
|
-
creationDate: new Date(),
|
170
|
-
balance: new BigNumber(0),
|
171
|
-
spendableBalance: new BigNumber(0),
|
172
|
-
operationsCount: 0,
|
173
|
-
operations: [],
|
174
|
-
pendingOperations: [],
|
175
|
-
currency: ethereumCurrency,
|
176
|
-
lastSyncDate: new Date(),
|
177
|
-
swapHistory: [],
|
178
|
-
balanceHistoryCache: {
|
179
|
-
HOUR: { latestDate: Date.now(), balances: [] },
|
180
|
-
DAY: { latestDate: Date.now(), balances: [] },
|
181
|
-
WEEK: { latestDate: Date.now(), balances: [] },
|
182
|
-
},
|
183
|
-
syncHash: "0x00000000", // Use proper hash format
|
184
|
-
subAccounts: [], // Add empty subAccounts array
|
185
|
-
nfts: [],
|
186
|
-
};
|
187
|
-
}
|
188
|
-
|
189
71
|
export const handlers = ({
|
190
72
|
accounts,
|
191
73
|
tracking,
|
@@ -194,7 +76,6 @@ export const handlers = ({
|
|
194
76
|
"custom.acre.messageSign": uiMessageSign,
|
195
77
|
"custom.acre.transactionSign": uiTransactionSign,
|
196
78
|
"custom.acre.transactionBroadcast": uiTransactionBroadcast,
|
197
|
-
"custom.acre.registerAccount": uiRegisterAccount,
|
198
79
|
},
|
199
80
|
}: {
|
200
81
|
accounts: AccountLike[];
|
@@ -211,16 +92,20 @@ export const handlers = ({
|
|
211
92
|
const transaction = deserializeTransaction(rawTransaction);
|
212
93
|
|
213
94
|
tracking.signTransactionRequested(manifest);
|
95
|
+
|
214
96
|
if (!transaction) {
|
215
97
|
tracking.signTransactionFail(manifest);
|
216
98
|
return Promise.reject(new Error("Transaction required"));
|
217
99
|
}
|
100
|
+
|
218
101
|
const accountId = getAccountIdFromWalletAccountId(walletAccountId);
|
219
102
|
if (!accountId) {
|
220
103
|
tracking.signTransactionFail(manifest);
|
221
104
|
return Promise.reject(new Error(`accountId ${walletAccountId} unknown`));
|
222
105
|
}
|
106
|
+
|
223
107
|
const account = accounts.find(account => account.id === accountId);
|
108
|
+
|
224
109
|
if (!account) {
|
225
110
|
tracking.signTransactionFail(manifest);
|
226
111
|
return Promise.reject(new Error("Account required"));
|
@@ -235,6 +120,7 @@ export const handlers = ({
|
|
235
120
|
const mainAccount = getMainAccount(account, parentAccount);
|
236
121
|
const currency = tokenCurrency ? findTokenById(tokenCurrency) : null;
|
237
122
|
const signerAccount = currency ? makeEmptyTokenAccount(mainAccount, currency) : account;
|
123
|
+
|
238
124
|
const { canEditFees, liveTx, hasFeesProvided } = getWalletAPITransactionSignFlowInfos({
|
239
125
|
walletApiTransaction: transaction,
|
240
126
|
account,
|
@@ -276,6 +162,7 @@ export const handlers = ({
|
|
276
162
|
});
|
277
163
|
});
|
278
164
|
}
|
165
|
+
|
279
166
|
return {
|
280
167
|
"custom.acre.messageSign": customWrapper<MessageSignParams, MessageSignResult>(async params => {
|
281
168
|
if (!params) {
|
@@ -388,6 +275,7 @@ export const handlers = ({
|
|
388
275
|
const broadcastAccount = getMainAccount(signerAccount, parentAccount);
|
389
276
|
|
390
277
|
let optimisticOperation: Operation = signedOperation.operation;
|
278
|
+
|
391
279
|
if (!getEnv("DISABLE_TRANSACTION_BROADCAST")) {
|
392
280
|
try {
|
393
281
|
optimisticOperation = await bridge.broadcast({
|
@@ -400,93 +288,17 @@ export const handlers = ({
|
|
400
288
|
throw error;
|
401
289
|
}
|
402
290
|
}
|
291
|
+
|
403
292
|
uiTransactionBroadcast &&
|
404
293
|
uiTransactionBroadcast(account, parentAccount, mainAccount, optimisticOperation);
|
294
|
+
|
405
295
|
return {
|
406
296
|
transactionHash: optimisticOperation.hash,
|
407
297
|
};
|
408
298
|
}),
|
409
|
-
"custom.acre.registerYieldBearingEthereumAddress": customWrapper<
|
410
|
-
RegisterYieldBearingEthereumAddressParams,
|
411
|
-
RegisterYieldBearingEthereumAddressResult
|
412
|
-
>(async params => {
|
413
|
-
if (!params) {
|
414
|
-
return Promise.reject(new Error("Parameters required"));
|
415
|
-
}
|
416
|
-
const validatedInputs = validateInputs(params);
|
417
|
-
const ethereumCurrency = getCryptoCurrencyById("ethereum");
|
418
|
-
const { token: existingToken, contractAddress: finalTokenContractAddress } = findAcreToken(
|
419
|
-
validatedInputs.tokenContractAddress,
|
420
|
-
validatedInputs.tokenTicker,
|
421
|
-
);
|
422
|
-
const existingBearingAccount = accounts.find(
|
423
|
-
account =>
|
424
|
-
"freshAddress" in account &&
|
425
|
-
(account as any).freshAddress === validatedInputs.ethereumAddress,
|
426
|
-
);
|
427
|
-
const baseName = "Yield-bearing BTC on ACRE";
|
428
|
-
// Account already added, skip registration.
|
429
|
-
if (existingBearingAccount) {
|
430
|
-
return {
|
431
|
-
success: true,
|
432
|
-
accountName: baseName,
|
433
|
-
parentAccountId: existingBearingAccount.id,
|
434
|
-
tokenAccountId: existingBearingAccount.id,
|
435
|
-
ethereumAddress: validatedInputs.ethereumAddress,
|
436
|
-
tokenContractAddress: finalTokenContractAddress,
|
437
|
-
meta: validatedInputs.meta,
|
438
|
-
};
|
439
|
-
}
|
440
|
-
|
441
|
-
if (uiRegisterAccount) {
|
442
|
-
// Create account & manage the case where an ACRE account has been already registered on another Ethereum address
|
443
|
-
// Filter to have only root accounts
|
444
|
-
const existingParentAccounts = accounts.filter(
|
445
|
-
(acc): acc is Account => acc.type === "Account",
|
446
|
-
);
|
447
|
-
const accountName = generateUniqueAccountName(
|
448
|
-
existingParentAccounts,
|
449
|
-
baseName,
|
450
|
-
finalTokenContractAddress,
|
451
|
-
);
|
452
|
-
const parentAccount = createParentAccount(
|
453
|
-
validatedInputs.ethereumAddress,
|
454
|
-
ethereumCurrency,
|
455
|
-
);
|
456
|
-
const tokenAccount = makeEmptyTokenAccount(parentAccount, existingToken);
|
457
|
-
// Add token account as sub-account of parent account
|
458
|
-
const parentAccountWithSubAccount = {
|
459
|
-
...parentAccount,
|
460
|
-
subAccounts: [tokenAccount],
|
461
|
-
};
|
462
|
-
|
463
|
-
return new Promise((resolve, reject) => {
|
464
|
-
uiRegisterAccount({
|
465
|
-
parentAccount: parentAccountWithSubAccount,
|
466
|
-
accountName,
|
467
|
-
existingAccounts: existingParentAccounts,
|
468
|
-
onSuccess: () => {
|
469
|
-
resolve({
|
470
|
-
success: true,
|
471
|
-
accountName,
|
472
|
-
parentAccountId: parentAccountWithSubAccount.id,
|
473
|
-
tokenAccountId: tokenAccount.id,
|
474
|
-
ethereumAddress: validatedInputs.ethereumAddress,
|
475
|
-
tokenContractAddress: finalTokenContractAddress,
|
476
|
-
meta: validatedInputs.meta,
|
477
|
-
});
|
478
|
-
},
|
479
|
-
onError: error => {
|
480
|
-
reject(error);
|
481
|
-
},
|
482
|
-
});
|
483
|
-
});
|
484
|
-
} else {
|
485
|
-
throw new Error("No account registration UI hook available");
|
486
|
-
}
|
487
|
-
}),
|
488
299
|
} as const satisfies Handlers;
|
489
300
|
};
|
301
|
+
|
490
302
|
function fromRelativePath(basePath: string, derivationPath?: string) {
|
491
303
|
if (!derivationPath) {
|
492
304
|
return basePath;
|
@@ -53,6 +53,7 @@ import { getSwapStepFromError } from "../../exchange/error";
|
|
53
53
|
import { postSwapCancelled } from "../../exchange/swap";
|
54
54
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
55
55
|
import { setBroadcastTransaction } from "../../exchange/swap/setBroadcastTransaction";
|
56
|
+
import { FAMILIES_MAPPING_LL_TO_WAPI } from "../constants";
|
56
57
|
|
57
58
|
export { ExchangeType };
|
58
59
|
|
@@ -485,11 +486,14 @@ export const handlers = ({
|
|
485
486
|
});
|
486
487
|
|
487
488
|
const mainFromAccount = getMainAccount(fromAccount, fromParentAccount);
|
489
|
+
const mainFromAccountFamily =
|
490
|
+
FAMILIES_MAPPING_LL_TO_WAPI[mainFromAccount.currency.family] ||
|
491
|
+
mainFromAccount.currency.family;
|
488
492
|
|
489
|
-
if (transaction.family !==
|
493
|
+
if (transaction.family !== mainFromAccountFamily) {
|
490
494
|
return Promise.reject(
|
491
495
|
new Error(
|
492
|
-
`Account and transaction must be from the same family. Account family: ${
|
496
|
+
`Account and transaction must be from the same family. Account family: ${mainFromAccountFamily}, Transaction family: ${transaction.family}`,
|
493
497
|
),
|
494
498
|
);
|
495
499
|
}
|
@@ -800,34 +804,27 @@ async function getStrategy(
|
|
800
804
|
delete customFeeConfig.utxoStrategy;
|
801
805
|
}
|
802
806
|
|
803
|
-
|
807
|
+
// Normalize family key for strategy lookup
|
808
|
+
const familyKey = FAMILIES_MAPPING_LL_TO_WAPI[family] || family;
|
809
|
+
const strategy = transactionStrategy?.[familyKey];
|
804
810
|
|
805
811
|
if (!strategy) {
|
806
|
-
throw new Error(`No transaction strategy found for family: ${
|
807
|
-
}
|
808
|
-
|
809
|
-
// Convert customFeeConfig values to BigNumber
|
810
|
-
const convertedCustomFeeConfig: { [key: string]: BigNumber } = {};
|
811
|
-
if (customFeeConfig) {
|
812
|
-
for (const [key, value] of Object.entries(customFeeConfig)) {
|
813
|
-
convertedCustomFeeConfig[key] = new BigNumber(value?.toString() || 0);
|
814
|
-
}
|
812
|
+
throw new Error(`No transaction strategy found for family: ${familyKey}`);
|
815
813
|
}
|
816
814
|
|
817
815
|
try {
|
818
816
|
return await strategy({
|
819
|
-
family,
|
820
|
-
amount
|
817
|
+
family: familyKey,
|
818
|
+
amount,
|
821
819
|
recipient,
|
822
|
-
customFeeConfig:
|
820
|
+
customFeeConfig: customFeeConfig || {},
|
823
821
|
payinExtraId,
|
824
822
|
extraTransactionParameters,
|
825
823
|
customErrorType,
|
826
824
|
});
|
827
825
|
} catch (error) {
|
828
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
829
826
|
throw new Error(
|
830
|
-
`Failed to execute transaction strategy for family: ${
|
827
|
+
`Failed to execute transaction strategy for family: ${familyKey}. Reason: ${(error as Error).message}`,
|
831
828
|
);
|
832
829
|
}
|
833
830
|
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { EvmAddress } from "@ledgerhq/coin-evm/types/signer";
|
2
|
-
import { CreateSigner } from "../../setup";
|
3
|
-
export type Signer = {
|
4
|
-
getAddress: (path: string) => Promise<EvmAddress>;
|
5
|
-
signTransaction: (path: string, tx: string) => Promise<string>;
|
6
|
-
};
|
7
|
-
export declare const createSigner: CreateSigner<Signer>;
|
8
|
-
//# sourceMappingURL=Eth.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Eth.d.ts","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/signer/Eth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA2B,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C,MAAM,MAAM,MAAM,GAAG;IACnB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAChE,CAAC;AAqBF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CAmC7C,CAAC"}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createSigner = void 0;
|
4
|
-
const rxjs_1 = require("rxjs");
|
5
|
-
const live_signer_evm_1 = require("@ledgerhq/live-signer-evm");
|
6
|
-
const live_env_1 = require("@ledgerhq/live-env");
|
7
|
-
const ethers_1 = require("ethers");
|
8
|
-
const isDmkTransport = (transport) => {
|
9
|
-
return ("dmk" in transport &&
|
10
|
-
transport.dmk !== undefined &&
|
11
|
-
"sessionId" in transport &&
|
12
|
-
transport.sessionId !== undefined);
|
13
|
-
};
|
14
|
-
const createLiveSigner = (transport) => {
|
15
|
-
if (isDmkTransport(transport)) {
|
16
|
-
return new live_signer_evm_1.DmkSignerEth(transport.dmk, transport.sessionId);
|
17
|
-
}
|
18
|
-
return new live_signer_evm_1.LegacySignerEth(transport);
|
19
|
-
};
|
20
|
-
const createSigner = (transport) => {
|
21
|
-
const signer = createLiveSigner(transport);
|
22
|
-
return {
|
23
|
-
getAddress: signer.getAddress.bind(signer),
|
24
|
-
signTransaction: async (path, tx) => {
|
25
|
-
// Configure type of resolutions necessary for the clear signing
|
26
|
-
const resolutionConfig = {
|
27
|
-
externalPlugins: true,
|
28
|
-
erc20: true,
|
29
|
-
nft: false,
|
30
|
-
uniswapV3: true,
|
31
|
-
};
|
32
|
-
const loadConfig = {
|
33
|
-
cryptoassetsBaseURL: (0, live_env_1.getEnv)("DYNAMIC_CAL_BASE_URL"),
|
34
|
-
nftExplorerBaseURL: (0, live_env_1.getEnv)("NFT_METADATA_SERVICE") + "/v1/ethereum",
|
35
|
-
};
|
36
|
-
signer.setLoadConfig(loadConfig);
|
37
|
-
const observable = signer.clearSignTransaction(path, tx.substring(2), resolutionConfig, true);
|
38
|
-
const event = observable.pipe((0, rxjs_1.filter)((event) => {
|
39
|
-
return event.type === "signer.evm.signed";
|
40
|
-
}));
|
41
|
-
const { value } = await (0, rxjs_1.firstValueFrom)(event);
|
42
|
-
return ethers_1.Signature.from({
|
43
|
-
r: "0x" + value.r,
|
44
|
-
s: "0x" + value.s,
|
45
|
-
v: typeof value.v === "number" ? value.v : parseInt(value.v, 16),
|
46
|
-
}).serialized;
|
47
|
-
},
|
48
|
-
};
|
49
|
-
};
|
50
|
-
exports.createSigner = createSigner;
|
51
|
-
//# sourceMappingURL=Eth.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Eth.js","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/signer/Eth.ts"],"names":[],"mappings":";;;AAAA,+BAA8C;AAI9C,+DAA0E;AAE1E,iDAA4C;AAE5C,mCAAmC;AAOnC,MAAM,cAAc,GAAG,CACrB,SAAoB,EACsD,EAAE;IAC5E,OAAO,CACL,KAAK,IAAI,SAAS;QAClB,SAAS,CAAC,GAAG,KAAK,SAAS;QAC3B,WAAW,IAAI,SAAS;QACxB,SAAS,CAAC,SAAS,KAAK,SAAS,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAA4B,CAAC,SAAoB,EAAE,EAAE;IACzE,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC7B,OAAO,IAAI,8BAAY,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC7D;IAED,OAAO,IAAI,iCAAe,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAEK,MAAM,YAAY,GAAyB,CAAC,SAAoB,EAAE,EAAE;IACzE,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAE3C,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAC1C,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;YAClC,gEAAgE;YAChE,MAAM,gBAAgB,GAAqB;gBACzC,eAAe,EAAE,IAAI;gBACrB,KAAK,EAAE,IAAI;gBACX,GAAG,EAAE,KAAK;gBACV,SAAS,EAAE,IAAI;aAChB,CAAC;YACF,MAAM,UAAU,GAAe;gBAC7B,mBAAmB,EAAE,IAAA,iBAAM,EAAC,sBAAsB,CAAC;gBACnD,kBAAkB,EAAE,IAAA,iBAAM,EAAC,sBAAsB,CAAC,GAAG,cAAc;aACpE,CAAC;YAEF,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEjC,MAAM,UAAU,GAAG,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;YAC9F,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAC3B,IAAA,aAAM,EAAC,CAAC,KAAK,EAA+D,EAAE;gBAC5E,OAAO,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC;YAC5C,CAAC,CAAC,CACH,CAAC;YACF,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,qBAAc,EAAC,KAAK,CAAC,CAAC;YAE9C,OAAO,kBAAS,CAAC,IAAI,CAAC;gBACpB,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;gBACjB,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;gBACjB,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;aACjE,CAAC,CAAC,UAAU,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAnCW,QAAA,YAAY,gBAmCvB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getAccountShape.test.d.ts","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/tests/getAccountShape.test.ts"],"names":[],"mappings":""}
|