@onekeyfe/hd-web-sdk 0.2.9 → 0.2.10

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.
@@ -25933,11 +25933,12 @@ const modifyAddressParametersForBackwardsCompatibility = address_parameters => {
25933
25933
 
25934
25934
  class CardanoGetAddress extends BaseMethod {
25935
25935
  init() {
25936
- var _a;
25936
+ var _a, _b;
25937
25937
 
25938
25938
  this.checkDeviceId = true;
25939
25939
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
25940
25940
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
25941
+ this.isCheck = !!((_b = this.payload) === null || _b === void 0 ? void 0 : _b.isCheck);
25941
25942
  const payload = this.hasBundle ? this.payload : {
25942
25943
  bundle: [this.payload]
25943
25944
  };
@@ -25961,7 +25962,7 @@ class CardanoGetAddress extends BaseMethod {
25961
25962
  name: 'address',
25962
25963
  type: 'string'
25963
25964
  }, {
25964
- name: 'showOnTrezor',
25965
+ name: 'showOnOneKey',
25965
25966
  type: 'boolean'
25966
25967
  }]);
25967
25968
  validateAddressParameters(batch.addressParameters);
@@ -25971,7 +25972,7 @@ class CardanoGetAddress extends BaseMethod {
25971
25972
  protocol_magic: batch.protocolMagic,
25972
25973
  network_id: batch.networkId,
25973
25974
  derivation_type: typeof batch.derivationType !== 'undefined' ? batch.derivationType : hdTransport.Messages.CardanoDerivationType.ICARUS_TREZOR,
25974
- show_display: typeof batch.showOnOneKey === 'boolean' ? !!batch.showOneKey : true
25975
+ show_display: typeof batch.showOnOneKey === 'boolean' ? !!batch.showOnOneKey : true
25975
25976
  };
25976
25977
  });
25977
25978
  }
@@ -25995,11 +25996,30 @@ class CardanoGetAddress extends BaseMethod {
25995
25996
  derivation_type,
25996
25997
  show_display
25997
25998
  });
25998
- const publicKeyRes = yield this.device.commands.typedCall('CardanoGetPublicKey', 'CardanoPublicKey', {
25999
- address_n: address_parameters.address_n.slice(0, 3),
26000
- derivation_type,
26001
- show_display
26002
- });
25999
+ let xpub;
26000
+ let stakeAddress;
26001
+
26002
+ if (address_parameters.address_type === hdTransport.Messages.CardanoAddressType.BASE && !this.isCheck) {
26003
+ const publicKeyRes = yield this.device.commands.typedCall('CardanoGetPublicKey', 'CardanoPublicKey', {
26004
+ address_n: address_parameters.address_n.slice(0, 3),
26005
+ derivation_type,
26006
+ show_display
26007
+ });
26008
+ xpub = publicKeyRes.message.xpub;
26009
+ const stakeAddressRes = yield this.device.commands.typedCall('CardanoGetAddress', 'CardanoAddress', {
26010
+ address_parameters: {
26011
+ address_type: hdTransport.Messages.CardanoAddressType.REWARD,
26012
+ address_n: [],
26013
+ address_n_staking: address_parameters.address_n_staking
26014
+ },
26015
+ protocol_magic,
26016
+ network_id,
26017
+ derivation_type,
26018
+ show_display
26019
+ });
26020
+ stakeAddress = stakeAddressRes.message.address;
26021
+ }
26022
+
26003
26023
  responses.push({
26004
26024
  addressParameters: addressParametersFromProto(batch.address_parameters),
26005
26025
  protocolMagic: batch.protocol_magic,
@@ -26007,7 +26027,8 @@ class CardanoGetAddress extends BaseMethod {
26007
26027
  serializedPath: serializedPath(batch.address_parameters.address_n),
26008
26028
  serializedStakingPath: serializedPath(batch.address_parameters.address_n_staking),
26009
26029
  address: response.message.address,
26010
- xpub: publicKeyRes.message.xpub
26030
+ xpub,
26031
+ stakeAddress
26011
26032
  });
26012
26033
  }
26013
26034
 
@@ -73403,7 +73424,7 @@ module.exports = {"i8":"6.5.4"};
73403
73424
  /***/ ((module) => {
73404
73425
 
73405
73426
  "use strict";
73406
- module.exports = JSON.parse('{"name":"@onekeyfe/hd-core","version":"0.2.9","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.9","@onekeyfe/hd-transport":"^0.2.9","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"}}');
73427
+ module.exports = JSON.parse('{"name":"@onekeyfe/hd-core","version":"0.2.10","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.10","@onekeyfe/hd-transport":"^0.2.10","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"}}');
73407
73428
 
73408
73429
  /***/ })
73409
73430
 
@@ -75942,7 +75963,7 @@ const src_init = async settings => {
75942
75963
 
75943
75964
  try {
75944
75965
  await init({ ..._settings,
75945
- version: "0.2.9"
75966
+ version: "0.2.10"
75946
75967
  });
75947
75968
  return true;
75948
75969
  } catch (e) {