@ledgerhq/live-common 21.17.1 → 21.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/lib/account/addAccounts.d.ts.map +1 -1
  2. package/lib/account/addAccounts.js +3 -2
  3. package/lib/account/addAccounts.js.map +1 -1
  4. package/lib/bridge/jsHelpers.js +2 -2
  5. package/lib/bridge/jsHelpers.js.map +1 -1
  6. package/lib/families/bitcoin/getAccountNetworkInfo.d.ts.map +1 -1
  7. package/lib/families/bitcoin/getAccountNetworkInfo.js +12 -2
  8. package/lib/families/bitcoin/getAccountNetworkInfo.js.map +1 -1
  9. package/lib/families/bitcoin/types.d.ts +1 -0
  10. package/lib/families/bitcoin/types.d.ts.map +1 -1
  11. package/lib/families/bitcoin/types.js.map +1 -1
  12. package/lib/families/bitcoin/wallet-btc/explorer/index.d.ts +1 -0
  13. package/lib/families/bitcoin/wallet-btc/explorer/index.d.ts.map +1 -1
  14. package/lib/families/bitcoin/wallet-btc/explorer/index.js +19 -0
  15. package/lib/families/bitcoin/wallet-btc/explorer/index.js.map +1 -1
  16. package/lib/families/bitcoin/wallet-btc/explorer/types.d.ts +1 -0
  17. package/lib/families/bitcoin/wallet-btc/explorer/types.d.ts.map +1 -1
  18. package/lib/families/ethereum/cli-transaction.d.ts.map +1 -1
  19. package/lib/families/ethereum/cli-transaction.js +10 -0
  20. package/lib/families/ethereum/cli-transaction.js.map +1 -1
  21. package/lib/families/ethereum/modules/erc1155.d.ts +4 -0
  22. package/lib/families/ethereum/modules/erc1155.d.ts.map +1 -0
  23. package/lib/families/ethereum/modules/erc1155.js +117 -0
  24. package/lib/families/ethereum/modules/erc1155.js.map +1 -0
  25. package/lib/families/ethereum/modules/erc721.d.ts +4 -0
  26. package/lib/families/ethereum/modules/erc721.d.ts.map +1 -0
  27. package/lib/families/ethereum/modules/erc721.js +95 -0
  28. package/lib/families/ethereum/modules/erc721.js.map +1 -0
  29. package/lib/families/ethereum/modules/index.d.ts +3 -1
  30. package/lib/families/ethereum/modules/index.d.ts.map +1 -1
  31. package/lib/families/ethereum/modules/index.js +5 -1
  32. package/lib/families/ethereum/modules/index.js.map +1 -1
  33. package/lib/families/ethereum/nft.test.d.ts +2 -0
  34. package/lib/families/ethereum/nft.test.d.ts.map +1 -0
  35. package/lib/families/ethereum/nft.test.js +167 -0
  36. package/lib/families/ethereum/nft.test.js.map +1 -0
  37. package/lib/families/ethereum/signOperation.d.ts.map +1 -1
  38. package/lib/families/ethereum/signOperation.js +1 -9
  39. package/lib/families/ethereum/signOperation.js.map +1 -1
  40. package/lib/families/ethereum/synchronisation.test.js.map +1 -1
  41. package/lib/families/ethereum/transaction.d.ts.map +1 -1
  42. package/lib/families/ethereum/transaction.js +25 -8
  43. package/lib/families/ethereum/transaction.js.map +1 -1
  44. package/lib/families/ethereum/types.d.ts +6 -0
  45. package/lib/families/ethereum/types.d.ts.map +1 -1
  46. package/lib/families/ethereum/types.js.map +1 -1
  47. package/lib/hw/uninstallApp.d.ts.map +1 -1
  48. package/lib/hw/uninstallApp.js +1 -1
  49. package/lib/hw/uninstallApp.js.map +1 -1
  50. package/lib/nft/helpers.d.ts +2 -1
  51. package/lib/nft/helpers.d.ts.map +1 -1
  52. package/lib/nft/helpers.js +8 -1
  53. package/lib/nft/helpers.js.map +1 -1
  54. package/package.json +6 -6
  55. package/src/account/addAccounts.ts +3 -2
  56. package/src/bridge/jsHelpers.ts +2 -2
  57. package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +2 -0
  58. package/src/families/bitcoin/getAccountNetworkInfo.ts +8 -1
  59. package/src/families/bitcoin/types.ts +1 -0
  60. package/src/families/bitcoin/wallet-btc/explorer/index.ts +7 -0
  61. package/src/families/bitcoin/wallet-btc/explorer/types.ts +1 -0
  62. package/src/families/ethereum/cli-transaction.ts +10 -0
  63. package/src/families/ethereum/modules/erc1155.ts +142 -0
  64. package/src/families/ethereum/modules/erc721.ts +108 -0
  65. package/src/families/ethereum/modules/index.ts +12 -1
  66. package/src/families/ethereum/nft.test.ts +90 -0
  67. package/src/families/ethereum/signOperation.ts +1 -13
  68. package/src/families/ethereum/synchronisation.test.ts +1 -0
  69. package/src/families/ethereum/transaction.ts +38 -8
  70. package/src/families/ethereum/types.ts +6 -0
  71. package/src/hw/uninstallApp.ts +13 -8
  72. package/src/nft/helpers.ts +9 -1
  73. package/src/types/account.ts +1 -1
  74. package/src/.DS_Store +0 -0
  75. package/src/__tests__/.DS_Store +0 -0
  76. package/src/currencies/.DS_Store +0 -0
