forked from Emurgo/cardano-serialization-lib
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcardano_serialization_lib.js.flow
6410 lines (5442 loc) · 117 KB
/
cardano_serialization_lib.js.flow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Flowtype definitions for cardano_serialization_lib
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.11.0
* @flow
*/
/**
* @param {TransactionHash} tx_body_hash
* @param {ByronAddress} addr
* @param {LegacyDaedalusPrivateKey} key
* @returns {BootstrapWitness}
*/
declare export function make_daedalus_bootstrap_witness(
tx_body_hash: TransactionHash,
addr: ByronAddress,
key: LegacyDaedalusPrivateKey
): BootstrapWitness;
/**
* @param {TransactionHash} tx_body_hash
* @param {ByronAddress} addr
* @param {Bip32PrivateKey} key
* @returns {BootstrapWitness}
*/
declare export function make_icarus_bootstrap_witness(
tx_body_hash: TransactionHash,
addr: ByronAddress,
key: Bip32PrivateKey
): BootstrapWitness;
/**
* @param {TransactionHash} tx_body_hash
* @param {PrivateKey} sk
* @returns {Vkeywitness}
*/
declare export function make_vkey_witness(
tx_body_hash: TransactionHash,
sk: PrivateKey
): Vkeywitness;
/**
* @param {AuxiliaryData} auxiliary_data
* @returns {AuxiliaryDataHash}
*/
declare export function hash_auxiliary_data(
auxiliary_data: AuxiliaryData
): AuxiliaryDataHash;
/**
* @param {TransactionBody} tx_body
* @returns {TransactionHash}
*/
declare export function hash_transaction(
tx_body: TransactionBody
): TransactionHash;
/**
* @param {PlutusData} plutus_data
* @returns {DataHash}
*/
declare export function hash_plutus_data(plutus_data: PlutusData): DataHash;
/**
* @param {Redeemers} redeemers
* @param {Costmdls} cost_models
* @param {PlutusList | void} datums
* @returns {ScriptDataHash}
*/
declare export function hash_script_data(
redeemers: Redeemers,
cost_models: Costmdls,
datums?: PlutusList
): ScriptDataHash;
/**
* @param {TransactionBody} txbody
* @param {BigNum} pool_deposit
* @param {BigNum} key_deposit
* @returns {Value}
*/
declare export function get_implicit_input(
txbody: TransactionBody,
pool_deposit: BigNum,
key_deposit: BigNum
): Value;
/**
* @param {TransactionBody} txbody
* @param {BigNum} pool_deposit
* @param {BigNum} key_deposit
* @returns {BigNum}
*/
declare export function get_deposit(
txbody: TransactionBody,
pool_deposit: BigNum,
key_deposit: BigNum
): BigNum;
/**
* @param {Value} assets
* @param {boolean} has_data_hash
* @param {BigNum} coins_per_utxo_word
* @returns {BigNum}
*/
declare export function min_ada_required(
assets: Value,
has_data_hash: boolean,
coins_per_utxo_word: BigNum
): BigNum;
/**
* Receives a script JSON string
* and returns a NativeScript.
* Cardano Wallet and Node styles are supported.
*
* * wallet: https://github.com/input-output-hk/cardano-wallet/blob/master/specifications/api/swagger.yaml
* * node: https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/simple-scripts.md
*
* self_xpub is expected to be a Bip32PublicKey as hex-encoded bytes
* @param {string} json
* @param {string} self_xpub
* @param {number} schema
* @returns {NativeScript}
*/
declare export function encode_json_str_to_native_script(
json: string,
self_xpub: string,
schema: number
): NativeScript;
/**
* @param {Uint8Array} bytes
* @returns {TransactionMetadatum}
*/
declare export function encode_arbitrary_bytes_as_metadatum(
bytes: Uint8Array
): TransactionMetadatum;
/**
* @param {TransactionMetadatum} metadata
* @returns {Uint8Array}
*/
declare export function decode_arbitrary_bytes_from_metadatum(
metadata: TransactionMetadatum
): Uint8Array;
/**
* @param {string} json
* @param {number} schema
* @returns {TransactionMetadatum}
*/
declare export function encode_json_str_to_metadatum(
json: string,
schema: number
): TransactionMetadatum;
/**
* @param {TransactionMetadatum} metadatum
* @param {number} schema
* @returns {string}
*/
declare export function decode_metadatum_to_json_str(
metadatum: TransactionMetadatum,
schema: number
): string;
/**
* @param {Transaction} tx
* @param {LinearFee} linear_fee
* @returns {BigNum}
*/
declare export function min_fee(tx: Transaction, linear_fee: LinearFee): BigNum;
/**
* @param {string} password
* @param {string} salt
* @param {string} nonce
* @param {string} data
* @returns {string}
*/
declare export function encrypt_with_password(
password: string,
salt: string,
nonce: string,
data: string
): string;
/**
* @param {string} password
* @param {string} data
* @returns {string}
*/
declare export function decrypt_with_password(
password: string,
data: string
): string;
/**
*/
declare export var CertificateKind: {|
+StakeRegistration: 0, // 0
+StakeDeregistration: 1, // 1
+StakeDelegation: 2, // 2
+PoolRegistration: 3, // 3
+PoolRetirement: 4, // 4
+GenesisKeyDelegation: 5, // 5
+MoveInstantaneousRewardsCert: 6, // 6
|};
/**
*/
declare export var MIRPot: {|
+Reserves: 0, // 0
+Treasury: 1, // 1
|};
/**
*/
declare export var MIRKind: {|
+ToOtherPot: 0, // 0
+ToStakeCredentials: 1, // 1
|};
/**
*/
declare export var RelayKind: {|
+SingleHostAddr: 0, // 0
+SingleHostName: 1, // 1
+MultiHostName: 2, // 2
|};
/**
*/
declare export var NativeScriptKind: {|
+ScriptPubkey: 0, // 0
+ScriptAll: 1, // 1
+ScriptAny: 2, // 2
+ScriptNOfK: 3, // 3
+TimelockStart: 4, // 4
+TimelockExpiry: 5, // 5
|};
/**
* Each new language uses a different namespace for hashing its script
* This is because you could have a language where the same bytes have different semantics
* So this avoids scripts in different languages mapping to the same hash
* Note that the enum value here is different than the enum value for deciding the cost model of a script
*/
declare export var ScriptHashNamespace: {|
+NativeScript: 0, // 0
|};
/**
*/
declare export var NetworkIdKind: {|
+Testnet: 0, // 0
+Mainnet: 1, // 1
|};
/**
* Used to choosed the schema for a script JSON string
*/
declare export var ScriptSchema: {|
+Wallet: 0, // 0
+Node: 1, // 1
|};
/**
*/
declare export var TransactionMetadatumKind: {|
+MetadataMap: 0, // 0
+MetadataList: 1, // 1
+Int: 2, // 2
+Bytes: 3, // 3
+Text: 4, // 4
|};
/**
*/
declare export var MetadataJsonSchema: {|
+NoConversions: 0, // 0
+BasicConversions: 1, // 1
+DetailedSchema: 2, // 2
|};
/**
*/
declare export var CoinSelectionStrategyCIP2: {|
+LargestFirst: 0, // 0
+RandomImprove: 1, // 1
+LargestFirstMultiAsset: 2, // 2
+RandomImproveMultiAsset: 3, // 3
|};
/**
*/
declare export var StakeCredKind: {|
+Key: 0, // 0
+Script: 1, // 1
|};
/**
*/
declare export var LanguageKind: {|
+PlutusV1: 0, // 0
|};
/**
*/
declare export var PlutusDataKind: {|
+ConstrPlutusData: 0, // 0
+Map: 1, // 1
+List: 2, // 2
+Integer: 3, // 3
+Bytes: 4, // 4
|};
/**
*/
declare export var RedeemerTagKind: {|
+Spend: 0, // 0
+Mint: 1, // 1
+Cert: 2, // 2
+Reward: 3, // 3
|};
/**
*/
declare export class Address {
free(): void;
/**
* @param {Uint8Array} data
* @returns {Address}
*/
static from_bytes(data: Uint8Array): Address;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {string | void} prefix
* @returns {string}
*/
to_bech32(prefix?: string): string;
/**
* @param {string} bech_str
* @returns {Address}
*/
static from_bech32(bech_str: string): Address;
/**
* @returns {number}
*/
network_id(): number;
}
/**
*/
declare export class AssetName {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {AssetName}
*/
static from_bytes(bytes: Uint8Array): AssetName;
/**
* @param {Uint8Array} name
* @returns {AssetName}
*/
static new(name: Uint8Array): AssetName;
/**
* @returns {Uint8Array}
*/
name(): Uint8Array;
}
/**
*/
declare export class AssetNames {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {AssetNames}
*/
static from_bytes(bytes: Uint8Array): AssetNames;
/**
* @returns {AssetNames}
*/
static new(): AssetNames;
/**
* @returns {number}
*/
len(): number;
/**
* @param {number} index
* @returns {AssetName}
*/
get(index: number): AssetName;
/**
* @param {AssetName} elem
*/
add(elem: AssetName): void;
}
/**
*/
declare export class Assets {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {Assets}
*/
static from_bytes(bytes: Uint8Array): Assets;
/**
* @returns {Assets}
*/
static new(): Assets;
/**
* @returns {number}
*/
len(): number;
/**
* @param {AssetName} key
* @param {BigNum} value
* @returns {BigNum | void}
*/
insert(key: AssetName, value: BigNum): BigNum | void;
/**
* @param {AssetName} key
* @returns {BigNum | void}
*/
get(key: AssetName): BigNum | void;
/**
* @returns {AssetNames}
*/
keys(): AssetNames;
}
/**
*/
declare export class AuxiliaryData {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {AuxiliaryData}
*/
static from_bytes(bytes: Uint8Array): AuxiliaryData;
/**
* @returns {AuxiliaryData}
*/
static new(): AuxiliaryData;
/**
* @returns {GeneralTransactionMetadata | void}
*/
metadata(): GeneralTransactionMetadata | void;
/**
* @param {GeneralTransactionMetadata} metadata
*/
set_metadata(metadata: GeneralTransactionMetadata): void;
/**
* @returns {NativeScripts | void}
*/
native_scripts(): NativeScripts | void;
/**
* @param {NativeScripts} native_scripts
*/
set_native_scripts(native_scripts: NativeScripts): void;
/**
* @returns {PlutusScripts | void}
*/
plutus_scripts(): PlutusScripts | void;
/**
* @param {PlutusScripts} plutus_scripts
*/
set_plutus_scripts(plutus_scripts: PlutusScripts): void;
}
/**
*/
declare export class AuxiliaryDataHash {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {string} prefix
* @returns {string}
*/
to_bech32(prefix: string): string;
/**
* @param {string} bech_str
* @returns {AuxiliaryDataHash}
*/
static from_bech32(bech_str: string): AuxiliaryDataHash;
/**
* @param {Uint8Array} bytes
* @returns {AuxiliaryDataHash}
*/
static from_bytes(bytes: Uint8Array): AuxiliaryDataHash;
}
/**
*/
declare export class AuxiliaryDataSet {
free(): void;
/**
* @returns {AuxiliaryDataSet}
*/
static new(): AuxiliaryDataSet;
/**
* @returns {number}
*/
len(): number;
/**
* @param {number} tx_index
* @param {AuxiliaryData} data
* @returns {AuxiliaryData | void}
*/
insert(tx_index: number, data: AuxiliaryData): AuxiliaryData | void;
/**
* @param {number} tx_index
* @returns {AuxiliaryData | void}
*/
get(tx_index: number): AuxiliaryData | void;
/**
* @returns {Uint32Array}
*/
indices(): Uint32Array;
}
/**
*/
declare export class BaseAddress {
free(): void;
/**
* @param {number} network
* @param {StakeCredential} payment
* @param {StakeCredential} stake
* @returns {BaseAddress}
*/
static new(
network: number,
payment: StakeCredential,
stake: StakeCredential
): BaseAddress;
/**
* @returns {StakeCredential}
*/
payment_cred(): StakeCredential;
/**
* @returns {StakeCredential}
*/
stake_cred(): StakeCredential;
/**
* @returns {Address}
*/
to_address(): Address;
/**
* @param {Address} addr
* @returns {BaseAddress | void}
*/
static from_address(addr: Address): BaseAddress | void;
}
/**
*/
declare export class BigInt {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {BigInt}
*/
static from_bytes(bytes: Uint8Array): BigInt;
/**
* @returns {BigNum | void}
*/
as_u64(): BigNum | void;
/**
* @param {string} text
* @returns {BigInt}
*/
static from_str(text: string): BigInt;
/**
* @returns {string}
*/
to_str(): string;
}
/**
*/
declare export class BigNum {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {BigNum}
*/
static from_bytes(bytes: Uint8Array): BigNum;
/**
* @param {string} string
* @returns {BigNum}
*/
static from_str(string: string): BigNum;
/**
* @returns {string}
*/
to_str(): string;
/**
* @returns {BigNum}
*/
static zero(): BigNum;
/**
* @returns {boolean}
*/
is_zero(): boolean;
/**
* @param {BigNum} other
* @returns {BigNum}
*/
checked_mul(other: BigNum): BigNum;
/**
* @param {BigNum} other
* @returns {BigNum}
*/
checked_add(other: BigNum): BigNum;
/**
* @param {BigNum} other
* @returns {BigNum}
*/
checked_sub(other: BigNum): BigNum;
/**
* returns 0 if it would otherwise underflow
* @param {BigNum} other
* @returns {BigNum}
*/
clamped_sub(other: BigNum): BigNum;
/**
* @param {BigNum} rhs_value
* @returns {number}
*/
compare(rhs_value: BigNum): number;
}
/**
*/
declare export class Bip32PrivateKey {
free(): void;
/**
* derive this private key with the given index.
*
* # Security considerations
*
* * hard derivation index cannot be soft derived with the public key
*
* # Hard derivation vs Soft derivation
*
* If you pass an index below 0x80000000 then it is a soft derivation.
* The advantage of soft derivation is that it is possible to derive the
* public key too. I.e. derivation the private key with a soft derivation
* index and then retrieving the associated public key is equivalent to
* deriving the public key associated to the parent private key.
*
* Hard derivation index does not allow public key derivation.
*
* This is why deriving the private key should not fail while deriving
* the public key may fail (if the derivation index is invalid).
* @param {number} index
* @returns {Bip32PrivateKey}
*/
derive(index: number): Bip32PrivateKey;
/**
* 128-byte xprv a key format in Cardano that some software still uses or requires
* the traditional 96-byte xprv is simply encoded as
* prv | chaincode
* however, because some software may not know how to compute a public key from a private key,
* the 128-byte inlines the public key in the following format
* prv | pub | chaincode
* so be careful if you see the term "xprv" as it could refer to either one
* our library does not require the pub (instead we compute the pub key when needed)
* @param {Uint8Array} bytes
* @returns {Bip32PrivateKey}
*/
static from_128_xprv(bytes: Uint8Array): Bip32PrivateKey;
/**
* see from_128_xprv
* @returns {Uint8Array}
*/
to_128_xprv(): Uint8Array;
/**
* @returns {Bip32PrivateKey}
*/
static generate_ed25519_bip32(): Bip32PrivateKey;
/**
* @returns {PrivateKey}
*/
to_raw_key(): PrivateKey;
/**
* @returns {Bip32PublicKey}
*/
to_public(): Bip32PublicKey;
/**
* @param {Uint8Array} bytes
* @returns {Bip32PrivateKey}
*/
static from_bytes(bytes: Uint8Array): Bip32PrivateKey;
/**
* @returns {Uint8Array}
*/
as_bytes(): Uint8Array;
/**
* @param {string} bech32_str
* @returns {Bip32PrivateKey}
*/
static from_bech32(bech32_str: string): Bip32PrivateKey;
/**
* @returns {string}
*/
to_bech32(): string;
/**
* @param {Uint8Array} entropy
* @param {Uint8Array} password
* @returns {Bip32PrivateKey}
*/
static from_bip39_entropy(
entropy: Uint8Array,
password: Uint8Array
): Bip32PrivateKey;
/**
* @returns {Uint8Array}
*/
chaincode(): Uint8Array;
}
/**
*/
declare export class Bip32PublicKey {
free(): void;
/**
* derive this public key with the given index.
*
* # Errors
*
* If the index is not a soft derivation index (< 0x80000000) then
* calling this method will fail.
*
* # Security considerations
*
* * hard derivation index cannot be soft derived with the public key
*
* # Hard derivation vs Soft derivation
*
* If you pass an index below 0x80000000 then it is a soft derivation.
* The advantage of soft derivation is that it is possible to derive the
* public key too. I.e. derivation the private key with a soft derivation
* index and then retrieving the associated public key is equivalent to
* deriving the public key associated to the parent private key.
*
* Hard derivation index does not allow public key derivation.
*
* This is why deriving the private key should not fail while deriving
* the public key may fail (if the derivation index is invalid).
* @param {number} index
* @returns {Bip32PublicKey}
*/
derive(index: number): Bip32PublicKey;
/**
* @returns {PublicKey}
*/
to_raw_key(): PublicKey;
/**
* @param {Uint8Array} bytes
* @returns {Bip32PublicKey}
*/
static from_bytes(bytes: Uint8Array): Bip32PublicKey;
/**
* @returns {Uint8Array}
*/
as_bytes(): Uint8Array;
/**
* @param {string} bech32_str
* @returns {Bip32PublicKey}
*/
static from_bech32(bech32_str: string): Bip32PublicKey;
/**
* @returns {string}
*/
to_bech32(): string;
/**
* @returns {Uint8Array}
*/
chaincode(): Uint8Array;
}
/**
*/
declare export class Block {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {Block}
*/
static from_bytes(bytes: Uint8Array): Block;
/**
* @returns {Header}
*/
header(): Header;
/**
* @returns {TransactionBodies}
*/
transaction_bodies(): TransactionBodies;
/**
* @returns {TransactionWitnessSets}
*/
transaction_witness_sets(): TransactionWitnessSets;
/**
* @returns {AuxiliaryDataSet}
*/
auxiliary_data_set(): AuxiliaryDataSet;
/**
* @returns {Uint32Array}
*/
invalid_transactions(): Uint32Array;
/**
* @param {Header} header
* @param {TransactionBodies} transaction_bodies
* @param {TransactionWitnessSets} transaction_witness_sets
* @param {AuxiliaryDataSet} auxiliary_data_set
* @param {Uint32Array} invalid_transactions
* @returns {Block}
*/
static new(
header: Header,
transaction_bodies: TransactionBodies,
transaction_witness_sets: TransactionWitnessSets,
auxiliary_data_set: AuxiliaryDataSet,
invalid_transactions: Uint32Array
): Block;
}
/**
*/
declare export class BlockHash {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {string} prefix
* @returns {string}
*/
to_bech32(prefix: string): string;
/**
* @param {string} bech_str
* @returns {BlockHash}
*/
static from_bech32(bech_str: string): BlockHash;
/**
* @param {Uint8Array} bytes
* @returns {BlockHash}
*/
static from_bytes(bytes: Uint8Array): BlockHash;
}
/**
*/
declare export class BootstrapWitness {
free(): void;
/**
* @returns {Uint8Array}
*/
to_bytes(): Uint8Array;
/**
* @param {Uint8Array} bytes
* @returns {BootstrapWitness}
*/
static from_bytes(bytes: Uint8Array): BootstrapWitness;