@knuth/js-wasm 2.10.0 → 3.0.0

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 (74) hide show
  1. package/LICENSE.md +23 -0
  2. package/README.md +235 -22
  3. package/package.json +12 -7
  4. package/src/kth.js +6 -3
  5. package/src/kth.wasm +0 -0
  6. package/types/Bitcoin.d.ts +4 -0
  7. package/types/DerivationPath.d.ts +8 -0
  8. package/types/DoubleList.d.ts +5 -4
  9. package/types/EcCompressed.d.ts +8 -3
  10. package/types/EcPublic.d.ts +10 -4
  11. package/types/ElectrumClient.d.ts +79 -0
  12. package/types/EllipticCurve.d.ts +8 -2
  13. package/types/Hash.d.ts +5 -0
  14. package/types/HdPublic.d.ts +9 -3
  15. package/types/Input.d.ts +10 -7
  16. package/types/InputList.d.ts +6 -5
  17. package/types/Interpreter.d.ts +9 -1
  18. package/types/Kth.d.ts +4 -0
  19. package/types/LazySequence.d.ts +4 -0
  20. package/types/ListHelper.d.ts +12 -0
  21. package/types/ListNative.d.ts +4 -0
  22. package/types/NativeLifetime.d.ts +11 -0
  23. package/types/Opcode.d.ts +10 -3
  24. package/types/OpcodeAliases.d.ts +16 -0
  25. package/types/Operation.d.ts +31 -26
  26. package/types/OperationList.d.ts +6 -5
  27. package/types/Output.d.ts +11 -7
  28. package/types/OutputList.d.ts +6 -5
  29. package/types/OutputPoint.d.ts +8 -4
  30. package/types/PaymentAddress.d.ts +13 -8
  31. package/types/PaymentAddressList.d.ts +6 -5
  32. package/types/Program.d.ts +15 -2
  33. package/types/RuleFork.d.ts +4 -0
  34. package/types/Script.d.ts +34 -19
  35. package/types/ScriptFlags.d.ts +67 -0
  36. package/types/Secret.d.ts +4 -0
  37. package/types/SecretFunctions.d.ts +4 -0
  38. package/types/SighashAlgorithm.d.ts +4 -0
  39. package/types/SighashGuard.d.ts +10 -0
  40. package/types/StringList.d.ts +5 -4
  41. package/types/TokenData.d.ts +8 -3
  42. package/types/TokenDataBothKinds.d.ts +6 -3
  43. package/types/TokenDataFungible.d.ts +4 -0
  44. package/types/TokenDataNonFungible.d.ts +9 -2
  45. package/types/Transaction.d.ts +12 -10
  46. package/types/TransactionHelpers.d.ts +14 -0
  47. package/types/U32List.d.ts +5 -4
  48. package/types/U64List.d.ts +5 -4
  49. package/types/Utxo.d.ts +10 -6
  50. package/types/UtxoList.d.ts +6 -5
  51. package/types/Wallet.d.ts +28 -52
  52. package/types/WalletData.d.ts +5 -1
  53. package/types/WalletManager.d.ts +6 -3
  54. package/types/WalletUtils.d.ts +53 -0
  55. package/types/encoding.d.ts +4 -0
  56. package/types/env.d.ts +4 -0
  57. package/types/logger.d.ts +6 -0
  58. package/types/main.d.ts +75 -2
  59. package/types/nativeScope.d.ts +10 -0
  60. package/types/types.d.ts +4 -0
  61. package/types/utils.d.ts +4 -0
  62. package/types/wasm/EmscriptenModule.d.ts +4 -0
  63. package/types/wasm/bootloader.d.ts +4 -0
  64. package/types/wasm/exceptions.d.ts +4 -0
  65. package/types/wasm/glue.d.ts +937 -170
  66. package/types/wasm/glue_manual.d.ts +4 -0
  67. package/types/wasm/loadLib.d.ts +4 -0
  68. package/types/wasm/manualGeneratedTypes.d.ts +4 -0
  69. package/types/wasm/mem.d.ts +33 -1
  70. package/types/wasm/promises.d.ts +4 -0
  71. package/types/wasm/stack.d.ts +6 -0
  72. package/types/wasm/string.d.ts +13 -0
  73. package/types/LazySequence copy.d.ts +0 -0
  74. package/types/wasm/glue copy.d.ts +0 -230
@@ -1,9 +1,23 @@
1
+ // Copyright (c) 2016-present Knuth Project developers.
2
+ // Distributed under the MIT software license, see the accompanying
3
+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
+
1
5
  declare const ptrSym: unique symbol;
6
+ /** A native call that returns a status code reported a non-zero status. */
7
+ export declare class NativeStatusError extends Error {
8
+ readonly operation: string;
9
+ readonly status: number;
10
+ constructor(operation: string, status: number);
11
+ }
12
+ /** True for a non-owning view (it must not be released: its parent owns the native handle). */
13
+ export declare function isBorrowedView(obj: any): boolean;
2
14
  declare const _CurrencyIntToKey: readonly ["bitcoin", "bitcoin_cash", "litecoin"];
3
15
  export declare type Currency = (typeof _CurrencyIntToKey)[number];
4
16
  export declare function CurrencyToInt(value: Currency): number;
