@cardano-sdk/hardware-ledger 0.2.2 → 0.2.3

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.
@@ -28,14 +28,16 @@ const Ledger = __importStar(require("@cardano-foundation/ledgerjs-hw-app-cardano
28
28
  const core_1 = require("@cardano-sdk/core");
29
29
  const keyPaths_1 = require("./keyPaths");
30
30
  const toRequiredSigner = (keyHash, context) => {
31
- const knowAddress = context?.knownAddresses.find((address) => {
31
+ const paymentCredKnownAddress = context?.knownAddresses.find((address) => {
32
32
  const paymentCredential = core_1.Cardano.Address.fromBech32(address.address)?.asBase()?.getPaymentCredential().hash;
33
+ return paymentCredential && paymentCredential.toString() === keyHash;
34
+ });
35
+ const stakeCredKnownAddress = context?.knownAddresses.find((address) => {
33
36
  const stakingCredential = core_1.Cardano.RewardAccount.toHash(address.rewardAccount);
34
- return ((paymentCredential && paymentCredential.toString() === keyHash) ||
35
- (stakingCredential && stakingCredential.toString() === keyHash));
37
+ return stakingCredential && stakingCredential.toString() === keyHash;
36
38
  });
37
- const paymentPath = knowAddress ? (0, keyPaths_1.paymentKeyPathFromGroupedAddress)(knowAddress) : null;
38
- const stakingPath = knowAddress ? (0, keyPaths_1.stakeKeyPathFromGroupedAddress)(knowAddress) : null;
39
+ const paymentPath = paymentCredKnownAddress ? (0, keyPaths_1.paymentKeyPathFromGroupedAddress)(paymentCredKnownAddress) : null;
40
+ const stakingPath = stakeCredKnownAddress ? (0, keyPaths_1.stakeKeyPathFromGroupedAddress)(stakeCredKnownAddress) : null;
39
41
  if (paymentPath) {
40
42
  return {
41
43
  path: paymentPath,
@@ -1 +1 @@
1
- {"version":3,"file":"requiredSigners.js","sourceRoot":"","sources":["../../../src/transformers/requiredSigners.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oFAAsE;AACtE,4CAA4C;AAG5C,yCAA8F;AAEvF,MAAM,gBAAgB,GAIzB,CAAC,OAAO,EAAE,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