utxo-lib 1.0.9 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/README.md +19 -16
  2. package/dist/src/address.d.ts.map +1 -1
  3. package/dist/src/address.js +11 -1
  4. package/dist/src/addressFormat.d.ts +1 -1
  5. package/dist/src/addressFormat.d.ts.map +1 -1
  6. package/dist/src/addressFormat.js +1 -1
  7. package/dist/src/bitgo/Musig2.d.ts +115 -17
  8. package/dist/src/bitgo/Musig2.d.ts.map +1 -1
  9. package/dist/src/bitgo/Musig2.js +283 -100
  10. package/dist/src/bitgo/PsbtUtil.d.ts +59 -0
  11. package/dist/src/bitgo/PsbtUtil.d.ts.map +1 -0
  12. package/dist/src/bitgo/PsbtUtil.js +91 -0
  13. package/dist/src/bitgo/UtxoPsbt.d.ts +180 -47
  14. package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
  15. package/dist/src/bitgo/UtxoPsbt.js +651 -107
  16. package/dist/src/bitgo/bitcoincash/address.js +2 -2
  17. package/dist/src/bitgo/index.d.ts +11 -0
  18. package/dist/src/bitgo/index.d.ts.map +1 -1
  19. package/dist/src/bitgo/index.js +6 -2
  20. package/dist/src/bitgo/legacysafe/index.d.ts +15 -0
  21. package/dist/src/bitgo/legacysafe/index.d.ts.map +1 -0
  22. package/dist/src/bitgo/legacysafe/index.js +61 -0
  23. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +10 -0
  24. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +1 -0
  25. package/dist/src/bitgo/litecoin/LitecoinPsbt.js +17 -0
  26. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +16 -0
  27. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +1 -0
  28. package/dist/src/bitgo/litecoin/LitecoinTransaction.js +46 -0
  29. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +10 -0
  30. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +1 -0
  31. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +15 -0
  32. package/dist/src/bitgo/litecoin/index.d.ts +4 -0
  33. package/dist/src/bitgo/litecoin/index.d.ts.map +1 -0
  34. package/dist/src/bitgo/litecoin/index.js +16 -0
  35. package/dist/src/bitgo/outputScripts.d.ts +3 -1
  36. package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
  37. package/dist/src/bitgo/outputScripts.js +18 -10
  38. package/dist/src/bitgo/parseInput.d.ts +49 -20
  39. package/dist/src/bitgo/parseInput.d.ts.map +1 -1
  40. package/dist/src/bitgo/parseInput.js +109 -25
  41. package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
  42. package/dist/src/bitgo/psbt/fromHalfSigned.js +9 -6
  43. package/dist/src/bitgo/signature.d.ts +3 -3
  44. package/dist/src/bitgo/signature.d.ts.map +1 -1
  45. package/dist/src/bitgo/signature.js +48 -16
  46. package/dist/src/bitgo/transaction.d.ts +18 -3
  47. package/dist/src/bitgo/transaction.d.ts.map +1 -1
  48. package/dist/src/bitgo/transaction.js +28 -15
  49. package/dist/src/bitgo/types.d.ts +2 -0
  50. package/dist/src/bitgo/types.d.ts.map +1 -1
  51. package/dist/src/bitgo/types.js +1 -1
  52. package/dist/src/bitgo/wallet/Psbt.d.ts +104 -12
  53. package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
  54. package/dist/src/bitgo/wallet/Psbt.js +285 -70
  55. package/dist/src/bitgo/wallet/Unspent.d.ts +28 -0
  56. package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
  57. package/dist/src/bitgo/wallet/Unspent.js +172 -68
  58. package/dist/src/bitgo/wallet/WalletOutput.d.ts +17 -1
  59. package/dist/src/bitgo/wallet/WalletOutput.d.ts.map +1 -1
  60. package/dist/src/bitgo/wallet/WalletOutput.js +64 -23
  61. package/dist/src/bitgo/wallet/chains.d.ts +2 -2
  62. package/dist/src/bitgo/wallet/chains.d.ts.map +1 -1
  63. package/dist/src/bitgo/wallet/chains.js +1 -1
  64. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts +0 -1
  65. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
  66. package/dist/src/bitgo/zcash/ZcashPsbt.js +6 -14
  67. package/dist/src/musig.d.ts +0 -1
  68. package/dist/src/musig.d.ts.map +1 -1
  69. package/dist/src/musig.js +15 -29
  70. package/dist/src/networks.d.ts +1 -2
  71. package/dist/src/networks.d.ts.map +1 -1
  72. package/dist/src/networks.js +22 -29
  73. package/dist/src/noble_ecc.d.ts.map +1 -1
  74. package/dist/src/noble_ecc.js +7 -3
  75. package/dist/src/payments/p2tr.d.ts.map +1 -1
  76. package/dist/src/payments/p2tr.js +15 -9
  77. package/dist/src/taproot.d.ts +16 -0
  78. package/dist/src/taproot.d.ts.map +1 -1
  79. package/dist/src/taproot.js +44 -2
  80. package/dist/src/testutil/index.d.ts +2 -0
  81. package/dist/src/testutil/index.d.ts.map +1 -1
  82. package/dist/src/testutil/index.js +3 -1
  83. package/dist/src/testutil/keys.d.ts +3 -0
  84. package/dist/src/testutil/keys.d.ts.map +1 -1
  85. package/dist/src/testutil/keys.js +17 -2
  86. package/dist/src/testutil/mock.d.ts +1 -1
  87. package/dist/src/testutil/mock.d.ts.map +1 -1
  88. package/dist/src/testutil/mock.js +12 -4
  89. package/dist/src/testutil/psbt.d.ts +89 -0
  90. package/dist/src/testutil/psbt.d.ts.map +1 -0
  91. package/dist/src/testutil/psbt.js +150 -0
  92. package/dist/src/testutil/transaction.d.ts +70 -0
  93. package/dist/src/testutil/transaction.d.ts.map +1 -0
  94. package/dist/src/testutil/transaction.js +107 -0
  95. package/package.json +6 -6
