@ledgerhq/live-common 34.36.0 → 34.37.0-nightly.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/apps/config.d.ts.map +1 -1
- package/lib/apps/config.js +6 -0
- package/lib/apps/config.js.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.d.ts +3 -0
- package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/accountBridge.js +34 -0
- package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -0
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts +3 -0
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/alpaca/index.js +20 -0
- package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +16 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +123 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -0
- package/lib/bridge/generic-alpaca/broadcast.d.ts +3 -0
- package/lib/bridge/generic-alpaca/broadcast.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/broadcast.js +11 -0
- package/lib/bridge/generic-alpaca/broadcast.js.map +1 -0
- package/lib/bridge/generic-alpaca/createTransaction.d.ts +16 -0
- package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/createTransaction.js +20 -0
- package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -0
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts +3 -0
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/currencyBridge.js +20 -0
- package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -0
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts +3 -0
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +26 -0
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -0
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts +3 -0
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/getAccountShape.js +58 -0
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -0
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts +3 -0
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +36 -0
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -0
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +3 -0
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/prepareTransaction.js +21 -0
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -0
- package/lib/bridge/generic-alpaca/signOperation.d.ts +7 -0
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/signOperation.js +49 -0
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -0
- package/lib/bridge/generic-alpaca/signer/index.d.ts +11 -0
- package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/signer/index.js +28 -0
- package/lib/bridge/generic-alpaca/signer/index.js.map +1 -0
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +5 -0
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/signer/signTransaction.js +11 -0
- package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -0
- package/lib/bridge/generic-alpaca/signer/types.d.ts +5 -0
- package/lib/bridge/generic-alpaca/signer/types.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/signer/types.js +3 -0
- package/lib/bridge/generic-alpaca/signer/types.js.map +1 -0
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts +2 -0
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +90 -0
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +1 -0
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts +2 -0
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +53 -0
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -0
- package/lib/bridge/generic-alpaca/tests/signOperation.test.d.ts +2 -0
- package/lib/bridge/generic-alpaca/tests/signOperation.test.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/tests/signOperation.test.js +79 -0
- package/lib/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -0
- package/lib/bridge/generic-alpaca/utils.d.ts +6 -0
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/utils.js +55 -0
- package/lib/bridge/generic-alpaca/utils.js.map +1 -0
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/bridge/impl.js +59 -3
- package/lib/bridge/impl.js.map +1 -1
- package/lib/config/index.d.ts +3 -2
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js +9 -1
- package/lib/config/index.js.map +1 -1
- package/lib/config/sharedConfig.d.ts.map +1 -1
- package/lib/config/sharedConfig.js +7 -0
- package/lib/config/sharedConfig.js.map +1 -1
- package/lib/e2e/enum/OperationType.d.ts +5 -0
- package/lib/e2e/enum/OperationType.d.ts.map +1 -0
- package/lib/e2e/enum/OperationType.js +9 -0
- package/lib/e2e/enum/OperationType.js.map +1 -0
- package/lib/e2e/enum/{Swap.d.ts → Provider.d.ts} +2 -1
- package/lib/e2e/enum/Provider.d.ts.map +1 -0
- package/lib/e2e/enum/{Swap.js → Provider.js} +2 -1
- package/lib/e2e/enum/Provider.js.map +1 -0
- package/lib/e2e/index.d.ts +6 -2
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/models/BuySell.d.ts +2 -0
- package/lib/e2e/models/BuySell.d.ts.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/providers/swap.d.ts +1 -0
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.integration.test.js +26 -12
- package/lib/exchange/providers/swap.integration.test.js.map +1 -1
- package/lib/exchange/providers/swap.js +25 -0
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/families/casper/bridge.integration.test.js +2 -2
- package/lib/families/casper/bridge.integration.test.js.map +1 -1
- package/lib/families/casper/config.d.ts +2 -2
- package/lib/families/casper/config.d.ts.map +1 -1
- package/lib/families/casper/config.js +4 -0
- package/lib/families/casper/config.js.map +1 -1
- package/lib/families/casper/setup.d.ts +1 -1
- package/lib/families/casper/setup.d.ts.map +1 -1
- package/lib/families/casper/setup.js +7 -4
- package/lib/families/casper/setup.js.map +1 -1
- package/lib/families/casper/types.d.ts +1 -1
- package/lib/families/casper/types.d.ts.map +1 -1
- package/lib/families/casper/types.js +1 -1
- package/lib/families/casper/types.js.map +1 -1
- package/lib/families/xrp/setup.d.ts +3 -6
- package/lib/families/xrp/setup.d.ts.map +1 -1
- package/lib/families/xrp/setup.js +1 -7
- package/lib/families/xrp/setup.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +5 -0
- 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 +4 -6
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/hooks/useOFACGeoBlockCheck.d.ts +8 -0
- package/lib/hooks/useOFACGeoBlockCheck.d.ts.map +1 -0
- package/lib/hooks/useOFACGeoBlockCheck.js +32 -0
- package/lib/hooks/useOFACGeoBlockCheck.js.map +1 -0
- package/lib/sanction/errors.d.ts +13 -0
- package/lib/sanction/errors.d.ts.map +1 -0
- package/lib/sanction/errors.js +36 -0
- package/lib/sanction/errors.js.map +1 -0
- package/lib/sanction/index.d.ts +3 -0
- package/lib/sanction/index.d.ts.map +1 -0
- package/lib/sanction/index.js +51 -0
- package/lib/sanction/index.js.map +1 -0
- 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/apps/config.d.ts.map +1 -1
- package/lib-es/apps/config.js +6 -0
- package/lib-es/apps/config.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/accountBridge.js +27 -0
- package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/alpaca/index.js +16 -0
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +16 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +116 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/broadcast.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/broadcast.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/broadcast.js +7 -0
- package/lib-es/bridge/generic-alpaca/broadcast.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +16 -0
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/createTransaction.js +13 -0
- package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/currencyBridge.js +16 -0
- package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +19 -0
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +51 -0
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +29 -0
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +3 -0
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +14 -0
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts +7 -0
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/signOperation.js +45 -0
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts +11 -0
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/signer/index.js +21 -0
- package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +5 -0
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.js +7 -0
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/signer/types.d.ts +5 -0
- package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/signer/types.js +2 -0
- package/lib-es/bridge/generic-alpaca/signer/types.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts +2 -0
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +62 -0
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts +2 -0
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +48 -0
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.d.ts +2 -0
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js +77 -0
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/utils.d.ts +6 -0
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/utils.js +46 -0
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -0
- package/lib-es/bridge/impl.d.ts.map +1 -1
- package/lib-es/bridge/impl.js +59 -3
- package/lib-es/bridge/impl.js.map +1 -1
- package/lib-es/config/index.d.ts +3 -2
- package/lib-es/config/index.d.ts.map +1 -1
- package/lib-es/config/index.js +8 -1
- 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 +7 -0
- package/lib-es/config/sharedConfig.js.map +1 -1
- package/lib-es/e2e/enum/OperationType.d.ts +5 -0
- package/lib-es/e2e/enum/OperationType.d.ts.map +1 -0
- package/lib-es/e2e/enum/OperationType.js +6 -0
- package/lib-es/e2e/enum/OperationType.js.map +1 -0
- package/lib-es/e2e/enum/{Swap.d.ts → Provider.d.ts} +2 -1
- package/lib-es/e2e/enum/Provider.d.ts.map +1 -0
- package/lib-es/e2e/enum/{Swap.js → Provider.js} +2 -1
- package/lib-es/e2e/enum/Provider.js.map +1 -0
- package/lib-es/e2e/index.d.ts +6 -2
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/models/BuySell.d.ts +2 -0
- package/lib-es/e2e/models/BuySell.d.ts.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/providers/swap.d.ts +1 -0
- package/lib-es/exchange/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.integration.test.js +27 -13
- package/lib-es/exchange/providers/swap.integration.test.js.map +1 -1
- package/lib-es/exchange/providers/swap.js +25 -0
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/families/casper/bridge.integration.test.js +1 -1
- package/lib-es/families/casper/bridge.integration.test.js.map +1 -1
- package/lib-es/families/casper/config.d.ts +2 -2
- package/lib-es/families/casper/config.d.ts.map +1 -1
- package/lib-es/families/casper/config.js +4 -0
- package/lib-es/families/casper/config.js.map +1 -1
- package/lib-es/families/casper/setup.d.ts +1 -1
- package/lib-es/families/casper/setup.d.ts.map +1 -1
- package/lib-es/families/casper/setup.js +6 -3
- package/lib-es/families/casper/setup.js.map +1 -1
- package/lib-es/families/casper/types.d.ts +1 -1
- package/lib-es/families/casper/types.d.ts.map +1 -1
- package/lib-es/families/casper/types.js +1 -1
- package/lib-es/families/casper/types.js.map +1 -1
- package/lib-es/families/xrp/setup.d.ts +3 -6
- package/lib-es/families/xrp/setup.d.ts.map +1 -1
- package/lib-es/families/xrp/setup.js +2 -7
- 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 +5 -0
- 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/hooks/useOFACGeoBlockCheck.d.ts +8 -0
- package/lib-es/hooks/useOFACGeoBlockCheck.d.ts.map +1 -0
- package/lib-es/hooks/useOFACGeoBlockCheck.js +28 -0
- package/lib-es/hooks/useOFACGeoBlockCheck.js.map +1 -0
- package/lib-es/sanction/errors.d.ts +13 -0
- package/lib-es/sanction/errors.d.ts.map +1 -0
- package/lib-es/sanction/errors.js +29 -0
- package/lib-es/sanction/errors.js.map +1 -0
- package/lib-es/sanction/index.d.ts +3 -0
- package/lib-es/sanction/index.d.ts.map +1 -0
- package/lib-es/sanction/index.js +44 -0
- package/lib-es/sanction/index.js.map +1 -0
- package/package.json +43 -42
- package/src/__tests__/test-helpers/bridge.ts +2 -4
- package/src/apps/config.ts +6 -0
- package/src/bridge/generic-alpaca/accountBridge.ts +32 -0
- package/src/bridge/generic-alpaca/alpaca/index.ts +20 -0
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +182 -0
- package/src/bridge/generic-alpaca/broadcast.ts +11 -0
- package/src/bridge/generic-alpaca/createTransaction.ts +27 -0
- package/src/bridge/generic-alpaca/currencyBridge.ts +17 -0
- package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +27 -0
- package/src/bridge/generic-alpaca/getAccountShape.ts +62 -0
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +38 -0
- package/src/bridge/generic-alpaca/prepareTransaction.ts +22 -0
- package/src/bridge/generic-alpaca/signOperation.ts +83 -0
- package/src/bridge/generic-alpaca/signer/index.ts +33 -0
- package/src/bridge/generic-alpaca/signer/signTransaction.ts +13 -0
- package/src/bridge/generic-alpaca/signer/types.ts +4 -0
- package/src/bridge/generic-alpaca/tests/estimateMaxSpendable.test.ts +76 -0
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +66 -0
- package/src/bridge/generic-alpaca/tests/signOperation.test.ts +96 -0
- package/src/bridge/generic-alpaca/utils.ts +63 -0
- package/src/bridge/impl.ts +87 -5
- package/src/config/index.ts +11 -2
- package/src/config/sharedConfig.ts +8 -0
- package/src/e2e/enum/OperationType.ts +4 -0
- package/src/e2e/enum/{Swap.ts → Provider.ts} +1 -0
- package/src/e2e/models/BuySell.ts +2 -0
- package/src/exchange/providers/swap.integration.test.ts +33 -16
- package/src/exchange/providers/swap.ts +32 -0
- package/src/families/casper/bridge.integration.test.ts +1 -1
- package/src/families/casper/config.ts +6 -2
- package/src/families/casper/setup.ts +10 -3
- package/src/families/casper/types.ts +1 -1
- package/src/families/xrp/setup.ts +2 -15
- package/src/featureFlags/defaultFeatures.ts +6 -0
- package/src/generated/bridge/js.ts +0 -2
- package/src/hooks/useOFACGeoBlockCheck.ts +37 -0
- package/src/sanction/errors.ts +31 -0
- package/src/sanction/index.ts +59 -0
- package/lib/e2e/enum/Swap.d.ts.map +0 -1
- package/lib/e2e/enum/Swap.js.map +0 -1
- package/lib-es/e2e/enum/Swap.d.ts.map +0 -1
- package/lib-es/e2e/enum/Swap.js.map +0 -1
@@ -0,0 +1,96 @@
|
|
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
|
+
});
|
@@ -0,0 +1,63 @@
|
|
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
|
+
};
|
package/src/bridge/impl.ts
CHANGED
@@ -1,11 +1,29 @@
|
|
1
|
+
import { isAddressSanctioned } from "../sanction";
|
1
2
|
import { CurrencyNotSupported } from "@ledgerhq/errors";
|
2
|
-
import { decodeAccountId, getMainAccount } from "../account";
|
3
3
|
import { getEnv } from "@ledgerhq/live-env";
|
4
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
5
|
+
import {
|
6
|
+
Account,
|
7
|
+
AccountBridge,
|
8
|
+
AccountLike,
|
9
|
+
CurrencyBridge,
|
10
|
+
TransactionStatusCommon,
|
11
|
+
} from "@ledgerhq/types-live";
|
12
|
+
import { decodeAccountId, getMainAccount } from "../account";
|
4
13
|
import { checkAccountSupported } from "../account/index";
|
5
14
|
import jsBridges from "../generated/bridge/js";
|
6
15
|
import mockBridges from "../generated/bridge/mock";
|
7
|
-
import
|
8
|
-
import {
|
16
|
+
import { RecipientAddressSanctionedError, UserAddressSanctionedError } from "../sanction/errors";
|
17
|
+
import { getAlpacaCurrencyBridge } from "./generic-alpaca/currencyBridge";
|
18
|
+
import { getAlpacaAccountBridge } from "./generic-alpaca/accountBridge";
|
19
|
+
import { TransactionCommon } from "@ledgerhq/types-live";
|
20
|
+
|
21
|
+
const alpacaized = {
|
22
|
+
xrp: true,
|
23
|
+
};
|
24
|
+
|
25
|
+
let accountBridgeInstance: AccountBridge<any> | null = null;
|
26
|
+
let currencyBridgeInstance: CurrencyBridge | null = null;
|
9
27
|
|
10
28
|
export const getCurrencyBridge = (currency: CryptoCurrency): CurrencyBridge => {
|
11
29
|
if (getEnv("MOCK")) {
|
@@ -16,6 +34,13 @@ export const getCurrencyBridge = (currency: CryptoCurrency): CurrencyBridge => {
|
|
16
34
|
});
|
17
35
|
}
|
18
36
|
|
37
|
+
if (alpacaized[currency.family]) {
|
38
|
+
if (!currencyBridgeInstance) {
|
39
|
+
currencyBridgeInstance = getAlpacaCurrencyBridge(currency.family, "local");
|
40
|
+
}
|
41
|
+
return currencyBridgeInstance;
|
42
|
+
}
|
43
|
+
|
19
44
|
const jsBridge = jsBridges[currency.family];
|
20
45
|
if (jsBridge) {
|
21
46
|
return jsBridge.currencyBridge;
|
@@ -57,9 +82,66 @@ export function getAccountBridgeByFamily(family: string, accountId?: string): Ac
|
|
57
82
|
}
|
58
83
|
}
|
59
84
|
|
85
|
+
if (alpacaized[family]) {
|
86
|
+
if (!accountBridgeInstance) {
|
87
|
+
accountBridgeInstance = getAlpacaAccountBridge(family, "local");
|
88
|
+
}
|
89
|
+
return accountBridgeInstance;
|
90
|
+
}
|
91
|
+
|
60
92
|
const jsBridge = jsBridges[family];
|
61
93
|
if (!jsBridge) {
|
62
|
-
throw new CurrencyNotSupported("currency bridge not found " + family);
|
94
|
+
throw new CurrencyNotSupported("account currency bridge not found " + family);
|
63
95
|
}
|
64
|
-
return jsBridge.accountBridge;
|
96
|
+
return wrapAccountBridge(jsBridge.accountBridge);
|
97
|
+
}
|
98
|
+
|
99
|
+
function wrapAccountBridge<T extends TransactionCommon>(
|
100
|
+
bridge: AccountBridge<T>,
|
101
|
+
): AccountBridge<T> {
|
102
|
+
return {
|
103
|
+
...bridge,
|
104
|
+
getTransactionStatus: async (...args) => {
|
105
|
+
const blockchainSpecific = await bridge.getTransactionStatus(...args);
|
106
|
+
const common = await commonGetTransactionStatus(...args);
|
107
|
+
const merged = mergeResults(blockchainSpecific, common);
|
108
|
+
return merged;
|
109
|
+
},
|
110
|
+
};
|
111
|
+
}
|
112
|
+
|
113
|
+
function mergeResults(
|
114
|
+
blockchainSpecific: TransactionStatusCommon,
|
115
|
+
common: Partial<TransactionStatusCommon>,
|
116
|
+
): TransactionStatusCommon {
|
117
|
+
const errors = { ...blockchainSpecific.errors, ...common.errors };
|
118
|
+
const warnings = { ...blockchainSpecific.warnings, ...common.warnings };
|
119
|
+
return { ...blockchainSpecific, errors, warnings };
|
120
|
+
}
|
121
|
+
|
122
|
+
async function commonGetTransactionStatus(
|
123
|
+
account: Account,
|
124
|
+
transaction: TransactionCommon,
|
125
|
+
): Promise<Partial<TransactionStatusCommon>> {
|
126
|
+
const errors: Record<string, Error> = {};
|
127
|
+
const warnings: Record<string, Error> = {};
|
128
|
+
|
129
|
+
let recipientIsBlacklisted = false;
|
130
|
+
if (transaction.recipient && transaction.recipient !== "") {
|
131
|
+
recipientIsBlacklisted = await isAddressSanctioned(account.currency, transaction.recipient);
|
132
|
+
if (recipientIsBlacklisted) {
|
133
|
+
errors.recipient = new RecipientAddressSanctionedError();
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
const userIsBlacklisted = await isAddressSanctioned(account.currency, account.freshAddress);
|
138
|
+
if (userIsBlacklisted) {
|
139
|
+
errors.amount = new UserAddressSanctionedError();
|
140
|
+
}
|
141
|
+
|
142
|
+
if (userIsBlacklisted || recipientIsBlacklisted) {
|
143
|
+
// Send log
|
144
|
+
}
|
145
|
+
|
146
|
+
return { errors, warnings };
|
65
147
|
}
|
package/src/config/index.ts
CHANGED
@@ -1,11 +1,20 @@
|
|
1
1
|
import { CryptoCurrency, CryptoCurrencyId } from "@ledgerhq/types-cryptoassets";
|
2
2
|
import { ConfigInfo, LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
3
|
-
import { CurrencyConfig } from "@ledgerhq/coin-framework/config";
|
3
|
+
import { CurrencyConfig, SharedConfig } from "@ledgerhq/coin-framework/config";
|
4
4
|
|
5
5
|
export type CurrencyLiveConfigDefinition = Partial<
|
6
6
|
Record<`config_currency_${CryptoCurrencyId}`, ConfigInfo>
|
7
7
|
>;
|
8
8
|
|
9
|
+
const getSharedConfiguration = (): SharedConfig => {
|
10
|
+
const config = LiveConfig.getValueByKey("config_currency");
|
11
|
+
if (!config) {
|
12
|
+
throw new Error("Configuration config_currency not found, please check Firebase Remote Config");
|
13
|
+
}
|
14
|
+
|
15
|
+
return config;
|
16
|
+
};
|
17
|
+
|
9
18
|
const getCurrencyConfiguration = <T extends CurrencyConfig>(
|
10
19
|
currency: CryptoCurrency,
|
11
20
|
): T & Record<string, unknown> => {
|
@@ -17,4 +26,4 @@ const getCurrencyConfiguration = <T extends CurrencyConfig>(
|
|
17
26
|
return currencyData;
|
18
27
|
};
|
19
28
|
|
20
|
-
export { getCurrencyConfiguration };
|
29
|
+
export { getCurrencyConfiguration, getSharedConfiguration };
|
@@ -36,6 +36,13 @@ const countervaluesConfig: ConfigSchema = {
|
|
36
36
|
},
|
37
37
|
};
|
38
38
|
|
39
|
+
const sharedCurrencyConfig: ConfigSchema = {
|
40
|
+
config_currency: {
|
41
|
+
type: "object",
|
42
|
+
default: {},
|
43
|
+
},
|
44
|
+
};
|
45
|
+
|
39
46
|
const liveCommonConfig: ConfigSchema = {
|
40
47
|
...appConfig,
|
41
48
|
};
|
@@ -67,4 +74,5 @@ export const liveConfig: ConfigSchema = {
|
|
67
74
|
...iconConfig,
|
68
75
|
...tonConfig,
|
69
76
|
...suiConfig,
|
77
|
+
...sharedCurrencyConfig,
|
70
78
|
};
|
@@ -15,6 +15,7 @@ export class Provider {
|
|
15
15
|
static readonly UNISWAP = new Provider("uniswap", "Uniswap", false, false, false);
|
16
16
|
static readonly LIFI = new Provider("lifi", "LI.FI", false, true, false);
|
17
17
|
static readonly CIC = new Provider("cic", "CIC", false, true, true);
|
18
|
+
static readonly COINBASE = new Provider("coinbase", "Coinbase", false, true, true);
|
18
19
|
|
19
20
|
static getNameByUiName(uiName: string): string {
|
20
21
|
const provider = Object.values(Provider).find(p => p.uiName === uiName);
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { AccountType } from "../enum/Account";
|
2
|
+
import { OperationType } from "../enum/OperationType";
|
2
3
|
|
3
4
|
export interface Fiat {
|
4
5
|
locale: string;
|
@@ -9,4 +10,5 @@ export interface BuySell {
|
|
9
10
|
crypto: AccountType;
|
10
11
|
fiat: Fiat;
|
11
12
|
amount: string;
|
13
|
+
operation: OperationType;
|
12
14
|
}
|
@@ -1,19 +1,4 @@
|
|
1
|
-
import { fetchAndMergeProviderData
|
2
|
-
|
3
|
-
describe("findExchangeCurrencyData", () => {
|
4
|
-
it("returns all data in expected format", async () => {
|
5
|
-
// When
|
6
|
-
const currencies = await findExchangeCurrencyData("arbitrum");
|
7
|
-
|
8
|
-
// Then
|
9
|
-
expect(currencies).toEqual({
|
10
|
-
config: "0345544808457468657265756d0d0345544812000000000000a4b1",
|
11
|
-
id: "arbitrum",
|
12
|
-
signature:
|
13
|
-
"30450221008ca557e4acc2fa290a6a44c2b0eb5232712ba69b23df93645a320bcff9789fd9022017e6e05582806a9d4b7b2aaaedbcc3471bd26e10ad686e4f313fc0b1068b5d64",
|
14
|
-
});
|
15
|
-
});
|
16
|
-
});
|
1
|
+
import { fetchAndMergeProviderData } from "./swap";
|
17
2
|
|
18
3
|
describe("fetchAndMergeProviderData", () => {
|
19
4
|
it("returns all data in expected format", async () => {
|
@@ -31,6 +16,11 @@ describe("fetchAndMergeProviderData", () => {
|
|
31
16
|
mainUrl: "https://changelly.com/",
|
32
17
|
name: "Changelly",
|
33
18
|
needsKYC: false,
|
19
|
+
usefulUrls: [
|
20
|
+
"https://changelly.com/terms-of-use",
|
21
|
+
"https://changelly.com/aml-kyc",
|
22
|
+
"https://support.changelly.com/en/support/tickets/new",
|
23
|
+
],
|
34
24
|
publicKey: {
|
35
25
|
curve: "secp256k1",
|
36
26
|
data: Buffer.from(
|
@@ -47,6 +37,33 @@ describe("fetchAndMergeProviderData", () => {
|
|
47
37
|
type: "CEX",
|
48
38
|
version: 1,
|
49
39
|
},
|
40
|
+
changelly_v2: {
|
41
|
+
displayName: "Changelly",
|
42
|
+
name: "Changelly",
|
43
|
+
useInExchangeApp: true,
|
44
|
+
publicKey: {
|
45
|
+
curve: "secp256k1",
|
46
|
+
data: Buffer.from(
|
47
|
+
"0480d7c0d3a9183597395f58dda05999328da6f18fabd5cda0aff8e8e3fc633436a2dbf48ecb23d40df7c3c7d3e774b77b4b5df0e9f7e08cf1cdf2dba788eb085b",
|
48
|
+
"hex",
|
49
|
+
),
|
50
|
+
},
|
51
|
+
signature: Buffer.from(
|
52
|
+
"3045022100c2db00da651cfcc84702f75ab5f131a3f037592080ea750a6f665a8cb36797c802200e594938cdf2c836b34717f57487002a0588f2088f64f00a6c4d320fd37db6fa",
|
53
|
+
"hex",
|
54
|
+
),
|
55
|
+
needsKYC: false,
|
56
|
+
type: "CEX",
|
57
|
+
usefulUrls: [
|
58
|
+
"https://changelly.com/terms-of-use",
|
59
|
+
"https://changelly.com/aml-kyc",
|
60
|
+
"https://support.changelly.com/en/support/tickets/new",
|
61
|
+
],
|
62
|
+
termsOfUseUrl: "https://changelly.com/terms-of-use",
|
63
|
+
supportUrl: "https://support.changelly.com/en/support/home",
|
64
|
+
mainUrl: "https://changelly.com/",
|
65
|
+
version: 2,
|
66
|
+
},
|
50
67
|
changenow: {
|
51
68
|
name: "ChangeNOW",
|
52
69
|
publicKey: {
|
@@ -15,6 +15,7 @@ export type AdditionalProviderConfig = SwapProviderConfig & { type: "DEX" | "CEX
|
|
15
15
|
version?: number;
|
16
16
|
termsOfUseUrl: string;
|
17
17
|
supportUrl: string;
|
18
|
+
usefulUrls?: string[];
|
18
19
|
mainUrl: string;
|
19
20
|
useInExchangeApp: boolean;
|
20
21
|
displayName: string;
|
@@ -39,10 +40,41 @@ const DEFAULT_SWAP_PROVIDERS: Record<string, ProviderConfig & Partial<Additional
|
|
39
40
|
needsKYC: false,
|
40
41
|
needsBearerToken: false,
|
41
42
|
type: "CEX",
|
43
|
+
usefulUrls: [
|
44
|
+
"https://changelly.com/terms-of-use",
|
45
|
+
"https://changelly.com/aml-kyc",
|
46
|
+
"https://support.changelly.com/en/support/tickets/new",
|
47
|
+
],
|
42
48
|
termsOfUseUrl: "https://changelly.com/terms-of-use",
|
43
49
|
supportUrl: "https://support.changelly.com/en/support/home",
|
44
50
|
mainUrl: "https://changelly.com/",
|
45
51
|
},
|
52
|
+
changelly_v2: {
|
53
|
+
name: "Changelly",
|
54
|
+
publicKey: {
|
55
|
+
curve: "secp256k1",
|
56
|
+
data: Buffer.from(
|
57
|
+
"0480d7c0d3a9183597395f58dda05999328da6f18fabd5cda0aff8e8e3fc633436a2dbf48ecb23d40df7c3c7d3e774b77b4b5df0e9f7e08cf1cdf2dba788eb085b",
|
58
|
+
"hex",
|
59
|
+
),
|
60
|
+
},
|
61
|
+
signature: Buffer.from(
|
62
|
+
"3045022100c2db00da651cfcc84702f75ab5f131a3f037592080ea750a6f665a8cb36797c802200e594938cdf2c836b34717f57487002a0588f2088f64f00a6c4d320fd37db6fa",
|
63
|
+
"hex",
|
64
|
+
),
|
65
|
+
needsKYC: false,
|
66
|
+
needsBearerToken: false,
|
67
|
+
type: "CEX",
|
68
|
+
usefulUrls: [
|
69
|
+
"https://changelly.com/terms-of-use",
|
70
|
+
"https://changelly.com/aml-kyc",
|
71
|
+
"https://support.changelly.com/en/support/tickets/new",
|
72
|
+
],
|
73
|
+
termsOfUseUrl: "https://changelly.com/terms-of-use",
|
74
|
+
supportUrl: "https://support.changelly.com/en/support/home",
|
75
|
+
mainUrl: "https://changelly.com/",
|
76
|
+
version: 2,
|
77
|
+
},
|
46
78
|
exodus: {
|
47
79
|
name: "exodus",
|
48
80
|
publicKey: {
|
@@ -1,12 +1,16 @@
|
|
1
|
-
import {
|
1
|
+
import { CurrencyLiveConfigDefinition } from "../../config";
|
2
2
|
|
3
|
-
export const casperConfig:
|
3
|
+
export const casperConfig: CurrencyLiveConfigDefinition = {
|
4
4
|
config_currency_casper: {
|
5
5
|
type: "object",
|
6
6
|
default: {
|
7
7
|
status: {
|
8
8
|
type: "active",
|
9
9
|
},
|
10
|
+
infra: {
|
11
|
+
API_CASPER_NODE_ENDPOINT: "https://casper.coin.ledger.com/node/",
|
12
|
+
API_CASPER_INDEXER: "https://casper.coin.ledger.com/indexer/",
|
13
|
+
},
|
10
14
|
},
|
11
15
|
},
|
12
16
|
};
|
@@ -1,17 +1,20 @@
|
|
1
1
|
// Goal of this file is to inject all necessary device/signer dependency to coin-modules
|
2
2
|
|
3
|
-
import { createBridges } from "@ledgerhq/coin-casper/bridge
|
3
|
+
import { createBridges } from "@ledgerhq/coin-casper/bridge";
|
4
4
|
import Transport from "@ledgerhq/hw-transport";
|
5
5
|
import Casper from "@zondax/ledger-casper";
|
6
|
-
import casperResolver from "@ledgerhq/coin-casper/signer
|
6
|
+
import casperResolver from "@ledgerhq/coin-casper/signer";
|
7
7
|
import { signMessage } from "@ledgerhq/coin-casper/hw-signMessage";
|
8
8
|
import type { Account, Bridge } from "@ledgerhq/types-live";
|
9
9
|
import makeCliTools from "@ledgerhq/coin-casper/test/cli";
|
10
10
|
import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup";
|
11
11
|
import { Resolver } from "../../hw/getAddress/types";
|
12
|
-
import { TransactionStatus, Transaction } from "@ledgerhq/coin-casper/types
|
12
|
+
import { TransactionStatus, Transaction } from "@ledgerhq/coin-casper/types";
|
13
13
|
import { CasperGetAddrResponse, CasperSignature, CasperSigner } from "./types";
|
14
|
+
import { getCurrencyConfiguration } from "../../config";
|
15
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
14
16
|
import { getPath, isError } from "./common";
|
17
|
+
import { CasperCoinConfig } from "@ledgerhq/coin-casper/config";
|
15
18
|
|
16
19
|
const createSigner: CreateSigner<CasperSigner> = (transport: Transport) => {
|
17
20
|
const casper = new Casper(transport);
|
@@ -37,8 +40,12 @@ const createSigner: CreateSigner<CasperSigner> = (transport: Transport) => {
|
|
37
40
|
};
|
38
41
|
};
|
39
42
|
|
43
|
+
const getCoinConfig: CasperCoinConfig = () =>
|
44
|
+
getCurrencyConfiguration<ReturnType<CasperCoinConfig>>(getCryptoCurrencyById("casper"));
|
45
|
+
|
40
46
|
const bridge: Bridge<Transaction, Account, TransactionStatus> = createBridges(
|
41
47
|
executeWithSigner(createSigner),
|
48
|
+
getCoinConfig,
|
42
49
|
);
|
43
50
|
|
44
51
|
const messageSigner = {
|
@@ -1,2 +1,2 @@
|
|
1
1
|
// Encapsulate for LLD & LLM
|
2
|
-
export * from "@ledgerhq/coin-casper/types
|
2
|
+
export * from "@ledgerhq/coin-casper/types";
|
@@ -1,31 +1,18 @@
|
|
1
1
|
// Goal of this file is to inject all necessary device/signer dependency to coin-modules
|
2
2
|
|
3
3
|
import Xrp from "@ledgerhq/hw-app-xrp";
|
4
|
-
import { Bridge } from "@ledgerhq/types-live";
|
5
4
|
import Transport from "@ledgerhq/hw-transport";
|
6
|
-
import { createBridges, type XrpCoinConfig } from "@ledgerhq/coin-xrp";
|
7
5
|
import xrpResolver from "@ledgerhq/coin-xrp/signer/index";
|
8
6
|
import makeCliTools from "@ledgerhq/coin-xrp/test/cli";
|
9
|
-
import {
|
10
|
-
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
11
|
-
import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup";
|
12
|
-
import { getCurrencyConfiguration } from "../../config";
|
7
|
+
import { CreateSigner, createResolver } from "../../bridge/setup";
|
13
8
|
import { Resolver } from "../../hw/getAddress/types";
|
14
9
|
|
15
10
|
const createSigner: CreateSigner<Xrp> = (transport: Transport) => {
|
16
11
|
return new Xrp(transport);
|
17
12
|
};
|
18
13
|
|
19
|
-
const getCoinConfig = () =>
|
20
|
-
getCurrencyConfiguration<XrpCoinConfig>(getCryptoCurrencyById("ripple"));
|
21
|
-
|
22
|
-
const bridge: Bridge<XrpTransaction> = createBridges(
|
23
|
-
executeWithSigner(createSigner),
|
24
|
-
getCoinConfig,
|
25
|
-
);
|
26
|
-
|
27
14
|
const resolver: Resolver = createResolver(createSigner, xrpResolver);
|
28
15
|
|
29
16
|
const cliTools = makeCliTools();
|
30
17
|
|
31
|
-
export {
|
18
|
+
export { cliTools, resolver };
|
@@ -422,6 +422,10 @@ export const DEFAULT_FEATURES: Features = {
|
|
422
422
|
},
|
423
423
|
},
|
424
424
|
|
425
|
+
ptxSwapLiveAppKycWarning: {
|
426
|
+
enabled: false,
|
427
|
+
},
|
428
|
+
|
425
429
|
llmAnalyticsOptInPrompt: {
|
426
430
|
enabled: false,
|
427
431
|
params: {
|
@@ -618,6 +622,8 @@ export const DEFAULT_FEATURES: Features = {
|
|
618
622
|
},
|
619
623
|
ldmkConnectApp: DEFAULT_FEATURE,
|
620
624
|
lldNetworkBasedAddAccount: DEFAULT_FEATURE,
|
625
|
+
llmOfacGeoBlocking: DEFAULT_FEATURE,
|
626
|
+
lldOfacGeoBlocking: DEFAULT_FEATURE,
|
621
627
|
};
|
622
628
|
|
623
629
|
// Firebase SDK treat JSON values as strings
|
@@ -20,7 +20,6 @@ import { bridge as tezos } from "../../families/tezos/setup";
|
|
20
20
|
import { bridge as ton } from "../../families/ton/setup";
|
21
21
|
import { bridge as tron } from "../../families/tron/setup";
|
22
22
|
import { bridge as vechain } from "../../families/vechain/setup";
|
23
|
-
import { bridge as xrp } from "../../families/xrp/setup";
|
24
23
|
import { bridge as sui } from "../../families/sui/setup";
|
25
24
|
import { bridge as mina } from "../../families/mina/setup";
|
26
25
|
|
@@ -47,7 +46,6 @@ export default {
|
|
47
46
|
ton,
|
48
47
|
tron,
|
49
48
|
vechain,
|
50
|
-
xrp,
|
51
49
|
sui,
|
52
50
|
mina,
|
53
51
|
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { useEffect, useState } from "react";
|
2
|
+
import { useFeature } from "../featureFlags";
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
4
|
+
import { getEnv } from "@ledgerhq/live-env";
|
5
|
+
|
6
|
+
const baseURL = () => getEnv("LEDGER_COUNTERVALUES_API");
|
7
|
+
|
8
|
+
export const useOFACGeoBlockCheck = ({
|
9
|
+
onFinish,
|
10
|
+
geoBlockingFeatureFlagKey,
|
11
|
+
}: {
|
12
|
+
onFinish?: () => void;
|
13
|
+
geoBlockingFeatureFlagKey: "llmOfacGeoBlocking" | "lldOfacGeoBlocking";
|
14
|
+
}) => {
|
15
|
+
const [blocked, setBlocked] = useState<boolean>(false);
|
16
|
+
|
17
|
+
const platformOfacGeoBlocking = useFeature(geoBlockingFeatureFlagKey);
|
18
|
+
|
19
|
+
const { data, isLoading } = useQuery({
|
20
|
+
queryKey: ["ofac-geo-block", geoBlockingFeatureFlagKey],
|
21
|
+
queryFn: async () => {
|
22
|
+
if (!platformOfacGeoBlocking?.enabled) return false;
|
23
|
+
const res = await fetch(`${baseURL()}/v3/market`);
|
24
|
+
return res.status === 451;
|
25
|
+
},
|
26
|
+
});
|
27
|
+
|
28
|
+
useEffect(() => {
|
29
|
+
if (!platformOfacGeoBlocking?.enabled) return;
|
30
|
+
setBlocked(data ?? false);
|
31
|
+
if (typeof onFinish === "function") {
|
32
|
+
onFinish();
|
33
|
+
}
|
34
|
+
}, [data, onFinish, platformOfacGeoBlocking]);
|
35
|
+
|
36
|
+
return { blocked, isLoading };
|
37
|
+
};
|
@@ -0,0 +1,31 @@
|
|
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
|
+
}
|