@onekeyfe/hd-web-sdk 0.2.3 → 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.
@@ -25273,17 +25273,44 @@ class XrpGetAddress$1 extends BaseMethod {
25273
25273
  }
25274
25274
 
25275
25275
  run() {
25276
+ var _a, _b, _c;
25277
+
25276
25278
  return __awaiter(this, void 0, void 0, function* () {
25277
- const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
25278
- paths: this.params,
25279
- ecdsa_curve_name: 'secp256k1'
25280
- });
25281
- const responses = res.message.public_keys.map((publicKey, index) => ({
25282
- path: serializedPath(this.params[index].address_n),
25283
- publicKey,
25284
- address: rippleKeypairs.deriveAddress(publicKey)
25285
- }));
25286
- return responses;
25279
+ if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features)) {
25280
+ const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
25281
+ paths: this.params,
25282
+ ecdsa_curve_name: 'secp256k1'
25283
+ });
25284
+ const result = res.message.public_keys.map((publicKey, index) => ({
25285
+ path: serializedPath(this.params[index].address_n),
25286
+ publicKey,
25287
+ address: rippleKeypairs.deriveAddress(publicKey)
25288
+ }));
25289
+ return Promise.resolve(result);
25290
+ }
25291
+
25292
+ const responses = [];
25293
+
25294
+ for (let i = 0; i < this.params.length; i++) {
25295
+ const param = this.params[i];
25296
+ const res = yield this.device.commands.typedCall('RippleGetAddress', 'RippleAddress', Object.assign({}, param));
25297
+ const publicKey = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
25298
+ paths: [{
25299
+ address_n: param.address_n
25300
+ }],
25301
+ ecdsa_curve_name: 'secp256k1'
25302
+ });
25303
+ const {
25304
+ address
25305
+ } = res.message;
25306
+ responses.push({
25307
+ path: serializedPath(param.address_n),
25308
+ address,
25309
+ publicKey: (_c = (_b = publicKey.message) === null || _b === void 0 ? void 0 : _b.public_keys) === null || _c === void 0 ? void 0 : _c[0]
25310
+ });
25311
+ }
25312
+
25313
+ return Promise.resolve(this.hasBundle ? responses : responses[0]);
25287
25314
  });
25288
25315
  }
25289
25316
 
@@ -71816,7 +71843,7 @@ module.exports = {"i8":"6.5.4"};
71816
71843
  /***/ ((module) => {
71817
71844
 
71818
71845
  "use strict";
71819
- module.exports = JSON.parse('{"name":"@onekeyfe/hd-core","version":"0.2.3","description":"> TODO: description","author":"OneKey","homepage":"https://github.com/OneKeyHQ/hardware-js-sdk#readme","license":"ISC","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/OneKeyHQ/hardware-js-sdk.git"},"publishConfig":{"access":"public"},"scripts":{"dev":"rimraf dist && rollup -c ../../build/rollup.config.js -w","build":"rimraf dist && rollup -c ../../build/rollup.config.js","lint":"eslint .","lint:fix":"eslint . --fix"},"bugs":{"url":"https://github.com/OneKeyHQ/hardware-js-sdk/issues"},"dependencies":{"@onekeyfe/hd-shared":"^0.2.3","@onekeyfe/hd-transport":"^0.2.3","axios":"^0.27.2","bignumber.js":"^9.0.2","jszip":"^3.10.1","parse-uri":"^1.0.7","semver":"^7.3.7"},"peerDependencies":{"@noble/hashes":"^1.1.3","ripple-keypairs":"^1.1.4"},"devDependencies":{"@noble/hashes":"^1.1.3","ripple-keypairs":"^1.1.4","@types/parse-uri":"^1.0.0","@types/semver":"^7.3.9"}}');
71846
+ module.exports = JSON.parse('{"name":"@onekeyfe/hd-core","version":"0.2.5","description":"> TODO: description","author":"OneKey","homepage":"https://github.com/OneKeyHQ/hardware-js-sdk#readme","license":"ISC","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/OneKeyHQ/hardware-js-sdk.git"},"publishConfig":{"access":"public"},"scripts":{"dev":"rimraf dist && rollup -c ../../build/rollup.config.js -w","build":"rimraf dist && rollup -c ../../build/rollup.config.js","lint":"eslint .","lint:fix":"eslint . --fix"},"bugs":{"url":"https://github.com/OneKeyHQ/hardware-js-sdk/issues"},"dependencies":{"@onekeyfe/hd-shared":"^0.2.5","@onekeyfe/hd-transport":"^0.2.5","axios":"^0.27.2","bignumber.js":"^9.0.2","jszip":"^3.10.1","parse-uri":"^1.0.7","semver":"^7.3.7"},"peerDependencies":{"@noble/hashes":"^1.1.3","ripple-keypairs":"^1.1.4"},"devDependencies":{"@noble/hashes":"^1.1.3","@types/parse-uri":"^1.0.0","@types/semver":"^7.3.9","ripple-keypairs":"^1.1.4"}}');
71820
71847
 
71821
71848
  /***/ })
71822
71849
 
@@ -74355,7 +74382,7 @@ const src_init = async settings => {
74355
74382
 
74356
74383
  try {
74357
74384
  await init({ ..._settings,
74358
- version: "0.2.3"
74385
+ version: "0.2.5"
74359
74386
  });
74360
74387
  return true;
74361
74388
  } catch (e) {