@@ -47,7 +47,7 @@ function getPrefix(network) {
47
47
  case networks_1.networks.ecash:
48
48
  return 'ecash';
49
49
  case networks_1.networks.ecashTest:
50
- return 'ecashtest';
50
+ return 'ectest';
51
51
  default:
52
52
  throw new Error(`unsupported prefix for ${networks_1.getNetworkName(network)}`);
53
53
  }
@@ -148,4 +148,4 @@ function toOutputScriptWithFormat(address, format, network) {
148
148
  throw new Error(`invalid format`);
149
149
  }
150
150
  exports.toOutputScriptWithFormat = toOutputScriptWithFormat;
151
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iaXRnby9iaXRjb2luY2FzaC9hZGRyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7Ozs7Ozs7R0FZRztBQUNILDJDQUEyQztBQUMzQywyQ0FBMkM7QUFDM0MsNkNBQTJGO0FBRzNGOzs7O0dBSUc7QUFDSCxTQUFTLHVCQUF1QixDQUFDLElBQVksRUFBRSxNQUFjO0lBRTNELE1BQU0sSUFBSSxHQUFJLFNBQVMsQ0FBQyxRQUFtRCxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ2xGLElBQUksQ0FBQyxJQUFJLEVBQUU7UUFDVCxNQUFNLElBQUksS0FBSyxDQUFDLHdCQUF3QixJQUFJLEVBQUUsQ0FBQyxDQUFDO0tBQ2pEO0lBQ0QsSUFBSTtRQUNGLE9BQU8sSUFBSSxDQUFDLEVBQUUsTUFBTSxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUM7S0FDOUI7SUFBQyxPQUFPLENBQUMsRUFBRTtRQUNWLE9BQU8sU0FBUyxDQUFDO0tBQ2xCO0FBQ0gsQ0FBQztBQUVEOzs7R0FHRztBQUNILFNBQWdCLFNBQVMsQ0FBQyxPQUFnQjtJQUN4QyxRQUFRLE9BQU8sRUFBRTtRQUNmLEtBQUssbUJBQVEsQ0FBQyxXQUFXO1lBQ3ZCLE9BQU8sYUFBYSxDQUFDO1FBQ3ZCLEtBQUssbUJBQVEsQ0FBQyxrQkFBa0I7WUFDOUIsT0FBTyxTQUFTLENBQUM7UUFDbkIsS0FBSyxtQkFBUSxD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c2gobmV0d29yaykgJiYgIWlzRUNhc2gobmV0d29yaykpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoYGludmFsaWQgbmV0d29ya2ApO1xuICB9XG5cbiAgaWYgKGZvcm1hdCA9PT0gJ2Nhc2hhZGRyJykge1xuICAgIHJldHVybiB0b091dHB1dFNjcmlwdEZyb21DYXNoQWRkcmVzcyhhZGRyZXNzLCBuZXR3b3JrKTtcbiAgfVxuXG4gIGlmIChmb3JtYXQgPT09ICdkZWZhdWx0Jykge1xuICAgIHJldHVybiBiaXRjb2luanMuYWRkcmVzcy50b091dHB1dFNjcmlwdChhZGRyZXNzLCBuZXR3b3JrIGFzIGJpdGNvaW5qcy5OZXR3b3JrKTtcbiAgfVxuXG4gIHRocm93IG5ldyBFcnJvcihgaW52YWxpZCBmb3JtYXRgKTtcbn1cbiJdfQ==
@@ -1,7 +1,10 @@
1
+ export { PsbtInput, PsbtOutput } from 'bip174/src/lib/interfaces';
1
2
  export * as bcashAddress from './bitcoincash';
2
3
  export * as keyutil from './keyutil';
3
4
  export * as nonStandardHalfSigned from './nonStandardHalfSigned';
4
5
  export * as outputScripts from './outputScripts';
6
+ export * as legacySafe from './legacysafe';
7
+ export * as musig2 from './Musig2';
5
8
  export * from './dash';
6
9
  export * from './parseInput';
7
10
  export * from './signature';
@@ -14,4 +17,12 @@ export * from './UtxoTransactionBuilder';
14
17
  export * from './wallet';
15
18
  export * from './zcash';
16
19
  export * from './tnumber';
