@ledgerhq/live-common 34.51.0-nightly.0 → 34.51.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/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.js +2 -0
- package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +3 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +37 -45
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js +0 -20
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/signRawOperation.d.ts +8 -0
- package/lib/bridge/generic-alpaca/signRawOperation.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/signRawOperation.js +55 -0
- package/lib/bridge/generic-alpaca/signRawOperation.js.map +1 -0
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js +1 -0
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +186 -88
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +1 -0
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/mockHelpers.d.ts +1 -0
- package/lib/bridge/mockHelpers.d.ts.map +1 -1
- package/lib/bridge/mockHelpers.js +53 -1
- package/lib/bridge/mockHelpers.js.map +1 -1
- package/lib/bridge/react/BridgeSync.d.ts +1 -0
- package/lib/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib/bridge/react/BridgeSync.js +19 -16
- package/lib/bridge/react/BridgeSync.js.map +1 -1
- package/lib/bridge/react/BridgeSync.test.js +403 -66
- package/lib/bridge/react/BridgeSync.test.js.map +1 -1
- package/lib/dada-client/entities/index.d.ts +1 -1
- package/lib/dada-client/entities/index.d.ts.map +1 -1
- package/lib/e2e/index.d.ts +8 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/families/algorand/bridge/mock.d.ts.map +1 -1
- package/lib/families/algorand/bridge/mock.js +1 -0
- package/lib/families/algorand/bridge/mock.js.map +1 -1
- package/lib/families/bitcoin/bridge/mock.d.ts.map +1 -1
- package/lib/families/bitcoin/bridge/mock.js +1 -0
- package/lib/families/bitcoin/bridge/mock.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +3 -0
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/cardano/bridge/mock.d.ts.map +1 -1
- package/lib/families/cardano/bridge/mock.js +1 -0
- package/lib/families/cardano/bridge/mock.js.map +1 -1
- package/lib/families/casper/bridge/mock.d.ts.map +1 -1
- package/lib/families/casper/bridge/mock.js +1 -0
- package/lib/families/casper/bridge/mock.js.map +1 -1
- package/lib/families/cosmos/bridge/mock.d.ts.map +1 -1
- package/lib/families/cosmos/bridge/mock.js +1 -0
- package/lib/families/cosmos/bridge/mock.js.map +1 -1
- package/lib/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib/families/evm/bridge/mock.js +1 -0
- package/lib/families/evm/bridge/mock.js.map +1 -1
- package/lib/families/icon/bridge/mock.d.ts.map +1 -1
- package/lib/families/icon/bridge/mock.js +1 -0
- package/lib/families/icon/bridge/mock.js.map +1 -1
- package/lib/families/multiversx/bridge/mock.d.ts.map +1 -1
- package/lib/families/multiversx/bridge/mock.js +1 -0
- package/lib/families/multiversx/bridge/mock.js.map +1 -1
- package/lib/families/polkadot/bridge/mock.d.ts.map +1 -1
- package/lib/families/polkadot/bridge/mock.js +1 -0
- package/lib/families/polkadot/bridge/mock.js.map +1 -1
- package/lib/families/polkadot/config.d.ts.map +1 -1
- package/lib/families/polkadot/config.js +84 -0
- package/lib/families/polkadot/config.js.map +1 -1
- package/lib/families/polkadot/setup.d.ts.map +1 -1
- package/lib/families/polkadot/setup.js +5 -4
- package/lib/families/polkadot/setup.js.map +1 -1
- package/lib/families/solana/bridge/mock.d.ts +1 -0
- package/lib/families/solana/bridge/mock.d.ts.map +1 -1
- package/lib/families/stellar/bridge/mock.d.ts.map +1 -1
- package/lib/families/stellar/bridge/mock.js +1 -0
- package/lib/families/stellar/bridge/mock.js.map +1 -1
- package/lib/families/tezos/bridge/mock.d.ts.map +1 -1
- package/lib/families/tezos/bridge/mock.js +1 -0
- package/lib/families/tezos/bridge/mock.js.map +1 -1
- package/lib/families/tron/bridge/mock.d.ts.map +1 -1
- package/lib/families/tron/bridge/mock.js +1 -0
- package/lib/families/tron/bridge/mock.js.map +1 -1
- package/lib/families/xrp/bridge/mock.d.ts.map +1 -1
- package/lib/families/xrp/bridge/mock.js +1 -0
- package/lib/families/xrp/bridge/mock.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +10 -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/generated/bridge/mock.d.ts +1 -0
- package/lib/generated/bridge/mock.d.ts.map +1 -1
- package/lib/hw/actions/rawTransaction.d.ts +37 -0
- package/lib/hw/actions/rawTransaction.d.ts.map +1 -0
- package/lib/hw/actions/rawTransaction.js +107 -0
- package/lib/hw/actions/rawTransaction.js.map +1 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +9 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/wallet-api/logic.d.ts +1 -0
- package/lib/wallet-api/logic.d.ts.map +1 -1
- package/lib/wallet-api/logic.js +21 -1
- package/lib/wallet-api/logic.js.map +1 -1
- package/lib/wallet-api/react.d.ts +9 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +60 -2
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/tracking.d.ts +3 -0
- package/lib/wallet-api/tracking.d.ts.map +1 -1
- package/lib/wallet-api/tracking.js +12 -0
- package/lib/wallet-api/tracking.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -0
- package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +3 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +37 -45
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +0 -17
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signRawOperation.d.ts +8 -0
- package/lib-es/bridge/generic-alpaca/signRawOperation.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/signRawOperation.js +48 -0
- package/lib-es/bridge/generic-alpaca/signRawOperation.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js +1 -0
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +163 -88
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +1 -0
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/mockHelpers.d.ts +1 -0
- package/lib-es/bridge/mockHelpers.d.ts.map +1 -1
- package/lib-es/bridge/mockHelpers.js +51 -0
- package/lib-es/bridge/mockHelpers.js.map +1 -1
- package/lib-es/bridge/react/BridgeSync.d.ts +1 -0
- package/lib-es/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib-es/bridge/react/BridgeSync.js +17 -15
- package/lib-es/bridge/react/BridgeSync.js.map +1 -1
- package/lib-es/bridge/react/BridgeSync.test.js +382 -65
- package/lib-es/bridge/react/BridgeSync.test.js.map +1 -1
- package/lib-es/dada-client/entities/index.d.ts +1 -1
- package/lib-es/dada-client/entities/index.d.ts.map +1 -1
- package/lib-es/e2e/index.d.ts +8 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/families/algorand/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/algorand/bridge/mock.js +2 -1
- package/lib-es/families/algorand/bridge/mock.js.map +1 -1
- package/lib-es/families/bitcoin/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/bitcoin/bridge/mock.js +2 -1
- package/lib-es/families/bitcoin/bridge/mock.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +3 -0
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/cardano/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/cardano/bridge/mock.js +2 -1
- package/lib-es/families/cardano/bridge/mock.js.map +1 -1
- package/lib-es/families/casper/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/casper/bridge/mock.js +2 -1
- package/lib-es/families/casper/bridge/mock.js.map +1 -1
- package/lib-es/families/cosmos/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/cosmos/bridge/mock.js +2 -1
- package/lib-es/families/cosmos/bridge/mock.js.map +1 -1
- package/lib-es/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/evm/bridge/mock.js +2 -1
- package/lib-es/families/evm/bridge/mock.js.map +1 -1
- package/lib-es/families/icon/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/icon/bridge/mock.js +2 -1
- package/lib-es/families/icon/bridge/mock.js.map +1 -1
- package/lib-es/families/multiversx/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/multiversx/bridge/mock.js +2 -1
- package/lib-es/families/multiversx/bridge/mock.js.map +1 -1
- package/lib-es/families/polkadot/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/polkadot/bridge/mock.js +2 -1
- package/lib-es/families/polkadot/bridge/mock.js.map +1 -1
- package/lib-es/families/polkadot/config.d.ts.map +1 -1
- package/lib-es/families/polkadot/config.js +84 -0
- package/lib-es/families/polkadot/config.js.map +1 -1
- package/lib-es/families/polkadot/setup.d.ts.map +1 -1
- package/lib-es/families/polkadot/setup.js +5 -4
- package/lib-es/families/polkadot/setup.js.map +1 -1
- package/lib-es/families/solana/bridge/mock.d.ts +1 -0
- package/lib-es/families/solana/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/stellar/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/stellar/bridge/mock.js +2 -1
- package/lib-es/families/stellar/bridge/mock.js.map +1 -1
- package/lib-es/families/tezos/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/tezos/bridge/mock.js +2 -1
- package/lib-es/families/tezos/bridge/mock.js.map +1 -1
- package/lib-es/families/tron/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/tron/bridge/mock.js +2 -1
- package/lib-es/families/tron/bridge/mock.js.map +1 -1
- package/lib-es/families/xrp/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/xrp/bridge/mock.js +2 -1
- package/lib-es/families/xrp/bridge/mock.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +10 -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/generated/bridge/mock.d.ts +1 -0
- package/lib-es/generated/bridge/mock.d.ts.map +1 -1
- package/lib-es/hw/actions/rawTransaction.d.ts +37 -0
- package/lib-es/hw/actions/rawTransaction.d.ts.map +1 -0
- package/lib-es/hw/actions/rawTransaction.js +103 -0
- package/lib-es/hw/actions/rawTransaction.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +9 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/wallet-api/logic.d.ts +1 -0
- package/lib-es/wallet-api/logic.d.ts.map +1 -1
- package/lib-es/wallet-api/logic.js +19 -0
- package/lib-es/wallet-api/logic.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +9 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +61 -3
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/tracking.d.ts +3 -0
- package/lib-es/wallet-api/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/tracking.js +12 -0
- package/lib-es/wallet-api/tracking.js.map +1 -1
- package/package.json +54 -54
- package/src/bridge/generic-alpaca/accountBridge.ts +2 -0
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +8 -0
- package/src/bridge/generic-alpaca/prepareTransaction.ts +46 -69
- package/src/bridge/generic-alpaca/signOperation.ts +0 -20
- package/src/bridge/generic-alpaca/signRawOperation.ts +86 -0
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +1 -0
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +191 -109
- package/src/bridge/generic-alpaca/utils.ts +1 -0
- package/src/bridge/mockHelpers.ts +57 -0
- package/src/bridge/react/BridgeSync.test.tsx +513 -82
- package/src/bridge/react/BridgeSync.tsx +18 -17
- package/src/dada-client/MIGRATION_GUIDE.md +215 -0
- package/src/dada-client/entities/index.ts +1 -1
- package/src/families/algorand/bridge/mock.ts +2 -0
- package/src/families/bitcoin/bridge/mock.ts +2 -0
- package/src/families/canton/bridge/mock.ts +3 -0
- package/src/families/cardano/bridge/mock.ts +2 -0
- package/src/families/casper/bridge/mock.ts +2 -0
- package/src/families/cosmos/bridge/mock.ts +2 -0
- package/src/families/evm/bridge/mock.ts +2 -0
- package/src/families/icon/bridge/mock.ts +2 -0
- package/src/families/multiversx/bridge/mock.ts +2 -0
- package/src/families/polkadot/bridge/mock.ts +2 -0
- package/src/families/polkadot/config.ts +84 -0
- package/src/families/polkadot/setup.ts +6 -4
- package/src/families/stellar/bridge/mock.ts +2 -0
- package/src/families/tezos/bridge/mock.ts +2 -0
- package/src/families/tron/bridge/mock.ts +2 -0
- package/src/families/xrp/bridge/mock.ts +2 -0
- package/src/featureFlags/defaultFeatures.ts +10 -1
- package/src/hw/actions/rawTransaction.ts +190 -0
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +9 -0
- package/src/wallet-api/logic.ts +35 -0
- package/src/wallet-api/react.ts +87 -1
- package/src/wallet-api/tracking.ts +15 -0
|
@@ -100,13 +100,21 @@ function useHydrate({ accounts, hydrateCurrency }) {
|
|
|
100
100
|
}, [accounts, hydrateCurrency]);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const nothingState = {
|
|
103
|
+
let lastTimeAnalyticsTrackPerAccountId: Record<string, number> = {};
|
|
104
|
+
let nothingState = {
|
|
106
105
|
pending: false,
|
|
107
106
|
error: null,
|
|
108
107
|
};
|
|
109
108
|
|
|
109
|
+
// Only used for tests
|
|
110
|
+
export function resetStates() {
|
|
111
|
+
lastTimeAnalyticsTrackPerAccountId = {};
|
|
112
|
+
nothingState = {
|
|
113
|
+
pending: false,
|
|
114
|
+
error: null,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
// useHydrate: returns a sync queue and bridge sync state
|
|
111
119
|
function useSyncQueue({
|
|
112
120
|
accounts,
|
|
@@ -159,11 +167,10 @@ function useSyncQueue({
|
|
|
159
167
|
if (!account) return;
|
|
160
168
|
const subAccounts: TokenAccount[] = account.subAccounts || [];
|
|
161
169
|
|
|
162
|
-
|
|
163
|
-
|
|
170
|
+
if (reason === "background") {
|
|
171
|
+
// don't track background syncs
|
|
164
172
|
return;
|
|
165
173
|
}
|
|
166
|
-
lastTimeSuccessSyncPerAccountId[accountId] = startSyncTime;
|
|
167
174
|
|
|
168
175
|
trackAnalytics("SyncSuccess", {
|
|
169
176
|
duration: (Date.now() - startSyncTime) / 1000,
|
|
@@ -173,22 +180,16 @@ function useSyncQueue({
|
|
|
173
180
|
operationsLength: account.operationsCount,
|
|
174
181
|
accountsCountForCurrency: accounts.filter(a => a.currency === account.currency).length,
|
|
175
182
|
tokensLength: subAccounts.length,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
subAccounts.forEach(a => {
|
|
181
|
-
const tokenId =
|
|
182
|
-
a.type === "TokenAccount" ? getAccountCurrency(a).id : account.currency.name;
|
|
183
|
-
trackAnalytics("SyncSuccessToken", {
|
|
184
|
-
tokenId,
|
|
183
|
+
tokens: subAccounts.map(a => ({
|
|
184
|
+
tokenId: a.type === "TokenAccount" ? getAccountCurrency(a).id : account.currency.name,
|
|
185
185
|
tokenTicker: getAccountCurrency(a).ticker,
|
|
186
186
|
operationsLength: a.operationsCount,
|
|
187
187
|
parentCurrencyName: account.currency.name,
|
|
188
188
|
parentDerivationMode: account.derivationMode,
|
|
189
189
|
votesCount: getVotesCount(a, account),
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
})),
|
|
191
|
+
votesCount: getVotesCount(account),
|
|
192
|
+
reason,
|
|
192
193
|
});
|
|
193
194
|
};
|
|
194
195
|
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# DaDa Client Migration Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Migrate from `listTokens()` and `listTokensForCryptoCurrency()` to the DaDa Client API.
|
|
6
|
+
|
|
7
|
+
> **Remove CAL Initiative ([LIVE-21487](https://ledgerhq.atlassian.net/browse/LIVE-21487))**: Replace static token lists with dynamic, server-managed asset data. Beware there are many usages of listTokens that actually are going to get dropped or moved to simpler solution than even using DaDa. This guide is for the usecases we still need to list tokens.
|
|
8
|
+
|
|
9
|
+
## Migration Scenarios
|
|
10
|
+
|
|
11
|
+
### 1. Basic Token Lists
|
|
12
|
+
|
|
13
|
+
**Before:**
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { listTokens } from "@ledgerhq/cryptoassets";
|
|
17
|
+
|
|
18
|
+
function TokenList() {
|
|
19
|
+
const tokens = listTokens();
|
|
20
|
+
return (
|
|
21
|
+
<div>
|
|
22
|
+
{tokens.map(token => <div key={token.id}>{token.name}</div>)}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**After:**
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { useAssetsData } from "@ledgerhq/live-common/dada-client/hooks/useAssetsData";
|
|
32
|
+
|
|
33
|
+
function TokenList() {
|
|
34
|
+
const { data, isLoading, loadNext } = useAssetsData({
|
|
35
|
+
product: "lld",
|
|
36
|
+
version: __APP_VERSION__,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (isLoading) return <div>Loading...</div>;
|
|
40
|
+
|
|
41
|
+
const tokens = Object.values(data?.cryptoOrTokenCurrencies || {})
|
|
42
|
+
.filter(currency => currency.type === "TokenCurrency");
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<InfiniteScrollList
|
|
46
|
+
data={tokens}
|
|
47
|
+
renderItem={(token, index) => (
|
|
48
|
+
<div key={token.id}>{token.name}</div>
|
|
49
|
+
)}
|
|
50
|
+
onScrollEnd={loadNext}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2. Currency-Specific Tokens
|
|
57
|
+
|
|
58
|
+
**Before:**
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets";
|
|
62
|
+
|
|
63
|
+
function EthereumTokens({ currency }) {
|
|
64
|
+
const tokens = listTokensForCryptoCurrency(currency);
|
|
65
|
+
return (
|
|
66
|
+
<select>
|
|
67
|
+
{tokens.map(token => (
|
|
68
|
+
<option key={token.id} value={token.id}>{token.name}</option>
|
|
69
|
+
))}
|
|
70
|
+
</select>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**After:**
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import { useAssetsData } from "@ledgerhq/live-common/dada-client/hooks/useAssetsData";
|
|
79
|
+
|
|
80
|
+
function EthereumTokens({ currency }) {
|
|
81
|
+
const { data, isLoading } = useAssetsData({
|
|
82
|
+
currencyIds: [currency.id],
|
|
83
|
+
areCurrenciesFiltered: true,
|
|
84
|
+
product: "lld",
|
|
85
|
+
version: __APP_VERSION__,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (isLoading) return <div>Loading...</div>;
|
|
89
|
+
|
|
90
|
+
const tokens = Object.values(data?.cryptoOrTokenCurrencies || {})
|
|
91
|
+
.filter(c => c.type === "TokenCurrency" && c.parentCurrency?.id === currency.id);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<select>
|
|
95
|
+
{tokens.map(token => (
|
|
96
|
+
<option key={token.id} value={token.id}>{token.name}</option>
|
|
97
|
+
))}
|
|
98
|
+
</select>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Search
|
|
104
|
+
|
|
105
|
+
**Before:**
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { listTokens } from "@ledgerhq/cryptoassets";
|
|
109
|
+
|
|
110
|
+
function SearchableTokens({ searchQuery }) {
|
|
111
|
+
const allTokens = listTokens();
|
|
112
|
+
const filteredTokens = allTokens.filter(token =>
|
|
113
|
+
token.name.toLowerCase().includes(searchQuery.toLowerCase())
|
|
114
|
+
);
|
|
115
|
+
return (
|
|
116
|
+
<div>
|
|
117
|
+
{filteredTokens.map(token => <div key={token.id}>{token.name}</div>)}
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**After:**
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { useAssetsData } from "@ledgerhq/live-common/dada-client/hooks/useAssetsData";
|
|
127
|
+
|
|
128
|
+
function SearchableTokens({ searchQuery }) {
|
|
129
|
+
const { data, isLoading, loadNext } = useAssetsData({
|
|
130
|
+
search: searchQuery,
|
|
131
|
+
product: "lld",
|
|
132
|
+
version: __APP_VERSION__,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
if (isLoading) return <div>Loading...</div>;
|
|
136
|
+
|
|
137
|
+
const tokens = Object.values(data?.cryptoOrTokenCurrencies || {})
|
|
138
|
+
.filter(currency => currency.type === "TokenCurrency");
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<InfiniteScrollList
|
|
142
|
+
data={tokens}
|
|
143
|
+
renderItem={(token) => <div key={token.id}>{token.name}</div>}
|
|
144
|
+
onScrollEnd={loadNext}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Setup
|
|
151
|
+
|
|
152
|
+
Add DaDa Client to your Redux store:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { configureStore } from "@reduxjs/toolkit";
|
|
156
|
+
import { assetsDataApi } from "@ledgerhq/live-common/dada-client/state-manager/api";
|
|
157
|
+
|
|
158
|
+
const store = configureStore({
|
|
159
|
+
reducer: {
|
|
160
|
+
[assetsDataApi.reducerPath]: assetsDataApi.reducer,
|
|
161
|
+
},
|
|
162
|
+
middleware: getDefaultMiddleware => getDefaultMiddleware().concat(assetsDataApi.middleware),
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Configuration
|
|
167
|
+
|
|
168
|
+
**Desktop (LLD):**
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
product: "lld";
|
|
172
|
+
version: __APP_VERSION__;
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Mobile (LLM):**
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
import { VersionNumber } from "react-native-version-number";
|
|
179
|
+
|
|
180
|
+
product: "llm";
|
|
181
|
+
version: VersionNumber.appVersion;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Pagination Components
|
|
185
|
+
|
|
186
|
+
**Desktop (LLD):** Use `InfiniteScrollList` with `onScrollEnd={loadNext}`
|
|
187
|
+
|
|
188
|
+
**Mobile (LLM):** Use `BottomSheetVirtualizedList` or `FlatList` with `onEndReached={loadNext}`
|
|
189
|
+
|
|
190
|
+
## API Reference
|
|
191
|
+
|
|
192
|
+
### useAssetsData (Paginated)
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const { data, isLoading, loadNext, error, refetch } = useAssetsData({
|
|
196
|
+
product: "lld" | "llm", // app identifier
|
|
197
|
+
version: string, // app version
|
|
198
|
+
search?: string, // server-side search query
|
|
199
|
+
currencyIds?: string[], // filter by parent currencies
|
|
200
|
+
areCurrenciesFiltered?: boolean, // required when using currencyIds
|
|
201
|
+
useCase?: string, // optimize server response
|
|
202
|
+
isStaging?: boolean, // use staging API
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### useAssetData (Single Page)
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
const { data, isLoading, error, refetch } = useAssetData({
|
|
210
|
+
product: "lld" | "llm", // app identifier
|
|
211
|
+
version: string, // app version
|
|
212
|
+
currencyIds?: string[], // filter by parent currencies
|
|
213
|
+
isStaging?: boolean, // use staging API
|
|
214
|
+
});
|
|
215
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
2
|
import type { ApiAsset } from "@ledgerhq/cryptoassets";
|
|
3
|
-
import { PartialMarketItemResponse } from "
|
|
3
|
+
import { PartialMarketItemResponse } from "../../market/utils/types";
|
|
4
4
|
|
|
5
5
|
// Types for crypto asset metadata
|
|
6
6
|
export interface CryptoAssetMeta {
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
makeAccountBridgeReceive,
|
|
13
13
|
scanAccounts,
|
|
14
14
|
signOperation,
|
|
15
|
+
signRawOperation,
|
|
15
16
|
broadcast,
|
|
16
17
|
sync,
|
|
17
18
|
isInvalidRecipient,
|
|
@@ -106,6 +107,7 @@ const accountBridge: AccountBridge<AlgorandTransaction, any> = {
|
|
|
106
107
|
assignFromAccountRaw,
|
|
107
108
|
initAccount,
|
|
108
109
|
signOperation,
|
|
110
|
+
signRawOperation,
|
|
109
111
|
broadcast,
|
|
110
112
|
getSerializedAddressParameters,
|
|
111
113
|
};
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
makeAccountBridgeReceive,
|
|
13
13
|
scanAccounts,
|
|
14
14
|
signOperation,
|
|
15
|
+
signRawOperation,
|
|
15
16
|
broadcast,
|
|
16
17
|
sync,
|
|
17
18
|
isInvalidRecipient,
|
|
@@ -129,6 +130,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
129
130
|
sync,
|
|
130
131
|
receive,
|
|
131
132
|
signOperation,
|
|
133
|
+
signRawOperation,
|
|
132
134
|
broadcast,
|
|
133
135
|
getSerializedAddressParameters,
|
|
134
136
|
};
|
|
@@ -165,6 +165,9 @@ const accountBridge: AccountBridge<CantonTransaction> = {
|
|
|
165
165
|
sync,
|
|
166
166
|
receive,
|
|
167
167
|
signOperation,
|
|
168
|
+
signRawOperation: () => {
|
|
169
|
+
throw new Error("signRawOperation is not supported");
|
|
170
|
+
},
|
|
168
171
|
broadcast,
|
|
169
172
|
getSerializedAddressParameters,
|
|
170
173
|
};
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
scanAccounts,
|
|
27
27
|
signOperation,
|
|
28
|
+
signRawOperation,
|
|
28
29
|
broadcast,
|
|
29
30
|
sync,
|
|
30
31
|
makeAccountBridgeReceive,
|
|
@@ -168,6 +169,7 @@ const accountBridge: AccountBridge<CardanoTransaction> = {
|
|
|
168
169
|
sync,
|
|
169
170
|
receive,
|
|
170
171
|
signOperation,
|
|
172
|
+
signRawOperation,
|
|
171
173
|
broadcast,
|
|
172
174
|
getSerializedAddressParameters,
|
|
173
175
|
};
|
|
@@ -11,6 +11,7 @@ import type { Transaction, TransactionStatus } from "../types";
|
|
|
11
11
|
import {
|
|
12
12
|
scanAccounts,
|
|
13
13
|
signOperation,
|
|
14
|
+
signRawOperation,
|
|
14
15
|
broadcast,
|
|
15
16
|
sync,
|
|
16
17
|
makeAccountBridgeReceive,
|
|
@@ -167,6 +168,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
167
168
|
sync,
|
|
168
169
|
receive,
|
|
169
170
|
signOperation,
|
|
171
|
+
signRawOperation,
|
|
170
172
|
broadcast,
|
|
171
173
|
estimateMaxSpendable,
|
|
172
174
|
getSerializedAddressParameters,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
makeAccountBridgeReceive,
|
|
33
33
|
scanAccounts,
|
|
34
34
|
signOperation,
|
|
35
|
+
signRawOperation,
|
|
35
36
|
sync,
|
|
36
37
|
} from "../../../bridge/mockHelpers";
|
|
37
38
|
import { getCurrencyConfiguration } from "../../../config";
|
|
@@ -126,6 +127,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
126
127
|
sync,
|
|
127
128
|
receive,
|
|
128
129
|
signOperation,
|
|
130
|
+
signRawOperation,
|
|
129
131
|
broadcast,
|
|
130
132
|
assignFromAccountRaw,
|
|
131
133
|
assignToAccountRaw,
|
|
@@ -6,6 +6,7 @@ import { getMainAccount } from "../../../account";
|
|
|
6
6
|
import {
|
|
7
7
|
scanAccounts,
|
|
8
8
|
signOperation,
|
|
9
|
+
signRawOperation,
|
|
9
10
|
broadcast,
|
|
10
11
|
sync,
|
|
11
12
|
makeAccountBridgeReceive,
|
|
@@ -118,6 +119,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
118
119
|
sync,
|
|
119
120
|
receive,
|
|
120
121
|
signOperation,
|
|
122
|
+
signRawOperation,
|
|
121
123
|
broadcast,
|
|
122
124
|
getSerializedAddressParameters,
|
|
123
125
|
};
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
scanAccounts,
|
|
11
11
|
signOperation,
|
|
12
|
+
signRawOperation,
|
|
12
13
|
broadcast,
|
|
13
14
|
sync,
|
|
14
15
|
isInvalidRecipient,
|
|
@@ -79,6 +80,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
79
80
|
sync,
|
|
80
81
|
receive,
|
|
81
82
|
signOperation,
|
|
83
|
+
signRawOperation,
|
|
82
84
|
broadcast,
|
|
83
85
|
getSerializedAddressParameters,
|
|
84
86
|
};
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
makeAccountBridgeReceive,
|
|
9
9
|
scanAccounts,
|
|
10
10
|
signOperation,
|
|
11
|
+
signRawOperation,
|
|
11
12
|
broadcast,
|
|
12
13
|
sync,
|
|
13
14
|
isInvalidRecipient,
|
|
@@ -99,6 +100,7 @@ const accountBridge: AccountBridge<Transaction, any> = {
|
|
|
99
100
|
assignToAccountRaw,
|
|
100
101
|
assignFromAccountRaw,
|
|
101
102
|
signOperation,
|
|
103
|
+
signRawOperation,
|
|
102
104
|
broadcast,
|
|
103
105
|
getSerializedAddressParameters,
|
|
104
106
|
};
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
makeAccountBridgeReceive,
|
|
9
9
|
scanAccounts,
|
|
10
10
|
signOperation,
|
|
11
|
+
signRawOperation,
|
|
11
12
|
broadcast,
|
|
12
13
|
sync,
|
|
13
14
|
isInvalidRecipient,
|
|
@@ -98,6 +99,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
98
99
|
assignToAccountRaw,
|
|
99
100
|
assignFromAccountRaw,
|
|
100
101
|
signOperation,
|
|
102
|
+
signRawOperation,
|
|
101
103
|
broadcast,
|
|
102
104
|
getSerializedAddressParameters,
|
|
103
105
|
};
|
|
@@ -12,6 +12,9 @@ export const polkadotConfig: Record<string, ConfigInfo> = {
|
|
|
12
12
|
url: getEnv("API_POLKADOT_SIDECAR"),
|
|
13
13
|
credentials: getEnv("API_POLKADOT_SIDECAR_CREDENTIALS"),
|
|
14
14
|
},
|
|
15
|
+
indexer: {
|
|
16
|
+
url: getEnv("API_POLKADOT_INDEXER"),
|
|
17
|
+
},
|
|
15
18
|
node: {
|
|
16
19
|
url: getEnv("API_POLKADOT_NODE"),
|
|
17
20
|
},
|
|
@@ -20,9 +23,90 @@ export const polkadotConfig: Record<string, ConfigInfo> = {
|
|
|
20
23
|
},
|
|
21
24
|
metadataShortener: {
|
|
22
25
|
url: "https://polkadot-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
26
|
+
id: "dot",
|
|
23
27
|
},
|
|
24
28
|
metadataHash: {
|
|
25
29
|
url: "https://polkadot-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
30
|
+
id: "dot",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
config_currency_assethub_polkadot: {
|
|
35
|
+
type: "object",
|
|
36
|
+
default: {
|
|
37
|
+
status: {
|
|
38
|
+
type: "active",
|
|
39
|
+
},
|
|
40
|
+
sidecar: {
|
|
41
|
+
url: "https://polkadot-asset-hub-sidecar.coin.ledger.com",
|
|
42
|
+
},
|
|
43
|
+
node: {
|
|
44
|
+
url: "https://polkadot-asset-hub-fullnodes.api.live.ledger.com",
|
|
45
|
+
},
|
|
46
|
+
staking: {
|
|
47
|
+
electionStatusThreshold: getEnv("POLKADOT_ELECTION_STATUS_THRESHOLD"),
|
|
48
|
+
},
|
|
49
|
+
indexer: {
|
|
50
|
+
url: "https://explorers.api.live.ledger.com/blockchain/dot_asset_hub",
|
|
51
|
+
},
|
|
52
|
+
metadataShortener: {
|
|
53
|
+
url: "https://polkadot-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
54
|
+
id: "dot-hub",
|
|
55
|
+
},
|
|
56
|
+
metadataHash: {
|
|
57
|
+
url: "https://polkadot-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
58
|
+
id: "dot-hub",
|
|
59
|
+
},
|
|
60
|
+
hasBeenMigrated: false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
config_currency_westend: {
|
|
64
|
+
type: "object",
|
|
65
|
+
default: {
|
|
66
|
+
status: {
|
|
67
|
+
type: "active",
|
|
68
|
+
},
|
|
69
|
+
sidecar: {
|
|
70
|
+
url: "https://polkadot-westend-sidecar.coin.ledger.com/rc",
|
|
71
|
+
},
|
|
72
|
+
node: {
|
|
73
|
+
url: "https://polkadot-westend-fullnodes.api.live.ledger.com",
|
|
74
|
+
},
|
|
75
|
+
indexer: {
|
|
76
|
+
url: "https://explorers.api.live.ledger.com/blockchain/dot_westend",
|
|
77
|
+
},
|
|
78
|
+
metadataShortener: {
|
|
79
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
80
|
+
id: "dot-hub",
|
|
81
|
+
},
|
|
82
|
+
metadataHash: {
|
|
83
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
84
|
+
id: "dot-hub",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
config_currency_assethub_westend: {
|
|
89
|
+
type: "object",
|
|
90
|
+
default: {
|
|
91
|
+
status: {
|
|
92
|
+
type: "active",
|
|
93
|
+
},
|
|
94
|
+
sidecar: {
|
|
95
|
+
url: "https://polkadot-westend-sidecar.coin.ledger.com",
|
|
96
|
+
},
|
|
97
|
+
node: {
|
|
98
|
+
url: "https://polkadot-westend-asset-hub-fullnodes.api.live.ledger.com",
|
|
99
|
+
},
|
|
100
|
+
indexer: {
|
|
101
|
+
url: "https://explorers.api.live.ledger.com/blockchain/dot_asset_hub_westend",
|
|
102
|
+
},
|
|
103
|
+
metadataShortener: {
|
|
104
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/transaction/metadata",
|
|
105
|
+
id: "dot-hub",
|
|
106
|
+
},
|
|
107
|
+
metadataHash: {
|
|
108
|
+
url: "https://polkadot-westend-metadata-shortener.api.live.ledger.com/node/metadata/hash",
|
|
109
|
+
id: "dot-hub",
|
|
26
110
|
},
|
|
27
111
|
},
|
|
28
112
|
},
|
|
@@ -15,15 +15,17 @@ import makeCliTools, { type CliTools } from "@ledgerhq/coin-polkadot/test/cli";
|
|
|
15
15
|
import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup";
|
|
16
16
|
import { Resolver } from "../../hw/getAddress/types";
|
|
17
17
|
import { getCurrencyConfiguration } from "../../config";
|
|
18
|
-
import {
|
|
18
|
+
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
19
19
|
|
|
20
20
|
const createSigner: CreateSigner<Polkadot> = (transport: Transport) => {
|
|
21
21
|
return new Polkadot(transport);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const getCurrencyConfig = (currency?: CryptoCurrency): PolkadotCoinConfig => {
|
|
25
|
+
if (!currency) {
|
|
26
|
+
throw new Error("No currency provided");
|
|
27
|
+
}
|
|
28
|
+
return getCurrencyConfiguration<PolkadotCoinConfig>(currency);
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
const bridge: Bridge<Transaction, PolkadotAccount, TransactionStatus> = createBridges(
|
|
@@ -19,6 +19,7 @@ import { formatCurrencyUnit } from "../../../currencies";
|
|
|
19
19
|
import {
|
|
20
20
|
scanAccounts,
|
|
21
21
|
signOperation,
|
|
22
|
+
signRawOperation,
|
|
22
23
|
broadcast,
|
|
23
24
|
sync,
|
|
24
25
|
isInvalidRecipient,
|
|
@@ -217,6 +218,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
217
218
|
sync,
|
|
218
219
|
receive,
|
|
219
220
|
signOperation,
|
|
221
|
+
signRawOperation,
|
|
220
222
|
broadcast,
|
|
221
223
|
estimateMaxSpendable,
|
|
222
224
|
getSerializedAddressParameters,
|
|
@@ -18,6 +18,7 @@ import { getMainAccount } from "../../../account";
|
|
|
18
18
|
import {
|
|
19
19
|
scanAccounts,
|
|
20
20
|
signOperation,
|
|
21
|
+
signRawOperation,
|
|
21
22
|
broadcast,
|
|
22
23
|
sync,
|
|
23
24
|
isInvalidRecipient,
|
|
@@ -205,6 +206,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
205
206
|
sync,
|
|
206
207
|
receive,
|
|
207
208
|
signOperation,
|
|
209
|
+
signRawOperation,
|
|
208
210
|
broadcast,
|
|
209
211
|
getSerializedAddressParameters,
|
|
210
212
|
};
|
|
@@ -6,6 +6,7 @@ import { getSerializedAddressParameters } from "@ledgerhq/coin-framework/bridge/
|
|
|
6
6
|
import {
|
|
7
7
|
scanAccounts,
|
|
8
8
|
signOperation,
|
|
9
|
+
signRawOperation,
|
|
9
10
|
broadcast,
|
|
10
11
|
sync,
|
|
11
12
|
isInvalidRecipient,
|
|
@@ -114,6 +115,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
114
115
|
sync,
|
|
115
116
|
receive,
|
|
116
117
|
signOperation,
|
|
118
|
+
signRawOperation,
|
|
117
119
|
broadcast,
|
|
118
120
|
getSerializedAddressParameters,
|
|
119
121
|
};
|
|
@@ -20,6 +20,7 @@ import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index";
|
|
|
20
20
|
import {
|
|
21
21
|
scanAccounts,
|
|
22
22
|
signOperation,
|
|
23
|
+
signRawOperation,
|
|
23
24
|
broadcast,
|
|
24
25
|
sync,
|
|
25
26
|
isInvalidRecipient,
|
|
@@ -143,6 +144,7 @@ const accountBridge: AccountBridge<Transaction> = {
|
|
|
143
144
|
sync,
|
|
144
145
|
receive,
|
|
145
146
|
signOperation,
|
|
147
|
+
signRawOperation,
|
|
146
148
|
broadcast,
|
|
147
149
|
getSerializedAddressParameters,
|
|
148
150
|
};
|
|
@@ -99,6 +99,9 @@ export const CURRENCY_DEFAULT_FEATURES = {
|
|
|
99
99
|
currencyKaspa: DEFAULT_FEATURE,
|
|
100
100
|
currencyEthereumHoodi: DEFAULT_FEATURE,
|
|
101
101
|
currencyCore: DEFAULT_FEATURE,
|
|
102
|
+
currencyWestend: DEFAULT_FEATURE,
|
|
103
|
+
currencyAssetHubPolkadot: DEFAULT_FEATURE,
|
|
104
|
+
currencyAssetHubWestend: DEFAULT_FEATURE,
|
|
102
105
|
};
|
|
103
106
|
|
|
104
107
|
/**
|
|
@@ -106,6 +109,7 @@ export const CURRENCY_DEFAULT_FEATURES = {
|
|
|
106
109
|
*/
|
|
107
110
|
export const DEFAULT_FEATURES: Features = {
|
|
108
111
|
...CURRENCY_DEFAULT_FEATURES,
|
|
112
|
+
welcomeScreenVideoCarousel: DEFAULT_FEATURE,
|
|
109
113
|
portfolioExchangeBanner: DEFAULT_FEATURE,
|
|
110
114
|
postOnboardingAssetsTransfer: DEFAULT_FEATURE,
|
|
111
115
|
counterValue: DEFAULT_FEATURE,
|
|
@@ -113,7 +117,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
|
113
117
|
ptxServiceCtaExchangeDrawer: DEFAULT_FEATURE,
|
|
114
118
|
ptxServiceCtaScreens: DEFAULT_FEATURE,
|
|
115
119
|
ptxSwapReceiveTRC20WithoutTrx: DEFAULT_FEATURE,
|
|
116
|
-
ptxSwapDetailedView: DEFAULT_FEATURE,
|
|
117
120
|
disableNftLedgerMarket: DEFAULT_FEATURE,
|
|
118
121
|
disableNftRaribleOpensea: DEFAULT_FEATURE,
|
|
119
122
|
disableNftSend: DEFAULT_FEATURE,
|
|
@@ -127,6 +130,12 @@ export const DEFAULT_FEATURES: Features = {
|
|
|
127
130
|
brazePushNotifications: initFeature(),
|
|
128
131
|
stakeAccountBanner: initFeature(),
|
|
129
132
|
|
|
133
|
+
ptxSwapDetailedView: initFeature({
|
|
134
|
+
enabled: false,
|
|
135
|
+
params: {
|
|
136
|
+
variant: ABTestingVariants.variantA,
|
|
137
|
+
},
|
|
138
|
+
}),
|
|
130
139
|
buyDeviceFromLive: {
|
|
131
140
|
enabled: false,
|
|
132
141
|
params: { debug: false, url: null },
|