@@ -37,6 +37,9 @@ export type Transaction = TransactionCommon & {
37
37
  feeCustomUnit: Unit | null | undefined;
38
38
  networkInfo: NetworkInfo | null | undefined;
39
39
  allowZeroAmount?: boolean;
40
+ collection?: string;
41
+ tokenIds?: string[];
42
+ quantities?: BigNumber[];
40
43
  };
41
44
  export type TransactionRaw = TransactionCommonRaw & {
42
45
  family: "ethereum";
@@ -49,6 +52,9 @@ export type TransactionRaw = TransactionCommonRaw & {
49
52
  feeCustomUnit: Unit | null | undefined;
50
53
  networkInfo: NetworkInfoRaw | null | undefined;
51
54
  allowZeroAmount?: boolean;
55
+ tokenIds?: string[];
56
+ collection?: string;
57
+ quantities?: string[];
52
58
  };
53
59
  export type TypedMessage = {
54
60
  types: {
@@ -9,14 +9,19 @@ export default function uninstallApp(
9
9
  targetId: string | number,
10
10
  app: ApplicationVersion | App
11
11
  ): Observable<any> {
12
- return ManagerAPI.install(transport, "uninstall-app", {
13
- targetId,
14
- perso: app.perso,
15
- deleteKey: app.delete_key,
16
- firmware: app.delete,
17
- firmwareKey: app.delete_key,
18
- hash: app.hash,
19
- }).pipe(
12
+ return ManagerAPI.install(
13
+ transport,
14
+ "uninstall-app",
15
+ {
16
+ targetId,
17
+ perso: app.perso,
18
+ deleteKey: app.delete_key,
19
+ firmware: app.delete,
20
+ firmwareKey: app.delete_key,
21
+ hash: app.hash,
22
+ },
23
+ true
24
+ ).pipe(
20
25
  ignoreElements(),
21
26
  catchError((e: Error) => {
22
27
  if (!e || !e.message) return throwError(e);
@@ -1,6 +1,6 @@
1
1
  import eip55 from "eip55";
2
2
  import BigNumber from "bignumber.js";
3
- import { NFT, Operation } from "../types";
3
+ import { NFT, Operation, Transaction } from "../types";
4
4
 
5
5
  type Collection = NFT["collection"];
6
6
 
@@ -76,3 +76,11 @@ export const nftsByCollections = (
76
76
  export const getNftKey = (contract: string, tokenId: string): string => {
77
77
  return `${contract}-${tokenId}`;
78
78
  };
79
+
80
+ export const isNftTransaction = (transaction: Transaction): boolean => {
81
+ if (transaction.family === "ethereum") {
82
+ return ["erc721.transfer", "erc1155.transfer"].includes(transaction.mode);
83
+ }
84
+
85
+ return false;
86
+ };
@@ -215,7 +215,7 @@ export type Account = {
215
215
  swapHistory: SwapOperation[];
216
216
  // Hash used to discard tx history on sync
217
217
  syncHash?: string;
218
- // Array of NFTs computed by diffing NFTOperations
218
+ // Array of NFTs computed by diffing NFTOperations ordered from newest to oldest
219
219
  nfts?: NFT[];
220
220
  };
221
221
  export type SubAccount = TokenAccount | ChildAccount;
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file