@ledgerhq/live-common 34.55.0-nightly.20251220023811 → 34.55.0-nightly.20251224024018

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.
Files changed (170) hide show
  1. package/lib/account/recentAddresses.d.ts +2 -1
  2. package/lib/account/recentAddresses.d.ts.map +1 -1
  3. package/lib/account/recentAddresses.js +27 -9
  4. package/lib/account/recentAddresses.js.map +1 -1
  5. package/lib/e2e/enum/Account.d.ts +15 -16
  6. package/lib/e2e/enum/Account.d.ts.map +1 -1
  7. package/lib/e2e/enum/Account.js +93 -100
  8. package/lib/e2e/enum/Account.js.map +1 -1
  9. package/lib/e2e/enum/Addresses.d.ts +12 -0
  10. package/lib/e2e/enum/Addresses.d.ts.map +1 -0
  11. package/lib/e2e/enum/Addresses.js +16 -0
  12. package/lib/e2e/enum/Addresses.js.map +1 -0
  13. package/lib/e2e/enum/AppInfos.d.ts +1 -0
  14. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  15. package/lib/e2e/enum/AppInfos.js +1 -0
  16. package/lib/e2e/enum/AppInfos.js.map +1 -1
  17. package/lib/e2e/enum/Currency.d.ts +1 -0
  18. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  19. package/lib/e2e/enum/Currency.js +1 -0
  20. package/lib/e2e/enum/Currency.js.map +1 -1
  21. package/lib/e2e/families/algorand.d.ts.map +1 -1
  22. package/lib/e2e/families/algorand.js +3 -0
  23. package/lib/e2e/families/algorand.js.map +1 -1
  24. package/lib/e2e/families/bitcoin.d.ts.map +1 -1
  25. package/lib/e2e/families/bitcoin.js +6 -0
  26. package/lib/e2e/families/bitcoin.js.map +1 -1
  27. package/lib/e2e/families/cardano.d.ts.map +1 -1
  28. package/lib/e2e/families/cardano.js +3 -0
  29. package/lib/e2e/families/cardano.js.map +1 -1
  30. package/lib/e2e/families/cosmos.d.ts.map +1 -1
  31. package/lib/e2e/families/cosmos.js +3 -0
  32. package/lib/e2e/families/cosmos.js.map +1 -1
  33. package/lib/e2e/families/evm.d.ts.map +1 -1
  34. package/lib/e2e/families/evm.js +3 -0
  35. package/lib/e2e/families/evm.js.map +1 -1
  36. package/lib/e2e/families/polkadot.d.ts.map +1 -1
  37. package/lib/e2e/families/polkadot.js +3 -0
  38. package/lib/e2e/families/polkadot.js.map +1 -1
  39. package/lib/e2e/families/solana.d.ts.map +1 -1
  40. package/lib/e2e/families/solana.js +3 -0
  41. package/lib/e2e/families/solana.js.map +1 -1
  42. package/lib/e2e/families/stellar.d.ts.map +1 -1
  43. package/lib/e2e/families/stellar.js +3 -0
  44. package/lib/e2e/families/stellar.js.map +1 -1
  45. package/lib/e2e/families/tron.d.ts.map +1 -1
  46. package/lib/e2e/families/tron.js +3 -0
  47. package/lib/e2e/families/tron.js.map +1 -1
  48. package/lib/e2e/families/xrp.d.ts.map +1 -1
  49. package/lib/e2e/families/xrp.js +3 -0
  50. package/lib/e2e/families/xrp.js.map +1 -1
  51. package/lib/e2e/index.d.ts +9 -0
  52. package/lib/e2e/index.d.ts.map +1 -1
  53. package/lib/e2e/models/Transaction.d.ts +1 -0
  54. package/lib/e2e/models/Transaction.d.ts.map +1 -1
  55. package/lib/e2e/models/Transaction.js +1 -0
  56. package/lib/e2e/models/Transaction.js.map +1 -1
  57. package/lib/e2e/speculos.d.ts.map +1 -1
  58. package/lib/e2e/speculos.js +10 -3
  59. package/lib/e2e/speculos.js.map +1 -1
  60. package/lib/e2e/swap.d.ts.map +1 -1
  61. package/lib/e2e/swap.js +5 -1
  62. package/lib/e2e/swap.js.map +1 -1
  63. package/lib/exchange/providers/swap.d.ts.map +1 -1
  64. package/lib/exchange/providers/swap.js +2 -0
  65. package/lib/exchange/providers/swap.js.map +1 -1
  66. package/lib/families/cosmos/datasets/cosmos.d.ts.map +1 -1
  67. package/lib/families/cosmos/datasets/cosmos.js +66 -18
  68. package/lib/families/cosmos/datasets/cosmos.js.map +1 -1
  69. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  70. package/lib/featureFlags/defaultFeatures.js +10 -0
  71. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  72. package/lib/featureFlags/useFeature.d.ts +1 -1
  73. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  74. package/lib-es/account/recentAddresses.d.ts +2 -1
  75. package/lib-es/account/recentAddresses.d.ts.map +1 -1
  76. package/lib-es/account/recentAddresses.js +27 -9
  77. package/lib-es/account/recentAddresses.js.map +1 -1
  78. package/lib-es/e2e/enum/Account.d.ts +15 -16
  79. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  80. package/lib-es/e2e/enum/Account.js +92 -98
  81. package/lib-es/e2e/enum/Account.js.map +1 -1
  82. package/lib-es/e2e/enum/Addresses.d.ts +12 -0
  83. package/lib-es/e2e/enum/Addresses.d.ts.map +1 -0
  84. package/lib-es/e2e/enum/Addresses.js +13 -0
  85. package/lib-es/e2e/enum/Addresses.js.map +1 -0
  86. package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
  87. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  88. package/lib-es/e2e/enum/AppInfos.js +1 -0
  89. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  90. package/lib-es/e2e/enum/Currency.d.ts +1 -0
  91. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  92. package/lib-es/e2e/enum/Currency.js +1 -0
  93. package/lib-es/e2e/enum/Currency.js.map +1 -1
  94. package/lib-es/e2e/families/algorand.d.ts.map +1 -1
  95. package/lib-es/e2e/families/algorand.js +3 -0
  96. package/lib-es/e2e/families/algorand.js.map +1 -1
  97. package/lib-es/e2e/families/bitcoin.d.ts.map +1 -1
  98. package/lib-es/e2e/families/bitcoin.js +6 -0
  99. package/lib-es/e2e/families/bitcoin.js.map +1 -1
  100. package/lib-es/e2e/families/cardano.d.ts.map +1 -1
  101. package/lib-es/e2e/families/cardano.js +3 -0
  102. package/lib-es/e2e/families/cardano.js.map +1 -1
  103. package/lib-es/e2e/families/cosmos.d.ts.map +1 -1
  104. package/lib-es/e2e/families/cosmos.js +3 -0
  105. package/lib-es/e2e/families/cosmos.js.map +1 -1
  106. package/lib-es/e2e/families/evm.d.ts.map +1 -1
  107. package/lib-es/e2e/families/evm.js +3 -0
  108. package/lib-es/e2e/families/evm.js.map +1 -1
  109. package/lib-es/e2e/families/polkadot.d.ts.map +1 -1
  110. package/lib-es/e2e/families/polkadot.js +3 -0
  111. package/lib-es/e2e/families/polkadot.js.map +1 -1
  112. package/lib-es/e2e/families/solana.d.ts.map +1 -1
  113. package/lib-es/e2e/families/solana.js +3 -0
  114. package/lib-es/e2e/families/solana.js.map +1 -1
  115. package/lib-es/e2e/families/stellar.d.ts.map +1 -1
  116. package/lib-es/e2e/families/stellar.js +3 -0
  117. package/lib-es/e2e/families/stellar.js.map +1 -1
  118. package/lib-es/e2e/families/tron.d.ts.map +1 -1
  119. package/lib-es/e2e/families/tron.js +3 -0
  120. package/lib-es/e2e/families/tron.js.map +1 -1
  121. package/lib-es/e2e/families/xrp.d.ts.map +1 -1
  122. package/lib-es/e2e/families/xrp.js +3 -0
  123. package/lib-es/e2e/families/xrp.js.map +1 -1
  124. package/lib-es/e2e/index.d.ts +9 -0
  125. package/lib-es/e2e/index.d.ts.map +1 -1
  126. package/lib-es/e2e/models/Transaction.d.ts +1 -0
  127. package/lib-es/e2e/models/Transaction.d.ts.map +1 -1
  128. package/lib-es/e2e/models/Transaction.js +1 -0
  129. package/lib-es/e2e/models/Transaction.js.map +1 -1
  130. package/lib-es/e2e/speculos.d.ts.map +1 -1
  131. package/lib-es/e2e/speculos.js +10 -3
  132. package/lib-es/e2e/speculos.js.map +1 -1
  133. package/lib-es/e2e/swap.d.ts.map +1 -1
  134. package/lib-es/e2e/swap.js +5 -1
  135. package/lib-es/e2e/swap.js.map +1 -1
  136. package/lib-es/exchange/providers/swap.d.ts.map +1 -1
  137. package/lib-es/exchange/providers/swap.js +2 -0
  138. package/lib-es/exchange/providers/swap.js.map +1 -1
  139. package/lib-es/families/cosmos/datasets/cosmos.d.ts.map +1 -1
  140. package/lib-es/families/cosmos/datasets/cosmos.js +67 -19
  141. package/lib-es/families/cosmos/datasets/cosmos.js.map +1 -1
  142. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  143. package/lib-es/featureFlags/defaultFeatures.js +10 -0
  144. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  145. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  146. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  147. package/package.json +74 -74
  148. package/src/account/recentAddresses.test.ts +115 -15
  149. package/src/account/recentAddresses.ts +37 -13
  150. package/src/e2e/enum/Account.ts +152 -396
  151. package/src/e2e/enum/Addresses.ts +11 -0
  152. package/src/e2e/enum/AppInfos.ts +2 -0
  153. package/src/e2e/enum/Currency.ts +2 -0
  154. package/src/e2e/families/algorand.ts +3 -0
  155. package/src/e2e/families/bitcoin.ts +6 -0
  156. package/src/e2e/families/cardano.ts +3 -0
  157. package/src/e2e/families/cosmos.ts +3 -0
  158. package/src/e2e/families/evm.ts +3 -0
  159. package/src/e2e/families/polkadot.ts +3 -0
  160. package/src/e2e/families/solana.ts +3 -0
  161. package/src/e2e/families/stellar.ts +3 -0
  162. package/src/e2e/families/tron.ts +3 -0
  163. package/src/e2e/families/xrp.ts +3 -1
  164. package/src/e2e/models/Transaction.ts +2 -0
  165. package/src/e2e/speculos.ts +10 -3
  166. package/src/e2e/swap.ts +7 -1
  167. package/src/exchange/providers/swap.ts +2 -0
  168. package/src/families/cosmos/datasets/cosmos.ts +71 -18
  169. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +7 -7
  170. package/src/featureFlags/defaultFeatures.ts +10 -1
