@ledgerhq/live-common 34.37.0-nightly.4 → 34.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +4 -4
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/bridge/impl.js +3 -59
- package/lib/bridge/impl.js.map +1 -1
- package/lib/config/index.d.ts +2 -3
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js +1 -9
- package/lib/config/index.js.map +1 -1
- package/lib/config/sharedConfig.d.ts.map +1 -1
- package/lib/config/sharedConfig.js +0 -7
- package/lib/config/sharedConfig.js.map +1 -1
- package/lib/e2e/index.d.ts +0 -4
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +0 -3
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosCI.js +1 -1
- package/lib/exchange/providers/swap.d.ts +0 -1
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.integration.test.js +12 -26
- package/lib/exchange/providers/swap.integration.test.js.map +1 -1
- package/lib/exchange/providers/swap.js +0 -25
- package/lib/exchange/providers/swap.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 +6 -3
- package/lib/families/xrp/setup.d.ts.map +1 -1
- package/lib/families/xrp/setup.js +7 -1
- package/lib/families/xrp/setup.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +0 -10
- 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 +1 -0
- package/lib/generated/bridge/js.d.ts.map +1 -1
- package/lib/generated/bridge/js.js +6 -4
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/hooks/useOFACGeoBlockCheck.js +1 -1
- package/lib/hooks/useOFACGeoBlockCheck.js.map +1 -1
- package/lib/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib/hw/connectAppEventMapper.js +4 -4
- package/lib/hw/connectAppEventMapper.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts +0 -2
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +0 -6
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/ModularDrawer/types.d.ts +25 -30
- package/lib/wallet-api/ModularDrawer/types.d.ts.map +1 -1
- package/lib/wallet-api/ModularDrawer/types.js +11 -15
- package/lib/wallet-api/ModularDrawer/types.js.map +1 -1
- package/lib/wallet-api/ModularDrawer/utils.js +1 -1
- package/lib/wallet-api/ModularDrawer/utils.js.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js +4 -4
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/bridge/impl.d.ts.map +1 -1
- package/lib-es/bridge/impl.js +3 -59
- package/lib-es/bridge/impl.js.map +1 -1
- package/lib-es/config/index.d.ts +2 -3
- package/lib-es/config/index.d.ts.map +1 -1
- package/lib-es/config/index.js +1 -8
- package/lib-es/config/index.js.map +1 -1
- package/lib-es/config/sharedConfig.d.ts.map +1 -1
- package/lib-es/config/sharedConfig.js +0 -7
- package/lib-es/config/sharedConfig.js.map +1 -1
- package/lib-es/e2e/index.d.ts +0 -4
- 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 -3
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosCI.js +1 -1
- package/lib-es/exchange/providers/swap.d.ts +0 -1
- package/lib-es/exchange/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.integration.test.js +13 -27
- package/lib-es/exchange/providers/swap.integration.test.js.map +1 -1
- package/lib-es/exchange/providers/swap.js +0 -25
- package/lib-es/exchange/providers/swap.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 +6 -3
- package/lib-es/families/xrp/setup.d.ts.map +1 -1
- package/lib-es/families/xrp/setup.js +7 -2
- package/lib-es/families/xrp/setup.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +0 -10
- 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 +1 -0
- package/lib-es/generated/bridge/js.d.ts.map +1 -1
- package/lib-es/generated/bridge/js.js +2 -0
- package/lib-es/generated/bridge/js.js.map +1 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js +1 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js.map +1 -1
- package/lib-es/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib-es/hw/connectAppEventMapper.js +5 -5
- package/lib-es/hw/connectAppEventMapper.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts +0 -2
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +0 -6
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/ModularDrawer/types.d.ts +25 -30
- package/lib-es/wallet-api/ModularDrawer/types.d.ts.map +1 -1
- package/lib-es/wallet-api/ModularDrawer/types.js +5 -9
- package/lib-es/wallet-api/ModularDrawer/types.js.map +1 -1
- package/lib-es/wallet-api/ModularDrawer/utils.js +1 -1
- package/lib-es/wallet-api/ModularDrawer/utils.js.map +1 -1
- package/package.json +69 -69
- package/src/__tests__/test-helpers/bridge.ts +4 -2
- package/src/bridge/impl.ts +5 -87
- package/src/config/index.ts +2 -11
- package/src/config/sharedConfig.ts +0 -8
- package/src/e2e/speculos.ts +0 -3
- package/src/e2e/speculosCI.ts +1 -1
- package/src/exchange/providers/swap.integration.test.ts +16 -33
- package/src/exchange/providers/swap.ts +0 -32
- package/src/families/evm/config.ts +2 -2
- package/src/families/xrp/setup.ts +15 -2
- package/src/featureFlags/defaultFeatures.ts +0 -12
- package/src/generated/bridge/js.ts +2 -0
- package/src/hooks/useOFACGeoBlockCheck.ts +1 -1
- package/src/hw/connectAppEventMapper.ts +4 -4
- package/src/wallet-api/Exchange/server.ts +0 -8
- package/src/wallet-api/ModularDrawer/types.ts +5 -9
- package/src/wallet-api/ModularDrawer/utils.ts +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.d.ts +0 -3
- package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/accountBridge.js +0 -34
- package/lib/bridge/generic-alpaca/accountBridge.js.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts +0 -3
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/index.js +0 -20
- package/lib/bridge/generic-alpaca/alpaca/index.js.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +0 -16
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -123
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +0 -1
- package/lib/bridge/generic-alpaca/broadcast.d.ts +0 -3
- package/lib/bridge/generic-alpaca/broadcast.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/broadcast.js +0 -11
- package/lib/bridge/generic-alpaca/broadcast.js.map +0 -1
- package/lib/bridge/generic-alpaca/createTransaction.d.ts +0 -16
- package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/createTransaction.js +0 -20
- package/lib/bridge/generic-alpaca/createTransaction.js.map +0 -1
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts +0 -3
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/currencyBridge.js +0 -20
- package/lib/bridge/generic-alpaca/currencyBridge.js.map +0 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts +0 -3
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +0 -26
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +0 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts +0 -3
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +0 -58
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +0 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts +0 -3
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +0 -36
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +0 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +0 -3
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +0 -21
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +0 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts +0 -7
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/signOperation.js +0 -49
- package/lib/bridge/generic-alpaca/signOperation.js.map +0 -1
- package/lib/bridge/generic-alpaca/signer/index.d.ts +0 -11
- package/lib/bridge/generic-alpaca/signer/index.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/signer/index.js +0 -28
- package/lib/bridge/generic-alpaca/signer/index.js.map +0 -1
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +0 -5
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/signer/signTransaction.js +0 -11
- package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +0 -1
- package/lib/bridge/generic-alpaca/signer/types.d.ts +0 -5
- package/lib/bridge/generic-alpaca/signer/types.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/signer/types.js +0 -3
- package/lib/bridge/generic-alpaca/signer/types.js.map +0 -1
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts +0 -2
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +0 -90
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +0 -1
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts +0 -2
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +0 -53
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +0 -1
- package/lib/bridge/generic-alpaca/tests/signOperation.test.d.ts +0 -2
- package/lib/bridge/generic-alpaca/tests/signOperation.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/tests/signOperation.test.js +0 -79
- package/lib/bridge/generic-alpaca/tests/signOperation.test.js.map +0 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +0 -6
- package/lib/bridge/generic-alpaca/utils.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/utils.js +0 -55
- package/lib/bridge/generic-alpaca/utils.js.map +0 -1
- package/lib/hooks/useShowProviderLoadingTransition.d.ts +0 -9
- package/lib/hooks/useShowProviderLoadingTransition.d.ts.map +0 -1
- package/lib/hooks/useShowProviderLoadingTransition.js +0 -46
- package/lib/hooks/useShowProviderLoadingTransition.js.map +0 -1
- package/lib/hooks/useShowProviderLoadingTransition.test.d.ts +0 -5
- package/lib/hooks/useShowProviderLoadingTransition.test.d.ts.map +0 -1
- package/lib/hooks/useShowProviderLoadingTransition.test.js +0 -83
- package/lib/hooks/useShowProviderLoadingTransition.test.js.map +0 -1
- package/lib/sanction/errors.d.ts +0 -13
- package/lib/sanction/errors.d.ts.map +0 -1
- package/lib/sanction/errors.js +0 -36
- package/lib/sanction/errors.js.map +0 -1
- package/lib/sanction/index.d.ts +0 -3
- package/lib/sanction/index.d.ts.map +0 -1
- package/lib/sanction/index.js +0 -51
- package/lib/sanction/index.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.js +0 -27
- package/lib-es/bridge/generic-alpaca/accountBridge.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.js +0 -16
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +0 -16
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -116
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/broadcast.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/broadcast.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/broadcast.js +0 -7
- package/lib-es/bridge/generic-alpaca/broadcast.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +0 -16
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.js +0 -13
- package/lib-es/bridge/generic-alpaca/createTransaction.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.js +0 -16
- package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +0 -19
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +0 -51
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +0 -29
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +0 -3
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +0 -14
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts +0 -7
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +0 -45
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts +0 -11
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/index.js +0 -21
- package/lib-es/bridge/generic-alpaca/signer/index.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +0 -5
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.js +0 -7
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/types.d.ts +0 -5
- package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/signer/types.js +0 -2
- package/lib-es/bridge/generic-alpaca/signer/types.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts +0 -2
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +0 -62
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts +0 -2
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +0 -48
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.d.ts +0 -2
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js +0 -77
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +0 -6
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/utils.js +0 -46
- package/lib-es/bridge/generic-alpaca/utils.js.map +0 -1
- package/lib-es/hooks/useShowProviderLoadingTransition.d.ts +0 -9
- package/lib-es/hooks/useShowProviderLoadingTransition.d.ts.map +0 -1
- package/lib-es/hooks/useShowProviderLoadingTransition.js +0 -41
- package/lib-es/hooks/useShowProviderLoadingTransition.js.map +0 -1
- package/lib-es/hooks/useShowProviderLoadingTransition.test.d.ts +0 -5
- package/lib-es/hooks/useShowProviderLoadingTransition.test.d.ts.map +0 -1
- package/lib-es/hooks/useShowProviderLoadingTransition.test.js +0 -81
- package/lib-es/hooks/useShowProviderLoadingTransition.test.js.map +0 -1
- package/lib-es/sanction/errors.d.ts +0 -13
- package/lib-es/sanction/errors.d.ts.map +0 -1
- package/lib-es/sanction/errors.js +0 -29
- package/lib-es/sanction/errors.js.map +0 -1
- package/lib-es/sanction/index.d.ts +0 -3
- package/lib-es/sanction/index.d.ts.map +0 -1
- package/lib-es/sanction/index.js +0 -44
- package/lib-es/sanction/index.js.map +0 -1
- package/src/bridge/generic-alpaca/accountBridge.ts +0 -32
- package/src/bridge/generic-alpaca/alpaca/index.ts +0 -20
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +0 -182
- package/src/bridge/generic-alpaca/broadcast.ts +0 -11
- package/src/bridge/generic-alpaca/createTransaction.ts +0 -27
- package/src/bridge/generic-alpaca/currencyBridge.ts +0 -17
- package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +0 -27
- package/src/bridge/generic-alpaca/getAccountShape.ts +0 -62
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +0 -38
- package/src/bridge/generic-alpaca/prepareTransaction.ts +0 -22
- package/src/bridge/generic-alpaca/signOperation.ts +0 -83
- package/src/bridge/generic-alpaca/signer/index.ts +0 -33
- package/src/bridge/generic-alpaca/signer/signTransaction.ts +0 -13
- package/src/bridge/generic-alpaca/signer/types.ts +0 -4
- package/src/bridge/generic-alpaca/tests/estimateMaxSpendable.test.ts +0 -76
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +0 -66
- package/src/bridge/generic-alpaca/tests/signOperation.test.ts +0 -96
- package/src/bridge/generic-alpaca/utils.ts +0 -63
- package/src/hooks/useShowProviderLoadingTransition.test.ts +0 -112
- package/src/hooks/useShowProviderLoadingTransition.ts +0 -57
- package/src/sanction/errors.ts +0 -31
- package/src/sanction/index.ts +0 -59
@@ -1,66 +0,0 @@
|
|
1
|
-
import { genericPrepareTransaction } from "../prepareTransaction";
|
2
|
-
import { getAlpacaApi } from "../alpaca";
|
3
|
-
import { transactionToIntent } from "../utils";
|
4
|
-
import BigNumber from "bignumber.js";
|
5
|
-
import type { TransactionCommon } from "@ledgerhq/types-live";
|
6
|
-
|
7
|
-
jest.mock("../alpaca", () => ({
|
8
|
-
getAlpacaApi: jest.fn(),
|
9
|
-
}));
|
10
|
-
|
11
|
-
jest.mock("../utils", () => ({
|
12
|
-
transactionToIntent: jest.fn(),
|
13
|
-
}));
|
14
|
-
|
15
|
-
describe("genericPrepareTransaction", () => {
|
16
|
-
const network = "testnet";
|
17
|
-
const kind = "local";
|
18
|
-
|
19
|
-
const account = {
|
20
|
-
id: "test-account",
|
21
|
-
address: "0xabc",
|
22
|
-
} as any;
|
23
|
-
|
24
|
-
const baseTransaction: TransactionCommon & { fees: BigNumber } = {
|
25
|
-
amount: new BigNumber(100_000),
|
26
|
-
fees: new BigNumber(500),
|
27
|
-
recipient: "0xrecipient",
|
28
|
-
};
|
29
|
-
|
30
|
-
const txIntent = { mock: "intent" };
|
31
|
-
|
32
|
-
beforeEach(() => {
|
33
|
-
jest.clearAllMocks();
|
34
|
-
(transactionToIntent as jest.Mock).mockReturnValue(txIntent);
|
35
|
-
});
|
36
|
-
|
37
|
-
it("updates fees if they differ", async () => {
|
38
|
-
const newFee = new BigNumber(700);
|
39
|
-
|
40
|
-
(getAlpacaApi as jest.Mock).mockReturnValue({
|
41
|
-
estimateFees: jest.fn().mockResolvedValue({ value: newFee }),
|
42
|
-
});
|
43
|
-
|
44
|
-
const prepareTransaction = genericPrepareTransaction(network, kind);
|
45
|
-
const result = await prepareTransaction(account, { ...baseTransaction });
|
46
|
-
|
47
|
-
expect((result as any).fees.toString()).toBe(newFee.toString());
|
48
|
-
expect(transactionToIntent).toHaveBeenCalledWith(
|
49
|
-
account,
|
50
|
-
expect.objectContaining(baseTransaction),
|
51
|
-
);
|
52
|
-
});
|
53
|
-
|
54
|
-
it("returns original transaction if fees are the same", async () => {
|
55
|
-
const sameFee = baseTransaction.fees;
|
56
|
-
|
57
|
-
(getAlpacaApi as jest.Mock).mockReturnValue({
|
58
|
-
estimateFees: jest.fn().mockResolvedValue({ value: sameFee }),
|
59
|
-
});
|
60
|
-
|
61
|
-
const prepareTransaction = genericPrepareTransaction(network, kind);
|
62
|
-
const result = await prepareTransaction(account, { ...baseTransaction });
|
63
|
-
|
64
|
-
expect(result).toStrictEqual(baseTransaction);
|
65
|
-
});
|
66
|
-
});
|
@@ -1,96 +0,0 @@
|
|
1
|
-
import { lastValueFrom } from "rxjs";
|
2
|
-
import { toArray } from "rxjs/operators";
|
3
|
-
import { genericSignOperation } from "../signOperation";
|
4
|
-
import { FeeNotLoaded } from "@ledgerhq/errors";
|
5
|
-
import { getAlpacaApi } from "../alpaca";
|
6
|
-
import { buildOptimisticOperation, transactionToIntent } from "../utils";
|
7
|
-
|
8
|
-
jest.mock("../alpaca", () => ({
|
9
|
-
getAlpacaApi: jest.fn(),
|
10
|
-
}));
|
11
|
-
|
12
|
-
jest.mock("../utils", () => ({
|
13
|
-
buildOptimisticOperation: jest.fn(),
|
14
|
-
transactionToIntent: jest.fn(),
|
15
|
-
}));
|
16
|
-
|
17
|
-
describe("genericSignOperation", () => {
|
18
|
-
const network = "xrp";
|
19
|
-
const kind = "local";
|
20
|
-
|
21
|
-
const mockSignerContext = jest.fn();
|
22
|
-
const mockSigner = {
|
23
|
-
getAddress: jest.fn(),
|
24
|
-
signTransaction: jest.fn(),
|
25
|
-
};
|
26
|
-
|
27
|
-
const account = {
|
28
|
-
freshAddressPath: "44'/144'/0'/0/0",
|
29
|
-
address: "rTestAddress",
|
30
|
-
} as any;
|
31
|
-
|
32
|
-
const transaction = {
|
33
|
-
amount: 100_000n,
|
34
|
-
fees: 500n,
|
35
|
-
tag: 1234,
|
36
|
-
} as any;
|
37
|
-
|
38
|
-
const deviceId = "mockDevice";
|
39
|
-
|
40
|
-
const txIntent = {
|
41
|
-
memo: {
|
42
|
-
type: "map",
|
43
|
-
memos: new Map(),
|
44
|
-
},
|
45
|
-
};
|
46
|
-
|
47
|
-
const unsignedTx = "unsignedTx";
|
48
|
-
const signedTx = "signedTx";
|
49
|
-
const pubKey = "pubKey";
|
50
|
-
|
51
|
-
beforeEach(() => {
|
52
|
-
jest.clearAllMocks();
|
53
|
-
|
54
|
-
(getAlpacaApi as jest.Mock).mockReturnValue({
|
55
|
-
craftTransaction: jest.fn().mockResolvedValue(unsignedTx),
|
56
|
-
combine: jest.fn().mockResolvedValue(signedTx),
|
57
|
-
});
|
58
|
-
|
59
|
-
(transactionToIntent as jest.Mock).mockReturnValue(txIntent);
|
60
|
-
(buildOptimisticOperation as jest.Mock).mockReturnValue({ id: "mock-op" });
|
61
|
-
|
62
|
-
mockSigner.getAddress.mockResolvedValue({ publicKey: pubKey });
|
63
|
-
mockSigner.signTransaction.mockResolvedValue("sig");
|
64
|
-
mockSignerContext.mockImplementation(async (_deviceId, cb) => cb(mockSigner));
|
65
|
-
});
|
66
|
-
|
67
|
-
it("emits full sign operation flow", async () => {
|
68
|
-
const signOperation = genericSignOperation(network, kind)(mockSignerContext);
|
69
|
-
const observable = signOperation({ account, transaction, deviceId });
|
70
|
-
|
71
|
-
const events = await lastValueFrom(observable.pipe(toArray()));
|
72
|
-
|
73
|
-
expect(events[0]).toEqual({ type: "device-signature-requested" });
|
74
|
-
expect(events[1]).toEqual({ type: "device-signature-granted" });
|
75
|
-
expect(events[2]).toEqual({
|
76
|
-
type: "signed",
|
77
|
-
signedOperation: {
|
78
|
-
operation: { id: "mock-op" },
|
79
|
-
signature: signedTx,
|
80
|
-
},
|
81
|
-
});
|
82
|
-
|
83
|
-
expect(transactionToIntent).toHaveBeenCalledWith(account, transaction);
|
84
|
-
expect(txIntent.memo.memos.get("destinationTag")).toBe("1234");
|
85
|
-
});
|
86
|
-
|
87
|
-
it("throws FeeNotLoaded if fees are missing", async () => {
|
88
|
-
const txWithoutFees = { ...transaction };
|
89
|
-
delete txWithoutFees.fees;
|
90
|
-
|
91
|
-
const signOperation = genericSignOperation(network, kind)(mockSignerContext);
|
92
|
-
const observable = signOperation({ account, transaction: txWithoutFees, deviceId });
|
93
|
-
|
94
|
-
await expect(observable.toPromise()).rejects.toThrow(FeeNotLoaded);
|
95
|
-
});
|
96
|
-
});
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
|
2
|
-
import { Account, Operation, OperationType, TransactionCommon } from "@ledgerhq/types-live";
|
3
|
-
import {
|
4
|
-
Operation as CoreOperation,
|
5
|
-
Asset,
|
6
|
-
TransactionIntent,
|
7
|
-
} from "@ledgerhq/coin-framework/api/types";
|
8
|
-
import BigNumber from "bignumber.js";
|
9
|
-
import { fromBigNumberToBigInt } from "@ledgerhq/coin-framework/utils";
|
10
|
-
|
11
|
-
export function adaptCoreOperationToLiveOperation(
|
12
|
-
accountId: string,
|
13
|
-
op: CoreOperation<Asset>,
|
14
|
-
): Operation {
|
15
|
-
return {
|
16
|
-
id: encodeOperationId(accountId, op.tx.hash, op.type),
|
17
|
-
hash: op.tx.hash,
|
18
|
-
accountId,
|
19
|
-
type: op.type as OperationType,
|
20
|
-
value: new BigNumber(op.value.toString()),
|
21
|
-
fee: new BigNumber(op.tx.fees.toString()),
|
22
|
-
blockHash: op.tx.block.hash,
|
23
|
-
blockHeight: op.tx.block.height,
|
24
|
-
senders: op.senders,
|
25
|
-
recipients: op.recipients,
|
26
|
-
date: op.tx.date,
|
27
|
-
transactionSequenceNumber: op.details?.sequence as number,
|
28
|
-
extra: {},
|
29
|
-
};
|
30
|
-
}
|
31
|
-
|
32
|
-
export function transactionToIntent(
|
33
|
-
_account: Account,
|
34
|
-
transaction: TransactionCommon,
|
35
|
-
): TransactionIntent<any> {
|
36
|
-
return {
|
37
|
-
type: "Payment",
|
38
|
-
sender: _account.freshAddress,
|
39
|
-
recipient: transaction.recipient,
|
40
|
-
amount: fromBigNumberToBigInt(transaction.amount, BigInt(0)),
|
41
|
-
asset: null,
|
42
|
-
};
|
43
|
-
}
|
44
|
-
|
45
|
-
export const buildOptimisticOperation = (
|
46
|
-
account: Account,
|
47
|
-
transaction: TransactionCommon,
|
48
|
-
): Operation => {
|
49
|
-
return {
|
50
|
-
id: encodeOperationId(account.id, "", "OUT"),
|
51
|
-
hash: "",
|
52
|
-
type: "OUT",
|
53
|
-
value: transaction.amount,
|
54
|
-
fee: transaction["fees"] ?? BigNumber(0),
|
55
|
-
blockHash: null,
|
56
|
-
blockHeight: null,
|
57
|
-
senders: [account.freshAddress.toString()],
|
58
|
-
recipients: [transaction.recipient],
|
59
|
-
accountId: account.id,
|
60
|
-
date: new Date(),
|
61
|
-
extra: {},
|
62
|
-
};
|
63
|
-
};
|
@@ -1,112 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @jest-environment jsdom
|
3
|
-
*/
|
4
|
-
|
5
|
-
import { renderHook } from "@testing-library/react";
|
6
|
-
import { LiveAppManifest } from "../platform/types";
|
7
|
-
import { INTERNAL_APP_IDS } from "../wallet-api/constants";
|
8
|
-
import { useFeature } from "../featureFlags";
|
9
|
-
import { useInternalAppIds } from "./useInternalAppIds";
|
10
|
-
|
11
|
-
import { useShowProviderLoadingTransition } from "./useShowProviderLoadingTransition";
|
12
|
-
|
13
|
-
jest.mock("../featureFlags", () => ({
|
14
|
-
useFeature: jest.fn(),
|
15
|
-
}));
|
16
|
-
jest.mock("../wallet-api/constants", () => ({
|
17
|
-
INTERNAL_APP_IDS: ["internal-app-id-1", "internal-app-id-2"],
|
18
|
-
}));
|
19
|
-
jest.mock("./useInternalAppIds", () => ({
|
20
|
-
useInternalAppIds: jest.fn(),
|
21
|
-
}));
|
22
|
-
|
23
|
-
describe("useShowProviderLoadingTransition", () => {
|
24
|
-
const mockUseFeature = useFeature as jest.Mock;
|
25
|
-
const mockUseInternalAppIds = useInternalAppIds as jest.Mock;
|
26
|
-
|
27
|
-
beforeEach(() => {
|
28
|
-
jest.clearAllMocks();
|
29
|
-
});
|
30
|
-
|
31
|
-
it("should return false when feature is disabled", () => {
|
32
|
-
mockUseFeature.mockReturnValue({ enabled: false, params: {} });
|
33
|
-
const { result } = renderHook(() =>
|
34
|
-
useShowProviderLoadingTransition({
|
35
|
-
manifest: { id: "test-app-id" } as LiveAppManifest,
|
36
|
-
isLoading: true,
|
37
|
-
}),
|
38
|
-
);
|
39
|
-
expect(result.current).toBe(false);
|
40
|
-
});
|
41
|
-
|
42
|
-
it("should return false for internal apps", () => {
|
43
|
-
mockUseFeature.mockReturnValue({ enabled: true, params: {} });
|
44
|
-
mockUseInternalAppIds.mockReturnValue(INTERNAL_APP_IDS);
|
45
|
-
const { result } = renderHook(() =>
|
46
|
-
useShowProviderLoadingTransition({
|
47
|
-
manifest: { id: "internal-app-id-1" } as LiveAppManifest,
|
48
|
-
isLoading: true,
|
49
|
-
}),
|
50
|
-
);
|
51
|
-
expect(result.current).toBe(false);
|
52
|
-
});
|
53
|
-
|
54
|
-
it("should return true when loading and feature is enabled", () => {
|
55
|
-
mockUseFeature.mockReturnValue({ enabled: true, params: {} });
|
56
|
-
mockUseInternalAppIds.mockReturnValue([]);
|
57
|
-
const { result } = renderHook(() =>
|
58
|
-
useShowProviderLoadingTransition({
|
59
|
-
manifest: { id: "test-app-id" } as LiveAppManifest,
|
60
|
-
isLoading: true,
|
61
|
-
}),
|
62
|
-
);
|
63
|
-
expect(result.current).toBe(true);
|
64
|
-
});
|
65
|
-
|
66
|
-
it("should handle extended loading state", () => {
|
67
|
-
jest.useFakeTimers();
|
68
|
-
mockUseFeature.mockReturnValue({ enabled: true, params: { durationMs: 1000 } });
|
69
|
-
mockUseInternalAppIds.mockReturnValue([]);
|
70
|
-
|
71
|
-
const { result, rerender } = renderHook(
|
72
|
-
({ isLoading }) =>
|
73
|
-
useShowProviderLoadingTransition({
|
74
|
-
manifest: { id: "test-app-id" } as LiveAppManifest,
|
75
|
-
isLoading,
|
76
|
-
}),
|
77
|
-
{
|
78
|
-
initialProps: { isLoading: true },
|
79
|
-
},
|
80
|
-
);
|
81
|
-
|
82
|
-
expect(result.current).toBe(true);
|
83
|
-
|
84
|
-
// Simulate the timeout
|
85
|
-
jest.advanceTimersByTime(1000);
|
86
|
-
|
87
|
-
rerender({ isLoading: false });
|
88
|
-
|
89
|
-
expect(result.current).toBe(false);
|
90
|
-
|
91
|
-
jest.useRealTimers();
|
92
|
-
});
|
93
|
-
it("should clear timeout on unmount", () => {
|
94
|
-
jest.useFakeTimers();
|
95
|
-
mockUseFeature.mockReturnValue({ enabled: true, params: { durationMs: 1000 } });
|
96
|
-
mockUseInternalAppIds.mockReturnValue([]);
|
97
|
-
|
98
|
-
const { unmount } = renderHook(() =>
|
99
|
-
useShowProviderLoadingTransition({
|
100
|
-
manifest: { id: "test-app-id" } as LiveAppManifest,
|
101
|
-
isLoading: true,
|
102
|
-
}),
|
103
|
-
);
|
104
|
-
|
105
|
-
unmount();
|
106
|
-
|
107
|
-
// Advance timers to ensure no memory leaks
|
108
|
-
jest.advanceTimersByTime(1000);
|
109
|
-
|
110
|
-
jest.useRealTimers();
|
111
|
-
});
|
112
|
-
});
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
2
|
-
|
3
|
-
import { useFeature } from "../featureFlags/index";
|
4
|
-
import { INTERNAL_APP_IDS } from "../wallet-api/constants";
|
5
|
-
import { useInternalAppIds } from "./useInternalAppIds";
|
6
|
-
import { LiveAppManifest } from "../platform/types";
|
7
|
-
|
8
|
-
export function useShowProviderLoadingTransition({
|
9
|
-
isLoading,
|
10
|
-
manifest,
|
11
|
-
}: {
|
12
|
-
manifest: LiveAppManifest;
|
13
|
-
isLoading: boolean;
|
14
|
-
}) {
|
15
|
-
const isEnabled = useProviderInterstitalEnabled({ manifest });
|
16
|
-
const [extendedInitialLoading, setExtendedInitialLoading] = useState(false);
|
17
|
-
|
18
|
-
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
|
19
|
-
const buySellLoaderFF = useFeature("buySellLoader");
|
20
|
-
const durationMs = buySellLoaderFF?.params?.durationMs ?? 0;
|
21
|
-
const internalAppIds = useInternalAppIds() || INTERNAL_APP_IDS;
|
22
|
-
const isAppInternal = internalAppIds.includes(manifest.id);
|
23
|
-
|
24
|
-
useEffect(() => {
|
25
|
-
if (isEnabled && isLoading && !extendedInitialLoading) {
|
26
|
-
setExtendedInitialLoading(true);
|
27
|
-
|
28
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
29
|
-
|
30
|
-
timeoutRef.current = setTimeout(() => {
|
31
|
-
setExtendedInitialLoading(false);
|
32
|
-
}, durationMs);
|
33
|
-
}
|
34
|
-
}, [durationMs, extendedInitialLoading, isAppInternal, isEnabled, isLoading]);
|
35
|
-
|
36
|
-
useEffect(() => {
|
37
|
-
return () => {
|
38
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
39
|
-
};
|
40
|
-
}, []);
|
41
|
-
|
42
|
-
return isEnabled && (isLoading || extendedInitialLoading);
|
43
|
-
}
|
44
|
-
|
45
|
-
export function useProviderInterstitalEnabled({ manifest }: { manifest?: LiveAppManifest }) {
|
46
|
-
const buySellLoaderFF = useFeature("buySellLoader");
|
47
|
-
const internalAppIds = useInternalAppIds() || INTERNAL_APP_IDS;
|
48
|
-
|
49
|
-
if (!manifest) {
|
50
|
-
return false;
|
51
|
-
}
|
52
|
-
|
53
|
-
const isAppInternal = internalAppIds.includes(manifest.id);
|
54
|
-
const isEnabled = buySellLoaderFF?.enabled && !isAppInternal;
|
55
|
-
|
56
|
-
return isEnabled;
|
57
|
-
}
|
package/src/sanction/errors.ts
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
export class UserAddressSanctionedError extends Error {
|
2
|
-
constructor() {
|
3
|
-
super();
|
4
|
-
this.message = this.constructor.name;
|
5
|
-
this.name = this.constructor.name;
|
6
|
-
}
|
7
|
-
}
|
8
|
-
|
9
|
-
export class UserAddressSanctionedForSendError extends Error {
|
10
|
-
constructor() {
|
11
|
-
super();
|
12
|
-
this.message = this.constructor.name;
|
13
|
-
this.name = this.constructor.name;
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
export class UserAddressSanctionedForStakingError extends Error {
|
18
|
-
constructor() {
|
19
|
-
super();
|
20
|
-
this.message = this.constructor.name;
|
21
|
-
this.name = this.constructor.name;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
export class RecipientAddressSanctionedError extends Error {
|
26
|
-
constructor() {
|
27
|
-
super();
|
28
|
-
this.message = this.constructor.name;
|
29
|
-
this.name = this.constructor.name;
|
30
|
-
}
|
31
|
-
}
|
package/src/sanction/index.ts
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
2
|
-
import axios from "axios";
|
3
|
-
import { hours, makeLRUCache } from "@ledgerhq/live-network/cache";
|
4
|
-
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
5
|
-
import { getCurrencyConfiguration, getSharedConfiguration } from "../config";
|
6
|
-
import { CurrencyConfig } from "@ledgerhq/coin-framework/config";
|
7
|
-
|
8
|
-
const cache = makeLRUCache(fetchSanctionedAddresses, () => "all_sanctioned_addresses", hours(12));
|
9
|
-
|
10
|
-
async function fetchSanctionedAddresses(): Promise<Record<string, string[]>> {
|
11
|
-
const { data } = await axios.get(
|
12
|
-
"https://ofac-compliance.pages.dev/all_sanctioned_addresses.json",
|
13
|
-
);
|
14
|
-
return data;
|
15
|
-
}
|
16
|
-
|
17
|
-
export async function isAddressSanctioned(
|
18
|
-
currency: CryptoCurrency,
|
19
|
-
address: string,
|
20
|
-
): Promise<boolean> {
|
21
|
-
if (!isCheckBlacklistAddressEnabled(currency)) {
|
22
|
-
return false;
|
23
|
-
}
|
24
|
-
|
25
|
-
// Only for testing, should be deleted after
|
26
|
-
const temporarySanctionedAddresses: string[] | undefined =
|
27
|
-
LiveConfig.getValueByKey(`tmp_sanctioned_addresses`);
|
28
|
-
|
29
|
-
const data: Record<string, string[]> = await cache();
|
30
|
-
const addresses = data[currency.ticker] || [];
|
31
|
-
|
32
|
-
if (temporarySanctionedAddresses) {
|
33
|
-
return addresses.concat(temporarySanctionedAddresses).includes(address);
|
34
|
-
}
|
35
|
-
|
36
|
-
return addresses.includes(address);
|
37
|
-
}
|
38
|
-
|
39
|
-
function isCheckBlacklistAddressEnabled(currency: CryptoCurrency): boolean {
|
40
|
-
const currencyConfig = tryGetCurrencyConfig(currency);
|
41
|
-
if (currencyConfig && "checkBlacklistAddress" in currencyConfig) {
|
42
|
-
return currencyConfig.checkBlacklistAddress === true;
|
43
|
-
} else {
|
44
|
-
const sharedConfiguration = getSharedConfiguration();
|
45
|
-
if ("checkBlacklistAddress" in sharedConfiguration) {
|
46
|
-
return sharedConfiguration.checkBlacklistAddress === true;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
return false;
|
51
|
-
}
|
52
|
-
|
53
|
-
function tryGetCurrencyConfig(currency: CryptoCurrency): CurrencyConfig | undefined {
|
54
|
-
try {
|
55
|
-
return getCurrencyConfiguration(currency);
|
56
|
-
} catch (error) {
|
57
|
-
return undefined;
|
58
|
-
}
|
59
|
-
}
|