@ledgerhq/live-common 34.48.0-nightly.8 → 34.48.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/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/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 -12
- 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/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/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 -12
- 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/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 +53 -56
- 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/Network.ts +0 -1
- package/src/e2e/speculos.ts +0 -12
- 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/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/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/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/wallet-api/ACRE/server.test.ts +0 -470
package/src/apps/react.ts
CHANGED
@@ -12,12 +12,14 @@ import {
|
|
12
12
|
import { runAppOp } from "./runner";
|
13
13
|
import { App } from "@ledgerhq/types-live";
|
14
14
|
import { useFeatureFlags } from "../featureFlags";
|
15
|
+
import { AppStorageType, StorageProvider } from "../device/use-cases/appDataBackup/types";
|
15
16
|
|
16
17
|
type UseAppsRunnerResult = [State, (arg0: Action) => void];
|
17
18
|
// use for React apps. support dynamic change of the state.
|
18
19
|
export const useAppsRunner = (
|
19
20
|
listResult: ListAppsResult,
|
20
21
|
exec: Exec,
|
22
|
+
storage: StorageProvider<AppStorageType>,
|
21
23
|
appsToRestore?: string[],
|
22
24
|
): UseAppsRunnerResult => {
|
23
25
|
// $FlowFixMe for ledger-live-mobile older react/flow version
|
@@ -34,7 +36,7 @@ export const useAppsRunner = (
|
|
34
36
|
|
35
37
|
useEffect(() => {
|
36
38
|
if (appOp) {
|
37
|
-
const sub = runAppOp({ state, appOp, exec }).subscribe(event => {
|
39
|
+
const sub = runAppOp({ state, appOp, exec, storage }).subscribe(event => {
|
38
40
|
dispatch({
|
39
41
|
type: "onRunnerEvent",
|
40
42
|
event,
|
package/src/apps/runner.ts
CHANGED
@@ -13,15 +13,18 @@ import type { Exec, State, AppOp, RunnerEvent, Action } from "./types";
|
|
13
13
|
import { reducer, getActionPlan, getNextAppOp } from "./logic";
|
14
14
|
import { delay } from "../promise";
|
15
15
|
import { getEnv } from "@ledgerhq/live-env";
|
16
|
+
import { AppStorageType, StorageProvider } from "../device/use-cases/appDataBackup/types";
|
16
17
|
|
17
18
|
export const runAppOp = ({
|
18
19
|
state,
|
19
20
|
appOp,
|
20
21
|
exec,
|
22
|
+
storage,
|
21
23
|
}: {
|
22
24
|
state: State;
|
23
25
|
appOp: AppOp;
|
24
26
|
exec: Exec;
|
27
|
+
storage?: StorageProvider<AppStorageType>;
|
25
28
|
}): Observable<RunnerEvent> => {
|
26
29
|
const { appByName, deviceInfo, deviceModel } = state;
|
27
30
|
const app = appByName[appOp.name];
|
@@ -53,6 +56,7 @@ export const runAppOp = ({
|
|
53
56
|
targetId: deviceInfo.targetId,
|
54
57
|
app,
|
55
58
|
modelId: deviceModel.id,
|
59
|
+
...(storage ? { storage } : {}),
|
56
60
|
...(state.skipAppDataBackup ? { skipAppDataBackup: true } : {}),
|
57
61
|
}),
|
58
62
|
).pipe(
|
@@ -95,6 +99,7 @@ type InlineInstallProgress = {
|
|
95
99
|
export const runAllWithProgress = (
|
96
100
|
state: State,
|
97
101
|
exec: Exec,
|
102
|
+
storage?: StorageProvider<AppStorageType>,
|
98
103
|
precision = 100,
|
99
104
|
): Observable<InlineInstallProgress> => {
|
100
105
|
const total = state.uninstallQueue.length + state.installQueue.length;
|
@@ -105,7 +110,9 @@ export const runAllWithProgress = (
|
|
105
110
|
return p;
|
106
111
|
}
|
107
112
|
|
108
|
-
return concat(
|
113
|
+
return concat(
|
114
|
+
...getActionPlan(state).map(appOp => runAppOp({ state, appOp, exec, storage })),
|
115
|
+
).pipe(
|
109
116
|
map(event => {
|
110
117
|
if (event.type === "runError") {
|
111
118
|
throw event.error;
|
@@ -14,14 +14,9 @@ import { genericEstimateMaxSpendable } from "./estimateMaxSpendable";
|
|
14
14
|
import { createTransaction } from "./createTransaction";
|
15
15
|
import { genericBroadcast } from "./broadcast";
|
16
16
|
import { genericSignOperation } from "./signOperation";
|
17
|
-
import type { AlpacaSigner } from "./signer/types";
|
18
17
|
|
19
|
-
export function getAlpacaAccountBridge(
|
20
|
-
network
|
21
|
-
kind: string,
|
22
|
-
customSigner?: AlpacaSigner,
|
23
|
-
): AccountBridge<any> {
|
24
|
-
const signer = customSigner ?? getSigner(network);
|
18
|
+
export function getAlpacaAccountBridge(network: string, kind: string): AccountBridge<any> {
|
19
|
+
const signer = getSigner(network);
|
25
20
|
return {
|
26
21
|
sync: makeSync({ getAccountShape: genericGetAccountShape(network, kind) }),
|
27
22
|
receive: makeAccountBridgeReceive(getAddressWrapper(signer.getAddress)),
|
@@ -33,5 +28,5 @@ export function getAlpacaAccountBridge(
|
|
33
28
|
broadcast: genericBroadcast(network, kind),
|
34
29
|
signOperation: genericSignOperation(network, kind)(signer.context),
|
35
30
|
getSerializedAddressParameters, // NOTE: check wether it should be exposed by coin-module's api instead?
|
36
|
-
} satisfies Partial<AccountBridge<any
|
31
|
+
} satisfies Partial<AccountBridge<any>> as AccountBridge<any>;
|
37
32
|
}
|
@@ -2,32 +2,37 @@ import { createApi as createXrpApi } from "@ledgerhq/coin-xrp/api/index";
|
|
2
2
|
import { createApi as createStellarApi } from "@ledgerhq/coin-stellar/api/index";
|
3
3
|
import { createApi as createCantonApi } from "@ledgerhq/coin-canton/api/index";
|
4
4
|
import { createApi as createTronApi } from "@ledgerhq/coin-tron/api/index";
|
5
|
-
import { createApi as createEvmApi } from "@ledgerhq/coin-evm/api/index";
|
6
5
|
import { getCurrencyConfiguration } from "../../../config";
|
6
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
7
7
|
import { getNetworkAlpacaApi } from "./network/network-alpaca";
|
8
8
|
import { Api } from "@ledgerhq/coin-framework/api/types";
|
9
9
|
import { XrpCoinConfig } from "@ledgerhq/coin-xrp/config";
|
10
10
|
import { StellarCoinConfig } from "@ledgerhq/coin-stellar/config";
|
11
11
|
import { CantonCoinConfig } from "@ledgerhq/coin-canton/config";
|
12
12
|
import { TronCoinConfig } from "@ledgerhq/coin-tron/config";
|
13
|
-
import { EvmConfigInfo } from "@ledgerhq/coin-evm/config";
|
14
|
-
import { findCryptoCurrencyByNetwork } from "../utils";
|
15
13
|
|
16
|
-
export function getAlpacaApi(network
|
14
|
+
export function getAlpacaApi(network, kind): Api<any> {
|
17
15
|
if (kind === "local") {
|
18
|
-
|
19
|
-
switch (currency?.family) {
|
16
|
+
switch (network) {
|
20
17
|
case "xrp":
|
21
|
-
return createXrpApi(
|
18
|
+
return createXrpApi(
|
19
|
+
getCurrencyConfiguration<XrpCoinConfig>(getCryptoCurrencyById("ripple")),
|
20
|
+
) as Api<any>; // FIXME: createXrpApi returns a strongly typed Api<XrpSender>, fix Api<any> to allow it
|
22
21
|
case "stellar":
|
23
|
-
return createStellarApi(
|
22
|
+
return createStellarApi(
|
23
|
+
getCurrencyConfiguration<StellarCoinConfig>(getCryptoCurrencyById("stellar")),
|
24
|
+
) as Api<any>;
|
24
25
|
case "canton":
|
25
|
-
return createCantonApi(
|
26
|
+
return createCantonApi(
|
27
|
+
getCurrencyConfiguration<CantonCoinConfig>(
|
28
|
+
getCryptoCurrencyById("canton_network_devnet"),
|
29
|
+
),
|
30
|
+
) as Api<any>;
|
26
31
|
case "tron":
|
27
|
-
return createTronApi(
|
28
|
-
|
29
|
-
|
32
|
+
return createTronApi(
|
33
|
+
getCurrencyConfiguration<TronCoinConfig>(getCryptoCurrencyById("tron")),
|
34
|
+
) as Api<any>;
|
30
35
|
}
|
31
36
|
}
|
32
|
-
return getNetworkAlpacaApi(network) satisfies Partial<Api<any
|
37
|
+
return getNetworkAlpacaApi(network) satisfies Partial<Api<any>> as Api<any>;
|
33
38
|
}
|
@@ -3,7 +3,6 @@ import * as xrpModule from "@ledgerhq/coin-xrp/api/index";
|
|
3
3
|
import * as stellarModule from "@ledgerhq/coin-stellar/api/index";
|
4
4
|
import * as cantonModule from "@ledgerhq/coin-canton/api/index";
|
5
5
|
import * as tronModule from "@ledgerhq/coin-tron/api/index";
|
6
|
-
import * as evmModule from "@ledgerhq/coin-evm/api/index";
|
7
6
|
import * as config from "../../../config";
|
8
7
|
import * as networkApi from "./network/network-alpaca";
|
9
8
|
import * as cryptoAssets from "@ledgerhq/cryptoassets/currencies";
|
@@ -11,7 +10,7 @@ import * as cryptoAssets from "@ledgerhq/cryptoassets/currencies";
|
|
11
10
|
const mockApiInstance = { mock: "api" };
|
12
11
|
|
13
12
|
jest.mock("@ledgerhq/cryptoassets/currencies", () => ({
|
14
|
-
|
13
|
+
getCryptoCurrencyById: jest.fn(),
|
15
14
|
}));
|
16
15
|
|
17
16
|
jest.mock("../../../config", () => ({
|
@@ -34,37 +33,18 @@ jest.mock("@ledgerhq/coin-tron/api/index", () => ({
|
|
34
33
|
createApi: jest.fn(),
|
35
34
|
}));
|
36
35
|
|
37
|
-
jest.mock("@ledgerhq/coin-evm/api/index", () => ({
|
38
|
-
createApi: jest.fn(),
|
39
|
-
}));
|
40
|
-
|
41
36
|
jest.mock("./network/network-alpaca", () => ({
|
42
37
|
getNetworkAlpacaApi: jest.fn(),
|
43
38
|
}));
|
44
39
|
|
45
40
|
describe("getAlpacaApi", () => {
|
41
|
+
const mockCurrency = { id: "mock-currency" };
|
42
|
+
|
46
43
|
beforeEach(() => {
|
47
44
|
jest.clearAllMocks();
|
48
45
|
|
49
46
|
// Common mocks
|
50
|
-
(cryptoAssets.
|
51
|
-
switch (id) {
|
52
|
-
case "ripple":
|
53
|
-
return { family: "xrp" };
|
54
|
-
case "stellar":
|
55
|
-
return { family: "stellar" };
|
56
|
-
case "canton":
|
57
|
-
return { family: "canton" };
|
58
|
-
case "tron":
|
59
|
-
return { family: "tron" };
|
60
|
-
case "ethereum":
|
61
|
-
return { family: "evm" };
|
62
|
-
case "sonic":
|
63
|
-
return { family: "evm" };
|
64
|
-
default:
|
65
|
-
return undefined;
|
66
|
-
}
|
67
|
-
});
|
47
|
+
(cryptoAssets.getCryptoCurrencyById as jest.Mock).mockReturnValue(mockCurrency);
|
68
48
|
(config.getCurrencyConfiguration as jest.Mock).mockReturnValue({ config: true });
|
69
49
|
|
70
50
|
// API mocks
|
@@ -72,29 +52,21 @@ describe("getAlpacaApi", () => {
|
|
72
52
|
jest.spyOn(stellarModule, "createApi").mockReturnValue(mockApiInstance as any);
|
73
53
|
jest.spyOn(cantonModule, "createApi").mockReturnValue(mockApiInstance as any);
|
74
54
|
jest.spyOn(tronModule, "createApi").mockReturnValue(mockApiInstance as any);
|
75
|
-
jest.spyOn(evmModule, "createApi").mockReturnValue(mockApiInstance as any);
|
76
55
|
jest.spyOn(networkApi, "getNetworkAlpacaApi").mockReturnValue(mockApiInstance as any);
|
77
56
|
});
|
78
57
|
|
79
58
|
const testCases = [
|
80
|
-
{ network: "xrp", module: xrpModule, label: "XRP"
|
81
|
-
{ network: "stellar", module: stellarModule, label: "Stellar"
|
82
|
-
{ network: "tron", module: tronModule, label: "Tron"
|
83
|
-
{ network: "canton", module: cantonModule, label: "Canton"
|
84
|
-
{
|
85
|
-
network: "ethereum",
|
86
|
-
module: evmModule,
|
87
|
-
label: "Ethereum",
|
88
|
-
params: [{ config: true }, "ethereum"],
|
89
|
-
},
|
90
|
-
{ network: "sonic", module: evmModule, label: "Sonic", params: [{ config: true }, "sonic"] },
|
59
|
+
{ network: "xrp", module: xrpModule, label: "XRP" },
|
60
|
+
{ network: "stellar", module: stellarModule, label: "Stellar" },
|
61
|
+
{ network: "tron", module: tronModule, label: "Tron" },
|
62
|
+
{ network: "canton", module: cantonModule, label: "Canton" },
|
91
63
|
];
|
92
64
|
|
93
|
-
testCases.forEach(({ network, module, label
|
65
|
+
testCases.forEach(({ network, module, label }) => {
|
94
66
|
it(`should return ${label} API for network "${network}" and kind "local"`, () => {
|
95
67
|
const result = getAlpacaApi(network, "local");
|
96
68
|
expect(result).toEqual(mockApiInstance);
|
97
|
-
expect(module.createApi).toHaveBeenCalledWith(
|
69
|
+
expect(module.createApi).toHaveBeenCalledWith({ config: true });
|
98
70
|
});
|
99
71
|
});
|
100
72
|
|
@@ -19,7 +19,7 @@ export function createTransaction(account: Account | TokenAccount): TransactionC
|
|
19
19
|
feeCustomUnit?: Unit | null | undefined;
|
20
20
|
memoType?: string | null;
|
21
21
|
memoValue?: string | null;
|
22
|
-
mode?: "send" | "changeTrust"
|
22
|
+
mode?: "send" | "changeTrust";
|
23
23
|
assetReference?: string;
|
24
24
|
assetOwner?: string;
|
25
25
|
networkInfo?: NetworkInfo | null;
|
@@ -51,14 +51,6 @@ export function createTransaction(account: Account | TokenAccount): TransactionC
|
|
51
51
|
assetOwner: "",
|
52
52
|
networkInfo: null,
|
53
53
|
};
|
54
|
-
case "evm": {
|
55
|
-
return {
|
56
|
-
mode: "send-eip1559",
|
57
|
-
family: currency.family,
|
58
|
-
amount: new BigNumber(0),
|
59
|
-
recipient: "",
|
60
|
-
};
|
61
|
-
}
|
62
54
|
default:
|
63
55
|
throw new Error(`Unsupported currency family: ${currency.family}`);
|
64
56
|
}
|
@@ -2,14 +2,8 @@ import { makeScanAccounts } from "@ledgerhq/coin-framework/bridge/jsHelpers";
|
|
2
2
|
import { CurrencyBridge } from "@ledgerhq/types-live";
|
3
3
|
import { genericGetAccountShape } from "./getAccountShape";
|
4
4
|
import { getSigner } from "./signer";
|
5
|
-
import type { AlpacaSigner } from "./signer/types";
|
6
5
|
|
7
|
-
export function getAlpacaCurrencyBridge(
|
8
|
-
network: string,
|
9
|
-
kind: string,
|
10
|
-
customSigner?: AlpacaSigner,
|
11
|
-
): CurrencyBridge {
|
12
|
-
const signer = customSigner ?? getSigner(network);
|
6
|
+
export function getAlpacaCurrencyBridge(network: string, kind: string): CurrencyBridge {
|
13
7
|
return {
|
14
8
|
preload: () => Promise.resolve({}),
|
15
9
|
hydrate: () => {
|
@@ -17,7 +11,7 @@ export function getAlpacaCurrencyBridge(
|
|
17
11
|
},
|
18
12
|
scanAccounts: makeScanAccounts({
|
19
13
|
getAccountShape: genericGetAccountShape(network, kind),
|
20
|
-
getAddressFn:
|
14
|
+
getAddressFn: getSigner(network).getAddress,
|
21
15
|
}),
|
22
16
|
};
|
23
17
|
}
|
@@ -73,7 +73,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
73
73
|
getTokenFromAsset: alpacaApi.getTokenFromAsset,
|
74
74
|
}) || [];
|
75
75
|
|
76
|
-
const
|
76
|
+
const operationsWithSubs = mergedOps.map(op => {
|
77
77
|
const subOperations = inferSubOperations(op.hash, subAccounts);
|
78
78
|
|
79
79
|
return {
|
@@ -85,12 +85,13 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
85
85
|
const res = {
|
86
86
|
id: accountId,
|
87
87
|
xpub: address,
|
88
|
-
blockHeight:
|
88
|
+
blockHeight:
|
89
|
+
operationsWithSubs.length === 0 ? 0 : blockInfo.height || initialAccount?.blockHeight,
|
89
90
|
balance: new BigNumber(nativeBalance.toString()),
|
90
91
|
spendableBalance: new BigNumber(spendableBalance.toString()),
|
91
|
-
operations,
|
92
|
+
operations: operationsWithSubs,
|
92
93
|
subAccounts,
|
93
|
-
operationsCount:
|
94
|
+
operationsCount: operationsWithSubs.length,
|
94
95
|
};
|
95
96
|
return res;
|
96
97
|
};
|
@@ -1,12 +1,22 @@
|
|
1
|
+
import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
|
1
2
|
import xrpGetAddress from "@ledgerhq/coin-xrp/signer/getAddress";
|
2
3
|
import stellarGetAddress from "@ledgerhq/coin-stellar/signer/getAddress";
|
3
|
-
import Stellar from "@ledgerhq/hw-app-str";
|
4
|
-
import { signTransaction, stellarSignTransaction } from "./signTransaction";
|
5
|
-
import { StrKey } from "@stellar/stellar-sdk";
|
6
4
|
import { CreateSigner, executeWithSigner } from "../../setup";
|
7
5
|
import Xrp from "@ledgerhq/hw-app-xrp";
|
6
|
+
import Stellar from "@ledgerhq/hw-app-str";
|
7
|
+
|
8
8
|
import Transport from "@ledgerhq/hw-transport";
|
9
|
-
import {
|
9
|
+
import { signTransaction, stellarSignTransaction } from "./signTransaction";
|
10
|
+
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
11
|
+
import { SignTransactionOptions } from "./types";
|
12
|
+
import { StrKey } from "@stellar/stellar-sdk";
|
13
|
+
|
14
|
+
export type AlpacaSigner = {
|
15
|
+
getAddress: GetAddressFn;
|
16
|
+
signTransaction?: (deviceId: string, opts: SignTransactionOptions) => Promise<string>;
|
17
|
+
signMessage?: (message: string) => Promise<string>;
|
18
|
+
context: SignerContext<any>;
|
19
|
+
};
|
10
20
|
|
11
21
|
const createSignerXrp: CreateSigner<Xrp> = (transport: Transport) => {
|
12
22
|
return new Xrp(transport);
|
@@ -37,7 +47,7 @@ const createSignerStellar: CreateSigner<Stellar> = (transport: Transport) => {
|
|
37
47
|
|
38
48
|
const signerContextStellar = executeWithSigner(createSignerStellar);
|
39
49
|
|
40
|
-
export function getSigner(network
|
50
|
+
export function getSigner(network): AlpacaSigner {
|
41
51
|
switch (network) {
|
42
52
|
case "ripple":
|
43
53
|
case "xrp": {
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
2
|
+
import { XrpSigner } from "@ledgerhq/coin-xrp/index";
|
3
|
+
import { SignTransactionOptions } from "./types";
|
2
4
|
import { StellarSigner } from "@ledgerhq/coin-stellar/types/signer";
|
3
|
-
import { LegacySigner, SignTransactionOptions } from "./types";
|
4
5
|
|
5
|
-
export const signTransaction = <
|
6
|
-
signerContext: SignerContext<Signer>,
|
7
|
-
) => {
|
6
|
+
export const signTransaction = (signerContext: SignerContext<XrpSigner>) => {
|
8
7
|
return async (deviceId: string, { path, rawTxHex }: SignTransactionOptions) => {
|
9
8
|
const signedTx = await signerContext(deviceId, signer =>
|
10
9
|
signer.signTransaction(path, rawTxHex),
|
@@ -1,17 +1,3 @@
|
|
1
|
-
import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
|
2
|
-
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
3
|
-
|
4
|
-
export type LegacySigner = {
|
5
|
-
signTransaction: (path: string, rawTxHex: string) => Promise<string>;
|
6
|
-
};
|
7
|
-
|
8
|
-
export type AlpacaSigner<S = unknown> = {
|
9
|
-
getAddress: GetAddressFn;
|
10
|
-
signTransaction?: (deviceId: string, opts: SignTransactionOptions) => Promise<string>;
|
11
|
-
signMessage?: (message: string) => Promise<string>;
|
12
|
-
context: SignerContext<S>;
|
13
|
-
};
|
14
|
-
|
15
1
|
export type SignTransactionOptions = {
|
16
2
|
rawTxHex: string;
|
17
3
|
path: string;
|
@@ -1,36 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
adaptCoreOperationToLiveOperation,
|
3
|
-
extractBalance,
|
4
|
-
findCryptoCurrencyByNetwork,
|
5
|
-
} from "./utils";
|
1
|
+
import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
|
6
2
|
import BigNumber from "bignumber.js";
|
7
3
|
import { Operation as CoreOperation } from "@ledgerhq/coin-framework/api/types";
|
8
4
|
|
9
5
|
describe("Alpaca utils", () => {
|
10
|
-
describe("findCryptoCurrencyByNetwork", () => {
|
11
|
-
it("finds a crypto currency by id", () => {
|
12
|
-
expect(findCryptoCurrencyByNetwork("ethereum")).toMatchObject({
|
13
|
-
id: "ethereum",
|
14
|
-
family: "evm",
|
15
|
-
});
|
16
|
-
});
|
17
|
-
|
18
|
-
it("takes currency remapping into account", () => {
|
19
|
-
expect(findCryptoCurrencyByNetwork("ripple")).toMatchObject({
|
20
|
-
id: "ripple",
|
21
|
-
family: "xrp",
|
22
|
-
});
|
23
|
-
expect(findCryptoCurrencyByNetwork("xrp")).toMatchObject({
|
24
|
-
id: "ripple",
|
25
|
-
family: "xrp",
|
26
|
-
});
|
27
|
-
});
|
28
|
-
|
29
|
-
it("does not find non existing currencies", () => {
|
30
|
-
expect(findCryptoCurrencyByNetwork("non_existing_currency")).toBeUndefined();
|
31
|
-
});
|
32
|
-
});
|
33
|
-
|
34
6
|
describe("extractBalance", () => {
|
35
7
|
it("extracts an existing balance", () => {
|
36
8
|
expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type1")).toEqual({
|
@@ -7,15 +7,6 @@ import {
|
|
7
7
|
Operation as CoreOperation,
|
8
8
|
TransactionIntent,
|
9
9
|
} from "@ledgerhq/coin-framework/api/types";
|
10
|
-
import { findCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
11
|
-
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
12
|
-
|
13
|
-
export function findCryptoCurrencyByNetwork(network: string): CryptoCurrency | undefined {
|
14
|
-
const networksRemap = {
|
15
|
-
xrp: "ripple",
|
16
|
-
};
|
17
|
-
return findCryptoCurrencyById(networksRemap[network] ?? network);
|
18
|
-
}
|
19
10
|
|
20
11
|
export function extractBalance(balances: Balance[], type: string): Balance {
|
21
12
|
return (
|
@@ -119,12 +110,6 @@ export function transactionToIntent(
|
|
119
110
|
case "send":
|
120
111
|
transactionType = "send";
|
121
112
|
break;
|
122
|
-
case "send-legacy":
|
123
|
-
transactionType = "send-legacy";
|
124
|
-
break;
|
125
|
-
case "send-eip1559":
|
126
|
-
transactionType = "send-eip1559";
|
127
|
-
break;
|
128
113
|
default:
|
129
114
|
throw new Error(`Unsupported transaction mode: ${transaction.mode}`);
|
130
115
|
}
|
@@ -11,7 +11,6 @@ import { evmConfig } from "../families/evm/config";
|
|
11
11
|
import { fileCoinConfig } from "../families/filecoin/config";
|
12
12
|
import { hederaConfig } from "../families/hedera/config";
|
13
13
|
import { internetComputerConfig } from "../families/internet_computer/config";
|
14
|
-
import { kaspaConfig } from "../families/kaspa/config";
|
15
14
|
import { nearConfig } from "../families/near/config";
|
16
15
|
import { minaConfig } from "../families/mina/config";
|
17
16
|
import { polkadotConfig } from "../families/polkadot/config";
|
@@ -56,7 +55,6 @@ export const liveConfig: ConfigSchema = {
|
|
56
55
|
...fileCoinConfig,
|
57
56
|
...hederaConfig,
|
58
57
|
...internetComputerConfig,
|
59
|
-
...kaspaConfig,
|
60
58
|
...nearConfig,
|
61
59
|
...minaConfig,
|
62
60
|
...polkadotConfig,
|
package/src/e2e/enum/Account.ts
CHANGED
@@ -276,20 +276,6 @@ export class Account {
|
|
276
276
|
0,
|
277
277
|
);
|
278
278
|
|
279
|
-
static readonly KASPA_1 = new Account(
|
280
|
-
Currency.KAS,
|
281
|
-
"KASPA 1",
|
282
|
-
"kaspa:kaspa:qqpqtujclz2usyj7rgmhghfu8e5echrh8t2pkz69tq37uclfrpu3g0w6laqqk",
|
283
|
-
0,
|
284
|
-
);
|
285
|
-
|
286
|
-
static readonly KASPA_2 = new Account(
|
287
|
-
Currency.KAS,
|
288
|
-
"KASPA 2",
|
289
|
-
"kaspa:qrx2agwk93qyjvlcuzz5jy37knt298zupvw2ls05p4te55c29uwuyzzra5qkv",
|
290
|
-
1,
|
291
|
-
);
|
292
|
-
|
293
279
|
static readonly LTC_1 = new Account(
|
294
280
|
Currency.LTC,
|
295
281
|
"Litecoin 1",
|
package/src/e2e/enum/AppInfos.ts
CHANGED
package/src/e2e/enum/Currency.ts
CHANGED
@@ -25,8 +25,6 @@ export class Currency {
|
|
25
25
|
|
26
26
|
static readonly APT = new Currency("Aptos", "APT", "aptos", AppInfos.APTOS, [Network.APTOS]);
|
27
27
|
|
28
|
-
static readonly KAS = new Currency("Kaspa", "KAS", "kaspa", AppInfos.KASPA, [Network.KASPA]);
|
29
|
-
|
30
28
|
static readonly tBTC = new Currency(
|
31
29
|
"Bitcoin Testnet",
|
32
30
|
"𝚝BTC",
|
package/src/e2e/enum/Network.ts
CHANGED
package/src/e2e/speculos.ts
CHANGED
@@ -30,7 +30,6 @@ import { sendXRP } from "./families/xrp";
|
|
30
30
|
import { delegateAptos, sendAptos } from "./families/aptos";
|
31
31
|
import { delegateNear } from "./families/near";
|
32
32
|
import { delegateCosmos, sendCosmos } from "./families/cosmos";
|
33
|
-
import { sendKaspa } from "./families/kaspa";
|
34
33
|
import { delegateSolana, sendSolana } from "./families/solana";
|
35
34
|
import { delegateTezos } from "./families/tezos";
|
36
35
|
import { delegateCelo } from "./families/celo";
|
@@ -326,14 +325,6 @@ export const specs: Specs = {
|
|
326
325
|
},
|
327
326
|
dependency: "",
|
328
327
|
},
|
329
|
-
Kaspa: {
|
330
|
-
currency: getCryptoCurrencyById("kaspa"),
|
331
|
-
appQuery: {
|
332
|
-
model: getSpeculosModel(),
|
333
|
-
appName: "Kaspa",
|
334
|
-
},
|
335
|
-
dependency: "",
|
336
|
-
},
|
337
328
|
};
|
338
329
|
|
339
330
|
export async function startSpeculos(
|
@@ -686,9 +677,6 @@ export async function signSendTransaction(tx: Transaction) {
|
|
686
677
|
case Currency.APT:
|
687
678
|
await sendAptos();
|
688
679
|
break;
|
689
|
-
case Currency.KAS:
|
690
|
-
await sendKaspa();
|
691
|
-
break;
|
692
680
|
default:
|
693
681
|
throw new Error(`Unsupported currency: ${currencyName.ticker}`);
|
694
682
|
}
|