@ledgerhq/live-common 34.52.0-nightly.4 → 34.52.0-nightly.6
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/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +7 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +5 -4
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts +5 -1
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts +4 -1
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +8 -5
- package/lib/e2e/data/deviceLabelsData.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/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +1 -1
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/index.d.ts +4 -0
- 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/families/canton/bridge/mock.d.ts +2 -2
- 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/canton/setup.d.ts +3 -3
- package/lib/families/canton/setup.d.ts.map +1 -1
- package/lib/families/canton/setup.js.map +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +17 -0
- package/lib/families/evm/config.js.map +1 -1
- package/lib/families/hedera/utils.d.ts +2 -0
- package/lib/families/hedera/utils.d.ts.map +1 -0
- package/lib/families/hedera/{logic.js → utils.js} +2 -2
- package/lib/families/hedera/utils.js.map +1 -0
- package/lib/families/sui/react.d.ts.map +1 -1
- package/lib/families/sui/react.js +1 -0
- package/lib/families/sui/react.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +1 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/generated/bridge/js.d.ts +1 -1
- package/lib/generated/bridge/mock.d.ts +1 -1
- package/lib/generated/specs.d.ts +1 -0
- package/lib/generated/specs.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +3 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.js.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js +7 -6
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- 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/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +7 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +5 -4
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts +5 -1
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts +4 -1
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.js +8 -5
- package/lib-es/e2e/data/deviceLabelsData.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/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +1 -1
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/index.d.ts +4 -0
- 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/families/canton/bridge/mock.d.ts +2 -2
- 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/canton/setup.d.ts +3 -3
- package/lib-es/families/canton/setup.d.ts.map +1 -1
- package/lib-es/families/canton/setup.js.map +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +17 -0
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/families/hedera/utils.d.ts +2 -0
- package/lib-es/families/hedera/utils.d.ts.map +1 -0
- package/lib-es/families/hedera/utils.js +3 -0
- package/lib-es/families/hedera/utils.js.map +1 -0
- package/lib-es/families/sui/react.d.ts.map +1 -1
- package/lib-es/families/sui/react.js +1 -0
- package/lib-es/families/sui/react.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +1 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/generated/bridge/js.d.ts +1 -1
- package/lib-es/generated/bridge/mock.d.ts +1 -1
- package/lib-es/generated/specs.d.ts +1 -0
- package/lib-es/generated/specs.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +3 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.js.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js +7 -6
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/package.json +52 -51
- package/src/__tests__/environment.test.ts +8 -5
- package/src/__tests__/migration/account-migration.ts +1 -0
- package/src/__tests__/test-helpers/environment.ts +2 -0
- package/src/bridge/generic-alpaca/getAccountShape.ts +8 -1
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +25 -2
- package/src/bridge/generic-alpaca/utils.test.ts +165 -0
- package/src/bridge/generic-alpaca/utils.ts +5 -4
- package/src/e2e/data/deviceLabelsData.ts +8 -5
- package/src/e2e/enum/DeviceLabels.ts +1 -0
- package/src/e2e/families/solana.ts +1 -4
- package/src/families/canton/bridge/mock.ts +10 -7
- package/src/families/canton/setup.ts +3 -3
- package/src/families/evm/config.ts +17 -0
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +222 -86
- package/src/families/hedera/utils.ts +2 -0
- package/src/families/sui/react.ts +5 -0
- package/src/featureFlags/defaultFeatures.ts +1 -0
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +3 -0
- package/src/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.ts +1 -1
- package/src/postOnboarding/hooks/usePostOnboardingHubState.ts +7 -9
- package/lib/families/hedera/logic.d.ts +0 -2
- package/lib/families/hedera/logic.d.ts.map +0 -1
- package/lib/families/hedera/logic.js.map +0 -1
- package/lib-es/families/hedera/logic.d.ts +0 -2
- package/lib-es/families/hedera/logic.d.ts.map +0 -1
- package/lib-es/families/hedera/logic.js +0 -3
- package/lib-es/families/hedera/logic.js.map +0 -1
- package/src/dada-client/MIGRATION_GUIDE.md +0 -187
- package/src/families/hedera/logic.ts +0 -2
- package/src/families/sui/__snapshots__/bridge.integration.test.ts.snap +0 -428
|
@@ -66,10 +66,11 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
66
66
|
default: DeviceLabels.CAPS_APPROVE,
|
|
67
67
|
},
|
|
68
68
|
sendVerify: {
|
|
69
|
+
[AppInfos.SOLANA.name]: DeviceLabels.TRANSFER,
|
|
69
70
|
default: DeviceLabels.REVIEW_OPERATION,
|
|
70
71
|
},
|
|
71
72
|
sendConfirm: {
|
|
72
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
73
|
+
[AppInfos.SOLANA.name]: DeviceLabels.APPROVE,
|
|
73
74
|
[AppInfos.TRON.name]: DeviceLabels.SIGN,
|
|
74
75
|
[AppInfos.STELLAR.name]: DeviceLabels.SIGN,
|
|
75
76
|
[AppInfos.RIPPLE.name]: DeviceLabels.SIGN,
|
|
@@ -114,7 +115,7 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
114
115
|
[AppInfos.ETHEREUM.name]: DeviceLabels.VERIFY_ETHEREUM,
|
|
115
116
|
[AppInfos.POLKADOT.name]: DeviceLabels.PLEASE_REVIEW,
|
|
116
117
|
[AppInfos.POLYGON.name]: DeviceLabels.VERIFY_POLYGON,
|
|
117
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
118
|
+
[AppInfos.SOLANA.name]: DeviceLabels.VERIFY_SOLANA_ADDRESS,
|
|
118
119
|
default: DeviceLabels.ADDRESS,
|
|
119
120
|
},
|
|
120
121
|
receiveConfirm: {
|
|
@@ -124,13 +125,14 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
124
125
|
[AppInfos.ETHEREUM.name]: DeviceLabels.CONFIRM,
|
|
125
126
|
[AppInfos.POLKADOT.name]: DeviceLabels.CAPS_APPROVE,
|
|
126
127
|
[AppInfos.POLYGON.name]: DeviceLabels.CONFIRM,
|
|
128
|
+
[AppInfos.SOLANA.name]: DeviceLabels.CONFIRM,
|
|
127
129
|
default: DeviceLabels.APPROVE,
|
|
128
130
|
},
|
|
129
131
|
delegateVerify: {
|
|
130
132
|
[AppInfos.COSMOS.name]: DeviceLabels.PLEASE_REVIEW,
|
|
131
133
|
[AppInfos.MULTIVERS_X.name]: DeviceLabels.RECEIVER,
|
|
132
134
|
[AppInfos.NEAR.name]: DeviceLabels.VIEW_HEADER,
|
|
133
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
135
|
+
[AppInfos.SOLANA.name]: DeviceLabels.REVIEW_TRANSACTION_TO,
|
|
134
136
|
default: DeviceLabels.REVIEW_OPERATION,
|
|
135
137
|
},
|
|
136
138
|
delegateConfirm: {
|
|
@@ -141,15 +143,16 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
141
143
|
[AppInfos.MULTIVERS_X.name]: DeviceLabels.SIGN,
|
|
142
144
|
[AppInfos.NEAR.name]: DeviceLabels.CONTINUE_TO_ACTION,
|
|
143
145
|
[AppInfos.OSMOSIS.name]: DeviceLabels.CAPS_APPROVE,
|
|
146
|
+
[AppInfos.SOLANA.name]: DeviceLabels.SIGN,
|
|
144
147
|
default: DeviceLabels.APPROVE,
|
|
145
148
|
},
|
|
146
149
|
sendVerify: {
|
|
147
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
150
|
+
[AppInfos.SOLANA.name]: DeviceLabels.REVIEW_TRANSACTION_TO,
|
|
148
151
|
[AppInfos.RIPPLE.name]: DeviceLabels.TRANSACTION_TYPE,
|
|
149
152
|
default: DeviceLabels.REVIEW_OPERATION,
|
|
150
153
|
},
|
|
151
154
|
sendConfirm: {
|
|
152
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
155
|
+
[AppInfos.SOLANA.name]: DeviceLabels.SIGN_TRANSACTION,
|
|
153
156
|
[AppInfos.TRON.name]: DeviceLabels.SIGN,
|
|
154
157
|
[AppInfos.STELLAR.name]: DeviceLabels.SIGN,
|
|
155
158
|
[AppInfos.RIPPLE.name]: DeviceLabels.SIGN,
|
|
@@ -39,6 +39,7 @@ export enum DeviceLabels {
|
|
|
39
39
|
REVIEW_OPERATION = "Review",
|
|
40
40
|
REMOVE_PHONE_OR_COMPUTER = "Remove phone or computer",
|
|
41
41
|
REVIEW_TRANSACTION = "Review transaction",
|
|
42
|
+
REVIEW_TRANSACTION_TO = "Review transaction to",
|
|
42
43
|
SEND = "Send",
|
|
43
44
|
SEND_TO_ADDRESS = "Send to address",
|
|
44
45
|
SEND_TO_ADDRESS_2 = "Send to address (2/2)",
|
|
@@ -22,10 +22,7 @@ export async function sendSolana(tx: Transaction) {
|
|
|
22
22
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
23
23
|
expect(isAmountCorrect).toBeTruthy();
|
|
24
24
|
if (process.env.SPECULOS_DEVICE !== Device.LNS.name) {
|
|
25
|
-
const isAddressCorrect = containsSubstringInEvent(
|
|
26
|
-
tx.accountToCredit.parentAccount?.address ?? tx.accountToCredit.address,
|
|
27
|
-
events,
|
|
28
|
-
);
|
|
25
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
29
26
|
expect(isAddressCorrect).toBeTruthy();
|
|
30
27
|
}
|
|
31
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeLRUCache, minutes } from "@ledgerhq/live-network/cache";
|
|
2
2
|
import { createApi } from "@ledgerhq/coin-canton/api/index";
|
|
3
|
-
import { Transaction as CantonTransaction } from "@ledgerhq/coin-canton/types";
|
|
3
|
+
import { Transaction as CantonTransaction, CantonAccount } from "@ledgerhq/coin-canton/types";
|
|
4
4
|
import type { AccountBridge } from "@ledgerhq/types-live";
|
|
5
5
|
import { BigNumber } from "bignumber.js";
|
|
6
6
|
|
|
@@ -51,12 +51,12 @@ const getTransactionStatus = async (): Promise<any> => {
|
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
const estimateMaxSpendable = ({ account }: { account:
|
|
54
|
+
const estimateMaxSpendable = ({ account }: { account: CantonAccount }): Promise<BigNumber> => {
|
|
55
55
|
return Promise.resolve(account.balance || new BigNumber(0));
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
const prepareTransaction = async (
|
|
59
|
-
_account:
|
|
59
|
+
_account: CantonAccount,
|
|
60
60
|
transaction: CantonTransaction,
|
|
61
61
|
): Promise<CantonTransaction> => {
|
|
62
62
|
return {
|
|
@@ -65,17 +65,17 @@ const prepareTransaction = async (
|
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
const sync = (_initialAccount:
|
|
68
|
+
const sync = (_initialAccount: CantonAccount): any => {
|
|
69
69
|
return {
|
|
70
70
|
subscribe: (observer: any) => {
|
|
71
|
-
observer.next((acc:
|
|
71
|
+
observer.next((acc: CantonAccount) => acc);
|
|
72
72
|
observer.complete();
|
|
73
73
|
return { unsubscribe: () => {} };
|
|
74
74
|
},
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
const receive = (_account:
|
|
78
|
+
const receive = (_account: CantonAccount, _opts: { deviceId: string }): any => {
|
|
79
79
|
return {
|
|
80
80
|
subscribe: (observer: any) => {
|
|
81
81
|
observer.next({
|
|
@@ -144,6 +144,9 @@ const scanAccounts = (): any => {
|
|
|
144
144
|
lastSyncDate: new Date(),
|
|
145
145
|
operations: [],
|
|
146
146
|
pendingOperations: [],
|
|
147
|
+
cantonResources: {
|
|
148
|
+
instrumentUtxoCounts: {},
|
|
149
|
+
},
|
|
147
150
|
},
|
|
148
151
|
});
|
|
149
152
|
observer.complete();
|
|
@@ -156,7 +159,7 @@ const getSerializedAddressParameters = (): Buffer => {
|
|
|
156
159
|
return Buffer.from("mock-address-params");
|
|
157
160
|
};
|
|
158
161
|
|
|
159
|
-
const accountBridge: AccountBridge<CantonTransaction> = {
|
|
162
|
+
const accountBridge: AccountBridge<CantonTransaction, CantonAccount> = {
|
|
160
163
|
createTransaction,
|
|
161
164
|
updateTransaction,
|
|
162
165
|
getTransactionStatus,
|
|
@@ -5,10 +5,10 @@ import { getEnv } from "@ledgerhq/live-env";
|
|
|
5
5
|
import Transport from "@ledgerhq/hw-transport";
|
|
6
6
|
import { CantonSigner } from "@ledgerhq/coin-canton";
|
|
7
7
|
import cantonResolver from "@ledgerhq/coin-canton/signer";
|
|
8
|
-
import type {
|
|
8
|
+
import type { Bridge } from "@ledgerhq/types-live";
|
|
9
9
|
import makeCliTools from "@ledgerhq/coin-canton/test/cli";
|
|
10
10
|
import { CantonCoinConfig } from "@ledgerhq/coin-canton/config";
|
|
11
|
-
import { TransactionStatus, Transaction } from "@ledgerhq/coin-canton/types";
|
|
11
|
+
import { TransactionStatus, Transaction, CantonAccount } from "@ledgerhq/coin-canton/types";
|
|
12
12
|
import { LegacySignerCanton } from "@ledgerhq/live-signer-canton";
|
|
13
13
|
import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup";
|
|
14
14
|
import cantonBridgeMock from "./bridge/mock";
|
|
@@ -27,7 +27,7 @@ const getCurrencyConfig = (currency?: CryptoCurrency) => {
|
|
|
27
27
|
return getCurrencyConfiguration<CantonCoinConfig>(currency);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const bridge: Bridge<Transaction,
|
|
30
|
+
const bridge: Bridge<Transaction, CantonAccount, TransactionStatus> = getEnv("MOCK")
|
|
31
31
|
? cantonBridgeMock
|
|
32
32
|
: createBridges(executeWithSigner(createSigner), getCurrencyConfig);
|
|
33
33
|
|
|
@@ -925,6 +925,23 @@ const evmConfig: CurrencyLiveConfigDefinition = {
|
|
|
925
925
|
showNfts: false,
|
|
926
926
|
},
|
|
927
927
|
},
|
|
928
|
+
config_currency_monad: {
|
|
929
|
+
type: "object",
|
|
930
|
+
default: {
|
|
931
|
+
status: {
|
|
932
|
+
type: "active",
|
|
933
|
+
},
|
|
934
|
+
node: {
|
|
935
|
+
type: "external",
|
|
936
|
+
uri: "https://rpc.monad.xyz",
|
|
937
|
+
},
|
|
938
|
+
explorer: {
|
|
939
|
+
type: "etherscan",
|
|
940
|
+
uri: "https://proxyetherscan.api.live.ledger.com/v2/api/143",
|
|
941
|
+
},
|
|
942
|
+
showNfts: false,
|
|
943
|
+
},
|
|
944
|
+
},
|
|
928
945
|
};
|
|
929
946
|
|
|
930
947
|
export { evmConfig };
|