17
+ export declare function CurrencyFromInt(value: number): Currency;
5
18
  export declare class LibConfigTypeSizes {
6
19
  private readonly [ptrSym];
20
+ private constructor();
7
21
  static _create(ptr: number): LibConfigTypeSizes;
8
22
  get size_int(): number;
9
23
  get size_long(): number;
@@ -12,6 +26,7 @@ export declare class LibConfigTypeSizes {
12
26
  }
13
27
  export declare class LibConfig {
14
28
  private readonly [ptrSym];
29
+ private constructor();
15
30
  static _create(ptr: number): LibConfig;
16
31
  get version(): string;
17
32
  get microarchitecture_id(): string;
@@ -35,20 +50,27 @@ export declare class LibConfig {
35
50
  static getEmscriptenVersionTiny(): number;
36
51
  static getBuildTimestamp(): number;
37
52
  }
53
+ declare const _NetworkIntToKey: readonly ["mainnet", "testnet", "regtest", "testnet4", "scalenet", "chipnet"];
54
+ export declare type Network = (typeof _NetworkIntToKey)[number];
55
+ export declare function NetworkToInt(value: Network): number;
56
+ export declare function NetworkFromInt(value: number): Network;
38
57
  export declare class StringListNative {
39
58
  private readonly [ptrSym];
40
59
  static _create(ptr: number): StringListNative;
41
60
  protected _destructor(): void;
42
61
  constructor();
43
- pushBack(string: string): void;
62
+ pushBack(elem: string): void;
44
63
  count(): number;
45
64
  nth(index: number): string;
65
+ assignAt(index: number, elem: string): void;
66
+ erase(index: number): void;
46
67
  }
47
68
  export declare class ShortHashNative {
48
69
  private readonly [ptrSym];
49
70
  static _create(ptr: number): ShortHashNative;
50
71
  get hash(): number;
51
72
  protected _destructor(): void;
73
+ constructor();
52
74
  set(data: number): void;
53
75
  }
54
76
  export declare class HashNative {
@@ -64,6 +86,7 @@ export declare class LongHashNative {
64
86
  static _create(ptr: number): LongHashNative;
65
87
  get hash(): number;
66
88
  protected _destructor(): void;
89
+ constructor();
67
90
  set(data: number): void;
68
91
  }
69
92
  export declare class EncryptedSeedNative {
@@ -71,60 +94,98 @@ export declare class EncryptedSeedNative {
71
94
  static _create(ptr: number): EncryptedSeedNative;
72
95
  get hash(): number;
73
96
  protected _destructor(): void;
97
+ constructor();
74
98
  set(data: number): void;
75
99
  }
76
100
  export declare class HashFunctionsNative {
77
101
  static sha256(encoded: Uint8Array): HashNative;
78
102
  static sha256Reversed(encoded: Uint8Array): HashNative;
79
103
  static sha256ReversedStr(encoded: Uint8Array): string;
104
+ static ripemd160(encoded: Uint8Array): ShortHashNative;
105
+ }
106
+ export declare class HashListNative {
107
+ private readonly [ptrSym];
108
+ static _create(ptr: number): HashListNative;
109
+ protected _destructor(): void;
110
+ constructor();
111
+ pushBack(elem: HashNative): void;
112
+ count(): number;
113
+ nth(index: number): HashNative;
114
+ assignAt(index: number, elem: HashNative): void;
115
+ erase(index: number): void;
80
116
  }
81
117
  export declare class DoubleListNative {
82
118
  private readonly [ptrSym];
83
119
  static _create(ptr: number): DoubleListNative;
84
120
  protected _destructor(): void;
85
121
  constructor();
86
- pushBack(x: number): void;
122
+ pushBack(elem: number): void;
87
123
  count(): number;
88
124
  nth(index: number): number;
125
+ assignAt(index: number, elem: number): void;
126
+ erase(index: number): void;
89
127
  }
90
128
  export declare class U32ListNative {
91
129
  private readonly [ptrSym];
92
130
  static _create(ptr: number): U32ListNative;
93
131
  protected _destructor(): void;
94
132
  constructor();
95
- pushBack(x: number): void;
133
+ pushBack(elem: number): void;
96
134
  count(): number;
97
135
  nth(index: number): number;
136
+ assignAt(index: number, elem: number): void;
137
+ erase(index: number): void;
98
138
  }
99
139
  export declare class U64ListNative {
100
140
  private readonly [ptrSym];
101
141
  static _create(ptr: number): U64ListNative;
102
142
  protected _destructor(): void;
103
143
  constructor();
104
- pushBack(x: bigint): void;
144
+ pushBack(elem: bigint): void;
105
145
  count(): number;
106
146
  nth(index: number): bigint;
147
+ assignAt(index: number, elem: bigint): void;
148
+ erase(index: number): void;
107
149
  }
150
+ export declare class BoolListNative {
151
+ private readonly [ptrSym];
152
+ static _create(ptr: number): BoolListNative;
153
+ protected _destructor(): void;
154
+ constructor();
155
+ pushBack(elem: boolean): void;
156
+ count(): number;
157
+ nth(index: number): boolean;
158
+ assignAt(index: number, elem: boolean): void;
159
+ erase(index: number): void;
160
+ }
161
+ declare const _DbModeIntToKey: readonly ["pruned", "normal", "full_indexed"];
162
+ export declare type DbMode = (typeof _DbModeIntToKey)[number];
163
+ export declare function DbModeToInt(value: DbMode): number;
164
+ export declare function DbModeFromInt(value: number): DbMode;
108
165
  export declare class HdChainCodeNative {
109
166
  private readonly [ptrSym];
167
+ private constructor();
110
168
  static _create(ptr: number): HdChainCodeNative;
111
169
  get data(): number;
112
170
  protected _destructor(): void;
113
171
  }
114
172
  export declare class HdKeyNative {
115
173
  private readonly [ptrSym];
174
+ private constructor();
116
175
  static _create(ptr: number): HdKeyNative;
117
176
  get data(): number;
118
177
  protected _destructor(): void;
119
178
  }
120
179
  export declare class EcCompressedNative {
121
180
  private readonly [ptrSym];
181
+ private constructor();
122
182
  static _create(ptr: number): EcCompressedNative;
123
183
  get data(): number;
124
184
  protected _destructor(): void;
125
185
  }
126
186
  export declare class EcUncompressedNative {
127
187
  private readonly [ptrSym];
188
+ private constructor();
128
189
  static _create(ptr: number): EcUncompressedNative;
129
190
  get data(): number;
130
191
  protected _destructor(): void;
@@ -139,12 +200,14 @@ export declare class EcSecretNative {
139
200
  }
140
201
  export declare class WifUncompressedNative {
141
202
  private readonly [ptrSym];
203
+ private constructor();
142
204
  static _create(ptr: number): WifUncompressedNative;
143
205
  get data(): number;
144
206
  protected _destructor(): void;
145
207
  }
146
208
  export declare class WifCompressedNative {
147
209
  private readonly [ptrSym];
210
+ private constructor();
148
211
  static _create(ptr: number): WifCompressedNative;
149
212
  get data(): number;
150
213
  protected _destructor(): void;
@@ -157,123 +220,217 @@ export declare class HdLineageNative {
157
220
  get parent_fingerprint(): number;
158
221
  get child_number(): number;
159
222
  protected _destructor(): void;
223
+ constructor(prefixes: bigint, depth: number, parent_fingerprint: number, child_number: number);
160
224
  }
161
225
  export declare class EllipticCurveNative {
162
- static secretToPublic(out: EcCompressedNative, secret: EcSecretNative): boolean;
226
+ static secretToPublic(secret: Uint8Array): [boolean, Uint8Array];
163
227
  }
164
228
  export declare class HdPublicNative {
165
229
  private readonly [ptrSym];
230
+ private constructor();
166
231
  static _create(ptr: number): HdPublicNative;
167
232
  protected _destructor(): void;
168
- constructor();
169
- constructor(encoded: string);
170
- isValid(): boolean;
171
- encoded(): string;
172
- chainCode(): HdChainCodeNative;
233
+ copy(): HdPublicNative;
234
+ static toPrefix(prefixes: bigint): number;
235
+ static parseFrom(encoded: string): HdPublicNative;
236
+ static parseFromWithPrefix(encoded: string, prefix: number): HdPublicNative;
237
+ static fromHdKey(key: Uint8Array): HdPublicNative;
238
+ static fromHdKeyWithPrefix(key: Uint8Array, prefix: number): HdPublicNative;
239
+ static fromSecret(secret: HashNative, chain_code: HashNative, lineage: HdLineageNative): HdPublicNative;
240
+ static fromVerifiedComponents(point: Uint8Array, chain_code: HashNative, lineage: HdLineageNative): HdPublicNative;
241
+ equals(other: HdPublicNative): boolean;
242
+ notEqual(other: HdPublicNative): boolean;
243
+ less(x: HdPublicNative): boolean;
244
+ greater(x: HdPublicNative): boolean;
245
+ lessOrEqual(x: HdPublicNative): boolean;
246
+ greaterOrEqual(x: HdPublicNative): boolean;
247
+ toStr(): string;
248
+ chainCode(): HashNative;
173
249
  lineage(): HdLineageNative;
174
- point(): EcCompressedNative;
175
- toHdKey(): HdKeyNative;
250
+ point(): Uint8Array;
251
+ toHdKey(): Uint8Array;
176
252
  derivePublic(index: number): HdPublicNative;
253
+ derivePath(path: string): HdPublicNative;
254
+ fingerprint(): number;
255
+ wipe(): void;
177
256
  }
178
257
  export declare class HdPrivateNative {
179
258
  private readonly [ptrSym];
259
+ private constructor();
180
260
  static _create(ptr: number): HdPrivateNative;
181
261
  protected _destructor(): void;
182
- constructor();
183
- constructor(encoded: string);
184
- constructor(seed: number, size: number, prefixes: bigint);
185
- isValid(): boolean;
186
- encoded(): string;
187
- secret(): EcSecretNative;
188
- chainCode(): HdChainCodeNative;
262
+ copy(): HdPrivateNative;
263
+ static toPrefix(prefixes: bigint): number;
264
+ static parseFrom(encoded: string): HdPrivateNative;
265
+ static parseFromWithPublicPrefix(encoded: string, public_prefix: number): HdPrivateNative;
266
+ static parseFromWithPrefixes(encoded: string, prefixes: bigint): HdPrivateNative;
267
+ static fromSeed(seed: Uint8Array, prefixes: bigint): HdPrivateNative;
268
+ static fromHdKey(private_key: Uint8Array): HdPrivateNative;
269
+ static fromHdKeyWithPublicPrefix(private_key: Uint8Array, public_prefix: number): HdPrivateNative;
270
+ static fromHdKeyWithPrefixes(private_key: Uint8Array, prefixes: bigint): HdPrivateNative;
271
+ static fromVerifiedParts(base: HdPublicNative, secret: HashNative): HdPrivateNative;
272
+ equals(other: HdPrivateNative): boolean;
273
+ notEqual(other: HdPrivateNative): boolean;
274
+ less(x: HdPrivateNative): boolean;
275
+ greater(x: HdPrivateNative): boolean;
276
+ lessOrEqual(x: HdPrivateNative): boolean;
277
+ greaterOrEqual(x: HdPrivateNative): boolean;
278
+ secret(): HashNative;
279
+ publicKey(): HdPublicNative;
280
+ chainCode(): HashNative;
189
281
  lineage(): HdLineageNative;
190
- point(): EcCompressedNative;
191
- toHdKeyNative(): HdKeyNative;
282
+ point(): Uint8Array;
283
+ toStr(): string;
284
+ toHdKey(): Uint8Array;
192
285
  toPublic(): HdPublicNative;
193
286
  derivePrivate(index: number): HdPrivateNative;
287
+ derivePath(path: string): HdPrivateNative;
288
+ static fromSeedAndPath(seed: Uint8Array, path: string, prefixes: bigint): HdPrivateNative;
194
289
  derivePublic(index: number): HdPublicNative;
195
- }
196
- export declare class PaymentAddressListNative {
197
- private readonly [ptrSym];
198
- static _create(ptr: number): PaymentAddressListNative;
199
- protected _destructor(): void;
200
- constructor();
201
- pushBack(utxo: PaymentAddressNative): void;
202
- count(): number;
203
- nth(index: number): PaymentAddressNative;
290
+ wipe(): void;
204
291
  }
205
292
  export declare class PaymentAddressNative {
206
293
  private readonly [ptrSym];
207
294
  static _create(ptr: number): PaymentAddressNative;
208
295
  protected _destructor(): void;
209
- constructor(address: string);
210
- static fromShortHash(hash: ShortHashNative, version: number): PaymentAddressNative;
211
- static fromHash(hash: HashNative, version: number): PaymentAddressNative;
296
+ constructor(short_hash: ShortHashNative, version: number);
297
+ constructor(hash: HashNative, version: number);
298
+ copy(): PaymentAddressNative;
299
+ static cashaddrPrefixFor(net: Network): string;
300
+ static parseFromSimple(address: string): PaymentAddressNative;
301
+ static parseFrom(address: string, net: Network): PaymentAddressNative;
302
+ static fromPayment(decoded: Uint8Array): PaymentAddressNative;
303
+ static fromEcPrivate(secret: EcPrivateNative): PaymentAddressNative;
304
+ static fromEcPublic(point: EcPublicNative, version: number): PaymentAddressNative;
212
305
  static fromScript(script: ScriptNative, version: number): PaymentAddressNative;
213
306
  static fromPayPublicKeyHashScript(script: ScriptNative, version: number): PaymentAddressNative;
307
+ equals(other: PaymentAddressNative): boolean;
308
+ notEqual(other: PaymentAddressNative): boolean;
309
+ less(x: PaymentAddressNative): boolean;
310
+ greater(x: PaymentAddressNative): boolean;
311
+ lessOrEqual(x: PaymentAddressNative): boolean;
312
+ greaterOrEqual(x: PaymentAddressNative): boolean;
313
+ toStr(): string;
214
314
  encodedLegacy(): string;
215
- encodedCashAddr(tokenAware: boolean): string;
315
+ encodedCashaddr(token_aware: boolean): string;
316
+ encodedToken(): string;
317
+ version(): number;
318
+ hashSpan(): Uint8Array;
216
319
  hash20(): ShortHashNative;
217
320
  hash32(): HashNative;
218
- version(): number;
219
- isValid(): boolean;
220
- static extract(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
221
- static extractInput(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
222
- static extractOutput(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
321
+ toPayment(): Uint8Array;
322
+ static extract(script: ScriptNative, p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
323
+ static extractInput(script: ScriptNative, p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
324
+ static extractOutput(script: ScriptNative, p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
325
+ }
326
+ export declare class PaymentAddressListNative {
327
+ private readonly [ptrSym];
328
+ static _create(ptr: number): PaymentAddressListNative;
329
+ protected _destructor(): void;
330
+ constructor();
331
+ pushBack(elem: PaymentAddressNative): void;
332
+ count(): number;
333
+ nth(index: number): PaymentAddressNative;
334
+ assignAt(index: number, elem: PaymentAddressNative): void;
335
+ erase(index: number): void;
223
336
  }
224
337
  export declare class EcPrivateNative {
225
338
  private readonly [ptrSym];
339
+ private constructor();
226
340
  static _create(ptr: number): EcPrivateNative;
227
341
  protected _destructor(): void;
228
- constructor();
229
- constructor(wif: string, version: number);
230
- constructor(wif: WifCompressedNative, version: number);
231
- constructor(wif: WifUncompressedNative, version: number);
232
- constructor(secret: EcSecretNative, version: number, compress: boolean);
233
- isValid(): boolean;
234
- encoded(): string;
235
- secret(): EcSecretNative;
342
+ copy(): EcPrivateNative;
343
+ static toAddressPrefix(version: number): number;
344
+ static toWifPrefix(version: number): number;
345
+ static toVersion(address: number, wif: number): number;
346
+ static parseFrom(wif: string, version: number): EcPrivateNative;
347
+ static fromCompressed(wif: Uint8Array, address_version: number): EcPrivateNative;
348
+ static fromUncompressed(wif: Uint8Array, address_version: number): EcPrivateNative;
349
+ static fromSecret(secret: HashNative, version: number, compress: boolean): EcPrivateNative;
350
+ static fromVerifiedSecret(secret: HashNative, version: number, compress: boolean): EcPrivateNative;
351
+ equals(other: EcPrivateNative): boolean;
352
+ notEqual(other: EcPrivateNative): boolean;
353
+ less(x: EcPrivateNative): boolean;
354
+ greater(x: EcPrivateNative): boolean;
355
+ lessOrEqual(x: EcPrivateNative): boolean;
356
+ greaterOrEqual(x: EcPrivateNative): boolean;
357
+ value(): HashNative;
358
+ secret(): HashNative;
236
359
  version(): number;
237
360
  paymentVersion(): number;
238
361
  wifVersion(): number;
239
362
  compressed(): boolean;
363
+ toStr(): string;
240
364
  toPublic(): EcPublicNative;
241
365
  toPaymentAddress(): PaymentAddressNative;
242
366
  }
243
367
  export declare class EcPublicNative {
244
368
  private readonly [ptrSym];
369
+ private constructor();
245
370
  static _create(ptr: number): EcPublicNative;
246
371
  protected _destructor(): void;
247
- constructor();
248
- constructor(base16: string);
249
- constructor(secret: EcPrivateNative);
250
- constructor(point: EcCompressedNative, compress: boolean);
251
- isValid(): boolean;
252
- encoded(): string;
253
- point(): EcCompressedNative;
372
+ static fromData(decoded: Uint8Array): EcPublicNative;
373
+ copy(): EcPublicNative;
374
+ static parseFrom(base16: string): EcPublicNative;
375
+ static fromPrivate(secret: EcPrivateNative): EcPublicNative;
376
+ static fromPoint(point: Uint8Array, compress: boolean): EcPublicNative;
377
+ static fromVerifiedPoint(point: Uint8Array, compress: boolean): EcPublicNative;
378
+ equals(other: EcPublicNative): boolean;
379
+ notEqual(other: EcPublicNative): boolean;
380
+ less(x: EcPublicNative): boolean;
381
+ greater(x: EcPublicNative): boolean;
382
+ lessOrEqual(x: EcPublicNative): boolean;
383
+ greaterOrEqual(x: EcPublicNative): boolean;
384
+ value(): Uint8Array;
385
+ point(): Uint8Array;
254
386
  compressed(): boolean;
387
+ toStr(): string;
388
+ encoded(): string;
255
389
  toData(): Uint8Array;
256
- toUncompressed(outData: EcUncompressedNative): boolean;
390
+ toUncompressed(): Uint8Array;
257
391
  toPaymentAddress(version: number): PaymentAddressNative;
258
392
  }
393
+ export declare class EcCompressedListNative {
394
+ private readonly [ptrSym];
395
+ static _create(ptr: number): EcCompressedListNative;
396
+ protected _destructor(): void;
397
+ constructor();
398
+ pushBack(elem: Uint8Array): void;
399
+ count(): number;
400
+ nth(index: number): Uint8Array;
401
+ }
402
+ export declare class DataStackNative {
403
+ private readonly [ptrSym];
404
+ static _create(ptr: number): DataStackNative;
405
+ protected _destructor(): void;
406
+ constructor();
407
+ copy(): DataStackNative;
408
+ count(): number;
409
+ pushBack(data: Uint8Array): void;
410
+ nth(index: number): Uint8Array;
411
+ nthCopy(index: number): Uint8Array;
412
+ erase(index: number): void;
413
+ }
259
414
  export declare class WalletNative {
260
415
  static mnemonicsToSeed(mnemonics: StringListNative): LongHashNative;
261
- static hdNew(seed: LongHashNative, version: number): HdPrivateNative;
262
- static hdPrivateToEc(key: HdPrivateNative): EcSecretNative;
263
- static ecToPublic(secret: EcSecretNative, uncompressed: boolean): EcPublicNative;
264
- static ecToAddress(point: EcPublicNative, version: number): PaymentAddressNative;
416
+ static mnemonicsToSeedNormalizedPassphrase(mnemonics: StringListNative, normalized_passphrase: string): LongHashNative;
265
417
  }
266
418
  export declare class WalletDataNative {
267
419
  private readonly [ptrSym];
420
+ private constructor();
268
421
  static _create(ptr: number): WalletDataNative;
269
422
  protected _destructor(): void;
423
+ copy(): WalletDataNative;
270
424
  mnemonics(): StringListNative;
271
- encryptedSeed(): EncryptedSeedNative;
425
+ setMnemonics(value: StringListNative): void;
272
426
  xpub(): HdPublicNative;
427
+ setXpub(value: HdPublicNative): void;
428
+ encryptedSeed(): Uint8Array;
429
+ setEncryptedSeed(value: Uint8Array): void;
430
+ static create(password: string, normalized_passphrase: string): WalletDataNative;
273
431
  }
274
432
  export declare class WalletManagerNative {
275
- static createWallet(password: string, normalizedPassphrase: string): [number, WalletDataNative];
276
- static decryptSeed(password: string, encryptedSeed: EncryptedSeedNative): [number, LongHashNative];
433
+ static decryptSeed(password: string, encrypted_seed: Uint8Array): LongHashNative;
277
434
  }
278
435
  export declare class NodeInfoNative {
279
436
  static printThreadId(): void;
@@ -284,39 +441,295 @@ export declare class NodeInfoNative {
284
441
  static marchNames(): string;
285
442
  static currencySymbol(): string;
286
443
  static currency(): string;
444
+ static dbType(mode: DbMode): string;
287
445
  static cppapiBuildTimestamp(): number;
446
+ static utxozReferenceMode(): boolean;
447
+ static embeddedBloomAvailable(): boolean;
448
+ static embeddedBloomCheckpointHeight(): number;
288
449
  }
450
+ declare const _OpcodeEnumNativeIntToKey: {
451
+ readonly '0': "push_size_0";
452
+ readonly '1': "push_size_1";
453
+ readonly '2': "push_size_2";
454
+ readonly '3': "push_size_3";
455
+ readonly '4': "push_size_4";
456
+ readonly '5': "push_size_5";
457
+ readonly '6': "push_size_6";
458
+ readonly '7': "push_size_7";
459
+ readonly '8': "push_size_8";
460
+ readonly '9': "push_size_9";
461
+ readonly '10': "push_size_10";
462
+ readonly '11': "push_size_11";
463
+ readonly '12': "push_size_12";
464
+ readonly '13': "push_size_13";
465
+ readonly '14': "push_size_14";
466
+ readonly '15': "push_size_15";
467
+ readonly '16': "push_size_16";
468
+ readonly '17': "push_size_17";
469
+ readonly '18': "push_size_18";
470
+ readonly '19': "push_size_19";
471
+ readonly '20': "push_size_20";
472
+ readonly '21': "push_size_21";
473
+ readonly '22': "push_size_22";
474
+ readonly '23': "push_size_23";
475
+ readonly '24': "push_size_24";
476
+ readonly '25': "push_size_25";
477
+ readonly '26': "push_size_26";
478
+ readonly '27': "push_size_27";
479
+ readonly '28': "push_size_28";
480
+ readonly '29': "push_size_29";
481
+ readonly '30': "push_size_30";
482
+ readonly '31': "push_size_31";
483
+ readonly '32': "push_size_32";
484
+ readonly '33': "push_size_33";
485
+ readonly '34': "push_size_34";
486
+ readonly '35': "push_size_35";
487
+ readonly '36': "push_size_36";
488
+ readonly '37': "push_size_37";
489
+ readonly '38': "push_size_38";
490
+ readonly '39': "push_size_39";
491
+ readonly '40': "push_size_40";
492
+ readonly '41': "push_size_41";
493
+ readonly '42': "push_size_42";
494
+ readonly '43': "push_size_43";
495
+ readonly '44': "push_size_44";
496
+ readonly '45': "push_size_45";
497
+ readonly '46': "push_size_46";
498
+ readonly '47': "push_size_47";
499
+ readonly '48': "push_size_48";
500
+ readonly '49': "push_size_49";
501
+ readonly '50': "push_size_50";
502
+ readonly '51': "push_size_51";
503
+ readonly '52': "push_size_52";
504
+ readonly '53': "push_size_53";
505
+ readonly '54': "push_size_54";
506
+ readonly '55': "push_size_55";
507
+ readonly '56': "push_size_56";
508
+ readonly '57': "push_size_57";
509
+ readonly '58': "push_size_58";
510
+ readonly '59': "push_size_59";
511
+ readonly '60': "push_size_60";
512
+ readonly '61': "push_size_61";
513
+ readonly '62': "push_size_62";
514
+ readonly '63': "push_size_63";
515
+ readonly '64': "push_size_64";
516
+ readonly '65': "push_size_65";
517
+ readonly '66': "push_size_66";
518
+ readonly '67': "push_size_67";
519
+ readonly '68': "push_size_68";
520
+ readonly '69': "push_size_69";
521
+ readonly '70': "push_size_70";
522
+ readonly '71': "push_size_71";
523
+ readonly '72': "push_size_72";
524
+ readonly '73': "push_size_73";
525
+ readonly '74': "push_size_74";
526
+ readonly '75': "push_size_75";
527
+ readonly '76': "push_one_size";
528
+ readonly '77': "push_two_size";
529
+ readonly '78': "push_four_size";
530
+ readonly '79': "push_negative_1";
531
+ readonly '80': "reserved_80";
532
+ readonly '81': "push_positive_1";
533
+ readonly '82': "push_positive_2";
534
+ readonly '83': "push_positive_3";
535
+ readonly '84': "push_positive_4";
536
+ readonly '85': "push_positive_5";
537
+ readonly '86': "push_positive_6";
538
+ readonly '87': "push_positive_7";
539
+ readonly '88': "push_positive_8";
540
+ readonly '89': "push_positive_9";
541
+ readonly '90': "push_positive_10";
542
+ readonly '91': "push_positive_11";
543
+ readonly '92': "push_positive_12";
544
+ readonly '93': "push_positive_13";
545
+ readonly '94': "push_positive_14";
546
+ readonly '95': "push_positive_15";
547
+ readonly '96': "push_positive_16";
548
+ readonly '97': "nop";
549
+ readonly '98': "reserved_98";
550
+ readonly '99': "if_";
551
+ readonly '100': "notif";
552
+ readonly '101': "op_begin";
553
+ readonly '102': "op_until";
554
+ readonly '103': "else_";
555
+ readonly '104': "endif";
556
+ readonly '105': "verify";
557
+ readonly '106': "return_";
558
+ readonly '107': "toaltstack";
559
+ readonly '108': "fromaltstack";
560
+ readonly '109': "drop2";
561
+ readonly '110': "dup2";
562
+ readonly '111': "dup3";
563
+ readonly '112': "over2";
564
+ readonly '113': "rot2";
565
+ readonly '114': "swap2";
566
+ readonly '115': "ifdup";
567
+ readonly '116': "depth";
568
+ readonly '117': "drop";
569
+ readonly '118': "dup";
570
+ readonly '119': "nip";
571
+ readonly '120': "over";
572
+ readonly '121': "pick";
573
+ readonly '122': "roll";
574
+ readonly '123': "rot";
575
+ readonly '124': "swap";
576
+ readonly '125': "tuck";
577
+ readonly '126': "cat";
578
+ readonly '127': "split";
579
+ readonly '128': "num2bin";
580
+ readonly '129': "bin2num";
581
+ readonly '130': "size";
582
+ readonly '131': "op_invert";
583
+ readonly '132': "and_";
584
+ readonly '133': "or_";
585
+ readonly '134': "xor_";
586
+ readonly '135': "equal";
587
+ readonly '136': "equalverify";
588
+ readonly '137': "op_define";
589
+ readonly '138': "op_invoke";
590
+ readonly '139': "add1";
591
+ readonly '140': "sub1";
592
+ readonly '141': "op_lshiftnum";
593
+ readonly '142': "op_rshiftnum";
594
+ readonly '143': "negate";
595
+ readonly '144': "abs";
596
+ readonly '145': "not_";
597
+ readonly '146': "nonzero";
598
+ readonly '147': "add";
599
+ readonly '148': "sub";
600
+ readonly '149': "mul";
601
+ readonly '150': "div";
602
+ readonly '151': "mod";
603
+ readonly '152': "op_lshiftbin";
604
+ readonly '153': "op_rshiftbin";
605
+ readonly '154': "booland";
606
+ readonly '155': "boolor";
607
+ readonly '156': "numequal";
608
+ readonly '157': "numequalverify";
609
+ readonly '158': "numnotequal";
610
+ readonly '159': "lessthan";
611
+ readonly '160': "greaterthan";
612
+ readonly '161': "lessthanorequal";
613
+ readonly '162': "greaterthanorequal";
614
+ readonly '163': "min";
615
+ readonly '164': "max";
616
+ readonly '165': "within";
617
+ readonly '166': "ripemd160";
618
+ readonly '167': "sha1";
619
+ readonly '168': "sha256";
620
+ readonly '169': "hash160";
621
+ readonly '170': "hash256";
622
+ readonly '171': "codeseparator";
623
+ readonly '172': "checksig";
624
+ readonly '173': "checksigverify";
625
+ readonly '174': "checkmultisig";
626
+ readonly '175': "checkmultisigverify";
627
+ readonly '176': "nop1";
628
+ readonly '177': "nop2";
629
+ readonly '178': "nop3";
630
+ readonly '179': "nop4";
631
+ readonly '180': "nop5";
632
+ readonly '181': "nop6";
633
+ readonly '182': "nop7";
634
+ readonly '183': "nop8";
635
+ readonly '184': "nop9";
636
+ readonly '185': "nop10";
637
+ readonly '186': "checkdatasig";
638
+ readonly '187': "checkdatasigverify";
639
+ readonly '188': "reverse_bytes";
640
+ readonly '192': "input_index";
641
+ readonly '193': "active_bytecode";
642
+ readonly '194': "tx_version";
643
+ readonly '195': "tx_input_count";
644
+ readonly '196': "tx_output_count";
645
+ readonly '197': "tx_locktime";
646
+ readonly '198': "utxo_value";
647
+ readonly '199': "utxo_bytecode";
648
+ readonly '200': "outpoint_tx_hash";
649
+ readonly '201': "outpoint_index";
650
+ readonly '202': "input_bytecode";
651
+ readonly '203': "input_sequence_number";
652
+ readonly '204': "output_value";
653
+ readonly '205': "output_bytecode";
654
+ readonly '206': "utxo_token_category";
655
+ readonly '207': "utxo_token_commitment";
656
+ readonly '208': "utxo_token_amount";
657
+ readonly '209': "output_token_category";
658
+ readonly '210': "output_token_commitment";
659
+ readonly '211': "output_token_amount";
660
+ readonly '212': "reserved_212";
661
+ readonly '213': "reserved_213";
662
+ readonly '214': "reserved_214";
663
+ readonly '215': "reserved_215";
664
+ readonly '216': "reserved_216";
665
+ readonly '217': "reserved_217";
666
+ readonly '218': "reserved_218";
667
+ readonly '219': "reserved_219";
668
+ readonly '220': "reserved_220";
669
+ readonly '221': "reserved_221";
670
+ readonly '222': "reserved_222";
671
+ readonly '223': "reserved_223";
672
+ readonly '224': "reserved_224";
673
+ readonly '225': "reserved_225";
674
+ readonly '226': "reserved_226";
675
+ readonly '227': "reserved_227";
676
+ readonly '228': "reserved_228";
677
+ readonly '229': "reserved_229";
678
+ readonly '230': "reserved_230";
679
+ readonly '231': "reserved_231";
680
+ readonly '232': "reserved_232";
681
+ readonly '233': "reserved_233";
682
+ readonly '234': "reserved_234";
683
+ readonly '235': "reserved_235";
684
+ readonly '236': "reserved_236";
685
+ readonly '237': "reserved_237";
686
+ readonly '238': "reserved_238";
687
+ readonly '239': "reserved_239";
688
+ readonly '240': "reserved_240";
689
+ readonly '241': "reserved_241";
690
+ readonly '242': "reserved_242";
691
+ readonly '243': "reserved_243";
692
+ readonly '244': "reserved_244";
693
+ readonly '245': "reserved_245";
694
+ readonly '246': "reserved_246";
695
+ readonly '247': "reserved_247";
696
+ readonly '248': "reserved_248";
697
+ readonly '249': "reserved_249";
698
+ readonly '250': "reserved_250";
699
+ readonly '251': "reserved_251";
700
+ readonly '252': "reserved_252";
701
+ readonly '253': "reserved_253";
702
+ readonly '254': "reserved_254";
703
+ readonly '255': "reserved_255";
704
+ };
705
+ export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[keyof typeof _OpcodeEnumNativeIntToKey];
706
+ export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
707
+ export declare function OpcodeEnumNativeFromInt(value: number): OpcodeEnumNative;
289
708
  export declare class OpcodeNative {
290
- static to_string(value: OpcodeEnumNative, active_forks: number): string;
291
- static from_string(value: string): [boolean, OpcodeEnumNative];
292
- static to_hexadecimal(code: OpcodeEnumNative): string;
293
- static from_hexadecimal(value: string): [boolean, OpcodeEnumNative];
709
+ static toStr(value: OpcodeEnumNative, active_flags: bigint): string;
710
+ static fromStr(value: string): [boolean, OpcodeEnumNative];
711
+ static toHexadecimal(code: OpcodeEnumNative): string;
712
+ static fromHexadecimal(value: string): [boolean, OpcodeEnumNative];
294
713
  }
295
714
  export declare class OperationNative {
296
715
  private readonly [ptrSym];
297
716
  static _create(ptr: number): OperationNative;
298
717
  protected _destructor(): void;
299
718
  constructor();
300
- constructor(opcode: OpcodeEnumNative);
301
- constructor(encoded: Uint8Array, minimal: boolean);
302
- toStr(activeForks: number): string;
303
- toData(): Uint8Array;
304
- fromData(encoded: Uint8Array): boolean;
305
- fromStr(str: string): boolean;
719
+ constructor(code: OpcodeEnumNative);
720
+ constructor(uncoded: Uint8Array, minimal: boolean);
721
+ static fromData(data: Uint8Array): OperationNative;
722
+ copy(): OperationNative;
723
+ equals(other: OperationNative): boolean;
724
+ notEqual(other: OperationNative): boolean;
725
+ fromStr(mnemonic: string): boolean;
306
726
  isValid(): boolean;
727
+ toDataSimple(): Uint8Array;
728
+ toData(): Uint8Array;
729
+ toStr(active_flags: bigint): string;
307
730
  serializedSize(): number;
308
731
  code(): OpcodeEnumNative;
309
732
  data(): Uint8Array;
310
- isPush(): boolean;
311
- isCounted(): boolean;
312
- isVersion(): boolean;
313
- isPositive(): boolean;
314
- isDisabled(activeForks: number): boolean;
315
- isConditional(): boolean;
316
- isRelaxedPush(): boolean;
317
- isOversized(maxSize: number): boolean;
318
- isMinimalPush(): boolean;
319
- isNominalPush(): boolean;
320
733
  static opcodeFromSize(size: number): OpcodeEnumNative;
321
734
  static minimalOpcodeFromData(data: Uint8Array): OpcodeEnumNative;
322
735
  static nominalOpcodeFromData(data: Uint8Array): OpcodeEnumNative;
@@ -329,42 +742,65 @@ export declare class OperationNative {
329
742
  static opcodeIsNumeric(code: OpcodeEnumNative): boolean;
330
743
  static opcodeIsPositive(code: OpcodeEnumNative): boolean;
331
744
  static opcodeIsReserved(code: OpcodeEnumNative): boolean;
332
- static opcodeIsDisabled(code: OpcodeEnumNative, activeForks: number): boolean;
745
+ static opcodeIsDisabled(code: OpcodeEnumNative, active_flags: bigint): boolean;
333
746
  static opcodeIsConditional(code: OpcodeEnumNative): boolean;
334
747
  static opcodeIsRelaxedPush(code: OpcodeEnumNative): boolean;
748
+ isPush(): boolean;
749
+ isCounted(): boolean;
750
+ isVersion(): boolean;
751
+ isPositive(): boolean;
752
+ isDisabled(active_flags: bigint): boolean;
753
+ isConditional(): boolean;
754
+ isRelaxedPush(): boolean;
755
+ isOversized(max_size: number): boolean;
756
+ isMinimalPush(): boolean;
757
+ isNominalPush(): boolean;
335
758
  }
336
759
  export declare class OperationListNative {
337
760
  private readonly [ptrSym];
338
761
  static _create(ptr: number): OperationListNative;
339
762
  protected _destructor(): void;
340
763
  constructor();
341
- pushBack(operation: OperationNative): void;
764
+ pushBack(elem: OperationNative): void;
342
765
  count(): number;
343
766
  nth(index: number): OperationNative;
767
+ assignAt(index: number, elem: OperationNative): void;
768
+ erase(index: number): void;
344
769
  }
345
- declare const _ScriptPatternIntToKey: readonly ["null_data", "pay_multisig", "pay_public_key", "pay_public_key_hash", "pay_script_hash", "sign_multisig", "sign_public_key", "sign_public_key_hash", "sign_script_hash", "witness_reservation", "non_standard"];
770
+ declare const _ScriptPatternIntToKey: readonly ["null_data", "pay_to_multisig", "pay_to_public_key", "pay_to_public_key_hash", "pay_to_script_hash", "pay_to_script_hash_32", "pay_to_script", "sign_multisig", "sign_public_key", "sign_public_key_hash", "sign_script_hash", "witness_reservation", "non_standard"];
346
771
  export declare type ScriptPattern = (typeof _ScriptPatternIntToKey)[number];
347
772
  export declare function ScriptPatternToInt(value: ScriptPattern): number;
773
+ export declare function ScriptPatternFromInt(value: number): ScriptPattern;
348
774
  declare const _EndorsementTypeIntToKey: readonly ["ecdsa", "schnorr"];
349
775
  export declare type EndorsementType = (typeof _EndorsementTypeIntToKey)[number];
350
776
  export declare function EndorsementTypeToInt(value: EndorsementType): number;
777
+ export declare function EndorsementTypeFromInt(value: number): EndorsementType;
351
778
  export declare class ScriptNative {
352
779
  private readonly [ptrSym];
353
780
  static _create(ptr: number): ScriptNative;
354
781
  protected _destructor(): void;
355
782
  constructor();
356
- constructor(str: string);
357
- constructor(operations: OperationListNative);
783
+ constructor(ops: OperationListNative);
358
784
  constructor(encoded: Uint8Array, prefix: boolean);
785
+ static fromData(data: Uint8Array, prefix: boolean): ScriptNative;
786
+ copy(): ScriptNative;
787
+ equals(other: ScriptNative): boolean;
788
+ notEqual(other: ScriptNative): boolean;
789
+ static fromDataWithSize(data: Uint8Array, size: number): ScriptNative;
790
+ fromOperations(ops: OperationListNative): void;
791
+ fromStr(mnemonic: string): boolean;
359
792
  isValid(): boolean;
360
793
  isValidOperations(): boolean;
361
- satoshiContentSize(): number;
362
- serializedSize(prefix: boolean): number;
363
- toStr(activeForks: number): string;
364
- type(): string;
365
794
  toData(prefix: boolean): Uint8Array;
795
+ toStr(active_flags: bigint): string;
796
+ serializedSize(prefix: boolean): number;
797
+ bytes(): Uint8Array;
366
798
  operations(): OperationListNative;
367
- toBytes(): Uint8Array;
799
+ firstOperation(): OperationNative;
800
+ static generateSignatureHash(tx: TransactionNative, input_index: number, script_code: ScriptNative, sighash_type: number, active_flags: bigint, value: bigint): [HashNative, number];
801
+ static checkSignature(signature: LongHashNative, sighash_type: number, public_key: Uint8Array, script_code: ScriptNative, tx: TransactionNative, input_index: number, active_flags: bigint, value: bigint): [boolean, number];
802
+ static createEndorsement(secret: HashNative, prevout_script: ScriptNative, tx: TransactionNative, input_index: number, sighash_type: number, active_flags: bigint, value: bigint, type: EndorsementType): Uint8Array;
803
+ static isEnabled(active_flags: bigint, fork: bigint): boolean;
368
804
  static isPushOnly(ops: OperationListNative): boolean;
369
805
  static isRelaxedPush(ops: OperationListNative): boolean;
370
806
  static isCoinbasePattern(ops: OperationListNative, height: number): boolean;
@@ -373,174 +809,451 @@ export declare class ScriptNative {
373
809
  static isPayPublicKeyPattern(ops: OperationListNative): boolean;
374
810
  static isPayPublicKeyHashPattern(ops: OperationListNative): boolean;
375
811
  static isPayScriptHashPattern(ops: OperationListNative): boolean;
812
+ static isPayScriptHash32Pattern(ops: OperationListNative): boolean;
376
813
  static isSignMultisigPattern(ops: OperationListNative): boolean;
377
814
  static isSignPublicKeyPattern(ops: OperationListNative): boolean;
378
815
  static isSignPublicKeyHashPattern(ops: OperationListNative): boolean;
379
816
  static isSignScriptHashPattern(ops: OperationListNative): boolean;
380
- static toNullDataPattern(data: Uint8Array): OperationListNative;
381
- static toPayPublicKeyPattern(point: Uint8Array): OperationListNative;
817
+ static toNullDataPattern(data: Uint8Array): OperationListNative | null;
818
+ static toPayPublicKeyPattern(point: Uint8Array): OperationListNative | null;
382
819
  static toPayPublicKeyHashPattern(hash: ShortHashNative): OperationListNative;
820
+ static toPayPublicKeyHashPatternUnlocking(end: Uint8Array, pubkey: EcPublicNative): OperationListNative | null;
821
+ static toPayPublicKeyHashPatternUnlockingPlaceholder(endorsement_size: number, pubkey_size: number): OperationListNative;
822
+ static toPayScriptHashPatternUnlockingPlaceholder(script_size: number, multisig: boolean): OperationListNative;
383
823
  static toPayScriptHashPattern(hash: ShortHashNative): OperationListNative;
824
+ static toPayScriptHash32Pattern(hash: HashNative): OperationListNative;
825
+ static toPayMultisigPatternEcCompressedList(signatures: number, points: EcCompressedListNative): OperationListNative;
826
+ static toPayMultisigPatternDataStack(signatures: number, points: DataStackNative): OperationListNative;
384
827
  pattern(): ScriptPattern;
385
- outputPattern(): ScriptPattern;
828
+ outputPatternSimple(): ScriptPattern;
829
+ outputPattern(flags: bigint): ScriptPattern;
386
830
  inputPattern(): ScriptPattern;
387
831
  sigops(accurate: boolean): number;
388
832
  isUnspendable(): boolean;
389
833
  reset(): void;
390
- static createEndorsement(secret: EcSecretNative, prevoutScript: ScriptNative, tx: TransactionNative, inputIndex: number, sighashType: number, activeForks: number, value: bigint, endorsementType: EndorsementType): Uint8Array;
391
- static verify(tx: TransactionNative, input: number, forks: number, inputScript: ScriptNative, prevoutScript: ScriptNative, value: bigint): number;
392
- static verifyTransaction(tx: TransactionNative, input: number, forks: number): number;
834
+ isPayToScriptHash(flags: bigint): boolean;
835
+ isPayToScriptHash32(flags: bigint): boolean;
836
+ static verify(tx: TransactionNative, input_index: number, flags: bigint, input_script: ScriptNative, prevout_script: ScriptNative, value: bigint): number;
837
+ static verifySimple(tx: TransactionNative, input: number, flags: bigint): number;
838
+ }
839
+ export declare class PointNative {
840
+ private readonly [ptrSym];
841
+ static _create(ptr: number): PointNative;
842
+ protected _destructor(): void;
843
+ constructor(hash: HashNative, index: number);
844
+ static fromData(data: Uint8Array, wire?: boolean): PointNative;
845
+ copy(): PointNative;
846
+ equals(other: PointNative): boolean;
847
+ notEqual(other: PointNative): boolean;
848
+ less(x: PointNative): boolean;
849
+ greater(x: PointNative): boolean;
850
+ lessOrEqual(x: PointNative): boolean;
851
+ greaterOrEqual(x: PointNative): boolean;
852
+ toData(wire: boolean): Uint8Array;
853
+ static satoshiFixedSize(): number;
854
+ serializedSize(wire?: boolean): number;
855
+ static createNull(): PointNative;
856
+ hash(): HashNative;
857
+ index(): number;
858
+ checksum(): bigint;
859
+ isNull(): boolean;
393
860
  }
394
861
  export declare class OutputPointNative {
395
862
  private readonly [ptrSym];
396
863
  static _create(ptr: number): OutputPointNative;
397
864
  protected _destructor(): void;
398
865
  constructor();
866
+ constructor(x: PointNative);
399
867
  constructor(hash: HashNative, index: number);
868
+ static fromData(data: Uint8Array, wire?: boolean): OutputPointNative;
869
+ copy(): OutputPointNative;
870
+ static createNull(): OutputPointNative;
871
+ isMature(height: number): boolean;
872
+ equals(other: OutputPointNative): boolean;
873
+ notEqual(other: OutputPointNative): boolean;
874
+ less(x: OutputPointNative): boolean;
875
+ greater(x: OutputPointNative): boolean;
876
+ lessOrEqual(x: OutputPointNative): boolean;
877
+ greaterOrEqual(x: OutputPointNative): boolean;
878
+ toData(wire: boolean): Uint8Array;
879
+ static satoshiFixedSize(): number;
880
+ serializedSize(wire?: boolean): number;
400
881
  hash(): HashNative;
401
882
  index(): number;
402
- cachedOutput(): OutputNative;
403
- setHash(hash: HashNative): void;
404
- setIndex(index: number): void;
405
- setCachedOutput(output: OutputNative): void;
883
+ checksum(): bigint;
884
+ isNull(): boolean;
406
885
  }
407
- declare const _TokenKindIntToKey: readonly ["none", "fungible", "non_fungible", "both"];
886
+ declare const _TokenKindIntToKey: readonly ["fungible_only", "non_fungible_only", "both"];
408
887
  export declare type TokenKind = (typeof _TokenKindIntToKey)[number];
409
888
  export declare function TokenKindToInt(value: TokenKind): number;
410
- declare const _TokenCapabilityIntToKey: readonly ["none", "mutable", "minting"];
889
+ export declare function TokenKindFromInt(value: number): TokenKind;
890
+ declare const _TokenCapabilityIntToKey: readonly ["none", "mut", "minting"];
411
891
  export declare type TokenCapability = (typeof _TokenCapabilityIntToKey)[number];
412
892
  export declare function TokenCapabilityToInt(value: TokenCapability): number;
893
+ export declare function TokenCapabilityFromInt(value: number): TokenCapability;
413
894
  export declare class TokenDataNative {
414
895
  private readonly [ptrSym];
896
+ private constructor();
415
897
  static _create(ptr: number): TokenDataNative;
416
898
  protected _destructor(): void;
417
- static constructFungible(category: HashNative, amount: bigint): TokenDataNative;
418
- static constructNonFungible(category: HashNative, capability: TokenCapability, commitmentData: Uint8Array): TokenDataNative;
419
- static constructBothKinds(category: HashNative, amount: bigint, capability: TokenCapability, commitmentData: Uint8Array): TokenDataNative;
899
+ static fromData(data: Uint8Array): TokenDataNative;
900
+ copy(): TokenDataNative;
901
+ id(): HashNative;
902
+ setId(value: HashNative): void;
903
+ equals(other: TokenDataNative): boolean;
904
+ notEqual(other: TokenDataNative): boolean;
905
+ less(x: TokenDataNative): boolean;
906
+ greater(x: TokenDataNative): boolean;
907
+ lessOrEqual(x: TokenDataNative): boolean;
908
+ greaterOrEqual(x: TokenDataNative): boolean;
909
+ static makeFungible(id: HashNative, amount: bigint): TokenDataNative | null;
910
+ static makeNonFungible(id: HashNative, capability: TokenCapability, commitment: Uint8Array): TokenDataNative | null;
911
+ static makeBoth(id: HashNative, amount: bigint, capability: TokenCapability, commitment: Uint8Array): TokenDataNative | null;
912
+ getKind(): TokenKind;
420
913
  isValid(): boolean;
914
+ getAmount(): bigint;
915
+ hasNft(): boolean;
916
+ isFungibleOnly(): boolean;
917
+ getNftCapability(): TokenCapability;
918
+ getNftCommitment(): Uint8Array;
919
+ isImmutableNft(): boolean;
920
+ isMutableNft(): boolean;
921
+ isMintingNft(): boolean;
421
922
  serializedSize(): number;
923
+ bitfield(): number;
422
924
  toData(): Uint8Array;
423
- kind(): TokenKind;
424
- category(): HashNative;
425
- fungibleAmount(): bigint;
426
- nonFungibleCapability(): TokenCapability;
427
- nonFungibleCommitment(): Uint8Array;
428
925
  }
429
926
  export declare class UtxoNative {
430
927
  private readonly [ptrSym];
431
928
  static _create(ptr: number): UtxoNative;
432
929
  protected _destructor(): void;
433
930
  constructor();
434
- static fromPointAmount(hash: HashNative, index: number, amount: bigint): UtxoNative;
435
- static fromPointAmountFungible(hash: HashNative, index: number, amount: bigint, category: HashNative, tokenAmount: bigint): UtxoNative;
436
- static fromPointAmountNonFungible(hash: HashNative, index: number, amount: bigint, category: HashNative, capability: TokenCapability, commitmentData: Uint8Array): UtxoNative;
437
- static fromPointAmountBothKinds(hash: HashNative, index: number, amount: bigint, category: HashNative, tokenAmount: bigint, capability: TokenCapability, commitmentData: Uint8Array): UtxoNative;
438
- hash(): HashNative;
439
- index(): number;
931
+ constructor(point: OutputPointNative, amount: bigint, token_data: TokenDataNative | null);
932
+ copy(): UtxoNative;
933
+ equals(other: UtxoNative): boolean;
934
+ notEqual(other: UtxoNative): boolean;
935
+ less(x: UtxoNative): boolean;
936
+ greater(x: UtxoNative): boolean;
937
+ lessOrEqual(x: UtxoNative): boolean;
938
+ greaterOrEqual(x: UtxoNative): boolean;
939
+ height(): number;
940
+ point(): OutputPointNative;
440
941
  amount(): bigint;
441
- cachedOutput(): OutputNative;
442
- hasTokenData(): boolean;
443
- tokenData(): TokenDataNative;
444
- tokenCategory(): HashNative;
445
- tokenAmount(): bigint;
446
- setHash(hash: HashNative): void;
447
- setIndex(index: number): void;
448
- setAmount(amount: bigint): void;
449
- setCachedOutput(output: OutputNative): void;
450
- setTokenData(token_data: TokenDataNative): void;
451
- setTokenCategory(category: HashNative): void;
452
- setTokenAmount(amount: bigint): void;
942
+ tokenData(): TokenDataNative | null;
453
943
  }
454
944
  export declare class OutputNative {
455
945
  private readonly [ptrSym];
456
946
  static _create(ptr: number): OutputNative;
457
947
  protected _destructor(): void;
458
948
  constructor();
459
- constructor(value: bigint, script: ScriptNative);
460
- constructor(value: bigint, script: ScriptNative, tokenData: TokenDataNative);
461
- static fromData(data: Uint8Array): OutputNative;
949
+ constructor(value: bigint, script: ScriptNative, token_data: TokenDataNative | null);
950
+ static fromData(data: Uint8Array, wire?: boolean): OutputNative;
951
+ copy(): OutputNative;
952
+ equals(other: OutputNative): boolean;
953
+ notEqual(other: OutputNative): boolean;
462
954
  toData(wire: boolean): Uint8Array;
463
- serializedSize(wire: boolean): number;
464
- isValid(): boolean;
955
+ serializedSize(wire?: boolean): number;
465
956
  value(): bigint;
957
+ setValue(value: bigint): void;
466
958
  script(): ScriptNative;
467
- hasTokenData(): boolean;
468
- tokenData(): TokenDataNative;
959
+ setScript(value: ScriptNative): void;
960
+ tokenData(): TokenDataNative | null;
961
+ setTokenData(value: TokenDataNative | null): void;
962
+ addressSimple(testnet?: boolean): PaymentAddressNative | null;
963
+ address(p2kh_version: number, p2sh_version: number): PaymentAddressNative | null;
964
+ addresses(p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
965
+ isValid(): boolean;
966
+ signatureOperations(bip141: boolean): number;
967
+ isDust(minimum_output_value: bigint): boolean;
968
+ reset(): void;
469
969
  }
470
970
  export declare class InputNative {
471
971
  private readonly [ptrSym];
472
972
  static _create(ptr: number): InputNative;
473
973
  protected _destructor(): void;
474
- constructor();
475
- constructor(previousOutput: OutputPointNative, script: ScriptNative, seq: number);
476
- static fromData(data: Uint8Array): InputNative;
974
+ constructor(previous_output: OutputPointNative, script: ScriptNative, sequence_value: number);
975
+ static fromData(data: Uint8Array, wire: boolean): InputNative;
976
+ copy(): InputNative;
977
+ equals(other: InputNative): boolean;
978
+ notEqual(other: InputNative): boolean;
477
979
  toData(wire: boolean): Uint8Array;
478
- serializedSize(wire: boolean): number;
479
- isValid(): boolean;
480
- seq(): number;
481
- script(): ScriptNative;
980
+ serializedSize(wire?: boolean): number;
482
981
  previousOutput(): OutputPointNative;
982
+ setPreviousOutput(value: OutputPointNative): void;
983
+ script(): ScriptNative;
984
+ setScript(value: ScriptNative): void;
985
+ sequenceValue(): number;
986
+ setSequence(value: number): void;
987
+ address(): PaymentAddressNative | null;
988
+ addresses(): PaymentAddressListNative;
989
+ isFinal(): boolean;
990
+ isLocked(block_height: number, median_time_past: number): boolean;
991
+ signatureOperations(bip16: boolean, bip141: boolean): number;
992
+ extractEmbeddedScript(): ScriptNative;
483
993
  }
484
994
  export declare class OutputListNative {
485
995
  private readonly [ptrSym];
486
996
  static _create(ptr: number): OutputListNative;
487
997
  protected _destructor(): void;
488
998
  constructor();
489
- pushBack(output: OutputNative): void;
999
+ pushBack(elem: OutputNative): void;
490
1000
  count(): number;
491
1001
  nth(index: number): OutputNative;
1002
+ assignAt(index: number, elem: OutputNative): void;
1003
+ erase(index: number): void;
492
1004
  }
493
1005
  export declare class InputListNative {
494
1006
  private readonly [ptrSym];
495
1007
  static _create(ptr: number): InputListNative;
496
1008
  protected _destructor(): void;
497
1009
  constructor();
498
- pushBack(input: InputNative): void;
1010
+ pushBack(elem: InputNative): void;
499
1011
  count(): number;
500
1012
  nth(index: number): InputNative;
1013
+ assignAt(index: number, elem: InputNative): void;
1014
+ erase(index: number): void;
1015
+ }
1016
+ export declare class OutputPointListNative {
1017
+ private readonly [ptrSym];
1018
+ static _create(ptr: number): OutputPointListNative;
1019
+ protected _destructor(): void;
1020
+ constructor();
1021
+ pushBack(elem: OutputPointNative): void;
1022
+ count(): number;
1023
+ nth(index: number): OutputPointNative;
1024
+ assignAt(index: number, elem: OutputPointNative): void;
1025
+ erase(index: number): void;
1026
+ }
1027
+ export declare class PointListNative {
1028
+ private readonly [ptrSym];
1029
+ static _create(ptr: number): PointListNative;
1030
+ protected _destructor(): void;
1031
+ constructor();
1032
+ pushBack(elem: PointNative): void;
1033
+ count(): number;
1034
+ nth(index: number): PointNative;
1035
+ assignAt(index: number, elem: PointNative): void;
1036
+ erase(index: number): void;
501
1037
  }
502
1038
  export declare class UtxoListNative {
503
1039
  private readonly [ptrSym];
504
1040
  static _create(ptr: number): UtxoListNative;
505
1041
  protected _destructor(): void;
506
1042
  constructor();
507
- pushBack(utxo: UtxoNative): void;
1043
+ pushBack(elem: UtxoNative): void;
508
1044
  count(): number;
509
1045
  nth(index: number): UtxoNative;
1046
+ assignAt(index: number, elem: UtxoNative): void;
1047
+ erase(index: number): void;
510
1048
  }
511
1049
  declare const _CoinSelectionAlgorithmIntToKey: readonly ["smallest_first", "largest_first", "manual", "send_all"];
512
1050
  export declare type CoinSelectionAlgorithm = (typeof _CoinSelectionAlgorithmIntToKey)[number];
513
1051
  export declare function CoinSelectionAlgorithmToInt(value: CoinSelectionAlgorithm): number;
1052
+ export declare function CoinSelectionAlgorithmFromInt(value: number): CoinSelectionAlgorithm;
514
1053
  export declare class TransactionNative {
515
1054
  private readonly [ptrSym];
516
1055
  static _create(ptr: number): TransactionNative;
517
1056
  protected _destructor(): void;
518
1057
  constructor();
519
1058
  constructor(version: number, locktime: number, inputs: InputListNative, outputs: OutputListNative);
520
- static fromData(data: Uint8Array): TransactionNative;
1059
+ static fromData(data: Uint8Array, wire?: boolean): TransactionNative;
1060
+ static constructMove(version: number, locktime: number, inputs: InputListNative, outputs: OutputListNative): TransactionNative;
1061
+ copy(): TransactionNative;
1062
+ static createNull(): TransactionNative;
1063
+ isNull(): boolean;
1064
+ equals(other: TransactionNative): boolean;
1065
+ notEqual(other: TransactionNative): boolean;
521
1066
  toData(wire: boolean): Uint8Array;
522
- serializedSize(wire: boolean): number;
523
- isValid(): boolean;
524
- hash(): HashNative;
1067
+ serializedSize(wire?: boolean): number;
525
1068
  version(): number;
526
1069
  locktime(): number;
527
- outputs(): OutputListNative;
528
1070
  inputs(): InputListNative;
529
- isCoinbase(): boolean;
1071
+ outputs(): OutputListNative;
1072
+ hash(): HashNative;
1073
+ outputsHash(): HashNative;
1074
+ inpointsHash(): HashNative;
1075
+ sequencesHash(): HashNative;
1076
+ utxosHash(): HashNative;
1077
+ fees(): bigint;
1078
+ previousOutputs(): PointListNative;
1079
+ missingPreviousOutputs(): PointListNative;
1080
+ missingPreviousTransactions(): HashListNative;
530
1081
  totalInputValue(): bigint;
531
1082
  totalOutputValue(): bigint;
532
- fees(): bigint;
533
- isMature(target_height: number): boolean;
534
- static createTemplateWithChangeRatios(available_utxos: UtxoListNative, amount_to_send: bigint, destination_address: PaymentAddressNative, change_addresses: PaymentAddressListNative, change_ratios: DoubleListNative, selection_algo: CoinSelectionAlgorithm): [number, TransactionNative, U32ListNative, PaymentAddressListNative, U64ListNative];
535
- static createTemplate(available_utxos: UtxoListNative, amount_to_send: bigint, destination_address: PaymentAddressNative, change_addresses: PaymentAddressListNative, selection_algo: CoinSelectionAlgorithm): [number, TransactionNative, U32ListNative, PaymentAddressListNative, U64ListNative];
1083
+ signatureOperations(bip16: boolean, bip141: boolean): number;
1084
+ isCoinbase(): boolean;
1085
+ isNullNonCoinbase(): boolean;
1086
+ isOversizedCoinbase(): boolean;
1087
+ isMature(height: number): boolean;
1088
+ isInternalDoubleSpend(): boolean;
1089
+ isDoubleSpend(include_unconfirmed: boolean): boolean;
1090
+ isDusty(minimum_output_value: bigint): boolean;
1091
+ isMissingPreviousOutputs(): boolean;
1092
+ isFinal(block_height: number, block_time: number): boolean;
1093
+ isLocked(block_height: number, median_time_past: number): boolean;
1094
+ isLocktimeConflict(): boolean;
1095
+ isOverspent(): boolean;
1096
+ check(max_block_size: number, transaction_pool: boolean, retarget: boolean): number;
1097
+ minTxSize(flags: bigint): number;
1098
+ accept(flags: bigint, height: number, median_time_past: number, max_sigops: number, is_under_checkpoint: boolean, transaction_pool: boolean, duplicate: boolean): number;
1099
+ isStandardSimple(): boolean;
1100
+ isStandard(flags: bigint): boolean;
1101
+ }
1102
+ export declare class TransactionListNative {
1103
+ private readonly [ptrSym];
1104
+ static _create(ptr: number): TransactionListNative;
1105
+ protected _destructor(): void;
1106
+ constructor();
1107
+ pushBack(elem: TransactionNative): void;
1108
+ count(): number;
1109
+ nth(index: number): TransactionNative;
1110
+ assignAt(index: number, elem: TransactionNative): void;
1111
+ erase(index: number): void;
536
1112
  }
537
1113
  export declare class InterpreterNative {
538
- static run(program: ProgramNative): number;
539
- static runOperation(operation: OperationNative, program: ProgramNative): number;
540
- static debugStart(program: ProgramNative): [number, number];
541
- static debugStepsAvailable(program: ProgramNative, step: number): boolean;
542
- static debugStep(program: ProgramNative, step: number): [number, number, ProgramNative];
543
- static debugEnd(program: ProgramNative): number;
1114
+ static runSimple(program: ProgramNative): number;
1115
+ static run(op: OperationNative, program: ProgramNative): number;
1116
+ static debugBegin(prog: ProgramNative): DebugSnapshotNative;
1117
+ static debugStep(snapshot: DebugSnapshotNative): DebugSnapshotNative;
1118
+ static debugStepN(snapshot: DebugSnapshotNative, n: number): DebugSnapshotNative;
1119
+ static debugRun(snapshot: DebugSnapshotNative): DebugSnapshotNative;
1120
+ static debugRunTraced(start: DebugSnapshotNative): DebugSnapshotListNative;
1121
+ static debugFinalize(snapshot: DebugSnapshotNative): number;
1122
+ }
1123
+ export declare class MetricsNative {
1124
+ private readonly [ptrSym];
1125
+ private constructor();
1126
+ static _create(ptr: number): MetricsNative;
1127
+ protected _destructor(): void;
1128
+ copy(): MetricsNative;
1129
+ sigChecks(): number;
1130
+ opCost(): bigint;
1131
+ hashDigestIterations(): bigint;
1132
+ addOpCost(cost: number): void;
1133
+ addPushOp(stack_item_length: number): void;
1134
+ addHashIterations(message_length: number, is_two_round_hash: boolean): void;
1135
+ addSigChecks(n_checks: number): void;
1136
+ isOverOpCostLimit(flags: bigint): boolean;
1137
+ isOverOpCostLimitSimple(): boolean;
1138
+ isOverHashItersLimit(): boolean;
1139
+ hasValidScriptLimits(): boolean;
1140
+ setScriptLimits(flags: bigint, script_sig_size: bigint): void;
1141
+ setNativeScriptLimits(standard: boolean, script_sig_size: bigint): void;
1142
+ compositeOpCostScriptFlags(flags: bigint): bigint;
1143
+ compositeOpCostBool(standard: boolean): bigint;
1144
+ }
1145
+ export declare class ScriptExecutionContextNative {
1146
+ private readonly [ptrSym];
1147
+ static _create(ptr: number): ScriptExecutionContextNative;
1148
+ protected _destructor(): void;
1149
+ constructor(input_index: number, transaction: TransactionNative);
1150
+ copy(): ScriptExecutionContextNative;
1151
+ inputIndex(): number;
1152
+ transaction(): TransactionNative;
1153
+ inputCount(): number;
1154
+ outputCount(): number;
1155
+ txVersion(): number;
1156
+ txLocktime(): number;
1157
+ }
1158
+ export declare class DebugSnapshotNative {
1159
+ private readonly [ptrSym];
1160
+ static _create(ptr: number): DebugSnapshotNative;
1161
+ protected _destructor(): void;
1162
+ constructor();
1163
+ constructor(p: ProgramNative);
1164
+ copy(): DebugSnapshotNative;
1165
+ prog(): ProgramNative;
1166
+ step(): number;
1167
+ last(): number;
1168
+ done(): boolean;
1169
+ controlStack(): BoolListNative;
1170
+ loopStack(): U64ListNative;
1171
+ invokeDepth(): number;
1172
+ outerLoopDepth(): number;
1173
+ }
1174
+ export declare class DebugSnapshotListNative {
1175
+ private readonly [ptrSym];
1176
+ static _create(ptr: number): DebugSnapshotListNative;
1177
+ protected _destructor(): void;
1178
+ constructor();
1179
+ pushBack(elem: DebugSnapshotNative): void;
1180
+ count(): number;
1181
+ nth(index: number): DebugSnapshotNative;
1182
+ assignAt(index: number, elem: DebugSnapshotNative): void;
1183
+ erase(index: number): void;
1184
+ }
1185
+ export declare class NumberNative {
1186
+ private readonly [ptrSym];
1187
+ static _create(ptr: number): NumberNative;
1188
+ protected _destructor(): void;
1189
+ constructor();
1190
+ copy(): NumberNative;
1191
+ static fromInt(value: bigint): NumberNative;
1192
+ valid(max_size: number): boolean;
1193
+ setData(data: Uint8Array, max_size: number): boolean;
1194
+ data(): Uint8Array;
1195
+ int32(): number;
1196
+ int64(): bigint;
1197
+ isTrue(): boolean;
1198
+ isFalse(): boolean;
1199
+ greater(value: bigint): boolean;
1200
+ less(value: bigint): boolean;
1201
+ greaterOrEqual(value: bigint): boolean;
1202
+ lessOrEqual(value: bigint): boolean;
1203
+ equals(other: NumberNative): boolean;
1204
+ notEqual(other: NumberNative): boolean;
1205
+ addInt64(value: bigint): NumberNative;
1206
+ subtractInt64(value: bigint): NumberNative;
1207
+ addNumber(x: NumberNative): NumberNative;
1208
+ subtractNumber(x: NumberNative): NumberNative;
1209
+ multiply(x: NumberNative): NumberNative;
1210
+ safeAddNumber(x: NumberNative): boolean;
1211
+ safeAddInt64(x: bigint): boolean;
1212
+ safeSubNumber(x: NumberNative): boolean;
1213
+ safeSubInt64(x: bigint): boolean;
1214
+ safeMulNumber(x: NumberNative): boolean;
1215
+ safeMulInt64(x: bigint): boolean;
1216
+ static safeAddNumber2(x: NumberNative, y: NumberNative): NumberNative;
1217
+ static safeSubNumber2(x: NumberNative, y: NumberNative): NumberNative;
1218
+ static safeMulNumber2(x: NumberNative, y: NumberNative): NumberNative;
1219
+ static isMinimallyEncoded(data: Uint8Array, max_integer_size: number): boolean;
1220
+ static minimallyEncode(data: Uint8Array): Uint8Array;
1221
+ }
1222
+ export declare class BigNumberNative {
1223
+ private readonly [ptrSym];
1224
+ static _create(ptr: number): BigNumberNative;
1225
+ protected _destructor(): void;
1226
+ constructor();
1227
+ constructor(value: bigint);
1228
+ constructor(decimal_str: string);
1229
+ copy(): BigNumberNative;
1230
+ static fromHex(hex_str: string): BigNumberNative;
1231
+ serialize(): Uint8Array;
1232
+ deserialize(data: Uint8Array): boolean;
1233
+ toStr(): string;
1234
+ toHex(): string;
1235
+ sign(): number;
1236
+ isZero(): boolean;
1237
+ isNonzero(): boolean;
1238
+ isNegative(): boolean;
1239
+ toInt32Saturating(): number;
1240
+ byteCount(): number;
1241
+ compare(other: BigNumberNative): number;
1242
+ equals(other: BigNumberNative): boolean;
1243
+ notEqual(other: BigNumberNative): boolean;
1244
+ add(other: BigNumberNative): BigNumberNative;
1245
+ subtract(other: BigNumberNative): BigNumberNative;
1246
+ multiply(other: BigNumberNative): BigNumberNative;
1247
+ abs(): BigNumberNative;
1248
+ negate(): void;
1249
+ pow(exp: BigNumberNative): BigNumberNative;
1250
+ powMod(exp: BigNumberNative, mod: BigNumberNative): BigNumberNative;
1251
+ mathModulo(mod: BigNumberNative): BigNumberNative;
1252
+ data(): Uint8Array;
1253
+ setData(d: Uint8Array, max_size: number): boolean;
1254
+ isTrue(): boolean;
1255
+ isFalse(): boolean;
1256
+ static isMinimallyEncoded(data: Uint8Array, max_size: number): boolean;
544
1257
  }
545
1258
  export declare class ProgramNative {
546
1259
  private readonly [ptrSym];
@@ -548,18 +1261,72 @@ export declare class ProgramNative {
548
1261
  protected _destructor(): void;
549
1262
  constructor();
550
1263
  constructor(script: ScriptNative);
551
- constructor(script: ScriptNative, program: ProgramNative);
552
- constructor(script: ScriptNative, transaction: TransactionNative, inputIndex: number, forks: number);
1264
+ constructor(script: ScriptNative, x: ProgramNative);
1265
+ constructor(script: ScriptNative, x: ProgramNative, move: boolean);
1266
+ constructor(script: ScriptNative, transaction: TransactionNative, input_index: number, flags: bigint, value: bigint);
1267
+ constructor(script: ScriptNative, transaction: TransactionNative, input_index: number, flags: bigint, stack: DataStackNative, value: bigint);
1268
+ copy(): ProgramNative;
1269
+ getMetrics(): MetricsNative;
553
1270
  isValid(): boolean;
554
- evaluate(): number;
1271
+ flags(): bigint;
1272
+ maxScriptElementSize(): number;
1273
+ maxIntegerSizeLegacy(): number;
1274
+ maxIntegerSize(): number;
1275
+ isChipVmLimitsEnabled(): boolean;
1276
+ isBigintEnabled(): boolean;
1277
+ inputIndex(): number;
1278
+ value(): bigint;
1279
+ transaction(): TransactionNative;
1280
+ context(): ScriptExecutionContextNative | null;
1281
+ getScript(): ScriptNative;
1282
+ resetActiveScript(): void;
1283
+ operationCount(): number;
1284
+ evaluateSimple(): number;
1285
+ evaluate(op: OperationNative): number;
1286
+ incrementOperationCountOperation(op: OperationNative): boolean;
1287
+ incrementOperationCountInt32(public_keys: number): boolean;
1288
+ markCodeSeparator(pc: number): boolean;
1289
+ push(value: boolean): void;
1290
+ pushMove(item: Uint8Array): void;
1291
+ pushCopy(item: Uint8Array): void;
1292
+ drop(): void;
1293
+ popSimple(): Uint8Array;
1294
+ popInt32(): number;
1295
+ popInt64(): bigint;
1296
+ popNumber(maximum_size: number): NumberNative;
1297
+ popBinary(): [NumberNative, NumberNative];
1298
+ popTernary(): [NumberNative, NumberNative, NumberNative];
1299
+ popBigNumber(maximum_size: number): BigNumberNative;
1300
+ popBigBinary(): [BigNumberNative, BigNumberNative];
1301
+ popBigTernary(): [BigNumberNative, BigNumberNative, BigNumberNative];
1302
+ popIndex(): number;
1303
+ pop(count: number): DataStackNative;
1304
+ duplicate(index: number): void;
1305
+ swap(index_left: number, index_right: number): void;
1306
+ empty(): boolean;
1307
+ stackTrue(clean: boolean): boolean;
555
1308
  stackResult(clean: boolean): boolean;
556
- size(): number;
1309
+ isStackOverflowSimple(): boolean;
1310
+ isStackOverflow(extra: number): boolean;
1311
+ if(op: OperationNative): boolean;
557
1312
  item(index: number): Uint8Array;
1313
+ top(): Uint8Array;
1314
+ topNumber(maximum_size: number): NumberNative;
1315
+ topBigNumber(maximum_size: number): BigNumberNative;
1316
+ subscript(): OperationListNative;
1317
+ size(): number;
1318
+ conditionalStackSize(): number;
1319
+ emptyAlternate(): boolean;
1320
+ pushAlternate(value: Uint8Array): void;
1321
+ popAlternate(): Uint8Array;
1322
+ open(value: boolean): void;
1323
+ negate(): void;
1324
+ close(): void;
1325
+ closed(): boolean;
1326
+ succeeded(): boolean;
558
1327
  }
559
1328
  declare const _RuleForkEnumNativeIntToKey: readonly ["no_rules", "easy_blocks", "bip16_rule", "bip30_rule", "bip34_rule", "bip66_rule", "bip65_rule", "bip90_rule", "allow_collisions", "bip68_rule", "bip112_rule", "bip113_rule", "bch_uahf", "bch_daa_cw144", "bch_pythagoras", "bch_euclid", "bch_pisano", "bch_mersenne", "bch_fermat", "bch_euler", "bch_gauss", "bch_descartes", "bch_lobachevski", "bch_galois", "bch_leibniz", "retarget", "unverified", "bip34_activations", "bip9_bit0_group", "bip9_bit1_group", "all_rules"];
560
1329
  export declare type RuleForkEnumNative = (typeof _RuleForkEnumNativeIntToKey)[number];
561
1330
  export declare function RuleForkEnumNativeToInt(value: RuleForkEnumNative): number;
562
- declare const _OpcodeEnumNativeIntToKey: readonly ["push_size_0", "push_size_1", "push_size_2", "push_size_3", "push_size_4", "push_size_5", "push_size_6", "push_size_7", "push_size_8", "push_size_9", "push_size_10", "push_size_11", "push_size_12", "push_size_13", "push_size_14", "push_size_15", "push_size_16", "push_size_17", "push_size_18", "push_size_19", "push_size_20", "push_size_21", "push_size_22", "push_size_23", "push_size_24", "push_size_25", "push_size_26", "push_size_27", "push_size_28", "push_size_29", "push_size_30", "push_size_31", "push_size_32", "push_size_33", "push_size_34", "push_size_35", "push_size_36", "push_size_37", "push_size_38", "push_size_39", "push_size_40", "push_size_41", "push_size_42", "push_size_43", "push_size_44", "push_size_45", "push_size_46", "push_size_47", "push_size_48", "push_size_49", "push_size_50", "push_size_51", "push_size_52", "push_size_53", "push_size_54", "push_size_55", "push_size_56", "push_size_57", "push_size_58", "push_size_59", "push_size_60", "push_size_61", "push_size_62", "push_size_63", "push_size_64", "push_size_65", "push_size_66", "push_size_67", "push_size_68", "push_size_69", "push_size_70", "push_size_71", "push_size_72", "push_size_73", "push_size_74", "push_size_75", "push_one_size", "push_two_size", "push_four_size", "push_negative_1", "reserved_80", "push_positive_1", "push_positive_2", "push_positive_3", "push_positive_4", "push_positive_5", "push_positive_6", "push_positive_7", "push_positive_8", "push_positive_9", "push_positive_10", "push_positive_11", "push_positive_12", "push_positive_13", "push_positive_14", "push_positive_15", "push_positive_16", "nop", "reserved_98", "if", "notif", "disabled_verif", "disabled_vernotif", "else", "endif", "verify", "return", "toaltstack", "fromaltstack", "drop2", "dup2", "dup3", "over2", "rot2", "swap2", "ifdup", "depth", "drop", "dup", "nip", "over", "pick", "roll", "rot", "swap", "tuck", "cat", "split", "num2bin", "bin2num", "size", "disabled_invert", "and", "or", "xor", "equal", "equalverify", "reserved_137", "reserved_138", "add1", "sub1", "disabled_mul2", "disabled_div2", "negate", "abs", "not", "nonzero", "add", "sub", "mul", "div", "mod", "disabled_lshift", "disabled_rshift", "booland", "boolor", "numequal", "numequalverify", "numnotequal", "lessthan", "greaterthan", "lessthanorequal", "greaterthanorequal", "min", "max", "within", "ripemd160", "sha1", "sha256", "hash160", "hash256", "codeseparator", "checksig", "checksigverify", "checkmultisig", "checkmultisigverify", "nop1", "nop2", "checklocktimeverify", "nop3", "checksequenceverify", "nop4", "nop5", "nop6", "nop7", "nop8", "nop9", "nop10", "checkdatasig", "checkdatasigverify", "reverse_bytes", "available1", "available2", "available3", "input_index", "active_bytecode", "tx_version", "tx_input_count", "tx_output_count", "tx_locktime", "utxo_value", "utxo_bytecode", "outpoint_tx_hash", "outpoint_index", "input_bytecode", "input_sequence_number", "output_value", "output_bytecode", "utxo_token_category", "utxo_token_commitment", "utxo_token_amount", "output_token_category", "output_token_commitment", "output_token_amount", "reserved_212", "reserved_213", "reserved_214", "first_undefined_op_value", "reserved_215", "reserved_216", "reserved_217", "reserved_218", "reserved_219", "reserved_220", "reserved_221", "reserved_222", "reserved_223", "reserved_224", "reserved_225", "reserved_226", "reserved_227", "reserved_228", "reserved_229", "reserved_230", "reserved_231", "reserved_232", "reserved_233", "reserved_234", "reserved_235", "reserved_236", "reserved_237", "reserved_238", "reserved_239", "special_token_prefix", "reserved_240", "reserved_241", "reserved_242", "reserved_243", "reserved_244", "reserved_245", "reserved_246", "reserved_247", "reserved_248", "reserved_249", "reserved_250", "reserved_251", "reserved_252", "reserved_253", "reserved_254", "reserved_255", "invalidopcode"];
563
- export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[number];
564
- export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
1331
+ export declare function RuleForkEnumNativeFromInt(value: number): RuleForkEnumNative;
565
1332
  export {};