@onekeyfe/hd-core 0.2.18 → 0.2.19
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/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -1
- package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -1
- package/dist/types/api/filecoinGetAddress.d.ts +1 -0
- package/dist/types/api/filecoinGetAddress.d.ts.map +1 -1
- package/dist/types/api/filecoinSignTransaction.d.ts +1 -0
- package/dist/types/api/filecoinSignTransaction.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/filecoin/FilecoinGetAddress.ts +2 -0
- package/src/api/filecoin/FilecoinSignTransaction.ts +3 -1
- package/src/data/messages/messages.json +8 -0
- package/src/types/api/filecoinGetAddress.ts +1 -0
- package/src/types/api/filecoinSignTransaction.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilecoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/filecoin/FilecoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,aAAa,CAAC;AAExE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;
|
|
1
|
+
{"version":3,"file":"FilecoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/filecoin/FilecoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,aAAa,CAAC;AAExE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IA+BJ,eAAe;;;;;;;;IAWT,GAAG;CAoBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilecoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/filecoin/FilecoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IACrF,SAAS,UAAS;IAElB,IAAI;
|
|
1
|
+
{"version":3,"file":"FilecoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/filecoin/FilecoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IACrF,SAAS,UAAS;IAElB,IAAI;IAsBJ,eAAe;;;;;;;;IAWT,GAAG;;;;CAYV"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1427,6 +1427,7 @@ declare type FilecoinAddress = {
|
|
|
1427
1427
|
declare type FilecoinGetAddressParams = {
|
|
1428
1428
|
path: string | number[];
|
|
1429
1429
|
showOnOneKey?: boolean;
|
|
1430
|
+
isTestnet?: boolean;
|
|
1430
1431
|
};
|
|
1431
1432
|
declare function filecoinGetAddress(connectId: string, deviceId: string, params: CommonParams & FilecoinGetAddressParams): Response<FilecoinAddress>;
|
|
1432
1433
|
declare function filecoinGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
@@ -1439,6 +1440,7 @@ declare type FilecoinSignedTx = {
|
|
|
1439
1440
|
declare type FilecoinSignTransactionParams = {
|
|
1440
1441
|
path: string | number[];
|
|
1441
1442
|
rawTx?: string;
|
|
1443
|
+
isTestnet?: boolean;
|
|
1442
1444
|
};
|
|
1443
1445
|
declare function filecoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & FilecoinSignTransactionParams): Response<FilecoinSignedTx>;
|
|
1444
1446
|
declare function filecoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & {
|
package/dist/index.js
CHANGED
|
@@ -5310,6 +5310,10 @@ var nested = {
|
|
|
5310
5310
|
show_display: {
|
|
5311
5311
|
type: "bool",
|
|
5312
5312
|
id: 2
|
|
5313
|
+
},
|
|
5314
|
+
testnet: {
|
|
5315
|
+
type: "bool",
|
|
5316
|
+
id: 3
|
|
5313
5317
|
}
|
|
5314
5318
|
}
|
|
5315
5319
|
},
|
|
@@ -5335,6 +5339,10 @@ var nested = {
|
|
|
5335
5339
|
rule: "required",
|
|
5336
5340
|
type: "bytes",
|
|
5337
5341
|
id: 2
|
|
5342
|
+
},
|
|
5343
|
+
testnet: {
|
|
5344
|
+
type: "bool",
|
|
5345
|
+
id: 3
|
|
5338
5346
|
}
|
|
5339
5347
|
}
|
|
5340
5348
|
},
|
|
@@ -17691,11 +17699,13 @@ class FilecoinGetAddress extends BaseMethod {
|
|
|
17691
17699
|
validateParams(batch, [
|
|
17692
17700
|
{ name: 'path', required: true },
|
|
17693
17701
|
{ name: 'showOnOneKey', type: 'boolean' },
|
|
17702
|
+
{ name: 'isTestnet', type: 'boolean' },
|
|
17694
17703
|
]);
|
|
17695
17704
|
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
17696
17705
|
this.params.push({
|
|
17697
17706
|
address_n: addressN,
|
|
17698
17707
|
show_display: showOnOneKey,
|
|
17708
|
+
testnet: batch.isTestnet,
|
|
17699
17709
|
});
|
|
17700
17710
|
});
|
|
17701
17711
|
}
|
|
@@ -17737,12 +17747,14 @@ class FilecoinSignTransaction extends BaseMethod {
|
|
|
17737
17747
|
validateParams(this.payload, [
|
|
17738
17748
|
{ name: 'path', required: true },
|
|
17739
17749
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
17750
|
+
{ name: 'isTestnet', type: 'boolean' },
|
|
17740
17751
|
]);
|
|
17741
|
-
const { path, rawTx } = this.payload;
|
|
17752
|
+
const { path, rawTx, isTestnet } = this.payload;
|
|
17742
17753
|
const addressN = validatePath(path, 3);
|
|
17743
17754
|
this.params = {
|
|
17744
17755
|
address_n: addressN,
|
|
17745
17756
|
raw_tx: formatAnyHex(rawTx),
|
|
17757
|
+
testnet: isTestnet,
|
|
17746
17758
|
};
|
|
17747
17759
|
}
|
|
17748
17760
|
getVersionRange() {
|
|
@@ -6,6 +6,7 @@ export declare type FilecoinAddress = {
|
|
|
6
6
|
export declare type FilecoinGetAddressParams = {
|
|
7
7
|
path: string | number[];
|
|
8
8
|
showOnOneKey?: boolean;
|
|
9
|
+
isTestnet?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare function filecoinGetAddress(connectId: string, deviceId: string, params: CommonParams & FilecoinGetAddressParams): Response<FilecoinAddress>;
|
|
11
12
|
export declare function filecoinGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filecoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/types/api/filecoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,uBAAuB,CAAC;AAE5B,oBAAY,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"filecoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/types/api/filecoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,uBAAuB,CAAC;AAE5B,oBAAY,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,wBAAwB,GAC9C,QAAQ,CAAC,eAAe,CAAC,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,wBAAwB,EAAE,CAAA;CAAE,GAC7D,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare type FilecoinSignedTx = {
|
|
|
6
6
|
export declare type FilecoinSignTransactionParams = {
|
|
7
7
|
path: string | number[];
|
|
8
8
|
rawTx?: string;
|
|
9
|
+
isTestnet?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare function filecoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & FilecoinSignTransactionParams): Response<FilecoinSignedTx>;
|
|
11
12
|
export declare function filecoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filecoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/types/api/filecoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,wBAAwB,CAAC;AAE7B,oBAAY,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"filecoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/types/api/filecoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,wBAAwB,CAAC;AAE7B,oBAAY,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,6BAA6B,GACnD,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,6BAA6B,EAAE,CAAA;CAAE,GAClE,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@onekeyfe/hd-shared": "^0.2.
|
|
28
|
-
"@onekeyfe/hd-transport": "^0.2.
|
|
27
|
+
"@onekeyfe/hd-shared": "^0.2.19",
|
|
28
|
+
"@onekeyfe/hd-transport": "^0.2.19",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"bignumber.js": "^9.0.2",
|
|
31
31
|
"jszip": "^3.10.1",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@types/semver": "^7.3.9",
|
|
43
43
|
"ripple-keypairs": "^1.1.4"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "85f3cc752e9f40ac4e14e213ea610e66e8942c01"
|
|
46
46
|
}
|
|
@@ -26,6 +26,7 @@ export default class FilecoinGetAddress extends BaseMethod<HardwareFilecoinGetAd
|
|
|
26
26
|
validateParams(batch, [
|
|
27
27
|
{ name: 'path', required: true },
|
|
28
28
|
{ name: 'showOnOneKey', type: 'boolean' },
|
|
29
|
+
{ name: 'isTestnet', type: 'boolean' },
|
|
29
30
|
]);
|
|
30
31
|
|
|
31
32
|
const showOnOneKey = batch.showOnOneKey ?? true;
|
|
@@ -33,6 +34,7 @@ export default class FilecoinGetAddress extends BaseMethod<HardwareFilecoinGetAd
|
|
|
33
34
|
this.params.push({
|
|
34
35
|
address_n: addressN,
|
|
35
36
|
show_display: showOnOneKey,
|
|
37
|
+
testnet: batch.isTestnet,
|
|
36
38
|
});
|
|
37
39
|
});
|
|
38
40
|
}
|
|
@@ -16,15 +16,17 @@ export default class FilecoinSignTransaction extends BaseMethod<HardwareFilecoin
|
|
|
16
16
|
validateParams(this.payload, [
|
|
17
17
|
{ name: 'path', required: true },
|
|
18
18
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
19
|
+
{ name: 'isTestnet', type: 'boolean' },
|
|
19
20
|
]);
|
|
20
21
|
|
|
21
22
|
// init params
|
|
22
|
-
const { path, rawTx } = this.payload as FilecoinSignTransactionParams;
|
|
23
|
+
const { path, rawTx, isTestnet } = this.payload as FilecoinSignTransactionParams;
|
|
23
24
|
const addressN = validatePath(path, 3);
|
|
24
25
|
|
|
25
26
|
this.params = {
|
|
26
27
|
address_n: addressN,
|
|
27
28
|
raw_tx: formatAnyHex(rawTx),
|
|
29
|
+
testnet: isTestnet,
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -4423,6 +4423,10 @@
|
|
|
4423
4423
|
"show_display": {
|
|
4424
4424
|
"type": "bool",
|
|
4425
4425
|
"id": 2
|
|
4426
|
+
},
|
|
4427
|
+
"testnet": {
|
|
4428
|
+
"type": "bool",
|
|
4429
|
+
"id": 3
|
|
4426
4430
|
}
|
|
4427
4431
|
}
|
|
4428
4432
|
},
|
|
@@ -4448,6 +4452,10 @@
|
|
|
4448
4452
|
"rule": "required",
|
|
4449
4453
|
"type": "bytes",
|
|
4450
4454
|
"id": 2
|
|
4455
|
+
},
|
|
4456
|
+
"testnet": {
|
|
4457
|
+
"type": "bool",
|
|
4458
|
+
"id": 3
|
|
4451
4459
|
}
|
|
4452
4460
|
}
|
|
4453
4461
|
},
|