@@ -0,0 +1,11 @@
1
+ export enum Addresses {
2
+ BTC_NATIVE_SEGWIT_1 = "bc1q550hm43wj0jq949xwsw67kwzz0t3wy60y3gfax",
3
+ SANCTIONED_ETHEREUM = "0x04DBA1194ee10112fE6C3207C0687DEf0e78baCf",
4
+ ETH_2 = "0xa1baa625c5E6A9304cB7AcD86d2fee6B710eC3eB",
5
+ ETH_OTHER_SEED = "0xce12D0A5cFf4A88ECab96ff8923215Dff366127b",
6
+ SOL_OTHER_SEED = "DLVArScX1BQEr7gZSSpHMGMq7HKKFKdFF82Cs6PvEKVC",
7
+ SOL_GIGA_2_ATA_ADDRESS = "8nnwXo313DXWcE3kBR54gDKDmcySeGVjYRztbCAPzxev",
8
+ SOL_WIF_2_ATA_ADDRESS = "PXFuX7GdgVpPnuXwQSkjt3jihZZCjcxy8G5fsQa1NBn",
9
+ SWAP_HISTORY_SOL_FROM = "9MQyG8qo6i616yApRoRVMXYerGV4swwtd2bDETC3RCWB",
10
+ SWAP_HISTORY_ETH_TO = "0x4BE2E2B8872AA298D6d123b9211B53E41f611566",
11
+ }
@@ -66,4 +66,6 @@ export class AppInfos {
66
66
  static readonly HEDERA = new AppInfos("Hedera");
67
67
 
68
68
  static readonly SUI = new AppInfos("Sui");
69
+
70
+ static readonly BASE = new AppInfos("Base");
69
71
  }
