@knuth/js-wasm 2.3.0 → 2.6.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 (51) hide show
  1. package/package.json +1 -1
  2. package/src/kth.js +1 -1
  3. package/src/kth.wasm +0 -0
  4. package/types/Bitcoin.d.ts +2 -0
  5. package/types/DoubleList.d.ts +6 -0
  6. package/types/EcCompressed.d.ts +7 -0
  7. package/types/EcPublic.d.ts +13 -0
  8. package/types/Hash.d.ts +32 -0
  9. package/types/HdPublic.d.ts +13 -0
  10. package/types/Input.d.ts +17 -0
  11. package/types/InputList.d.ts +7 -0
  12. package/types/Interpreter.d.ts +17 -0
  13. package/types/Kth.d.ts +1 -0
  14. package/types/LazySequence copy.d.ts +0 -0
  15. package/types/ListHelper.d.ts +5 -0
  16. package/types/ListNative.d.ts +5 -0
  17. package/types/Opcode.d.ts +9 -0
  18. package/types/Operation.d.ts +47 -0
  19. package/types/OperationList.d.ts +7 -0
  20. package/types/Output.d.ts +18 -0
  21. package/types/OutputList.d.ts +7 -0
  22. package/types/OutputPoint.d.ts +14 -0
  23. package/types/PaymentAddress.d.ts +16 -1
  24. package/types/PaymentAddressList.d.ts +7 -0
  25. package/types/Program.d.ts +15 -0
  26. package/types/RuleFork.d.ts +38 -0
  27. package/types/Script.d.ts +51 -0
  28. package/types/Secret.d.ts +4 -0
  29. package/types/SecretFunctions.d.ts +8 -0
  30. package/types/SighashAlgorithm.d.ts +19 -0
  31. package/types/StringList.d.ts +6 -0
  32. package/types/TokenData.d.ts +18 -0
  33. package/types/TokenDataBothKinds.d.ts +9 -0
  34. package/types/TokenDataFungible.d.ts +5 -0
  35. package/types/TokenDataNonFungible.d.ts +7 -0
  36. package/types/Transaction.d.ts +30 -0
  37. package/types/U32List.d.ts +6 -0
  38. package/types/U64List.d.ts +6 -0
  39. package/types/Utxo.d.ts +17 -0
  40. package/types/UtxoList.d.ts +7 -0
  41. package/types/Wallet.d.ts +19 -6
  42. package/types/WalletData.d.ts +11 -0
  43. package/types/WalletManager.d.ts +8 -0
  44. package/types/encoding.d.ts +5 -0
  45. package/types/main.d.ts +54 -1
  46. package/types/wasm/exceptions.d.ts +1 -0
  47. package/types/wasm/glue copy.d.ts +230 -0
  48. package/types/wasm/glue.d.ts +388 -2
  49. package/types/wasm/glue_manual.d.ts +42 -0
  50. package/types/wasm/manualGeneratedTypes.d.ts +5 -0
  51. package/types/wasm/mem.d.ts +4 -1
@@ -1,8 +1,18 @@
1
1
  declare const ptrSym: unique symbol;
2
2
  declare const _CurrencyIntToKey: readonly ["bitcoin", "bitcoin_cash", "litecoin"];
3
3
  export declare type Currency = (typeof _CurrencyIntToKey)[number];
4
+ export declare function CurrencyToInt(value: Currency): number;
4
5
  declare const _LogLibraryIntToKey: readonly ["boost", "spdlog", "binlog"];
5
6
  export declare type LogLibrary = (typeof _LogLibraryIntToKey)[number];
