utxo-lib 1.0.8 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) 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/base_crypto.d.ts +14 -0
  8. package/dist/src/base_crypto.d.ts.map +1 -0
  9. package/dist/src/base_crypto.js +215 -0
  10. package/dist/src/bitgo/Musig2.d.ts +115 -17
  11. package/dist/src/bitgo/Musig2.d.ts.map +1 -1
  12. package/dist/src/bitgo/Musig2.js +283 -101
  13. package/dist/src/bitgo/PsbtUtil.d.ts +59 -0
  14. package/dist/src/bitgo/PsbtUtil.d.ts.map +1 -0
  15. package/dist/src/bitgo/PsbtUtil.js +91 -0
  16. package/dist/src/bitgo/UtxoPsbt.d.ts +180 -47
  17. package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
  18. package/dist/src/bitgo/UtxoPsbt.js +657 -121
  19. package/dist/src/bitgo/UtxoTransaction.js +2 -2
  20. package/dist/src/bitgo/bitcoincash/address.js +2 -2
  21. package/dist/src/bitgo/index.d.ts +11 -0
  22. package/dist/src/bitgo/index.d.ts.map +1 -1
  23. package/dist/src/bitgo/index.js +6 -2
  24. package/dist/src/bitgo/legacysafe/index.d.ts +15 -0
  25. package/dist/src/bitgo/legacysafe/index.d.ts.map +1 -0
  26. package/dist/src/bitgo/legacysafe/index.js +61 -0
  27. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +10 -0
  28. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +1 -0
  29. package/dist/src/bitgo/litecoin/LitecoinPsbt.js +17 -0
  30. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +16 -0
  31. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +1 -0
  32. package/dist/src/bitgo/litecoin/LitecoinTransaction.js +46 -0
  33. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +10 -0
  34. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +1 -0
  35. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +15 -0
  36. package/dist/src/bitgo/litecoin/index.d.ts +4 -0
  37. package/dist/src/bitgo/litecoin/index.d.ts.map +1 -0
  38. package/dist/src/bitgo/litecoin/index.js +16 -0
  39. package/dist/src/bitgo/outputScripts.d.ts +3 -1
  40. package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
  41. package/dist/src/bitgo/outputScripts.js +20 -12
  42. package/dist/src/bitgo/parseInput.d.ts +49 -20
  43. package/dist/src/bitgo/parseInput.d.ts.map +1 -1
  44. package/dist/src/bitgo/parseInput.js +110 -26
  45. package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
  46. package/dist/src/bitgo/psbt/fromHalfSigned.js +9 -6
  47. package/dist/src/bitgo/psbt/scriptTypes.js +3 -3
  48. package/dist/src/bitgo/signature.d.ts +3 -3
  49. package/dist/src/bitgo/signature.d.ts.map +1 -1
  50. package/dist/src/bitgo/signature.js +48 -16
  51. package/dist/src/bitgo/transaction.d.ts +18 -3
  52. package/dist/src/bitgo/transaction.d.ts.map +1 -1
  53. package/dist/src/bitgo/transaction.js +28 -15
  54. package/dist/src/bitgo/types.d.ts +2 -0
  55. package/dist/src/bitgo/types.d.ts.map +1 -1
  56. package/dist/src/bitgo/types.js +1 -1
  57. package/dist/src/bitgo/wallet/Psbt.d.ts +104 -12
  58. package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
  59. package/dist/src/bitgo/wallet/Psbt.js +285 -70
  60. package/dist/src/bitgo/wallet/Unspent.d.ts +28 -0
  61. package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
  62. package/dist/src/bitgo/wallet/Unspent.js +172 -68
  63. package/dist/src/bitgo/wallet/WalletOutput.d.ts +17 -1
  64. package/dist/src/bitgo/wallet/WalletOutput.d.ts.map +1 -1
  65. package/dist/src/bitgo/wallet/WalletOutput.js +64 -23
  66. package/dist/src/bitgo/wallet/chains.d.ts +2 -2
  67. package/dist/src/bitgo/wallet/chains.d.ts.map +1 -1
  68. package/dist/src/bitgo/wallet/chains.js +1 -1
  69. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts +0 -1
  70. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
  71. package/dist/src/bitgo/zcash/ZcashPsbt.js +7 -16
  72. package/dist/src/bitgo/zcash/ZcashTransaction.js +2 -2
  73. package/dist/src/musig.d.ts +390 -0
  74. package/dist/src/musig.d.ts.map +1 -0
  75. package/dist/src/musig.js +447 -0
  76. package/dist/src/networks.d.ts +1 -2
  77. package/dist/src/networks.d.ts.map +1 -1
  78. package/dist/src/networks.js +22 -29
  79. package/dist/src/noble_ecc.d.ts +1 -1
  80. package/dist/src/noble_ecc.d.ts.map +1 -1
  81. package/dist/src/noble_ecc.js +11 -7
  82. package/dist/src/payments/p2tr.d.ts.map +1 -1
  83. package/dist/src/payments/p2tr.js +21 -19
  84. package/dist/src/payments/p2tr_ns.js +2 -3
  85. package/dist/src/taproot.d.ts +16 -0
  86. package/dist/src/taproot.d.ts.map +1 -1
  87. package/dist/src/taproot.js +45 -4
  88. package/dist/src/testutil/index.d.ts +2 -0
  89. package/dist/src/testutil/index.d.ts.map +1 -1
  90. package/dist/src/testutil/index.js +3 -1
  91. package/dist/src/testutil/keys.d.ts +3 -0
  92. package/dist/src/testutil/keys.d.ts.map +1 -1
  93. package/dist/src/testutil/keys.js +17 -2
  94. package/dist/src/testutil/mock.d.ts +1 -1
  95. package/dist/src/testutil/mock.d.ts.map +1 -1
  96. package/dist/src/testutil/mock.js +12 -4
  97. package/dist/src/testutil/psbt.d.ts +89 -0
  98. package/dist/src/testutil/psbt.d.ts.map +1 -0
  99. package/dist/src/testutil/psbt.js +150 -0
  100. package/dist/src/testutil/transaction.d.ts +70 -0
  101. package/dist/src/testutil/transaction.d.ts.map +1 -0
  102. package/dist/src/testutil/transaction.js +107 -0
  103. package/dist/src/transaction_builder.js +2 -2
  104. package/package.json +6 -7
