@ledgerhq/live-common 21.16.3 → 21.17.2

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.
@@ -84,11 +84,16 @@ class Zen implements ICrypto {
84
84
  if (!this.validateAddress(address)) {
85
85
  throw new InvalidAddress();
86
86
  }
87
- // TODO find a better way to calculate the script from zen address instead of converting to bitcoin address
88
- return toOutputScript(
87
+ const outputScript = toOutputScript(
89
88
  Zen.toBitcoinAddr(address),
90
89
  coininfo.bitcoin.main.toBitcoinJS()
91
90
  );
91
+ // refer to https://github.com/LedgerHQ/lib-ledger-core/blob/fc9d762b83fc2b269d072b662065747a64ab2816/core/src/wallet/bitcoin/scripts/BitcoinLikeScript.cpp#L139 and https://github.com/LedgerHQ/lib-ledger-core/blob/fc9d762b83fc2b269d072b662065747a64ab2816/core/src/wallet/bitcoin/networks.cpp#L39 for bip115 Script and its network parameters
92
+ const bip115Script = Buffer.from(
93
+ "209ec9845acb02fab24e1c0368b3b517c1a4488fba97f0e3459ac053ea0100000003c01f02b4",
94
+ "hex"
95
+ );
96
+ return Buffer.concat([outputScript, bip115Script]);
92
97
  }
93
98
 
94
99
  // eslint-disable-next-line class-methods-use-this