@ledgerhq/live-common 34.37.0-nightly.3 → 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 -2
- 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/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +0 -7
- package/lib/exchange/swap/completeExchange.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 -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 +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 -2
- 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/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +0 -7
- package/lib-es/exchange/swap/completeExchange.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 -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 +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/exchange/swap/completeExchange.ts +0 -15
- package/src/families/evm/config.ts +2 -2
- package/src/families/xrp/setup.ts +15 -2
- package/src/featureFlags/defaultFeatures.ts +0 -5
- 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/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/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/sanction/errors.ts +0 -31
- package/src/sanction/index.ts +0 -59
package/src/bridge/impl.ts
CHANGED
@@ -1,29 +1,11 @@
|
|
1
|
-
import { isAddressSanctioned } from "../sanction";
|
2
1
|
import { CurrencyNotSupported } from "@ledgerhq/errors";
|
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
2
|
import { decodeAccountId, getMainAccount } from "../account";
|
3
|
+
import { getEnv } from "@ledgerhq/live-env";
|
13
4
|
import { checkAccountSupported } from "../account/index";
|
14
5
|
import jsBridges from "../generated/bridge/js";
|
15
6
|
import mockBridges from "../generated/bridge/mock";
|
16
|
-
import {
|
17
|
-
import {
|
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;
|
7
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
8
|
+
import { Account, AccountBridge, AccountLike, CurrencyBridge } from "@ledgerhq/types-live";
|
27
9
|
|
28
10
|
export const getCurrencyBridge = (currency: CryptoCurrency): CurrencyBridge => {
|
29
11
|
if (getEnv("MOCK")) {
|
@@ -34,13 +16,6 @@ export const getCurrencyBridge = (currency: CryptoCurrency): CurrencyBridge => {
|
|
34
16
|
});
|
35
17
|
}
|
36
18
|
|
37
|
-
if (alpacaized[currency.family]) {
|
38
|
-
if (!currencyBridgeInstance) {
|
39
|
-
currencyBridgeInstance = getAlpacaCurrencyBridge(currency.family, "local");
|
40
|
-
}
|
41
|
-
return currencyBridgeInstance;
|
42
|
-
}
|
43
|
-
|
44
19
|
const jsBridge = jsBridges[currency.family];
|
45
20
|
if (jsBridge) {
|
46
21
|
return jsBridge.currencyBridge;
|
@@ -82,66 +57,9 @@ export function getAccountBridgeByFamily(family: string, accountId?: string): Ac
|
|
82
57
|
}
|
83
58
|
}
|
84
59
|
|
85
|
-
if (alpacaized[family]) {
|
86
|
-
if (!accountBridgeInstance) {
|
87
|
-
accountBridgeInstance = getAlpacaAccountBridge(family, "local");
|
88
|
-
}
|
89
|
-
return accountBridgeInstance;
|
90
|
-
}
|
91
|
-
|
92
60
|
const jsBridge = jsBridges[family];
|
93
61
|
if (!jsBridge) {
|
94
|
-
throw new CurrencyNotSupported("
|
62
|
+
throw new CurrencyNotSupported("currency bridge not found " + family);
|
95
63
|
}
|
96
|
-
return
|
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 };
|
64
|
+
return jsBridge.accountBridge;
|
147
65
|
}
|
package/src/config/index.ts
CHANGED
@@ -1,20 +1,11 @@
|
|
1
1
|
import { CryptoCurrency, CryptoCurrencyId } from "@ledgerhq/types-cryptoassets";
|
2
2
|
import { ConfigInfo, LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
3
|
-
import { CurrencyConfig
|
3
|
+
import { CurrencyConfig } 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
|
-
|
18
9
|
const getCurrencyConfiguration = <T extends CurrencyConfig>(
|
19
10
|
currency: CryptoCurrency,
|
20
11
|
): T & Record<string, unknown> => {
|
@@ -26,4 +17,4 @@ const getCurrencyConfiguration = <T extends CurrencyConfig>(
|
|
26
17
|
return currencyData;
|
27
18
|
};
|
28
19
|
|
29
|
-
export { getCurrencyConfiguration
|
20
|
+
export { getCurrencyConfiguration };
|
@@ -36,13 +36,6 @@ const countervaluesConfig: ConfigSchema = {
|
|
36
36
|
},
|
37
37
|
};
|
38
38
|
|
39
|
-
const sharedCurrencyConfig: ConfigSchema = {
|
40
|
-
config_currency: {
|
41
|
-
type: "object",
|
42
|
-
default: {},
|
43
|
-
},
|
44
|
-
};
|
45
|
-
|
46
39
|
const liveCommonConfig: ConfigSchema = {
|
47
40
|
...appConfig,
|
48
41
|
};
|
@@ -74,5 +67,4 @@ export const liveConfig: ConfigSchema = {
|
|
74
67
|
...iconConfig,
|
75
68
|
...tonConfig,
|
76
69
|
...suiConfig,
|
77
|
-
...sharedCurrencyConfig,
|
78
70
|
};
|
package/src/e2e/speculos.ts
CHANGED
@@ -569,9 +569,6 @@ export async function expectValidAddressDevice(account: Account, addressDisplaye
|
|
569
569
|
case Currency.ATOM:
|
570
570
|
deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.CAPS_APPROVE, DeviceLabels.CAPS_REJECT];
|
571
571
|
break;
|
572
|
-
case Currency.BTC:
|
573
|
-
deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.CONFIRM, DeviceLabels.CANCEL];
|
574
|
-
break;
|
575
572
|
default:
|
576
573
|
deviceLabels = [DeviceLabels.ADDRESS, DeviceLabels.APPROVE, DeviceLabels.REJECT];
|
577
574
|
break;
|
package/src/e2e/speculosCI.ts
CHANGED
@@ -58,7 +58,7 @@ async function githubApiRequest<T = unknown>({
|
|
58
58
|
}
|
59
59
|
}
|
60
60
|
|
61
|
-
function waitForSpeculosReady(url: string, { interval = 2000, timeout =
|
61
|
+
function waitForSpeculosReady(url: string, { interval = 2000, timeout = 120_000 } = {}) {
|
62
62
|
return new Promise((resolve, reject) => {
|
63
63
|
const startTime = Date.now();
|
64
64
|
|
@@ -1,4 +1,19 @@
|
|
1
|
-
import { fetchAndMergeProviderData } from "./swap";
|
1
|
+
import { fetchAndMergeProviderData, findExchangeCurrencyData } from "./swap";
|
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
|
+
});
|
2
17
|
|
3
18
|
describe("fetchAndMergeProviderData", () => {
|
4
19
|
it("returns all data in expected format", async () => {
|
@@ -16,11 +31,6 @@ describe("fetchAndMergeProviderData", () => {
|
|
16
31
|
mainUrl: "https://changelly.com/",
|
17
32
|
name: "Changelly",
|
18
33
|
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
|
-
],
|
24
34
|
publicKey: {
|
25
35
|
curve: "secp256k1",
|
26
36
|
data: Buffer.from(
|
@@ -37,33 +47,6 @@ describe("fetchAndMergeProviderData", () => {
|
|
37
47
|
type: "CEX",
|
38
48
|
version: 1,
|
39
49
|
},
|
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
|
-
},
|
67
50
|
changenow: {
|
68
51
|
name: "ChangeNOW",
|
69
52
|
publicKey: {
|
@@ -15,7 +15,6 @@ export type AdditionalProviderConfig = SwapProviderConfig & { type: "DEX" | "CEX
|
|
15
15
|
version?: number;
|
16
16
|
termsOfUseUrl: string;
|
17
17
|
supportUrl: string;
|
18
|
-
usefulUrls?: string[];
|
19
18
|
mainUrl: string;
|
20
19
|
useInExchangeApp: boolean;
|
21
20
|
displayName: string;
|
@@ -40,41 +39,10 @@ const DEFAULT_SWAP_PROVIDERS: Record<string, ProviderConfig & Partial<Additional
|
|
40
39
|
needsKYC: false,
|
41
40
|
needsBearerToken: false,
|
42
41
|
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
|
-
],
|
48
42
|
termsOfUseUrl: "https://changelly.com/terms-of-use",
|
49
43
|
supportUrl: "https://support.changelly.com/en/support/home",
|
50
44
|
mainUrl: "https://changelly.com/",
|
51
45
|
},
|
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
|
-
},
|
78
46
|
exodus: {
|
79
47
|
name: "exodus",
|
80
48
|
publicKey: {
|
@@ -25,8 +25,6 @@ import { CompleteExchangeStep, convertTransportError } from "../error";
|
|
25
25
|
import type { CompleteExchangeInputSwap, CompleteExchangeRequestEvent } from "../platform/types";
|
26
26
|
import { convertToAppExchangePartnerKey, getSwapProvider } from "../providers";
|
27
27
|
import { CEXProviderConfig } from "../providers/swap";
|
28
|
-
import { isAddressSanctioned } from "../../sanction";
|
29
|
-
import { RecipientAddressSanctionedError } from "../../sanction/errors";
|
30
28
|
|
31
29
|
const COMPLETE_EXCHANGE_LOG = "SWAP-CompleteExchange";
|
32
30
|
|
@@ -66,19 +64,6 @@ const completeExchange = (
|
|
66
64
|
const payoutCurrency = getAccountCurrency(toAccount);
|
67
65
|
const refundCurrency = getAccountCurrency(fromAccount);
|
68
66
|
const mainRefundCurrency = getAccountCurrency(refundAccount);
|
69
|
-
|
70
|
-
const isPayoutSanctioned = await isAddressSanctioned(
|
71
|
-
payoutAccount.currency,
|
72
|
-
payoutAccount.freshAddress,
|
73
|
-
);
|
74
|
-
const isRefundSanctioned = await isAddressSanctioned(
|
75
|
-
refundAccount.currency,
|
76
|
-
refundAccount.freshAddress,
|
77
|
-
);
|
78
|
-
|
79
|
-
if (isPayoutSanctioned || isRefundSanctioned) {
|
80
|
-
throw new RecipientAddressSanctionedError();
|
81
|
-
}
|
82
67
|
if (mainPayoutCurrency.type !== "CryptoCurrency")
|
83
68
|
throw new Error("This should be a cryptocurrency");
|
84
69
|
if (mainRefundCurrency.type !== "CryptoCurrency")
|
@@ -104,7 +104,7 @@ const evmConfig: CurrencyLiveConfigDefinition = {
|
|
104
104
|
type: "ledger",
|
105
105
|
explorerId: "eth",
|
106
106
|
},
|
107
|
-
showNfts:
|
107
|
+
showNfts: true,
|
108
108
|
},
|
109
109
|
},
|
110
110
|
config_currency_sonic: {
|
@@ -266,7 +266,7 @@ const evmConfig: CurrencyLiveConfigDefinition = {
|
|
266
266
|
type: "ledger",
|
267
267
|
explorerId: "matic",
|
268
268
|
},
|
269
|
-
showNfts:
|
269
|
+
showNfts: true,
|
270
270
|
},
|
271
271
|
},
|
272
272
|
config_currency_reosc: {
|
@@ -1,18 +1,31 @@
|
|
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";
|
4
5
|
import Transport from "@ledgerhq/hw-transport";
|
6
|
+
import { createBridges, type XrpCoinConfig } from "@ledgerhq/coin-xrp";
|
5
7
|
import xrpResolver from "@ledgerhq/coin-xrp/signer/index";
|
6
8
|
import makeCliTools from "@ledgerhq/coin-xrp/test/cli";
|
7
|
-
import {
|
9
|
+
import { Transaction as XrpTransaction } from "@ledgerhq/coin-xrp/types";
|
10
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
11
|
+
import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup";
|
12
|
+
import { getCurrencyConfiguration } from "../../config";
|
8
13
|
import { Resolver } from "../../hw/getAddress/types";
|
9
14
|
|
10
15
|
const createSigner: CreateSigner<Xrp> = (transport: Transport) => {
|
11
16
|
return new Xrp(transport);
|
12
17
|
};
|
13
18
|
|
19
|
+
const getCoinConfig = () =>
|
20
|
+
getCurrencyConfiguration<XrpCoinConfig>(getCryptoCurrencyById("ripple"));
|
21
|
+
|
22
|
+
const bridge: Bridge<XrpTransaction> = createBridges(
|
23
|
+
executeWithSigner(createSigner),
|
24
|
+
getCoinConfig,
|
25
|
+
);
|
26
|
+
|
14
27
|
const resolver: Resolver = createResolver(createSigner, xrpResolver);
|
15
28
|
|
16
29
|
const cliTools = makeCliTools();
|
17
30
|
|
18
|
-
export { cliTools, resolver };
|
31
|
+
export { bridge, cliTools, resolver };
|
@@ -422,10 +422,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
422
422
|
},
|
423
423
|
},
|
424
424
|
|
425
|
-
ptxSwapLiveAppKycWarning: {
|
426
|
-
enabled: false,
|
427
|
-
},
|
428
|
-
|
429
425
|
llmAnalyticsOptInPrompt: {
|
430
426
|
enabled: false,
|
431
427
|
params: {
|
@@ -609,7 +605,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
609
605
|
live_app: true,
|
610
606
|
receive_flow: true,
|
611
607
|
send_flow: true,
|
612
|
-
enableModularization: false,
|
613
608
|
},
|
614
609
|
},
|
615
610
|
llNftSupport: DEFAULT_FEATURE,
|
@@ -20,6 +20,7 @@ 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";
|
23
24
|
import { bridge as sui } from "../../families/sui/setup";
|
24
25
|
import { bridge as mina } from "../../families/mina/setup";
|
25
26
|
|
@@ -46,6 +47,7 @@ export default {
|
|
46
47
|
ton,
|
47
48
|
tron,
|
48
49
|
vechain,
|
50
|
+
xrp,
|
49
51
|
sui,
|
50
52
|
mina,
|
51
53
|
};
|
@@ -20,7 +20,7 @@ export const useOFACGeoBlockCheck = ({
|
|
20
20
|
queryKey: ["ofac-geo-block", geoBlockingFeatureFlagKey],
|
21
21
|
queryFn: async () => {
|
22
22
|
if (!platformOfacGeoBlocking?.enabled) return false;
|
23
|
-
const res = await fetch(`${baseURL()}/v3/
|
23
|
+
const res = await fetch(`${baseURL()}/v3/market`);
|
24
24
|
return res.status === 451;
|
25
25
|
},
|
26
26
|
});
|
@@ -11,9 +11,9 @@ import type {
|
|
11
11
|
} from "@ledgerhq/device-management-kit";
|
12
12
|
import {
|
13
13
|
DeviceActionStatus,
|
14
|
+
DeviceDisconnectedWhileSendingError,
|
14
15
|
DeviceLockedError,
|
15
16
|
DeviceSessionStateType,
|
16
|
-
DeviceStatus,
|
17
17
|
UserInteractionRequired,
|
18
18
|
OutOfMemoryDAError,
|
19
19
|
SecureChannelError,
|
@@ -96,9 +96,7 @@ export class ConnectAppEventMapper {
|
|
96
96
|
return;
|
97
97
|
}
|
98
98
|
|
99
|
-
if (
|
100
|
-
this.eventSubject.next({ type: "disconnected", expected: false });
|
101
|
-
} else if (
|
99
|
+
if (
|
102
100
|
deviceState.firmwareVersion?.metadata &&
|
103
101
|
deviceState.firmwareUpdateContext &&
|
104
102
|
!this.lastSeenDeviceSent
|
@@ -259,6 +257,8 @@ export class ConnectAppEventMapper {
|
|
259
257
|
this.eventSubject.complete();
|
260
258
|
} else if (error instanceof SecureChannelError) {
|
261
259
|
this.eventSubject.error(new UserRefusedAllowManager());
|
260
|
+
} else if (error instanceof DeviceDisconnectedWhileSendingError) {
|
261
|
+
this.eventSubject.next({ type: "disconnected", expected: false });
|
262
262
|
} else if ("_tag" in error && error._tag === "WebHidSendReportError") {
|
263
263
|
this.eventSubject.next({ type: "disconnected", expected: false });
|
264
264
|
this.eventSubject.complete();
|
@@ -65,8 +65,6 @@ export type CompleteExchangeUiRequest = {
|
|
65
65
|
swapId?: string;
|
66
66
|
amountExpectedTo?: number;
|
67
67
|
magnitudeAwareRate?: BigNumber;
|
68
|
-
refundAddress?: string;
|
69
|
-
payoutAddress?: string;
|
70
68
|
};
|
71
69
|
|
72
70
|
type ExchangeStartParamsUiRequest =
|
@@ -288,15 +286,11 @@ export const handlers = ({
|
|
288
286
|
|
289
287
|
let amountExpectedTo;
|
290
288
|
let magnitudeAwareRate;
|
291
|
-
let refundAddress;
|
292
|
-
let payoutAddress;
|
293
289
|
if (params.exchangeType === "SWAP") {
|
294
290
|
// Get amountExpectedTo and magnitudeAwareRate from binary payload
|
295
291
|
const decodePayload = await decodeSwapPayload(params.hexBinaryPayload);
|
296
292
|
amountExpectedTo = new BigNumber(decodePayload.amountToWallet.toString());
|
297
293
|
magnitudeAwareRate = tx.amount && amountExpectedTo.dividedBy(tx.amount);
|
298
|
-
refundAddress = decodePayload.refundAddress;
|
299
|
-
payoutAddress = decodePayload.payoutAddress;
|
300
294
|
}
|
301
295
|
|
302
296
|
return new Promise((resolve, reject) =>
|
@@ -312,8 +306,6 @@ export const handlers = ({
|
|
312
306
|
swapId: params.exchangeType === "SWAP" ? params.swapId : undefined,
|
313
307
|
amountExpectedTo,
|
314
308
|
magnitudeAwareRate,
|
315
|
-
refundAddress,
|
316
|
-
payoutAddress,
|
317
309
|
},
|
318
310
|
onSuccess: (transactionHash: string) => {
|
319
311
|
tracking.completeExchangeSuccess({
|
@@ -12,15 +12,11 @@ export type ModularDrawerConfiguration = {
|
|
12
12
|
};
|
13
13
|
};
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
"numberOfAccountsAndApy",
|
21
|
-
"undefined",
|
22
|
-
] as const;
|
23
|
-
export const networksRightElementOptions = ["balance", "undefined"] as const;
|
15
|
+
const filterOptions = ["topNetworks"] as const;
|
16
|
+
const assetsLeftElementOptions = ["apy", "priceVariation"] as const;
|
17
|
+
const assetsRightElementOptions = ["balance", "marketTrend"] as const;
|
18
|
+
const networksLeftElementOptions = ["numberOfAccounts", "numberOfAccountsAndApy"] as const;
|
19
|
+
const networksRightElementOptions = ["balance"] as const;
|
24
20
|
|
25
21
|
export const EnhancedModularDrawerConfigurationSchema = z.object({
|
26
22
|
assets: z
|
@@ -19,7 +19,7 @@ export function validateAndTransformConfigurationWithZod(
|
|
19
19
|
const result = EnhancedModularDrawerConfigurationSchema.safeParse(config);
|
20
20
|
|
21
21
|
if (!result.success) {
|
22
|
-
console.warn("
|
22
|
+
console.warn("Modulare Drawer invalid configuration received:", result.error);
|
23
23
|
return {};
|
24
24
|
}
|
25
25
|
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"accountBridge.d.ts","sourceRoot":"","sources":["../../../src/bridge/generic-alpaca/accountBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiBrD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAcxF"}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.getAlpacaAccountBridge = void 0;
|
7
|
-
const jsHelpers_1 = require("../jsHelpers");
|
8
|
-
const getAccountShape_1 = require("./getAccountShape");
|
9
|
-
const jsHelpers_2 = require("@ledgerhq/coin-framework/bridge/jsHelpers");
|
10
|
-
const getAddressWrapper_1 = __importDefault(require("@ledgerhq/coin-framework/bridge/getAddressWrapper"));
|
11
|
-
const signer_1 = require("./signer");
|
12
|
-
const prepareTransaction_1 = require("./prepareTransaction");
|
13
|
-
const getTransactionStatus_1 = require("./getTransactionStatus");
|
14
|
-
const estimateMaxSpendable_1 = require("./estimateMaxSpendable");
|
15
|
-
const createTransaction_1 = require("./createTransaction");
|
16
|
-
const broadcast_1 = require("./broadcast");
|
17
|
-
const signOperation_1 = require("./signOperation");
|
18
|
-
function getAlpacaAccountBridge(network, kind) {
|
19
|
-
const signer = (0, signer_1.getSigner)(network);
|
20
|
-
return {
|
21
|
-
sync: (0, jsHelpers_1.makeSync)({ getAccountShape: (0, getAccountShape_1.genericGetAccountShape)(network, kind) }),
|
22
|
-
receive: (0, jsHelpers_2.makeAccountBridgeReceive)((0, getAddressWrapper_1.default)(signer.getAddress)),
|
23
|
-
createTransaction: createTransaction_1.createTransaction,
|
24
|
-
updateTransaction: (jsHelpers_2.updateTransaction),
|
25
|
-
prepareTransaction: (0, prepareTransaction_1.genericPrepareTransaction)(network, kind),
|
26
|
-
getTransactionStatus: (0, getTransactionStatus_1.genericGetTransactionStatus)(network, kind),
|
27
|
-
estimateMaxSpendable: (0, estimateMaxSpendable_1.genericEstimateMaxSpendable)(network, kind),
|
28
|
-
broadcast: (0, broadcast_1.genericBroadcast)(network, kind),
|
29
|
-
signOperation: (0, signOperation_1.genericSignOperation)(network, kind)(signer.context),
|
30
|
-
getSerializedAddressParameters: jsHelpers_2.getSerializedAddressParameters, // NOTE: check wether it should be exposed by coin-module's api instead?
|
31
|
-
};
|
32
|
-
}
|
33
|
-
exports.getAlpacaAccountBridge = getAlpacaAccountBridge;
|
34
|
-
//# sourceMappingURL=accountBridge.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"accountBridge.js","sourceRoot":"","sources":["../../../src/bridge/generic-alpaca/accountBridge.ts"],"names":[],"mappings":";;;;;;AACA,4CAAwC;AACxC,uDAA2D;AAC3D,yEAImD;AACnD,0GAAkF;AAClF,qCAAqC;AACrC,6DAAiE;AACjE,iEAAqE;AACrE,iEAAqE;AACrE,2DAAwD;AACxD,2CAA+C;AAC/C,mDAAuD;AAEvD,SAAgB,sBAAsB,CAAC,OAAe,EAAE,IAAY;IAClE,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,OAAO,CAAC,CAAC;IAClC,OAAO;QACL,IAAI,EAAE,IAAA,oBAAQ,EAAC,EAAE,eAAe,EAAE,IAAA,wCAAsB,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;QAC1E,OAAO,EAAE,IAAA,oCAAwB,EAAC,IAAA,2BAAiB,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACvE,iBAAiB,EAAE,qCAAiB;QACpC,iBAAiB,EAAE,CAAA,6BAAsB,CAAA;QACzC,kBAAkB,EAAE,IAAA,8CAAyB,EAAC,OAAO,EAAE,IAAI,CAAC;QAC5D,oBAAoB,EAAE,IAAA,kDAA2B,EAAC,OAAO,EAAE,IAAI,CAAC;QAChE,oBAAoB,EAAE,IAAA,kDAA2B,EAAC,OAAO,EAAE,IAAI,CAAC;QAChE,SAAS,EAAE,IAAA,4BAAgB,EAAC,OAAO,EAAE,IAAI,CAAC;QAC1C,aAAa,EAAE,IAAA,oCAAoB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;QAClE,8BAA8B,EAA9B,0CAA8B,EAAE,wEAAwE;KAC7C,CAAC;AAChE,CAAC;AAdD,wDAcC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/alpaca/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAGzD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAYrF"}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getAlpacaApi = void 0;
|
4
|
-
const index_1 = require("@ledgerhq/coin-xrp/api/index");
|
5
|
-
const config_1 = require("../../../config");
|
6
|
-
const currencies_1 = require("@ledgerhq/cryptoassets/currencies");
|
7
|
-
const network_alpaca_1 = require("./network/network-alpaca");
|
8
|
-
function getAlpacaApi(network, kind) {
|
9
|
-
if (kind === "local") {
|
10
|
-
switch (network) {
|
11
|
-
case "ripple":
|
12
|
-
case "xrp":
|
13
|
-
return (0, index_1.createApi)((0, config_1.getCurrencyConfiguration)((0, currencies_1.getCryptoCurrencyById)("ripple")));
|
14
|
-
// as unknown as Api<any>; // FIXME: createXrpApi returns a strongly typed Api<XrpSender>, fix Api<any> to allow it
|
15
|
-
}
|
16
|
-
}
|
17
|
-
return (0, network_alpaca_1.getNetworkAlpacaApi)(network);
|
18
|
-
}
|
19
|
-
exports.getAlpacaApi = getAlpacaApi;
|
20
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/bridge/generic-alpaca/alpaca/index.ts"],"names":[],"mappings":";;;AAAA,wDAAyE;AACzE,4CAA2D;AAC3D,kEAA0E;AAC1E,6DAA+D;AAI/D,SAAgB,YAAY,CAAC,OAAe,EAAE,IAAwB;IACpE,IAAI,IAAI,KAAK,OAAO,EAAE;QACpB,QAAQ,OAAO,EAAE;YACf,KAAK,QAAQ,CAAC;YACd,KAAK,KAAK;gBACR,OAAO,IAAA,iBAAY,EACjB,IAAA,iCAAwB,EAAgB,IAAA,kCAAqB,EAAC,QAAQ,CAAC,CAAC,CACxD,CAAC;YACrB,mHAAmH;SACpH;KACF;IACD,OAAO,IAAA,oCAAmB,EAAC,OAAO,CAAmD,CAAC;AACxF,CAAC;AAZD,oCAYC"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import type { Account, Balance, BlockInfo, Operation, FeeEstimation, Pagination, TransactionIntent, Transaction, TransactionValidation } from "@ledgerhq/coin-framework/api/index";
|
2
|
-
type AssetInfo = {
|
3
|
-
type: "native";
|
4
|
-
};
|
5
|
-
export declare const getNetworkAlpacaApi: (networkFamily: string) => {
|
6
|
-
broadcast: (signedOperation: string) => Promise<string>;
|
7
|
-
combine: (tx: string, signature: string, pubKey?: string) => Promise<string>;
|
8
|
-
validateIntent: (account: Account, transaction: Transaction) => Promise<TransactionValidation>;
|
9
|
-
estimateFees: (intent: TransactionIntent<any>) => Promise<FeeEstimation>;
|
10
|
-
getBalance: (address: string) => Promise<Balance<AssetInfo>[]>;
|
11
|
-
listOperations: (address: string, pagination: Pagination) => Promise<[Operation<any>[], string]>;
|
12
|
-
lastBlock: () => Promise<BlockInfo>;
|
13
|
-
craftTransaction: (intent: TransactionIntent<any>) => Promise<string>;
|
14
|
-
};
|
15
|
-
export {};
|
16
|
-
//# sourceMappingURL=network-alpaca.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"network-alpaca.d.ts","sourceRoot":"","sources":["../../../../../src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,OAAO,EACP,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EAEtB,MAAM,oCAAoC,CAAC;AAiG5C,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AA4DF,eAAO,MAAM,mBAAmB,kBAAmB,MAAM;iCA9Ib,MAAM,KAAG,QAAQ,MAAM,CAAC;kBAmBvC,MAAM,aAAa,MAAM,WAAW,MAAM,KAAG,QAAQ,MAAM,CAAC;8BAqC5E,OAAO,eACH,WAAW,KACvB,QAAQ,qBAAqB,CAAC;2BApBG,kBAAkB,GAAG,CAAC,KAAG,QAAQ,aAAa,CAAC;0BA+ChD,MAAM,KAAG,QAAQ,QAAQ,SAAS,CAAC,EAAE,CAAC;8BAgB9D,MAAM,cACH,UAAU,KACrB,QAAQ,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;qBAYV,QAAQ,SAAS,CAAC;+BAaN,kBAAkB,GAAG,CAAC,KAAG,QAAQ,MAAM,CAAC;CAwB3D,CAAC"}
|