@ledgerhq/live-common 34.47.0-nightly.0 → 34.47.0-nightly.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__tests__/test-helpers/environment.js +2 -0
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/bridge/crypto-assets/cal-integration.d.ts +4 -0
- package/lib/bridge/crypto-assets/cal-integration.d.ts.map +1 -0
- package/lib/bridge/crypto-assets/cal-integration.js +26 -0
- package/lib/bridge/crypto-assets/cal-integration.js.map +1 -0
- package/lib/bridge/crypto-assets/cal-integration.test.d.ts +2 -0
- package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +1 -0
- package/lib/bridge/crypto-assets/cal-integration.test.js +45 -0
- package/lib/bridge/crypto-assets/cal-integration.test.js.map +1 -0
- package/lib/bridge/crypto-assets/cal-store.d.ts +14 -0
- package/lib/bridge/crypto-assets/cal-store.d.ts.map +1 -0
- package/lib/bridge/crypto-assets/cal-store.js +42 -0
- package/lib/bridge/crypto-assets/cal-store.js.map +1 -0
- package/lib/bridge/crypto-assets/cal-store.test.d.ts +2 -0
- package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +1 -0
- package/lib/bridge/crypto-assets/cal-store.test.js +70 -0
- package/lib/bridge/crypto-assets/cal-store.test.js.map +1 -0
- package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +4 -0
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/crypto-assets/index.test.js +36 -0
- package/lib/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts +2 -3
- package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/buildSubAccounts.js +3 -12
- package/lib/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +1 -0
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +1 -0
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +2 -0
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/index.d.ts +4 -4
- package/lib/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
- package/lib/exchange/platform/transfer/completeExchange.js +3 -5
- package/lib/exchange/platform/transfer/completeExchange.js.map +1 -1
- package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +5 -2
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib/exchange/swap/initSwap.js +5 -2
- package/lib/exchange/swap/initSwap.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +35 -1
- package/lib/families/canton/config.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -1
- 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/modularDrawer/__mocks__/dada.mock.d.ts +3336 -0
- package/lib/modularDrawer/__mocks__/dada.mock.d.ts.map +1 -0
- package/lib/modularDrawer/__mocks__/dada.mock.js +3879 -0
- package/lib/modularDrawer/__mocks__/dada.mock.js.map +1 -0
- package/lib/modularDrawer/data/state-manager/api.d.ts +729 -24
- package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.js +29 -11
- package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +129 -73
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.d.ts +4 -5
- package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.js +34 -15
- package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts +9 -0
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts.map +1 -0
- package/lib/modularDrawer/utils/getLoadingStatus.js +18 -0
- package/lib/modularDrawer/utils/getLoadingStatus.js.map +1 -0
- package/lib-es/__tests__/test-helpers/environment.js +2 -0
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/bridge/crypto-assets/cal-integration.d.ts +4 -0
- package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +1 -0
- package/lib-es/bridge/crypto-assets/cal-integration.js +21 -0
- package/lib-es/bridge/crypto-assets/cal-integration.js.map +1 -0
- package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +2 -0
- package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +1 -0
- package/lib-es/bridge/crypto-assets/cal-integration.test.js +43 -0
- package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +1 -0
- package/lib-es/bridge/crypto-assets/cal-store.d.ts +14 -0
- package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +1 -0
- package/lib-es/bridge/crypto-assets/cal-store.js +38 -0
- package/lib-es/bridge/crypto-assets/cal-store.js.map +1 -0
- package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +2 -0
- package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +1 -0
- package/lib-es/bridge/crypto-assets/cal-store.test.js +68 -0
- package/lib-es/bridge/crypto-assets/cal-store.test.js.map +1 -0
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +4 -0
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.test.js +36 -0
- package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +2 -3
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +2 -9
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +3 -3
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +1 -0
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +1 -0
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +2 -0
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/index.d.ts +4 -4
- package/lib-es/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/platform/transfer/completeExchange.js +3 -2
- package/lib-es/exchange/platform/transfer/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +5 -2
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib-es/exchange/swap/initSwap.js +5 -2
- package/lib-es/exchange/swap/initSwap.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +35 -1
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -1
- 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/modularDrawer/__mocks__/dada.mock.d.ts +3336 -0
- package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts.map +1 -0
- package/lib-es/modularDrawer/__mocks__/dada.mock.js +3876 -0
- package/lib-es/modularDrawer/__mocks__/dada.mock.js.map +1 -0
- package/lib-es/modularDrawer/data/state-manager/api.d.ts +729 -24
- package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.js +28 -10
- package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +130 -74
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +4 -5
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.js +36 -17
- package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts +9 -0
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/getLoadingStatus.js +14 -0
- package/lib-es/modularDrawer/utils/getLoadingStatus.js.map +1 -0
- package/package.json +48 -48
- package/src/__tests__/test-helpers/environment.ts +2 -0
- package/src/bridge/crypto-assets/cal-integration.test.ts +53 -0
- package/src/bridge/crypto-assets/cal-integration.ts +23 -0
- package/src/bridge/crypto-assets/cal-store.test.ts +93 -0
- package/src/bridge/crypto-assets/cal-store.ts +46 -0
- package/src/bridge/crypto-assets/index.test.ts +47 -0
- package/src/bridge/crypto-assets/index.ts +5 -0
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -1
- package/src/bridge/generic-alpaca/buildSubAccounts.ts +3 -11
- package/src/bridge/generic-alpaca/getAccountShape.ts +3 -4
- package/src/e2e/enum/DeviceLabels.ts +1 -0
- package/src/e2e/families/tezos.ts +2 -0
- package/src/exchange/platform/transfer/completeExchange.ts +3 -2
- package/src/exchange/swap/completeExchange.ts +5 -2
- package/src/exchange/swap/initSwap.ts +5 -4
- package/src/families/canton/config.ts +36 -1
- package/src/featureFlags/defaultFeatures.ts +1 -1
- package/src/modularDrawer/__mocks__/dada.mock.ts +3890 -0
- package/src/modularDrawer/data/state-manager/api.ts +32 -11
- package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +136 -75
- package/src/modularDrawer/hooks/useAssetsData.ts +40 -17
- package/src/modularDrawer/utils/getLoadingStatus.ts +24 -0
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ledgerhq/live-common",
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
4
|
-
"version": "34.47.0-nightly.
|
4
|
+
"version": "34.47.0-nightly.2",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
@@ -154,7 +154,7 @@
|
|
154
154
|
"reselect": "^4.1.5",
|
155
155
|
"rlp": "^3.0.0",
|
156
156
|
"rxjs": "^7.8.1",
|
157
|
-
"
|
157
|
+
"@noble/curves": "^1.9.7",
|
158
158
|
"semver": "^7.3.5",
|
159
159
|
"sha.js": "^2.4.11",
|
160
160
|
"triple-beam": "^1.3.0",
|
@@ -165,44 +165,44 @@
|
|
165
165
|
"xstate": "^5.19.2",
|
166
166
|
"yargs": "^17.0.0",
|
167
167
|
"zod": "^3.22.4",
|
168
|
-
"@ledgerhq/coin-algorand": "^0.9.
|
169
|
-
"@ledgerhq/coin-aptos": "^3.
|
170
|
-
"@ledgerhq/coin-bitcoin": "^0.
|
171
|
-
"@ledgerhq/coin-canton": "^0.
|
172
|
-
"@ledgerhq/coin-cardano": "^0.11.
|
173
|
-
"@ledgerhq/coin-casper": "^2.0.
|
174
|
-
"@ledgerhq/coin-celo": "^1.2.1",
|
175
|
-
"@ledgerhq/coin-cosmos": "^0.16.
|
176
|
-
"@ledgerhq/coin-evm": "^2.
|
177
|
-
"@ledgerhq/coin-filecoin": "^1.10.1",
|
178
|
-
"@ledgerhq/coin-framework": "^6.
|
179
|
-
"@ledgerhq/coin-hedera": "^1.10.1",
|
180
|
-
"@ledgerhq/coin-icon": "^0.11.
|
181
|
-
"@ledgerhq/coin-internet_computer": "^1.7.
|
182
|
-
"@ledgerhq/coin-mina": "^1.1.
|
183
|
-
"@ledgerhq/coin-multiversx": "^0.4.
|
184
|
-
"@ledgerhq/coin-
|
185
|
-
"@ledgerhq/coin-
|
186
|
-
"@ledgerhq/coin-solana": "^0.31.1",
|
187
|
-
"@ledgerhq/coin-stacks": "^0.8.
|
188
|
-
"@ledgerhq/coin-stellar": "^6.
|
189
|
-
"@ledgerhq/coin-sui": "^0.12.0-nightly.
|
190
|
-
"@ledgerhq/coin-tezos": "^6.
|
191
|
-
"@ledgerhq/coin-ton": "^0.13.8-nightly.
|
192
|
-
"@ledgerhq/coin-tron": "^5.3.0-nightly.
|
193
|
-
"@ledgerhq/coin-vechain": "^2.8.
|
194
|
-
"@ledgerhq/coin-xrp": "^7.
|
168
|
+
"@ledgerhq/coin-algorand": "^0.9.19-nightly.1",
|
169
|
+
"@ledgerhq/coin-aptos": "^3.2.0-nightly.1",
|
170
|
+
"@ledgerhq/coin-bitcoin": "^0.21.0-nightly.1",
|
171
|
+
"@ledgerhq/coin-canton": "^0.4.0-nightly.1",
|
172
|
+
"@ledgerhq/coin-cardano": "^0.11.3-nightly.1",
|
173
|
+
"@ledgerhq/coin-casper": "^2.0.10-nightly.1",
|
174
|
+
"@ledgerhq/coin-celo": "^1.2.2-nightly.1",
|
175
|
+
"@ledgerhq/coin-cosmos": "^0.16.8-nightly.1",
|
176
|
+
"@ledgerhq/coin-evm": "^2.29.0-nightly.1",
|
177
|
+
"@ledgerhq/coin-filecoin": "^1.10.2-nightly.1",
|
178
|
+
"@ledgerhq/coin-framework": "^6.3.0-nightly.1",
|
179
|
+
"@ledgerhq/coin-hedera": "^1.10.2-nightly.1",
|
180
|
+
"@ledgerhq/coin-icon": "^0.11.6-nightly.1",
|
181
|
+
"@ledgerhq/coin-internet_computer": "^1.7.19-nightly.1",
|
182
|
+
"@ledgerhq/coin-mina": "^1.1.18-nightly.1",
|
183
|
+
"@ledgerhq/coin-multiversx": "^0.4.19-nightly.1",
|
184
|
+
"@ledgerhq/coin-polkadot": "^6.9.0-nightly.1",
|
185
|
+
"@ledgerhq/coin-near": "^0.12.2-nightly.1",
|
186
|
+
"@ledgerhq/coin-solana": "^0.31.2-nightly.1",
|
187
|
+
"@ledgerhq/coin-stacks": "^0.8.19-nightly.1",
|
188
|
+
"@ledgerhq/coin-stellar": "^6.3.0-nightly.1",
|
189
|
+
"@ledgerhq/coin-sui": "^0.12.0-nightly.2",
|
190
|
+
"@ledgerhq/coin-tezos": "^6.3.0-nightly.1",
|
191
|
+
"@ledgerhq/coin-ton": "^0.13.8-nightly.2",
|
192
|
+
"@ledgerhq/coin-tron": "^5.3.0-nightly.2",
|
193
|
+
"@ledgerhq/coin-vechain": "^2.8.3-nightly.1",
|
194
|
+
"@ledgerhq/coin-xrp": "^7.3.0-nightly.1",
|
195
195
|
"@ledgerhq/crypto-icons-ui": "^1.18.0-nightly.0",
|
196
|
-
"@ledgerhq/cryptoassets": "^13.
|
197
|
-
"@ledgerhq/device-core": "^0.6.
|
196
|
+
"@ledgerhq/cryptoassets": "^13.27.0-nightly.0",
|
197
|
+
"@ledgerhq/device-core": "^0.6.2-nightly.0",
|
198
198
|
"@ledgerhq/devices": "8.5.1-nightly.0",
|
199
199
|
"@ledgerhq/errors": "^6.25.0-nightly.0",
|
200
200
|
"@ledgerhq/hw-app-algorand": "^6.31.6-nightly.0",
|
201
201
|
"@ledgerhq/hw-app-aptos": "^6.34.6-nightly.0",
|
202
|
-
"@ledgerhq/hw-app-btc": "^10.
|
203
|
-
"@ledgerhq/hw-app-celo": "^6.34.
|
202
|
+
"@ledgerhq/hw-app-btc": "^10.11.0-nightly.1",
|
203
|
+
"@ledgerhq/hw-app-celo": "^6.34.2-nightly.0",
|
204
204
|
"@ledgerhq/hw-app-cosmos": "^6.32.6-nightly.0",
|
205
|
-
"@ledgerhq/hw-app-eth": "^6.45.
|
205
|
+
"@ledgerhq/hw-app-eth": "^6.45.17-nightly.0",
|
206
206
|
"@ledgerhq/hw-app-exchange": "^0.13.0",
|
207
207
|
"@ledgerhq/hw-app-hedera": "^1.2.6-nightly.0",
|
208
208
|
"@ledgerhq/hw-app-icon": "^1.3.6-nightly.0",
|
@@ -213,28 +213,28 @@
|
|
213
213
|
"@ledgerhq/hw-app-sui": "^1.4.0-nightly.0",
|
214
214
|
"@ledgerhq/hw-app-tezos": "^6.31.6-nightly.0",
|
215
215
|
"@ledgerhq/hw-app-trx": "^6.31.6-nightly.0",
|
216
|
-
"@ledgerhq/hw-app-vet": "^0.5.
|
216
|
+
"@ledgerhq/hw-app-vet": "^0.5.15-nightly.0",
|
217
217
|
"@ledgerhq/hw-app-xrp": "^6.32.4-nightly.0",
|
218
218
|
"@ledgerhq/hw-transport": "^6.31.10-nightly.0",
|
219
219
|
"@ledgerhq/hw-transport-mocker": "^6.29.10-nightly.0",
|
220
|
-
"@ledgerhq/ledger-cal-service": "^1.
|
220
|
+
"@ledgerhq/ledger-cal-service": "^1.4.0-nightly.2",
|
221
221
|
"@ledgerhq/live-config": "^3.2.0-nightly.0",
|
222
|
-
"@ledgerhq/live-countervalues": "^0.6.
|
223
|
-
"@ledgerhq/live-countervalues-react": "^0.5.0",
|
222
|
+
"@ledgerhq/live-countervalues-react": "^0.6.0-nightly.1",
|
224
223
|
"@ledgerhq/live-dmk-shared": "^0.12.1",
|
225
224
|
"@ledgerhq/live-env": "^2.15.0-nightly.1",
|
226
225
|
"@ledgerhq/live-hooks": "0.1.0",
|
227
226
|
"@ledgerhq/live-network": "^2.0.16-nightly.1",
|
228
|
-
"@ledgerhq/live-nft": "^0.8.
|
227
|
+
"@ledgerhq/live-nft": "^0.8.19-nightly.1",
|
229
228
|
"@ledgerhq/live-promise": "^0.1.1",
|
230
|
-
"@ledgerhq/live-signer-canton": "^0.2.3-nightly.
|
231
|
-
"@ledgerhq/live-signer-evm": "^0.7.1",
|
232
|
-
"@ledgerhq/live-signer-solana": "^0.5.
|
233
|
-
"@ledgerhq/live-wallet": "^0.12.
|
229
|
+
"@ledgerhq/live-signer-canton": "^0.2.3-nightly.2",
|
230
|
+
"@ledgerhq/live-signer-evm": "^0.7.2-nightly.1",
|
231
|
+
"@ledgerhq/live-signer-solana": "^0.5.4-nightly.1",
|
232
|
+
"@ledgerhq/live-wallet": "^0.12.3-nightly.1",
|
234
233
|
"@ledgerhq/logs": "^6.13.0",
|
235
|
-
"@ledgerhq/speculos-transport": "^0.2.9-nightly.
|
234
|
+
"@ledgerhq/speculos-transport": "^0.2.9-nightly.2",
|
236
235
|
"@ledgerhq/wallet-api-acre-module": "^0.6.0",
|
237
|
-
"@ledgerhq/wallet-api-exchange-module": "^0.16.0-nightly.1"
|
236
|
+
"@ledgerhq/wallet-api-exchange-module": "^0.16.0-nightly.1",
|
237
|
+
"@ledgerhq/live-countervalues": "^0.6.3-nightly.1"
|
238
238
|
},
|
239
239
|
"devDependencies": {
|
240
240
|
"@solana/web3.js": "1.95.4",
|
@@ -282,10 +282,10 @@
|
|
282
282
|
"undici": "6.19.2",
|
283
283
|
"uuid": "^8.3.2",
|
284
284
|
"ws": "7",
|
285
|
-
"@ledgerhq/device-react": "^0.2.
|
286
|
-
"@ledgerhq/types-cryptoassets": "^7.26.0-nightly.
|
285
|
+
"@ledgerhq/device-react": "^0.2.43-nightly.0",
|
286
|
+
"@ledgerhq/types-cryptoassets": "^7.26.0-nightly.1",
|
287
287
|
"@ledgerhq/types-devices": "^6.27.0",
|
288
|
-
"@ledgerhq/types-live": "^6.
|
288
|
+
"@ledgerhq/types-live": "^6.83.0-nightly.0"
|
289
289
|
},
|
290
290
|
"scripts": {
|
291
291
|
"build": "zx ./scripts/build-ts.mjs",
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { isCALIntegrationEnabled, getCALStore } from "./cal-integration";
|
2
|
+
import { CALStore } from "./cal-store";
|
3
|
+
import { isFeature } from "../../featureFlags/firebaseFeatureFlags";
|
4
|
+
|
5
|
+
jest.mock("../../featureFlags/firebaseFeatureFlags", () => ({
|
6
|
+
isFeature: jest.fn(),
|
7
|
+
}));
|
8
|
+
|
9
|
+
const mockIsFeature = jest.mocked(isFeature);
|
10
|
+
|
11
|
+
describe("CAL Integration", () => {
|
12
|
+
beforeEach(() => {
|
13
|
+
mockIsFeature.mockClear();
|
14
|
+
});
|
15
|
+
|
16
|
+
describe("isCALIntegrationEnabled", () => {
|
17
|
+
it("should return false when feature flag is disabled", () => {
|
18
|
+
mockIsFeature.mockReturnValue(false);
|
19
|
+
|
20
|
+
expect(isCALIntegrationEnabled()).toBe(false);
|
21
|
+
expect(mockIsFeature).toHaveBeenCalledWith("calLedgerService");
|
22
|
+
});
|
23
|
+
|
24
|
+
it("should return true when feature flag is enabled (assuming MOCK is false)", () => {
|
25
|
+
mockIsFeature.mockReturnValue(true);
|
26
|
+
|
27
|
+
const result = isCALIntegrationEnabled();
|
28
|
+
expect(mockIsFeature).toHaveBeenCalledWith("calLedgerService");
|
29
|
+
expect(result).toEqual(true);
|
30
|
+
});
|
31
|
+
|
32
|
+
it("should return false when feature check throws", () => {
|
33
|
+
mockIsFeature.mockImplementation(() => {
|
34
|
+
throw new Error("Feature check error");
|
35
|
+
});
|
36
|
+
|
37
|
+
expect(isCALIntegrationEnabled()).toBe(false);
|
38
|
+
});
|
39
|
+
});
|
40
|
+
|
41
|
+
describe("getCALStore", () => {
|
42
|
+
it("should return a CALStore instance", () => {
|
43
|
+
const store = getCALStore();
|
44
|
+
expect(store).toBeInstanceOf(CALStore);
|
45
|
+
});
|
46
|
+
|
47
|
+
it("should return the same instance on multiple calls", () => {
|
48
|
+
const store1 = getCALStore();
|
49
|
+
const store2 = getCALStore();
|
50
|
+
expect(store1).toBe(store2);
|
51
|
+
});
|
52
|
+
});
|
53
|
+
});
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { getEnv } from "@ledgerhq/live-env";
|
2
|
+
import { log } from "@ledgerhq/logs";
|
3
|
+
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
4
|
+
import { CALStore } from "./cal-store";
|
5
|
+
import { isFeature } from "../../featureFlags/firebaseFeatureFlags";
|
6
|
+
|
7
|
+
let calStoreInstance: CALStore | undefined;
|
8
|
+
|
9
|
+
export function isCALIntegrationEnabled(): boolean {
|
10
|
+
try {
|
11
|
+
return !getEnv("MOCK") && isFeature("calLedgerService");
|
12
|
+
} catch (error) {
|
13
|
+
log("cal", "Error checking CAL integration:", error);
|
14
|
+
return false;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
export function getCALStore(): CryptoAssetsStore {
|
19
|
+
if (!calStoreInstance) {
|
20
|
+
calStoreInstance = new CALStore();
|
21
|
+
}
|
22
|
+
return calStoreInstance;
|
23
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { CALStore } from "./cal-store";
|
2
|
+
import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
3
|
+
|
4
|
+
describe("CALStore", () => {
|
5
|
+
let store: CALStore;
|
6
|
+
|
7
|
+
beforeEach(() => {
|
8
|
+
store = new CALStore();
|
9
|
+
});
|
10
|
+
|
11
|
+
describe("Token cache operations", () => {
|
12
|
+
const token = {
|
13
|
+
id: "ethereum/erc20/usdt",
|
14
|
+
name: "Tether USD",
|
15
|
+
ticker: "USDT",
|
16
|
+
contractAddress: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
17
|
+
parentCurrency: { id: "ethereum" },
|
18
|
+
type: "TokenCurrency",
|
19
|
+
units: [
|
20
|
+
{
|
21
|
+
name: "USDT",
|
22
|
+
code: "USDT",
|
23
|
+
magnitude: 6,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
} as TokenCurrency;
|
27
|
+
|
28
|
+
it("should store and retrieve tokens by ID", () => {
|
29
|
+
store.addTokens([token]);
|
30
|
+
|
31
|
+
const foundToken = store.findTokenById("ethereum/erc20/usdt");
|
32
|
+
expect(foundToken).toEqual(token);
|
33
|
+
});
|
34
|
+
|
35
|
+
it("should store and retrieve tokens by address", () => {
|
36
|
+
store.addTokens([token]);
|
37
|
+
|
38
|
+
const foundToken = store.findTokenByAddress("0xdAC17F958D2ee523a2206206994597C13D831ec7");
|
39
|
+
expect(foundToken).toEqual(token);
|
40
|
+
});
|
41
|
+
|
42
|
+
it("should store and retrieve tokens by ticker", () => {
|
43
|
+
store.addTokens([token]);
|
44
|
+
|
45
|
+
const foundToken = store.findTokenByTicker("USDT");
|
46
|
+
expect(foundToken).toEqual(token);
|
47
|
+
});
|
48
|
+
|
49
|
+
it("should find token by address in specific currency", () => {
|
50
|
+
store.addTokens([token]);
|
51
|
+
|
52
|
+
const foundToken = store.findTokenByAddressInCurrency(
|
53
|
+
"0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
54
|
+
"ethereum",
|
55
|
+
);
|
56
|
+
expect(foundToken).toEqual(token);
|
57
|
+
});
|
58
|
+
|
59
|
+
it("should not find token by address in different currency", () => {
|
60
|
+
store.addTokens([token]);
|
61
|
+
|
62
|
+
const foundToken = store.findTokenByAddressInCurrency(
|
63
|
+
"0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
64
|
+
"polygon",
|
65
|
+
);
|
66
|
+
expect(foundToken).toBeUndefined();
|
67
|
+
});
|
68
|
+
|
69
|
+
it("should return undefined for non-existent address in findTokenByAddressInCurrency", () => {
|
70
|
+
store.addTokens([token]);
|
71
|
+
|
72
|
+
const foundToken = store.findTokenByAddressInCurrency("0xNONEXISTENT", "ethereum");
|
73
|
+
expect(foundToken).toBeUndefined();
|
74
|
+
});
|
75
|
+
|
76
|
+
it("should return undefined for non-existent tokens", () => {
|
77
|
+
expect(store.findTokenById("non-existent")).toBeUndefined();
|
78
|
+
expect(store.findTokenByAddress("0x0000")).toBeUndefined();
|
79
|
+
expect(store.findTokenByTicker("FAKE")).toBeUndefined();
|
80
|
+
});
|
81
|
+
|
82
|
+
it("should throw error when getting non-existent token by ID", () => {
|
83
|
+
expect(() => store.getTokenById("non-existent")).toThrow("Token not found: non-existent");
|
84
|
+
});
|
85
|
+
|
86
|
+
it("should get existing token by ID", () => {
|
87
|
+
store.addTokens([token]);
|
88
|
+
|
89
|
+
const foundToken = store.getTokenById("ethereum/erc20/usdt");
|
90
|
+
expect(foundToken).toEqual(token);
|
91
|
+
});
|
92
|
+
});
|
93
|
+
});
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
2
|
+
import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
3
|
+
|
4
|
+
export class CALStore implements CryptoAssetsStore {
|
5
|
+
private tokenCache = new Map<string, TokenCurrency>();
|
6
|
+
private addressCache = new Map<string, TokenCurrency>();
|
7
|
+
private tickerCache = new Map<string, TokenCurrency>();
|
8
|
+
|
9
|
+
addTokens(tokens: TokenCurrency[]) {
|
10
|
+
tokens.forEach(token => {
|
11
|
+
this.tokenCache.set(token.id, token);
|
12
|
+
if (token.contractAddress) {
|
13
|
+
this.addressCache.set(token.contractAddress, token);
|
14
|
+
}
|
15
|
+
this.tickerCache.set(token.ticker, token);
|
16
|
+
});
|
17
|
+
}
|
18
|
+
|
19
|
+
findTokenByAddress(address: string): TokenCurrency | undefined {
|
20
|
+
return this.addressCache.get(address);
|
21
|
+
}
|
22
|
+
|
23
|
+
getTokenById(id: string): TokenCurrency {
|
24
|
+
const token = this.tokenCache.get(id);
|
25
|
+
if (!token) {
|
26
|
+
throw new Error(`Token not found: ${id}`);
|
27
|
+
}
|
28
|
+
return token;
|
29
|
+
}
|
30
|
+
|
31
|
+
findTokenById(id: string): TokenCurrency | undefined {
|
32
|
+
return this.tokenCache.get(id);
|
33
|
+
}
|
34
|
+
|
35
|
+
findTokenByAddressInCurrency(address: string, currencyId: string): TokenCurrency | undefined {
|
36
|
+
const token = this.addressCache.get(address);
|
37
|
+
if (token && token.parentCurrency.id === currencyId) {
|
38
|
+
return token;
|
39
|
+
}
|
40
|
+
return undefined;
|
41
|
+
}
|
42
|
+
|
43
|
+
findTokenByTicker(ticker: string): TokenCurrency | undefined {
|
44
|
+
return this.tickerCache.get(ticker);
|
45
|
+
}
|
46
|
+
}
|
@@ -2,8 +2,22 @@ import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
2
2
|
import { getCryptoAssetsStore, setCryptoAssetsStore } from ".";
|
3
3
|
import * as legacy from "@ledgerhq/cryptoassets/tokens";
|
4
4
|
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
5
|
+
import * as calIntegration from "./cal-integration";
|
5
6
|
|
6
7
|
describe("Testing CryptoAssetStore", () => {
|
8
|
+
let isCALIntegrationEnabledSpy: jest.SpyInstance;
|
9
|
+
let getCALStoreSpy: jest.SpyInstance;
|
10
|
+
|
11
|
+
beforeEach(() => {
|
12
|
+
isCALIntegrationEnabledSpy = jest
|
13
|
+
.spyOn(calIntegration, "isCALIntegrationEnabled")
|
14
|
+
.mockReturnValue(false);
|
15
|
+
getCALStoreSpy = jest.spyOn(calIntegration, "getCALStore");
|
16
|
+
});
|
17
|
+
|
18
|
+
afterEach(() => {
|
19
|
+
jest.restoreAllMocks();
|
20
|
+
});
|
7
21
|
it("should return the default methods from cryptoassets libs when feature flag does not exists", () => {
|
8
22
|
LiveConfig.setConfig({
|
9
23
|
some_other_feature: {
|
@@ -68,4 +82,37 @@ describe("Testing CryptoAssetStore", () => {
|
|
68
82
|
const store = getCryptoAssetsStore();
|
69
83
|
expect(store).toBe(newStore);
|
70
84
|
});
|
85
|
+
|
86
|
+
it("should return CAL store when CAL integration is enabled", () => {
|
87
|
+
isCALIntegrationEnabledSpy.mockReturnValue(true);
|
88
|
+
|
89
|
+
const mockCALStore = {} as unknown as CryptoAssetsStore;
|
90
|
+
getCALStoreSpy.mockReturnValue(mockCALStore);
|
91
|
+
|
92
|
+
const store = getCryptoAssetsStore();
|
93
|
+
|
94
|
+
expect(isCALIntegrationEnabledSpy).toHaveBeenCalled();
|
95
|
+
expect(getCALStoreSpy).toHaveBeenCalled();
|
96
|
+
expect(store).toBe(mockCALStore);
|
97
|
+
});
|
98
|
+
|
99
|
+
it("should prioritize CAL integration over feature flags", () => {
|
100
|
+
isCALIntegrationEnabledSpy.mockReturnValue(true);
|
101
|
+
|
102
|
+
LiveConfig.setConfig({
|
103
|
+
feature_cal_lazy_loading: {
|
104
|
+
type: "boolean",
|
105
|
+
default: true,
|
106
|
+
},
|
107
|
+
});
|
108
|
+
|
109
|
+
const mockCALStore = {} as unknown as CryptoAssetsStore;
|
110
|
+
getCALStoreSpy.mockReturnValue(mockCALStore);
|
111
|
+
|
112
|
+
const store = getCryptoAssetsStore();
|
113
|
+
|
114
|
+
expect(store).toBe(mockCALStore);
|
115
|
+
expect(isCALIntegrationEnabledSpy).toHaveBeenCalled();
|
116
|
+
expect(getCALStoreSpy).toHaveBeenCalled();
|
117
|
+
});
|
71
118
|
});
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
2
2
|
import * as legacy from "@ledgerhq/cryptoassets/tokens";
|
3
3
|
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
4
|
+
import { isCALIntegrationEnabled, getCALStore } from "./cal-integration";
|
4
5
|
|
5
6
|
const legacyStore: CryptoAssetsStore = {
|
6
7
|
findTokenByAddress: legacy.findTokenByAddress,
|
@@ -17,6 +18,10 @@ export function setCryptoAssetsStore(store: CryptoAssetsStore) {
|
|
17
18
|
}
|
18
19
|
|
19
20
|
export function getCryptoAssetsStore(): CryptoAssetsStore {
|
21
|
+
if (isCALIntegrationEnabled()) {
|
22
|
+
return getCALStore();
|
23
|
+
}
|
24
|
+
|
20
25
|
const featureEnabled =
|
21
26
|
LiveConfig.isConfigSet() && LiveConfig.getValueByKey("feature_cal_lazy_loading");
|
22
27
|
if (!featureEnabled) {
|
@@ -134,7 +134,7 @@ const buildGetSequence = (networkFamily: string) =>
|
|
134
134
|
const buildListOperations = networkFamily =>
|
135
135
|
async function listOperations(
|
136
136
|
address: string,
|
137
|
-
pagination: Pagination = { minHeight: 0 },
|
137
|
+
pagination: Pagination = { minHeight: 0, order: "asc" },
|
138
138
|
): Promise<[Operation<any>[], string]> {
|
139
139
|
const { data } = await network<{ operations: Operation<any>[] }, unknown>({
|
140
140
|
method: "GET",
|
@@ -5,7 +5,6 @@ import type { Operation, SyncConfig, TokenAccount } from "@ledgerhq/types-live";
|
|
5
5
|
import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
|
6
6
|
import { listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets";
|
7
7
|
import { AssetInfo, Balance } from "@ledgerhq/coin-framework/api/types";
|
8
|
-
import { findTokenById } from "@ledgerhq/cryptoassets/tokens";
|
9
8
|
|
10
9
|
export interface OperationCommon extends Operation {
|
11
10
|
extra: Record<string, any>;
|
@@ -13,11 +12,6 @@ export interface OperationCommon extends Operation {
|
|
13
12
|
|
14
13
|
export const getAssetIdFromTokenId = (tokenId: string): string => tokenId.split("/")[2];
|
15
14
|
|
16
|
-
export const getAssetIdFromAsset = (asset: AssetInfo) =>
|
17
|
-
asset.type !== "native" && "assetReference" in asset && "assetOwner" in asset
|
18
|
-
? `${asset.assetReference}:${asset.assetOwner}`
|
19
|
-
: "";
|
20
|
-
|
21
15
|
function buildTokenAccount({
|
22
16
|
parentAccountId,
|
23
17
|
assetBalance,
|
@@ -68,12 +62,14 @@ export function buildSubAccounts({
|
|
68
62
|
assetsBalance,
|
69
63
|
syncConfig,
|
70
64
|
operations,
|
65
|
+
getTokenFromAsset,
|
71
66
|
}: {
|
72
67
|
currency: CryptoCurrency;
|
73
68
|
accountId: string;
|
74
69
|
assetsBalance: Balance[];
|
75
70
|
syncConfig: SyncConfig;
|
76
71
|
operations: OperationCommon[];
|
72
|
+
getTokenFromAsset?: (asset: AssetInfo) => TokenCurrency | undefined;
|
77
73
|
}): TokenAccount[] | undefined {
|
78
74
|
const { blacklistedTokenIds = [] } = syncConfig;
|
79
75
|
const allTokens = listTokensForCryptoCurrency(currency);
|
@@ -85,7 +81,7 @@ export function buildSubAccounts({
|
|
85
81
|
assetsBalance
|
86
82
|
.filter(b => b.asset.type !== "native") // NOTE: this could be removed, keeping here while fixing things up
|
87
83
|
.map(balance => {
|
88
|
-
const token =
|
84
|
+
const token = getTokenFromAsset && getTokenFromAsset(balance.asset);
|
89
85
|
// NOTE: for future tokens, will need to check over currencyName/standard(erc20,trc10,trc20, etc)/id
|
90
86
|
if (token && !blacklistedTokenIds.includes(token.id)) {
|
91
87
|
tokenAccounts.push(
|
@@ -104,7 +100,3 @@ export function buildSubAccounts({
|
|
104
100
|
});
|
105
101
|
return tokenAccounts;
|
106
102
|
}
|
107
|
-
|
108
|
-
export function findToken(currency: CryptoCurrency, balance: Balance): TokenCurrency | undefined {
|
109
|
-
return findTokenById(`${currency.family}/asset/${getAssetIdFromAsset(balance.asset)}`);
|
110
|
-
}
|
@@ -4,7 +4,6 @@ import BigNumber from "bignumber.js";
|
|
4
4
|
import { getAlpacaApi } from "./alpaca";
|
5
5
|
import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
|
6
6
|
import { inferSubOperations } from "@ledgerhq/coin-framework/serialization";
|
7
|
-
import { findToken } from "./buildSubAccounts";
|
8
7
|
import { buildSubAccounts, OperationCommon } from "./buildSubAccounts";
|
9
8
|
|
10
9
|
export function genericGetAccountShape(network: string, kind: string): GetAccountShape {
|
@@ -33,8 +32,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
33
32
|
|
34
33
|
const assetsBalance = balanceRes
|
35
34
|
.filter(b => b.asset.type !== "native")
|
36
|
-
.filter(b =>
|
37
|
-
|
35
|
+
.filter(b => alpacaApi.getTokenFromAsset && alpacaApi.getTokenFromAsset(b.asset));
|
38
36
|
const nativeBalance = BigInt(nativeAsset?.value ?? "0");
|
39
37
|
|
40
38
|
const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
|
@@ -43,7 +41,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
43
41
|
const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
|
44
42
|
|
45
43
|
const blockHeight = oldOps.length ? (oldOps[0].blockHeight ?? 0) + 1 : 0;
|
46
|
-
const paginationParams: any = { minHeight: blockHeight };
|
44
|
+
const paginationParams: any = { minHeight: blockHeight, order: "asc" };
|
47
45
|
if (lastPagingToken) {
|
48
46
|
paginationParams.lastPagingToken = lastPagingToken;
|
49
47
|
}
|
@@ -72,6 +70,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
72
70
|
assetsBalance,
|
73
71
|
syncConfig,
|
74
72
|
operations: assetOperations,
|
73
|
+
getTokenFromAsset: alpacaApi.getTokenFromAsset,
|
75
74
|
}) || [];
|
76
75
|
|
77
76
|
const operationsWithSubs = mergedOps.map(op => {
|
@@ -3,6 +3,8 @@ import { DeviceLabels } from "../enum/DeviceLabels";
|
|
3
3
|
|
4
4
|
export async function delegateTezos() {
|
5
5
|
await waitFor(DeviceLabels.REVIEW_OPERATION);
|
6
|
+
await pressUntilTextFound(DeviceLabels.ACCEPT_RISK);
|
7
|
+
await pressBoth();
|
6
8
|
await pressUntilTextFound(DeviceLabels.ACCEPT);
|
7
9
|
await pressBoth();
|
8
10
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import secp256k1 from "secp256k1";
|
1
|
+
import { secp256k1 } from "@noble/curves/secp256k1";
|
2
2
|
import { firstValueFrom, from, Observable } from "rxjs";
|
3
3
|
import { TransportStatusError, WrongDeviceForAccount } from "@ledgerhq/errors";
|
4
4
|
|
@@ -187,7 +187,8 @@ function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffe
|
|
187
187
|
return Buffer.from(base64Signature, "base64");
|
188
188
|
}
|
189
189
|
if (exchangeType === ExchangeTypes.Sell) return Buffer.from(signature, "hex");
|
190
|
-
|
190
|
+
const sig = secp256k1.Signature.fromCompact(Buffer.from(signature, "hex"));
|
191
|
+
return Buffer.from(sig.toDERRawBytes());
|
191
192
|
}
|
192
193
|
|
193
194
|
export default completeExchange;
|
@@ -14,7 +14,7 @@ import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
|
|
14
14
|
import { log } from "@ledgerhq/logs";
|
15
15
|
import BigNumber from "bignumber.js";
|
16
16
|
import { Observable } from "rxjs";
|
17
|
-
import secp256k1 from "secp256k1";
|
17
|
+
import { secp256k1 } from "@noble/curves/secp256k1";
|
18
18
|
import { getCurrencyExchangeConfig } from "../";
|
19
19
|
import { getAccountCurrency, getMainAccount } from "../../account";
|
20
20
|
import { getAccountBridge } from "../../bridge";
|
@@ -271,7 +271,10 @@ const completeExchange = (
|
|
271
271
|
function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffer {
|
272
272
|
return exchangeType === ExchangeTypes.SwapNg
|
273
273
|
? base64UrlDecode(signature)
|
274
|
-
:
|
274
|
+
: (() => {
|
275
|
+
const sig = secp256k1.Signature.fromCompact(Buffer.from(signature, "hex"));
|
276
|
+
return Buffer.from(sig.toDERRawBytes());
|
277
|
+
})();
|
275
278
|
}
|
276
279
|
|
277
280
|
function base64UrlDecode(base64Url: string): Buffer {
|
@@ -14,7 +14,7 @@ import { log } from "@ledgerhq/logs";
|
|
14
14
|
import { BigNumber } from "bignumber.js";
|
15
15
|
import invariant from "invariant";
|
16
16
|
import { firstValueFrom, from, Observable } from "rxjs";
|
17
|
-
import secp256k1 from "secp256k1";
|
17
|
+
import { secp256k1 } from "@noble/curves/secp256k1";
|
18
18
|
import { getCurrencyExchangeConfig } from "../";
|
19
19
|
import { getAccountCurrency, getMainAccount } from "../../account";
|
20
20
|
import { getAccountBridge } from "../../bridge";
|
@@ -184,9 +184,10 @@ const initSwap = (input: InitSwapInput): Observable<SwapRequestEvent> => {
|
|
184
184
|
|
185
185
|
await swap.processTransaction(Buffer.from(swapResult.binaryPayload, "hex"), estimatedFees);
|
186
186
|
if (unsubscribed) return;
|
187
|
-
const goodSign = <Buffer>(
|
188
|
-
secp256k1.
|
189
|
-
|
187
|
+
const goodSign = <Buffer>(() => {
|
188
|
+
const sig = secp256k1.Signature.fromCompact(Buffer.from(swapResult.signature, "hex"));
|
189
|
+
return Buffer.from(sig.toDERRawBytes());
|
190
|
+
})();
|
190
191
|
await swap.checkTransactionSignature(goodSign);
|
191
192
|
if (unsubscribed) return;
|
192
193
|
const mainPayoutCurrency = getAccountCurrency(payoutAccount);
|