20
+ export * from './litecoin';
21
+ export * from './PsbtUtil';
22
+ import { PsbtInput } from 'bip174/src/lib/interfaces';
23
+ /**
24
+ * alias for PsbtInput type to avoid direct bip174 library dependency by users of the util functions
25
+ * @deprecated use PsbtInput instead
26
+ */
27
+ export declare type PsbtInputType = PsbtInput;
17
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bitgo/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAA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,EAAE,MAAM,2BAA2B,CAAC;AACtD;;;GAGG;AACH,oBAAY,aAAa,GAAG,SAAS,CAAC"}
@@ -10,11 +10,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.outputScripts = exports.nonStandardHalfSigned = exports.keyutil = exports.bcashAddress = void 0;
13
+ exports.musig2 = exports.legacySafe = exports.outputScripts = exports.nonStandardHalfSigned = exports.keyutil = exports.bcashAddress = void 0;
14
14
  exports.bcashAddress = require("./bitcoincash");
15
15
  exports.keyutil = require("./keyutil");
16
16
  exports.nonStandardHalfSigned = require("./nonStandardHalfSigned");
17
17
  exports.outputScripts = require("./outputScripts");
18
+ exports.legacySafe = require("./legacysafe");
19
+ exports.musig2 = require("./Musig2");
18
20
  __exportStar(require("./dash"), exports);
19
21
  __exportStar(require("./parseInput"), exports);
20
22
  __exportStar(require("./signature"), exports);
@@ -27,4 +29,6 @@ __exportStar(require("./UtxoTransactionBuilder"), exports);
27
29
  __exportStar(require("./wallet"), exports);
28
30
  __exportStar(require("./zcash"), exports);
29
31
  __exportStar(require("./tnumber"), exports);
