@onekeyfe/hd-core 1.1.6-patch.3 → 1.1.6-patch.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/xrp/XrpGetAddress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"XrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/xrp/XrpGetAddress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CACnD;IACE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB,EAAE,CACJ;IACC,SAAS,UAAS;IAElB,aAAa,UAAS;IAEtB,IAAI;IA+BJ,eAAe;;;;;IAQT,GAAG;CAuCV"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var blake2s = require('@noble/hashes/blake2s');
|
|
|
14
14
|
var sha256 = require('@noble/hashes/sha256');
|
|
15
15
|
var JSZip = require('jszip');
|
|
16
16
|
var sha3 = require('@noble/hashes/sha3');
|
|
17
|
-
var rippleKeypairs = require('ripple-keypairs');
|
|
18
17
|
var blake2b = require('@noble/hashes/blake2b');
|
|
19
18
|
var buffer = require('buffer');
|
|
20
19
|
|
|
@@ -34463,21 +34462,8 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
34463
34462
|
};
|
|
34464
34463
|
}
|
|
34465
34464
|
run() {
|
|
34466
|
-
var _a, _b, _c, _d
|
|
34465
|
+
var _a, _b, _c, _d;
|
|
34467
34466
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34468
|
-
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features) && !this.shouldConfirm) {
|
|
34469
|
-
const res = yield batchGetPublickeys(this.device, this.params, 'secp256k1', 144);
|
|
34470
|
-
const result = res.public_keys.map((publicKey, index) => ({
|
|
34471
|
-
path: serializedPath(this.params[index].address_n),
|
|
34472
|
-
address: rippleKeypairs.deriveAddress(publicKey),
|
|
34473
|
-
publicKey,
|
|
34474
|
-
pub: publicKey,
|
|
34475
|
-
}));
|
|
34476
|
-
validateResult(result, ['address', 'publicKey'], {
|
|
34477
|
-
expectedLength: this.params.length,
|
|
34478
|
-
});
|
|
34479
|
-
return Promise.resolve(result);
|
|
34480
|
-
}
|
|
34481
34467
|
const responses = [];
|
|
34482
34468
|
for (let i = 0; i < this.params.length; i++) {
|
|
34483
34469
|
const param = this.params[i];
|
|
@@ -34491,8 +34477,8 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
34491
34477
|
responses.push({
|
|
34492
34478
|
path,
|
|
34493
34479
|
address,
|
|
34494
|
-
publicKey: (
|
|
34495
|
-
pub: (
|
|
34480
|
+
publicKey: (_b = (_a = publicKey.message) === null || _a === void 0 ? void 0 : _a.public_keys) === null || _b === void 0 ? void 0 : _b[0],
|
|
34481
|
+
pub: (_d = (_c = publicKey.message) === null || _c === void 0 ? void 0 : _c.public_keys) === null || _d === void 0 ? void 0 : _d[0],
|
|
34496
34482
|
});
|
|
34497
34483
|
this.postPreviousAddressMessage({
|
|
34498
34484
|
path,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.1.6-patch.
|
|
3
|
+
"version": "1.1.6-patch.4",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "1.1.6-patch.
|
|
29
|
-
"@onekeyfe/hd-transport": "1.1.6-patch.
|
|
28
|
+
"@onekeyfe/hd-shared": "1.1.6-patch.4",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.1.6-patch.4",
|
|
30
30
|
"axios": "^0.30.1",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"bytebuffer": "^5.0.1",
|
|
@@ -35,16 +35,14 @@
|
|
|
35
35
|
"semver": "^7.3.7"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@noble/hashes": "^1.1.3"
|
|
39
|
-
"ripple-keypairs": "^2.0.0"
|
|
38
|
+
"@noble/hashes": "^1.1.3"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@noble/hashes": "^1.1.3",
|
|
43
42
|
"@types/parse-uri": "^1.0.0",
|
|
44
43
|
"@types/semver": "^7.3.9",
|
|
45
44
|
"@types/w3c-web-usb": "^1.0.10",
|
|
46
|
-
"@types/web-bluetooth": "^0.0.21"
|
|
47
|
-
"ripple-keypairs": "^1.3.1"
|
|
45
|
+
"@types/web-bluetooth": "^0.0.21"
|
|
48
46
|
},
|
|
49
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "ea295bb2b3f7f9f31ed0d6b3cc8201ef9aa64396"
|
|
50
48
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { deriveAddress } from 'ripple-keypairs';
|
|
2
1
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
2
|
import { XrpAddress, XrpGetAddressParams } from '../../types/api/xrpGetAddress';
|
|
4
|
-
import { supportBatchPublicKey } from '../../utils/deviceFeaturesUtils';
|
|
5
3
|
import { BaseMethod } from '../BaseMethod';
|
|
6
4
|
import { validateParams, validateResult } from '../helpers/paramsValidator';
|
|
7
5
|
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
8
|
-
import { batchGetPublickeys } from '../helpers/batchGetPublickeys';
|
|
9
6
|
|
|
10
7
|
export default class XrpGetAddress extends BaseMethod<
|
|
11
8
|
{
|
|
@@ -57,22 +54,6 @@ export default class XrpGetAddress extends BaseMethod<
|
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
async run() {
|
|
60
|
-
if (this.hasBundle && supportBatchPublicKey(this.device?.features) && !this.shouldConfirm) {
|
|
61
|
-
const res = await batchGetPublickeys(this.device, this.params, 'secp256k1', 144);
|
|
62
|
-
const result = res.public_keys.map((publicKey: string, index: number) => ({
|
|
63
|
-
path: serializedPath((this.params as unknown as any[])[index].address_n),
|
|
64
|
-
address: deriveAddress(publicKey),
|
|
65
|
-
publicKey,
|
|
66
|
-
pub: publicKey,
|
|
67
|
-
}));
|
|
68
|
-
|
|
69
|
-
validateResult(result, ['address', 'publicKey'], {
|
|
70
|
-
expectedLength: this.params.length,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
return Promise.resolve(result);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
57
|
const responses: XrpAddress[] = [];
|
|
77
58
|
for (let i = 0; i < this.params.length; i++) {
|
|
78
59
|
const param = this.params[i];
|