@@ -33,7 +33,6 @@ function isPlainPubkeys(pubkeys) {
33
33
  }
34
34
  // output: OP_1 {witnessProgram}
35
35
  function p2tr(a, opts) {
36
- var _a, _b, _c, _d;
37
36
  if (!a.address && !a.pubkey && !a.pubkeys && !(a.redeems && a.redeems.length) && !a.output && !a.witness) {
38
37
  throw new TypeError('Not enough data');
39
38
  }
@@ -110,7 +109,6 @@ function p2tr(a, opts) {
110
109
  }
111
110
  });
112
111
  bitcoinjs_lib_1.lazy.prop(o, 'internalPubkey', () => {
113
- var _a;
114
112
  if (a.pubkey) {
115
113
  // single pubkey
116
114
  return a.pubkey;
@@ -121,12 +119,12 @@ function p2tr(a, opts) {
121
119
  else if (a.pubkeys && a.pubkeys.length > 1) {
122
120
  // multiple pubkeys
123
121
  if (isPlainPubkeys(a.pubkeys)) {
124
- return Buffer.from(noble_ecc_1.musig.getXOnlyPubkey(noble_ecc_1.musig.keyAgg(noble_ecc_1.musig.keySort(a.pubkeys))));
122
+ return Buffer.from(noble_ecc_1.musig.getXOnlyPubkey(noble_ecc_1.musig.keyAgg(a.pubkeys)));
125
123
  }
126
124
  return Buffer.from(taproot.aggregateMuSigPubkeys(ecc, a.pubkeys));
127
125
  }
128
126
  else if (_parsedControlBlock()) {
129
- return (_a = _parsedControlBlock()) === null || _a === void 0 ? void 0 : _a.internalPubkey;
127
+ return _parsedControlBlock()?.internalPubkey;
130
128
  }
131
129
  else {
132
130
  // If there is no key path spending condition, we use an internal key with unknown secret key.
@@ -138,14 +136,9 @@ function p2tr(a, opts) {
138
136
  return H;
139
137
  }
140
138
  });
141
- const _taprootPubkey = bitcoinjs_lib_1.lazy.value(() => {
142
- var _a;
139
+ bitcoinjs_lib_1.lazy.prop(o, 'taptreeRoot', () => {
143
140
  const parsedControlBlock = _parsedControlBlock();
144
141
  const parsedWitness = _parsedWitness();
145
- // Refuse to create an unspendable key
146
- if (!a.pubkey && !(a.pubkeys && a.pubkeys.length) && !a.redeems && !parsedControlBlock) {
147
- return;
148
- }
149
142
  let taptreeRoot;
150
143
  // Prefer to get the root via the control block because not all redeems may
151
144
  // be available
@@ -161,8 +154,16 @@ function p2tr(a, opts) {
161
154
  taptreeRoot = taproot.getTaptreeRoot(ecc, parsedControlBlock, tapscript);
162
155
  }
163
156
  if (!taptreeRoot && _taprootPaths())
164
- taptreeRoot = (_a = _taprootPaths()) === null || _a === void 0 ? void 0 : _a.root;
165
- return taproot.tapTweakPubkey(ecc, o === null || o === void 0 ? void 0 : o.internalPubkey, taptreeRoot);
157
+ taptreeRoot = _taprootPaths()?.root;
158
+ return taptreeRoot;
159
+ });
160
+ const _taprootPubkey = bitcoinjs_lib_1.lazy.value(() => {
161
+ const taptreeRoot = o.taptreeRoot;
162
+ // Refuse to create an unspendable key
163
+ if (!a.pubkey && !(a.pubkeys && a.pubkeys.length) && !a.redeems && !taptreeRoot) {
164
+ return;
165
+ }
166
+ return taproot.tapTweakPubkey(ecc, o?.internalPubkey, taptreeRoot);
166
167
  });
167
168
  bitcoinjs_lib_1.lazy.prop(o, 'tapTree', () => {
168
169
  if (!a.redeems)
@@ -185,8 +186,7 @@ function p2tr(a, opts) {
185
186
  };
186
187
  });
187
188
  bitcoinjs_lib_1.lazy.prop(o, 'address', () => {
188
- var _a;
189
- const pubkey = _outputPubkey() || (_taprootPubkey() && ((_a = _taprootPubkey()) === null || _a === void 0 ? void 0 : _a.xOnlyPubkey));
189
+ const pubkey = _outputPubkey() || (_taprootPubkey() && _taprootPubkey()?.xOnlyPubkey);
190
190
  // only encode the 32 byte witness program as bech32m
191
191
  const words = bech32m.toWords(pubkey);
192
192
  words.unshift(0x01);
@@ -284,21 +284,23 @@ function p2tr(a, opts) {
284
284
  throw new TypeError('Output is invalid');
285
285
  }
286
286
  // if we're passed both an output script and an address, ensure they match
287
- if (a.address && _outputPubkey && !((_a = _outputPubkey()) === null || _a === void 0 ? void 0 : _a.equals((_b = _address()) === null || _b === void 0 ? void 0 : _b.data))) {
287
+ if (a.address && _outputPubkey && !_outputPubkey()?.equals(_address()?.data)) {
288
288
  throw new TypeError('mismatch between address & output');
289
289
  }
290
- if (taprootPubkey && _outputPubkey && !((_c = _outputPubkey()) === null || _c === void 0 ? void 0 : _c.equals(taprootPubkey.xOnlyPubkey))) {
290
+ // Wrapping `taprootPubkey.xOnlyPubkey` in Buffer because of a peculiar issue in the frontend
291
+ // where a polyfill for Buffer is used. Refer: https://bitgoinc.atlassian.net/browse/BG-61420
292
+ if (taprootPubkey && _outputPubkey && !_outputPubkey()?.equals(Buffer.from(taprootPubkey.xOnlyPubkey))) {
291
293
  throw new TypeError('mismatch between output and taproot pubkey');
292
294
  }
293
295
  }
294
296
  if (a.address) {
295
- if (taprootPubkey && !((_d = _address()) === null || _d === void 0 ? void 0 : _d.data.equals(taprootPubkey.xOnlyPubkey))) {
297
+ if (taprootPubkey && !_address()?.data.equals(Buffer.from(taprootPubkey.xOnlyPubkey))) {
296
298
  throw new TypeError('mismatch between address and taproot pubkey');
297
299
  }
298
300
  }
299
301
  const parsedControlBlock = _parsedControlBlock();
300
302
  if (parsedControlBlock) {
301
- if (!parsedControlBlock.internalPubkey.equals(o === null || o === void 0 ? void 0 : o.internalPubkey)) {
303
+ if (!parsedControlBlock.internalPubkey.equals(o?.internalPubkey)) {
302
304
  throw new TypeError('Internal pubkey mismatch');
303
305
  }
304
306
  if (taprootPubkey && parsedControlBlock.parity !== taprootPubkey.parity) {
@@ -345,4 +347,4 @@ function p2tr(a, opts) {
345
347
  return Object.assign(o, a);
346
348
  }
347
349
  exports.p2tr = p2tr;
348
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicDJ0ci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYXltZW50cy9wMnRyLnRzIl0sIm5hbWV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IHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcigndW5leHBlY3RlZCBzaWduYXR1cmUgd2l0aCBzY3JpcHQgcGF0aCB3aXRuZXNzJyk7XG4gICAgICB9XG5cbiAgICAgIGlmIChhLmNvbnRyb2xCbG9jayAmJiAhYS5jb250cm9sQmxvY2suZXF1YWxzKHBhcnNlZFdpdG5lc3MuY29udHJvbEJsb2NrKSkge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdjb250cm9sIGJsb2NrIG1pc21hdGNoJyk7XG4gICAgICB9XG5cbiAgICAgIGlmIChhLmFubmV4ICYmIHBhcnNlZFdpdG5lc3MuYW5uZXggJiYgIWEuYW5uZXguZXF1YWxzKHBhcnNlZFdpdG5lc3MuYW5uZXgpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ2FubmV4IG1pc21hdGNoJyk7XG4gICAgICB9XG5cbiAgICAgIGlmIChjaG9zZW5SZWRlZW0gJiYgY2hvc2VuUmVkZWVtLm91dHB1dCAmJiAhY2hvc2VuUmVkZWVtLm91dHB1dC5lcXVhbHMocGFyc2VkV2l0bmVzcy50YXBzY3JpcHQpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ3RhcHNjcmlwdCBtaXNtYXRjaCcpO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBPYmplY3QuYXNzaWduKG8sIGEpO1xufVxuIl19
@@ -62,10 +62,9 @@ function p2tr_ns(a, opts) {
62
62
  return chunks.filter((_, index) => index % 2 === 0);
63
63
  });
64
64
  bitcoinjs_lib_1.lazy.prop(o, 'signatures', () => {
65
- var _a;
66
65
  if (!a.input)
67
66
  return;
68
- return (_a = bitcoinjs_lib_1.script.decompile(a.input)) === null || _a === void 0 ? void 0 : _a.reverse();
67
+ return bitcoinjs_lib_1.script.decompile(a.input)?.reverse();
69
68
  });
70
69
  bitcoinjs_lib_1.lazy.prop(o, 'input', () => {
71
70
  if (!a.signatures)
@@ -131,4 +130,4 @@ function p2tr_ns(a, opts) {
131
130
  return Object.assign(o, a);
132
131
  }
133
132
  exports.p2tr_ns = p2tr_ns;
134
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicDJ0cl9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYXltZW50cy9wMnRyX25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDBDQUF1QztBQUN2QyxpREFBcUY7QUFFckYsTUFBTSxHQUFHLEdBQUcsc0JBQU8sQ0FBQyxHQUFHLENBQUM7QUFDeEIsTUFBTSxLQUFLLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBRW5DLE1BQU0sZUFBZSxHQUFHLG1CQUFRLENBQUMsT0FBTyxDQUFDO0FBRXpDLFNBQVMsV0FBVyxDQUFDLENBQVcsRUFBRSxDQUFXO0lBQzNDLElBQUksQ0FBQyxDQUFDLE1BQU0sS0FBSyxDQUFDLENBQUMsTUFBTTtRQUFFLE9BQU8sS0FBSyxDQUFDO0lBRXhDLE9BQU8sQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUN0QixPQUFPLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDeEIsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDO0FBRUQsMEJBQTBCO0FBQzFCLHNFQUFzRTtBQUN0RSxTQUFnQixPQUFPLENBQUMsQ0FBVSxFQUFFLElBQWtCO0lBQ3BELElBQUksQ0FBQyxDQUFDLENBQUMsS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLE1BQU0sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLE9BQU8sSUFBSSxDQUFDLENBQUM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XJ5KGlzQWNjZXB0YWJsZVNpZ25hdHVyZSkpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignSW5wdXQgaGFzIGludmFsaWQgc2lnbmF0dXJlKHMpJyk7XG4gICAgICB9XG5cbiAgICAgIGlmIChhLnNpZ25hdHVyZXMgJiYgIXN0YWNrc0VxdWFsKGEuc2lnbmF0dXJlcywgby5zaWduYXR1cmVzISkpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignU2lnbmF0dXJlIG1pc21hdGNoJyk7XG4gICAgICB9XG4gICAgICBpZiAoby5uICE9PSBvLnNpZ25hdHVyZXMhLmxlbmd0aCkge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKGBTaWduYXR1cmUgY291bnQgbWlzbWF0Y2ggKG46ICR7by5ufSwgc2lnbmF0dXJlcy5sZW5ndGg6ICR7by5zaWduYXR1cmVzIS5sZW5ndGh9YCk7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIE9iamVjdC5hc3NpZ24obywgYSk7XG59XG4iXX0=
@@ -44,6 +44,7 @@ export declare function hashTapLeaf(script: Buffer, leafVersion?: number): Buffe
44
44
  * @returns the tagged tapbranch hash
45
45
  */
46
46
  export declare function hashTapBranch(child1: Buffer, child2: Buffer): Buffer;
47
+ export declare function calculateTapTweak(pubkey: Uint8Array, taptreeRoot?: Uint8Array): Uint8Array;
47
48
  /**
48
49
  * Tweaks a privkey, using the tagged hash of its pubkey, and (optionally) a taptree root
49
50
  * @param ecc Elliptic curve implementation
@@ -138,4 +139,19 @@ export declare function getTapleafHash(ecc: TinySecp256k1Interface, controlBlock
138
139
  */
139
140
  export declare function getTaptreeRoot(ecc: TinySecp256k1Interface, controlBlock: Buffer | ControlBlock, tapscript: Buffer, tapleafHash?: Buffer): Buffer;
140
141
  export declare function getTweakedOutputKey(payment: bpayments.Payment): Buffer;
142
+ /**
143
+ * @returns output script for either script path input controlBlock
144
+ * & leafScript OR key path input internalPubKey & taptreeRoot
145
+ */
146
+ export declare function createTaprootOutputScript(p2trArgs: {
147
+ internalPubKey: Buffer;
148
+ taptreeRoot: Buffer;
149
+ } | {
150
+ controlBlock: Buffer;
151
+ leafScript: Buffer;
152
+ }): Buffer;
153
+ /**
154
+ * @returns x-only taproot output key (tapOutputKey)
155
+ */
156
+ export declare function getTaprootOutputKey(outputScript: Buffer | (number | Buffer)[]): Buffer;
141
157
  //# sourceMappingURL=taproot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"taproot.d.ts","sourceRoot":"","sources":["../../src/taproot.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,IAAI,WAAW,EAA0B,MAAM,2BAA2B,CAAC;AAG3F,OAAO,EAAwC,QAAQ,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAG5F;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAkB,CAAC;AACnD,eAAO,MAAM,yBAAyB,MAAO,CAAC;AAE9C,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IACrC,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,wBAAwB,GAAG,IAAI,CAAC;IACtF,eAAe,CAAC,EAAE,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAAC;IACzE,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAAC;IAC/D,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAAC;IAC1D,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAAC;IAChE,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAC1C;AAED;;;;;;GAMG;A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