30
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYml0Z28vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUFBLGdEQUE4QztBQUM5Qyx1Q0FBcUM7QUFDckMsbUVBQWlFO0FBQ2pFLG1EQUFpRDtBQUNqRCx5Q0FBdUI7QUFDdkIsK0NBQTZCO0FBQzdCLDhDQUE0QjtBQUM1QixnREFBOEI7QUFDOUIsMENBQXdCO0FBQ3hCLDRDQUEwQjtBQUMxQiw2Q0FBMkI7QUFDM0Isb0RBQWtDO0FBQ2xDLDJEQUF5QztBQUN6QywyQ0FBeUI7QUFDekIsMENBQXdCO0FBQ3hCLDRDQUEwQiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGFzIGJjYXNoQWRkcmVzcyBmcm9tICcuL2JpdGNvaW5jYXNoJztcbmV4cG9ydCAqIGFzIGtleXV0aWwgZnJvbSAnLi9rZXl1dGlsJztcbmV4cG9ydCAqIGFzIG5vblN0YW5kYXJkSGFsZlNpZ25lZCBmcm9tICcuL25vblN0YW5kYXJkSGFsZlNpZ25lZCc7XG5leHBvcnQgKiBhcyBvdXRwdXRTY3JpcHRzIGZyb20gJy4vb3V0cHV0U2NyaXB0cyc7XG5leHBvcnQgKiBmcm9tICcuL2Rhc2gnO1xuZXhwb3J0ICogZnJvbSAnLi9wYXJzZUlucHV0JztcbmV4cG9ydCAqIGZyb20gJy4vc2lnbmF0dXJlJztcbmV4cG9ydCAqIGZyb20gJy4vdHJhbnNhY3Rpb24nO1xuZXhwb3J0ICogZnJvbSAnLi90eXBlcyc7XG5leHBvcnQgKiBmcm9tICcuL1Vuc3BlbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9VdHhvUHNidCc7XG5leHBvcnQgKiBmcm9tICcuL1V0eG9UcmFuc2FjdGlvbic7XG5leHBvcnQgKiBmcm9tICcuL1V0eG9UcmFuc2FjdGlvbkJ1aWxkZXInO1xuZXhwb3J0ICogZnJvbSAnLi93YWxsZXQnO1xuZXhwb3J0ICogZnJvbSAnLi96Y2FzaCc7XG5leHBvcnQgKiBmcm9tICcuL3RudW1iZXInO1xuIl19
32
+ __exportStar(require("./litecoin"), exports);
33
+ __exportStar(require("./PsbtUtil"), exports);
34
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYml0Z28vaW5kZXgudHMiXSw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uZXhwb3J0ICogZnJvbSAnLi90eXBlcyc7XG5leHBvcnQgKiBmcm9tICcuL1Vuc3BlbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9VdHhvUHNidCc7XG5leHBvcnQgKiBmcm9tICcuL1V0eG9UcmFuc2FjdGlvbic7XG5leHBvcnQgKiBmcm9tICcuL1V0eG9UcmFuc2FjdGlvbkJ1aWxkZXInO1xuZXhwb3J0ICogZnJvbSAnLi93YWxsZXQnO1xuZXhwb3J0ICogZnJvbSAnLi96Y2FzaCc7XG5leHBvcnQgKiBmcm9tICcuL3RudW1iZXInO1xuZXhwb3J0ICogZnJvbSAnLi9saXRlY29pbic7XG5leHBvcnQgKiBmcm9tICcuL1BzYnRVdGlsJztcblxuaW1wb3J0IHsgUHNidElucHV0IH0gZnJvbSAnYmlwMTc0L3NyYy9saWIvaW50ZXJmYWNlcyc7XG4vKipcbiAqIGFsaWFzIGZvciBQc2J0SW5wdXQgdHlwZSB0byBhdm9pZCBkaXJlY3QgYmlwMTc0IGxpYnJhcnkgZGVwZW5kZW5jeSBieSB1c2VycyBvZiB0aGUgdXRpbCBmdW5jdGlvbnNcbiAqIEBkZXByZWNhdGVkIHVzZSBQc2J0SW5wdXQgaW5zdGVhZFxuICovXG5leHBvcnQgdHlwZSBQc2J0SW5wdXRUeXBlID0gUHNidElucHV0O1xuIl19
@@ -0,0 +1,15 @@
1
+ /**
2
+ * V1 Safe Wallets are the oldest type of wallets that BitGo supports. They were
3
+ * created back in 2013-14 and don't use HD chains. Instead, they have only one
4
+ * P2SH address per wallet whose redeem script uses uncompressed public keys.
5
+ * */
6
+ /// <reference types="node" />
7
+ import { Network } from '../../networks';
8
+ export declare function toUncompressedPub(pubkey: Buffer): Buffer;
9
+ export declare function toCompressedPub(pubkey: Buffer): Buffer;
10
+ /** create p2sh scripts with uncompressed pubkeys */
11
+ export declare function createLegacySafeOutputScript2of3(pubkeys: Buffer[], network?: Network): {
12
+ scriptPubKey: Buffer;
13
+ redeemScript: Buffer;
14
+ };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/legacysafe/index.ts"],"names":[],"mappings":"AAAA;;;;KAIK;;AAIL,OAAO,EAAa,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAepD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,oDAAoD;AACpD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,CAAC,EAAE,OAAO,GAChB;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAgCA"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * V1 Safe Wallets are the oldest type of wallets that BitGo supports. They were
4
+ * created back in 2013-14 and don't use HD chains. Instead, they have only one
5
+ * P2SH address per wallet whose redeem script uses uncompressed public keys.
6
+ * */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createLegacySafeOutputScript2of3 = exports.toCompressedPub = exports.toUncompressedPub = void 0;
9
+ const assert = require("assert");
10
+ const noble_ecc_1 = require("../../noble_ecc");
11
+ const networks_1 = require("../../networks");
12
+ const types_1 = require("../types");
13
+ const bitcoinjs = require("bitcoinjs-lib");
14
+ function getPublicKeyBuffer(publicKey, { compressed = true } = {}) {
15
+ const res = noble_ecc_1.ecc.pointCompress(publicKey, compressed);
16
+ if (res === null) {
17
+ throw new Error('invalid public key');
18
+ }
19
+ const buffer = Buffer.from(res);
20
+ assert.strictEqual(buffer.length, compressed ? 33 : 65);
21
+ return buffer;
22
+ }
23
+ function toUncompressedPub(pubkey) {
24
+ return getPublicKeyBuffer(pubkey, { compressed: false });
25
+ }
26
+ exports.toUncompressedPub = toUncompressedPub;
27
+ function toCompressedPub(pubkey) {
28
+ return getPublicKeyBuffer(pubkey, { compressed: true });
29
+ }
30
+ exports.toCompressedPub = toCompressedPub;
31
+ /** create p2sh scripts with uncompressed pubkeys */
32
+ function createLegacySafeOutputScript2of3(pubkeys, network) {
33
+ if (network) {
34
+ if (!networks_1.isBitcoin(network)) {
35
+ throw new Error(`unsupported network for legacy safe output script: ${network.coin}`);
36
+ }
37
+ }
38
+ if (!types_1.isTriple(pubkeys)) {
39
+ throw new Error(`must provide pubkey triple`);
40
+ }
41
+ pubkeys.forEach((key) => {
42
+ if (key.length !== pubkeys[0].length) {
43
+ throw new Error(`all pubkeys must have the same length`);
44
+ }
45
+ if (key.length !== 65 && key.length !== 33) {
46
+ // V1 Safe BTC wallets could contain either uncompressed or compressed pubkeys
47
+ throw new Error(`Unexpected key length ${key.length}, neither compressed nor uncompressed.`);
48
+ }
49
+ });
50
+ const script2of3 = bitcoinjs.payments.p2ms({ m: 2, pubkeys });
51
+ assert(script2of3.output);
52
+ const scriptPubKey = bitcoinjs.payments.p2sh({ redeem: script2of3 });
53
+ assert(scriptPubKey);
54
+ assert(scriptPubKey.output);
55
+ return {
56
+ scriptPubKey: scriptPubKey.output,
57
+ redeemScript: script2of3.output,
58
+ };
59
+ }
60
+ exports.createLegacySafeOutputScript2of3 = createLegacySafeOutputScript2of3;
61
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vbGVnYWN5c2FmZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7S0FJSzs7O0FBRUwsaUNBQWlDO0FBQ2pDLCtDQUFnRDtBQUNoRCw2Q0FBb0Q7QUFDcEQsb0NBQW9DO0FBQ3BDLDJDQUEyQztBQUUzQyxTQUFTLGtCQUFrQixDQUFDLFNBQWlCLEVBQUUsRUFBRSxVQUFVLEdB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3JFYWNoKChrZXkpID0+IHtcbiAgICBpZiAoa2V5Lmxlbmd0aCAhPT0gcHVia2V5c1swXS5sZW5ndGgpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcihgYWxsIHB1YmtleXMgbXVzdCBoYXZlIHRoZSBzYW1lIGxlbmd0aGApO1xuICAgIH1cbiAgICBpZiAoa2V5Lmxlbmd0aCAhPT0gNjUgJiYga2V5Lmxlbmd0aCAhPT0gMzMpIHtcbiAgICAgIC8vIFYxIFNhZmUgQlRDIHdhbGxldHMgY291bGQgY29udGFpbiBlaXRoZXIgdW5jb21wcmVzc2VkIG9yIGNvbXByZXNzZWQgcHVia2V5c1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmV4cGVjdGVkIGtleSBsZW5ndGggJHtrZXkubGVuZ3RofSwgbmVpdGhlciBjb21wcmVzc2VkIG5vciB1bmNvbXByZXNzZWQuYCk7XG4gICAgfVxuICB9KTtcblxuICBjb25zdCBzY3JpcHQyb2YzID0gYml0Y29pbmpzLnBheW1lbnRzLnAybXMoeyBtOiAyLCBwdWJrZXlzIH0pO1xuICBhc3NlcnQoc2NyaXB0Mm9mMy5vdXRwdXQpO1xuXG4gIGNvbnN0IHNjcmlwdFB1YktleSA9IGJpdGNvaW5qcy5wYXltZW50cy5wMnNoKHsgcmVkZWVtOiBzY3JpcHQyb2YzIH0pO1xuICBhc3NlcnQoc2NyaXB0UHViS2V5KTtcbiAgYXNzZXJ0KHNjcmlwdFB1YktleS5vdXRwdXQpO1xuXG4gIHJldHVybiB7XG4gICAgc2NyaXB0UHViS2V5OiBzY3JpcHRQdWJLZXkub3V0cHV0LFxuICAgIHJlZGVlbVNjcmlwdDogc2NyaXB0Mm9mMy5vdXRwdXQsXG4gIH07XG59XG4iXX0=
@@ -0,0 +1,10 @@
1
+ /// <reference types="node" />
2
+ import { PsbtOpts, UtxoPsbt } from '../UtxoPsbt';
3
+ import { Network } from '../../networks';
4
+ import { Psbt as PsbtBase } from 'bip174';
5
+ import { LitecoinTransaction } from './LitecoinTransaction';
6
+ export declare class LitecoinPsbt extends UtxoPsbt<LitecoinTransaction<bigint>> {
7
+ protected static transactionFromBuffer(buffer: Buffer, network: Network): LitecoinTransaction<bigint>;
8
+ static createPsbt(opts: PsbtOpts, data?: PsbtBase): LitecoinPsbt;
9
+ }
10
+ //# sourceMappingURL=LitecoinPsbt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LitecoinPsbt.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/LitecoinPsbt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,YAAa,SAAQ,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACrE,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAIrG,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,YAAY;CAMjE"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LitecoinPsbt = void 0;
4
+ const UtxoPsbt_1 = require("../UtxoPsbt");
5
+ const bip174_1 = require("bip174");
6
+ const bitcoinjs_lib_1 = require("bitcoinjs-lib");
7
+ const LitecoinTransaction_1 = require("./LitecoinTransaction");
8
+ class LitecoinPsbt extends UtxoPsbt_1.UtxoPsbt {
9
+ static transactionFromBuffer(buffer, network) {
10
+ return LitecoinTransaction_1.LitecoinTransaction.fromBuffer(buffer, false, 'bigint', network);
11
+ }
12
+ static createPsbt(opts, data) {
13
+ return new LitecoinPsbt(opts, data || new bip174_1.Psbt(new bitcoinjs_lib_1.PsbtTransaction({ tx: new LitecoinTransaction_1.LitecoinTransaction(opts.network) })));
14
+ }
15
+ }
16
+ exports.LitecoinPsbt = LitecoinPsbt;
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTGl0ZWNvaW5Qc2J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JpdGdvL2xpdGVjb2luL0xpdGVjb2luUHNidC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQ0FBaUQ7QUFFakQsbUNBQTBDO0FBQzFDLGlEQUFnRDtBQUNoRCwrREFBNEQ7QUFFNUQsTUFBYSxZQUFhLFNBQVEsbUJBQXFDO0lBQzNELE1BQU0sQ0FBQyxxQkFBcUIsQ0FBQyxNQUFjLEVBQUUsT0FBZ0I7UUFDckUsT0FBTyx5Q0FBbUIsQ0FBQyxVQUFVLENBQVMsTUFBTSxFQUFFLEtBQUssRUFBRSxRQUFRLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDbEYsQ0FBQztJQUVELE1BQU0sQ0FBQyxVQUFVLENBQUMsSUFBYyxFQUFFLElBQWU7UUFDL0MsT0FBTyxJQUFJLFlBQVksQ0FDckIsSUFBSSxFQUNKLElBQUksSUFBSSxJQUFJLGFBQVEsQ0FBQyxJQUFJLCtCQUFlLENBQUMsRUFBRSxFQUFFLEVBQUUsSUFBSSx5Q0FBbUIsQ0FBUyxJQUFJLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQ2pHLENBQUM7SUFDSixDQUFDO0NBQ0Y7QUFYRCxvQ0FXQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFBzYnRPcHRzLCBVdHhvUHNidCB9IGZyb20gJy4uL1V0eG9Qc2J0JztcbmltcG9ydCB7IE5ldHdvcmsgfSBmcm9tICcuLi8uLi9uZXR3b3Jrcyc7XG5pbXBvcnQgeyBQc2J0IGFzIFBzYnRCYXNlIH0gZnJvbSAnYmlwMTc0JztcbmltcG9ydCB7IFBzYnRUcmFuc2FjdGlvbiB9IGZyb20gJ2JpdGNvaW5qcy1saWInO1xuaW1wb3J0IHsgTGl0ZWNvaW5UcmFuc2FjdGlvbiB9IGZyb20gJy4vTGl0ZWNvaW5UcmFuc2FjdGlvbic7XG5cbmV4cG9ydCBjbGFzcyBMaXRlY29pblBzYnQgZXh0ZW5kcyBVdHhvUHNidDxMaXRlY29pblRyYW5zYWN0aW9uPGJpZ2ludD4+IHtcbiAgcHJvdGVjdGVkIHN0YXRpYyB0cmFuc2FjdGlvbkZyb21CdWZmZXIoYnVmZmVyOiBCdWZmZXIsIG5ldHdvcms6IE5ldHdvcmspOiBMaXRlY29pblRyYW5zYWN0aW9uPGJpZ2ludD4ge1xuICAgIHJldHVybiBMaXRlY29pblRyYW5zYWN0aW9uLmZyb21CdWZmZXI8YmlnaW50PihidWZmZXIsIGZhbHNlLCAnYmlnaW50JywgbmV0d29yayk7XG4gIH1cblxuICBzdGF0aWMgY3JlYXRlUHNidChvcHRzOiBQc2J0T3B0cywgZGF0YT86IFBzYnRCYXNlKTogTGl0ZWNvaW5Qc2J0IHtcbiAgICByZXR1cm4gbmV3IExpdGVjb2luUHNidChcbiAgICAgIG9wdHMsXG4gICAgICBkYXRhIHx8IG5ldyBQc2J0QmFzZShuZXcgUHNidFRyYW5zYWN0aW9uKHsgdHg6IG5ldyBMaXRlY29pblRyYW5zYWN0aW9uPGJpZ2ludD4ob3B0cy5uZXR3b3JrKSB9KSlcbiAgICApO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,16 @@
1
+ /// <reference types="node" />
2
+ import { UtxoTransaction } from '../UtxoTransaction';
3
+ import { Network, networks } from '../../networks';
4
+ export declare type LitecoinNetwork = typeof networks.litecoin | typeof networks.litecoinTest;
5
+ /**
6
+ * We only care about reading a transaction that can have a potentially different advanced transaction flag,
7
+ * but we dont need to write one.
8
+ */
9
+ export declare class LitecoinTransaction<TNumber extends number | bigint = number> extends UtxoTransaction<TNumber> {
10
+ static MWEB_PEGOUT_TX_FLAG: number;
11
+ constructor(network: Network, tx?: LitecoinTransaction<bigint | number>, amountType?: 'bigint' | 'number');
12
+ protected static newTransaction<TNumber extends number | bigint = number>(network: Network, transaction?: LitecoinTransaction<number | bigint>, amountType?: 'number' | 'bigint'): LitecoinTransaction<TNumber>;
13
+ clone<TN2 extends bigint | number = TNumber>(amountType?: 'number' | 'bigint'): LitecoinTransaction<TN2>;
14
+ static fromBuffer<TNumber extends number | bigint = number>(buffer: Buffer, noStrict: boolean, amountType?: 'number' | 'bigint', network?: LitecoinNetwork): LitecoinTransaction<TNumber>;
15
+ }
16
+ //# sourceMappingURL=LitecoinTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LitecoinTransaction.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/LitecoinTransaction.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAc,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/D,oBAAY,eAAe,GAAG,OAAO,QAAQ,CAAC,QAAQ,GAAG,OAAO,QAAQ,CAAC,YAAY,CAAC;AAEtF;;;GAGG;AACH,qBAAa,mBAAmB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IACzG,MAAM,CAAC,mBAAmB,SAAQ;gBAEtB,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ;IAQzG,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EACtE,OAAO,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC,EAClD,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAC/B,mBAAmB,CAAC,OAAO,CAAC;IAI/B,KAAK,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,mBAAmB,CAAC,GAAG,CAAC;IAIxG,MAAM,CAAC,UAAU,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EACxD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,EACjB,UAAU,GAAE,QAAQ,GAAG,QAAmB,EAC1C,OAAO,CAAC,EAAE,eAAe,GACxB,mBAAmB,CAAC,OAAO,CAAC;CAuBhC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LitecoinTransaction = void 0;
4
+ const bufferutils_1 = require("bitcoinjs-lib/src/bufferutils");
5
+ const UtxoTransaction_1 = require("../UtxoTransaction");
6
+ const networks_1 = require("../../networks");
7
+ /**
8
+ * We only care about reading a transaction that can have a potentially different advanced transaction flag,
9
+ * but we dont need to write one.
10
+ */
11
+ class LitecoinTransaction extends UtxoTransaction_1.UtxoTransaction {
12
+ constructor(network, tx, amountType) {
13
+ super(network, tx, amountType);
14
+ if (!networks_1.isLitecoin(network)) {
15
+ throw new Error(`invalid network`);
16
+ }
17
+ }
18
+ static newTransaction(network, transaction, amountType) {
19
+ return new LitecoinTransaction(network, transaction, amountType);
20
+ }
21
+ clone(amountType) {
22
+ return new LitecoinTransaction(this.network, this, amountType);
23
+ }
24
+ static fromBuffer(buffer, noStrict, amountType = 'number', network) {
25
+ if (!network) {
26
+ throw new Error(`must provide network`);
27
+ }
28
+ const bufferReader = new bufferutils_1.BufferReader(buffer);
29
+ const txVersion = bufferReader.readInt32();
30
+ const marker = bufferReader.readUInt8();
31
+ const flag = bufferReader.readUInt8();
32
+ if (marker === LitecoinTransaction.ADVANCED_TRANSACTION_MARKER &&
33
+ flag === LitecoinTransaction.MWEB_PEGOUT_TX_FLAG) {
34
+ // Litecoin has an MWEB advanced transaction marker. Slice out the marker and 5th to last byte and read like a normal transaction
35
+ const bufferWriter = new bufferutils_1.BufferWriter(Buffer.allocUnsafe(buffer.length - 3));
36
+ bufferWriter.writeUInt32(txVersion);
37
+ bufferWriter.writeSlice(buffer.slice(6, buffer.length - 5));
38
+ bufferWriter.writeSlice(buffer.slice(buffer.length - 4, buffer.length));
39
+ return super.fromBuffer(bufferWriter.buffer, noStrict, amountType, network);
40
+ }
41
+ return super.fromBuffer(buffer, noStrict, amountType, network);
42
+ }
43
+ }
44
+ exports.LitecoinTransaction = LitecoinTransaction;
45
+ LitecoinTransaction.MWEB_PEGOUT_TX_FLAG = 0x08;
46
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTGl0ZWNvaW5UcmFuc2FjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iaXRnby9saXRlY29pbi9MaXRlY29pblRyYW5zYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLCtEQUEyRTtBQUUzRSx3REFBcUQ7QUFDckQsNkNBQStEO0FBSS9EOzs7R0FHRztBQUNILE1BQWEsbUJBQThELFNBQVEsaUNBQXdCO0lBR3pHLFlBQVksT0FBZ0IsRUFBRSxFQUF5QyxFQUFFLFVBQWdDO1FBQ3ZHLEtBQUssQ0FBQyxPQUFPLEVBQUUsRUFBRSxFQUFFLFVBQVUsQ0FBQyxDQUFDO1FBRS9CLElBQUksQ0FBQyxxQkFBVSxDQUFDLE9BQU8sQ0FBQyxFQUFFO1lBQ3hCLE1BQU0sSUFB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TUFSS0VSICYmXG4gICAgICBmbGFnID09PSBMaXRlY29pblRyYW5zYWN0aW9uLk1XRUJfUEVHT1VUX1RYX0ZMQUdcbiAgICApIHtcbiAgICAgIC8vIExpdGVjb2luIGhhcyBhbiBNV0VCIGFkdmFuY2VkIHRyYW5zYWN0aW9uIG1hcmtlci4gU2xpY2Ugb3V0IHRoZSBtYXJrZXIgYW5kIDV0aCB0byBsYXN0IGJ5dGUgIGFuZCByZWFkIGxpa2UgYSBub3JtYWwgdHJhbnNhY3Rpb25cbiAgICAgIGNvbnN0IGJ1ZmZlcldyaXRlciA9IG5ldyBCdWZmZXJXcml0ZXIoQnVmZmVyLmFsbG9jVW5zYWZlKGJ1ZmZlci5sZW5ndGggLSAzKSk7XG4gICAgICBidWZmZXJXcml0ZXIud3JpdGVVSW50MzIodHhWZXJzaW9uKTtcbiAgICAgIGJ1ZmZlcldyaXRlci53cml0ZVNsaWNlKGJ1ZmZlci5zbGljZSg2LCBidWZmZXIubGVuZ3RoIC0gNSkpO1xuICAgICAgYnVmZmVyV3JpdGVyLndyaXRlU2xpY2UoYnVmZmVyLnNsaWNlKGJ1ZmZlci5sZW5ndGggLSA0LCBidWZmZXIubGVuZ3RoKSk7XG4gICAgICByZXR1cm4gc3VwZXIuZnJvbUJ1ZmZlcihidWZmZXJXcml0ZXIuYnVmZmVyLCBub1N0cmljdCwgYW1vdW50VHlwZSwgbmV0d29yayk7XG4gICAgfVxuICAgIHJldHVybiBzdXBlci5mcm9tQnVmZmVyKGJ1ZmZlciwgbm9TdHJpY3QsIGFtb3VudFR5cGUsIG5ldHdvcmspO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,10 @@
1
+ import * as bitcoinjs from 'bitcoinjs-lib';
2
+ import { UtxoTransactionBuilder } from '../UtxoTransactionBuilder';
3
+ import { Network } from '../../networks';
4
+ import { UtxoTransaction } from '../UtxoTransaction';
5
+ import { LitecoinTransaction } from './LitecoinTransaction';
6
+ export declare class LitecoinTransactionBuilder<TNumber extends number | bigint = number> extends UtxoTransactionBuilder<TNumber, LitecoinTransaction<TNumber>> {
7
+ protected static newTransactionBuilder<TNumber extends number | bigint>(network: Network, tx: UtxoTransaction<TNumber>): LitecoinTransactionBuilder<TNumber>;
8
+ protected createInitialTransaction(network: Network, tx?: bitcoinjs.Transaction<TNumber>): LitecoinTransaction<TNumber>;
9
+ }
10
+ //# sourceMappingURL=LitecoinTransactionBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LitecoinTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/LitecoinTransactionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,0BAA0B,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,sBAAsB,CAC9G,OAAO,EACP,mBAAmB,CAAC,OAAO,CAAC,CAC7B;IACC,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EACpE,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,GAC3B,0BAA0B,CAAC,OAAO,CAAC;IAItC,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,OAAO,EAChB,EAAE,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,GAClC,mBAAmB,CAAC,OAAO,CAAC;CAGhC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LitecoinTransactionBuilder = void 0;
4
+ const UtxoTransactionBuilder_1 = require("../UtxoTransactionBuilder");
5
+ const LitecoinTransaction_1 = require("./LitecoinTransaction");
6
+ class LitecoinTransactionBuilder extends UtxoTransactionBuilder_1.UtxoTransactionBuilder {
7
+ static newTransactionBuilder(network, tx) {
8
+ return new LitecoinTransactionBuilder(network, tx);
9
+ }
10
+ createInitialTransaction(network, tx) {
11
+ return new LitecoinTransaction_1.LitecoinTransaction(network, tx);
12
+ }
13
+ }
14
+ exports.LitecoinTransactionBuilder = LitecoinTransactionBuilder;
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTGl0ZWNvaW5UcmFuc2FjdGlvbkJ1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vbGl0ZWNvaW4vTGl0ZWNvaW5UcmFuc2FjdGlvbkJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsc0VBQW1FO0FBR25FLCtEQUE0RDtBQUU1RCxNQUFhLDBCQUFxRSxTQUFRLCtDQUd6RjtJQUNXLE1BQU0sQ0FBQyxxQkFBcUIsQ0FDcEMsT0FBZ0IsRUFDaEIsRUFBNEI7UUFFNUIsT0FBTyxJQUFJLDBCQUEwQixDQUFVLE9BQU8sRUFBRSxFQUFFLENBQUMsQ0FBQztJQUM5RCxDQUFDO0lBRVMsd0JBQXdCLENBQ2hDLE9BQWdCLEVBQ2hCLEVBQW1DO1FBRW5DLE9BQU8sSUFBSSx5Q0FBbUIsQ0FBVSxPQUFPLEVBQUUsRUFBa0MsQ0FBQyxDQUFDO0lBQ3ZGLENBQUM7Q0FDRjtBQWpCRCxnRUFpQkMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBiaXRjb2luanMgZnJvbSAnYml0Y29pbmpzLWxpYic7XG5cbmltcG9ydCB7IFV0eG9UcmFuc2FjdGlvbkJ1aWxkZXIgfSBmcm9tIC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LCB0eCBhcyBMaXRlY29pblRyYW5zYWN0aW9uPFROdW1iZXI+KTtcbiAgfVxufVxuIl19
@@ -0,0 +1,4 @@
1
+ export * from './LitecoinPsbt';
2
+ export * from './LitecoinTransaction';
3
+ export * from './LitecoinTransactionBuilder';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./LitecoinPsbt"), exports);
14
+ __exportStar(require("./LitecoinTransaction"), exports);
15
+ __exportStar(require("./LitecoinTransactionBuilder"), exports);
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vbGl0ZWNvaW4vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsaURBQStCO0FBQy9CLHdEQUFzQztBQUN0QywrREFBNkMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL0xpdGVjb2luUHNidCc7XG5leHBvcnQgKiBmcm9tICcuL0xpdGVjb2luVHJhbnNhY3Rpb24nO1xuZXhwb3J0ICogZnJvbSAnLi9MaXRlY29pblRyYW5zYWN0aW9uQnVpbGRlcic7XG4iXX0=
@@ -6,7 +6,7 @@ export { scriptTypeForChain } from './wallet/chains';
6
6
  export declare const scriptTypeP2shP2pk = "p2shP2pk";
