@ledgerhq/live-common 34.52.0-nightly.20251031094135 → 34.52.0-nightly.20251104023745
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/setup.js +3 -5
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/apps/config.d.ts.map +1 -1
- package/lib/apps/config.js +1 -0
- package/lib/apps/config.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js +5 -3
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/types.d.ts +56 -2
- package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +97 -1
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/e2e/index.d.ts +0 -2
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.js +1 -1
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib/e2e/speculosAppVersion.js +1 -0
- package/lib/e2e/speculosAppVersion.js.map +1 -1
- package/lib/families/tron/data.mock.d.ts.map +1 -1
- package/lib/families/tron/data.mock.js +1 -0
- package/lib/families/tron/data.mock.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -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/market/hooks/useLargeMoverCurrencies.d.ts +1 -1
- package/lib/market/hooks/useMarketDataProvider.d.ts +2 -2
- package/lib/market/hooks/useMarketDataProvider.d.ts.map +1 -1
- package/lib/market/utils/currencyFormatter.d.ts +3 -3
- package/lib/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib/market/utils/currencyFormatter.js.map +1 -1
- package/lib/market/utils/queryKeys.d.ts +0 -1
- package/lib/market/utils/queryKeys.d.ts.map +1 -1
- package/lib/market/utils/queryKeys.js +0 -1
- package/lib/market/utils/queryKeys.js.map +1 -1
- package/lib/market/utils/types.d.ts +6 -6
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js +13 -4
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib/postOnboarding/mock.d.ts +1 -0
- package/lib/postOnboarding/mock.d.ts.map +1 -1
- package/lib/postOnboarding/mock.js +3 -1
- package/lib/postOnboarding/mock.js.map +1 -1
- package/lib/postOnboarding/reducer.d.ts +16 -14
- package/lib/postOnboarding/reducer.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/setup.js +3 -5
- package/lib-es/__tests__/test-helpers/setup.js.map +1 -1
- package/lib-es/apps/config.d.ts.map +1 -1
- package/lib-es/apps/config.js +1 -0
- package/lib-es/apps/config.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +5 -3
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts +56 -2
- package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +97 -1
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/e2e/index.d.ts +0 -2
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +1 -1
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib-es/e2e/speculosAppVersion.js +1 -0
- package/lib-es/e2e/speculosAppVersion.js.map +1 -1
- package/lib-es/families/tron/data.mock.d.ts.map +1 -1
- package/lib-es/families/tron/data.mock.js +1 -0
- package/lib-es/families/tron/data.mock.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -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/market/hooks/useLargeMoverCurrencies.d.ts +1 -1
- package/lib-es/market/hooks/useMarketDataProvider.d.ts +2 -2
- package/lib-es/market/hooks/useMarketDataProvider.d.ts.map +1 -1
- package/lib-es/market/utils/currencyFormatter.d.ts +3 -3
- package/lib-es/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib-es/market/utils/currencyFormatter.js.map +1 -1
- package/lib-es/market/utils/queryKeys.d.ts +0 -1
- package/lib-es/market/utils/queryKeys.d.ts.map +1 -1
- package/lib-es/market/utils/queryKeys.js +0 -1
- package/lib-es/market/utils/queryKeys.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +6 -6
- package/lib-es/market/utils/types.d.ts.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js +13 -4
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib-es/postOnboarding/mock.d.ts +1 -0
- package/lib-es/postOnboarding/mock.d.ts.map +1 -1
- package/lib-es/postOnboarding/mock.js +2 -0
- package/lib-es/postOnboarding/mock.js.map +1 -1
- package/lib-es/postOnboarding/reducer.d.ts +16 -14
- package/lib-es/postOnboarding/reducer.d.ts.map +1 -1
- package/package.json +74 -74
- package/src/DataModel.test.ts +1 -0
- package/src/__tests__/test-helpers/setup.ts +3 -6
- package/src/apps/config.ts +1 -0
- package/src/bridge/generic-alpaca/signOperation.ts +5 -3
- package/src/bridge/generic-alpaca/types.ts +75 -2
- package/src/bridge/generic-alpaca/utils.test.ts +28 -2
- package/src/bridge/generic-alpaca/utils.ts +121 -2
- package/src/deposit/deposit.integration.test.ts +15 -0
- package/src/e2e/speculos.ts +1 -1
- package/src/e2e/speculosAppVersion.ts +1 -0
- package/src/families/tron/data.mock.ts +1 -0
- package/src/featureFlags/defaultFeatures.ts +1 -1
- package/src/market/hooks/useMarketDataProvider.ts +2 -2
- package/src/market/utils/currencyFormatter.ts +3 -3
- package/src/market/utils/queryKeys.ts +0 -1
- package/src/market/utils/types.ts +6 -6
- package/src/postOnboarding/hooks/usePostOnboardingHubState.test.ts +30 -3
- package/src/postOnboarding/hooks/usePostOnboardingHubState.ts +20 -6
- package/src/postOnboarding/mock.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/postOnboarding/mock.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAI/F,eAAO,MAAM,qBAAqB,EAAE,SAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/postOnboarding/mock.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAI/F,eAAO,MAAM,qBAAqB,EAAE,SAAyB,CAAC;AAC9D,eAAO,MAAM,0BAA0B,EAAE,MAA2B,CAAC;AAErE,eAAO,MAAM,aAAa,EAAE,oBAS3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,oBAUjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,oBAQnC,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,sBAAsB,GAAG,oBAAoB,CAMxF"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { PostOnboardingActionId } from "@ledgerhq/types-live";
|
|
3
3
|
const MockIcon = () => null;
|
|
4
4
|
export const mockedFeatureIdToTest = "mockFeature";
|
|
5
|
+
export const mockedFeatureParamIdToTest = "mockFeatureParam";
|
|
5
6
|
export const claimTestMock = {
|
|
6
7
|
id: PostOnboardingActionId.claimMock,
|
|
7
8
|
Icon: MockIcon,
|
|
@@ -16,6 +17,7 @@ export const personalizeTestMock = {
|
|
|
16
17
|
id: PostOnboardingActionId.personalizeMock,
|
|
17
18
|
Icon: MockIcon,
|
|
18
19
|
featureFlagId: mockedFeatureIdToTest,
|
|
20
|
+
featureFlagParamId: mockedFeatureParamIdToTest,
|
|
19
21
|
title: `Personalize my device`,
|
|
20
22
|
titleCompleted: `Personalize my device`,
|
|
21
23
|
description: "By customizing the screen.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../src/postOnboarding/mock.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAmC,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE/F,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAE5B,MAAM,CAAC,MAAM,qBAAqB,GAAc,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../src/postOnboarding/mock.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAmC,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE/F,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAE5B,MAAM,CAAC,MAAM,qBAAqB,GAAc,aAAa,CAAC;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAW,kBAAkB,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAyB;IACjD,EAAE,EAAE,sBAAsB,CAAC,SAAS;IACpC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,cAAc;IACrB,cAAc,EAAE,cAAc;IAC9B,WAAW,EAAE,wBAAwB;IACrC,QAAQ,EAAE,MAAM;IAChB,yBAAyB,EAAE,aAAa;IACxC,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD,EAAE,EAAE,sBAAsB,CAAC,eAAe;IAC1C,IAAI,EAAE,QAAQ;IACd,aAAa,EAAE,qBAAqB;IACpC,kBAAkB,EAAE,0BAA0B;IAC9C,KAAK,EAAE,uBAAuB;IAC9B,cAAc,EAAE,uBAAuB;IACvC,WAAW,EAAE,4BAA4B;IACzC,yBAAyB,EAAE,qBAAqB;IAChD,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAyB;IACzD,EAAE,EAAE,sBAAsB,CAAC,iBAAiB;IAC5C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8BAA8B;IACrC,cAAc,EAAE,8BAA8B;IAC9C,WAAW,EAAE,yDAAyD;IACtE,yBAAyB,EAAE,mBAAmB;IAC9C,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC;CACzC,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,EAA0B;IAChE,OAAO;QACL,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,aAAa;QACjD,CAAC,sBAAsB,CAAC,eAAe,CAAC,EAAE,mBAAmB;QAC7D,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,EAAE,qBAAqB;KAClE,CAAC,EAAE,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -24,17 +24,18 @@ export declare const hubStateSelector: ((state: {
|
|
|
24
24
|
deviceModelId: DeviceModelId | null;
|
|
25
25
|
actionsToComplete: PostOnboardingActionId[];
|
|
26
26
|
actionsCompleted: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
assetsTransfer?: boolean | undefined;
|
|
28
|
+
buyCrypto?: boolean | undefined;
|
|
29
|
+
syncAccounts?: boolean | undefined;
|
|
30
|
+
customImage?: boolean | undefined;
|
|
31
|
+
recover?: boolean | undefined;
|
|
30
32
|
assetsTransferMock?: boolean | undefined;
|
|
31
33
|
buyCryptoMock?: boolean | undefined;
|
|
32
34
|
customImageMock?: boolean | undefined;
|
|
35
|
+
claimMock?: boolean | undefined;
|
|
36
|
+
migrateAssetsMock?: boolean | undefined;
|
|
37
|
+
personalizeMock?: boolean | undefined;
|
|
33
38
|
recoverMock?: boolean | undefined;
|
|
34
|
-
customImage?: boolean | undefined;
|
|
35
|
-
assetsTransfer?: boolean | undefined;
|
|
36
|
-
buyCrypto?: boolean | undefined;
|
|
37
|
-
recover?: boolean | undefined;
|
|
38
39
|
};
|
|
39
40
|
lastActionCompleted: PostOnboardingActionId | null;
|
|
40
41
|
postOnboardingInProgress: boolean;
|
|
@@ -42,17 +43,18 @@ export declare const hubStateSelector: ((state: {
|
|
|
42
43
|
deviceModelId: DeviceModelId | null;
|
|
43
44
|
actionsToComplete: PostOnboardingActionId[];
|
|
44
45
|
actionsCompleted: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
assetsTransfer?: boolean | undefined;
|
|
47
|
+
buyCrypto?: boolean | undefined;
|
|
48
|
+
syncAccounts?: boolean | undefined;
|
|
49
|
+
customImage?: boolean | undefined;
|
|
50
|
+
recover?: boolean | undefined;
|
|
48
51
|
assetsTransferMock?: boolean | undefined;
|
|
49
52
|
buyCryptoMock?: boolean | undefined;
|
|
50
53
|
customImageMock?: boolean | undefined;
|
|
54
|
+
claimMock?: boolean | undefined;
|
|
55
|
+
migrateAssetsMock?: boolean | undefined;
|
|
56
|
+
personalizeMock?: boolean | undefined;
|
|
51
57
|
recoverMock?: boolean | undefined;
|
|
52
|
-
customImage?: boolean | undefined;
|
|
53
|
-
assetsTransfer?: boolean | undefined;
|
|
54
|
-
buyCrypto?: boolean | undefined;
|
|
55
|
-
recover?: boolean | undefined;
|
|
56
58
|
};
|
|
57
59
|
lastActionCompleted: PostOnboardingActionId | null;
|
|
58
60
|
postOnboardingInProgress: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/postOnboarding/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGnF,OAAO,EAAkB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,mBAQ1B,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CAAE,CAAC;AACzE,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,sBAAsB,EAAE,CAAC;CACtC,CAAC;AACF,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,sBAAsB,CAAC;CAClC,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,sBAAsB,GAAG,WAAW,GAAG,yBAAyB,CAAC;;AA0CnG,wBAAmF;AAiBnF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C;IAAE,cAAc,EAAE,mBAAmB,CAAA;CAAE,EACvC,mBAAmB,CAOpB,CAAC;AAEF,eAAO,MAAM,gBAAgB;oBAVT,mBAAmB
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/postOnboarding/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGnF,OAAO,EAAkB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,mBAQ1B,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CAAE,CAAC;AACzE,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,sBAAsB,EAAE,CAAC;CACtC,CAAC;AACF,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,sBAAsB,CAAC;CAClC,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,sBAAsB,GAAG,WAAW,GAAG,yBAAyB,CAAC;;AA0CnG,wBAAmF;AAiBnF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C;IAAE,cAAc,EAAE,mBAAmB,CAAA;CAAE,EACvC,mBAAmB,CAOpB,CAAC;AAEF,eAAO,MAAM,gBAAgB;oBAVT,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrC,CAAC;AAEH,eAAO,MAAM,mCAAmC;oBA3B5B,mBAAmB;;;;;CA8BtC,CAAC;AAEF,eAAO,MAAM,+CAA+C;oBAhCxC,mBAAmB;;;;;CAmCtC,CAAC;AAEF,eAAO,MAAM,oCAAoC;oBArC7B,mBAAmB;;;;;CAwCtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-common",
|
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
|
4
|
-
"version": "34.52.0-nightly.
|
|
4
|
+
"version": "34.52.0-nightly.20251104023745",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"react-dom": ">=16",
|
|
75
75
|
"react-native": ">=0.65.1",
|
|
76
76
|
"react-native-svg": ">=12.1.1",
|
|
77
|
-
"react-redux": "
|
|
77
|
+
"react-redux": "7.2.9",
|
|
78
78
|
"redux-actions": "2.6.5"
|
|
79
79
|
},
|
|
80
80
|
"peerDependenciesMeta": {
|
|
@@ -163,80 +163,80 @@
|
|
|
163
163
|
"xstate": "^5.19.2",
|
|
164
164
|
"yargs": "^17.0.0",
|
|
165
165
|
"zod": "^3.22.4",
|
|
166
|
-
"react-redux": "
|
|
167
|
-
"@ledgerhq/coin-algorand": "^0.12.0-nightly.
|
|
168
|
-
"@ledgerhq/coin-aptos": "^3.5.0-nightly.
|
|
169
|
-
"@ledgerhq/coin-bitcoin": "^0.24.0-nightly.
|
|
170
|
-
"@ledgerhq/coin-canton": "^0.9.0-nightly.
|
|
171
|
-
"@ledgerhq/coin-cardano": "^0.14.0-nightly.
|
|
172
|
-
"@ledgerhq/coin-casper": "^2.3.0-nightly.
|
|
173
|
-
"@ledgerhq/coin-
|
|
174
|
-
"@ledgerhq/coin-
|
|
175
|
-
"@ledgerhq/coin-evm": "^2.34.0-nightly.
|
|
176
|
-
"@ledgerhq/coin-filecoin": "^1.14.0-nightly.
|
|
177
|
-
"@ledgerhq/coin-framework": "^6.8.0-nightly.
|
|
178
|
-
"@ledgerhq/coin-hedera": "^1.13.0-nightly.
|
|
179
|
-
"@ledgerhq/coin-icon": "^0.14.0-nightly.
|
|
180
|
-
"@ledgerhq/coin-internet_computer": "^1.10.0-nightly.
|
|
181
|
-
"@ledgerhq/coin-kaspa": "^1.4.0-nightly.
|
|
182
|
-
"@ledgerhq/coin-
|
|
183
|
-
"@ledgerhq/coin-
|
|
184
|
-
"@ledgerhq/coin-
|
|
185
|
-
"@ledgerhq/coin-polkadot": "^6.12.0-nightly.
|
|
186
|
-
"@ledgerhq/coin-solana": "^0.36.0-nightly.
|
|
187
|
-
"@ledgerhq/coin-stacks": "^0.11.0-nightly.
|
|
188
|
-
"@ledgerhq/coin-stellar": "^6.6.0-nightly.
|
|
189
|
-
"@ledgerhq/coin-sui": "^0.17.0-nightly.
|
|
190
|
-
"@ledgerhq/coin-tezos": "^6.8.0-nightly.
|
|
191
|
-
"@ledgerhq/coin-ton": "^0.16.0-nightly.
|
|
192
|
-
"@ledgerhq/coin-tron": "^5.6.0-nightly.
|
|
193
|
-
"@ledgerhq/coin-vechain": "^2.12.0-nightly.
|
|
194
|
-
"@ledgerhq/coin-xrp": "^7.7.0-nightly.
|
|
195
|
-
"@ledgerhq/crypto-icons-ui": "^1.22.0-nightly.
|
|
196
|
-
"@ledgerhq/cryptoassets": "^13.32.0-nightly.
|
|
197
|
-
"@ledgerhq/device-core": "^0.6.7-nightly.
|
|
198
|
-
"@ledgerhq/devices": "8.7.0-nightly.
|
|
199
|
-
"@ledgerhq/errors": "^6.27.0-nightly.
|
|
200
|
-
"@ledgerhq/hw-app-algorand": "^6.31.9-nightly.
|
|
201
|
-
"@ledgerhq/hw-app-
|
|
202
|
-
"@ledgerhq/hw-app-
|
|
203
|
-
"@ledgerhq/hw-app-celo": "^6.35.2-nightly.
|
|
204
|
-
"@ledgerhq/hw-app-cosmos": "^6.32.9-nightly.
|
|
205
|
-
"@ledgerhq/hw-app-eth": "^6.47.0-nightly.
|
|
206
|
-
"@ledgerhq/hw-app-exchange": "^0.17.0-nightly.
|
|
207
|
-
"@ledgerhq/hw-app-hedera": "^1.2.9-nightly.
|
|
208
|
-
"@ledgerhq/hw-app-icon": "^1.3.9-nightly.
|
|
209
|
-
"@ledgerhq/hw-app-
|
|
210
|
-
"@ledgerhq/hw-app-
|
|
211
|
-
"@ledgerhq/hw-app-near": "^6.31.9-nightly.
|
|
212
|
-
"@ledgerhq/hw-app-polkadot": "^6.34.9-nightly.
|
|
213
|
-
"@ledgerhq/hw-app-str": "^7.2.9-nightly.
|
|
166
|
+
"react-redux": "7.2.9",
|
|
167
|
+
"@ledgerhq/coin-algorand": "^0.12.0-nightly.20251104023745",
|
|
168
|
+
"@ledgerhq/coin-aptos": "^3.5.0-nightly.20251104023745",
|
|
169
|
+
"@ledgerhq/coin-bitcoin": "^0.24.0-nightly.20251104023745",
|
|
170
|
+
"@ledgerhq/coin-canton": "^0.9.0-nightly.20251104023745",
|
|
171
|
+
"@ledgerhq/coin-cardano": "^0.14.0-nightly.20251104023745",
|
|
172
|
+
"@ledgerhq/coin-casper": "^2.3.0-nightly.20251104023745",
|
|
173
|
+
"@ledgerhq/coin-cosmos": "^0.19.0-nightly.20251104023745",
|
|
174
|
+
"@ledgerhq/coin-celo": "^1.7.0-nightly.20251104023745",
|
|
175
|
+
"@ledgerhq/coin-evm": "^2.34.0-nightly.20251104023745",
|
|
176
|
+
"@ledgerhq/coin-filecoin": "^1.14.0-nightly.20251104023745",
|
|
177
|
+
"@ledgerhq/coin-framework": "^6.8.0-nightly.20251104023745",
|
|
178
|
+
"@ledgerhq/coin-hedera": "^1.13.0-nightly.20251104023745",
|
|
179
|
+
"@ledgerhq/coin-icon": "^0.14.0-nightly.20251104023745",
|
|
180
|
+
"@ledgerhq/coin-internet_computer": "^1.10.0-nightly.20251104023745",
|
|
181
|
+
"@ledgerhq/coin-kaspa": "^1.4.0-nightly.20251104023745",
|
|
182
|
+
"@ledgerhq/coin-multiversx": "^0.7.0-nightly.20251104023745",
|
|
183
|
+
"@ledgerhq/coin-near": "^0.15.0-nightly.20251104023745",
|
|
184
|
+
"@ledgerhq/coin-mina": "^1.4.0-nightly.20251104023745",
|
|
185
|
+
"@ledgerhq/coin-polkadot": "^6.12.0-nightly.20251104023745",
|
|
186
|
+
"@ledgerhq/coin-solana": "^0.36.0-nightly.20251104023745",
|
|
187
|
+
"@ledgerhq/coin-stacks": "^0.11.0-nightly.20251104023745",
|
|
188
|
+
"@ledgerhq/coin-stellar": "^6.6.0-nightly.20251104023745",
|
|
189
|
+
"@ledgerhq/coin-sui": "^0.17.0-nightly.20251104023745",
|
|
190
|
+
"@ledgerhq/coin-tezos": "^6.8.0-nightly.20251104023745",
|
|
191
|
+
"@ledgerhq/coin-ton": "^0.16.0-nightly.20251104023745",
|
|
192
|
+
"@ledgerhq/coin-tron": "^5.6.0-nightly.20251104023745",
|
|
193
|
+
"@ledgerhq/coin-vechain": "^2.12.0-nightly.20251104023745",
|
|
194
|
+
"@ledgerhq/coin-xrp": "^7.7.0-nightly.20251104023745",
|
|
195
|
+
"@ledgerhq/crypto-icons-ui": "^1.22.0-nightly.20251104023745",
|
|
196
|
+
"@ledgerhq/cryptoassets": "^13.32.0-nightly.20251104023745",
|
|
197
|
+
"@ledgerhq/device-core": "^0.6.7-nightly.20251104023745",
|
|
198
|
+
"@ledgerhq/devices": "8.7.0-nightly.20251104023745",
|
|
199
|
+
"@ledgerhq/errors": "^6.27.0-nightly.20251104023745",
|
|
200
|
+
"@ledgerhq/hw-app-algorand": "^6.31.9-nightly.20251104023745",
|
|
201
|
+
"@ledgerhq/hw-app-aptos": "^6.34.9-nightly.20251104023745",
|
|
202
|
+
"@ledgerhq/hw-app-btc": "^10.12.0-nightly.20251104023745",
|
|
203
|
+
"@ledgerhq/hw-app-celo": "^6.35.2-nightly.20251104023745",
|
|
204
|
+
"@ledgerhq/hw-app-cosmos": "^6.32.9-nightly.20251104023745",
|
|
205
|
+
"@ledgerhq/hw-app-eth": "^6.47.0-nightly.20251104023745",
|
|
206
|
+
"@ledgerhq/hw-app-exchange": "^0.17.0-nightly.20251104023745",
|
|
207
|
+
"@ledgerhq/hw-app-hedera": "^1.2.9-nightly.20251104023745",
|
|
208
|
+
"@ledgerhq/hw-app-icon": "^1.3.9-nightly.20251104023745",
|
|
209
|
+
"@ledgerhq/hw-app-kaspa": "^1.3.2-nightly.20251104023745",
|
|
210
|
+
"@ledgerhq/hw-app-multiversx": "^6.26.0-nightly.20251104023745",
|
|
211
|
+
"@ledgerhq/hw-app-near": "^6.31.9-nightly.20251104023745",
|
|
212
|
+
"@ledgerhq/hw-app-polkadot": "^6.34.9-nightly.20251104023745",
|
|
213
|
+
"@ledgerhq/hw-app-str": "^7.2.9-nightly.20251104023745",
|
|
214
214
|
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
215
|
-
"@ledgerhq/hw-app-tezos": "^6.31.9-nightly.
|
|
216
|
-
"@ledgerhq/hw-app-trx": "^6.31.9-nightly.
|
|
217
|
-
"@ledgerhq/hw-app-vet": "^0.7.0-nightly.
|
|
218
|
-
"@ledgerhq/hw-
|
|
219
|
-
"@ledgerhq/hw-
|
|
220
|
-
"@ledgerhq/hw-transport": "6.31.13-nightly.
|
|
221
|
-
"@ledgerhq/hw-transport-mocker": "^6.29.13-nightly.
|
|
222
|
-
"@ledgerhq/ledger-cal-service": "^1.8.0-nightly.
|
|
223
|
-
"@ledgerhq/ledger-trust-service": "^0.4.1-nightly.
|
|
215
|
+
"@ledgerhq/hw-app-tezos": "^6.31.9-nightly.20251104023745",
|
|
216
|
+
"@ledgerhq/hw-app-trx": "^6.31.9-nightly.20251104023745",
|
|
217
|
+
"@ledgerhq/hw-app-vet": "^0.7.0-nightly.20251104023745",
|
|
218
|
+
"@ledgerhq/hw-bolos": "^6.32.9-nightly.20251104023745",
|
|
219
|
+
"@ledgerhq/hw-app-xrp": "^6.32.7-nightly.20251104023745",
|
|
220
|
+
"@ledgerhq/hw-transport": "6.31.13-nightly.20251104023745",
|
|
221
|
+
"@ledgerhq/hw-transport-mocker": "^6.29.13-nightly.20251104023745",
|
|
222
|
+
"@ledgerhq/ledger-cal-service": "^1.8.0-nightly.20251104023745",
|
|
223
|
+
"@ledgerhq/ledger-trust-service": "^0.4.1-nightly.20251104023745",
|
|
224
|
+
"@ledgerhq/live-countervalues": "^0.9.0-nightly.20251104023745",
|
|
224
225
|
"@ledgerhq/live-config": "^3.2.0",
|
|
225
|
-
"@ledgerhq/live-countervalues": "^0.
|
|
226
|
-
"@ledgerhq/live-
|
|
227
|
-
"@ledgerhq/live-dmk-shared": "^0.15.0-nightly.20251031094135",
|
|
228
|
-
"@ledgerhq/live-env": "^2.20.0-nightly.20251031094135",
|
|
226
|
+
"@ledgerhq/live-countervalues-react": "^0.7.1-nightly.20251104023745",
|
|
227
|
+
"@ledgerhq/live-dmk-shared": "^0.15.0-nightly.20251104023745",
|
|
229
228
|
"@ledgerhq/live-hooks": "0.2.0",
|
|
230
|
-
"@ledgerhq/live-
|
|
229
|
+
"@ledgerhq/live-env": "^2.20.0-nightly.20251104023745",
|
|
230
|
+
"@ledgerhq/live-network": "^2.1.0-nightly.20251104023745",
|
|
231
231
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
232
|
-
"@ledgerhq/live-signer-
|
|
233
|
-
"@ledgerhq/live-signer-
|
|
234
|
-
"@ledgerhq/live-signer-solana": "^0.6.0-nightly.
|
|
235
|
-
"@ledgerhq/live-wallet": "^0.15.0-nightly.
|
|
232
|
+
"@ledgerhq/live-signer-evm": "^0.10.0-nightly.20251104023745",
|
|
233
|
+
"@ledgerhq/live-signer-canton": "^0.5.0-nightly.20251104023745",
|
|
234
|
+
"@ledgerhq/live-signer-solana": "^0.6.0-nightly.20251104023745",
|
|
235
|
+
"@ledgerhq/live-wallet": "^0.15.0-nightly.20251104023745",
|
|
236
236
|
"@ledgerhq/logs": "^6.13.0",
|
|
237
|
-
"@ledgerhq/speculos-transport": "^0.2.14-nightly.
|
|
238
|
-
"@ledgerhq/wallet-api-acre-module": "^0.9.0-nightly.
|
|
239
|
-
"@ledgerhq/wallet-api-exchange-module": "^0.18.0-nightly.
|
|
237
|
+
"@ledgerhq/speculos-transport": "^0.2.14-nightly.20251104023745",
|
|
238
|
+
"@ledgerhq/wallet-api-acre-module": "^0.9.0-nightly.20251104023745",
|
|
239
|
+
"@ledgerhq/wallet-api-exchange-module": "^0.18.0-nightly.20251104023745"
|
|
240
240
|
},
|
|
241
241
|
"devDependencies": {
|
|
242
242
|
"@solana/web3.js": "1.95.4",
|
|
@@ -284,10 +284,10 @@
|
|
|
284
284
|
"undici": "6.19.2",
|
|
285
285
|
"uuid": "^8.3.2",
|
|
286
286
|
"ws": "7",
|
|
287
|
-
"@ledgerhq/device-react": "^0.3.1-nightly.
|
|
288
|
-
"@ledgerhq/types-cryptoassets": "^7.30.0-nightly.
|
|
287
|
+
"@ledgerhq/device-react": "^0.3.1-nightly.20251104023745",
|
|
288
|
+
"@ledgerhq/types-cryptoassets": "^7.30.0-nightly.20251104023745",
|
|
289
289
|
"@ledgerhq/types-devices": "^6.27.0",
|
|
290
|
-
"@ledgerhq/types-live": "^6.88.0-nightly.
|
|
290
|
+
"@ledgerhq/types-live": "^6.88.0-nightly.20251104023745"
|
|
291
291
|
},
|
|
292
292
|
"scripts": {
|
|
293
293
|
"build": "zx ./scripts/build-ts.mjs",
|
package/src/DataModel.test.ts
CHANGED
|
@@ -68,6 +68,7 @@ describe("DataModel", () => {
|
|
|
68
68
|
setCryptoAssetsStoreForCoinFramework({
|
|
69
69
|
findTokenById: (_: string) => undefined,
|
|
70
70
|
findTokenByAddressInCurrency: (_: string, __: string) => undefined,
|
|
71
|
+
getTokensSyncHash: (_: string) => Promise.resolve("test_hash"),
|
|
71
72
|
} as CryptoAssetsStore);
|
|
72
73
|
|
|
73
74
|
test("createDataModel for crypto.org account", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
|
2
|
-
import
|
|
2
|
+
import { legacyCryptoAssetsStore } from "@ledgerhq/cryptoassets/tokens";
|
|
3
3
|
import "./environment";
|
|
4
4
|
import BigNumber from "bignumber.js";
|
|
5
5
|
|
|
@@ -14,8 +14,5 @@ expect.extend({
|
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
//
|
|
18
|
-
setCryptoAssetsStoreForCoinFramework(
|
|
19
|
-
findTokenById: (_: string) => undefined,
|
|
20
|
-
findTokenByAddressInCurrency: (_: string, __: string) => undefined,
|
|
21
|
-
} as CryptoAssetsStore);
|
|
17
|
+
// Use legacyCryptoAssetsStore for integration tests so tokens can be found
|
|
18
|
+
setCryptoAssetsStoreForCoinFramework(legacyCryptoAssetsStore);
|
package/src/apps/config.ts
CHANGED
|
@@ -119,9 +119,11 @@ export const genericSignOperation =
|
|
|
119
119
|
// Enrich with memo and asset information
|
|
120
120
|
transactionIntent = enrichTransactionIntent(transactionIntent, transaction, publicKey);
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
if (typeof transactionIntent.sequence !== "number") {
|
|
123
|
+
// TODO: should compute it and pass it down to craftTransaction (duplicate call right now)
|
|
124
|
+
const sequenceNumber = await alpacaApi.getSequence(transactionIntent.sender);
|
|
125
|
+
transactionIntent.sequence = sequenceNumber;
|
|
126
|
+
}
|
|
125
127
|
|
|
126
128
|
/* Craft unsigned blob via Alpaca */
|
|
127
129
|
const { transaction: unsigned } = await alpacaApi.craftTransaction(transactionIntent, {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
Operation,
|
|
3
|
+
OperationRaw,
|
|
4
|
+
TransactionCommon,
|
|
5
|
+
TransactionCommonRaw,
|
|
6
|
+
} from "@ledgerhq/types-live";
|
|
2
7
|
import BigNumber from "bignumber.js";
|
|
3
8
|
import type { Unit } from "@ledgerhq/types-cryptoassets";
|
|
4
9
|
|
|
@@ -6,6 +11,34 @@ type NetworkInfo = {
|
|
|
6
11
|
fees: BigNumber;
|
|
7
12
|
};
|
|
8
13
|
|
|
14
|
+
type NetworkInfoRaw = {
|
|
15
|
+
fees: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type Strategy = "slow" | "medium" | "fast";
|
|
19
|
+
|
|
20
|
+
export type FeeData = {
|
|
21
|
+
maxFeePerGas: BigNumber | null;
|
|
22
|
+
maxPriorityFeePerGas: BigNumber | null;
|
|
23
|
+
gasPrice: BigNumber | null;
|
|
24
|
+
nextBaseFee: BigNumber | null;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type FeeDataRaw = {
|
|
28
|
+
maxFeePerGas: string | null;
|
|
29
|
+
maxPriorityFeePerGas: string | null;
|
|
30
|
+
gasPrice: string | null;
|
|
31
|
+
nextBaseFee: string | null;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type GasOptions = {
|
|
35
|
+
[key in Strategy]: FeeData;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type GasOptionsRaw = {
|
|
39
|
+
[key in Strategy]: FeeDataRaw;
|
|
40
|
+
};
|
|
41
|
+
|
|
9
42
|
export type GenericTransaction = TransactionCommon & {
|
|
10
43
|
family: string;
|
|
11
44
|
fees?: BigNumber | null;
|
|
@@ -14,6 +47,7 @@ export type GenericTransaction = TransactionCommon & {
|
|
|
14
47
|
parameters: { fees?: BigNumber | null };
|
|
15
48
|
};
|
|
16
49
|
tag?: number | null | undefined;
|
|
50
|
+
nonce?: number | null | undefined;
|
|
17
51
|
feeCustomUnit?: Unit | null | undefined;
|
|
18
52
|
memoType?: string | null;
|
|
19
53
|
memoValue?: string | null;
|
|
@@ -31,13 +65,52 @@ export type GenericTransaction = TransactionCommon & {
|
|
|
31
65
|
assetReference?: string;
|
|
32
66
|
assetOwner?: string;
|
|
33
67
|
networkInfo?: NetworkInfo | null;
|
|
34
|
-
chainId?: number;
|
|
68
|
+
chainId?: number | null;
|
|
35
69
|
gasLimit?: BigNumber | null;
|
|
36
70
|
gasPrice?: BigNumber | null;
|
|
37
71
|
maxFeePerGas?: BigNumber | null;
|
|
38
72
|
maxPriorityFeePerGas?: BigNumber | null;
|
|
73
|
+
gasOptions?: GasOptions;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type GenericTransactionRaw = TransactionCommonRaw & {
|
|
77
|
+
family: string;
|
|
78
|
+
fees?: string | null;
|
|
79
|
+
storageLimit?: string | null;
|
|
80
|
+
customFees?: {
|
|
81
|
+
parameters: { fees?: string | null };
|
|
82
|
+
};
|
|
83
|
+
tag?: number | null | undefined;
|
|
84
|
+
nonce?: number | null | undefined;
|
|
85
|
+
feeCustomUnit?: Unit | null | undefined;
|
|
86
|
+
memoType?: string | null;
|
|
87
|
+
memoValue?: string | null;
|
|
88
|
+
data?: string;
|
|
89
|
+
mode?:
|
|
90
|
+
| "send"
|
|
91
|
+
| "changeTrust"
|
|
92
|
+
| "send-legacy"
|
|
93
|
+
| "send-eip1559"
|
|
94
|
+
| "delegate"
|
|
95
|
+
| "stake"
|
|
96
|
+
| "undelegate"
|
|
97
|
+
| "unstake";
|
|
98
|
+
type?: number | null;
|
|
99
|
+
assetReference?: string | null;
|
|
100
|
+
assetOwner?: string | null;
|
|
101
|
+
networkInfo?: NetworkInfoRaw | null;
|
|
102
|
+
chainId?: number | null;
|
|
103
|
+
gasLimit?: string | null;
|
|
104
|
+
gasPrice?: string | null;
|
|
105
|
+
maxFeePerGas?: string | null;
|
|
106
|
+
maxPriorityFeePerGas?: string | null;
|
|
107
|
+
gasOptions?: GasOptionsRaw;
|
|
39
108
|
};
|
|
40
109
|
|
|
41
110
|
export interface OperationCommon extends Operation {
|
|
42
111
|
extra: Record<string, any>;
|
|
43
112
|
}
|
|
113
|
+
|
|
114
|
+
export interface OperationCommonRaw extends OperationRaw {
|
|
115
|
+
extra: Record<string, any>;
|
|
116
|
+
}
|
|
@@ -22,6 +22,7 @@ describe("Alpaca utils", () => {
|
|
|
22
22
|
parentType: "OPT_IN",
|
|
23
23
|
subType: undefined,
|
|
24
24
|
parentValue: new BigNumber(50),
|
|
25
|
+
parentRecipient: "recipient-address",
|
|
25
26
|
},
|
|
26
27
|
],
|
|
27
28
|
[
|
|
@@ -32,6 +33,7 @@ describe("Alpaca utils", () => {
|
|
|
32
33
|
parentType: "DELEGATE",
|
|
33
34
|
subType: undefined,
|
|
34
35
|
parentValue: new BigNumber(50),
|
|
36
|
+
parentRecipient: "recipient-address",
|
|
35
37
|
},
|
|
36
38
|
],
|
|
37
39
|
[
|
|
@@ -42,6 +44,7 @@ describe("Alpaca utils", () => {
|
|
|
42
44
|
parentType: "DELEGATE",
|
|
43
45
|
subType: undefined,
|
|
44
46
|
parentValue: new BigNumber(50),
|
|
47
|
+
parentRecipient: "recipient-address",
|
|
45
48
|
},
|
|
46
49
|
],
|
|
47
50
|
[
|
|
@@ -52,6 +55,7 @@ describe("Alpaca utils", () => {
|
|
|
52
55
|
parentType: "UNDELEGATE",
|
|
53
56
|
subType: undefined,
|
|
54
57
|
parentValue: new BigNumber(50),
|
|
58
|
+
parentRecipient: "recipient-address",
|
|
55
59
|
},
|
|
56
60
|
],
|
|
57
61
|
[
|
|
@@ -62,6 +66,7 @@ describe("Alpaca utils", () => {
|
|
|
62
66
|
parentType: "UNDELEGATE",
|
|
63
67
|
subType: undefined,
|
|
64
68
|
parentValue: new BigNumber(50),
|
|
69
|
+
parentRecipient: "recipient-address",
|
|
65
70
|
},
|
|
66
71
|
],
|
|
67
72
|
[
|
|
@@ -72,6 +77,7 @@ describe("Alpaca utils", () => {
|
|
|
72
77
|
parentType: "OUT",
|
|
73
78
|
subType: undefined,
|
|
74
79
|
parentValue: new BigNumber(50),
|
|
80
|
+
parentRecipient: "recipient-address",
|
|
75
81
|
},
|
|
76
82
|
],
|
|
77
83
|
[
|
|
@@ -82,6 +88,7 @@ describe("Alpaca utils", () => {
|
|
|
82
88
|
parentType: "FEES",
|
|
83
89
|
subType: "OPT_IN",
|
|
84
90
|
parentValue: new BigNumber(12),
|
|
91
|
+
parentRecipient: "contract-address",
|
|
85
92
|
},
|
|
86
93
|
],
|
|
87
94
|
[
|
|
@@ -92,6 +99,7 @@ describe("Alpaca utils", () => {
|
|
|
92
99
|
parentType: "FEES",
|
|
93
100
|
subType: "DELEGATE",
|
|
94
101
|
parentValue: new BigNumber(12),
|
|
102
|
+
parentRecipient: "contract-address",
|
|
95
103
|
},
|
|
96
104
|
],
|
|
97
105
|
[
|
|
@@ -102,6 +110,7 @@ describe("Alpaca utils", () => {
|
|
|
102
110
|
parentType: "FEES",
|
|
103
111
|
subType: "DELEGATE",
|
|
104
112
|
parentValue: new BigNumber(12),
|
|
113
|
+
parentRecipient: "contract-address",
|
|
105
114
|
},
|
|
106
115
|
],
|
|
107
116
|
[
|
|
@@ -112,6 +121,7 @@ describe("Alpaca utils", () => {
|
|
|
112
121
|
parentType: "FEES",
|
|
113
122
|
subType: "UNDELEGATE",
|
|
114
123
|
parentValue: new BigNumber(12),
|
|
124
|
+
parentRecipient: "contract-address",
|
|
115
125
|
},
|
|
116
126
|
],
|
|
117
127
|
[
|
|
@@ -122,20 +132,26 @@ describe("Alpaca utils", () => {
|
|
|
122
132
|
parentType: "FEES",
|
|
123
133
|
subType: "UNDELEGATE",
|
|
124
134
|
parentValue: new BigNumber(12),
|
|
135
|
+
parentRecipient: "contract-address",
|
|
125
136
|
},
|
|
126
137
|
],
|
|
127
138
|
[
|
|
128
139
|
"token",
|
|
129
140
|
"send",
|
|
130
141
|
{ subAccountId: "sub-account-id" },
|
|
131
|
-
{
|
|
142
|
+
{
|
|
143
|
+
parentType: "FEES",
|
|
144
|
+
subType: "OUT",
|
|
145
|
+
parentValue: new BigNumber(12),
|
|
146
|
+
parentRecipient: "contract-address",
|
|
147
|
+
},
|
|
132
148
|
],
|
|
133
149
|
])("builds an optimistic %s operation with %s mode ", (_s, mode, params, expected) => {
|
|
134
150
|
const operation = buildOptimisticOperation(
|
|
135
151
|
{
|
|
136
152
|
id: "parent-account-id",
|
|
137
153
|
freshAddress: "account-address",
|
|
138
|
-
subAccounts: [{ id: "sub-account-id" }],
|
|
154
|
+
subAccounts: [{ id: "sub-account-id", token: { contractAddress: "contract-address" } }],
|
|
139
155
|
} as Account,
|
|
140
156
|
{
|
|
141
157
|
mode,
|
|
@@ -156,6 +172,11 @@ describe("Alpaca utils", () => {
|
|
|
156
172
|
fee: new BigNumber(12),
|
|
157
173
|
blockHash: null,
|
|
158
174
|
blockHeight: null,
|
|
175
|
+
transactionRaw: {
|
|
176
|
+
amount: expected.subType ? "0" : expected.parentValue.toFixed(),
|
|
177
|
+
fees: "12",
|
|
178
|
+
recipient: expected.parentRecipient,
|
|
179
|
+
},
|
|
159
180
|
...(expected.subType
|
|
160
181
|
? {
|
|
161
182
|
subOperations: [
|
|
@@ -168,6 +189,11 @@ describe("Alpaca utils", () => {
|
|
|
168
189
|
value: new BigNumber(50),
|
|
169
190
|
blockHash: null,
|
|
170
191
|
blockHeight: null,
|
|
192
|
+
transactionRaw: {
|
|
193
|
+
amount: "50",
|
|
194
|
+
fees: "12",
|
|
195
|
+
recipient: "recipient-address",
|
|
196
|
+
},
|
|
171
197
|
},
|
|
172
198
|
],
|
|
173
199
|
}
|