7
+ export declare function LogLibraryToInt(value: LogLibrary): number;
8
+ export declare class LibConfigTypeSizes {
9
+ private readonly [ptrSym];
10
+ static _create(ptr: number): LibConfigTypeSizes;
11
+ get size_int(): number;
12
+ get size_long(): number;
13
+ get size_pointer(): number;
14
+ protected _destructor(): void;
15
+ }
6
16
  export declare class LibConfig {
7
17
  private readonly [ptrSym];
8
18
  static _create(ptr: number): LibConfig;
@@ -14,8 +24,21 @@ export declare class LibConfig {
14
24
  get mempool(): boolean;
15
25
  get db_readonly(): boolean;
16
26
  get debug_mode(): boolean;
27
+ get architecture(): string;
28
+ get os_name(): string;
29
+ get compiler_name(): string;
30
+ get compiler_version(): string;
31
+ get optimization_level(): string;
32
+ get build_timestamp(): number;
33
+ get build_git_hash(): string;
34
+ get endianness(): string;
35
+ get type_sizes(): LibConfigTypeSizes;
17
36
  protected _destructor(): void;
18
37
  static getLibconfig(): LibConfig;
38
+ static getEmscriptenVersionMajor(): number;
39
+ static getEmscriptenVersionMinor(): number;
40
+ static getEmscriptenVersionTiny(): number;
41
+ static getBuildTimestamp(): number;
19
42
  }
20
43
  export declare class StringListNative {
21
44
  private readonly [ptrSym];
@@ -23,24 +46,69 @@ export declare class StringListNative {
23
46
  protected _destructor(): void;
24
47
  constructor();
25
48
  pushBack(string: string): void;
49
+ count(): number;
50
+ nth(index: number): string;
26
51
  }
27
52
  export declare class ShortHashNative {
28
53
  private readonly [ptrSym];
29
54
  static _create(ptr: number): ShortHashNative;
30
55
  get hash(): number;
31
56
  protected _destructor(): void;
57
+ set(data: number): void;
32
58
  }
33
59
  export declare class HashNative {
34
60
  private readonly [ptrSym];
35
61
  static _create(ptr: number): HashNative;
36
62
  get hash(): number;
37
63
  protected _destructor(): void;
64
+ constructor();
65
+ set(data: number): void;
38
66
  }
39
67
  export declare class LongHashNative {
40
68
  private readonly [ptrSym];
41
69
  static _create(ptr: number): LongHashNative;
42
70
  get hash(): number;
43
71
  protected _destructor(): void;
72
+ set(data: number): void;
73
+ }
74
+ export declare class EncryptedSeedNative {
75
+ private readonly [ptrSym];
76
+ static _create(ptr: number): EncryptedSeedNative;
77
+ get hash(): number;
78
+ protected _destructor(): void;
79
+ set(data: number): void;
80
+ }
81
+ export declare class HashFunctionsNative {
82
+ static sha256(encoded: Uint8Array): HashNative;
83
+ static sha256Reversed(encoded: Uint8Array): HashNative;
84
+ static sha256ReversedStr(encoded: Uint8Array): string;
85
+ }
86
+ export declare class DoubleListNative {
87
+ private readonly [ptrSym];
88
+ static _create(ptr: number): DoubleListNative;
89
+ protected _destructor(): void;
90
+ constructor();
91
+ pushBack(x: number): void;
92
+ count(): number;
93
+ nth(index: number): number;
94
+ }
95
+ export declare class U32ListNative {
96
+ private readonly [ptrSym];
97
+ static _create(ptr: number): U32ListNative;
98
+ protected _destructor(): void;
99
+ constructor();
100
+ pushBack(x: number): void;
101
+ count(): number;
102
+ nth(index: number): number;
103
+ }
104
+ export declare class U64ListNative {
105
+ private readonly [ptrSym];
106
+ static _create(ptr: number): U64ListNative;
107
+ protected _destructor(): void;
108
+ constructor();
109
+ pushBack(x: bigint): void;
110
+ count(): number;
111
+ nth(index: number): bigint;
44
112
  }
45
113
  export declare class HdChainCodeNative {
46
114
  private readonly [ptrSym];
@@ -71,6 +139,8 @@ export declare class EcSecretNative {
71
139
  static _create(ptr: number): EcSecretNative;
72
140
  get hash(): number;
73
141
  protected _destructor(): void;
142
+ constructor();
143
+ set(data: number): void;
74
144
  }
75
145
  export declare class WifUncompressedNative {
76
146
  private readonly [ptrSym];
@@ -101,6 +171,7 @@ export declare class HdPublicNative {
101
171
  static _create(ptr: number): HdPublicNative;
102
172
  protected _destructor(): void;
103
173
  constructor();
174
+ constructor(encoded: string);
104
175
  isValid(): boolean;
105
176
  encoded(): string;
106
177
  chainCode(): HdChainCodeNative;
@@ -132,13 +203,28 @@ export declare class PaymentAddressNative {
132
203
  static _create(ptr: number): PaymentAddressNative;
133
204
  protected _destructor(): void;
134
205
  constructor(address: string);
135
- constructor(hash: ShortHashNative, version: number);
206
+ static fromShortHash(hash: ShortHashNative, version: number): PaymentAddressNative;
207
+ static fromHash(hash: HashNative, version: number): PaymentAddressNative;
208
+ static fromScript(script: ScriptNative, version: number): PaymentAddressNative;
209
+ static fromPayPublicKeyHashScript(script: ScriptNative, version: number): PaymentAddressNative;
136
210
  encodedLegacy(): string;
137
- encodedCashaddr(tokenAware: boolean): string;
211
+ encodedCashAddr(tokenAware: boolean): string;
138
212
  hash20(): ShortHashNative;
139
213
  hash32(): HashNative;
140
214
  version(): number;
141
215
  isValid(): boolean;
216
+ static extract(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
217
+ static extractInput(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
218
+ static extractOutput(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
219
+ }
220
+ export declare class PaymentAddressListNative {
221
+ private readonly [ptrSym];
222
+ static _create(ptr: number): PaymentAddressListNative;
223
+ protected _destructor(): void;
224
+ constructor();
225
+ pushBack(utxo: PaymentAddressNative): void;
226
+ count(): number;
227
+ nth(index: number): PaymentAddressNative;
142
228
  }
143
229
  export declare class EcPrivateNative {
144
230
  private readonly [ptrSym];
@@ -171,6 +257,7 @@ export declare class EcPublicNative {
171
257
  encoded(): string;
172
258
  point(): EcCompressedNative;
173
259
  compressed(): boolean;
260
+ toData(): Uint8Array;
174
261
  toUncompressed(outData: EcUncompressedNative): boolean;
175
262
  toPaymentAddress(version: number): PaymentAddressNative;
176
263
  }
@@ -181,4 +268,303 @@ export declare class WalletNative {
181
268
  static ecToPublic(secret: EcSecretNative, uncompressed: boolean): EcPublicNative;
182
269
  static ecToAddress(point: EcPublicNative, version: number): PaymentAddressNative;
183
270
  }
271
+ export declare class WalletDataNative {
272
+ private readonly [ptrSym];
273
+ static _create(ptr: number): WalletDataNative;
274
+ protected _destructor(): void;
275
+ mnemonics(): StringListNative;
276
+ encryptedSeed(): EncryptedSeedNative;
277
+ xpub(): HdPublicNative;
278
+ }
279
+ export declare class WalletManagerNative {
280
+ static createWallet(password: string, normalizedPassphrase: string): [number, WalletDataNative];
281
+ static decryptSeed(password: string, encryptedSeed: EncryptedSeedNative): [number, LongHashNative];
282
+ }
283
+ export declare class NodeInfoNative {
284
+ static printThreadId(): void;
285
+ static getThreadId(): bigint;
286
+ static capiVersion(): string;
287
+ static cppapiVersion(): string;
288
+ static microarchitecture(): string;
289
+ static marchNames(): string;
290
+ static currencySymbol(): string;
291
+ static currency(): string;
292
+ static cppapiBuildTimestamp(): number;
293
+ }
294
+ export declare class OpcodeNative {
295
+ static to_string(value: OpcodeEnumNative, active_forks: number): string;
296
+ static from_string(value: string): [boolean, OpcodeEnumNative];
297
+ static to_hexadecimal(code: OpcodeEnumNative): string;
298
+ static from_hexadecimal(value: string): [boolean, OpcodeEnumNative];
299
+ }
300
+ export declare class OperationNative {
301
+ private readonly [ptrSym];
302
+ static _create(ptr: number): OperationNative;
303
+ protected _destructor(): void;
304
+ constructor();
305
+ constructor(opcode: OpcodeEnumNative);
306
+ constructor(encoded: Uint8Array, minimal: boolean);
307
+ toStr(activeForks: number): string;
308
+ toData(): Uint8Array;
309
+ fromData(encoded: Uint8Array): boolean;
310
+ fromStr(str: string): boolean;
311
+ isValid(): boolean;
312
+ serializedSize(): number;
313
+ code(): OpcodeEnumNative;
314
+ data(): Uint8Array;
315
+ isPush(): boolean;
316
+ isCounted(): boolean;
317
+ isVersion(): boolean;
318
+ isPositive(): boolean;
319
+ isDisabled(activeForks: number): boolean;
320
+ isConditional(): boolean;
321
+ isRelaxedPush(): boolean;
322
+ isOversized(maxSize: number): boolean;
323
+ isMinimalPush(): boolean;
324
+ isNominalPush(): boolean;
325
+ static opcodeFromSize(size: number): OpcodeEnumNative;
326
+ static minimalOpcodeFromData(data: Uint8Array): OpcodeEnumNative;
327
+ static nominalOpcodeFromData(data: Uint8Array): OpcodeEnumNative;
328
+ static opcodeFromPositive(value: number): OpcodeEnumNative;
329
+ static opcodeToPositive(code: OpcodeEnumNative): number;
330
+ static opcodeIsPush(code: OpcodeEnumNative): boolean;
331
+ static opcodeIsPayload(code: OpcodeEnumNative): boolean;
332
+ static opcodeIsCounted(code: OpcodeEnumNative): boolean;
333
+ static opcodeIsVersion(code: OpcodeEnumNative): boolean;
334
+ static opcodeIsNumeric(code: OpcodeEnumNative): boolean;
335
+ static opcodeIsPositive(code: OpcodeEnumNative): boolean;
336
+ static opcodeIsReserved(code: OpcodeEnumNative): boolean;
337
+ static opcodeIsDisabled(code: OpcodeEnumNative, activeForks: number): boolean;
338
+ static opcodeIsConditional(code: OpcodeEnumNative): boolean;
339
+ static opcodeIsRelaxedPush(code: OpcodeEnumNative): boolean;
340
+ }
341
+ export declare class OperationListNative {
342
+ private readonly [ptrSym];
343
+ static _create(ptr: number): OperationListNative;
344
+ protected _destructor(): void;
345
+ constructor();
346
+ pushBack(operation: OperationNative): void;
347
+ count(): number;
348
+ nth(index: number): OperationNative;
349
+ }
350
+ 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"];
351
+ export declare type ScriptPattern = (typeof _ScriptPatternIntToKey)[number];
352
+ export declare function ScriptPatternToInt(value: ScriptPattern): number;
353
+ declare const _EndorsementTypeIntToKey: readonly ["ecdsa", "schnorr"];
354
+ export declare type EndorsementType = (typeof _EndorsementTypeIntToKey)[number];
355
+ export declare function EndorsementTypeToInt(value: EndorsementType): number;
356
+ export declare class ScriptNative {
357
+ private readonly [ptrSym];
358
+ static _create(ptr: number): ScriptNative;
359
+ protected _destructor(): void;
360
+ constructor();
361
+ constructor(str: string);
362
+ constructor(operations: OperationListNative);
363
+ constructor(encoded: Uint8Array, prefix: boolean);
364
+ isValid(): boolean;
365
+ isValidOperations(): boolean;
366
+ satoshiContentSize(): number;
367
+ serializedSize(prefix: boolean): number;
368
+ toStr(activeForks: number): string;
369
+ type(): string;
370
+ toData(prefix: boolean): Uint8Array;
371
+ operations(): OperationListNative;
372
+ toBytes(): Uint8Array;
373
+ static isPushOnly(ops: OperationListNative): boolean;
374
+ static isRelaxedPush(ops: OperationListNative): boolean;
375
+ static isCoinbasePattern(ops: OperationListNative, height: number): boolean;
376
+ static isNullDataPattern(ops: OperationListNative): boolean;
377
+ static isPayMultisigPattern(ops: OperationListNative): boolean;
378
+ static isPayPublicKeyPattern(ops: OperationListNative): boolean;
379
+ static isPayPublicKeyHashPattern(ops: OperationListNative): boolean;
380
+ static isPayScriptHashPattern(ops: OperationListNative): boolean;
381
+ static isSignMultisigPattern(ops: OperationListNative): boolean;
382
+ static isSignPublicKeyPattern(ops: OperationListNative): boolean;
383
+ static isSignPublicKeyHashPattern(ops: OperationListNative): boolean;
384
+ static isSignScriptHashPattern(ops: OperationListNative): boolean;
385
+ static toNullDataPattern(data: Uint8Array): OperationListNative;
386
+ static toPayPublicKeyPattern(point: Uint8Array): OperationListNative;
387
+ static toPayPublicKeyHashPattern(hash: ShortHashNative): OperationListNative;
388
+ static toPayScriptHashPattern(hash: ShortHashNative): OperationListNative;
389
+ pattern(): ScriptPattern;
390
+ outputPattern(): ScriptPattern;
391
+ inputPattern(): ScriptPattern;
392
+ sigops(accurate: boolean): number;
393
+ isUnspendable(): boolean;
394
+ reset(): void;
395
+ static createEndorsement(secret: EcSecretNative, prevoutScript: ScriptNative, tx: TransactionNative, inputIndex: number, sighashType: number, activeForks: number, value: bigint, endorsementType: EndorsementType): Uint8Array;
396
+ static verify(tx: TransactionNative, input: number, forks: number, inputScript: ScriptNative, prevoutScript: ScriptNative, value: bigint): number;
397
+ static verifyTransaction(tx: TransactionNative, input: number, forks: number): number;
398
+ }
399
+ export declare class OutputPointNative {
400
+ private readonly [ptrSym];
401
+ static _create(ptr: number): OutputPointNative;
402
+ protected _destructor(): void;
403
+ constructor();
404
+ constructor(hash: HashNative, index: number);
405
+ hash(): HashNative;
406
+ index(): number;
407
+ cachedOutput(): OutputNative;
408
+ setHash(hash: HashNative): void;
409
+ setIndex(index: number): void;
410
+ setCachedOutput(output: OutputNative): void;
411
+ }
412
+ declare const _TokenKindIntToKey: readonly ["none", "fungible", "non_fungible", "both"];
413
+ export declare type TokenKind = (typeof _TokenKindIntToKey)[number];
414
+ export declare function TokenKindToInt(value: TokenKind): number;
415
+ declare const _TokenCapabilityIntToKey: readonly ["none", "mutable", "minting"];
416
+ export declare type TokenCapability = (typeof _TokenCapabilityIntToKey)[number];
417
+ export declare function TokenCapabilityToInt(value: TokenCapability): number;
418
+ export declare class TokenDataNative {
419
+ private readonly [ptrSym];
420
+ static _create(ptr: number): TokenDataNative;
421
+ protected _destructor(): void;
422
+ static constructFungible(category: HashNative, amount: bigint): TokenDataNative;
423
+ static constructNonFungible(category: HashNative, capability: TokenCapability, commitmentData: Uint8Array): TokenDataNative;
424
+ static constructBothKinds(category: HashNative, amount: bigint, capability: TokenCapability, commitmentData: Uint8Array): TokenDataNative;
425
+ isValid(): boolean;
426
+ serializedSize(): number;
427
+ toData(): Uint8Array;
428
+ kind(): TokenKind;
429
+ category(): HashNative;
430
+ fungibleAmount(): bigint;
431
+ nonFungibleCapability(): TokenCapability;
432
+ nonFungibleCommitment(): Uint8Array;
433
+ }
434
+ export declare class UtxoNative {
435
+ private readonly [ptrSym];
436
+ static _create(ptr: number): UtxoNative;
437
+ protected _destructor(): void;
438
+ constructor();
439
+ static fromPointAmount(hash: HashNative, index: number, amount: bigint): UtxoNative;
440
+ static fromPointAmountFungible(hash: HashNative, index: number, amount: bigint, category: HashNative, tokenAmount: bigint): UtxoNative;
441
+ static fromPointAmountNonFungible(hash: HashNative, index: number, amount: bigint, category: HashNative, capability: TokenCapability, commitmentData: Uint8Array): UtxoNative;
442
+ static fromPointAmountBothKinds(hash: HashNative, index: number, amount: bigint, category: HashNative, tokenAmount: bigint, capability: TokenCapability, commitmentData: Uint8Array): UtxoNative;
443
+ hash(): HashNative;
444
+ index(): number;
445
+ amount(): bigint;
446
+ cachedOutput(): OutputNative;
447
+ hasTokenData(): boolean;
448
+ tokenData(): TokenDataNative;
449
+ tokenCategory(): HashNative;
450
+ tokenAmount(): bigint;
451
+ setHash(hash: HashNative): void;
452
+ setIndex(index: number): void;
453
+ setAmount(amount: bigint): void;
454
+ setCachedOutput(output: OutputNative): void;
455
+ setTokenData(token_data: TokenDataNative): void;
456
+ setTokenCategory(category: HashNative): void;
457
+ setTokenAmount(amount: bigint): void;
458
+ }
459
+ export declare class OutputNative {
460
+ private readonly [ptrSym];
461
+ static _create(ptr: number): OutputNative;
462
+ protected _destructor(): void;
463
+ constructor();
464
+ constructor(value: bigint, script: ScriptNative);
465
+ constructor(value: bigint, script: ScriptNative, tokenData: TokenDataNative);
466
+ static fromData(data: Uint8Array): OutputNative;
467
+ toData(wire: boolean): Uint8Array;
468
+ serializedSize(wire: boolean): number;
469
+ isValid(): boolean;
470
+ value(): bigint;
471
+ script(): ScriptNative;
472
+ hasTokenData(): boolean;
473
+ tokenData(): TokenDataNative;
474
+ }
475
+ export declare class InputNative {
476
+ private readonly [ptrSym];
477
+ static _create(ptr: number): InputNative;
478
+ protected _destructor(): void;
479
+ constructor();
480
+ constructor(previousOutput: OutputPointNative, script: ScriptNative, seq: number);
481
+ static fromData(data: Uint8Array): InputNative;
482
+ toData(wire: boolean): Uint8Array;
483
+ serializedSize(wire: boolean): number;
484
+ isValid(): boolean;
485
+ seq(): number;
486
+ script(): ScriptNative;
487
+ previousOutput(): OutputPointNative;
488
+ }
489
+ export declare class OutputListNative {
490
+ private readonly [ptrSym];
491
+ static _create(ptr: number): OutputListNative;
492
+ protected _destructor(): void;
493
+ constructor();
494
+ pushBack(output: OutputNative): void;
495
+ count(): number;
496
+ nth(index: number): OutputNative;
497
+ }
498
+ export declare class InputListNative {
499
+ private readonly [ptrSym];
500
+ static _create(ptr: number): InputListNative;
501
+ protected _destructor(): void;
502
+ constructor();
503
+ pushBack(input: InputNative): void;
504
+ count(): number;
505
+ nth(index: number): InputNative;
506
+ }
507
+ export declare class UtxoListNative {
508
+ private readonly [ptrSym];
509
+ static _create(ptr: number): UtxoListNative;
510
+ protected _destructor(): void;
511
+ constructor();
512
+ pushBack(utxo: UtxoNative): void;
513
+ count(): number;
514
+ nth(index: number): UtxoNative;
515
+ }
516
+ declare const _CoinSelectionAlgorithmIntToKey: readonly ["smallest_first", "largest_first", "manual", "send_all"];
517
+ export declare type CoinSelectionAlgorithm = (typeof _CoinSelectionAlgorithmIntToKey)[number];
518
+ export declare function CoinSelectionAlgorithmToInt(value: CoinSelectionAlgorithm): number;
519
+ export declare class TransactionNative {
520
+ private readonly [ptrSym];
521
+ static _create(ptr: number): TransactionNative;
522
+ protected _destructor(): void;
523
+ constructor();
524
+ constructor(version: number, locktime: number, inputs: InputListNative, outputs: OutputListNative);
525
+ static fromData(data: Uint8Array): TransactionNative;
526
+ toData(wire: boolean): Uint8Array;
527
+ serializedSize(wire: boolean): number;
528
+ isValid(): boolean;
529
+ hash(): HashNative;
530
+ version(): number;
531
+ locktime(): number;
532
+ outputs(): OutputListNative;
533
+ inputs(): InputListNative;
534
+ isCoinbase(): boolean;
535
+ totalInputValue(): bigint;
536
+ totalOutputValue(): bigint;
537
+ fees(): bigint;
538
+ isMature(target_height: number): boolean;
539
+ 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];
540
+ static createTemplate(available_utxos: UtxoListNative, amount_to_send: bigint, destination_address: PaymentAddressNative, change_addresses: PaymentAddressListNative, selection_algo: CoinSelectionAlgorithm): [number, TransactionNative, U32ListNative, PaymentAddressListNative, U64ListNative];
541
+ }
542
+ export declare class InterpreterNative {
543
+ static run(program: ProgramNative): number;
544
+ static runOperation(operation: OperationNative, program: ProgramNative): number;
545
+ static debugStart(program: ProgramNative): [number, number];
546
+ static debugStepsAvailable(program: ProgramNative, step: number): boolean;
547
+ static debugStep(program: ProgramNative, step: number): [number, number, ProgramNative];
548
+ static debugEnd(program: ProgramNative): number;
549
+ }
550
+ export declare class ProgramNative {
551
+ private readonly [ptrSym];
552
+ static _create(ptr: number): ProgramNative;
553
+ protected _destructor(): void;
554
+ constructor();
555
+ constructor(script: ScriptNative);
556
+ constructor(script: ScriptNative, program: ProgramNative);
557
+ constructor(script: ScriptNative, transaction: TransactionNative, inputIndex: number, forks: number);
558
+ isValid(): boolean;
559
+ evaluate(): number;
560
+ stackResult(clean: boolean): boolean;
561
+ size(): number;
562
+ item(index: number): Uint8Array;
563
+ }
564
+ 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"];
565
+ export declare type RuleForkEnumNative = (typeof _RuleForkEnumNativeIntToKey)[number];
566
+ export declare function RuleForkEnumNativeToInt(value: RuleForkEnumNative): number;
567
+ 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"];
568
+ export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[number];
569
+ export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
184
570
  export {};
@@ -0,0 +1,42 @@
1
+ declare const _RuleForkEnumNativeKeyToInt: {
2
+ readonly no_rules: 0;
3
+ readonly easy_blocks: number;
4
+ readonly bip16_rule: number;
5
+ readonly bip30_rule: number;
6
+ readonly bip34_rule: number;
7
+ readonly bip66_rule: number;
8
+ readonly bip65_rule: number;
9
+ readonly bip90_rule: number;
10
+ readonly allow_collisions: number;
11
+ readonly bip68_rule: number;
12
+ readonly bip112_rule: number;
13
+ readonly bip113_rule: number;
14
+ readonly bch_uahf: number;
15
+ readonly bch_daa_cw144: number;
16
+ readonly bch_pythagoras: number;
17
+ readonly bch_euclid: number;
18
+ readonly bch_pisano: number;
19
+ readonly bch_mersenne: number;
20
+ readonly bch_fermat: number;
21
+ readonly bch_euler: number;
22
+ readonly bch_gauss: number;
23
+ readonly bch_descartes: number;
24
+ readonly bch_lobachevski: number;
25
+ readonly bch_galois: number;
26
+ readonly bch_leibniz: number;
27
+ readonly retarget: number;
28
+ readonly unverified: number;
29
+ readonly bip34_activations: number;
30
+ readonly bip9_bit0_group: number;
31
+ readonly bip9_bit1_group: number;
32
+ readonly all_rules: 4294967295;
33
+ };
34
+ export declare const RuleForkEnumValues: string[];
35
+ export declare type RuleForkEnumNative = keyof typeof _RuleForkEnumNativeKeyToInt;
36
+ export declare function RuleForkEnumNativeToInt(value: RuleForkEnumNative): number;
37
+ export declare function RuleForkEnumNativeFromInt(value: number): RuleForkEnumNative | undefined;
38
+ 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", "checklocktimeverify", "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", "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", "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", "invalidopcode"];
39
+ export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[number];
40
+ export declare const OpcodeEnumValues: string[];
41
+ export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
42
+ export {};
@@ -0,0 +1,5 @@
1
+ import Klass from '../../tools/wasm-generator/src/klass';
2
+ import Enum from '../../tools/wasm-generator/src/enum';
3
+ import Typedef from '../../tools/wasm-generator/src/typedef';
4
+ declare const manualGeneratedTypes: Array<Klass | Enum | Typedef>;
5
+ export default manualGeneratedTypes;
@@ -7,4 +7,7 @@ interface CustomAllocatedArray {
7
7
  declare function buffer(): ArrayBufferLike;
8
8
  declare function malloc<T extends AnyTypedArrayConstructor>(arrayClass: T, len: number): InstanceType<T> & CustomAllocatedArray;
9
9
  declare function free(objOrPtr: any): void;
10
- export { malloc, free, buffer };
10
+ declare function readUint32(ptr: number): number;
11
+ declare function setUint8Array(encoded: Uint8Array, encodedPtr: number): void;
12
+ declare function subarray(ptr: number, size: number): Uint8Array<ArrayBufferLike>;
13
+ export { malloc, free, buffer, readUint32, setUint8Array, subarray };