7
7
  export declare type ScriptTypeP2shP2pk = typeof scriptTypeP2shP2pk;
8
8
  export declare const scriptTypes2Of3: readonly ["p2sh", "p2shP2wsh", "p2wsh", "p2tr", "p2trMusig2"];
9
- export declare type ScriptType2Of3 = typeof scriptTypes2Of3[number];
9
+ export declare type ScriptType2Of3 = (typeof scriptTypes2Of3)[number];
10
10
  export declare function isScriptType2Of3(t: string): t is ScriptType2Of3;
11
11
  export declare type ScriptType = ScriptTypeP2shP2pk | ScriptType2Of3;
12
12
  /**
@@ -65,6 +65,8 @@ export declare function checkXOnlyPublicKey(b: Buffer): Buffer;
65
65
  * Validates size of the pub key for 32 bytes and returns the same iff true.
66
66
  */
67
67
  export declare function checkPlainPublicKey(b: Buffer): Buffer;
68
+ export declare function checkTapMerkleRoot(b: Buffer): Buffer;
69
+ export declare function checkTxHash(b: Buffer): Buffer;
68
70
  export declare function createPaymentP2tr(pubkeys: Triple<Buffer>, redeemIndex?: number | {
69
71
  signer: Buffer;
70
72
  cosigner: Buffer;
@@ -1 +1 @@
1
- {"version":3,"file":"outputScripts.d.ts","sourceRoot":"","sources":["../../../src/bitgo/outputScripts.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,OAAO,EAA0D,MAAM,IAAI,CAAC;AAErF,OAAO,EAAY,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,oBAAY,kBAAkB,GAAG,O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