@arkade-os/sdk 0.5.3 → 0.5.5

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.
Files changed (114) hide show
  1. package/README.md +138 -50
  2. package/dist/adapters/expo.cjs +10 -5
  3. package/dist/adapters/expo.d.cts +13 -8
  4. package/dist/adapters/expo.d.ts +13 -8
  5. package/dist/adapters/expo.js +4 -3
  6. package/dist/{asyncStorageTaskQueue-C9PkPcW_.d.cts → asyncStorageTaskQueue-BbH-THYJ.d.cts} +2 -2
  7. package/dist/{asyncStorageTaskQueue-B3U5gQ-i.d.ts → asyncStorageTaskQueue-BlvkJyTa.d.ts} +2 -2
  8. package/dist/base-C-Y5t_0F.d.cts +359 -0
  9. package/dist/base-C-Y5t_0F.d.ts +359 -0
  10. package/dist/{chunk-OPX2HRWM.js → chunk-4I53THL6.js} +210 -937
  11. package/dist/chunk-4I53THL6.js.map +1 -0
  12. package/dist/{chunk-5WRA66RV.cjs → chunk-5SYUEVJH.cjs} +10 -10
  13. package/dist/chunk-5SYUEVJH.cjs.map +1 -0
  14. package/dist/{chunk-6FL4N4S2.js → chunk-7GIKLFHC.js} +83 -20
  15. package/dist/chunk-7GIKLFHC.js.map +1 -0
  16. package/dist/{chunk-BYPBVHVA.cjs → chunk-AMH7Q3DF.cjs} +61 -935
  17. package/dist/chunk-AMH7Q3DF.cjs.map +1 -0
  18. package/dist/{chunk-P7B4LQ3H.js → chunk-BCA6D255.js} +18 -842
  19. package/dist/chunk-BCA6D255.js.map +1 -0
  20. package/dist/{chunk-T7C3E2HL.js → chunk-CE46RS6L.js} +20 -39
  21. package/dist/chunk-CE46RS6L.js.map +1 -0
  22. package/dist/chunk-DNFTHG73.js +829 -0
  23. package/dist/chunk-DNFTHG73.js.map +1 -0
  24. package/dist/chunk-FDJ734CH.js +882 -0
  25. package/dist/chunk-FDJ734CH.js.map +1 -0
  26. package/dist/chunk-FLPWNMX3.cjs +930 -0
  27. package/dist/chunk-FLPWNMX3.cjs.map +1 -0
  28. package/dist/{chunk-Y4BL3YYX.js → chunk-FVVXCDNE.js} +4 -4
  29. package/dist/chunk-FVVXCDNE.js.map +1 -0
  30. package/dist/{chunk-ZPF4I3K2.cjs → chunk-HQQ4NRXI.cjs} +29 -47
  31. package/dist/chunk-HQQ4NRXI.cjs.map +1 -0
  32. package/dist/chunk-JFJNB7ZH.cjs +884 -0
  33. package/dist/chunk-JFJNB7ZH.cjs.map +1 -0
  34. package/dist/{chunk-KW7ZEWYS.cjs → chunk-KCL5AVML.cjs} +223 -985
  35. package/dist/chunk-KCL5AVML.cjs.map +1 -0
  36. package/dist/{chunk-HAQAWBYG.js → chunk-OO2KEK64.js} +2860 -1366
  37. package/dist/chunk-OO2KEK64.js.map +1 -0
  38. package/dist/{chunk-OUTWUYJ4.cjs → chunk-T254PXSN.cjs} +3337 -1824
  39. package/dist/chunk-T254PXSN.cjs.map +1 -0
  40. package/dist/chunk-V3ZLL5VY.js +380 -0
  41. package/dist/chunk-V3ZLL5VY.js.map +1 -0
  42. package/dist/chunk-X6ZI53DZ.cjs +383 -0
  43. package/dist/chunk-X6ZI53DZ.cjs.map +1 -0
  44. package/dist/{chunk-ZMSM3NOH.cjs → chunk-XWUCNMPN.cjs} +98 -34
  45. package/dist/chunk-XWUCNMPN.cjs.map +1 -0
  46. package/dist/compiler.cjs +50 -0
  47. package/dist/compiler.cjs.map +1 -0
  48. package/dist/compiler.d.cts +38 -0
  49. package/dist/compiler.d.ts +38 -0
  50. package/dist/compiler.js +47 -0
  51. package/dist/compiler.js.map +1 -0
  52. package/dist/contracts/handlers/index.cjs +11 -9
  53. package/dist/contracts/handlers/index.d.cts +6 -4
  54. package/dist/contracts/handlers/index.d.ts +6 -4
  55. package/dist/contracts/handlers/index.js +4 -2
  56. package/dist/{delegate-Cd28gxpM.d.ts → delegate-gGkUnYpi.d.cts} +1 -1
  57. package/dist/{delegate-ByfKszb6.d.cts → delegate-iyDum4fw.d.ts} +1 -1
  58. package/dist/{index-B6X2E7W_.d.ts → index-BWwVnJhU.d.cts} +7 -272
  59. package/dist/{index-DgH_0j14.d.cts → index-Bx-iArDs.d.ts} +7 -272
  60. package/dist/{index-BURzbRup.d.cts → index-DCml4QJn.d.ts} +1090 -1140
  61. package/dist/{index-BURzbRup.d.ts → index-DkyzIzKL.d.cts} +1090 -1140
  62. package/dist/index.cjs +470 -371
  63. package/dist/index.d.cts +687 -410
  64. package/dist/index.d.ts +687 -410
  65. package/dist/index.js +7 -4
  66. package/dist/{wallet-BnmhohgZ.d.ts → keyringDescriptorProvider-CS4w4PWd.d.ts} +427 -372
  67. package/dist/{wallet-BjQugVUt.d.cts → keyringDescriptorProvider-CmHXrIXd.d.cts} +427 -372
  68. package/dist/program-BARSNg3X.d.ts +286 -0
  69. package/dist/program-znrWkxE4.d.cts +286 -0
  70. package/dist/repositories/realm/index.cjs +100 -51
  71. package/dist/repositories/realm/index.cjs.map +1 -1
  72. package/dist/repositories/realm/index.d.cts +25 -10
  73. package/dist/repositories/realm/index.d.ts +25 -10
  74. package/dist/repositories/realm/index.js +72 -24
  75. package/dist/repositories/realm/index.js.map +1 -1
  76. package/dist/repositories/sqlite/index.cjs +222 -131
  77. package/dist/repositories/sqlite/index.cjs.map +1 -1
  78. package/dist/repositories/sqlite/index.d.cts +36 -17
  79. package/dist/repositories/sqlite/index.d.ts +36 -17
  80. package/dist/repositories/sqlite/index.js +196 -107
  81. package/dist/repositories/sqlite/index.js.map +1 -1
  82. package/dist/{taskRunner-BaNCSxqK.d.ts → taskRunner-DgMLSk_O.d.ts} +4 -4
  83. package/dist/{taskRunner-i56-drQV.d.cts → taskRunner-buh6aFpG.d.cts} +4 -4
  84. package/dist/wallet/expo/background.cjs +17 -14
  85. package/dist/wallet/expo/background.cjs.map +1 -1
  86. package/dist/wallet/expo/background.d.cts +5 -4
  87. package/dist/wallet/expo/background.d.ts +5 -4
  88. package/dist/wallet/expo/background.js +10 -7
  89. package/dist/wallet/expo/background.js.map +1 -1
  90. package/dist/wallet/expo/index.cjs +29 -16
  91. package/dist/wallet/expo/index.cjs.map +1 -1
  92. package/dist/wallet/expo/index.d.cts +12 -7
  93. package/dist/wallet/expo/index.d.ts +12 -7
  94. package/dist/wallet/expo/index.js +20 -7
  95. package/dist/wallet/expo/index.js.map +1 -1
  96. package/dist/worker/expo/index.cjs +12 -9
  97. package/dist/worker/expo/index.cjs.map +1 -1
  98. package/dist/worker/expo/index.d.cts +6 -5
  99. package/dist/worker/expo/index.d.ts +6 -5
  100. package/dist/worker/expo/index.js +8 -5
  101. package/dist/worker/expo/index.js.map +1 -1
  102. package/package.json +16 -1
  103. package/dist/chunk-5WRA66RV.cjs.map +0 -1
  104. package/dist/chunk-6FL4N4S2.js.map +0 -1
  105. package/dist/chunk-BYPBVHVA.cjs.map +0 -1
  106. package/dist/chunk-HAQAWBYG.js.map +0 -1
  107. package/dist/chunk-KW7ZEWYS.cjs.map +0 -1
  108. package/dist/chunk-OPX2HRWM.js.map +0 -1
  109. package/dist/chunk-OUTWUYJ4.cjs.map +0 -1
  110. package/dist/chunk-P7B4LQ3H.js.map +0 -1
  111. package/dist/chunk-T7C3E2HL.js.map +0 -1
  112. package/dist/chunk-Y4BL3YYX.js.map +0 -1
  113. package/dist/chunk-ZMSM3NOH.cjs.map +0 -1
  114. package/dist/chunk-ZPF4I3K2.cjs.map +0 -1
