@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
@@ -1,70 +0,0 @@
|
|
1
|
-
import { filter, firstValueFrom } from "rxjs";
|
2
|
-
import { EvmAddress, EvmSignature, EvmSigner } from "@ledgerhq/coin-evm/types/signer";
|
3
|
-
import { CreateSigner } from "../../setup";
|
4
|
-
import { DeviceManagementKit } from "@ledgerhq/device-management-kit";
|
5
|
-
import { DmkSignerEth, LegacySignerEth } from "@ledgerhq/live-signer-evm";
|
6
|
-
import Transport from "@ledgerhq/hw-transport";
|
7
|
-
import { getEnv } from "@ledgerhq/live-env";
|
8
|
-
import { ResolutionConfig, LoadConfig } from "@ledgerhq/hw-app-eth/lib/services/types";
|
9
|
-
import { Signature } from "ethers";
|
10
|
-
|
11
|
-
export type Signer = {
|
12
|
-
getAddress: (path: string) => Promise<EvmAddress>;
|
13
|
-
signTransaction: (path: string, tx: string) => Promise<string>;
|
14
|
-
};
|
15
|
-
|
16
|
-
const isDmkTransport = (
|
17
|
-
transport: Transport,
|
18
|
-
): transport is Transport & { dmk: DeviceManagementKit; sessionId: string } => {
|
19
|
-
return (
|
20
|
-
"dmk" in transport &&
|
21
|
-
transport.dmk !== undefined &&
|
22
|
-
"sessionId" in transport &&
|
23
|
-
transport.sessionId !== undefined
|
24
|
-
);
|
25
|
-
};
|
26
|
-
|
27
|
-
const createLiveSigner: CreateSigner<EvmSigner> = (transport: Transport) => {
|
28
|
-
if (isDmkTransport(transport)) {
|
29
|
-
return new DmkSignerEth(transport.dmk, transport.sessionId);
|
30
|
-
}
|
31
|
-
|
32
|
-
return new LegacySignerEth(transport);
|
33
|
-
};
|
34
|
-
|
35
|
-
export const createSigner: CreateSigner<Signer> = (transport: Transport) => {
|
36
|
-
const signer = createLiveSigner(transport);
|
37
|
-
|
38
|
-
return {
|
39
|
-
getAddress: signer.getAddress.bind(signer),
|
40
|
-
signTransaction: async (path, tx) => {
|
41
|
-
// Configure type of resolutions necessary for the clear signing
|
42
|
-
const resolutionConfig: ResolutionConfig = {
|
43
|
-
externalPlugins: true,
|
44
|
-
erc20: true,
|
45
|
-
nft: false,
|
46
|
-
uniswapV3: true,
|
47
|
-
};
|
48
|
-
const loadConfig: LoadConfig = {
|
49
|
-
cryptoassetsBaseURL: getEnv("DYNAMIC_CAL_BASE_URL"),
|
50
|
-
nftExplorerBaseURL: getEnv("NFT_METADATA_SERVICE") + "/v1/ethereum",
|
51
|
-
};
|
52
|
-
|
53
|
-
signer.setLoadConfig(loadConfig);
|
54
|
-
|
55
|
-
const observable = signer.clearSignTransaction(path, tx.substring(2), resolutionConfig, true);
|
56
|
-
const event = observable.pipe(
|
57
|
-
filter((event): event is { type: "signer.evm.signed"; value: EvmSignature } => {
|
58
|
-
return event.type === "signer.evm.signed";
|
59
|
-
}),
|
60
|
-
);
|
61
|
-
const { value } = await firstValueFrom(event);
|
62
|
-
|
63
|
-
return Signature.from({
|
64
|
-
r: "0x" + value.r,
|
65
|
-
s: "0x" + value.s,
|
66
|
-
v: typeof value.v === "number" ? value.v : parseInt(value.v, 16),
|
67
|
-
}).serialized;
|
68
|
-
},
|
69
|
-
};
|
70
|
-
};
|
@@ -1,173 +0,0 @@
|
|
1
|
-
import BigNumber from "bignumber.js";
|
2
|
-
import { genericGetAccountShape } from "../getAccountShape";
|
3
|
-
|
4
|
-
jest.mock("@ledgerhq/coin-framework/account/index", () => ({
|
5
|
-
encodeAccountId: jest.fn(() => "accId"),
|
6
|
-
}));
|
7
|
-
|
8
|
-
const mergeOpsMock = jest.fn();
|
9
|
-
jest.mock("@ledgerhq/coin-framework/bridge/jsHelpers", () => ({
|
10
|
-
mergeOps: (...args: any[]) => mergeOpsMock(...args),
|
11
|
-
}));
|
12
|
-
|
13
|
-
const listOperationsMock = jest.fn();
|
14
|
-
const getBalanceMock = jest.fn();
|
15
|
-
const lastBlockMock = jest.fn();
|
16
|
-
const getTokenFromAssetMock = jest.fn();
|
17
|
-
const chainSpecificGetAccountShapeMock = jest.fn();
|
18
|
-
jest.mock("../alpaca", () => ({
|
19
|
-
getAlpacaApi: () => ({
|
20
|
-
lastBlock: (...a: any[]) => lastBlockMock(...a),
|
21
|
-
getBalance: (...a: any[]) => getBalanceMock(...a),
|
22
|
-
listOperations: (...a: any[]) => listOperationsMock(...a),
|
23
|
-
getTokenFromAsset: (...a: any[]) => getTokenFromAssetMock(...a),
|
24
|
-
getChainSpecificRules: () => ({
|
25
|
-
getAccountShape: (...a: any[]) => chainSpecificGetAccountShapeMock(...a),
|
26
|
-
}),
|
27
|
-
}),
|
28
|
-
}));
|
29
|
-
|
30
|
-
const adaptCoreOperationToLiveOperationMock = jest.fn();
|
31
|
-
const extractBalanceMock = jest.fn();
|
32
|
-
jest.mock("../utils", () => ({
|
33
|
-
adaptCoreOperationToLiveOperation: (...a: any[]) => adaptCoreOperationToLiveOperationMock(...a),
|
34
|
-
extractBalance: (...a: any[]) => extractBalanceMock(...a),
|
35
|
-
}));
|
36
|
-
|
37
|
-
const inferSubOperationsMock = jest.fn();
|
38
|
-
jest.mock("@ledgerhq/coin-framework/serialization", () => ({
|
39
|
-
inferSubOperations: (...a: any[]) => inferSubOperationsMock(...a),
|
40
|
-
}));
|
41
|
-
|
42
|
-
const buildSubAccountsMock = jest.fn();
|
43
|
-
jest.mock("../buildSubAccounts", () => ({
|
44
|
-
buildSubAccounts: (...a: any[]) => buildSubAccountsMock(...a),
|
45
|
-
}));
|
46
|
-
|
47
|
-
// Test matrix for Stellar & XRP
|
48
|
-
const chains = [
|
49
|
-
{ currency: { id: "stellar", name: "Stellar" }, network: "testnet" },
|
50
|
-
{ currency: { id: "ripple", name: "XRP" }, network: "mainnet" },
|
51
|
-
];
|
52
|
-
|
53
|
-
describe("genericGetAccountShape (stellar & xrp)", () => {
|
54
|
-
beforeEach(() => {
|
55
|
-
jest.clearAllMocks();
|
56
|
-
});
|
57
|
-
|
58
|
-
describe.each(chains)("$currency.id", ({ currency, network }) => {
|
59
|
-
test("builds account shape with existing operations, pagination and sub accounts", async () => {
|
60
|
-
const oldOp = {
|
61
|
-
hash: "h1",
|
62
|
-
blockHeight: 10,
|
63
|
-
type: "OPT_IN",
|
64
|
-
extra: { pagingToken: "pt1", assetReference: "ar1", assetOwner: "ow1" },
|
65
|
-
};
|
66
|
-
const initialAccount = { operations: [oldOp], blockHeight: 10 };
|
67
|
-
|
68
|
-
extractBalanceMock.mockReturnValue({ value: "1000", locked: "300" });
|
69
|
-
getBalanceMock.mockResolvedValue([
|
70
|
-
{ asset: { type: "native" }, value: "1000", locked: "300" },
|
71
|
-
{ asset: { type: "token", symbol: "TOK1" }, value: "42" },
|
72
|
-
{ asset: { type: "token", symbol: "TOK_IGNORE" }, value: "5" },
|
73
|
-
]);
|
74
|
-
|
75
|
-
getTokenFromAssetMock.mockImplementation(asset =>
|
76
|
-
asset.symbol === "TOK1" ? { id: `${currency.id}_token1` } : null,
|
77
|
-
);
|
78
|
-
|
79
|
-
const coreOp = { hash: "h2", height: 12 };
|
80
|
-
listOperationsMock.mockResolvedValue([[coreOp]]);
|
81
|
-
|
82
|
-
adaptCoreOperationToLiveOperationMock.mockImplementation((_accId, op) => ({
|
83
|
-
hash: op.hash,
|
84
|
-
type: "IN",
|
85
|
-
blockHeight: 12,
|
86
|
-
extra: { assetReference: "ar2", assetOwner: "ow2" },
|
87
|
-
}));
|
88
|
-
|
89
|
-
mergeOpsMock.mockImplementation((oldOps, newOps) => [...newOps, ...oldOps]);
|
90
|
-
|
91
|
-
buildSubAccountsMock.mockReturnValue([
|
92
|
-
{ id: `${currency.id}_subAcc1`, type: "TokenAccount" },
|
93
|
-
]);
|
94
|
-
|
95
|
-
inferSubOperationsMock.mockImplementation(hash =>
|
96
|
-
hash === "h2" ? [{ id: `${currency.id}_subOp1` }] : [],
|
97
|
-
);
|
98
|
-
|
99
|
-
lastBlockMock.mockResolvedValue({ height: 123 });
|
100
|
-
|
101
|
-
const getShape = genericGetAccountShape(network, currency.id);
|
102
|
-
const result = await getShape(
|
103
|
-
{
|
104
|
-
address: `${currency.id}_addr1`,
|
105
|
-
initialAccount,
|
106
|
-
currency,
|
107
|
-
derivationMode: "",
|
108
|
-
} as any,
|
109
|
-
{ paginationConfig: {} as any },
|
110
|
-
);
|
111
|
-
|
112
|
-
expect(chainSpecificGetAccountShapeMock).toHaveBeenCalledWith(`${currency.id}_addr1`);
|
113
|
-
|
114
|
-
expect(listOperationsMock).toHaveBeenCalledWith(`${currency.id}_addr1`, {
|
115
|
-
minHeight: 11,
|
116
|
-
order: "asc",
|
117
|
-
lastPagingToken: "pt1",
|
118
|
-
});
|
119
|
-
|
120
|
-
const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].assetsBalance;
|
121
|
-
expect(assetsBalancePassed).toHaveLength(1);
|
122
|
-
expect(assetsBalancePassed[0].asset.symbol).toBe("TOK1");
|
123
|
-
|
124
|
-
const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
|
125
|
-
expect(assetOpsPassed).toHaveLength(1);
|
126
|
-
expect(assetOpsPassed[0].hash).toBe("h2");
|
127
|
-
|
128
|
-
expect(result).toMatchObject({
|
129
|
-
balance: new BigNumber(1000),
|
130
|
-
spendableBalance: new BigNumber(700),
|
131
|
-
blockHeight: 123,
|
132
|
-
operationsCount: 2,
|
133
|
-
subAccounts: [{ id: `${currency.id}_subAcc1`, type: "TokenAccount" }],
|
134
|
-
operations: [
|
135
|
-
{
|
136
|
-
hash: "h2",
|
137
|
-
type: "IN",
|
138
|
-
blockHeight: 12,
|
139
|
-
subOperations: [{ id: `${currency.id}_subOp1` }],
|
140
|
-
extra: { assetReference: "ar2", assetOwner: "ow2" },
|
141
|
-
},
|
142
|
-
oldOp,
|
143
|
-
],
|
144
|
-
});
|
145
|
-
});
|
146
|
-
|
147
|
-
test("handles empty operations (no old ops, no new ops) and blockHeight=0", async () => {
|
148
|
-
getBalanceMock.mockResolvedValue([{ asset: { type: "native" }, value: "0", locked: "0" }]);
|
149
|
-
extractBalanceMock.mockReturnValue({ value: "0", locked: "0" });
|
150
|
-
listOperationsMock.mockResolvedValue([[]]);
|
151
|
-
buildSubAccountsMock.mockReturnValue([]);
|
152
|
-
|
153
|
-
const getShape = genericGetAccountShape(network, currency.id);
|
154
|
-
const result = await getShape(
|
155
|
-
{
|
156
|
-
address: `${currency.id}_addr2`,
|
157
|
-
initialAccount: undefined,
|
158
|
-
currency,
|
159
|
-
derivationMode: "",
|
160
|
-
} as any,
|
161
|
-
{ paginationConfig: {} as any },
|
162
|
-
);
|
163
|
-
expect(result).toMatchObject({
|
164
|
-
operations: [], // Empty array check for `operations`
|
165
|
-
blockHeight: 0,
|
166
|
-
operationsCount: 0,
|
167
|
-
subAccounts: [], // Empty array check for `subAccounts`
|
168
|
-
balance: new BigNumber(0),
|
169
|
-
spendableBalance: new BigNumber(0),
|
170
|
-
});
|
171
|
-
});
|
172
|
-
});
|
173
|
-
});
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import expect from "expect";
|
2
|
-
import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos";
|
3
|
-
import { DeviceLabels } from "../enum/DeviceLabels";
|
4
|
-
import { Delegate } from "../models/Delegate";
|
5
|
-
|
6
|
-
export async function sendKaspa() {
|
7
|
-
await pressUntilTextFound(DeviceLabels.APPROVE);
|
8
|
-
await pressBoth();
|
9
|
-
}
|
10
|
-
|
11
|
-
export async function delegateKaspa(delegatingAccount: Delegate) {
|
12
|
-
await waitFor(DeviceLabels.REVIEW_OPERATION);
|
13
|
-
const events = await pressUntilTextFound(DeviceLabels.APPROVE);
|
14
|
-
const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
|
15
|
-
expect(isAmountCorrect).toBeTruthy();
|
16
|
-
await pressBoth();
|
17
|
-
}
|
@@ -1,66 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`kaspa currency bridge scanAccounts kaspa seed 1 1`] = `
|
4
|
-
[
|
5
|
-
{
|
6
|
-
"balance": "13370000",
|
7
|
-
"currencyId": "kaspa",
|
8
|
-
"derivationMode": "",
|
9
|
-
"freshAddress": "kaspa:qz49rpg0q6ywewxkwl76757ya79v6j556hcmrcy7mk9d36ewgp80cdrwlct2h",
|
10
|
-
"freshAddressPath": "44'/111111'/0'/0/1",
|
11
|
-
"id": "js:2:kaspa:41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576:",
|
12
|
-
"index": 0,
|
13
|
-
"operationsCount": 1,
|
14
|
-
"pendingOperations": [],
|
15
|
-
"seedIdentifier": "41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576",
|
16
|
-
"spendableBalance": "13370000",
|
17
|
-
"swapHistory": [],
|
18
|
-
"syncHash": undefined,
|
19
|
-
"used": true,
|
20
|
-
"xpub": "41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576",
|
21
|
-
},
|
22
|
-
{
|
23
|
-
"balance": "0",
|
24
|
-
"currencyId": "kaspa",
|
25
|
-
"derivationMode": "",
|
26
|
-
"freshAddress": "kaspa:qpncmme6ues25uk9umkqju4rtwtt33ud9lcrp7qn8jwv62m53m26jpjhar48j",
|
27
|
-
"freshAddressPath": "44'/111111'/1'/0/0",
|
28
|
-
"id": "js:2:kaspa:4104751b5ebd4a9d2a0a25d5c37cab4814a95335b8945cfcaa6a4138de418f581bb1d0d02f22081b3cda223a51e18a63ebdffd64803e0988b68a91802738a5a9f901206d4a2b989a82b5fb160f0151ea5d046451a291a0748f3038ecdc63d637cce00b:",
|
29
|
-
"index": 1,
|
30
|
-
"operationsCount": 0,
|
31
|
-
"pendingOperations": [],
|
32
|
-
"seedIdentifier": "41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576",
|
33
|
-
"spendableBalance": "0",
|
34
|
-
"swapHistory": [],
|
35
|
-
"syncHash": undefined,
|
36
|
-
"used": false,
|
37
|
-
"xpub": "4104751b5ebd4a9d2a0a25d5c37cab4814a95335b8945cfcaa6a4138de418f581bb1d0d02f22081b3cda223a51e18a63ebdffd64803e0988b68a91802738a5a9f901206d4a2b989a82b5fb160f0151ea5d046451a291a0748f3038ecdc63d637cce00b",
|
38
|
-
},
|
39
|
-
]
|
40
|
-
`;
|
41
|
-
|
42
|
-
exports[`kaspa currency bridge scanAccounts kaspa seed 1 2`] = `
|
43
|
-
[
|
44
|
-
[
|
45
|
-
{
|
46
|
-
"accountId": "js:2:kaspa:41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576:",
|
47
|
-
"blockHash": "12166d40313b71447d4dd837f2e91e749407b0a1c8844e9e9d010390a67d6b52",
|
48
|
-
"blockHeight": 194187672,
|
49
|
-
"extra": {},
|
50
|
-
"fee": "2069",
|
51
|
-
"hash": "ed6dc5422558c3480e6a7809bf166e6ba1f2931ef39f24fe9b3bcf48253e4752",
|
52
|
-
"id": "ed6dc5422558c3480e6a7809bf166e6ba1f2931ef39f24fe9b3bcf48253e4752",
|
53
|
-
"recipients": [
|
54
|
-
"kaspa:qzavrhr9eg0k7pgr8mysfej34alfy8uj6vc9r84kgqfkqd8rtgxm5t0jvah73",
|
55
|
-
"kaspa:qqt874j85r5ga5av0q6tthj2tu89dfpchjmvjuvx5tyn2vpjjrhk7tcpsx2vu",
|
56
|
-
],
|
57
|
-
"senders": [
|
58
|
-
"kaspa:qqt874j85r5ga5av0q6tthj2tu89dfpchjmvjuvx5tyn2vpjjrhk7tcpsx2vu",
|
59
|
-
],
|
60
|
-
"type": "IN",
|
61
|
-
"value": "13370000",
|
62
|
-
},
|
63
|
-
],
|
64
|
-
[],
|
65
|
-
]
|
66
|
-
`;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import type { Account, FeeStrategy } from "@ledgerhq/types-live";
|
2
|
-
import type { Transaction } from "@ledgerhq/coin-kaspa/types/index";
|
3
|
-
import { BigNumber } from "bignumber.js";
|
4
|
-
|
5
|
-
export const useFeesStrategy = (a: Account, t: Transaction): FeeStrategy[] => {
|
6
|
-
const allSameEstimatedSeconds: boolean = t.networkInfo.every(
|
7
|
-
ni => ni.estimatedSeconds === t.networkInfo[0].estimatedSeconds,
|
8
|
-
);
|
9
|
-
|
10
|
-
return t.networkInfo.map(ni => ({
|
11
|
-
label: ni.label,
|
12
|
-
amount: ni.amount,
|
13
|
-
disabled: (ni.label === "slow" || ni.label === "medium") && allSameEstimatedSeconds,
|
14
|
-
extra: {
|
15
|
-
estimatedMs: BigNumber(ni.estimatedSeconds * 1000),
|
16
|
-
},
|
17
|
-
unit: a.currency.units[a.currency.units.length - 1], // Should be sat
|
18
|
-
}));
|
19
|
-
};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
// Goal of this file is to inject all necessary device/signer dependency to coin-modules
|
2
|
-
|
3
|
-
import kaspaResolver from "@ledgerhq/coin-kaspa/hw-getAddress";
|
4
|
-
import Kaspa from "@ledgerhq/hw-app-kaspa";
|
5
|
-
import Transport from "@ledgerhq/hw-transport";
|
6
|
-
import { createResolver, CreateSigner, executeWithSigner } from "../../bridge/setup";
|
7
|
-
import type { Resolver } from "../../hw/getAddress/types";
|
8
|
-
import { KaspaSigner } from "@ledgerhq/coin-kaspa/types/signer";
|
9
|
-
import { KaspaAccount, Transaction, TransactionStatus } from "@ledgerhq/coin-kaspa/types/bridge";
|
10
|
-
import { createBridges } from "@ledgerhq/coin-kaspa/bridge";
|
11
|
-
import type { Bridge } from "@ledgerhq/types-live";
|
12
|
-
import makeCliTools from "@ledgerhq/coin-kaspa/test/cli";
|
13
|
-
|
14
|
-
const createSigner: CreateSigner<KaspaSigner> = (transport: Transport) => {
|
15
|
-
return new Kaspa(transport);
|
16
|
-
};
|
17
|
-
|
18
|
-
// const kaspaCoin = getCryptoCurrencyById("kaspa");
|
19
|
-
const resolver: Resolver = createResolver(createSigner, kaspaResolver);
|
20
|
-
// const getCurrencyConfig = (): KaspaCoinConfig => getCurrencyConfiguration(kaspaCoin);
|
21
|
-
|
22
|
-
const bridge: Bridge<Transaction, KaspaAccount, TransactionStatus> = createBridges(
|
23
|
-
executeWithSigner(createSigner),
|
24
|
-
);
|
25
|
-
const cliTools = makeCliTools;
|
26
|
-
|
27
|
-
export { bridge, cliTools, resolver };
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from "@ledgerhq/coin-kaspa/types/index";
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import { ChangeEvent, useCallback, useState } from "react";
|
2
|
-
|
3
|
-
export type UseSearchParams = {
|
4
|
-
/** Initial value to display in the search input */
|
5
|
-
initialValue?: string;
|
6
|
-
/** Persist the search value to the host app state (e.g., Redux) */
|
7
|
-
onPersistSearchValue?: (value: string) => void;
|
8
|
-
/** Track analytics when the debounced value changes and should be emitted */
|
9
|
-
onTrackSearch?: (query: string) => void;
|
10
|
-
};
|
11
|
-
|
12
|
-
export type UseSearchResult = {
|
13
|
-
handleSearch: (queryOrEvent: string | ChangeEvent<HTMLInputElement>) => void;
|
14
|
-
handleDebouncedChange: (current: string, previous: string) => void;
|
15
|
-
displayedValue: string | undefined;
|
16
|
-
};
|
17
|
-
|
18
|
-
const normalize = (value: string) => value.trim();
|
19
|
-
|
20
|
-
export function useSearchCommon({
|
21
|
-
initialValue,
|
22
|
-
onPersistSearchValue,
|
23
|
-
onTrackSearch,
|
24
|
-
}: UseSearchParams): UseSearchResult {
|
25
|
-
const [displayedValue, setDisplayedValue] = useState<string | undefined>(initialValue);
|
26
|
-
|
27
|
-
const handleSearch = useCallback((queryOrEvent: string | ChangeEvent<HTMLInputElement>) => {
|
28
|
-
const nextValue = typeof queryOrEvent === "string" ? queryOrEvent : queryOrEvent.target.value;
|
29
|
-
setDisplayedValue(nextValue);
|
30
|
-
}, []);
|
31
|
-
|
32
|
-
const shouldEmitEvent = useCallback(
|
33
|
-
(currentQuery: string, previousQuery: string) =>
|
34
|
-
currentQuery !== "" && currentQuery !== previousQuery,
|
35
|
-
[],
|
36
|
-
);
|
37
|
-
const handleDebouncedChange = useCallback(
|
38
|
-
(current: string, previous: string) => {
|
39
|
-
const currentQuery = normalize(current);
|
40
|
-
const previousQuery = normalize(previous);
|
41
|
-
|
42
|
-
onPersistSearchValue?.(currentQuery);
|
43
|
-
|
44
|
-
if (!shouldEmitEvent(currentQuery, previousQuery)) return;
|
45
|
-
|
46
|
-
onTrackSearch?.(currentQuery);
|
47
|
-
},
|
48
|
-
[onPersistSearchValue, onTrackSearch, shouldEmitEvent],
|
49
|
-
);
|
50
|
-
|
51
|
-
return { handleSearch, handleDebouncedChange, displayedValue };
|
52
|
-
}
|