@ledgerhq/coin-casper 2.2.1-nightly.0 → 2.3.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +23 -0
- package/lib/bridge/deviceTransactionConfig.d.ts +1 -1
- package/lib/bridge/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/bridge/deviceTransactionConfig.js +1 -1
- package/lib/bridge/deviceTransactionConfig.js.map +1 -1
- package/lib-es/bridge/deviceTransactionConfig.d.ts +1 -1
- package/lib-es/bridge/deviceTransactionConfig.d.ts.map +1 -1
- package/lib-es/bridge/deviceTransactionConfig.js +1 -1
- package/lib-es/bridge/deviceTransactionConfig.js.map +1 -1
- package/package.json +7 -7
- package/src/bridge/deviceTransactionConfig.test.ts +13 -13
- package/src/bridge/deviceTransactionConfig.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/coin-casper@2.2.
|
|
2
|
+
> @ledgerhq/coin-casper@2.2.1-nightly.1 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-casper
|
|
3
3
|
> tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @ledgerhq/coin-casper
|
|
2
2
|
|
|
3
|
+
## 2.3.0-nightly.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#12321](https://github.com/LedgerHQ/ledger-live/pull/12321) [`63e8f34`](https://github.com/LedgerHQ/ledger-live/commit/63e8f342f6b951ab77bb710b9971f033c05e579e) Thanks [@mcayuelas-ledger](https://github.com/mcayuelas-ledger)! - Bump axios version to 1.12.2
|
|
8
|
+
|
|
9
|
+
- [#12340](https://github.com/LedgerHQ/ledger-live/pull/12340) [`8d7c1f7`](https://github.com/LedgerHQ/ledger-live/commit/8d7c1f7a92489647399b0e780d4bb926508e8554) Thanks [@gre-ledger](https://github.com/gre-ledger)! - migrate getDeviceTransactionConfig to async
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`63e8f34`](https://github.com/LedgerHQ/ledger-live/commit/63e8f342f6b951ab77bb710b9971f033c05e579e), [`3d4188a`](https://github.com/LedgerHQ/ledger-live/commit/3d4188a26021d33b950129d82cb55d2c2e8d4358)]:
|
|
14
|
+
- @ledgerhq/cryptoassets@13.32.0-nightly.1
|
|
15
|
+
- @ledgerhq/coin-framework@6.8.0-nightly.2
|
|
16
|
+
- @ledgerhq/live-network@2.1.0-nightly.0
|
|
17
|
+
- @ledgerhq/types-live@6.88.0-nightly.1
|
|
18
|
+
|
|
19
|
+
## 2.2.1-nightly.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`a731c4c`](https://github.com/LedgerHQ/ledger-live/commit/a731c4cd492a968eb7baa981fdd8aaddedd21f25)]:
|
|
24
|
+
- @ledgerhq/coin-framework@6.8.0-nightly.1
|
|
25
|
+
|
|
3
26
|
## 2.2.1-nightly.0
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -13,6 +13,6 @@ declare function getDeviceTransactionConfig({ transaction, }: {
|
|
|
13
13
|
parentAccount: Account | null | undefined;
|
|
14
14
|
transaction: Transaction;
|
|
15
15
|
status: TransactionStatus;
|
|
16
|
-
}): Array<DeviceTransactionField
|
|
16
|
+
}): Promise<Array<DeviceTransactionField>>;
|
|
17
17
|
export default getDeviceTransactionConfig;
|
|
18
18
|
//# sourceMappingURL=deviceTransactionConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceTransactionConfig.d.ts","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,O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CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const logs_1 = require("@ledgerhq/logs");
|
|
4
4
|
const common_logic_1 = require("../common-logic");
|
|
5
5
|
const consts_1 = require("../consts");
|
|
6
|
-
function getDeviceTransactionConfig({ transaction, }) {
|
|
6
|
+
async function getDeviceTransactionConfig({ transaction, }) {
|
|
7
7
|
const fields = [];
|
|
8
8
|
fields.push({
|
|
9
9
|
type: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceTransactionConfig.js","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":";;AAAA,yCAAqC;AAIrC,kDAAiD;AAEjD,sCAA2C;AAU3C,
|
|
1
|
+
{"version":3,"file":"deviceTransactionConfig.js","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":";;AAAA,yCAAqC;AAIrC,kDAAiD;AAEjD,sCAA2C;AAU3C,KAAK,UAAU,0BAA0B,CAAC,EACxC,WAAW,GAMZ;IACC,MAAM,MAAM,GAAkC,EAAE,CAAC;IACjD,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,IAAA,6BAAc,EAAC,CAAC,CAAC;KACzB,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,uBAAc;KACtB,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE,uBAAuB;QAC7B,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,WAAW,CAAC,IAAI;KACxB,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE,uBAAuB;QAC7B,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,WAAW,CAAC,MAAM;KAC1B,CAAC,CAAC;IAEH,IAAI,WAAW,CAAC,UAAU,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE,WAAW,CAAC,UAAU;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,IAAA,UAAG,EAAC,OAAO,EAAE,sBAAsB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAE7D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,kBAAe,0BAA0B,CAAC"}
|
|
@@ -13,6 +13,6 @@ declare function getDeviceTransactionConfig({ transaction, }: {
|
|
|
13
13
|
parentAccount: Account | null | undefined;
|
|
14
14
|
transaction: Transaction;
|
|
15
15
|
status: TransactionStatus;
|
|
16
|
-
}): Array<DeviceTransactionField
|
|
16
|
+
}): Promise<Array<DeviceTransactionField>>;
|
|
17
17
|
export default getDeviceTransactionConfig;
|
|
18
18
|
//# sourceMappingURL=deviceTransactionConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceTransactionConfig.d.ts","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AAEF,KAAK,sBAAsB,GAAG,4BAA4B,GAAG,2BAA2B,CAAC;AAEzF,
|
|
1
|
+
{"version":3,"file":"deviceTransactionConfig.d.ts","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AAEF,KAAK,sBAAsB,GAAG,4BAA4B,GAAG,2BAA2B,CAAC;AAEzF,iBAAe,0BAA0B,CAAC,EACxC,WAAW,GACZ,EAAE;IACD,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAkCzC;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { log } from "@ledgerhq/logs";
|
|
2
2
|
import { methodToString } from "../common-logic";
|
|
3
3
|
import { CASPER_NETWORK } from "../consts";
|
|
4
|
-
function getDeviceTransactionConfig({ transaction, }) {
|
|
4
|
+
async function getDeviceTransactionConfig({ transaction, }) {
|
|
5
5
|
const fields = [];
|
|
6
6
|
fields.push({
|
|
7
7
|
type: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceTransactionConfig.js","sourceRoot":"","sources":["../../src/bridge/deviceTransactionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAIrC,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,CAAC;IAE7D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,eAAe,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-casper",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-nightly.2",
|
|
4
4
|
"description": "Ledger Casper integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -98,24 +98,24 @@
|
|
|
98
98
|
"invariant": "^2.2.2",
|
|
99
99
|
"lodash": "^4.17.21",
|
|
100
100
|
"rxjs": "^7.8.1",
|
|
101
|
-
"@ledgerhq/coin-framework": "^6.
|
|
102
|
-
"@ledgerhq/cryptoassets": "^13.
|
|
101
|
+
"@ledgerhq/coin-framework": "^6.8.0-nightly.2",
|
|
102
|
+
"@ledgerhq/cryptoassets": "^13.32.0-nightly.1",
|
|
103
103
|
"@ledgerhq/devices": "8.6.2-nightly.0",
|
|
104
104
|
"@ledgerhq/errors": "^6.27.0-nightly.0",
|
|
105
|
-
"@ledgerhq/live-network": "^2.0.
|
|
105
|
+
"@ledgerhq/live-network": "^2.1.0-nightly.0",
|
|
106
106
|
"@ledgerhq/logs": "^6.13.0",
|
|
107
|
-
"@ledgerhq/types-live": "^6.88.0-nightly.
|
|
107
|
+
"@ledgerhq/types-live": "^6.88.0-nightly.1"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@types/invariant": "^2.2.2",
|
|
111
111
|
"@types/jest": "^29.5.10",
|
|
112
112
|
"@types/lodash": "^4.14.191",
|
|
113
113
|
"@types/semver": "^7.5.8",
|
|
114
|
-
"axios": "1.
|
|
114
|
+
"axios": "1.12.2",
|
|
115
115
|
"expect": "^27.4.6",
|
|
116
116
|
"jest": "^29.7.0",
|
|
117
117
|
"ts-jest": "^29.1.1",
|
|
118
|
-
"@ledgerhq/disable-network-setup": "^0.0.0",
|
|
118
|
+
"@ledgerhq/disable-network-setup": "^0.1.0-nightly.0",
|
|
119
119
|
"@ledgerhq/types-cryptoassets": "^7.29.0"
|
|
120
120
|
},
|
|
121
121
|
"scripts": {
|
|
@@ -35,8 +35,8 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
35
35
|
/**
|
|
36
36
|
* Helper to get config fields
|
|
37
37
|
*/
|
|
38
|
-
const getConfigFields = (transaction: Transaction, account = createMockAccount()) =>
|
|
39
|
-
getDeviceTransactionConfig({
|
|
38
|
+
const getConfigFields = async (transaction: Transaction, account = createMockAccount()) =>
|
|
39
|
+
await getDeviceTransactionConfig({
|
|
40
40
|
account,
|
|
41
41
|
parentAccount: null,
|
|
42
42
|
transaction,
|
|
@@ -47,14 +47,14 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
47
47
|
jest.clearAllMocks();
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
test("should display chain ID, transaction type and amount fields for standard transactions", () => {
|
|
50
|
+
test("should display chain ID, transaction type and amount fields for standard transactions", async () => {
|
|
51
51
|
// Create mock transaction
|
|
52
52
|
const mockTransaction = createMockTransaction({
|
|
53
53
|
amount: MOCK_AMOUNT,
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
// Get display fields
|
|
57
|
-
const fields = getConfigFields(mockTransaction);
|
|
57
|
+
const fields = await getConfigFields(mockTransaction);
|
|
58
58
|
|
|
59
59
|
// Verify the results
|
|
60
60
|
expect(fields).toHaveLength(4);
|
|
@@ -90,7 +90,7 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
90
90
|
expect(log).toHaveBeenCalledWith("debug", expect.stringContaining("Transaction config"));
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
test("should include transferId field when provided in transaction", () => {
|
|
93
|
+
test("should include transferId field when provided in transaction", async () => {
|
|
94
94
|
// Create mock transaction with transferId
|
|
95
95
|
const mockTransaction = createMockTransaction({
|
|
96
96
|
amount: MOCK_AMOUNT,
|
|
@@ -98,7 +98,7 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
// Get display fields
|
|
101
|
-
const fields = getConfigFields(mockTransaction);
|
|
101
|
+
const fields = await getConfigFields(mockTransaction);
|
|
102
102
|
|
|
103
103
|
// Verify the results
|
|
104
104
|
expect(fields).toHaveLength(5); // Chain ID, Type, Amount, Transfer ID fields
|
|
@@ -115,7 +115,7 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
test("should not include transferId field when undefined in transaction", () => {
|
|
118
|
+
test("should not include transferId field when undefined in transaction", async () => {
|
|
119
119
|
// Create mock transaction with explicitly undefined transferId
|
|
120
120
|
const mockTransaction = createMockTransaction({
|
|
121
121
|
amount: MOCK_AMOUNT,
|
|
@@ -123,21 +123,21 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
// Get display fields
|
|
126
|
-
const fields = getConfigFields(mockTransaction);
|
|
126
|
+
const fields = await getConfigFields(mockTransaction);
|
|
127
127
|
|
|
128
128
|
// Verify no transferId field is present
|
|
129
129
|
expect(fields).toHaveLength(4);
|
|
130
130
|
expect(fields.map(field => field.label)).not.toContain("Transfer ID");
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
test("should handle zero amount transactions correctly", () => {
|
|
133
|
+
test("should handle zero amount transactions correctly", async () => {
|
|
134
134
|
// Create mock transaction with zero amount
|
|
135
135
|
const mockTransaction = createMockTransaction({
|
|
136
136
|
amount: new BigNumber(0),
|
|
137
137
|
});
|
|
138
138
|
|
|
139
139
|
// Get display fields
|
|
140
|
-
const fields = getConfigFields(mockTransaction);
|
|
140
|
+
const fields = await getConfigFields(mockTransaction);
|
|
141
141
|
|
|
142
142
|
// Verify amount field has zero value
|
|
143
143
|
const amountField = fields.find(field => field.label === "Amount");
|
|
@@ -149,7 +149,7 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
149
149
|
});
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
test("should maintain consistent order of fields regardless of transaction properties", () => {
|
|
152
|
+
test("should maintain consistent order of fields regardless of transaction properties", async () => {
|
|
153
153
|
// Create two transactions - one with transferId, one without
|
|
154
154
|
const txWithTransferId = createMockTransaction({
|
|
155
155
|
amount: MOCK_AMOUNT,
|
|
@@ -160,8 +160,8 @@ describe("getDeviceTransactionConfig", () => {
|
|
|
160
160
|
amount: MOCK_AMOUNT,
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
const fieldsWithId = getConfigFields(txWithTransferId);
|
|
164
|
-
const fieldsWithoutId = getConfigFields(txWithoutTransferId);
|
|
163
|
+
const fieldsWithId = await getConfigFields(txWithTransferId);
|
|
164
|
+
const fieldsWithoutId = await getConfigFields(txWithoutTransferId);
|
|
165
165
|
|
|
166
166
|
// Verify field order consistency for common fields
|
|
167
167
|
for (let i = 0; i < fieldsWithoutId.length; i++) {
|
|
@@ -14,14 +14,14 @@ export type ExtraDeviceTransactionField = {
|
|
|
14
14
|
|
|
15
15
|
type DeviceTransactionField = CommonDeviceTransactionField | ExtraDeviceTransactionField;
|
|
16
16
|
|
|
17
|
-
function getDeviceTransactionConfig({
|
|
17
|
+
async function getDeviceTransactionConfig({
|
|
18
18
|
transaction,
|
|
19
19
|
}: {
|
|
20
20
|
account: AccountLike;
|
|
21
21
|
parentAccount: Account | null | undefined;
|
|
22
22
|
transaction: Transaction;
|
|
23
23
|
status: TransactionStatus;
|
|
24
|
-
}): Array<DeviceTransactionField
|
|
24
|
+
}): Promise<Array<DeviceTransactionField>> {
|
|
25
25
|
const fields: Array<DeviceTransactionField> = [];
|
|
26
26
|
fields.push({
|
|
27
27
|
type: "text",
|