@@ -0,0 +1,930 @@
1
+ 'use strict';
2
+
3
+ var bip68 = require('bip68');
4
+ var btcSigner = require('@scure/btc-signer');
5
+ var base = require('@scure/base');
6
+ var utils_js = require('@scure/btc-signer/utils.js');
7
+ var script_js = require('@scure/btc-signer/script.js');
8
+ var payment_js = require('@scure/btc-signer/payment.js');
9
+ var P = require('micro-packed');
10
+
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var bip68__namespace = /*#__PURE__*/_interopNamespace(bip68);
30
+ var P__namespace = /*#__PURE__*/_interopNamespace(P);
31
+
32
+ var __defProp = Object.defineProperty;
33
+ var __export = (target, all) => {
34
+ for (var name in all)
35
+ __defProp(target, name, { get: all[name], enumerable: true });
36
+ };
37
+ function timelockToSequence(timelock) {
38
+ return bip68__namespace.encode(
39
+ timelock.type === "blocks" ? { blocks: Number(timelock.value) } : { seconds: Number(timelock.value) }
40
+ );
41
+ }
42
+ function sequenceToTimelock(sequence) {
43
+ const decoded = bip68__namespace.decode(sequence);
44
+ if ("blocks" in decoded && decoded.blocks !== void 0) {
45
+ return { type: "blocks", value: BigInt(decoded.blocks) };
46
+ }
47
+ if ("seconds" in decoded && decoded.seconds !== void 0) {
48
+ return { type: "seconds", value: BigInt(decoded.seconds) };
49
+ }
50
+ throw new Error(`Invalid BIP68 sequence: ${sequence}`);
51
+ }
52
+ function sequenceToCanonicalTimelock(sequence) {
53
+ if (sequence < 0n || sequence >= 0x80000000n) return void 0;
54
+ const timelock = sequenceToTimelock(Number(sequence));
55
+ return BigInt(timelockToSequence(timelock)) === sequence ? timelock : void 0;
56
+ }
57
+ var MinimalScriptNum = btcSigner.ScriptNum(void 0, true);
58
+ function decodeTapscript(script) {
59
+ const types = [
60
+ exports.MultisigTapscript,
61
+ exports.CSVMultisigTapscript,
62
+ exports.ConditionCSVMultisigTapscript,
63
+ exports.ConditionMultisigTapscript,
64
+ exports.CLTVMultisigTapscript
65
+ ];
66
+ for (const type of types) {
67
+ try {
68
+ return type.decode(script);
69
+ } catch (error) {
70
+ continue;
71
+ }
72
+ }
73
+ throw new Error(`Failed to decode: script ${base.hex.encode(script)} is not a valid tapscript`);
74
+ }
75
+ exports.MultisigTapscript = void 0;
76
+ ((MultisigTapscript2) => {
77
+ ((MultisigType2) => {
78
+ MultisigType2[MultisigType2["CHECKSIG"] = 0] = "CHECKSIG";
79
+ MultisigType2[MultisigType2["CHECKSIGADD"] = 1] = "CHECKSIGADD";
80
+ })(MultisigTapscript2.MultisigType || (MultisigTapscript2.MultisigType = {}));
81
+ function encode2(params) {
82
+ if (params.pubkeys.length === 0) {
83
+ throw new Error("At least 1 pubkey is required");
84
+ }
85
+ for (const pubkey of params.pubkeys) {
86
+ if (pubkey.length !== 32) {
87
+ throw new Error(`Invalid pubkey length: expected 32, got ${pubkey.length}`);
88
+ }
89
+ }
90
+ if (!params.type) {
91
+ params.type = 0 /* CHECKSIG */;
92
+ }
93
+ if (params.type === 1 /* CHECKSIGADD */) {
94
+ return {
95
+ type: "multisig" /* Multisig */,
96
+ params,
97
+ script: btcSigner.p2tr_ms(params.pubkeys.length, params.pubkeys).script
98
+ };
99
+ }
100
+ const asm = [];
101
+ for (let i = 0; i < params.pubkeys.length; i++) {
102
+ asm.push(params.pubkeys[i]);
103
+ if (i < params.pubkeys.length - 1) {
104
+ asm.push("CHECKSIGVERIFY");
105
+ } else {
106
+ asm.push("CHECKSIG");
107
+ }
108
+ }
109
+ return {
110
+ type: "multisig" /* Multisig */,
111
+ params,
112
+ script: btcSigner.Script.encode(asm)
113
+ };
114
+ }
115
+ MultisigTapscript2.encode = encode2;
116
+ function decode2(script) {
117
+ if (script.length === 0) {
118
+ throw new Error("Failed to decode: script is empty");
119
+ }
120
+ try {
121
+ return decodeChecksigAdd(script);
122
+ } catch (error) {
123
+ try {
124
+ return decodeChecksig(script);
125
+ } catch (error2) {
126
+ throw new Error(
127
+ `Failed to decode script: ${error2 instanceof Error ? error2.message : String(error2)}`
128
+ );
129
+ }
130
+ }
131
+ }
132
+ MultisigTapscript2.decode = decode2;
133
+ function decodeChecksigAdd(script) {
134
+ const asm = btcSigner.Script.decode(script);
135
+ const pubkeys = [];
136
+ let foundNumEqual = false;
137
+ for (let i = 0; i < asm.length; i++) {
138
+ const op = asm[i];
139
+ if (typeof op !== "string" && typeof op !== "number") {
140
+ if (op.length !== 32) {
141
+ throw new Error(`Invalid pubkey length: expected 32, got ${op.length}`);
142
+ }
143
+ pubkeys.push(op);
144
+ if (i + 1 >= asm.length || asm[i + 1] !== "CHECKSIGADD" && asm[i + 1] !== "CHECKSIG") {
145
+ throw new Error("Expected CHECKSIGADD or CHECKSIG after pubkey");
146
+ }
147
+ i++;
148
+ continue;
149
+ }
150
+ if (i === asm.length - 1) {
151
+ if (op !== "NUMEQUAL") {
152
+ throw new Error("Expected NUMEQUAL at end of script");
153
+ }
154
+ foundNumEqual = true;
155
+ }
156
+ }
157
+ if (!foundNumEqual) {
158
+ throw new Error("Missing NUMEQUAL operation");
159
+ }
160
+ if (pubkeys.length === 0) {
161
+ throw new Error("Invalid script: must have at least 1 pubkey");
162
+ }
163
+ const reconstructed = encode2({
164
+ pubkeys,
165
+ type: 1 /* CHECKSIGADD */
166
+ });
167
+ if (base.hex.encode(reconstructed.script) !== base.hex.encode(script)) {
168
+ throw new Error("Invalid script format: script reconstruction mismatch");
169
+ }
170
+ return {
171
+ type: "multisig" /* Multisig */,
172
+ params: { pubkeys, type: 1 /* CHECKSIGADD */ },
173
+ script
174
+ };
175
+ }
176
+ function decodeChecksig(script) {
177
+ const asm = btcSigner.Script.decode(script);
178
+ const pubkeys = [];
179
+ for (let i = 0; i < asm.length; i++) {
180
+ const op = asm[i];
181
+ if (typeof op !== "string" && typeof op !== "number") {
182
+ if (op.length !== 32) {
183
+ throw new Error(`Invalid pubkey length: expected 32, got ${op.length}`);
184
+ }
185
+ pubkeys.push(op);
186
+ if (i + 1 >= asm.length) {
187
+ throw new Error("Unexpected end of script");
188
+ }
189
+ const nextOp = asm[i + 1];
190
+ if (nextOp !== "CHECKSIGVERIFY" && nextOp !== "CHECKSIG") {
191
+ throw new Error("Expected CHECKSIGVERIFY or CHECKSIG after pubkey");
192
+ }
193
+ if (i === asm.length - 2 && nextOp !== "CHECKSIG") {
194
+ throw new Error("Last operation must be CHECKSIG");
195
+ }
196
+ i++;
197
+ continue;
198
+ }
199
+ }
200
+ if (pubkeys.length === 0) {
201
+ throw new Error("Invalid script: must have at least 1 pubkey");
202
+ }
203
+ const reconstructed = encode2({ pubkeys, type: 0 /* CHECKSIG */ });
204
+ if (base.hex.encode(reconstructed.script) !== base.hex.encode(script)) {
205
+ throw new Error("Invalid script format: script reconstruction mismatch");
206
+ }
207
+ return {
208
+ type: "multisig" /* Multisig */,
209
+ params: { pubkeys, type: 0 /* CHECKSIG */ },
210
+ script
211
+ };
212
+ }
213
+ function is(tapscript) {
214
+ return tapscript.type === "multisig" /* Multisig */;
215
+ }
216
+ MultisigTapscript2.is = is;
217
+ })(exports.MultisigTapscript || (exports.MultisigTapscript = {}));
218
+ exports.CSVMultisigTapscript = void 0;
219
+ ((CSVMultisigTapscript2) => {
220
+ function encode2(params) {
221
+ for (const pubkey of params.pubkeys) {
222
+ if (pubkey.length !== 32) {
223
+ throw new Error(`Invalid pubkey length: expected 32, got ${pubkey.length}`);
224
+ }
225
+ }
226
+ const sequence = MinimalScriptNum.encode(BigInt(timelockToSequence(params.timelock)));
227
+ const asm = [
228
+ sequence.length === 1 ? sequence[0] : sequence,
229
+ "CHECKSEQUENCEVERIFY",
230
+ "DROP"
231
+ ];
232
+ const multisigScript = exports.MultisigTapscript.encode(params);
233
+ const script = new Uint8Array([...btcSigner.Script.encode(asm), ...multisigScript.script]);
234
+ return {
235
+ type: "csv-multisig" /* CSVMultisig */,
236
+ params,
237
+ script
238
+ };
239
+ }
240
+ CSVMultisigTapscript2.encode = encode2;
241
+ function decode2(script) {
242
+ if (script.length === 0) {
243
+ throw new Error("Failed to decode: script is empty");
244
+ }
245
+ const isValid = isScriptValid(script);
246
+ if (isValid instanceof Error) {
247
+ throw isValid;
248
+ }
249
+ const asm = btcSigner.Script.decode(script);
250
+ const sequence = asm[0];
251
+ const multisigScript = new Uint8Array(btcSigner.Script.encode(asm.slice(3)));
252
+ let multisig;
253
+ try {
254
+ multisig = exports.MultisigTapscript.decode(multisigScript);
255
+ } catch (error) {
256
+ throw new Error(
257
+ `Invalid multisig script: ${error instanceof Error ? error.message : String(error)}`
258
+ );
259
+ }
260
+ let sequenceNum;
261
+ if (typeof sequence === "number") {
262
+ sequenceNum = sequence;
263
+ } else {
264
+ sequenceNum = Number(MinimalScriptNum.decode(sequence));
265
+ }
266
+ const timelock = sequenceToTimelock(sequenceNum);
267
+ const reconstructed = encode2({
268
+ timelock,
269
+ ...multisig.params
270
+ });
271
+ if (base.hex.encode(reconstructed.script) !== base.hex.encode(script)) {
272
+ throw new Error("Invalid script format: script reconstruction mismatch");
273
+ }
274
+ return {
275
+ type: "csv-multisig" /* CSVMultisig */,
276
+ params: {
277
+ timelock,
278
+ ...multisig.params
279
+ },
280
+ script
281
+ };
282
+ }
283
+ CSVMultisigTapscript2.decode = decode2;
284
+ function is(tapscript) {
285
+ return tapscript.type === "csv-multisig" /* CSVMultisig */;
286
+ }
287
+ CSVMultisigTapscript2.is = is;
288
+ function isScriptValid(script) {
289
+ const asm = btcSigner.Script.decode(script);
290
+ if (asm.length < 3) {
291
+ return new Error(`Invalid script: too short (expected at least 3)`);
292
+ }
293
+ const sequence = asm[0];
294
+ if (typeof sequence === "string") {
295
+ return new Error("Invalid script: expected sequence number");
296
+ }
297
+ if (asm[1] !== "CHECKSEQUENCEVERIFY" || asm[2] !== "DROP") {
298
+ return new Error("Invalid script: expected CHECKSEQUENCEVERIFY DROP");
299
+ }
300
+ return true;
301
+ }
302
+ CSVMultisigTapscript2.isScriptValid = isScriptValid;
303
+ })(exports.CSVMultisigTapscript || (exports.CSVMultisigTapscript = {}));
304
+ function isConditionScriptValid(script) {
305
+ const asm = btcSigner.Script.decode(script);
306
+ if (asm.length < 1) {
307
+ return new Error(`Invalid script: too short (expected at least 1)`);
308
+ }
309
+ if (asm.lastIndexOf("VERIFY") === -1) {
310
+ return new Error("Invalid script: missing VERIFY operation");
311
+ }
312
+ return true;
313
+ }
314
+ exports.ConditionCSVMultisigTapscript = void 0;
315
+ ((ConditionCSVMultisigTapscript2) => {
316
+ function encode2(params) {
317
+ const script = new Uint8Array([
318
+ ...params.conditionScript,
319
+ ...btcSigner.Script.encode(["VERIFY"]),
320
+ ...exports.CSVMultisigTapscript.encode(params).script
321
+ ]);
322
+ return {
323
+ type: "condition-csv-multisig" /* ConditionCSVMultisig */,
324
+ params,
325
+ script
326
+ };
327
+ }
328
+ ConditionCSVMultisigTapscript2.encode = encode2;
329
+ function decode2(script) {
330
+ if (script.length === 0) {
331
+ throw new Error("Failed to decode: script is empty");
332
+ }
333
+ const isValid = isScriptValid(script);
334
+ if (isValid instanceof Error) {
335
+ throw isValid;
336
+ }
337
+ const asm = btcSigner.Script.decode(script);
338
+ const verifyIndex = asm.lastIndexOf("VERIFY");
339
+ if (verifyIndex === -1) {
340
+ throw Error("Invalid script: missing VERIFY operation");
341
+ }
342
+ const conditionScript = new Uint8Array(btcSigner.Script.encode(asm.slice(0, verifyIndex)));
343
+ const csvMultisigScript = new Uint8Array(btcSigner.Script.encode(asm.slice(verifyIndex + 1)));
344
+ let csvMultisig;
345
+ try {
346
+ csvMultisig = exports.CSVMultisigTapscript.decode(csvMultisigScript);
347
+ } catch (error) {
348
+ throw new Error(
349
+ `Invalid CSV multisig script: ${error instanceof Error ? error.message : String(error)}`
350
+ );
351
+ }
352
+ const reconstructed = encode2({
353
+ conditionScript,
354
+ ...csvMultisig.params
355
+ });
356
+ if (base.hex.encode(reconstructed.script) !== base.hex.encode(script)) {
357
+ throw new Error("Invalid script format: script reconstruction mismatch");
358
+ }
359
+ return {
360
+ type: "condition-csv-multisig" /* ConditionCSVMultisig */,
361
+ params: {
362
+ conditionScript,
363
+ ...csvMultisig.params
364
+ },
365
+ script
366
+ };
367
+ }
368
+ ConditionCSVMultisigTapscript2.decode = decode2;
369
+ function is(tapscript) {
370
+ return tapscript.type === "condition-csv-multisig" /* ConditionCSVMultisig */;
371
+ }
372
+ ConditionCSVMultisigTapscript2.is = is;
373
+ function isScriptValid(script) {
374
+ return isConditionScriptValid(script);
375
+ }
376
+ ConditionCSVMultisigTapscript2.isScriptValid = isScriptValid;
377
+ })(exports.ConditionCSVMultisigTapscript || (exports.ConditionCSVMultisigTapscript = {}));
378
+ exports.ConditionMultisigTapscript = void 0;
379
+ ((ConditionMultisigTapscript2) => {
380
+ function encode2(params) {
381
+ const script = new Uint8Array([
382
+ ...params.conditionScript,
383
+ ...btcSigner.Script.encode(["VERIFY"]),
384
+ ...exports.MultisigTapscript.encode(params).script
385
+ ]);
386
+ return {
387
+ type: "condition-multisig" /* ConditionMultisig */,
388
+ params,
389
+ script
390
+ };
391
+ }
392
+ ConditionMultisigTapscript2.encode = encode2;
393
+ function decode2(script) {
394
+ if (script.length === 0) {
395
+ throw new Error("Failed to decode: script is empty");
396
+ }
397
+ const isValid = isScriptValid(script);
398
+ if (isValid instanceof Error) {
399
+ throw isValid;
400
+ }
401
+ const asm = btcSigner.Script.decode(script);
402
+ const verifyIndex = asm.lastIndexOf("VERIFY");
403
+ if (verifyIndex === -1) {
404
+ throw Error("Invalid script: missing VERIFY operation");
405
+ }
406
+ const conditionScript = new Uint8Array(btcSigner.Script.encode(asm.slice(0, verifyIndex)));
407
+ const multisigScript = new Uint8Array(btcSigner.Script.encode(asm.slice(verifyIndex + 1)));
408
+ let multisig;
409
+ try {
410
+ multisig = exports.MultisigTapscript.decode(multisigScript);
411
+ } catch (error) {
412
+ throw new Error(
413
+ `Invalid multisig script: ${error instanceof Error ? error.message : String(error)}`
414
+ );
415
+ }
416
+ const reconstructed = encode2({
417
+ conditionScript,
418
+ ...multisig.params
419
+ });
420
+ if (base.hex.encode(reconstructed.script) !== base.hex.encode(script)) {
421
+ throw new Error("Invalid script format: script reconstruction mismatch");
422
+ }
423
+ return {
424
+ type: "condition-multisig" /* ConditionMultisig */,
425
+ params: {
426
+ conditionScript,
427
+ ...multisig.params
428
+ },
429
+ script
430
+ };
431
+ }
432
+ ConditionMultisigTapscript2.decode = decode2;
433
+ function is(tapscript) {
434
+ return tapscript.type === "condition-multisig" /* ConditionMultisig */;
435
+ }
436
+ ConditionMultisigTapscript2.is = is;
437
+ function isScriptValid(script) {
438
+ return isConditionScriptValid(script);
439
+ }
440
+ ConditionMultisigTapscript2.isScriptValid = isScriptValid;
441
+ })(exports.ConditionMultisigTapscript || (exports.ConditionMultisigTapscript = {}));
442
+ exports.CLTVMultisigTapscript = void 0;
443
+ ((CLTVMultisigTapscript2) => {
444
+ function encode2(params) {
445
+ const locktime = MinimalScriptNum.encode(params.absoluteTimelock);
446
+ const asm = [
447
+ locktime.length === 1 ? locktime[0] : locktime,
448
+ "CHECKLOCKTIMEVERIFY",
449
+ "DROP"
450
+ ];
451
+ const timelockedScript = btcSigner.Script.encode(asm);
452
+ const script = new Uint8Array([
453
+ ...timelockedScript,
454
+ ...exports.MultisigTapscript.encode(params).script
455
+ ]);
456
+ return {
457
+ type: "cltv-multisig" /* CLTVMultisig */,
458
+ params,
459
+ script
460
+ };
461
+ }
462
+ CLTVMultisigTapscript2.encode = encode2;
463
+ function decode2(script) {
464
+ if (script.length === 0) {
465
+ throw new Error("Failed to decode: script is empty");
466
+ }
467
+ const isValid = isScriptValid(script);
468
+ if (isValid instanceof Error) {
469
+ throw isValid;
470
+ }
471
+ const asm = btcSigner.Script.decode(script);
472
+ const locktime = asm[0];
473
+ if (typeof locktime === "string") {
474
+ throw new Error("Invalid script: expected locktime number");
475
+ }
476
+ if (asm[1] !== "CHECKLOCKTIMEVERIFY" || asm[2] !== "DROP") {
477
+ throw new Error("Invalid script: expected CHECKLOCKTIMEVERIFY DROP");
478
+ }
479
+ const multisigScript = new Uint8Array(btcSigner.Script.encode(asm.slice(3)));
480
+ let multisig;
481
+ try {
482
+ multisig = exports.MultisigTapscript.decode(multisigScript);
483
+ } catch (error) {
484
+ throw new Error(
485
+ `Invalid multisig script: ${error instanceof Error ? error.message : String(error)}`
486
+ );
487
+ }
488
+ let absoluteTimelock;
489
+ if (typeof locktime === "number") {
490
+ absoluteTimelock = BigInt(locktime);
491
+ } else {
492
+ absoluteTimelock = MinimalScriptNum.decode(locktime);
493
+ }
494
+ const reconstructed = encode2({
495
+ absoluteTimelock,
496
+ ...multisig.params
497
+ });
498
+ if (base.hex.encode(reconstructed.script) !== base.hex.encode(script)) {
499
+ throw new Error("Invalid script format: script reconstruction mismatch");
500
+ }
501
+ return {
502
+ type: "cltv-multisig" /* CLTVMultisig */,
503
+ params: {
504
+ absoluteTimelock,
505
+ ...multisig.params
506
+ },
507
+ script
508
+ };
509
+ }
510
+ CLTVMultisigTapscript2.decode = decode2;
511
+ function is(tapscript) {
512
+ return tapscript.type === "cltv-multisig" /* CLTVMultisig */;
513
+ }
514
+ CLTVMultisigTapscript2.is = is;
515
+ function isScriptValid(script) {
516
+ const asm = btcSigner.Script.decode(script);
517
+ if (asm.length < 3) {
518
+ return new Error(`Invalid script: too short (expected at least 3)`);
519
+ }
520
+ const locktime = asm[0];
521
+ if (typeof locktime === "string") {
522
+ return new Error("Invalid script: expected locktime as number or bytes");
523
+ }
524
+ if (asm[1] !== "CHECKLOCKTIMEVERIFY" || asm[2] !== "DROP") {
525
+ return new Error("Invalid script: expected CHECKLOCKTIMEVERIFY DROP");
526
+ }
527
+ return true;
528
+ }
529
+ CLTVMultisigTapscript2.isScriptValid = isScriptValid;
530
+ })(exports.CLTVMultisigTapscript || (exports.CLTVMultisigTapscript = {}));
531
+ var getNetwork = (network) => {
532
+ const found = networks[network];
533
+ if (!found) throw new Error(`Unsupported network: ${network}`);
534
+ return found;
535
+ };
536
+ var networkFromOperatorInfo = (info) => getNetwork(info.network);
537
+ var networkFromArkadeInfo = networkFromOperatorInfo;
538
+ var networks = {
539
+ bitcoin: withArkPrefix(utils_js.NETWORK, "ark", "bitcoin"),
540
+ testnet: withArkPrefix(utils_js.TEST_NETWORK, "tark", "testnet"),
541
+ signet: withArkPrefix(utils_js.TEST_NETWORK, "tark", "signet"),
542
+ mutinynet: withArkPrefix(utils_js.TEST_NETWORK, "tark", "mutinynet"),
543
+ regtest: withArkPrefix(
544
+ {
545
+ ...utils_js.TEST_NETWORK,
546
+ bech32: "bcrt",
547
+ pubKeyHash: 111,
548
+ scriptHash: 196
549
+ },
550
+ "tark",
551
+ "regtest"
552
+ )
553
+ };
554
+ function withArkPrefix(network, prefix, name) {
555
+ return {
556
+ ...network,
557
+ hrp: prefix,
558
+ name
559
+ };
560
+ }
561
+ var DEFAULT_ARKADE_SERVER_URL = "https://arkade.computer";
562
+ var DEFAULT_ARKADE_EMULATOR_URL = "https://emulator.arkade.computer";
563
+ var DEFAULT_NETWORK = networks.bitcoin;
564
+ var DEFAULT_NETWORK_NAME = "bitcoin";
565
+ var COMPRESSED_PUBKEY = /^0[23][0-9a-f]{64}$/;
566
+ var BITCOIN_EMULATOR_PUBKEY = "0239c196415da47b26456a101daaa12ba9e445bfe153197f1e2b750bf40e52092e";
567
+ var MUTINYNET_EMULATOR_PUBKEY = "03f823b9b2febc81f4af967e77aed2f541cbd3397c6d8f5a72e32eb7b471af889a";
568
+ var REGTEST_EMULATOR_PUBKEY = "02999413c46fa10ada5cbc4bcc79a1d09160c2ba3cfc812705d7a13e5e545fb2a9";
569
+ var EMULATOR_PUBKEYS = {
570
+ bitcoin: BITCOIN_EMULATOR_PUBKEY,
571
+ mutinynet: MUTINYNET_EMULATOR_PUBKEY,
572
+ regtest: REGTEST_EMULATOR_PUBKEY
573
+ };
574
+ function defaultEmulatorPubkey(network) {
575
+ const pinned = network.name ? EMULATOR_PUBKEYS[network.name] : void 0;
576
+ if (!pinned) {
577
+ const cause = network.name ? `no emulator is deployed for ${network.name}` : `this Network carries no name, so it cannot be matched (build it with getNetwork(...) rather than by hand)`;
578
+ throw new Error(
579
+ `No emulator co-signer key is pinned for this network: ${cause}; pass emulatorPubkey: "<33-byte compressed hex>" to Arkade.connect to co-sign with your own emulator instead. Pinned networks: ${Object.keys(EMULATOR_PUBKEYS).join(", ")}`
580
+ );
581
+ }
582
+ return pinned;
583
+ }
584
+ function resolveEmulatorPubkey(network, override) {
585
+ if (override === void 0) return defaultEmulatorPubkey(network);
586
+ if (!COMPRESSED_PUBKEY.test(override)) {
587
+ throw new Error(
588
+ `Emulator pubkey override must be 33-byte compressed secp256k1 hex (66 lowercase chars, 02/03 prefix), got ${JSON.stringify(override)}.`
589
+ );
590
+ }
591
+ return override;
592
+ }
593
+ var ArkAddress = class _ArkAddress {
594
+ /**
595
+ * Create an Arkade address from its server public key, Taproot output key, and prefix.
596
+ *
597
+ * @param serverPubKey - 32-byte Arkade server public key
598
+ * @param vtxoTaprootKey - 32-byte Taproot output key (a.k.a. tweaked public key)
599
+ * @param hrp - Bech32 human-readable prefix
600
+ * @param version - Address version byte
601
+ * @defaultValue `version = 0`
602
+ * @throws Error if either public key is not 32 bytes long
603
+ */
604
+ constructor(serverPubKey, vtxoTaprootKey, hrp = DEFAULT_NETWORK.hrp, version = 0) {
605
+ this.serverPubKey = serverPubKey;
606
+ this.vtxoTaprootKey = vtxoTaprootKey;
607
+ this.hrp = hrp;
608
+ this.version = version;
609
+ if (serverPubKey.length !== 32) {
610
+ throw new Error(
611
+ "Invalid server public key length, expected 32 bytes, got " + serverPubKey.length
612
+ );
613
+ }
614
+ if (vtxoTaprootKey.length !== 32) {
615
+ throw new Error(
616
+ "Invalid vtxo taproot public key length, expected 32 bytes, got " + vtxoTaprootKey.length
617
+ );
618
+ }
619
+ }
620
+ serverPubKey;
621
+ vtxoTaprootKey;
622
+ hrp;
623
+ version;
624
+ /**
625
+ * Decode an Arkade address from its bech32m string form.
626
+ *
627
+ * @param address - Bech32m-encoded Arkade address
628
+ * @returns Decoded Arkade address
629
+ * @throws Error if the address is malformed or has an invalid payload length
630
+ * @see encode
631
+ */
632
+ static decode(address) {
633
+ const decoded = base.bech32m.decodeUnsafe(address, 1023);
634
+ if (!decoded) {
635
+ throw new Error("Invalid address");
636
+ }
637
+ const data = new Uint8Array(base.bech32m.fromWords(decoded.words));
638
+ if (data.length !== 1 + 32 + 32) {
639
+ throw new Error("Invalid data length, expected 65 bytes, got " + data.length);
640
+ }
641
+ const version = data[0];
642
+ const serverPubKey = data.slice(1, 33);
643
+ const vtxoTaprootPubKey = data.slice(33, 65);
644
+ return new _ArkAddress(serverPubKey, vtxoTaprootPubKey, decoded.prefix, version);
645
+ }
646
+ /**
647
+ * Encode the address to its bech32m string form.
648
+ *
649
+ * @returns Bech32m-encoded Arkade address
650
+ * @see decode
651
+ */
652
+ encode() {
653
+ const data = new Uint8Array(1 + 32 + 32);
654
+ data[0] = this.version;
655
+ data.set(this.serverPubKey, 1);
656
+ data.set(this.vtxoTaprootKey, 33);
657
+ const words = base.bech32m.toWords(data);
658
+ return base.bech32m.encode(this.hrp, words, 1023);
659
+ }
660
+ /** ScriptPubKey used to send non-dust funds to the address. */
661
+ get pkScript() {
662
+ return script_js.Script.encode(["OP_1", this.vtxoTaprootKey]);
663
+ }
664
+ /** ScriptPubKey used to send sub-dust funds to the address. */
665
+ get subdustPkScript() {
666
+ return script_js.Script.encode(["RETURN", this.vtxoTaprootKey]);
667
+ }
668
+ };
669
+ function assembleBtcdTaprootTree(scripts) {
670
+ if (scripts.length === 0) {
671
+ throw new Error("assembleBtcdTaprootTree: empty scripts list");
672
+ }
673
+ const leaves = scripts.map((script) => ({
674
+ script,
675
+ leafVersion: payment_js.TAP_LEAF_VERSION
676
+ }));
677
+ if (leaves.length === 1) {
678
+ return leaves[0];
679
+ }
680
+ const branches = [];
681
+ for (let i = 0; i < leaves.length; i += 2) {
682
+ if (i === leaves.length - 1) {
683
+ const last = branches.pop();
684
+ if (last === void 0) {
685
+ throw new Error(
686
+ `assembleBtcdTaprootTree: unexpected odd leaf at i=${i} with no prior branch`
687
+ );
688
+ }
689
+ branches.push([last, leaves[i]]);
690
+ } else {
691
+ branches.push([leaves[i], leaves[i + 1]]);
692
+ }
693
+ }
694
+ while (branches.length >= 2) {
695
+ const left = branches.shift();
696
+ const right = branches.shift();
697
+ branches.push([left, right]);
698
+ }
699
+ return branches[0];
700
+ }
701
+ function btcdLeafLayout(count) {
702
+ const placeholders = Array.from({ length: count }, () => new Uint8Array());
703
+ const indexOf = new Map(placeholders.map((script, index) => [script, index]));
704
+ const layout = [];
705
+ const walk = (node, depth) => {
706
+ if (Array.isArray(node)) {
707
+ walk(node[0], depth + 1);
708
+ walk(node[1], depth + 1);
709
+ } else {
710
+ layout.push({ index: indexOf.get(node.script), depth });
711
+ }
712
+ };
713
+ walk(assembleBtcdTaprootTree(placeholders), 0);
714
+ return layout;
715
+ }
716
+ var proofTapLeafScriptOf = (coin) => coin.intentTapLeafScript ?? coin.proofTapLeafScript;
717
+ var TapTreeCoder = P__namespace.array(
718
+ null,
719
+ P__namespace.struct({ depth: P__namespace.U8, version: P__namespace.U8, script: script_js.VarBytes })
720
+ );
721
+ function scriptFromTapLeafScript(leaf) {
722
+ return leaf[1].subarray(0, leaf[1].length - 1);
723
+ }
724
+ var VtxoScript = class _VtxoScript {
725
+ /**
726
+ * Create a virtual output script from its tapleaf scripts.
727
+ *
728
+ * The Taproot script tree is assembled using btcd's algorithm
729
+ * (`txscript.AssembleTaprootScriptTree`) so the derived taproot output
730
+ * key agrees with arkd for any leaf count. `@scure/btc-signer`'s
731
+ * default `taprootListToTree` is a Huffman builder that only agrees
732
+ * with arkd for power-of-2 leaf counts.
733
+ *
734
+ * @param scripts - Raw tapscript bytes for each leaf
735
+ * @throws Error if the provided leaves cannot produce a valid Taproot tree
736
+ */
737
+ constructor(scripts) {
738
+ this.scripts = scripts;
739
+ const tapTree = assembleBtcdTaprootTree(scripts);
740
+ const payment = btcSigner.p2tr(btcSigner.taprootNumsKey(), tapTree, void 0, true);
741
+ if (!payment.tapLeafScript || payment.tapLeafScript.length !== scripts.length) {
742
+ throw new Error("invalid scripts");
743
+ }
744
+ this.leaves = payment.tapLeafScript;
745
+ this.tweakedPublicKey = payment.tweakedPubkey;
746
+ this.pkScript = payment.script;
747
+ }
748
+ scripts;
749
+ leaves;
750
+ tweakedPublicKey;
751
+ pkScript;
752
+ /**
753
+ * Decode a virtual output script from an encoded TapTree.
754
+ *
755
+ * Leaves are normally read in construction order and their depths
756
+ * ignored: that covers the {@link encode} form (every depth 1) and the
757
+ * placeholder depths other writers use, such as arkd's. The exception is
758
+ * the BIP-371 form {@link toBIP371TapTree} writes, whose leaves are in the
759
+ * tree's DFS order: for some leaf counts (6, 7, 10, ...) that differs from
760
+ * construction order. A tree whose depths are exactly the shape
761
+ * `assembleBtcdTaprootTree` builds is that form, so its leaves are mapped
762
+ * back to construction order first. No construction-order writer produces
763
+ * that depth sequence when the two orders differ, so this never reorders
764
+ * a tree that decoded correctly before.
765
+ *
766
+ * Every leaf must carry the base tapscript version: the tree is rebuilt
767
+ * with {@link TAP_LEAF_VERSION} leaves, so any other version would
768
+ * silently derive a different taproot key.
769
+ *
770
+ * @param tapTree - Encoded TapTree bytes
771
+ * @returns Decoded virtual output script
772
+ * @throws Error if the TapTree cannot be decoded into a valid script set
773
+ * or a leaf carries a version other than {@link TAP_LEAF_VERSION}
774
+ * @see encode
775
+ */
776
+ static decode(tapTree) {
777
+ const leaves = TapTreeCoder.decode(tapTree);
778
+ const foreign = leaves.find((leaf) => leaf.version !== payment_js.TAP_LEAF_VERSION);
779
+ if (foreign) {
780
+ throw new Error(`unsupported tap leaf version 0x${foreign.version.toString(16)}`);
781
+ }
782
+ const scripts = leaves.map((leaf) => leaf.script);
783
+ if (leaves.every((leaf) => leaf.depth === 1)) {
784
+ return new _VtxoScript(scripts);
785
+ }
786
+ const layout = btcdLeafLayout(leaves.length);
787
+ if (layout.some((slot, i) => slot.depth !== leaves[i].depth)) {
788
+ return new _VtxoScript(scripts);
789
+ }
790
+ const ordered = new Array(leaves.length);
791
+ layout.forEach((slot, i) => {
792
+ ordered[slot.index] = scripts[i];
793
+ });
794
+ return new _VtxoScript(ordered);
795
+ }
796
+ /**
797
+ * Encode the virtual output script to a TapTree byte representation.
798
+ *
799
+ * @returns Encoded TapTree bytes
800
+ * @see decode
801
+ */
802
+ encode() {
803
+ const tapTree = TapTreeCoder.encode(
804
+ this.scripts.map((script) => ({
805
+ depth: 1,
806
+ version: payment_js.TAP_LEAF_VERSION,
807
+ script
808
+ }))
809
+ );
810
+ return tapTree;
811
+ }
812
+ /**
813
+ * Build the Arkade address corresponding to this virtual output script.
814
+ *
815
+ * @param prefix - Bech32 human-readable prefix
816
+ * @param serverPubKey - 32-byte Arkade server public key
817
+ * @returns Arkade address for this script
818
+ * @see ArkAddress
819
+ */
820
+ address(prefix = DEFAULT_NETWORK.hrp, serverPubKey) {
821
+ return new ArkAddress(serverPubKey, this.tweakedPublicKey, prefix);
822
+ }
823
+ /**
824
+ * Build the Taproot onchain address corresponding to this virtual output script.
825
+ *
826
+ * @param network - Bitcoin network descriptor
827
+ * @returns Taproot onchain address
828
+ * @see address
829
+ */
830
+ onchainAddress(network = DEFAULT_NETWORK) {
831
+ return btcSigner.Address(network).encode({
832
+ type: "tr",
833
+ pubkey: this.tweakedPublicKey
834
+ });
835
+ }
836
+ /**
837
+ * Look up a tapleaf script by its hex-encoded tapscript body.
838
+ *
839
+ * @param scriptHex - Hex-encoded tapscript body without the leaf version byte
840
+ * @returns Matching tapleaf script
841
+ * @throws Error if no matching leaf exists
842
+ */
843
+ findLeaf(scriptHex) {
844
+ const leaf = this.leaves.find(
845
+ (leaf2) => base.hex.encode(scriptFromTapLeafScript(leaf2)) === scriptHex
846
+ );
847
+ if (!leaf) {
848
+ throw new Error(`leaf '${scriptHex}' not found`);
849
+ }
850
+ return leaf;
851
+ }
852
+ /**
853
+ * Return all unilateral exit paths embedded in the virtual output script.
854
+ *
855
+ * @returns CSV-based exit paths found in the leaves
856
+ * @see getSequence
857
+ */
858
+ exitPaths() {
859
+ const paths = [];
860
+ for (const leaf of this.leaves) {
861
+ try {
862
+ const script = scriptFromTapLeafScript(leaf);
863
+ if (exports.CSVMultisigTapscript.isScriptValid(script) === true) {
864
+ const tapScript = exports.CSVMultisigTapscript.decode(script);
865
+ paths.push(tapScript);
866
+ } else if (exports.ConditionCSVMultisigTapscript.isScriptValid(script) === true) {
867
+ const tapScript = exports.ConditionCSVMultisigTapscript.decode(script);
868
+ paths.push(tapScript);
869
+ }
870
+ } catch (e) {
871
+ console.debug("Failed to decode script", e);
872
+ }
873
+ }
874
+ return paths;
875
+ }
876
+ };
877
+ function toBIP371TapTree(tapTree) {
878
+ const scripts = TapTreeCoder.decode(tapTree).map((leaf) => leaf.script);
879
+ const vtxoScript = new VtxoScript(scripts);
880
+ return vtxoScript.leaves.map((leaf) => ({
881
+ depth: leaf[0].merklePath.length,
882
+ version: payment_js.TAP_LEAF_VERSION,
883
+ script: scriptFromTapLeafScript(leaf)
884
+ }));
885
+ }
886
+ function getSequence(tapLeafScript) {
887
+ let sequence = void 0;
888
+ try {
889
+ const scriptWithLeafVersion = tapLeafScript[1];
890
+ const script = scriptWithLeafVersion.subarray(0, scriptWithLeafVersion.length - 1);
891
+ try {
892
+ const params = exports.CSVMultisigTapscript.decode(script).params;
893
+ sequence = timelockToSequence(params.timelock);
894
+ } catch {
895
+ const params = exports.CLTVMultisigTapscript.decode(script).params;
896
+ sequence = Number(params.absoluteTimelock);
897
+ }
898
+ } catch {
899
+ }
900
+ return sequence;
901
+ }
902
+
903
+ exports.ArkAddress = ArkAddress;
904
+ exports.BITCOIN_EMULATOR_PUBKEY = BITCOIN_EMULATOR_PUBKEY;
905
+ exports.DEFAULT_ARKADE_EMULATOR_URL = DEFAULT_ARKADE_EMULATOR_URL;
906
+ exports.DEFAULT_ARKADE_SERVER_URL = DEFAULT_ARKADE_SERVER_URL;
907
+ exports.DEFAULT_NETWORK = DEFAULT_NETWORK;
908
+ exports.DEFAULT_NETWORK_NAME = DEFAULT_NETWORK_NAME;
909
+ exports.MUTINYNET_EMULATOR_PUBKEY = MUTINYNET_EMULATOR_PUBKEY;
910
+ exports.REGTEST_EMULATOR_PUBKEY = REGTEST_EMULATOR_PUBKEY;
911
+ exports.TapTreeCoder = TapTreeCoder;
912
+ exports.VtxoScript = VtxoScript;
913
+ exports.__export = __export;
914
+ exports.assembleBtcdTaprootTree = assembleBtcdTaprootTree;
915
+ exports.decodeTapscript = decodeTapscript;
916
+ exports.defaultEmulatorPubkey = defaultEmulatorPubkey;
917
+ exports.getNetwork = getNetwork;
918
+ exports.getSequence = getSequence;
919
+ exports.networkFromArkadeInfo = networkFromArkadeInfo;
920
+ exports.networkFromOperatorInfo = networkFromOperatorInfo;
921
+ exports.networks = networks;
922
+ exports.proofTapLeafScriptOf = proofTapLeafScriptOf;
923
+ exports.resolveEmulatorPubkey = resolveEmulatorPubkey;
924
+ exports.scriptFromTapLeafScript = scriptFromTapLeafScript;
925
+ exports.sequenceToCanonicalTimelock = sequenceToCanonicalTimelock;
926
+ exports.sequenceToTimelock = sequenceToTimelock;
927
+ exports.timelockToSequence = timelockToSequence;
928
+ exports.toBIP371TapTree = toBIP371TapTree;
929
+ //# sourceMappingURL=chunk-FLPWNMX3.cjs.map
930
+ //# sourceMappingURL=chunk-FLPWNMX3.cjs.map