@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,359 @@
1
+ import { NETWORK } from '@scure/btc-signer';
2
+ import { PSBTOutput } from '@scure/btc-signer/psbt.js';
3
+ import { Bytes } from '@scure/btc-signer/utils.js';
4
+
5
+ /**
6
+ * RelativeTimelock lets to create timelocked with CHECKSEQUENCEVERIFY script.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const timelock = { value: 144n, type: "blocks" }; // 1 day in blocks
11
+ * const timelock = { value: 512n, type: "seconds" }; // 8 minutes in seconds
12
+ * ```
13
+ */
14
+ type RelativeTimelock = {
15
+ value: bigint;
16
+ type: "seconds" | "blocks";
17
+ };
18
+ declare enum TapscriptType {
19
+ Multisig = "multisig",
20
+ CSVMultisig = "csv-multisig",
21
+ ConditionCSVMultisig = "condition-csv-multisig",
22
+ ConditionMultisig = "condition-multisig",
23
+ CLTVMultisig = "cltv-multisig"
24
+ }
25
+ /**
26
+ * ArkTapscript is the base element of vtxo scripts.
27
+ * It is used to encode and decode the different types of vtxo scripts.
28
+ */
29
+ interface ArkTapscript<T extends TapscriptType, Params> {
30
+ type: T;
31
+ params: Params;
32
+ script: Uint8Array;
33
+ }
34
+ /**
35
+ * decodeTapscript is a function that decodes an Arkade tapscript from a raw script.
36
+ *
37
+ * @throws {Error} if the script is not a valid Arkade tapscript
38
+ * @example
39
+ * ```typescript
40
+ * const arkTapscript = decodeTapscript(new Uint8Array(32));
41
+ * console.log("type:", arkTapscript.type);
42
+ * ```
43
+ */
44
+ declare function decodeTapscript(script: Uint8Array): ArkTapscript<TapscriptType, any>;
45
+ /**
46
+ * Implements a multi-signature tapscript.
47
+ *
48
+ * <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * const multisigTapscript = MultisigTapscript.encode({ pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
53
+ * ```
54
+ */
55
+ declare namespace MultisigTapscript {
56
+ type Type = ArkTapscript<TapscriptType.Multisig, Params>;
57
+ enum MultisigType {
58
+ CHECKSIG = 0,
59
+ CHECKSIGADD = 1
60
+ }
61
+ type Params = {
62
+ pubkeys: Bytes[];
63
+ type?: MultisigType;
64
+ };
65
+ /** Encode a plain multisig tapscript. */
66
+ function encode(params: Params): Type;
67
+ /** Decode a plain multisig tapscript from raw script bytes. */
68
+ function decode(script: Uint8Array): Type;
69
+ /** Return true when the tapscript is a plain multisig tapscript. */
70
+ function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
71
+ }
72
+ /**
73
+ * Implements a relative timelock script that requires all specified pubkeys to sign
74
+ * after the relative timelock has expired. The timelock can be specified in blocks or seconds.
75
+ *
76
+ * This is the standard exit closure and it is also used for the sweep closure in vtxo trees.
77
+ *
78
+ * <sequence> CHECKSEQUENCEVERIFY DROP <pubkey> CHECKSIG
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const csvMultisigTapscript = CSVMultisigTapscript.encode({ timelock: { type: "blocks", value: 144 }, pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
83
+ * ```
84
+ */
85
+ declare namespace CSVMultisigTapscript {
86
+ type Type = ArkTapscript<TapscriptType.CSVMultisig, Params>;
87
+ type Params = {
88
+ timelock: RelativeTimelock;
89
+ } & MultisigTapscript.Params;
90
+ /** Encode a CSV multisig tapscript. */
91
+ function encode(params: Params): Type;
92
+ /** Decode a CSV multisig tapscript from raw script bytes. */
93
+ function decode(script: Uint8Array): Type;
94
+ /** Return true when the tapscript is a CSV multisig tapscript. */
95
+ function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
96
+ function isScriptValid(script: Uint8Array): true | Error;
97
+ }
98
+ /**
99
+ * Combines a condition script with an exit closure. The resulting script requires
100
+ * the condition to be met, followed by the standard exit closure requirements
101
+ * (timelock and signatures).
102
+ *
103
+ * <conditionScript> VERIFY <sequence> CHECKSEQUENCEVERIFY DROP <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
104
+ *
105
+ * @example
106
+ * ```typescript
107
+ * const conditionCSVMultisigTapscript = ConditionCSVMultisigTapscript.encode({ conditionScript: new Uint8Array(32), pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
108
+ * ```
109
+ */
110
+ declare namespace ConditionCSVMultisigTapscript {
111
+ type Type = ArkTapscript<TapscriptType.ConditionCSVMultisig, Params>;
112
+ type Params = {
113
+ conditionScript: Bytes;
114
+ } & CSVMultisigTapscript.Params;
115
+ /** Encode a condition + CSV multisig tapscript. */
116
+ function encode(params: Params): Type;
117
+ /** Decode a condition + CSV multisig tapscript from raw script bytes. */
118
+ function decode(script: Uint8Array): Type;
119
+ /** Return true when the tapscript is a condition + CSV multisig tapscript. */
120
+ function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
121
+ function isScriptValid(script: Uint8Array): true | Error;
122
+ }
123
+ /**
124
+ * Combines a condition script with a forfeit closure. The resulting script requires
125
+ * the condition to be met, followed by the standard forfeit closure requirements
126
+ * (multi-signature).
127
+ *
128
+ * <conditionScript> VERIFY <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * const conditionMultisigTapscript = ConditionMultisigTapscript.encode({ conditionScript: new Uint8Array(32), pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
133
+ * ```
134
+ */
135
+ declare namespace ConditionMultisigTapscript {
136
+ type Type = ArkTapscript<TapscriptType.ConditionMultisig, Params>;
137
+ type Params = {
138
+ conditionScript: Bytes;
139
+ } & MultisigTapscript.Params;
140
+ /** Encode a condition + multisig tapscript. */
141
+ function encode(params: Params): Type;
142
+ /** Decode a condition + multisig tapscript from raw script bytes. */
143
+ function decode(script: Uint8Array): Type;
144
+ /** Return true when the tapscript is a condition + multisig tapscript. */
145
+ function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
146
+ function isScriptValid(script: Uint8Array): true | Error;
147
+ }
148
+ /**
149
+ * Implements an absolute timelock (CLTV) script combined with a forfeit closure.
150
+ * The script requires waiting until a specific block height/timestamp before the
151
+ * forfeit closure conditions can be met.
152
+ *
153
+ * <locktime> CHECKLOCKTIMEVERIFY DROP <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * const cltvMultisigTapscript = CLTVMultisigTapscript.encode({ absoluteTimelock: 144, pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
158
+ * ```
159
+ */
160
+ declare namespace CLTVMultisigTapscript {
161
+ type Type = ArkTapscript<TapscriptType.CLTVMultisig, Params>;
162
+ type Params = {
163
+ absoluteTimelock: bigint;
164
+ } & MultisigTapscript.Params;
165
+ /** Encode a CLTV multisig tapscript. */
166
+ function encode(params: Params): Type;
167
+ /** Decode a CLTV multisig tapscript from raw script bytes. */
168
+ function decode(script: Uint8Array): Type;
169
+ /** Return true when the tapscript is a CLTV multisig tapscript. */
170
+ function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
171
+ function isScriptValid(script: Uint8Array): true | Error;
172
+ }
173
+
174
+ /**
175
+ * ArkAddress allows creating and decoding bech32m-encoded Arkade addresses: an hrp plus a
176
+ * 65-byte payload of version byte ‖ 32-byte server pubkey ‖ 32-byte VTXO taproot key.
177
+ *
178
+ * @remarks
179
+ * This is an Arkade-specific address format.
180
+ * It is distinct from the Taproot onchain address returned by `VtxoScript.onchainAddress`.
181
+ *
182
+ * @see VtxoScript
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * const address = new ArkAddress(
187
+ * new Uint8Array(32), // server public key
188
+ * new Uint8Array(32), // vtxo taproot public key
189
+ * "ark"
190
+ * );
191
+ *
192
+ * const encoded = address.encode();
193
+ * console.log("address: ", encoded);
194
+ *
195
+ * const decoded = ArkAddress.decode(encoded);
196
+ * ```
197
+ */
198
+ declare class ArkAddress {
199
+ readonly serverPubKey: Bytes;
200
+ readonly vtxoTaprootKey: Bytes;
201
+ readonly hrp: string;
202
+ readonly version: number;
203
+ /**
204
+ * Create an Arkade address from its server public key, Taproot output key, and prefix.
205
+ *
206
+ * @param serverPubKey - 32-byte Arkade server public key
207
+ * @param vtxoTaprootKey - 32-byte Taproot output key (a.k.a. tweaked public key)
208
+ * @param hrp - Bech32 human-readable prefix
209
+ * @param version - Address version byte
210
+ * @defaultValue `version = 0`
211
+ * @throws Error if either public key is not 32 bytes long
212
+ */
213
+ constructor(serverPubKey: Bytes, vtxoTaprootKey: Bytes, hrp?: string, version?: number);
214
+ /**
215
+ * Decode an Arkade address from its bech32m string form.
216
+ *
217
+ * @param address - Bech32m-encoded Arkade address
218
+ * @returns Decoded Arkade address
219
+ * @throws Error if the address is malformed or has an invalid payload length
220
+ * @see encode
221
+ */
222
+ static decode(address: string): ArkAddress;
223
+ /**
224
+ * Encode the address to its bech32m string form.
225
+ *
226
+ * @returns Bech32m-encoded Arkade address
227
+ * @see decode
228
+ */
229
+ encode(): string;
230
+ /** ScriptPubKey used to send non-dust funds to the address. */
231
+ get pkScript(): Bytes;
232
+ /** ScriptPubKey used to send sub-dust funds to the address. */
233
+ get subdustPkScript(): Bytes;
234
+ }
235
+
236
+ type TapLeafScript = [
237
+ {
238
+ version: number;
239
+ internalKey: Bytes;
240
+ merklePath: Bytes[];
241
+ },
242
+ Bytes
243
+ ];
244
+ declare const TapTreeCoder: (typeof PSBTOutput.tapTree)[2];
245
+ declare function scriptFromTapLeafScript(leaf: TapLeafScript): Bytes;
246
+ /**
247
+ * VtxoScript is a script that contains a list of tapleaf scripts.
248
+ * It is used to create virtual output scripts.
249
+ *
250
+ * @see ArkAddress
251
+ *
252
+ * @example
253
+ * ```typescript
254
+ * const vtxoScript = new VtxoScript([new Uint8Array(32), new Uint8Array(32)]);
255
+ * ```
256
+ */
257
+ declare class VtxoScript {
258
+ readonly scripts: Bytes[];
259
+ readonly leaves: TapLeafScript[];
260
+ readonly tweakedPublicKey: Bytes;
261
+ readonly pkScript: Bytes;
262
+ /**
263
+ * Decode a virtual output script from an encoded TapTree.
264
+ *
265
+ * Leaves are normally read in construction order and their depths
266
+ * ignored: that covers the {@link encode} form (every depth 1) and the
267
+ * placeholder depths other writers use, such as arkd's. The exception is
268
+ * the BIP-371 form {@link toBIP371TapTree} writes, whose leaves are in the
269
+ * tree's DFS order: for some leaf counts (6, 7, 10, ...) that differs from
270
+ * construction order. A tree whose depths are exactly the shape
271
+ * `assembleBtcdTaprootTree` builds is that form, so its leaves are mapped
272
+ * back to construction order first. No construction-order writer produces
273
+ * that depth sequence when the two orders differ, so this never reorders
274
+ * a tree that decoded correctly before.
275
+ *
276
+ * Every leaf must carry the base tapscript version: the tree is rebuilt
277
+ * with {@link TAP_LEAF_VERSION} leaves, so any other version would
278
+ * silently derive a different taproot key.
279
+ *
280
+ * @param tapTree - Encoded TapTree bytes
281
+ * @returns Decoded virtual output script
282
+ * @throws Error if the TapTree cannot be decoded into a valid script set
283
+ * or a leaf carries a version other than {@link TAP_LEAF_VERSION}
284
+ * @see encode
285
+ */
286
+ static decode(tapTree: Bytes): VtxoScript;
287
+ /**
288
+ * Create a virtual output script from its tapleaf scripts.
289
+ *
290
+ * The Taproot script tree is assembled using btcd's algorithm
291
+ * (`txscript.AssembleTaprootScriptTree`) so the derived taproot output
292
+ * key agrees with arkd for any leaf count. `@scure/btc-signer`'s
293
+ * default `taprootListToTree` is a Huffman builder that only agrees
294
+ * with arkd for power-of-2 leaf counts.
295
+ *
296
+ * @param scripts - Raw tapscript bytes for each leaf
297
+ * @throws Error if the provided leaves cannot produce a valid Taproot tree
298
+ */
299
+ constructor(scripts: Bytes[]);
300
+ /**
301
+ * Encode the virtual output script to a TapTree byte representation.
302
+ *
303
+ * @returns Encoded TapTree bytes
304
+ * @see decode
305
+ */
306
+ encode(): Bytes;
307
+ /**
308
+ * Build the Arkade address corresponding to this virtual output script.
309
+ *
310
+ * @param prefix - Bech32 human-readable prefix
311
+ * @param serverPubKey - 32-byte Arkade server public key
312
+ * @returns Arkade address for this script
313
+ * @see ArkAddress
314
+ */
315
+ address(prefix: string | undefined, serverPubKey: Bytes): ArkAddress;
316
+ /**
317
+ * Build the Taproot onchain address corresponding to this virtual output script.
318
+ *
319
+ * @param network - Bitcoin network descriptor
320
+ * @returns Taproot onchain address
321
+ * @see address
322
+ */
323
+ onchainAddress(network?: typeof NETWORK): string;
324
+ /**
325
+ * Look up a tapleaf script by its hex-encoded tapscript body.
326
+ *
327
+ * @param scriptHex - Hex-encoded tapscript body without the leaf version byte
328
+ * @returns Matching tapleaf script
329
+ * @throws Error if no matching leaf exists
330
+ */
331
+ findLeaf(scriptHex: string): TapLeafScript;
332
+ /**
333
+ * Return all unilateral exit paths embedded in the virtual output script.
334
+ *
335
+ * @returns CSV-based exit paths found in the leaves
336
+ * @see getSequence
337
+ */
338
+ exitPaths(): Array<CSVMultisigTapscript.Type | ConditionCSVMultisigTapscript.Type>;
339
+ }
340
+ type EncodedVtxoScript = {
341
+ tapTree: Bytes;
342
+ };
343
+ /**
344
+ * Extract the timelock value encoded in a timelocked tapleaf, if any.
345
+ *
346
+ * The return value is unit-ambiguous: for a CSV leaf it is a BIP-68
347
+ * nSequence (relative timelock); for a CLTV leaf it is an absolute
348
+ * nLockTime. Callers must know which leaf shape they are inspecting to
349
+ * interpret the number correctly, and must not copy a CSV result into
350
+ * `Transaction.lockTime` (or vice versa).
351
+ *
352
+ * @param tapLeafScript - Tapleaf script to inspect
353
+ * @returns The encoded timelock value, or `undefined` when neither a CSV
354
+ * nor CLTV path is present
355
+ * @see VtxoScript.exitPaths
356
+ */
357
+ declare function getSequence(tapLeafScript: TapLeafScript): number | undefined;
358
+
359
+ export { ArkAddress as A, CSVMultisigTapscript as C, type EncodedVtxoScript as E, MultisigTapscript as M, type RelativeTimelock as R, type TapLeafScript as T, VtxoScript as V, type ArkTapscript as a, CLTVMultisigTapscript as b, ConditionCSVMultisigTapscript as c, ConditionMultisigTapscript as d, TapTreeCoder as e, TapscriptType as f, decodeTapscript as g, getSequence as h, scriptFromTapLeafScript as s };