@@ -199,6 +199,8 @@ export class Currency {
199
199
 
200
200
  static readonly SUI = new Currency("Sui", "SUI", "sui", AppInfos.SUI, [Network.SUI]);
201
201
 
202
+ static readonly BASE = new Currency("Base", "ETH", "base", AppInfos.BASE, [Network.BASE]);
203
+
202
204
  static readonly SUI_USDC = new Currency(
203
205
  "USD Coin",
204
206
  "USDC",
@@ -15,6 +15,9 @@ export const sendAlgorand = withDeviceController(
15
15
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
16
16
  expect(isAmountCorrect).toBeTruthy();
17
17
 
18
+ if (!tx.accountToCredit.address) {
19
+ throw new Error("Recipient address is not set");
20
+ }
18
21
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
19
22
  expect(isAddressCorrect).toBeTruthy();
20
23
 
@@ -17,6 +17,9 @@ export const sendBTCBasedCoin = withDeviceController(
17
17
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
18
18
  expect(isAmountCorrect).toBeTruthy();
19
19
 
20
+ if (!tx.accountToCredit.address) {
21
+ throw new Error("Recipient address is not set");
22
+ }
20
23
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
21
24
  expect(isAddressCorrect).toBeTruthy();
22
25
 
@@ -42,6 +45,9 @@ export const sendBTC = withDeviceController(
42
45
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
43
46
  expect(isAmountCorrect).toBeTruthy();
44
47
 
48
+ if (!tx.accountToCredit.address) {
49
+ throw new Error("Recipient address is not set");
50
+ }
45
51
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
46
52
  expect(isAddressCorrect).toBeTruthy();
47
53
 
@@ -14,6 +14,9 @@ import { withDeviceController } from "../deviceInteraction/DeviceController";
14
14
  type ActionType = "both" | "right" | "tap" | "swipe" | "confirm" | "hold";
15
15
 
16
16
  function validateTransactionData(tx: Transaction, events: string[]) {
17
+ if (!tx.accountToCredit.address) {
18
+ throw new Error("Recipient address is not set");
19
+ }
17
20
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
18
21
  expect(isAddressCorrect).toBeTruthy();
19
22
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
@@ -33,6 +33,9 @@ export const sendCosmos = withDeviceController(
33
33
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
34
34
  expect(isAmountCorrect).toBeTruthy();
35
35
 
36
+ if (!tx.accountToCredit.address) {
37
+ throw new Error("Recipient address is not set");
38
+ }
36
39
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
37
40
  expect(isAddressCorrect).toBeTruthy();
38
41
 
@@ -16,6 +16,9 @@ function validateTransactionData(tx: Transaction, events: string[]) {
16
16
  const isENSNameCorrect = containsSubstringInEvent(tx.accountToCredit.ensName, events);
17
17
  expect(isENSNameCorrect).toBeTruthy();
18
18
  } else {
19
+ if (!tx.accountToCredit.address) {
20
+ throw new Error("Recipient address is not set");
21
+ }
19
22
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
20
23
  expect(isAddressCorrect).toBeTruthy();
21
24
  }
@@ -15,6 +15,9 @@ export const sendPolkadot = withDeviceController(
15
15
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
16
16
  expect(isAmountCorrect).toBeTruthy();
17
17
 
18
+ if (!tx.accountToCredit.address) {
19
+ throw new Error("Recipient address is not set");
20
+ }
18
21
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
19
22
  expect(isAddressCorrect).toBeTruthy();
20
23
 
@@ -33,6 +33,9 @@ export const sendSolana = withDeviceController(
33
33
  expect(isAmountCorrect).toBeTruthy();
34
34
 
35
35
  if (process.env.SPECULOS_DEVICE !== Device.LNS.name) {
36
+ if (!tx.accountToCredit.address) {
37
+ throw new Error("Recipient address is not set");
38
+ }
36
39
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
37
40
  expect(isAddressCorrect).toBeTruthy();
38
41
  }
@@ -15,6 +15,9 @@ export const sendStellar = withDeviceController(
15
15
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
16
16
  expect(isAmountCorrect).toBeTruthy();
17
17
 
18
+ if (!tx.accountToCredit.address) {
19
+ throw new Error("Recipient address is not set");
20
+ }
18
21
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
19
22
  expect(isAddressCorrect).toBeTruthy();
20
23
 
@@ -15,6 +15,9 @@ export const sendTron = withDeviceController(
15
15
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
16
16
  expect(isAmountCorrect).toBeTruthy();
17
17
 
18
+ if (!tx.accountToCredit.address) {
19
+ throw new Error("Recipient address is not set");
20
+ }
18
21
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
19
22
  expect(isAddressCorrect).toBeTruthy();
20
23
 
@@ -14,7 +14,9 @@ export const sendXRP = withDeviceController(
14
14
  const events = await getSendEvents(tx);
15
15
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
16
16
  expect(isAmountCorrect).toBeTruthy();
17
-
17
+ if (!tx.accountToCredit.address) {
18
+ throw new Error("Recipient address is not set");
19
+ }
18
20
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
19
21
  expect(isAddressCorrect).toBeTruthy();
20
22
 
@@ -4,6 +4,8 @@ import { AccountType } from "../enum/Account";
4
4
  export type TransactionType = Transaction;
5
5
 
6
6
  export class Transaction {
7
+ public recipientAddress?: string;
8
+
7
9
  constructor(
8
10
  public accountToDebit: AccountType,
9
11
  public accountToCredit: AccountType,
@@ -349,6 +349,14 @@ export const specs: Specs = {
349
349
  },
350
350
  dependency: "",
351
351
  },
352
+ Base: {
353
+ currency: getCryptoCurrencyById("base"),
354
+ appQuery: {
355
+ model: getSpeculosModel(),
356
+ appName: "Ethereum",
357
+ },
358
+ dependency: "",
359
+ },
352
360
  };
353
361
 
354
362
  export async function startSpeculos(
@@ -814,16 +822,15 @@ export async function signSendTransaction(tx: Transaction) {
814
822
  const currencyName = tx.accountToDebit.currency;
815
823
  switch (currencyName) {
816
824
  case Currency.sepETH:
825
+ case Currency.BASE:
817
826
  case Currency.POL:
818
827
  case Currency.ETH:
828
+ case Currency.ETH_USDT:
819
829
  await sendEVM(tx);
820
830
  break;
821
831
  case Currency.BTC:
822
832
  await sendBTC(tx);
823
833
  break;
824
- case Currency.ETH_USDT:
825
- await sendEVM(tx);
826
- break;
827
834
  case Currency.DOGE:
828
835
  case Currency.BCH:
829
836
  await sendBTCBasedCoin(tx);
package/src/e2e/swap.ts CHANGED
@@ -4,6 +4,12 @@ import axios from "axios";
4
4
 
5
5
  export async function getMinimumSwapAmount(AccountFrom: Account, AccountTo: Account) {
6
6
  try {
7
+ const addressFrom = AccountFrom.address || AccountFrom.parentAccount?.address;
8
+
9
+ if (!addressFrom) {
10
+ throw new Error("No address available from accounts when requesting minimum swap amount.");
11
+ }
12
+
7
13
  const requestConfig = {
8
14
  method: "GET",
9
15
  url: "https://swap-stg.ledger-test.com/v5/quote",
@@ -11,7 +17,7 @@ export async function getMinimumSwapAmount(AccountFrom: Account, AccountTo: Acco
11
17
  from: AccountFrom.currency.id,
12
18
  to: AccountTo.currency.id,
13
19
  amountFrom: 0.0001,
14
- addressFrom: AccountFrom.address,
20
+ addressFrom,
15
21
  fiatForCounterValue: "USD",
16
22
  slippage: 1,
17
23
  networkFees: 0.001,
@@ -248,12 +248,14 @@ const DEFAULT_SWAP_PROVIDERS: Record<string, ProviderConfig & Partial<Additional
248
248
  export const dexProvidersContractAddress: { [key: string]: string } = {
249
249
  "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad": "Uniswap",
250
250
  "0x111111125421ca6dc452d289314280a0f8842a65": "1inch",
251
+ "0x6a000f20005980200259b80c5102003040001068": "velora",
251
252
  };
252
253
 
253
254
  export const termsOfUse: { [key: string]: string } = {
254
255
  paraswap: "https://paraswap.io/tos",
255
256
  "1inch": "https://1inch.com/assets/Widget_1inch.com_Terms_of_Use.pdf",
256
257
  Uniswap: "https://uniswap.org/terms-of-service",
258
+ velora: "https://www.velora.xyz/terms/terms-of-use",
257
259
  };
258
260
 
259
261
  export const privacyPolicy: { [key: string]: string } = {
@@ -4,11 +4,14 @@ import {
4
4
  InvalidAddressBecauseDestinationIsAlsoSource,
5
5
  NotEnoughBalance,
6
6
  AmountRequired,
7
+ RecommendUndelegation,
7
8
  } from "@ledgerhq/errors";
8
9
  import invariant from "invariant";
9
10
  import type { CosmosAccount, Transaction } from "@ledgerhq/coin-cosmos/types/index";
10
11
  import { AccountRaw, CurrenciesData } from "@ledgerhq/types-live";
11
12
  import { fromTransactionRaw } from "@ledgerhq/coin-cosmos/transaction";
13
+ import { CosmosTooManyRedelegations } from "@ledgerhq/coin-cosmos/errors";
14
+ import { COSMOS_MAX_REDELEGATIONS } from "@ledgerhq/coin-cosmos/logic";
12
15
 
13
16
  const dataset: CurrenciesData<Transaction> = {
14
17
  FIXME_ignoreAccountFields: ["cosmosResources", "operationsCount", "operations"],
@@ -99,15 +102,26 @@ const dataset: CurrenciesData<Transaction> = {
99
102
  memo: null,
100
103
  mode: "send",
101
104
  }),
102
- expectedStatus: account => {
105
+ expectedStatus: (account, t) => {
103
106
  const { cosmosResources } = account as CosmosAccount;
104
107
  if (!cosmosResources) throw new Error("Should exist because it's cosmos");
105
- const totalSpent = account.balance.minus(
108
+ const estimatedFees = t.fees || new BigNumber(0);
109
+ const spendableBalance = account.balance.minus(
106
110
  cosmosResources.unbondingBalance.plus(cosmosResources.delegatedBalance),
107
111
  );
112
+ const amount = BigNumber.max(0, spendableBalance.minus(estimatedFees));
113
+ const totalSpent = amount.plus(estimatedFees);
114
+ const errors: Record<string, Error> = {};
115
+ const warnings: Record<string, Error> = {};
116
+ if (amount.lte(0)) {
117
+ errors.amount = new NotEnoughBalance();
118
+ }
119
+ if (cosmosResources.delegations.length > 0) {
120
+ warnings.amount = new RecommendUndelegation();
121
+ }
108
122
  return {
109
- errors: {},
110
- warnings: {},
123
+ errors,
124
+ warnings,
111
125
  totalSpent,
112
126
  };
113
127
  },
@@ -131,12 +145,23 @@ const dataset: CurrenciesData<Transaction> = {
131
145
  const { cosmosResources } = account as CosmosAccount;
132
146
  if (!cosmosResources) throw new Error("Should exist because it's cosmos");
133
147
  invariant(t.memo === "test", "Should have a memo");
134
- const totalSpent = account.balance.minus(
148
+ const estimatedFees = t.fees || new BigNumber(0);
149
+ const spendableBalance = account.balance.minus(
135
150
  cosmosResources.unbondingBalance.plus(cosmosResources.delegatedBalance),
136
151
  );
152
+ const amount = BigNumber.max(0, spendableBalance.minus(estimatedFees));
153
+ const totalSpent = amount.plus(estimatedFees);
154
+ const errors: Record<string, Error> = {};
155
+ const warnings: Record<string, Error> = {};
156
+ if (amount.lte(0)) {
157
+ errors.amount = new NotEnoughBalance();
158
+ }
159
+ if (cosmosResources.delegations.length > 0) {
160
+ warnings.amount = new RecommendUndelegation();
161
+ }
137
162
  return {
138
- errors: {},
139
- warnings: {},
163
+ errors,
164
+ warnings,
140
165
  totalSpent,
141
166
  };
142
167
  },
@@ -171,8 +196,16 @@ const dataset: CurrenciesData<Transaction> = {
171
196
  }),
172
197
  expectedStatus: (a, t) => {
173
198
  invariant(t.memo === "Ledger Live", "Should have a memo");
199
+ const { cosmosResources } = a as CosmosAccount;
200
+ const errors: Record<string, Error> = {};
201
+ if (
202
+ cosmosResources &&
203
+ cosmosResources.redelegations.length >= COSMOS_MAX_REDELEGATIONS
204
+ ) {
205
+ errors.redelegation = new CosmosTooManyRedelegations();
206
+ }
174
207
  return {
175
- errors: {},
208
+ errors,
176
209
  warnings: {},
177
210
  };
178
211
  },
@@ -190,11 +223,21 @@ const dataset: CurrenciesData<Transaction> = {
190
223
  ],
191
224
  sourceValidator: "cosmosvaloper1sd4tl9aljmmezzudugs7zlaya7pg2895ws8tfs",
192
225
  }),
193
- expectedStatus: {
194
- errors: {
195
- amount: new AmountRequired(),
196
- },
197
- warnings: {},
226
+ expectedStatus: a => {
227
+ const { cosmosResources } = a as CosmosAccount;
228
+ const errors: Record<string, Error> = {};
229
+ if (
230
+ cosmosResources &&
231
+ cosmosResources.redelegations.length >= COSMOS_MAX_REDELEGATIONS
232
+ ) {
233
+ errors.redelegation = new CosmosTooManyRedelegations();
234
+ } else {
235
+ errors.amount = new AmountRequired();
236
+ }
237
+ return {
238
+ errors,
239
+ warnings: {},
240
+ };
198
241
  },
199
242
  },
200
243
  {
@@ -210,11 +253,21 @@ const dataset: CurrenciesData<Transaction> = {
210
253
  ],
211
254
  sourceValidator: "cosmosvaloper1sd4tl9aljmmezzudugs7zlaya7pg2895ws8tfs",
212
255
  }),
213
- expectedStatus: {
214
- errors: {
215
- redelegation: new InvalidAddressBecauseDestinationIsAlsoSource(),
216
- },
217
- warnings: {},
256
+ expectedStatus: a => {
257
+ const { cosmosResources } = a as CosmosAccount;
258
+ const errors: Record<string, Error> = {};
259
+ if (
260
+ cosmosResources &&
261
+ cosmosResources.redelegations.length >= COSMOS_MAX_REDELEGATIONS
262
+ ) {
263
+ errors.redelegation = new CosmosTooManyRedelegations();
264
+ } else {
265
+ errors.redelegation = new InvalidAddressBecauseDestinationIsAlsoSource();
266
+ }
267
+ return {
268
+ errors,
269
+ warnings: {},
270
+ };
218
271
  },
219
272
  },
220
273
  {
@@ -25,7 +25,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
25
25
  "spendableBalance": "3437436",
26
26
  "subAccounts": [],
27
27
  "swapHistory": [],
28
- "syncHash": "0xbeb9a2a8",
28
+ "syncHash": "0x1ceb1f53",
29
29
  "used": true,
30
30
  },
31
31
  {
@@ -84,7 +84,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
84
84
  "spendableBalance": "80396525",
85
85
  "subAccounts": [],
86
86
  "swapHistory": [],
87
- "syncHash": "0xbeb9a2a8",
87
+ "syncHash": "0x1ceb1f53",
88
88
  "used": true,
89
89
  },
90
90
  {
@@ -121,7 +121,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
121
121
  "spendableBalance": "80189",
122
122
  "subAccounts": [],
123
123
  "swapHistory": [],
124
- "syncHash": "0xbeb9a2a8",
124
+ "syncHash": "0x1ceb1f53",
125
125
  "used": true,
126
126
  },
127
127
  {
@@ -147,7 +147,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
147
147
  "spendableBalance": "99442073",
148
148
  "subAccounts": [],
149
149
  "swapHistory": [],
150
- "syncHash": "0xbeb9a2a8",
150
+ "syncHash": "0x1ceb1f53",
151
151
  "used": true,
152
152
  },
153
153
  {
@@ -173,7 +173,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
173
173
  "spendableBalance": "334045080",
174
174
  "subAccounts": [],
175
175
  "swapHistory": [],
176
- "syncHash": "0xbeb9a2a8",
176
+ "syncHash": "0x1ceb1f53",
177
177
  "used": true,
178
178
  },
179
179
  {
@@ -221,7 +221,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
221
221
  "spendableBalance": "36243023",
222
222
  "subAccounts": [],
223
223
  "swapHistory": [],
224
- "syncHash": "0xbeb9a2a8",
224
+ "syncHash": "0x1ceb1f53",
225
225
  "used": true,
226
226
  },
227
227
  {
@@ -269,7 +269,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
269
269
  "spendableBalance": "0",
270
270
  "subAccounts": [],
271
271
  "swapHistory": [],
272
- "syncHash": "0xbeb9a2a8",
272
+ "syncHash": "0x1ceb1f53",
273
273
  "used": false,
274
274
  },
275
275
  ]
@@ -585,6 +585,7 @@ export const DEFAULT_FEATURES: Features = {
585
585
  manager: true,
586
586
  accounts: true,
587
587
  settings: true,
588
+ onboarding: true,
588
589
  postOnboarding: true,
589
590
  },
590
591
  },
@@ -600,6 +601,8 @@ export const DEFAULT_FEATURES: Features = {
600
601
  },
601
602
  lwmLedgerSyncOptimisation: DEFAULT_FEATURE,
602
603
  lwdLedgerSyncOptimisation: DEFAULT_FEATURE,
604
+ lwmNewWordingOptInNotificationsDrawer: DEFAULT_FEATURE,
605
+ lwmOptimizeOptInNotificationsToOptOutUsers: DEFAULT_FEATURE,
603
606
  lldNanoSUpsellBanners: {
604
607
  ...DEFAULT_FEATURE,
605
608
  params: {
@@ -740,7 +743,6 @@ export const DEFAULT_FEATURES: Features = {
740
743
  lldRebornABtest: DEFAULT_FEATURE,
741
744
  llmRebornABtest: DEFAULT_FEATURE,
742
745
  lifiSolana: DEFAULT_FEATURE,
743
-
744
746
  llmAnimatedSplashScreen: {
745
747
  enabled: true,
746
748
  params: {
@@ -748,6 +750,13 @@ export const DEFAULT_FEATURES: Features = {
748
750
  android: true,
749
751
  },
750
752
  },
753
+ llmOnboardingEnableSync: initFeature({
754
+ enabled: false,
755
+ params: {
756
+ nanos: false,
757
+ touchscreens: false,
758
+ },
759
+ }),
751
760
  };
752
761
 
753
762
  // Firebase SDK treat JSON values as strings