@onekeyfe/hd-core 0.2.4 → 0.2.5
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/xrp/XrpGetAddress.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -1
- package/dist/types/api/xrpGetAddress.d.ts +1 -1
- package/dist/types/api/xrpGetAddress.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/xrp/XrpGetAddress.ts +9 -0
- package/src/types/api/xrpGetAddress.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/xrp/XrpGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,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,IAAI;IA2BJ,eAAe;;;;;IAQT,GAAG;
|
|
1
|
+
{"version":3,"file":"XrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/xrp/XrpGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,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,IAAI;IA2BJ,eAAe;;;;;IAQT,GAAG;CAyCV"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1151,7 +1151,7 @@ declare type XrpGetAddressParams = {
|
|
|
1151
1151
|
path: string | number[];
|
|
1152
1152
|
showOnOneKey?: boolean;
|
|
1153
1153
|
};
|
|
1154
|
-
declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & XrpGetAddressParams): Response<XrpAddress
|
|
1154
|
+
declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & XrpGetAddressParams): Response<XrpAddress>;
|
|
1155
1155
|
declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
1156
1156
|
bundle?: XrpGetAddressParams[];
|
|
1157
1157
|
}): Response<XrpAddress[]>;
|
package/dist/index.js
CHANGED
|
@@ -16078,7 +16078,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16078
16078
|
};
|
|
16079
16079
|
}
|
|
16080
16080
|
run() {
|
|
16081
|
-
var _a;
|
|
16081
|
+
var _a, _b, _c;
|
|
16082
16082
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16083
16083
|
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features)) {
|
|
16084
16084
|
const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
@@ -16096,10 +16096,15 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16096
16096
|
for (let i = 0; i < this.params.length; i++) {
|
|
16097
16097
|
const param = this.params[i];
|
|
16098
16098
|
const res = yield this.device.commands.typedCall('RippleGetAddress', 'RippleAddress', Object.assign({}, param));
|
|
16099
|
+
const publicKey = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
16100
|
+
paths: [{ address_n: param.address_n }],
|
|
16101
|
+
ecdsa_curve_name: 'secp256k1',
|
|
16102
|
+
});
|
|
16099
16103
|
const { address } = res.message;
|
|
16100
16104
|
responses.push({
|
|
16101
16105
|
path: serializedPath(param.address_n),
|
|
16102
16106
|
address,
|
|
16107
|
+
publicKey: (_c = (_b = publicKey.message) === null || _b === void 0 ? void 0 : _b.public_keys) === null || _c === void 0 ? void 0 : _c[0],
|
|
16103
16108
|
});
|
|
16104
16109
|
}
|
|
16105
16110
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -8,7 +8,7 @@ export declare type XrpGetAddressParams = {
|
|
|
8
8
|
path: string | number[];
|
|
9
9
|
showOnOneKey?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & XrpGetAddressParams): Response<XrpAddress
|
|
11
|
+
export declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & XrpGetAddressParams): Response<XrpAddress>;
|
|
12
12
|
export declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
13
13
|
bundle?: XrpGetAddressParams[];
|
|
14
14
|
}): Response<XrpAddress[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/types/api/xrpGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,mBAAmB,GACzC,QAAQ,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"xrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/types/api/xrpGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,mBAAmB,GACzC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAA;CAAE,GACxD,QAAQ,CAAC,UAAU,EAAE,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.5",
|
|
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.5",
|
|
28
|
+
"@onekeyfe/hd-transport": "^0.2.5",
|
|
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": "05ae2785be37f8d157de5f386010caa2f58335c3"
|
|
46
46
|
}
|
|
@@ -70,12 +70,21 @@ export default class XrpGetAddress extends BaseMethod<
|
|
|
70
70
|
const res = await this.device.commands.typedCall('RippleGetAddress', 'RippleAddress', {
|
|
71
71
|
...param,
|
|
72
72
|
});
|
|
73
|
+
const publicKey = await this.device.commands.typedCall(
|
|
74
|
+
'BatchGetPublickeys',
|
|
75
|
+
'EcdsaPublicKeys',
|
|
76
|
+
{
|
|
77
|
+
paths: [{ address_n: param.address_n }],
|
|
78
|
+
ecdsa_curve_name: 'secp256k1',
|
|
79
|
+
}
|
|
80
|
+
);
|
|
73
81
|
|
|
74
82
|
const { address } = res.message;
|
|
75
83
|
|
|
76
84
|
responses.push({
|
|
77
85
|
path: serializedPath(param.address_n),
|
|
78
86
|
address,
|
|
87
|
+
publicKey: publicKey.message?.public_keys?.[0],
|
|
79
88
|
});
|
|
80
89
|
}
|
|
81
90
|
|