@ledgerhq/live-common 34.49.0-nightly.1 → 34.49.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/account/formatters.d.ts.map +1 -1
- package/lib/account/formatters.js +1 -27
- package/lib/account/formatters.js.map +1 -1
- package/lib/customImage/errors.d.ts +0 -6
- package/lib/customImage/errors.d.ts.map +1 -1
- package/lib/customImage/errors.js +1 -3
- package/lib/customImage/errors.js.map +1 -1
- package/lib/deposit/type.d.ts +1 -0
- package/lib/deposit/type.d.ts.map +1 -1
- package/lib/deposit/type.js.map +1 -1
- package/lib/e2e/index.d.ts +2 -9
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.js +2 -1
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -4
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/dada.mock.d.ts +10 -0
- package/lib/modularDrawer/__mocks__/dada.mock.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/dada.mock.js +10 -0
- package/lib/modularDrawer/__mocks__/dada.mock.js.map +1 -1
- package/lib-es/account/formatters.d.ts.map +1 -1
- package/lib-es/account/formatters.js +1 -27
- package/lib-es/account/formatters.js.map +1 -1
- package/lib-es/customImage/errors.d.ts +0 -6
- package/lib-es/customImage/errors.d.ts.map +1 -1
- package/lib-es/customImage/errors.js +0 -2
- package/lib-es/customImage/errors.js.map +1 -1
- package/lib-es/deposit/type.d.ts +1 -0
- package/lib-es/deposit/type.d.ts.map +1 -1
- package/lib-es/deposit/type.js.map +1 -1
- package/lib-es/e2e/index.d.ts +2 -9
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.js +2 -1
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -4
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts +10 -0
- package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/dada.mock.js +10 -0
- package/lib-es/modularDrawer/__mocks__/dada.mock.js.map +1 -1
- package/package.json +47 -48
- package/src/account/formatters.ts +2 -40
- package/src/customImage/errors.ts +0 -4
- package/src/deposit/type.ts +1 -0
- package/src/exchange/providers/swap.ts +2 -1
- package/src/featureFlags/defaultFeatures.ts +1 -4
- package/src/modularDrawer/__mocks__/dada.mock.ts +10 -0
@@ -4,24 +4,15 @@ import {
|
|
4
4
|
getOperationAmountNumber,
|
5
5
|
getOperationAmountNumberWithInternals,
|
6
6
|
} from "@ledgerhq/coin-framework/operation";
|
7
|
-
import { nftsByCollections } from "@ledgerhq/live-nft";
|
8
7
|
import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
|
9
8
|
import type { Unit } from "@ledgerhq/types-cryptoassets";
|
10
|
-
import type { Account, Operation
|
9
|
+
import type { Account, Operation } from "@ledgerhq/types-live";
|
11
10
|
import { BigNumber } from "bignumber.js";
|
12
11
|
import invariant from "invariant";
|
13
12
|
import { formatCurrencyUnit } from "../currencies";
|
14
13
|
import { toAccountRaw } from "./serialization";
|
15
14
|
import { getAccountBridge } from "../bridge";
|
16
15
|
|
17
|
-
const styling = {
|
18
|
-
bold: (str: string) => `\x1b[1m${str}\x1b[22m`,
|
19
|
-
underline: (str: string) => `\x1b[4m${str}\x1b[24m`,
|
20
|
-
cyan: (str: string) => `\x1b[36m${str}\x1b[37m`,
|
21
|
-
magenta: (str: string) => `\x1b[35m${str}\x1b[37m`,
|
22
|
-
reverse: (str: string) => `\x1b[7m${str}\x1b[27m`,
|
23
|
-
};
|
24
|
-
|
25
16
|
const isSignificantAccount = acc =>
|
26
17
|
acc.balance.gt(10 ** (getAccountCurrency(acc).units[0].magnitude - 6));
|
27
18
|
|
@@ -77,8 +68,7 @@ function maybeDisplaySumOfOpsIssue(ops, balance, unit) {
|
|
77
68
|
}
|
78
69
|
|
79
70
|
const cliFormat = (account, level?: string) => {
|
80
|
-
const { id, name, freshAddress, freshAddressPath, derivationMode, index, operations
|
81
|
-
account;
|
71
|
+
const { id, name, freshAddress, freshAddressPath, derivationMode, index, operations } = account;
|
82
72
|
const tag = getTagDerivationMode(account.currency, derivationMode);
|
83
73
|
const balance = formatCurrencyUnit(getAccountCurrency(account).units[0], account.balance, {
|
84
74
|
showCode: true,
|
@@ -122,34 +112,6 @@ const cliFormat = (account, level?: string) => {
|
|
122
112
|
)
|
123
113
|
.join("\n");
|
124
114
|
|
125
|
-
if (nfts?.length) {
|
126
|
-
const NFTCollections = nftsByCollections(nfts);
|
127
|
-
|
128
|
-
str += "\n";
|
129
|
-
str += `NFT Collections (${Object.keys(NFTCollections).length}) `;
|
130
|
-
str += "\n";
|
131
|
-
|
132
|
-
str += Object.entries(NFTCollections)
|
133
|
-
.map(([contract, nfts]: [string, ProtoNFT[]]) => {
|
134
|
-
const tokenName = nfts?.[0]?.metadata?.tokenName;
|
135
|
-
const { bold, magenta, cyan, reverse } = styling;
|
136
|
-
|
137
|
-
return (
|
138
|
-
`${bold(tokenName ?? "Unknown Collection Name")} (${magenta(contract)}): ` +
|
139
|
-
nfts
|
140
|
-
.map(t =>
|
141
|
-
t?.metadata?.nftName
|
142
|
-
? `\n ${t.amount}x ${reverse(` ${t?.metadata?.nftName} `)} ${cyan(
|
143
|
-
"#" + t.tokenId,
|
144
|
-
)}`
|
145
|
-
: `\n ${t.amount}x ${cyan("#" + t.tokenId)}`,
|
146
|
-
)
|
147
|
-
.join()
|
148
|
-
);
|
149
|
-
})
|
150
|
-
.join("\n");
|
151
|
-
}
|
152
|
-
|
153
115
|
if (level === "basic") return str;
|
154
116
|
str += "\nOPERATIONS (" + operations.length + ")";
|
155
117
|
str += operations
|
@@ -4,16 +4,12 @@ export const ImageLoadFromGalleryError = createCustomErrorClass("ImageLoadFromGa
|
|
4
4
|
|
5
5
|
export const ImageLoadFromFileError = createCustomErrorClass("ImageLoadFromFileError");
|
6
6
|
|
7
|
-
export const ImageLoadFromNftError = createCustomErrorClass("ImageLoadFromNftError");
|
8
|
-
|
9
7
|
export const ImageIncorrectFileTypeError = createCustomErrorClass("ImageIncorrectFileTypeError");
|
10
8
|
|
11
9
|
export const ImageDownloadError = createCustomErrorClass("ImageDownloadError");
|
12
10
|
|
13
11
|
export const ImageTooLargeError = createCustomErrorClass("ImageTooLargeError");
|
14
12
|
|
15
|
-
export const NFTMetadataLoadingError = createCustomErrorClass("NFTMetadataLoadingError");
|
16
|
-
|
17
13
|
export const ImageSizeLoadingError = createCustomErrorClass("ImageSizeLoadingError");
|
18
14
|
|
19
15
|
export const ImageCropError = createCustomErrorClass("ImageCropError");
|
package/src/deposit/type.ts
CHANGED
@@ -226,7 +226,8 @@ const DEFAULT_SWAP_PROVIDERS: Record<string, ProviderConfig & Partial<Additional
|
|
226
226
|
};
|
227
227
|
|
228
228
|
export const dexProvidersContractAddress: { [key: string]: string } = {
|
229
|
-
"
|
229
|
+
"0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad": "Uniswap",
|
230
|
+
"0x111111125421ca6dc452d289314280a0f8842a65": "1inch",
|
230
231
|
};
|
231
232
|
|
232
233
|
export const termsOfUse: { [key: string]: string } = {
|
@@ -111,6 +111,7 @@ export const DEFAULT_FEATURES: Features = {
|
|
111
111
|
ptxServiceCtaExchangeDrawer: DEFAULT_FEATURE,
|
112
112
|
ptxServiceCtaScreens: DEFAULT_FEATURE,
|
113
113
|
ptxSwapReceiveTRC20WithoutTrx: DEFAULT_FEATURE,
|
114
|
+
ptxSwapconfirmSwapOnDevice: DEFAULT_FEATURE,
|
114
115
|
disableNftLedgerMarket: DEFAULT_FEATURE,
|
115
116
|
disableNftRaribleOpensea: DEFAULT_FEATURE,
|
116
117
|
disableNftSend: DEFAULT_FEATURE,
|
@@ -492,7 +493,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
492
493
|
refreshTime: 3, //nb minutes
|
493
494
|
},
|
494
495
|
},
|
495
|
-
spamReportNfts: DEFAULT_FEATURE,
|
496
496
|
lldWalletSync: {
|
497
497
|
...DEFAULT_FEATURE,
|
498
498
|
params: {
|
@@ -592,8 +592,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
592
592
|
},
|
593
593
|
llmThai: DEFAULT_FEATURE,
|
594
594
|
lldThai: DEFAULT_FEATURE,
|
595
|
-
lldSolanaNfts: DEFAULT_FEATURE,
|
596
|
-
llmSolanaNfts: DEFAULT_FEATURE,
|
597
595
|
largemoverLandingpage: DEFAULT_FEATURE,
|
598
596
|
llmMmkvMigration: {
|
599
597
|
...DEFAULT_FEATURE,
|
@@ -629,7 +627,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
629
627
|
backendEnvironment: "PROD",
|
630
628
|
},
|
631
629
|
},
|
632
|
-
llNftSupport: DEFAULT_FEATURE,
|
633
630
|
llNftEntryPoint: {
|
634
631
|
...DEFAULT_FEATURE,
|
635
632
|
params: {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export const expectedAssetsSorted = [
|
2
2
|
{
|
3
3
|
id: "bitcoin",
|
4
|
+
metaCurrencyId: "bitcoin",
|
4
5
|
ticker: "BTC",
|
5
6
|
name: "Bitcoin",
|
6
7
|
assetsIds: {
|
@@ -9,6 +10,7 @@ export const expectedAssetsSorted = [
|
|
9
10
|
},
|
10
11
|
{
|
11
12
|
id: "ethereum",
|
13
|
+
metaCurrencyId: "urn:crypto:meta-currency:ethereum",
|
12
14
|
ticker: "ETH",
|
13
15
|
name: "Ethereum",
|
14
16
|
assetsIds: {
|
@@ -26,6 +28,7 @@ export const expectedAssetsSorted = [
|
|
26
28
|
},
|
27
29
|
{
|
28
30
|
id: "ripple",
|
31
|
+
metaCurrencyId: "ripple",
|
29
32
|
ticker: "XRP",
|
30
33
|
name: "Ripple",
|
31
34
|
assetsIds: {
|
@@ -34,6 +37,7 @@ export const expectedAssetsSorted = [
|
|
34
37
|
},
|
35
38
|
{
|
36
39
|
id: "ethereum/erc20/usd_tether__erc20_",
|
40
|
+
metaCurrencyId: "urn:crypto:meta-currency:tether",
|
37
41
|
ticker: "USDT",
|
38
42
|
name: "Tether USD",
|
39
43
|
assetsIds: {
|
@@ -57,6 +61,7 @@ export const expectedAssetsSorted = [
|
|
57
61
|
},
|
58
62
|
{
|
59
63
|
id: "bsc",
|
64
|
+
metaCurrencyId: "urn:crypto:meta-currency:binancecoin",
|
60
65
|
ticker: "BNB",
|
61
66
|
name: "Binance Smart Chain",
|
62
67
|
assetsIds: {
|
@@ -67,6 +72,7 @@ export const expectedAssetsSorted = [
|
|
67
72
|
},
|
68
73
|
{
|
69
74
|
id: "solana",
|
75
|
+
metaCurrencyId: "solana",
|
70
76
|
ticker: "SOL",
|
71
77
|
name: "Solana",
|
72
78
|
assetsIds: {
|
@@ -75,6 +81,7 @@ export const expectedAssetsSorted = [
|
|
75
81
|
},
|
76
82
|
{
|
77
83
|
id: "ethereum/erc20/usd__coin",
|
84
|
+
metaCurrencyId: "urn:crypto:meta-currency:usd_coin",
|
78
85
|
ticker: "USDC",
|
79
86
|
name: "USD Coin",
|
80
87
|
assetsIds: {
|
@@ -104,6 +111,7 @@ export const expectedAssetsSorted = [
|
|
104
111
|
},
|
105
112
|
{
|
106
113
|
id: "ethereum/erc20/steth",
|
114
|
+
metaCurrencyId: "ethereum/erc20/steth",
|
107
115
|
ticker: "stETH",
|
108
116
|
name: "LIDO Staked ETH",
|
109
117
|
assetsIds: {
|
@@ -112,6 +120,7 @@ export const expectedAssetsSorted = [
|
|
112
120
|
},
|
113
121
|
{
|
114
122
|
id: "tron",
|
123
|
+
metaCurrencyId: "tron",
|
115
124
|
ticker: "TRX",
|
116
125
|
name: "Tron",
|
117
126
|
assetsIds: {
|
@@ -120,6 +129,7 @@ export const expectedAssetsSorted = [
|
|
120
129
|
},
|
121
130
|
{
|
122
131
|
id: "dogecoin",
|
132
|
+
metaCurrencyId: "dogecoin",
|
123
133
|
ticker: "DOGE",
|
124
134
|
name: "Dogecoin",
|
125
135
|
assetsIds: {
|