@bubolabs/wallet-wasm 0.1.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.
- package/README.md +103 -0
- package/index.d.ts +289 -0
- package/index.js +748 -0
- package/package.json +34 -0
- package/pkg/bubo_wallet_wasm.d.ts +192 -0
- package/pkg/bubo_wallet_wasm.js +9 -0
- package/pkg/bubo_wallet_wasm_bg.js +1343 -0
- package/pkg/bubo_wallet_wasm_bg.wasm +0 -0
- package/pkg/bubo_wallet_wasm_bg.wasm.d.ts +78 -0
- package/pkg/package.json +18 -0
- package/pkg-cardano/bubo_wallet_wasm.d.ts +4367 -0
- package/pkg-cardano/bubo_wallet_wasm.js +9 -0
- package/pkg-cardano/bubo_wallet_wasm_bg.js +30154 -0
- package/pkg-cardano/bubo_wallet_wasm_bg.wasm +0 -0
- package/pkg-cardano/bubo_wallet_wasm_bg.wasm.d.ts +2447 -0
- package/pkg-cardano/package.json +18 -0
|
@@ -0,0 +1,4367 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class Address {
|
|
5
|
+
private constructor();
|
|
6
|
+
free(): void;
|
|
7
|
+
[Symbol.dispose](): void;
|
|
8
|
+
static from_bech32(bech_str: string): Address;
|
|
9
|
+
static from_bytes(data: Uint8Array): Address;
|
|
10
|
+
static from_hex(hex_str: string): Address;
|
|
11
|
+
static from_json(json: string): Address;
|
|
12
|
+
is_malformed(): boolean;
|
|
13
|
+
kind(): AddressKind;
|
|
14
|
+
network_id(): number;
|
|
15
|
+
payment_cred(): Credential | undefined;
|
|
16
|
+
to_bech32(prefix?: string | null): string;
|
|
17
|
+
to_bytes(): Uint8Array;
|
|
18
|
+
to_hex(): string;
|
|
19
|
+
to_js_value(): any;
|
|
20
|
+
to_json(): string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum AddressKind {
|
|
24
|
+
Base = 0,
|
|
25
|
+
Pointer = 1,
|
|
26
|
+
Enterprise = 2,
|
|
27
|
+
Reward = 3,
|
|
28
|
+
Byron = 4,
|
|
29
|
+
Malformed = 5,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class Anchor {
|
|
33
|
+
private constructor();
|
|
34
|
+
free(): void;
|
|
35
|
+
[Symbol.dispose](): void;
|
|
36
|
+
anchor_data_hash(): AnchorDataHash;
|
|
37
|
+
static from_bytes(bytes: Uint8Array): Anchor;
|
|
38
|
+
static from_hex(hex_str: string): Anchor;
|
|
39
|
+
static from_json(json: string): Anchor;
|
|
40
|
+
static new(anchor_url: URL, anchor_data_hash: AnchorDataHash): Anchor;
|
|
41
|
+
to_bytes(): Uint8Array;
|
|
42
|
+
to_hex(): string;
|
|
43
|
+
to_js_value(): any;
|
|
44
|
+
to_json(): string;
|
|
45
|
+
url(): URL;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class AnchorDataHash {
|
|
49
|
+
private constructor();
|
|
50
|
+
free(): void;
|
|
51
|
+
[Symbol.dispose](): void;
|
|
52
|
+
static from_bech32(bech_str: string): AnchorDataHash;
|
|
53
|
+
static from_bytes(bytes: Uint8Array): AnchorDataHash;
|
|
54
|
+
static from_hex(hex: string): AnchorDataHash;
|
|
55
|
+
to_bech32(prefix: string): string;
|
|
56
|
+
to_bytes(): Uint8Array;
|
|
57
|
+
to_hex(): string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class AssetName {
|
|
61
|
+
private constructor();
|
|
62
|
+
free(): void;
|
|
63
|
+
[Symbol.dispose](): void;
|
|
64
|
+
static from_bytes(bytes: Uint8Array): AssetName;
|
|
65
|
+
static from_hex(hex_str: string): AssetName;
|
|
66
|
+
static from_json(json: string): AssetName;
|
|
67
|
+
name(): Uint8Array;
|
|
68
|
+
static new(name: Uint8Array): AssetName;
|
|
69
|
+
to_bytes(): Uint8Array;
|
|
70
|
+
to_hex(): string;
|
|
71
|
+
to_js_value(): any;
|
|
72
|
+
to_json(): string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class AssetNames {
|
|
76
|
+
private constructor();
|
|
77
|
+
free(): void;
|
|
78
|
+
[Symbol.dispose](): void;
|
|
79
|
+
add(elem: AssetName): void;
|
|
80
|
+
static from_bytes(bytes: Uint8Array): AssetNames;
|
|
81
|
+
static from_hex(hex_str: string): AssetNames;
|
|
82
|
+
static from_json(json: string): AssetNames;
|
|
83
|
+
get(index: number): AssetName;
|
|
84
|
+
len(): number;
|
|
85
|
+
static new(): AssetNames;
|
|
86
|
+
to_bytes(): Uint8Array;
|
|
87
|
+
to_hex(): string;
|
|
88
|
+
to_js_value(): any;
|
|
89
|
+
to_json(): string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export class Assets {
|
|
93
|
+
private constructor();
|
|
94
|
+
free(): void;
|
|
95
|
+
[Symbol.dispose](): void;
|
|
96
|
+
static from_bytes(bytes: Uint8Array): Assets;
|
|
97
|
+
static from_hex(hex_str: string): Assets;
|
|
98
|
+
static from_json(json: string): Assets;
|
|
99
|
+
get(key: AssetName): BigNum | undefined;
|
|
100
|
+
insert(key: AssetName, value: BigNum): BigNum | undefined;
|
|
101
|
+
keys(): AssetNames;
|
|
102
|
+
len(): number;
|
|
103
|
+
static new(): Assets;
|
|
104
|
+
to_bytes(): Uint8Array;
|
|
105
|
+
to_hex(): string;
|
|
106
|
+
to_js_value(): any;
|
|
107
|
+
to_json(): string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class AuxiliaryData {
|
|
111
|
+
private constructor();
|
|
112
|
+
free(): void;
|
|
113
|
+
[Symbol.dispose](): void;
|
|
114
|
+
static from_bytes(bytes: Uint8Array): AuxiliaryData;
|
|
115
|
+
static from_hex(hex_str: string): AuxiliaryData;
|
|
116
|
+
static from_json(json: string): AuxiliaryData;
|
|
117
|
+
metadata(): GeneralTransactionMetadata | undefined;
|
|
118
|
+
native_scripts(): NativeScripts | undefined;
|
|
119
|
+
static new(): AuxiliaryData;
|
|
120
|
+
plutus_scripts(): PlutusScripts | undefined;
|
|
121
|
+
prefer_alonzo_format(): boolean;
|
|
122
|
+
set_metadata(metadata: GeneralTransactionMetadata): void;
|
|
123
|
+
set_native_scripts(native_scripts: NativeScripts): void;
|
|
124
|
+
set_plutus_scripts(plutus_scripts: PlutusScripts): void;
|
|
125
|
+
set_prefer_alonzo_format(prefer: boolean): void;
|
|
126
|
+
to_bytes(): Uint8Array;
|
|
127
|
+
to_hex(): string;
|
|
128
|
+
to_js_value(): any;
|
|
129
|
+
to_json(): string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export class AuxiliaryDataHash {
|
|
133
|
+
private constructor();
|
|
134
|
+
free(): void;
|
|
135
|
+
[Symbol.dispose](): void;
|
|
136
|
+
static from_bech32(bech_str: string): AuxiliaryDataHash;
|
|
137
|
+
static from_bytes(bytes: Uint8Array): AuxiliaryDataHash;
|
|
138
|
+
static from_hex(hex: string): AuxiliaryDataHash;
|
|
139
|
+
to_bech32(prefix: string): string;
|
|
140
|
+
to_bytes(): Uint8Array;
|
|
141
|
+
to_hex(): string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export class AuxiliaryDataSet {
|
|
145
|
+
private constructor();
|
|
146
|
+
free(): void;
|
|
147
|
+
[Symbol.dispose](): void;
|
|
148
|
+
get(tx_index: number): AuxiliaryData | undefined;
|
|
149
|
+
indices(): Uint32Array;
|
|
150
|
+
insert(tx_index: number, data: AuxiliaryData): AuxiliaryData | undefined;
|
|
151
|
+
len(): number;
|
|
152
|
+
static new(): AuxiliaryDataSet;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export class BaseAddress {
|
|
156
|
+
private constructor();
|
|
157
|
+
free(): void;
|
|
158
|
+
[Symbol.dispose](): void;
|
|
159
|
+
static from_address(addr: Address): BaseAddress | undefined;
|
|
160
|
+
network_id(): number;
|
|
161
|
+
static new(network: number, payment: Credential, stake: Credential): BaseAddress;
|
|
162
|
+
payment_cred(): Credential;
|
|
163
|
+
stake_cred(): Credential;
|
|
164
|
+
to_address(): Address;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export class BigInt {
|
|
168
|
+
private constructor();
|
|
169
|
+
free(): void;
|
|
170
|
+
[Symbol.dispose](): void;
|
|
171
|
+
abs(): BigInt;
|
|
172
|
+
add(other: BigInt): BigInt;
|
|
173
|
+
as_int(): Int | undefined;
|
|
174
|
+
as_u64(): BigNum | undefined;
|
|
175
|
+
div_ceil(other: BigInt): BigInt;
|
|
176
|
+
div_floor(other: BigInt): BigInt;
|
|
177
|
+
static from_bytes(bytes: Uint8Array): BigInt;
|
|
178
|
+
static from_hex(hex_str: string): BigInt;
|
|
179
|
+
static from_json(json: string): BigInt;
|
|
180
|
+
static from_str(text: string): BigInt;
|
|
181
|
+
increment(): BigInt;
|
|
182
|
+
is_zero(): boolean;
|
|
183
|
+
mul(other: BigInt): BigInt;
|
|
184
|
+
static one(): BigInt;
|
|
185
|
+
pow(exp: number): BigInt;
|
|
186
|
+
sub(other: BigInt): BigInt;
|
|
187
|
+
to_bytes(): Uint8Array;
|
|
188
|
+
to_hex(): string;
|
|
189
|
+
to_js_value(): any;
|
|
190
|
+
to_json(): string;
|
|
191
|
+
to_str(): string;
|
|
192
|
+
static zero(): BigInt;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export class BigNum {
|
|
196
|
+
private constructor();
|
|
197
|
+
free(): void;
|
|
198
|
+
[Symbol.dispose](): void;
|
|
199
|
+
checked_add(other: BigNum): BigNum;
|
|
200
|
+
checked_mul(other: BigNum): BigNum;
|
|
201
|
+
checked_sub(other: BigNum): BigNum;
|
|
202
|
+
/**
|
|
203
|
+
* returns 0 if it would otherwise underflow
|
|
204
|
+
*/
|
|
205
|
+
clamped_sub(other: BigNum): BigNum;
|
|
206
|
+
compare(rhs_value: BigNum): number;
|
|
207
|
+
div_floor(other: BigNum): BigNum;
|
|
208
|
+
static from_bytes(bytes: Uint8Array): BigNum;
|
|
209
|
+
static from_hex(hex_str: string): BigNum;
|
|
210
|
+
static from_json(json: string): BigNum;
|
|
211
|
+
static from_str(string: string): BigNum;
|
|
212
|
+
is_zero(): boolean;
|
|
213
|
+
less_than(rhs_value: BigNum): boolean;
|
|
214
|
+
static max(a: BigNum, b: BigNum): BigNum;
|
|
215
|
+
static max_value(): BigNum;
|
|
216
|
+
static one(): BigNum;
|
|
217
|
+
to_bytes(): Uint8Array;
|
|
218
|
+
to_hex(): string;
|
|
219
|
+
to_js_value(): any;
|
|
220
|
+
to_json(): string;
|
|
221
|
+
to_str(): string;
|
|
222
|
+
static zero(): BigNum;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export class Bip32PrivateKey {
|
|
226
|
+
private constructor();
|
|
227
|
+
free(): void;
|
|
228
|
+
[Symbol.dispose](): void;
|
|
229
|
+
as_bytes(): Uint8Array;
|
|
230
|
+
chaincode(): Uint8Array;
|
|
231
|
+
/**
|
|
232
|
+
* derive this private key with the given index.
|
|
233
|
+
*
|
|
234
|
+
* # Security considerations
|
|
235
|
+
*
|
|
236
|
+
* * hard derivation index cannot be soft derived with the public key
|
|
237
|
+
*
|
|
238
|
+
* # Hard derivation vs Soft derivation
|
|
239
|
+
*
|
|
240
|
+
* If you pass an index below 0x80000000 then it is a soft derivation.
|
|
241
|
+
* The advantage of soft derivation is that it is possible to derive the
|
|
242
|
+
* public key too. I.e. derivation the private key with a soft derivation
|
|
243
|
+
* index and then retrieving the associated public key is equivalent to
|
|
244
|
+
* deriving the public key associated to the parent private key.
|
|
245
|
+
*
|
|
246
|
+
* Hard derivation index does not allow public key derivation.
|
|
247
|
+
*
|
|
248
|
+
* This is why deriving the private key should not fail while deriving
|
|
249
|
+
* the public key may fail (if the derivation index is invalid).
|
|
250
|
+
*/
|
|
251
|
+
derive(index: number): Bip32PrivateKey;
|
|
252
|
+
/**
|
|
253
|
+
* 128-byte xprv a key format in Cardano that some software still uses or requires
|
|
254
|
+
* the traditional 96-byte xprv is simply encoded as
|
|
255
|
+
* prv | chaincode
|
|
256
|
+
* however, because some software may not know how to compute a public key from a private key,
|
|
257
|
+
* the 128-byte inlines the public key in the following format
|
|
258
|
+
* prv | pub | chaincode
|
|
259
|
+
* so be careful if you see the term "xprv" as it could refer to either one
|
|
260
|
+
* our library does not require the pub (instead we compute the pub key when needed)
|
|
261
|
+
*/
|
|
262
|
+
static from_128_xprv(bytes: Uint8Array): Bip32PrivateKey;
|
|
263
|
+
static from_bech32(bech32_str: string): Bip32PrivateKey;
|
|
264
|
+
static from_bip39_entropy(entropy: Uint8Array, password: Uint8Array): Bip32PrivateKey;
|
|
265
|
+
static from_bytes(bytes: Uint8Array): Bip32PrivateKey;
|
|
266
|
+
static from_hex(hex_str: string): Bip32PrivateKey;
|
|
267
|
+
static generate_ed25519_bip32(): Bip32PrivateKey;
|
|
268
|
+
/**
|
|
269
|
+
* see from_128_xprv
|
|
270
|
+
*/
|
|
271
|
+
to_128_xprv(): Uint8Array;
|
|
272
|
+
to_bech32(): string;
|
|
273
|
+
to_hex(): string;
|
|
274
|
+
to_public(): Bip32PublicKey;
|
|
275
|
+
to_raw_key(): PrivateKey;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export class Bip32PublicKey {
|
|
279
|
+
private constructor();
|
|
280
|
+
free(): void;
|
|
281
|
+
[Symbol.dispose](): void;
|
|
282
|
+
as_bytes(): Uint8Array;
|
|
283
|
+
chaincode(): Uint8Array;
|
|
284
|
+
/**
|
|
285
|
+
* derive this public key with the given index.
|
|
286
|
+
*
|
|
287
|
+
* # Errors
|
|
288
|
+
*
|
|
289
|
+
* If the index is not a soft derivation index (< 0x80000000) then
|
|
290
|
+
* calling this method will fail.
|
|
291
|
+
*
|
|
292
|
+
* # Security considerations
|
|
293
|
+
*
|
|
294
|
+
* * hard derivation index cannot be soft derived with the public key
|
|
295
|
+
*
|
|
296
|
+
* # Hard derivation vs Soft derivation
|
|
297
|
+
*
|
|
298
|
+
* If you pass an index below 0x80000000 then it is a soft derivation.
|
|
299
|
+
* The advantage of soft derivation is that it is possible to derive the
|
|
300
|
+
* public key too. I.e. derivation the private key with a soft derivation
|
|
301
|
+
* index and then retrieving the associated public key is equivalent to
|
|
302
|
+
* deriving the public key associated to the parent private key.
|
|
303
|
+
*
|
|
304
|
+
* Hard derivation index does not allow public key derivation.
|
|
305
|
+
*
|
|
306
|
+
* This is why deriving the private key should not fail while deriving
|
|
307
|
+
* the public key may fail (if the derivation index is invalid).
|
|
308
|
+
*/
|
|
309
|
+
derive(index: number): Bip32PublicKey;
|
|
310
|
+
static from_bech32(bech32_str: string): Bip32PublicKey;
|
|
311
|
+
static from_bytes(bytes: Uint8Array): Bip32PublicKey;
|
|
312
|
+
static from_hex(hex_str: string): Bip32PublicKey;
|
|
313
|
+
to_bech32(): string;
|
|
314
|
+
to_hex(): string;
|
|
315
|
+
to_raw_key(): PublicKey;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export class Block {
|
|
319
|
+
private constructor();
|
|
320
|
+
free(): void;
|
|
321
|
+
[Symbol.dispose](): void;
|
|
322
|
+
auxiliary_data_set(): AuxiliaryDataSet;
|
|
323
|
+
static from_bytes(bytes: Uint8Array): Block;
|
|
324
|
+
static from_hex(hex_str: string): Block;
|
|
325
|
+
static from_json(json: string): Block;
|
|
326
|
+
header(): Header;
|
|
327
|
+
invalid_transactions(): Uint32Array;
|
|
328
|
+
static new(header: Header, transaction_bodies: TransactionBodies, transaction_witness_sets: TransactionWitnessSets, auxiliary_data_set: AuxiliaryDataSet, invalid_transactions: Uint32Array): Block;
|
|
329
|
+
to_bytes(): Uint8Array;
|
|
330
|
+
to_hex(): string;
|
|
331
|
+
to_js_value(): any;
|
|
332
|
+
to_json(): string;
|
|
333
|
+
transaction_bodies(): TransactionBodies;
|
|
334
|
+
transaction_witness_sets(): TransactionWitnessSets;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export enum BlockEra {
|
|
338
|
+
Byron = 0,
|
|
339
|
+
Shelley = 1,
|
|
340
|
+
Allegra = 2,
|
|
341
|
+
Mary = 3,
|
|
342
|
+
Alonzo = 4,
|
|
343
|
+
Babbage = 5,
|
|
344
|
+
Conway = 6,
|
|
345
|
+
Unknown = 7,
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export class BlockHash {
|
|
349
|
+
private constructor();
|
|
350
|
+
free(): void;
|
|
351
|
+
[Symbol.dispose](): void;
|
|
352
|
+
static from_bech32(bech_str: string): BlockHash;
|
|
353
|
+
static from_bytes(bytes: Uint8Array): BlockHash;
|
|
354
|
+
static from_hex(hex: string): BlockHash;
|
|
355
|
+
to_bech32(prefix: string): string;
|
|
356
|
+
to_bytes(): Uint8Array;
|
|
357
|
+
to_hex(): string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export class BootstrapWitness {
|
|
361
|
+
private constructor();
|
|
362
|
+
free(): void;
|
|
363
|
+
[Symbol.dispose](): void;
|
|
364
|
+
attributes(): Uint8Array;
|
|
365
|
+
chain_code(): Uint8Array;
|
|
366
|
+
static from_bytes(bytes: Uint8Array): BootstrapWitness;
|
|
367
|
+
static from_hex(hex_str: string): BootstrapWitness;
|
|
368
|
+
static from_json(json: string): BootstrapWitness;
|
|
369
|
+
static new(vkey: Vkey, signature: Ed25519Signature, chain_code: Uint8Array, attributes: Uint8Array): BootstrapWitness;
|
|
370
|
+
signature(): Ed25519Signature;
|
|
371
|
+
to_bytes(): Uint8Array;
|
|
372
|
+
to_hex(): string;
|
|
373
|
+
to_js_value(): any;
|
|
374
|
+
to_json(): string;
|
|
375
|
+
vkey(): Vkey;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export class BootstrapWitnesses {
|
|
379
|
+
private constructor();
|
|
380
|
+
free(): void;
|
|
381
|
+
[Symbol.dispose](): void;
|
|
382
|
+
/**
|
|
383
|
+
* Add a new `BootstrapWitness` to the set.
|
|
384
|
+
* Returns `true` if the element was not already present in the set.
|
|
385
|
+
*/
|
|
386
|
+
add(witness: BootstrapWitness): boolean;
|
|
387
|
+
static from_bytes(bytes: Uint8Array): BootstrapWitnesses;
|
|
388
|
+
static from_hex(hex_str: string): BootstrapWitnesses;
|
|
389
|
+
static from_json(json: string): BootstrapWitnesses;
|
|
390
|
+
get(index: number): BootstrapWitness;
|
|
391
|
+
len(): number;
|
|
392
|
+
static new(): BootstrapWitnesses;
|
|
393
|
+
to_bytes(): Uint8Array;
|
|
394
|
+
to_hex(): string;
|
|
395
|
+
to_js_value(): any;
|
|
396
|
+
to_json(): string;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export class ByronAddress {
|
|
400
|
+
private constructor();
|
|
401
|
+
free(): void;
|
|
402
|
+
[Symbol.dispose](): void;
|
|
403
|
+
attributes(): Uint8Array;
|
|
404
|
+
byron_address_kind(): ByronAddressType;
|
|
405
|
+
/**
|
|
406
|
+
* returns the byron protocol magic embedded in the address, or mainnet id if none is present
|
|
407
|
+
* note: for bech32 addresses, you need to use network_id instead
|
|
408
|
+
*/
|
|
409
|
+
byron_protocol_magic(): number;
|
|
410
|
+
static from_address(addr: Address): ByronAddress | undefined;
|
|
411
|
+
static from_base58(s: string): ByronAddress;
|
|
412
|
+
static from_bytes(bytes: Uint8Array): ByronAddress;
|
|
413
|
+
static icarus_from_key(key: Bip32PublicKey, protocol_magic: number): ByronAddress;
|
|
414
|
+
static is_valid(s: string): boolean;
|
|
415
|
+
network_id(): number;
|
|
416
|
+
to_address(): Address;
|
|
417
|
+
to_base58(): string;
|
|
418
|
+
to_bytes(): Uint8Array;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export enum ByronAddressType {
|
|
422
|
+
ATPubKey = 0,
|
|
423
|
+
ATScript = 1,
|
|
424
|
+
ATRedeem = 2,
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export enum CborContainerType {
|
|
428
|
+
Array = 0,
|
|
429
|
+
Map = 1,
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export enum CborSetType {
|
|
433
|
+
Tagged = 0,
|
|
434
|
+
Untagged = 1,
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export class Certificate {
|
|
438
|
+
private constructor();
|
|
439
|
+
free(): void;
|
|
440
|
+
[Symbol.dispose](): void;
|
|
441
|
+
as_committee_cold_resign(): CommitteeColdResign | undefined;
|
|
442
|
+
as_committee_hot_auth(): CommitteeHotAuth | undefined;
|
|
443
|
+
as_drep_deregistration(): DRepDeregistration | undefined;
|
|
444
|
+
as_drep_registration(): DRepRegistration | undefined;
|
|
445
|
+
as_drep_update(): DRepUpdate | undefined;
|
|
446
|
+
as_genesis_key_delegation(): GenesisKeyDelegation | undefined;
|
|
447
|
+
as_move_instantaneous_rewards_cert(): MoveInstantaneousRewardsCert | undefined;
|
|
448
|
+
as_pool_registration(): PoolRegistration | undefined;
|
|
449
|
+
as_pool_retirement(): PoolRetirement | undefined;
|
|
450
|
+
/**
|
|
451
|
+
* Since StakeRegistration can represent stake_registration certificate or reg_cert certificate, because both certificates have the same semantics.
|
|
452
|
+
* And in some cases you want to get a reg_cert, this function is used to get a reg_cert.
|
|
453
|
+
* The function will return None if StakeRegistration represents a stake_registration certificate or Certificate is not a StakeRegistration.
|
|
454
|
+
*/
|
|
455
|
+
as_reg_cert(): StakeRegistration | undefined;
|
|
456
|
+
as_stake_and_vote_delegation(): StakeAndVoteDelegation | undefined;
|
|
457
|
+
as_stake_delegation(): StakeDelegation | undefined;
|
|
458
|
+
as_stake_deregistration(): StakeDeregistration | undefined;
|
|
459
|
+
as_stake_registration(): StakeRegistration | undefined;
|
|
460
|
+
as_stake_registration_and_delegation(): StakeRegistrationAndDelegation | undefined;
|
|
461
|
+
as_stake_vote_registration_and_delegation(): StakeVoteRegistrationAndDelegation | undefined;
|
|
462
|
+
/**
|
|
463
|
+
* Since StakeDeregistration can represent stake_deregistration certificate or unreg_cert certificate, because both certificates have the same semantics.
|
|
464
|
+
* And in some cases you want to get an unreg_cert, this function is used to get an unreg_cert.
|
|
465
|
+
* The function will return None if StakeDeregistration represents a stake_deregistration certificate or Certificate is not a StakeDeregistration.
|
|
466
|
+
*/
|
|
467
|
+
as_unreg_cert(): StakeDeregistration | undefined;
|
|
468
|
+
as_vote_delegation(): VoteDelegation | undefined;
|
|
469
|
+
as_vote_registration_and_delegation(): VoteRegistrationAndDelegation | undefined;
|
|
470
|
+
static from_bytes(bytes: Uint8Array): Certificate;
|
|
471
|
+
static from_hex(hex_str: string): Certificate;
|
|
472
|
+
static from_json(json: string): Certificate;
|
|
473
|
+
has_required_script_witness(): boolean;
|
|
474
|
+
kind(): CertificateKind;
|
|
475
|
+
static new_committee_cold_resign(committee_cold_resign: CommitteeColdResign): Certificate;
|
|
476
|
+
static new_committee_hot_auth(committee_hot_auth: CommitteeHotAuth): Certificate;
|
|
477
|
+
static new_drep_deregistration(drep_deregistration: DRepDeregistration): Certificate;
|
|
478
|
+
static new_drep_registration(drep_registration: DRepRegistration): Certificate;
|
|
479
|
+
static new_drep_update(drep_update: DRepUpdate): Certificate;
|
|
480
|
+
static new_genesis_key_delegation(genesis_key_delegation: GenesisKeyDelegation): Certificate;
|
|
481
|
+
static new_move_instantaneous_rewards_cert(move_instantaneous_rewards_cert: MoveInstantaneousRewardsCert): Certificate;
|
|
482
|
+
static new_pool_registration(pool_registration: PoolRegistration): Certificate;
|
|
483
|
+
static new_pool_retirement(pool_retirement: PoolRetirement): Certificate;
|
|
484
|
+
/**
|
|
485
|
+
* Since StakeRegistration can represent stake_registration certificate or reg_cert certificate, because both certificates have the same semantics.
|
|
486
|
+
* And in some cases you want to create a reg_cert, this function is used to create a reg_cert.
|
|
487
|
+
* The function will return an error if StakeRegistration represents a stake_registration certificate.
|
|
488
|
+
*/
|
|
489
|
+
static new_reg_cert(stake_registration: StakeRegistration): Certificate;
|
|
490
|
+
static new_stake_and_vote_delegation(stake_and_vote_delegation: StakeAndVoteDelegation): Certificate;
|
|
491
|
+
static new_stake_delegation(stake_delegation: StakeDelegation): Certificate;
|
|
492
|
+
static new_stake_deregistration(stake_deregistration: StakeDeregistration): Certificate;
|
|
493
|
+
static new_stake_registration(stake_registration: StakeRegistration): Certificate;
|
|
494
|
+
static new_stake_registration_and_delegation(stake_registration_and_delegation: StakeRegistrationAndDelegation): Certificate;
|
|
495
|
+
static new_stake_vote_registration_and_delegation(stake_vote_registration_and_delegation: StakeVoteRegistrationAndDelegation): Certificate;
|
|
496
|
+
/**
|
|
497
|
+
* Since StakeDeregistration can represent stake_deregistration certificate or unreg_cert certificate, because both certificates have the same semantics.
|
|
498
|
+
* And in some cases you want to create an unreg_cert, this function is used to create an unreg_cert.
|
|
499
|
+
* The function will return an error if StakeDeregistration represents a stake_deregistration certificate.
|
|
500
|
+
*/
|
|
501
|
+
static new_unreg_cert(stake_deregistration: StakeDeregistration): Certificate;
|
|
502
|
+
static new_vote_delegation(vote_delegation: VoteDelegation): Certificate;
|
|
503
|
+
static new_vote_registration_and_delegation(vote_registration_and_delegation: VoteRegistrationAndDelegation): Certificate;
|
|
504
|
+
to_bytes(): Uint8Array;
|
|
505
|
+
to_hex(): string;
|
|
506
|
+
to_js_value(): any;
|
|
507
|
+
to_json(): string;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export enum CertificateKind {
|
|
511
|
+
StakeRegistration = 0,
|
|
512
|
+
StakeDeregistration = 1,
|
|
513
|
+
StakeDelegation = 2,
|
|
514
|
+
PoolRegistration = 3,
|
|
515
|
+
PoolRetirement = 4,
|
|
516
|
+
GenesisKeyDelegation = 5,
|
|
517
|
+
MoveInstantaneousRewardsCert = 6,
|
|
518
|
+
CommitteeHotAuth = 7,
|
|
519
|
+
CommitteeColdResign = 8,
|
|
520
|
+
DRepDeregistration = 9,
|
|
521
|
+
DRepRegistration = 10,
|
|
522
|
+
DRepUpdate = 11,
|
|
523
|
+
StakeAndVoteDelegation = 12,
|
|
524
|
+
StakeRegistrationAndDelegation = 13,
|
|
525
|
+
StakeVoteRegistrationAndDelegation = 14,
|
|
526
|
+
VoteDelegation = 15,
|
|
527
|
+
VoteRegistrationAndDelegation = 16,
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
export class Certificates {
|
|
531
|
+
private constructor();
|
|
532
|
+
free(): void;
|
|
533
|
+
[Symbol.dispose](): void;
|
|
534
|
+
/**
|
|
535
|
+
* Add a new `Certificate` to the set.
|
|
536
|
+
* Returns `true` if the element was not already present in the set.
|
|
537
|
+
*/
|
|
538
|
+
add(elem: Certificate): boolean;
|
|
539
|
+
static from_bytes(bytes: Uint8Array): Certificates;
|
|
540
|
+
static from_hex(hex_str: string): Certificates;
|
|
541
|
+
static from_json(json: string): Certificates;
|
|
542
|
+
get(index: number): Certificate;
|
|
543
|
+
len(): number;
|
|
544
|
+
static new(): Certificates;
|
|
545
|
+
to_bytes(): Uint8Array;
|
|
546
|
+
to_hex(): string;
|
|
547
|
+
to_js_value(): any;
|
|
548
|
+
to_json(): string;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export class CertificatesBuilder {
|
|
552
|
+
private constructor();
|
|
553
|
+
free(): void;
|
|
554
|
+
[Symbol.dispose](): void;
|
|
555
|
+
add(cert: Certificate): void;
|
|
556
|
+
add_with_native_script(cert: Certificate, native_script_source: NativeScriptSource): void;
|
|
557
|
+
add_with_plutus_witness(cert: Certificate, witness: PlutusWitness): void;
|
|
558
|
+
build(): Certificates;
|
|
559
|
+
get_certificates_deposit(pool_deposit: BigNum, key_deposit: BigNum): BigNum;
|
|
560
|
+
get_certificates_refund(pool_deposit: BigNum, key_deposit: BigNum): Value;
|
|
561
|
+
get_native_scripts(): NativeScripts;
|
|
562
|
+
get_plutus_witnesses(): PlutusWitnesses;
|
|
563
|
+
get_ref_inputs(): TransactionInputs;
|
|
564
|
+
has_plutus_scripts(): boolean;
|
|
565
|
+
static new(): CertificatesBuilder;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export class ChangeConfig {
|
|
569
|
+
private constructor();
|
|
570
|
+
free(): void;
|
|
571
|
+
[Symbol.dispose](): void;
|
|
572
|
+
change_address(address: Address): ChangeConfig;
|
|
573
|
+
change_plutus_data(plutus_data: OutputDatum): ChangeConfig;
|
|
574
|
+
change_script_ref(script_ref: ScriptRef): ChangeConfig;
|
|
575
|
+
static new(address: Address): ChangeConfig;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export enum CoinSelectionStrategyCIP2 {
|
|
579
|
+
/**
|
|
580
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
581
|
+
*/
|
|
582
|
+
LargestFirst = 0,
|
|
583
|
+
/**
|
|
584
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
585
|
+
*/
|
|
586
|
+
RandomImprove = 1,
|
|
587
|
+
/**
|
|
588
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
589
|
+
*/
|
|
590
|
+
LargestFirstMultiAsset = 2,
|
|
591
|
+
/**
|
|
592
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
593
|
+
*/
|
|
594
|
+
RandomImproveMultiAsset = 3,
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export class Committee {
|
|
598
|
+
private constructor();
|
|
599
|
+
free(): void;
|
|
600
|
+
[Symbol.dispose](): void;
|
|
601
|
+
add_member(committee_cold_credential: Credential, epoch: number): void;
|
|
602
|
+
static from_bytes(bytes: Uint8Array): Committee;
|
|
603
|
+
static from_hex(hex_str: string): Committee;
|
|
604
|
+
static from_json(json: string): Committee;
|
|
605
|
+
get_member_epoch(committee_cold_credential: Credential): number | undefined;
|
|
606
|
+
members_keys(): Credentials;
|
|
607
|
+
static new(quorum_threshold: UnitInterval): Committee;
|
|
608
|
+
quorum_threshold(): UnitInterval;
|
|
609
|
+
to_bytes(): Uint8Array;
|
|
610
|
+
to_hex(): string;
|
|
611
|
+
to_js_value(): any;
|
|
612
|
+
to_json(): string;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export class CommitteeColdResign {
|
|
616
|
+
private constructor();
|
|
617
|
+
free(): void;
|
|
618
|
+
[Symbol.dispose](): void;
|
|
619
|
+
anchor(): Anchor | undefined;
|
|
620
|
+
committee_cold_credential(): Credential;
|
|
621
|
+
static from_bytes(bytes: Uint8Array): CommitteeColdResign;
|
|
622
|
+
static from_hex(hex_str: string): CommitteeColdResign;
|
|
623
|
+
static from_json(json: string): CommitteeColdResign;
|
|
624
|
+
has_script_credentials(): boolean;
|
|
625
|
+
static new(committee_cold_credential: Credential): CommitteeColdResign;
|
|
626
|
+
static new_with_anchor(committee_cold_credential: Credential, anchor: Anchor): CommitteeColdResign;
|
|
627
|
+
to_bytes(): Uint8Array;
|
|
628
|
+
to_hex(): string;
|
|
629
|
+
to_js_value(): any;
|
|
630
|
+
to_json(): string;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export class CommitteeHotAuth {
|
|
634
|
+
private constructor();
|
|
635
|
+
free(): void;
|
|
636
|
+
[Symbol.dispose](): void;
|
|
637
|
+
committee_cold_credential(): Credential;
|
|
638
|
+
committee_hot_credential(): Credential;
|
|
639
|
+
static from_bytes(bytes: Uint8Array): CommitteeHotAuth;
|
|
640
|
+
static from_hex(hex_str: string): CommitteeHotAuth;
|
|
641
|
+
static from_json(json: string): CommitteeHotAuth;
|
|
642
|
+
has_script_credentials(): boolean;
|
|
643
|
+
static new(committee_cold_credential: Credential, committee_hot_credential: Credential): CommitteeHotAuth;
|
|
644
|
+
to_bytes(): Uint8Array;
|
|
645
|
+
to_hex(): string;
|
|
646
|
+
to_js_value(): any;
|
|
647
|
+
to_json(): string;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
export class Constitution {
|
|
651
|
+
private constructor();
|
|
652
|
+
free(): void;
|
|
653
|
+
[Symbol.dispose](): void;
|
|
654
|
+
anchor(): Anchor;
|
|
655
|
+
static from_bytes(bytes: Uint8Array): Constitution;
|
|
656
|
+
static from_hex(hex_str: string): Constitution;
|
|
657
|
+
static from_json(json: string): Constitution;
|
|
658
|
+
static new(anchor: Anchor): Constitution;
|
|
659
|
+
static new_with_script_hash(anchor: Anchor, script_hash: ScriptHash): Constitution;
|
|
660
|
+
script_hash(): ScriptHash | undefined;
|
|
661
|
+
to_bytes(): Uint8Array;
|
|
662
|
+
to_hex(): string;
|
|
663
|
+
to_js_value(): any;
|
|
664
|
+
to_json(): string;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
export class ConstrPlutusData {
|
|
668
|
+
private constructor();
|
|
669
|
+
free(): void;
|
|
670
|
+
[Symbol.dispose](): void;
|
|
671
|
+
alternative(): BigNum;
|
|
672
|
+
data(): PlutusList;
|
|
673
|
+
static from_bytes(bytes: Uint8Array): ConstrPlutusData;
|
|
674
|
+
static from_hex(hex_str: string): ConstrPlutusData;
|
|
675
|
+
static new(alternative: BigNum, data: PlutusList): ConstrPlutusData;
|
|
676
|
+
to_bytes(): Uint8Array;
|
|
677
|
+
to_hex(): string;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export class CostModel {
|
|
681
|
+
private constructor();
|
|
682
|
+
free(): void;
|
|
683
|
+
[Symbol.dispose](): void;
|
|
684
|
+
static from_bytes(bytes: Uint8Array): CostModel;
|
|
685
|
+
static from_hex(hex_str: string): CostModel;
|
|
686
|
+
static from_json(json: string): CostModel;
|
|
687
|
+
get(operation: number): Int;
|
|
688
|
+
len(): number;
|
|
689
|
+
/**
|
|
690
|
+
* Creates a new CostModels instance of an unrestricted length
|
|
691
|
+
*/
|
|
692
|
+
static new(): CostModel;
|
|
693
|
+
/**
|
|
694
|
+
* Sets the cost at the specified index to the specified value.
|
|
695
|
+
* In case the operation index is larger than the previous largest used index,
|
|
696
|
+
* it will fill any inbetween indexes with zeroes
|
|
697
|
+
*/
|
|
698
|
+
set(operation: number, cost: Int): Int;
|
|
699
|
+
to_bytes(): Uint8Array;
|
|
700
|
+
to_hex(): string;
|
|
701
|
+
to_js_value(): any;
|
|
702
|
+
to_json(): string;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
export class Costmdls {
|
|
706
|
+
private constructor();
|
|
707
|
+
free(): void;
|
|
708
|
+
[Symbol.dispose](): void;
|
|
709
|
+
static from_bytes(bytes: Uint8Array): Costmdls;
|
|
710
|
+
static from_hex(hex_str: string): Costmdls;
|
|
711
|
+
static from_json(json: string): Costmdls;
|
|
712
|
+
get(key: Language): CostModel | undefined;
|
|
713
|
+
insert(key: Language, value: CostModel): CostModel | undefined;
|
|
714
|
+
keys(): Languages;
|
|
715
|
+
len(): number;
|
|
716
|
+
static new(): Costmdls;
|
|
717
|
+
retain_language_versions(languages: Languages): Costmdls;
|
|
718
|
+
to_bytes(): Uint8Array;
|
|
719
|
+
to_hex(): string;
|
|
720
|
+
to_js_value(): any;
|
|
721
|
+
to_json(): string;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export enum CredKind {
|
|
725
|
+
Key = 0,
|
|
726
|
+
Script = 1,
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
export class Credential {
|
|
730
|
+
private constructor();
|
|
731
|
+
free(): void;
|
|
732
|
+
[Symbol.dispose](): void;
|
|
733
|
+
static from_bytes(bytes: Uint8Array): Credential;
|
|
734
|
+
static from_hex(hex_str: string): Credential;
|
|
735
|
+
static from_json(json: string): Credential;
|
|
736
|
+
static from_keyhash(hash: Ed25519KeyHash): Credential;
|
|
737
|
+
static from_scripthash(hash: ScriptHash): Credential;
|
|
738
|
+
has_script_hash(): boolean;
|
|
739
|
+
kind(): CredKind;
|
|
740
|
+
to_bytes(): Uint8Array;
|
|
741
|
+
to_hex(): string;
|
|
742
|
+
to_js_value(): any;
|
|
743
|
+
to_json(): string;
|
|
744
|
+
to_keyhash(): Ed25519KeyHash | undefined;
|
|
745
|
+
to_scripthash(): ScriptHash | undefined;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export class Credentials {
|
|
749
|
+
private constructor();
|
|
750
|
+
free(): void;
|
|
751
|
+
[Symbol.dispose](): void;
|
|
752
|
+
/**
|
|
753
|
+
* Add a new `Credential` to the set.
|
|
754
|
+
* Returns `true` if the element was not already present in the set.
|
|
755
|
+
*/
|
|
756
|
+
add(credential: Credential): boolean;
|
|
757
|
+
static from_bytes(bytes: Uint8Array): Credentials;
|
|
758
|
+
static from_hex(hex_str: string): Credentials;
|
|
759
|
+
static from_json(json: string): Credentials;
|
|
760
|
+
get(index: number): Credential;
|
|
761
|
+
len(): number;
|
|
762
|
+
static new(): Credentials;
|
|
763
|
+
to_bytes(): Uint8Array;
|
|
764
|
+
to_hex(): string;
|
|
765
|
+
to_js_value(): any;
|
|
766
|
+
to_json(): string;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
export class DNSRecordAorAAAA {
|
|
770
|
+
private constructor();
|
|
771
|
+
free(): void;
|
|
772
|
+
[Symbol.dispose](): void;
|
|
773
|
+
static from_bytes(bytes: Uint8Array): DNSRecordAorAAAA;
|
|
774
|
+
static from_hex(hex_str: string): DNSRecordAorAAAA;
|
|
775
|
+
static from_json(json: string): DNSRecordAorAAAA;
|
|
776
|
+
static new(dns_name: string): DNSRecordAorAAAA;
|
|
777
|
+
record(): string;
|
|
778
|
+
to_bytes(): Uint8Array;
|
|
779
|
+
to_hex(): string;
|
|
780
|
+
to_js_value(): any;
|
|
781
|
+
to_json(): string;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export class DNSRecordSRV {
|
|
785
|
+
private constructor();
|
|
786
|
+
free(): void;
|
|
787
|
+
[Symbol.dispose](): void;
|
|
788
|
+
static from_bytes(bytes: Uint8Array): DNSRecordSRV;
|
|
789
|
+
static from_hex(hex_str: string): DNSRecordSRV;
|
|
790
|
+
static from_json(json: string): DNSRecordSRV;
|
|
791
|
+
static new(dns_name: string): DNSRecordSRV;
|
|
792
|
+
record(): string;
|
|
793
|
+
to_bytes(): Uint8Array;
|
|
794
|
+
to_hex(): string;
|
|
795
|
+
to_js_value(): any;
|
|
796
|
+
to_json(): string;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export class DRep {
|
|
800
|
+
private constructor();
|
|
801
|
+
free(): void;
|
|
802
|
+
[Symbol.dispose](): void;
|
|
803
|
+
static from_bech32(bech32_str: string): DRep;
|
|
804
|
+
static from_bytes(bytes: Uint8Array): DRep;
|
|
805
|
+
static from_hex(hex_str: string): DRep;
|
|
806
|
+
static from_json(json: string): DRep;
|
|
807
|
+
kind(): DRepKind;
|
|
808
|
+
static new_always_abstain(): DRep;
|
|
809
|
+
static new_always_no_confidence(): DRep;
|
|
810
|
+
static new_from_credential(cred: Credential): DRep;
|
|
811
|
+
static new_key_hash(key_hash: Ed25519KeyHash): DRep;
|
|
812
|
+
static new_script_hash(script_hash: ScriptHash): DRep;
|
|
813
|
+
to_bech32(cip_129_format: boolean): string;
|
|
814
|
+
to_bytes(): Uint8Array;
|
|
815
|
+
to_hex(): string;
|
|
816
|
+
to_js_value(): any;
|
|
817
|
+
to_json(): string;
|
|
818
|
+
to_key_hash(): Ed25519KeyHash | undefined;
|
|
819
|
+
to_script_hash(): ScriptHash | undefined;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
export class DRepDeregistration {
|
|
823
|
+
private constructor();
|
|
824
|
+
free(): void;
|
|
825
|
+
[Symbol.dispose](): void;
|
|
826
|
+
coin(): BigNum;
|
|
827
|
+
static from_bytes(bytes: Uint8Array): DRepDeregistration;
|
|
828
|
+
static from_hex(hex_str: string): DRepDeregistration;
|
|
829
|
+
static from_json(json: string): DRepDeregistration;
|
|
830
|
+
has_script_credentials(): boolean;
|
|
831
|
+
static new(voting_credential: Credential, coin: BigNum): DRepDeregistration;
|
|
832
|
+
to_bytes(): Uint8Array;
|
|
833
|
+
to_hex(): string;
|
|
834
|
+
to_js_value(): any;
|
|
835
|
+
to_json(): string;
|
|
836
|
+
voting_credential(): Credential;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
export enum DRepKind {
|
|
840
|
+
KeyHash = 0,
|
|
841
|
+
ScriptHash = 1,
|
|
842
|
+
AlwaysAbstain = 2,
|
|
843
|
+
AlwaysNoConfidence = 3,
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export class DRepRegistration {
|
|
847
|
+
private constructor();
|
|
848
|
+
free(): void;
|
|
849
|
+
[Symbol.dispose](): void;
|
|
850
|
+
anchor(): Anchor | undefined;
|
|
851
|
+
coin(): BigNum;
|
|
852
|
+
static from_bytes(bytes: Uint8Array): DRepRegistration;
|
|
853
|
+
static from_hex(hex_str: string): DRepRegistration;
|
|
854
|
+
static from_json(json: string): DRepRegistration;
|
|
855
|
+
has_script_credentials(): boolean;
|
|
856
|
+
static new(voting_credential: Credential, coin: BigNum): DRepRegistration;
|
|
857
|
+
static new_with_anchor(voting_credential: Credential, coin: BigNum, anchor: Anchor): DRepRegistration;
|
|
858
|
+
to_bytes(): Uint8Array;
|
|
859
|
+
to_hex(): string;
|
|
860
|
+
to_js_value(): any;
|
|
861
|
+
to_json(): string;
|
|
862
|
+
voting_credential(): Credential;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export class DRepUpdate {
|
|
866
|
+
private constructor();
|
|
867
|
+
free(): void;
|
|
868
|
+
[Symbol.dispose](): void;
|
|
869
|
+
anchor(): Anchor | undefined;
|
|
870
|
+
static from_bytes(bytes: Uint8Array): DRepUpdate;
|
|
871
|
+
static from_hex(hex_str: string): DRepUpdate;
|
|
872
|
+
static from_json(json: string): DRepUpdate;
|
|
873
|
+
has_script_credentials(): boolean;
|
|
874
|
+
static new(voting_credential: Credential): DRepUpdate;
|
|
875
|
+
static new_with_anchor(voting_credential: Credential, anchor: Anchor): DRepUpdate;
|
|
876
|
+
to_bytes(): Uint8Array;
|
|
877
|
+
to_hex(): string;
|
|
878
|
+
to_js_value(): any;
|
|
879
|
+
to_json(): string;
|
|
880
|
+
voting_credential(): Credential;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export class DRepVotingThresholds {
|
|
884
|
+
private constructor();
|
|
885
|
+
free(): void;
|
|
886
|
+
[Symbol.dispose](): void;
|
|
887
|
+
committee_no_confidence(): UnitInterval;
|
|
888
|
+
committee_normal(): UnitInterval;
|
|
889
|
+
static from_bytes(bytes: Uint8Array): DRepVotingThresholds;
|
|
890
|
+
static from_hex(hex_str: string): DRepVotingThresholds;
|
|
891
|
+
static from_json(json: string): DRepVotingThresholds;
|
|
892
|
+
hard_fork_initiation(): UnitInterval;
|
|
893
|
+
motion_no_confidence(): UnitInterval;
|
|
894
|
+
static new(motion_no_confidence: UnitInterval, committee_normal: UnitInterval, committee_no_confidence: UnitInterval, update_constitution: UnitInterval, hard_fork_initiation: UnitInterval, pp_network_group: UnitInterval, pp_economic_group: UnitInterval, pp_technical_group: UnitInterval, pp_governance_group: UnitInterval, treasury_withdrawal: UnitInterval): DRepVotingThresholds;
|
|
895
|
+
pp_economic_group(): UnitInterval;
|
|
896
|
+
pp_governance_group(): UnitInterval;
|
|
897
|
+
pp_network_group(): UnitInterval;
|
|
898
|
+
pp_technical_group(): UnitInterval;
|
|
899
|
+
set_committee_no_confidence(committee_no_confidence: UnitInterval): void;
|
|
900
|
+
set_committee_normal(committee_normal: UnitInterval): void;
|
|
901
|
+
set_hard_fork_initiation(hard_fork_initiation: UnitInterval): void;
|
|
902
|
+
set_motion_no_confidence(motion_no_confidence: UnitInterval): void;
|
|
903
|
+
set_pp_economic_group(pp_economic_group: UnitInterval): void;
|
|
904
|
+
set_pp_governance_group(pp_governance_group: UnitInterval): void;
|
|
905
|
+
set_pp_network_group(pp_network_group: UnitInterval): void;
|
|
906
|
+
set_pp_technical_group(pp_technical_group: UnitInterval): void;
|
|
907
|
+
set_treasury_withdrawal(treasury_withdrawal: UnitInterval): void;
|
|
908
|
+
set_update_constitution(update_constitution: UnitInterval): void;
|
|
909
|
+
to_bytes(): Uint8Array;
|
|
910
|
+
to_hex(): string;
|
|
911
|
+
to_js_value(): any;
|
|
912
|
+
to_json(): string;
|
|
913
|
+
treasury_withdrawal(): UnitInterval;
|
|
914
|
+
update_constitution(): UnitInterval;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
export class DataCost {
|
|
918
|
+
private constructor();
|
|
919
|
+
free(): void;
|
|
920
|
+
[Symbol.dispose](): void;
|
|
921
|
+
coins_per_byte(): BigNum;
|
|
922
|
+
static new_coins_per_byte(coins_per_byte: BigNum): DataCost;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
export class DataHash {
|
|
926
|
+
private constructor();
|
|
927
|
+
free(): void;
|
|
928
|
+
[Symbol.dispose](): void;
|
|
929
|
+
static from_bech32(bech_str: string): DataHash;
|
|
930
|
+
static from_bytes(bytes: Uint8Array): DataHash;
|
|
931
|
+
static from_hex(hex: string): DataHash;
|
|
932
|
+
to_bech32(prefix: string): string;
|
|
933
|
+
to_bytes(): Uint8Array;
|
|
934
|
+
to_hex(): string;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
export class DatumSource {
|
|
938
|
+
private constructor();
|
|
939
|
+
free(): void;
|
|
940
|
+
[Symbol.dispose](): void;
|
|
941
|
+
static new(datum: PlutusData): DatumSource;
|
|
942
|
+
static new_ref_input(input: TransactionInput): DatumSource;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
export class Ed25519KeyHash {
|
|
946
|
+
private constructor();
|
|
947
|
+
free(): void;
|
|
948
|
+
[Symbol.dispose](): void;
|
|
949
|
+
static from_bech32(bech_str: string): Ed25519KeyHash;
|
|
950
|
+
static from_bytes(bytes: Uint8Array): Ed25519KeyHash;
|
|
951
|
+
static from_hex(hex: string): Ed25519KeyHash;
|
|
952
|
+
to_bech32(prefix: string): string;
|
|
953
|
+
to_bytes(): Uint8Array;
|
|
954
|
+
to_hex(): string;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
export class Ed25519KeyHashes {
|
|
958
|
+
private constructor();
|
|
959
|
+
free(): void;
|
|
960
|
+
[Symbol.dispose](): void;
|
|
961
|
+
/**
|
|
962
|
+
* Add a new `Ed25519KeyHash` to the set.
|
|
963
|
+
* Returns `true` if the element was not already present in the set.
|
|
964
|
+
*/
|
|
965
|
+
add(keyhash: Ed25519KeyHash): boolean;
|
|
966
|
+
contains(elem: Ed25519KeyHash): boolean;
|
|
967
|
+
static from_bytes(bytes: Uint8Array): Ed25519KeyHashes;
|
|
968
|
+
static from_hex(hex_str: string): Ed25519KeyHashes;
|
|
969
|
+
static from_json(json: string): Ed25519KeyHashes;
|
|
970
|
+
get(index: number): Ed25519KeyHash;
|
|
971
|
+
len(): number;
|
|
972
|
+
static new(): Ed25519KeyHashes;
|
|
973
|
+
to_bytes(): Uint8Array;
|
|
974
|
+
to_hex(): string;
|
|
975
|
+
to_js_value(): any;
|
|
976
|
+
to_json(): string;
|
|
977
|
+
to_option(): Ed25519KeyHashes | undefined;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
export class Ed25519Signature {
|
|
981
|
+
private constructor();
|
|
982
|
+
free(): void;
|
|
983
|
+
[Symbol.dispose](): void;
|
|
984
|
+
static from_bech32(bech32_str: string): Ed25519Signature;
|
|
985
|
+
static from_bytes(bytes: Uint8Array): Ed25519Signature;
|
|
986
|
+
static from_hex(input: string): Ed25519Signature;
|
|
987
|
+
to_bech32(): string;
|
|
988
|
+
to_bytes(): Uint8Array;
|
|
989
|
+
to_hex(): string;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
export class EnterpriseAddress {
|
|
993
|
+
private constructor();
|
|
994
|
+
free(): void;
|
|
995
|
+
[Symbol.dispose](): void;
|
|
996
|
+
static from_address(addr: Address): EnterpriseAddress | undefined;
|
|
997
|
+
network_id(): number;
|
|
998
|
+
static new(network: number, payment: Credential): EnterpriseAddress;
|
|
999
|
+
payment_cred(): Credential;
|
|
1000
|
+
to_address(): Address;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
export class ExUnitPrices {
|
|
1004
|
+
private constructor();
|
|
1005
|
+
free(): void;
|
|
1006
|
+
[Symbol.dispose](): void;
|
|
1007
|
+
static from_bytes(bytes: Uint8Array): ExUnitPrices;
|
|
1008
|
+
static from_hex(hex_str: string): ExUnitPrices;
|
|
1009
|
+
static from_json(json: string): ExUnitPrices;
|
|
1010
|
+
mem_price(): UnitInterval;
|
|
1011
|
+
static new(mem_price: UnitInterval, step_price: UnitInterval): ExUnitPrices;
|
|
1012
|
+
step_price(): UnitInterval;
|
|
1013
|
+
to_bytes(): Uint8Array;
|
|
1014
|
+
to_hex(): string;
|
|
1015
|
+
to_js_value(): any;
|
|
1016
|
+
to_json(): string;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
export class ExUnits {
|
|
1020
|
+
private constructor();
|
|
1021
|
+
free(): void;
|
|
1022
|
+
[Symbol.dispose](): void;
|
|
1023
|
+
static from_bytes(bytes: Uint8Array): ExUnits;
|
|
1024
|
+
static from_hex(hex_str: string): ExUnits;
|
|
1025
|
+
static from_json(json: string): ExUnits;
|
|
1026
|
+
mem(): BigNum;
|
|
1027
|
+
static new(mem: BigNum, steps: BigNum): ExUnits;
|
|
1028
|
+
steps(): BigNum;
|
|
1029
|
+
to_bytes(): Uint8Array;
|
|
1030
|
+
to_hex(): string;
|
|
1031
|
+
to_js_value(): any;
|
|
1032
|
+
to_json(): string;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Read only view of a block with more strict structs for hash sensitive structs.
|
|
1037
|
+
* Warning: This is experimental and may be removed or changed in the future.
|
|
1038
|
+
*/
|
|
1039
|
+
export class FixedBlock {
|
|
1040
|
+
private constructor();
|
|
1041
|
+
free(): void;
|
|
1042
|
+
[Symbol.dispose](): void;
|
|
1043
|
+
auxiliary_data_set(): AuxiliaryDataSet;
|
|
1044
|
+
block_hash(): BlockHash;
|
|
1045
|
+
static from_bytes(bytes: Uint8Array): FixedBlock;
|
|
1046
|
+
static from_hex(hex_str: string): FixedBlock;
|
|
1047
|
+
header(): Header;
|
|
1048
|
+
invalid_transactions(): Uint32Array;
|
|
1049
|
+
transaction_bodies(): FixedTransactionBodies;
|
|
1050
|
+
transaction_witness_sets(): TransactionWitnessSets;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
export class FixedTransaction {
|
|
1054
|
+
private constructor();
|
|
1055
|
+
free(): void;
|
|
1056
|
+
[Symbol.dispose](): void;
|
|
1057
|
+
add_bootstrap_witness(bootstrap_witness: BootstrapWitness): void;
|
|
1058
|
+
add_vkey_witness(vkey_witness: Vkeywitness): void;
|
|
1059
|
+
auxiliary_data(): AuxiliaryData | undefined;
|
|
1060
|
+
body(): TransactionBody;
|
|
1061
|
+
static from_bytes(bytes: Uint8Array): FixedTransaction;
|
|
1062
|
+
static from_hex(hex_str: string): FixedTransaction;
|
|
1063
|
+
is_valid(): boolean;
|
|
1064
|
+
static new(raw_body: Uint8Array, raw_witness_set: Uint8Array, is_valid: boolean): FixedTransaction;
|
|
1065
|
+
static new_from_body_bytes(raw_body: Uint8Array): FixedTransaction;
|
|
1066
|
+
static new_with_auxiliary(raw_body: Uint8Array, raw_witness_set: Uint8Array, raw_auxiliary_data: Uint8Array, is_valid: boolean): FixedTransaction;
|
|
1067
|
+
raw_auxiliary_data(): Uint8Array | undefined;
|
|
1068
|
+
raw_body(): Uint8Array;
|
|
1069
|
+
raw_witness_set(): Uint8Array;
|
|
1070
|
+
set_auxiliary_data(raw_auxiliary_data: Uint8Array): void;
|
|
1071
|
+
set_body(raw_body: Uint8Array): void;
|
|
1072
|
+
set_is_valid(valid: boolean): void;
|
|
1073
|
+
/**
|
|
1074
|
+
* We do not recommend using this function, since it might lead to script integrity hash.
|
|
1075
|
+
* The only purpose of this struct is to sign the transaction from third-party sources.
|
|
1076
|
+
* Use `.sign_and_add_vkey_signature` or `.sign_and_add_icarus_bootstrap_signature` or `.sign_and_add_daedalus_bootstrap_signature` instead.
|
|
1077
|
+
*/
|
|
1078
|
+
set_witness_set(raw_witness_set: Uint8Array): void;
|
|
1079
|
+
sign_and_add_daedalus_bootstrap_signature(addr: ByronAddress, private_key: LegacyDaedalusPrivateKey): void;
|
|
1080
|
+
sign_and_add_icarus_bootstrap_signature(addr: ByronAddress, private_key: Bip32PrivateKey): void;
|
|
1081
|
+
sign_and_add_vkey_signature(private_key: PrivateKey): void;
|
|
1082
|
+
to_bytes(): Uint8Array;
|
|
1083
|
+
to_hex(): string;
|
|
1084
|
+
transaction_hash(): TransactionHash;
|
|
1085
|
+
witness_set(): TransactionWitnessSet;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Warning: This is experimental and may be removed or changed in the future.
|
|
1090
|
+
*/
|
|
1091
|
+
export class FixedTransactionBodies {
|
|
1092
|
+
private constructor();
|
|
1093
|
+
free(): void;
|
|
1094
|
+
[Symbol.dispose](): void;
|
|
1095
|
+
add(elem: FixedTransactionBody): void;
|
|
1096
|
+
static from_bytes(bytes: Uint8Array): FixedTransactionBodies;
|
|
1097
|
+
static from_hex(hex_str: string): FixedTransactionBodies;
|
|
1098
|
+
get(index: number): FixedTransactionBody;
|
|
1099
|
+
len(): number;
|
|
1100
|
+
static new(): FixedTransactionBodies;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Read-only view of a transaction body. With correct hash and original bytes.
|
|
1105
|
+
* Warning: This is experimental and may be removed in the future.
|
|
1106
|
+
*/
|
|
1107
|
+
export class FixedTransactionBody {
|
|
1108
|
+
private constructor();
|
|
1109
|
+
free(): void;
|
|
1110
|
+
[Symbol.dispose](): void;
|
|
1111
|
+
static from_bytes(bytes: Uint8Array): FixedTransactionBody;
|
|
1112
|
+
static from_hex(hex_str: string): FixedTransactionBody;
|
|
1113
|
+
original_bytes(): Uint8Array;
|
|
1114
|
+
transaction_body(): TransactionBody;
|
|
1115
|
+
tx_hash(): TransactionHash;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* A set of witnesses for a transaction.
|
|
1120
|
+
* Keeps original bytes to allow for safe roundtrip serialization.
|
|
1121
|
+
* That helps to avoid incorrect script data hash after adding a vkey or bootstrap witness.
|
|
1122
|
+
* You can add a vkey witness or a bootstrap witness to the set.
|
|
1123
|
+
* Or get TransactionWitnessSet to read fields.
|
|
1124
|
+
*/
|
|
1125
|
+
export class FixedTxWitnessesSet {
|
|
1126
|
+
private constructor();
|
|
1127
|
+
free(): void;
|
|
1128
|
+
[Symbol.dispose](): void;
|
|
1129
|
+
add_bootstrap_witness(bootstrap_witness: BootstrapWitness): void;
|
|
1130
|
+
add_vkey_witness(vkey_witness: Vkeywitness): void;
|
|
1131
|
+
static from_bytes(data: Uint8Array): FixedTxWitnessesSet;
|
|
1132
|
+
to_bytes(): Uint8Array;
|
|
1133
|
+
tx_witnesses_set(): TransactionWitnessSet;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Warning: This is experimental and may be removed in the future.
|
|
1138
|
+
*/
|
|
1139
|
+
export class FixedVersionedBlock {
|
|
1140
|
+
private constructor();
|
|
1141
|
+
free(): void;
|
|
1142
|
+
[Symbol.dispose](): void;
|
|
1143
|
+
block(): FixedBlock;
|
|
1144
|
+
era(): BlockEra;
|
|
1145
|
+
static from_bytes(bytes: Uint8Array): FixedVersionedBlock;
|
|
1146
|
+
static from_hex(hex_str: string): FixedVersionedBlock;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export class GeneralTransactionMetadata {
|
|
1150
|
+
private constructor();
|
|
1151
|
+
free(): void;
|
|
1152
|
+
[Symbol.dispose](): void;
|
|
1153
|
+
static from_bytes(bytes: Uint8Array): GeneralTransactionMetadata;
|
|
1154
|
+
static from_hex(hex_str: string): GeneralTransactionMetadata;
|
|
1155
|
+
static from_json(json: string): GeneralTransactionMetadata;
|
|
1156
|
+
get(key: BigNum): TransactionMetadatum | undefined;
|
|
1157
|
+
insert(key: BigNum, value: TransactionMetadatum): TransactionMetadatum | undefined;
|
|
1158
|
+
keys(): TransactionMetadatumLabels;
|
|
1159
|
+
len(): number;
|
|
1160
|
+
static new(): GeneralTransactionMetadata;
|
|
1161
|
+
to_bytes(): Uint8Array;
|
|
1162
|
+
to_hex(): string;
|
|
1163
|
+
to_js_value(): any;
|
|
1164
|
+
to_json(): string;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
export class GenesisDelegateHash {
|
|
1168
|
+
private constructor();
|
|
1169
|
+
free(): void;
|
|
1170
|
+
[Symbol.dispose](): void;
|
|
1171
|
+
static from_bech32(bech_str: string): GenesisDelegateHash;
|
|
1172
|
+
static from_bytes(bytes: Uint8Array): GenesisDelegateHash;
|
|
1173
|
+
static from_hex(hex: string): GenesisDelegateHash;
|
|
1174
|
+
to_bech32(prefix: string): string;
|
|
1175
|
+
to_bytes(): Uint8Array;
|
|
1176
|
+
to_hex(): string;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
export class GenesisHash {
|
|
1180
|
+
private constructor();
|
|
1181
|
+
free(): void;
|
|
1182
|
+
[Symbol.dispose](): void;
|
|
1183
|
+
static from_bech32(bech_str: string): GenesisHash;
|
|
1184
|
+
static from_bytes(bytes: Uint8Array): GenesisHash;
|
|
1185
|
+
static from_hex(hex: string): GenesisHash;
|
|
1186
|
+
to_bech32(prefix: string): string;
|
|
1187
|
+
to_bytes(): Uint8Array;
|
|
1188
|
+
to_hex(): string;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
export class GenesisHashes {
|
|
1192
|
+
private constructor();
|
|
1193
|
+
free(): void;
|
|
1194
|
+
[Symbol.dispose](): void;
|
|
1195
|
+
add(elem: GenesisHash): void;
|
|
1196
|
+
static from_bytes(bytes: Uint8Array): GenesisHashes;
|
|
1197
|
+
static from_hex(hex_str: string): GenesisHashes;
|
|
1198
|
+
static from_json(json: string): GenesisHashes;
|
|
1199
|
+
get(index: number): GenesisHash;
|
|
1200
|
+
len(): number;
|
|
1201
|
+
static new(): GenesisHashes;
|
|
1202
|
+
to_bytes(): Uint8Array;
|
|
1203
|
+
to_hex(): string;
|
|
1204
|
+
to_js_value(): any;
|
|
1205
|
+
to_json(): string;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
export class GenesisKeyDelegation {
|
|
1209
|
+
private constructor();
|
|
1210
|
+
free(): void;
|
|
1211
|
+
[Symbol.dispose](): void;
|
|
1212
|
+
static from_bytes(bytes: Uint8Array): GenesisKeyDelegation;
|
|
1213
|
+
static from_hex(hex_str: string): GenesisKeyDelegation;
|
|
1214
|
+
static from_json(json: string): GenesisKeyDelegation;
|
|
1215
|
+
genesis_delegate_hash(): GenesisDelegateHash;
|
|
1216
|
+
genesishash(): GenesisHash;
|
|
1217
|
+
static new(genesishash: GenesisHash, genesis_delegate_hash: GenesisDelegateHash, vrf_keyhash: VRFKeyHash): GenesisKeyDelegation;
|
|
1218
|
+
to_bytes(): Uint8Array;
|
|
1219
|
+
to_hex(): string;
|
|
1220
|
+
to_js_value(): any;
|
|
1221
|
+
to_json(): string;
|
|
1222
|
+
vrf_keyhash(): VRFKeyHash;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
export class GovernanceAction {
|
|
1226
|
+
private constructor();
|
|
1227
|
+
free(): void;
|
|
1228
|
+
[Symbol.dispose](): void;
|
|
1229
|
+
as_hard_fork_initiation_action(): HardForkInitiationAction | undefined;
|
|
1230
|
+
as_info_action(): InfoAction | undefined;
|
|
1231
|
+
as_new_committee_action(): UpdateCommitteeAction | undefined;
|
|
1232
|
+
as_new_constitution_action(): NewConstitutionAction | undefined;
|
|
1233
|
+
as_no_confidence_action(): NoConfidenceAction | undefined;
|
|
1234
|
+
as_parameter_change_action(): ParameterChangeAction | undefined;
|
|
1235
|
+
as_treasury_withdrawals_action(): TreasuryWithdrawalsAction | undefined;
|
|
1236
|
+
static from_bytes(bytes: Uint8Array): GovernanceAction;
|
|
1237
|
+
static from_hex(hex_str: string): GovernanceAction;
|
|
1238
|
+
static from_json(json: string): GovernanceAction;
|
|
1239
|
+
kind(): GovernanceActionKind;
|
|
1240
|
+
static new_hard_fork_initiation_action(hard_fork_initiation_action: HardForkInitiationAction): GovernanceAction;
|
|
1241
|
+
static new_info_action(info_action: InfoAction): GovernanceAction;
|
|
1242
|
+
static new_new_committee_action(new_committee_action: UpdateCommitteeAction): GovernanceAction;
|
|
1243
|
+
static new_new_constitution_action(new_constitution_action: NewConstitutionAction): GovernanceAction;
|
|
1244
|
+
static new_no_confidence_action(no_confidence_action: NoConfidenceAction): GovernanceAction;
|
|
1245
|
+
static new_parameter_change_action(parameter_change_action: ParameterChangeAction): GovernanceAction;
|
|
1246
|
+
static new_treasury_withdrawals_action(treasury_withdrawals_action: TreasuryWithdrawalsAction): GovernanceAction;
|
|
1247
|
+
to_bytes(): Uint8Array;
|
|
1248
|
+
to_hex(): string;
|
|
1249
|
+
to_js_value(): any;
|
|
1250
|
+
to_json(): string;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
export class GovernanceActionId {
|
|
1254
|
+
private constructor();
|
|
1255
|
+
free(): void;
|
|
1256
|
+
[Symbol.dispose](): void;
|
|
1257
|
+
static from_bytes(bytes: Uint8Array): GovernanceActionId;
|
|
1258
|
+
static from_hex(hex_str: string): GovernanceActionId;
|
|
1259
|
+
static from_json(json: string): GovernanceActionId;
|
|
1260
|
+
index(): number;
|
|
1261
|
+
static new(transaction_id: TransactionHash, index: number): GovernanceActionId;
|
|
1262
|
+
to_bytes(): Uint8Array;
|
|
1263
|
+
to_hex(): string;
|
|
1264
|
+
to_js_value(): any;
|
|
1265
|
+
to_json(): string;
|
|
1266
|
+
transaction_id(): TransactionHash;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
export class GovernanceActionIds {
|
|
1270
|
+
private constructor();
|
|
1271
|
+
free(): void;
|
|
1272
|
+
[Symbol.dispose](): void;
|
|
1273
|
+
add(governance_action_id: GovernanceActionId): void;
|
|
1274
|
+
static from_json(json: string): GovernanceActionIds;
|
|
1275
|
+
get(index: number): GovernanceActionId | undefined;
|
|
1276
|
+
len(): number;
|
|
1277
|
+
static new(): GovernanceActionIds;
|
|
1278
|
+
to_js_value(): any;
|
|
1279
|
+
to_json(): string;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
export enum GovernanceActionKind {
|
|
1283
|
+
ParameterChangeAction = 0,
|
|
1284
|
+
HardForkInitiationAction = 1,
|
|
1285
|
+
TreasuryWithdrawalsAction = 2,
|
|
1286
|
+
NoConfidenceAction = 3,
|
|
1287
|
+
UpdateCommitteeAction = 4,
|
|
1288
|
+
NewConstitutionAction = 5,
|
|
1289
|
+
InfoAction = 6,
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
export class HardForkInitiationAction {
|
|
1293
|
+
private constructor();
|
|
1294
|
+
free(): void;
|
|
1295
|
+
[Symbol.dispose](): void;
|
|
1296
|
+
static from_bytes(bytes: Uint8Array): HardForkInitiationAction;
|
|
1297
|
+
static from_hex(hex_str: string): HardForkInitiationAction;
|
|
1298
|
+
static from_json(json: string): HardForkInitiationAction;
|
|
1299
|
+
gov_action_id(): GovernanceActionId | undefined;
|
|
1300
|
+
static new(protocol_version: ProtocolVersion): HardForkInitiationAction;
|
|
1301
|
+
static new_with_action_id(gov_action_id: GovernanceActionId, protocol_version: ProtocolVersion): HardForkInitiationAction;
|
|
1302
|
+
protocol_version(): ProtocolVersion;
|
|
1303
|
+
to_bytes(): Uint8Array;
|
|
1304
|
+
to_hex(): string;
|
|
1305
|
+
to_js_value(): any;
|
|
1306
|
+
to_json(): string;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
export class Header {
|
|
1310
|
+
private constructor();
|
|
1311
|
+
free(): void;
|
|
1312
|
+
[Symbol.dispose](): void;
|
|
1313
|
+
body_signature(): KESSignature;
|
|
1314
|
+
static from_bytes(bytes: Uint8Array): Header;
|
|
1315
|
+
static from_hex(hex_str: string): Header;
|
|
1316
|
+
static from_json(json: string): Header;
|
|
1317
|
+
header_body(): HeaderBody;
|
|
1318
|
+
static new(header_body: HeaderBody, body_signature: KESSignature): Header;
|
|
1319
|
+
to_bytes(): Uint8Array;
|
|
1320
|
+
to_hex(): string;
|
|
1321
|
+
to_js_value(): any;
|
|
1322
|
+
to_json(): string;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
export class HeaderBody {
|
|
1326
|
+
private constructor();
|
|
1327
|
+
free(): void;
|
|
1328
|
+
[Symbol.dispose](): void;
|
|
1329
|
+
block_body_hash(): BlockHash;
|
|
1330
|
+
block_body_size(): number;
|
|
1331
|
+
block_number(): number;
|
|
1332
|
+
static from_bytes(bytes: Uint8Array): HeaderBody;
|
|
1333
|
+
static from_hex(hex_str: string): HeaderBody;
|
|
1334
|
+
static from_json(json: string): HeaderBody;
|
|
1335
|
+
/**
|
|
1336
|
+
* If this function returns true, the `.nonce_vrf_or_nothing`
|
|
1337
|
+
* and the `.leader_vrf_or_nothing` functions will return
|
|
1338
|
+
* non-empty results
|
|
1339
|
+
*/
|
|
1340
|
+
has_nonce_and_leader_vrf(): boolean;
|
|
1341
|
+
/**
|
|
1342
|
+
* If this function returns true, the `.vrf_result_or_nothing`
|
|
1343
|
+
* function will return a non-empty result
|
|
1344
|
+
*/
|
|
1345
|
+
has_vrf_result(): boolean;
|
|
1346
|
+
issuer_vkey(): Vkey;
|
|
1347
|
+
/**
|
|
1348
|
+
* Might return nothing in case `.has_nonce_and_leader_vrf` returns false
|
|
1349
|
+
*/
|
|
1350
|
+
leader_vrf_or_nothing(): VRFCert | undefined;
|
|
1351
|
+
/**
|
|
1352
|
+
* !!! DEPRECATED !!!
|
|
1353
|
+
* This constructor uses outdated slot number format.
|
|
1354
|
+
* Use `.new_headerbody` instead
|
|
1355
|
+
*/
|
|
1356
|
+
static new(block_number: number, slot: number, prev_hash: BlockHash | null | undefined, issuer_vkey: Vkey, vrf_vkey: VRFVKey, vrf_result: VRFCert, block_body_size: number, block_body_hash: BlockHash, operational_cert: OperationalCert, protocol_version: ProtocolVersion): HeaderBody;
|
|
1357
|
+
static new_headerbody(block_number: number, slot: BigNum, prev_hash: BlockHash | null | undefined, issuer_vkey: Vkey, vrf_vkey: VRFVKey, vrf_result: VRFCert, block_body_size: number, block_body_hash: BlockHash, operational_cert: OperationalCert, protocol_version: ProtocolVersion): HeaderBody;
|
|
1358
|
+
/**
|
|
1359
|
+
* Might return nothing in case `.has_nonce_and_leader_vrf` returns false
|
|
1360
|
+
*/
|
|
1361
|
+
nonce_vrf_or_nothing(): VRFCert | undefined;
|
|
1362
|
+
operational_cert(): OperationalCert;
|
|
1363
|
+
prev_hash(): BlockHash | undefined;
|
|
1364
|
+
protocol_version(): ProtocolVersion;
|
|
1365
|
+
/**
|
|
1366
|
+
* !!! DEPRECATED !!!
|
|
1367
|
+
* Returns a Slot32 (u32) value in case the underlying original BigNum (u64) value is within the limits.
|
|
1368
|
+
* Otherwise will just raise an error.
|
|
1369
|
+
*/
|
|
1370
|
+
slot(): number;
|
|
1371
|
+
slot_bignum(): BigNum;
|
|
1372
|
+
to_bytes(): Uint8Array;
|
|
1373
|
+
to_hex(): string;
|
|
1374
|
+
to_js_value(): any;
|
|
1375
|
+
to_json(): string;
|
|
1376
|
+
/**
|
|
1377
|
+
* Might return nothing in case `.has_vrf_result` returns false
|
|
1378
|
+
*/
|
|
1379
|
+
vrf_result_or_nothing(): VRFCert | undefined;
|
|
1380
|
+
vrf_vkey(): VRFVKey;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
export class InfoAction {
|
|
1384
|
+
private constructor();
|
|
1385
|
+
free(): void;
|
|
1386
|
+
[Symbol.dispose](): void;
|
|
1387
|
+
static new(): InfoAction;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
export class Int {
|
|
1391
|
+
private constructor();
|
|
1392
|
+
free(): void;
|
|
1393
|
+
[Symbol.dispose](): void;
|
|
1394
|
+
/**
|
|
1395
|
+
* !!! DEPRECATED !!!
|
|
1396
|
+
* Returns an i32 value in case the underlying original i128 value is within the limits.
|
|
1397
|
+
* Otherwise will just return an empty value (undefined).
|
|
1398
|
+
*/
|
|
1399
|
+
as_i32(): number | undefined;
|
|
1400
|
+
/**
|
|
1401
|
+
* Returns the underlying value converted to i32 if possible (within limits)
|
|
1402
|
+
* JsError in case of out of boundary overflow
|
|
1403
|
+
*/
|
|
1404
|
+
as_i32_or_fail(): number;
|
|
1405
|
+
/**
|
|
1406
|
+
* Returns the underlying value converted to i32 if possible (within limits)
|
|
1407
|
+
* Otherwise will just return an empty value (undefined).
|
|
1408
|
+
*/
|
|
1409
|
+
as_i32_or_nothing(): number | undefined;
|
|
1410
|
+
/**
|
|
1411
|
+
* BigNum can only contain unsigned u64 values
|
|
1412
|
+
*
|
|
1413
|
+
* This function will return the *absolute* BigNum representation
|
|
1414
|
+
* only in case the underlying i128 value is negative.
|
|
1415
|
+
*
|
|
1416
|
+
* Otherwise nothing will be returned (undefined).
|
|
1417
|
+
*/
|
|
1418
|
+
as_negative(): BigNum | undefined;
|
|
1419
|
+
/**
|
|
1420
|
+
* BigNum can only contain unsigned u64 values
|
|
1421
|
+
*
|
|
1422
|
+
* This function will return the BigNum representation
|
|
1423
|
+
* only in case the underlying i128 value is positive.
|
|
1424
|
+
*
|
|
1425
|
+
* Otherwise nothing will be returned (undefined).
|
|
1426
|
+
*/
|
|
1427
|
+
as_positive(): BigNum | undefined;
|
|
1428
|
+
static from_bytes(bytes: Uint8Array): Int;
|
|
1429
|
+
static from_hex(hex_str: string): Int;
|
|
1430
|
+
static from_json(json: string): Int;
|
|
1431
|
+
static from_str(string: string): Int;
|
|
1432
|
+
is_positive(): boolean;
|
|
1433
|
+
static new(x: BigNum): Int;
|
|
1434
|
+
static new_i32(x: number): Int;
|
|
1435
|
+
static new_negative(x: BigNum): Int;
|
|
1436
|
+
to_bytes(): Uint8Array;
|
|
1437
|
+
to_hex(): string;
|
|
1438
|
+
to_js_value(): any;
|
|
1439
|
+
to_json(): string;
|
|
1440
|
+
/**
|
|
1441
|
+
* Returns string representation of the underlying i128 value directly.
|
|
1442
|
+
* Might contain the minus sign (-) in case of negative value.
|
|
1443
|
+
*/
|
|
1444
|
+
to_str(): string;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
export class Ipv4 {
|
|
1448
|
+
private constructor();
|
|
1449
|
+
free(): void;
|
|
1450
|
+
[Symbol.dispose](): void;
|
|
1451
|
+
static from_bytes(bytes: Uint8Array): Ipv4;
|
|
1452
|
+
static from_hex(hex_str: string): Ipv4;
|
|
1453
|
+
static from_json(json: string): Ipv4;
|
|
1454
|
+
ip(): Uint8Array;
|
|
1455
|
+
static new(data: Uint8Array): Ipv4;
|
|
1456
|
+
to_bytes(): Uint8Array;
|
|
1457
|
+
to_hex(): string;
|
|
1458
|
+
to_js_value(): any;
|
|
1459
|
+
to_json(): string;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
export class Ipv6 {
|
|
1463
|
+
private constructor();
|
|
1464
|
+
free(): void;
|
|
1465
|
+
[Symbol.dispose](): void;
|
|
1466
|
+
static from_bytes(bytes: Uint8Array): Ipv6;
|
|
1467
|
+
static from_hex(hex_str: string): Ipv6;
|
|
1468
|
+
static from_json(json: string): Ipv6;
|
|
1469
|
+
ip(): Uint8Array;
|
|
1470
|
+
static new(data: Uint8Array): Ipv6;
|
|
1471
|
+
to_bytes(): Uint8Array;
|
|
1472
|
+
to_hex(): string;
|
|
1473
|
+
to_js_value(): any;
|
|
1474
|
+
to_json(): string;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
export class KESSignature {
|
|
1478
|
+
private constructor();
|
|
1479
|
+
free(): void;
|
|
1480
|
+
[Symbol.dispose](): void;
|
|
1481
|
+
static from_bytes(bytes: Uint8Array): KESSignature;
|
|
1482
|
+
to_bytes(): Uint8Array;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
export class KESVKey {
|
|
1486
|
+
private constructor();
|
|
1487
|
+
free(): void;
|
|
1488
|
+
[Symbol.dispose](): void;
|
|
1489
|
+
static from_bech32(bech_str: string): KESVKey;
|
|
1490
|
+
static from_bytes(bytes: Uint8Array): KESVKey;
|
|
1491
|
+
static from_hex(hex: string): KESVKey;
|
|
1492
|
+
to_bech32(prefix: string): string;
|
|
1493
|
+
to_bytes(): Uint8Array;
|
|
1494
|
+
to_hex(): string;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
export class Language {
|
|
1498
|
+
private constructor();
|
|
1499
|
+
free(): void;
|
|
1500
|
+
[Symbol.dispose](): void;
|
|
1501
|
+
static from_bytes(bytes: Uint8Array): Language;
|
|
1502
|
+
static from_hex(hex_str: string): Language;
|
|
1503
|
+
static from_json(json: string): Language;
|
|
1504
|
+
kind(): LanguageKind;
|
|
1505
|
+
static new_plutus_v1(): Language;
|
|
1506
|
+
static new_plutus_v2(): Language;
|
|
1507
|
+
static new_plutus_v3(): Language;
|
|
1508
|
+
to_bytes(): Uint8Array;
|
|
1509
|
+
to_hex(): string;
|
|
1510
|
+
to_js_value(): any;
|
|
1511
|
+
to_json(): string;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
export enum LanguageKind {
|
|
1515
|
+
PlutusV1 = 0,
|
|
1516
|
+
PlutusV2 = 1,
|
|
1517
|
+
PlutusV3 = 2,
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
export class Languages {
|
|
1521
|
+
private constructor();
|
|
1522
|
+
free(): void;
|
|
1523
|
+
[Symbol.dispose](): void;
|
|
1524
|
+
add(elem: Language): void;
|
|
1525
|
+
get(index: number): Language;
|
|
1526
|
+
len(): number;
|
|
1527
|
+
static list(): Languages;
|
|
1528
|
+
static new(): Languages;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
export class LegacyDaedalusPrivateKey {
|
|
1532
|
+
private constructor();
|
|
1533
|
+
free(): void;
|
|
1534
|
+
[Symbol.dispose](): void;
|
|
1535
|
+
as_bytes(): Uint8Array;
|
|
1536
|
+
chaincode(): Uint8Array;
|
|
1537
|
+
static from_bytes(bytes: Uint8Array): LegacyDaedalusPrivateKey;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
export class LinearFee {
|
|
1541
|
+
private constructor();
|
|
1542
|
+
free(): void;
|
|
1543
|
+
[Symbol.dispose](): void;
|
|
1544
|
+
coefficient(): BigNum;
|
|
1545
|
+
constant(): BigNum;
|
|
1546
|
+
static new(coefficient: BigNum, constant: BigNum): LinearFee;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
export enum MIRKind {
|
|
1550
|
+
ToOtherPot = 0,
|
|
1551
|
+
ToStakeCredentials = 1,
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
export enum MIRPot {
|
|
1555
|
+
Reserves = 0,
|
|
1556
|
+
Treasury = 1,
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
export class MIRToStakeCredentials {
|
|
1560
|
+
private constructor();
|
|
1561
|
+
free(): void;
|
|
1562
|
+
[Symbol.dispose](): void;
|
|
1563
|
+
static from_bytes(bytes: Uint8Array): MIRToStakeCredentials;
|
|
1564
|
+
static from_hex(hex_str: string): MIRToStakeCredentials;
|
|
1565
|
+
static from_json(json: string): MIRToStakeCredentials;
|
|
1566
|
+
get(cred: Credential): Int | undefined;
|
|
1567
|
+
insert(cred: Credential, delta: Int): Int | undefined;
|
|
1568
|
+
keys(): Credentials;
|
|
1569
|
+
len(): number;
|
|
1570
|
+
static new(): MIRToStakeCredentials;
|
|
1571
|
+
to_bytes(): Uint8Array;
|
|
1572
|
+
to_hex(): string;
|
|
1573
|
+
to_js_value(): any;
|
|
1574
|
+
to_json(): string;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
export class MalformedAddress {
|
|
1578
|
+
private constructor();
|
|
1579
|
+
free(): void;
|
|
1580
|
+
[Symbol.dispose](): void;
|
|
1581
|
+
static from_address(addr: Address): MalformedAddress | undefined;
|
|
1582
|
+
original_bytes(): Uint8Array;
|
|
1583
|
+
to_address(): Address;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
export enum MetadataJsonSchema {
|
|
1587
|
+
NoConversions = 0,
|
|
1588
|
+
BasicConversions = 1,
|
|
1589
|
+
DetailedSchema = 2,
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
export class MetadataList {
|
|
1593
|
+
private constructor();
|
|
1594
|
+
free(): void;
|
|
1595
|
+
[Symbol.dispose](): void;
|
|
1596
|
+
add(elem: TransactionMetadatum): void;
|
|
1597
|
+
static from_bytes(bytes: Uint8Array): MetadataList;
|
|
1598
|
+
static from_hex(hex_str: string): MetadataList;
|
|
1599
|
+
get(index: number): TransactionMetadatum;
|
|
1600
|
+
len(): number;
|
|
1601
|
+
static new(): MetadataList;
|
|
1602
|
+
to_bytes(): Uint8Array;
|
|
1603
|
+
to_hex(): string;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
export class MetadataMap {
|
|
1607
|
+
private constructor();
|
|
1608
|
+
free(): void;
|
|
1609
|
+
[Symbol.dispose](): void;
|
|
1610
|
+
static from_bytes(bytes: Uint8Array): MetadataMap;
|
|
1611
|
+
static from_hex(hex_str: string): MetadataMap;
|
|
1612
|
+
get(key: TransactionMetadatum): TransactionMetadatum;
|
|
1613
|
+
get_i32(key: number): TransactionMetadatum;
|
|
1614
|
+
get_str(key: string): TransactionMetadatum;
|
|
1615
|
+
has(key: TransactionMetadatum): boolean;
|
|
1616
|
+
insert(key: TransactionMetadatum, value: TransactionMetadatum): TransactionMetadatum | undefined;
|
|
1617
|
+
insert_i32(key: number, value: TransactionMetadatum): TransactionMetadatum | undefined;
|
|
1618
|
+
insert_str(key: string, value: TransactionMetadatum): TransactionMetadatum | undefined;
|
|
1619
|
+
keys(): MetadataList;
|
|
1620
|
+
len(): number;
|
|
1621
|
+
static new(): MetadataMap;
|
|
1622
|
+
to_bytes(): Uint8Array;
|
|
1623
|
+
to_hex(): string;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
export class Mint {
|
|
1627
|
+
private constructor();
|
|
1628
|
+
free(): void;
|
|
1629
|
+
[Symbol.dispose](): void;
|
|
1630
|
+
/**
|
|
1631
|
+
* Returns the multiasset where only negative (burning) entries are present
|
|
1632
|
+
*/
|
|
1633
|
+
as_negative_multiasset(): MultiAsset;
|
|
1634
|
+
/**
|
|
1635
|
+
* Returns the multiasset where only positive (minting) entries are present
|
|
1636
|
+
*/
|
|
1637
|
+
as_positive_multiasset(): MultiAsset;
|
|
1638
|
+
static from_bytes(bytes: Uint8Array): Mint;
|
|
1639
|
+
static from_hex(hex_str: string): Mint;
|
|
1640
|
+
static from_json(json: string): Mint;
|
|
1641
|
+
get(key: ScriptHash): MintsAssets | undefined;
|
|
1642
|
+
insert(key: ScriptHash, value: MintAssets): MintAssets | undefined;
|
|
1643
|
+
keys(): ScriptHashes;
|
|
1644
|
+
len(): number;
|
|
1645
|
+
static new(): Mint;
|
|
1646
|
+
static new_from_entry(key: ScriptHash, value: MintAssets): Mint;
|
|
1647
|
+
to_bytes(): Uint8Array;
|
|
1648
|
+
to_hex(): string;
|
|
1649
|
+
to_js_value(): any;
|
|
1650
|
+
to_json(): string;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
export class MintAssets {
|
|
1654
|
+
private constructor();
|
|
1655
|
+
free(): void;
|
|
1656
|
+
[Symbol.dispose](): void;
|
|
1657
|
+
get(key: AssetName): Int | undefined;
|
|
1658
|
+
insert(key: AssetName, value: Int): Int | undefined;
|
|
1659
|
+
keys(): AssetNames;
|
|
1660
|
+
len(): number;
|
|
1661
|
+
static new(): MintAssets;
|
|
1662
|
+
static new_from_entry(key: AssetName, value: Int): MintAssets;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
export class MintBuilder {
|
|
1666
|
+
private constructor();
|
|
1667
|
+
free(): void;
|
|
1668
|
+
[Symbol.dispose](): void;
|
|
1669
|
+
add_asset(mint: MintWitness, asset_name: AssetName, amount: Int): void;
|
|
1670
|
+
build(): Mint;
|
|
1671
|
+
get_native_scripts(): NativeScripts;
|
|
1672
|
+
get_plutus_witnesses(): PlutusWitnesses;
|
|
1673
|
+
get_redeemers(): Redeemers;
|
|
1674
|
+
get_ref_inputs(): TransactionInputs;
|
|
1675
|
+
has_native_scripts(): boolean;
|
|
1676
|
+
has_plutus_scripts(): boolean;
|
|
1677
|
+
static new(): MintBuilder;
|
|
1678
|
+
set_asset(mint: MintWitness, asset_name: AssetName, amount: Int): void;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
export class MintWitness {
|
|
1682
|
+
private constructor();
|
|
1683
|
+
free(): void;
|
|
1684
|
+
[Symbol.dispose](): void;
|
|
1685
|
+
static new_native_script(native_script: NativeScriptSource): MintWitness;
|
|
1686
|
+
static new_plutus_script(plutus_script: PlutusScriptSource, redeemer: Redeemer): MintWitness;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
export class MintsAssets {
|
|
1690
|
+
private constructor();
|
|
1691
|
+
free(): void;
|
|
1692
|
+
[Symbol.dispose](): void;
|
|
1693
|
+
add(mint_assets: MintAssets): void;
|
|
1694
|
+
static from_json(json: string): MintsAssets;
|
|
1695
|
+
get(index: number): MintAssets | undefined;
|
|
1696
|
+
len(): number;
|
|
1697
|
+
static new(): MintsAssets;
|
|
1698
|
+
to_js_value(): any;
|
|
1699
|
+
to_json(): string;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
export class MoveInstantaneousReward {
|
|
1703
|
+
private constructor();
|
|
1704
|
+
free(): void;
|
|
1705
|
+
[Symbol.dispose](): void;
|
|
1706
|
+
as_to_other_pot(): BigNum | undefined;
|
|
1707
|
+
as_to_stake_creds(): MIRToStakeCredentials | undefined;
|
|
1708
|
+
static from_bytes(bytes: Uint8Array): MoveInstantaneousReward;
|
|
1709
|
+
static from_hex(hex_str: string): MoveInstantaneousReward;
|
|
1710
|
+
static from_json(json: string): MoveInstantaneousReward;
|
|
1711
|
+
kind(): MIRKind;
|
|
1712
|
+
static new_to_other_pot(pot: MIRPot, amount: BigNum): MoveInstantaneousReward;
|
|
1713
|
+
static new_to_stake_creds(pot: MIRPot, amounts: MIRToStakeCredentials): MoveInstantaneousReward;
|
|
1714
|
+
pot(): MIRPot;
|
|
1715
|
+
to_bytes(): Uint8Array;
|
|
1716
|
+
to_hex(): string;
|
|
1717
|
+
to_js_value(): any;
|
|
1718
|
+
to_json(): string;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
export class MoveInstantaneousRewardsCert {
|
|
1722
|
+
private constructor();
|
|
1723
|
+
free(): void;
|
|
1724
|
+
[Symbol.dispose](): void;
|
|
1725
|
+
static from_bytes(bytes: Uint8Array): MoveInstantaneousRewardsCert;
|
|
1726
|
+
static from_hex(hex_str: string): MoveInstantaneousRewardsCert;
|
|
1727
|
+
static from_json(json: string): MoveInstantaneousRewardsCert;
|
|
1728
|
+
move_instantaneous_reward(): MoveInstantaneousReward;
|
|
1729
|
+
static new(move_instantaneous_reward: MoveInstantaneousReward): MoveInstantaneousRewardsCert;
|
|
1730
|
+
to_bytes(): Uint8Array;
|
|
1731
|
+
to_hex(): string;
|
|
1732
|
+
to_js_value(): any;
|
|
1733
|
+
to_json(): string;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
export class MultiAsset {
|
|
1737
|
+
private constructor();
|
|
1738
|
+
free(): void;
|
|
1739
|
+
[Symbol.dispose](): void;
|
|
1740
|
+
static from_bytes(bytes: Uint8Array): MultiAsset;
|
|
1741
|
+
static from_hex(hex_str: string): MultiAsset;
|
|
1742
|
+
static from_json(json: string): MultiAsset;
|
|
1743
|
+
/**
|
|
1744
|
+
* all assets under {policy_id}, if any exist, or else None (undefined in JS)
|
|
1745
|
+
*/
|
|
1746
|
+
get(policy_id: ScriptHash): Assets | undefined;
|
|
1747
|
+
/**
|
|
1748
|
+
* returns the amount of asset {asset_name} under policy {policy_id}
|
|
1749
|
+
* If such an asset does not exist, 0 is returned.
|
|
1750
|
+
*/
|
|
1751
|
+
get_asset(policy_id: ScriptHash, asset_name: AssetName): BigNum;
|
|
1752
|
+
/**
|
|
1753
|
+
* set (and replace if it exists) all assets with policy {policy_id} to a copy of {assets}
|
|
1754
|
+
*/
|
|
1755
|
+
insert(policy_id: ScriptHash, assets: Assets): Assets | undefined;
|
|
1756
|
+
/**
|
|
1757
|
+
* returns all policy IDs used by assets in this multiasset
|
|
1758
|
+
*/
|
|
1759
|
+
keys(): ScriptHashes;
|
|
1760
|
+
/**
|
|
1761
|
+
* the number of unique policy IDs in the multiasset
|
|
1762
|
+
*/
|
|
1763
|
+
len(): number;
|
|
1764
|
+
static new(): MultiAsset;
|
|
1765
|
+
/**
|
|
1766
|
+
* sets the asset {asset_name} to {value} under policy {policy_id}
|
|
1767
|
+
* returns the previous amount if it was set, or else None (undefined in JS)
|
|
1768
|
+
*/
|
|
1769
|
+
set_asset(policy_id: ScriptHash, asset_name: AssetName, value: BigNum): BigNum | undefined;
|
|
1770
|
+
/**
|
|
1771
|
+
* removes an asset from the list if the result is 0 or less
|
|
1772
|
+
* does not modify this object, instead the result is returned
|
|
1773
|
+
*/
|
|
1774
|
+
sub(rhs_ma: MultiAsset): MultiAsset;
|
|
1775
|
+
to_bytes(): Uint8Array;
|
|
1776
|
+
to_hex(): string;
|
|
1777
|
+
to_js_value(): any;
|
|
1778
|
+
to_json(): string;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
export class MultiHostName {
|
|
1782
|
+
private constructor();
|
|
1783
|
+
free(): void;
|
|
1784
|
+
[Symbol.dispose](): void;
|
|
1785
|
+
dns_name(): DNSRecordSRV;
|
|
1786
|
+
static from_bytes(bytes: Uint8Array): MultiHostName;
|
|
1787
|
+
static from_hex(hex_str: string): MultiHostName;
|
|
1788
|
+
static from_json(json: string): MultiHostName;
|
|
1789
|
+
static new(dns_name: DNSRecordSRV): MultiHostName;
|
|
1790
|
+
to_bytes(): Uint8Array;
|
|
1791
|
+
to_hex(): string;
|
|
1792
|
+
to_js_value(): any;
|
|
1793
|
+
to_json(): string;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
export class NativeScript {
|
|
1797
|
+
private constructor();
|
|
1798
|
+
free(): void;
|
|
1799
|
+
[Symbol.dispose](): void;
|
|
1800
|
+
as_script_all(): ScriptAll | undefined;
|
|
1801
|
+
as_script_any(): ScriptAny | undefined;
|
|
1802
|
+
as_script_n_of_k(): ScriptNOfK | undefined;
|
|
1803
|
+
as_script_pubkey(): ScriptPubkey | undefined;
|
|
1804
|
+
as_timelock_expiry(): TimelockExpiry | undefined;
|
|
1805
|
+
as_timelock_start(): TimelockStart | undefined;
|
|
1806
|
+
static from_bytes(bytes: Uint8Array): NativeScript;
|
|
1807
|
+
static from_hex(hex_str: string): NativeScript;
|
|
1808
|
+
static from_json(json: string): NativeScript;
|
|
1809
|
+
/**
|
|
1810
|
+
* Returns a set of Ed25519KeyHashes
|
|
1811
|
+
* contained within this script recursively on any depth level.
|
|
1812
|
+
* The order of the keys in the result is not determined in any way.
|
|
1813
|
+
*/
|
|
1814
|
+
get_required_signers(): Ed25519KeyHashes;
|
|
1815
|
+
hash(): ScriptHash;
|
|
1816
|
+
kind(): NativeScriptKind;
|
|
1817
|
+
static new_script_all(script_all: ScriptAll): NativeScript;
|
|
1818
|
+
static new_script_any(script_any: ScriptAny): NativeScript;
|
|
1819
|
+
static new_script_n_of_k(script_n_of_k: ScriptNOfK): NativeScript;
|
|
1820
|
+
static new_script_pubkey(script_pubkey: ScriptPubkey): NativeScript;
|
|
1821
|
+
static new_timelock_expiry(timelock_expiry: TimelockExpiry): NativeScript;
|
|
1822
|
+
static new_timelock_start(timelock_start: TimelockStart): NativeScript;
|
|
1823
|
+
to_bytes(): Uint8Array;
|
|
1824
|
+
to_hex(): string;
|
|
1825
|
+
to_js_value(): any;
|
|
1826
|
+
to_json(): string;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
export enum NativeScriptKind {
|
|
1830
|
+
ScriptPubkey = 0,
|
|
1831
|
+
ScriptAll = 1,
|
|
1832
|
+
ScriptAny = 2,
|
|
1833
|
+
ScriptNOfK = 3,
|
|
1834
|
+
TimelockStart = 4,
|
|
1835
|
+
TimelockExpiry = 5,
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
export class NativeScriptSource {
|
|
1839
|
+
private constructor();
|
|
1840
|
+
free(): void;
|
|
1841
|
+
[Symbol.dispose](): void;
|
|
1842
|
+
get_ref_script_size(): number | undefined;
|
|
1843
|
+
static new(script: NativeScript): NativeScriptSource;
|
|
1844
|
+
static new_ref_input(script_hash: ScriptHash, input: TransactionInput, script_size: number): NativeScriptSource;
|
|
1845
|
+
set_required_signers(key_hashes: Ed25519KeyHashes): void;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
export class NativeScripts {
|
|
1849
|
+
private constructor();
|
|
1850
|
+
free(): void;
|
|
1851
|
+
[Symbol.dispose](): void;
|
|
1852
|
+
add(elem: NativeScript): void;
|
|
1853
|
+
static from_bytes(bytes: Uint8Array): NativeScripts;
|
|
1854
|
+
static from_hex(hex_str: string): NativeScripts;
|
|
1855
|
+
static from_json(json: string): NativeScripts;
|
|
1856
|
+
get(index: number): NativeScript;
|
|
1857
|
+
len(): number;
|
|
1858
|
+
static new(): NativeScripts;
|
|
1859
|
+
to_bytes(): Uint8Array;
|
|
1860
|
+
to_hex(): string;
|
|
1861
|
+
to_js_value(): any;
|
|
1862
|
+
to_json(): string;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
export class NetworkId {
|
|
1866
|
+
private constructor();
|
|
1867
|
+
free(): void;
|
|
1868
|
+
[Symbol.dispose](): void;
|
|
1869
|
+
static from_bytes(bytes: Uint8Array): NetworkId;
|
|
1870
|
+
static from_hex(hex_str: string): NetworkId;
|
|
1871
|
+
static from_json(json: string): NetworkId;
|
|
1872
|
+
kind(): NetworkIdKind;
|
|
1873
|
+
static mainnet(): NetworkId;
|
|
1874
|
+
static testnet(): NetworkId;
|
|
1875
|
+
to_bytes(): Uint8Array;
|
|
1876
|
+
to_hex(): string;
|
|
1877
|
+
to_js_value(): any;
|
|
1878
|
+
to_json(): string;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
export enum NetworkIdKind {
|
|
1882
|
+
Testnet = 0,
|
|
1883
|
+
Mainnet = 1,
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
export class NetworkInfo {
|
|
1887
|
+
private constructor();
|
|
1888
|
+
free(): void;
|
|
1889
|
+
[Symbol.dispose](): void;
|
|
1890
|
+
static mainnet(): NetworkInfo;
|
|
1891
|
+
network_id(): number;
|
|
1892
|
+
static new(network_id: number, protocol_magic: number): NetworkInfo;
|
|
1893
|
+
protocol_magic(): number;
|
|
1894
|
+
static testnet_preprod(): NetworkInfo;
|
|
1895
|
+
static testnet_preview(): NetworkInfo;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
export class NewConstitutionAction {
|
|
1899
|
+
private constructor();
|
|
1900
|
+
free(): void;
|
|
1901
|
+
[Symbol.dispose](): void;
|
|
1902
|
+
constitution(): Constitution;
|
|
1903
|
+
static from_bytes(bytes: Uint8Array): NewConstitutionAction;
|
|
1904
|
+
static from_hex(hex_str: string): NewConstitutionAction;
|
|
1905
|
+
static from_json(json: string): NewConstitutionAction;
|
|
1906
|
+
gov_action_id(): GovernanceActionId | undefined;
|
|
1907
|
+
has_script_hash(): boolean;
|
|
1908
|
+
static new(constitution: Constitution): NewConstitutionAction;
|
|
1909
|
+
static new_with_action_id(gov_action_id: GovernanceActionId, constitution: Constitution): NewConstitutionAction;
|
|
1910
|
+
to_bytes(): Uint8Array;
|
|
1911
|
+
to_hex(): string;
|
|
1912
|
+
to_js_value(): any;
|
|
1913
|
+
to_json(): string;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
export class NoConfidenceAction {
|
|
1917
|
+
private constructor();
|
|
1918
|
+
free(): void;
|
|
1919
|
+
[Symbol.dispose](): void;
|
|
1920
|
+
static from_bytes(bytes: Uint8Array): NoConfidenceAction;
|
|
1921
|
+
static from_hex(hex_str: string): NoConfidenceAction;
|
|
1922
|
+
static from_json(json: string): NoConfidenceAction;
|
|
1923
|
+
gov_action_id(): GovernanceActionId | undefined;
|
|
1924
|
+
static new(): NoConfidenceAction;
|
|
1925
|
+
static new_with_action_id(gov_action_id: GovernanceActionId): NoConfidenceAction;
|
|
1926
|
+
to_bytes(): Uint8Array;
|
|
1927
|
+
to_hex(): string;
|
|
1928
|
+
to_js_value(): any;
|
|
1929
|
+
to_json(): string;
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
export class Nonce {
|
|
1933
|
+
private constructor();
|
|
1934
|
+
free(): void;
|
|
1935
|
+
[Symbol.dispose](): void;
|
|
1936
|
+
static from_bytes(bytes: Uint8Array): Nonce;
|
|
1937
|
+
static from_hex(hex_str: string): Nonce;
|
|
1938
|
+
static from_json(json: string): Nonce;
|
|
1939
|
+
get_hash(): Uint8Array | undefined;
|
|
1940
|
+
static new_from_hash(hash: Uint8Array): Nonce;
|
|
1941
|
+
static new_identity(): Nonce;
|
|
1942
|
+
to_bytes(): Uint8Array;
|
|
1943
|
+
to_hex(): string;
|
|
1944
|
+
to_js_value(): any;
|
|
1945
|
+
to_json(): string;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
export class OperationalCert {
|
|
1949
|
+
private constructor();
|
|
1950
|
+
free(): void;
|
|
1951
|
+
[Symbol.dispose](): void;
|
|
1952
|
+
static from_bytes(bytes: Uint8Array): OperationalCert;
|
|
1953
|
+
static from_hex(hex_str: string): OperationalCert;
|
|
1954
|
+
static from_json(json: string): OperationalCert;
|
|
1955
|
+
hot_vkey(): KESVKey;
|
|
1956
|
+
kes_period(): number;
|
|
1957
|
+
static new(hot_vkey: KESVKey, sequence_number: number, kes_period: number, sigma: Ed25519Signature): OperationalCert;
|
|
1958
|
+
sequence_number(): number;
|
|
1959
|
+
sigma(): Ed25519Signature;
|
|
1960
|
+
to_bytes(): Uint8Array;
|
|
1961
|
+
to_hex(): string;
|
|
1962
|
+
to_js_value(): any;
|
|
1963
|
+
to_json(): string;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
export class OutputDatum {
|
|
1967
|
+
private constructor();
|
|
1968
|
+
free(): void;
|
|
1969
|
+
[Symbol.dispose](): void;
|
|
1970
|
+
data(): PlutusData | undefined;
|
|
1971
|
+
data_hash(): DataHash | undefined;
|
|
1972
|
+
static new_data(data: PlutusData): OutputDatum;
|
|
1973
|
+
static new_data_hash(data_hash: DataHash): OutputDatum;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
export class ParameterChangeAction {
|
|
1977
|
+
private constructor();
|
|
1978
|
+
free(): void;
|
|
1979
|
+
[Symbol.dispose](): void;
|
|
1980
|
+
static from_bytes(bytes: Uint8Array): ParameterChangeAction;
|
|
1981
|
+
static from_hex(hex_str: string): ParameterChangeAction;
|
|
1982
|
+
static from_json(json: string): ParameterChangeAction;
|
|
1983
|
+
gov_action_id(): GovernanceActionId | undefined;
|
|
1984
|
+
static new(protocol_param_updates: ProtocolParamUpdate): ParameterChangeAction;
|
|
1985
|
+
static new_with_action_id(gov_action_id: GovernanceActionId, protocol_param_updates: ProtocolParamUpdate): ParameterChangeAction;
|
|
1986
|
+
static new_with_policy_hash(protocol_param_updates: ProtocolParamUpdate, policy_hash: ScriptHash): ParameterChangeAction;
|
|
1987
|
+
static new_with_policy_hash_and_action_id(gov_action_id: GovernanceActionId, protocol_param_updates: ProtocolParamUpdate, policy_hash: ScriptHash): ParameterChangeAction;
|
|
1988
|
+
policy_hash(): ScriptHash | undefined;
|
|
1989
|
+
protocol_param_updates(): ProtocolParamUpdate;
|
|
1990
|
+
to_bytes(): Uint8Array;
|
|
1991
|
+
to_hex(): string;
|
|
1992
|
+
to_js_value(): any;
|
|
1993
|
+
to_json(): string;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
export class PlutusData {
|
|
1997
|
+
private constructor();
|
|
1998
|
+
free(): void;
|
|
1999
|
+
[Symbol.dispose](): void;
|
|
2000
|
+
as_address(network: NetworkInfo): Address;
|
|
2001
|
+
as_bytes(): Uint8Array | undefined;
|
|
2002
|
+
as_constr_plutus_data(): ConstrPlutusData | undefined;
|
|
2003
|
+
as_integer(): BigInt | undefined;
|
|
2004
|
+
as_list(): PlutusList | undefined;
|
|
2005
|
+
as_map(): PlutusMap | undefined;
|
|
2006
|
+
static from_address(address: Address): PlutusData;
|
|
2007
|
+
static from_bytes(bytes: Uint8Array): PlutusData;
|
|
2008
|
+
static from_hex(hex_str: string): PlutusData;
|
|
2009
|
+
static from_json(json: string, schema: PlutusDatumSchema): PlutusData;
|
|
2010
|
+
kind(): PlutusDataKind;
|
|
2011
|
+
static new_bytes(bytes: Uint8Array): PlutusData;
|
|
2012
|
+
static new_constr_plutus_data(constr_plutus_data: ConstrPlutusData): PlutusData;
|
|
2013
|
+
/**
|
|
2014
|
+
* Same as `.new_constr_plutus_data` but creates constr with empty data list
|
|
2015
|
+
*/
|
|
2016
|
+
static new_empty_constr_plutus_data(alternative: BigNum): PlutusData;
|
|
2017
|
+
static new_integer(integer: BigInt): PlutusData;
|
|
2018
|
+
static new_list(list: PlutusList): PlutusData;
|
|
2019
|
+
static new_map(map: PlutusMap): PlutusData;
|
|
2020
|
+
static new_single_value_constr_plutus_data(alternative: BigNum, plutus_data: PlutusData): PlutusData;
|
|
2021
|
+
to_bytes(): Uint8Array;
|
|
2022
|
+
to_hex(): string;
|
|
2023
|
+
to_json(schema: PlutusDatumSchema): string;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
export enum PlutusDataKind {
|
|
2027
|
+
ConstrPlutusData = 0,
|
|
2028
|
+
Map = 1,
|
|
2029
|
+
List = 2,
|
|
2030
|
+
Integer = 3,
|
|
2031
|
+
Bytes = 4,
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* JSON <-> PlutusData conversion schemas.
|
|
2036
|
+
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
2037
|
+
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
2038
|
+
*
|
|
2039
|
+
* All methods here have the following restrictions due to limitations on dependencies:
|
|
2040
|
+
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
2041
|
+
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
2042
|
+
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
2043
|
+
* on either side when tested so proceed with caution
|
|
2044
|
+
*/
|
|
2045
|
+
export enum PlutusDatumSchema {
|
|
2046
|
+
/**
|
|
2047
|
+
* ScriptDataJsonNoSchema in cardano-node.
|
|
2048
|
+
*
|
|
2049
|
+
* This is the format used by --script-data-value in cardano-cli
|
|
2050
|
+
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
2051
|
+
* From JSON:
|
|
2052
|
+
* * null/true/false/floats NOT supported
|
|
2053
|
+
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
2054
|
+
* To JSON:
|
|
2055
|
+
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
2056
|
+
* * Lists not supported in keys
|
|
2057
|
+
* * Maps not supported in keys
|
|
2058
|
+
*/
|
|
2059
|
+
BasicConversions = 0,
|
|
2060
|
+
/**
|
|
2061
|
+
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
2062
|
+
*
|
|
2063
|
+
* This is the format used by --script-data-file in cardano-cli
|
|
2064
|
+
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
2065
|
+
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
2066
|
+
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
2067
|
+
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
2068
|
+
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
2069
|
+
* Integer's value is a JSON number e.g. {"int": 100}
|
|
2070
|
+
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
2071
|
+
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
2072
|
+
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
2073
|
+
* respectively with their values being the plutus datum encoded via this same schema
|
|
2074
|
+
* e.g. {"map": [
|
|
2075
|
+
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
2076
|
+
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
2077
|
+
* ]}
|
|
2078
|
+
* From JSON:
|
|
2079
|
+
* * null/true/false/floats NOT supported
|
|
2080
|
+
* * the JSON must conform to a very specific schema
|
|
2081
|
+
* To JSON:
|
|
2082
|
+
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
2083
|
+
*/
|
|
2084
|
+
DetailedSchema = 1,
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
export class PlutusList {
|
|
2088
|
+
private constructor();
|
|
2089
|
+
free(): void;
|
|
2090
|
+
[Symbol.dispose](): void;
|
|
2091
|
+
add(elem: PlutusData): void;
|
|
2092
|
+
static from_bytes(bytes: Uint8Array): PlutusList;
|
|
2093
|
+
static from_hex(hex_str: string): PlutusList;
|
|
2094
|
+
get(index: number): PlutusData;
|
|
2095
|
+
len(): number;
|
|
2096
|
+
static new(): PlutusList;
|
|
2097
|
+
to_bytes(): Uint8Array;
|
|
2098
|
+
to_hex(): string;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
export class PlutusMap {
|
|
2102
|
+
private constructor();
|
|
2103
|
+
free(): void;
|
|
2104
|
+
[Symbol.dispose](): void;
|
|
2105
|
+
static from_bytes(bytes: Uint8Array): PlutusMap;
|
|
2106
|
+
static from_hex(hex_str: string): PlutusMap;
|
|
2107
|
+
get(key: PlutusData): PlutusMapValues | undefined;
|
|
2108
|
+
/**
|
|
2109
|
+
* Returns the previous value associated with the key, if any.
|
|
2110
|
+
* Replace the values associated with the key.
|
|
2111
|
+
*/
|
|
2112
|
+
insert(key: PlutusData, values: PlutusMapValues): PlutusMapValues | undefined;
|
|
2113
|
+
keys(): PlutusList;
|
|
2114
|
+
/**
|
|
2115
|
+
* Return count ok different keys in the map.
|
|
2116
|
+
*/
|
|
2117
|
+
len(): number;
|
|
2118
|
+
static new(): PlutusMap;
|
|
2119
|
+
to_bytes(): Uint8Array;
|
|
2120
|
+
to_hex(): string;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
export class PlutusMapValues {
|
|
2124
|
+
private constructor();
|
|
2125
|
+
free(): void;
|
|
2126
|
+
[Symbol.dispose](): void;
|
|
2127
|
+
add(elem: PlutusData): void;
|
|
2128
|
+
get(index: number): PlutusData | undefined;
|
|
2129
|
+
len(): number;
|
|
2130
|
+
static new(): PlutusMapValues;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
export class PlutusScript {
|
|
2134
|
+
private constructor();
|
|
2135
|
+
free(): void;
|
|
2136
|
+
[Symbol.dispose](): void;
|
|
2137
|
+
/**
|
|
2138
|
+
*
|
|
2139
|
+
* * The raw bytes of this compiled Plutus script.
|
|
2140
|
+
* * If you need "cborBytes" for cardano-cli use PlutusScript::to_bytes() instead.
|
|
2141
|
+
*
|
|
2142
|
+
*/
|
|
2143
|
+
bytes(): Uint8Array;
|
|
2144
|
+
static from_bytes(bytes: Uint8Array): PlutusScript;
|
|
2145
|
+
/**
|
|
2146
|
+
* Same as `.from_bytes` but will consider the script as requiring the Plutus Language V2
|
|
2147
|
+
*/
|
|
2148
|
+
static from_bytes_v2(bytes: Uint8Array): PlutusScript;
|
|
2149
|
+
/**
|
|
2150
|
+
* Same as `.from_bytes` but will consider the script as requiring the Plutus Language V3
|
|
2151
|
+
*/
|
|
2152
|
+
static from_bytes_v3(bytes: Uint8Array): PlutusScript;
|
|
2153
|
+
/**
|
|
2154
|
+
* Same as `.from_bytes` but will consider the script as requiring the specified language version
|
|
2155
|
+
*/
|
|
2156
|
+
static from_bytes_with_version(bytes: Uint8Array, language: Language): PlutusScript;
|
|
2157
|
+
static from_hex(hex_str: string): PlutusScript;
|
|
2158
|
+
/**
|
|
2159
|
+
* Same as .from_hex but will consider the script as requiring the specified language version
|
|
2160
|
+
*/
|
|
2161
|
+
static from_hex_with_version(hex_str: string, language: Language): PlutusScript;
|
|
2162
|
+
hash(): ScriptHash;
|
|
2163
|
+
language_version(): Language;
|
|
2164
|
+
/**
|
|
2165
|
+
*
|
|
2166
|
+
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
2167
|
+
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
2168
|
+
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
2169
|
+
*
|
|
2170
|
+
*/
|
|
2171
|
+
static new(bytes: Uint8Array): PlutusScript;
|
|
2172
|
+
/**
|
|
2173
|
+
*
|
|
2174
|
+
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
2175
|
+
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
2176
|
+
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
2177
|
+
*
|
|
2178
|
+
*/
|
|
2179
|
+
static new_v2(bytes: Uint8Array): PlutusScript;
|
|
2180
|
+
/**
|
|
2181
|
+
*
|
|
2182
|
+
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
2183
|
+
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
2184
|
+
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
2185
|
+
*
|
|
2186
|
+
*/
|
|
2187
|
+
static new_v3(bytes: Uint8Array): PlutusScript;
|
|
2188
|
+
/**
|
|
2189
|
+
*
|
|
2190
|
+
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
2191
|
+
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
2192
|
+
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
2193
|
+
*
|
|
2194
|
+
*/
|
|
2195
|
+
static new_with_version(bytes: Uint8Array, language: Language): PlutusScript;
|
|
2196
|
+
to_bytes(): Uint8Array;
|
|
2197
|
+
to_hex(): string;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
export class PlutusScriptSource {
|
|
2201
|
+
private constructor();
|
|
2202
|
+
free(): void;
|
|
2203
|
+
[Symbol.dispose](): void;
|
|
2204
|
+
get_ref_script_size(): number | undefined;
|
|
2205
|
+
static new(script: PlutusScript): PlutusScriptSource;
|
|
2206
|
+
static new_ref_input(script_hash: ScriptHash, input: TransactionInput, lang_ver: Language, script_size: number): PlutusScriptSource;
|
|
2207
|
+
set_required_signers(key_hashes: Ed25519KeyHashes): void;
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
export class PlutusScripts {
|
|
2211
|
+
private constructor();
|
|
2212
|
+
free(): void;
|
|
2213
|
+
[Symbol.dispose](): void;
|
|
2214
|
+
add(elem: PlutusScript): void;
|
|
2215
|
+
static from_bytes(bytes: Uint8Array): PlutusScripts;
|
|
2216
|
+
static from_hex(hex_str: string): PlutusScripts;
|
|
2217
|
+
static from_json(json: string): PlutusScripts;
|
|
2218
|
+
get(index: number): PlutusScript;
|
|
2219
|
+
len(): number;
|
|
2220
|
+
static new(): PlutusScripts;
|
|
2221
|
+
to_bytes(): Uint8Array;
|
|
2222
|
+
to_hex(): string;
|
|
2223
|
+
to_js_value(): any;
|
|
2224
|
+
to_json(): string;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
export class PlutusWitness {
|
|
2228
|
+
private constructor();
|
|
2229
|
+
free(): void;
|
|
2230
|
+
[Symbol.dispose](): void;
|
|
2231
|
+
datum(): PlutusData | undefined;
|
|
2232
|
+
static new(script: PlutusScript, datum: PlutusData, redeemer: Redeemer): PlutusWitness;
|
|
2233
|
+
static new_with_ref(script: PlutusScriptSource, datum: DatumSource, redeemer: Redeemer): PlutusWitness;
|
|
2234
|
+
static new_with_ref_without_datum(script: PlutusScriptSource, redeemer: Redeemer): PlutusWitness;
|
|
2235
|
+
static new_without_datum(script: PlutusScript, redeemer: Redeemer): PlutusWitness;
|
|
2236
|
+
redeemer(): Redeemer;
|
|
2237
|
+
script(): PlutusScript | undefined;
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
export class PlutusWitnesses {
|
|
2241
|
+
private constructor();
|
|
2242
|
+
free(): void;
|
|
2243
|
+
[Symbol.dispose](): void;
|
|
2244
|
+
add(elem: PlutusWitness): void;
|
|
2245
|
+
get(index: number): PlutusWitness;
|
|
2246
|
+
len(): number;
|
|
2247
|
+
static new(): PlutusWitnesses;
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
export class Pointer {
|
|
2251
|
+
private constructor();
|
|
2252
|
+
free(): void;
|
|
2253
|
+
[Symbol.dispose](): void;
|
|
2254
|
+
cert_index(): number;
|
|
2255
|
+
cert_index_bignum(): BigNum;
|
|
2256
|
+
/**
|
|
2257
|
+
* !!! DEPRECATED !!!
|
|
2258
|
+
* This constructor uses outdated slot number format for the ttl value, tx_index and cert_index.
|
|
2259
|
+
* Use `.new_pointer` instead
|
|
2260
|
+
*/
|
|
2261
|
+
static new(slot: number, tx_index: number, cert_index: number): Pointer;
|
|
2262
|
+
static new_pointer(slot: BigNum, tx_index: BigNum, cert_index: BigNum): Pointer;
|
|
2263
|
+
slot(): number;
|
|
2264
|
+
slot_bignum(): BigNum;
|
|
2265
|
+
tx_index(): number;
|
|
2266
|
+
tx_index_bignum(): BigNum;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
export class PointerAddress {
|
|
2270
|
+
private constructor();
|
|
2271
|
+
free(): void;
|
|
2272
|
+
[Symbol.dispose](): void;
|
|
2273
|
+
static from_address(addr: Address): PointerAddress | undefined;
|
|
2274
|
+
network_id(): number;
|
|
2275
|
+
static new(network: number, payment: Credential, stake: Pointer): PointerAddress;
|
|
2276
|
+
payment_cred(): Credential;
|
|
2277
|
+
stake_pointer(): Pointer;
|
|
2278
|
+
to_address(): Address;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
export class PoolMetadata {
|
|
2282
|
+
private constructor();
|
|
2283
|
+
free(): void;
|
|
2284
|
+
[Symbol.dispose](): void;
|
|
2285
|
+
static from_bytes(bytes: Uint8Array): PoolMetadata;
|
|
2286
|
+
static from_hex(hex_str: string): PoolMetadata;
|
|
2287
|
+
static from_json(json: string): PoolMetadata;
|
|
2288
|
+
static new(url: URL, pool_metadata_hash: PoolMetadataHash): PoolMetadata;
|
|
2289
|
+
pool_metadata_hash(): PoolMetadataHash;
|
|
2290
|
+
to_bytes(): Uint8Array;
|
|
2291
|
+
to_hex(): string;
|
|
2292
|
+
to_js_value(): any;
|
|
2293
|
+
to_json(): string;
|
|
2294
|
+
url(): URL;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
export class PoolMetadataHash {
|
|
2298
|
+
private constructor();
|
|
2299
|
+
free(): void;
|
|
2300
|
+
[Symbol.dispose](): void;
|
|
2301
|
+
static from_bech32(bech_str: string): PoolMetadataHash;
|
|
2302
|
+
static from_bytes(bytes: Uint8Array): PoolMetadataHash;
|
|
2303
|
+
static from_hex(hex: string): PoolMetadataHash;
|
|
2304
|
+
to_bech32(prefix: string): string;
|
|
2305
|
+
to_bytes(): Uint8Array;
|
|
2306
|
+
to_hex(): string;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
export class PoolParams {
|
|
2310
|
+
private constructor();
|
|
2311
|
+
free(): void;
|
|
2312
|
+
[Symbol.dispose](): void;
|
|
2313
|
+
cost(): BigNum;
|
|
2314
|
+
static from_bytes(bytes: Uint8Array): PoolParams;
|
|
2315
|
+
static from_hex(hex_str: string): PoolParams;
|
|
2316
|
+
static from_json(json: string): PoolParams;
|
|
2317
|
+
margin(): UnitInterval;
|
|
2318
|
+
static new(operator: Ed25519KeyHash, vrf_keyhash: VRFKeyHash, pledge: BigNum, cost: BigNum, margin: UnitInterval, reward_account: RewardAddress, pool_owners: Ed25519KeyHashes, relays: Relays, pool_metadata?: PoolMetadata | null): PoolParams;
|
|
2319
|
+
operator(): Ed25519KeyHash;
|
|
2320
|
+
pledge(): BigNum;
|
|
2321
|
+
pool_metadata(): PoolMetadata | undefined;
|
|
2322
|
+
pool_owners(): Ed25519KeyHashes;
|
|
2323
|
+
relays(): Relays;
|
|
2324
|
+
reward_account(): RewardAddress;
|
|
2325
|
+
to_bytes(): Uint8Array;
|
|
2326
|
+
to_hex(): string;
|
|
2327
|
+
to_js_value(): any;
|
|
2328
|
+
to_json(): string;
|
|
2329
|
+
vrf_keyhash(): VRFKeyHash;
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
export class PoolRegistration {
|
|
2333
|
+
private constructor();
|
|
2334
|
+
free(): void;
|
|
2335
|
+
[Symbol.dispose](): void;
|
|
2336
|
+
static from_bytes(bytes: Uint8Array): PoolRegistration;
|
|
2337
|
+
static from_hex(hex_str: string): PoolRegistration;
|
|
2338
|
+
static from_json(json: string): PoolRegistration;
|
|
2339
|
+
static new(pool_params: PoolParams): PoolRegistration;
|
|
2340
|
+
pool_params(): PoolParams;
|
|
2341
|
+
to_bytes(): Uint8Array;
|
|
2342
|
+
to_hex(): string;
|
|
2343
|
+
to_js_value(): any;
|
|
2344
|
+
to_json(): string;
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
export class PoolRetirement {
|
|
2348
|
+
private constructor();
|
|
2349
|
+
free(): void;
|
|
2350
|
+
[Symbol.dispose](): void;
|
|
2351
|
+
epoch(): number;
|
|
2352
|
+
static from_bytes(bytes: Uint8Array): PoolRetirement;
|
|
2353
|
+
static from_hex(hex_str: string): PoolRetirement;
|
|
2354
|
+
static from_json(json: string): PoolRetirement;
|
|
2355
|
+
static new(pool_keyhash: Ed25519KeyHash, epoch: number): PoolRetirement;
|
|
2356
|
+
pool_keyhash(): Ed25519KeyHash;
|
|
2357
|
+
to_bytes(): Uint8Array;
|
|
2358
|
+
to_hex(): string;
|
|
2359
|
+
to_js_value(): any;
|
|
2360
|
+
to_json(): string;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
export class PoolVotingThresholds {
|
|
2364
|
+
private constructor();
|
|
2365
|
+
free(): void;
|
|
2366
|
+
[Symbol.dispose](): void;
|
|
2367
|
+
committee_no_confidence(): UnitInterval;
|
|
2368
|
+
committee_normal(): UnitInterval;
|
|
2369
|
+
static from_bytes(bytes: Uint8Array): PoolVotingThresholds;
|
|
2370
|
+
static from_hex(hex_str: string): PoolVotingThresholds;
|
|
2371
|
+
static from_json(json: string): PoolVotingThresholds;
|
|
2372
|
+
hard_fork_initiation(): UnitInterval;
|
|
2373
|
+
motion_no_confidence(): UnitInterval;
|
|
2374
|
+
static new(motion_no_confidence: UnitInterval, committee_normal: UnitInterval, committee_no_confidence: UnitInterval, hard_fork_initiation: UnitInterval, security_relevant_threshold: UnitInterval): PoolVotingThresholds;
|
|
2375
|
+
security_relevant_threshold(): UnitInterval;
|
|
2376
|
+
to_bytes(): Uint8Array;
|
|
2377
|
+
to_hex(): string;
|
|
2378
|
+
to_js_value(): any;
|
|
2379
|
+
to_json(): string;
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
export class PrivateKey {
|
|
2383
|
+
private constructor();
|
|
2384
|
+
free(): void;
|
|
2385
|
+
[Symbol.dispose](): void;
|
|
2386
|
+
as_bytes(): Uint8Array;
|
|
2387
|
+
/**
|
|
2388
|
+
* Get private key from its bech32 representation
|
|
2389
|
+
* ```javascript
|
|
2390
|
+
* PrivateKey.from_bech32('ed25519_sk1ahfetf02qwwg4dkq7mgp4a25lx5vh9920cr5wnxmpzz9906qvm8qwvlts0');
|
|
2391
|
+
* ```
|
|
2392
|
+
* For an extended 25519 key
|
|
2393
|
+
* ```javascript
|
|
2394
|
+
* PrivateKey.from_bech32('ed25519e_sk1gqwl4szuwwh6d0yk3nsqcc6xxc3fpvjlevgwvt60df59v8zd8f8prazt8ln3lmz096ux3xvhhvm3ca9wj2yctdh3pnw0szrma07rt5gl748fp');
|
|
2395
|
+
* ```
|
|
2396
|
+
*/
|
|
2397
|
+
static from_bech32(bech32_str: string): PrivateKey;
|
|
2398
|
+
static from_extended_bytes(bytes: Uint8Array): PrivateKey;
|
|
2399
|
+
static from_hex(hex_str: string): PrivateKey;
|
|
2400
|
+
static from_normal_bytes(bytes: Uint8Array): PrivateKey;
|
|
2401
|
+
static generate_ed25519(): PrivateKey;
|
|
2402
|
+
static generate_ed25519extended(): PrivateKey;
|
|
2403
|
+
sign(message: Uint8Array): Ed25519Signature;
|
|
2404
|
+
to_bech32(): string;
|
|
2405
|
+
to_hex(): string;
|
|
2406
|
+
to_public(): PublicKey;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
export class ProposedProtocolParameterUpdates {
|
|
2410
|
+
private constructor();
|
|
2411
|
+
free(): void;
|
|
2412
|
+
[Symbol.dispose](): void;
|
|
2413
|
+
static from_bytes(bytes: Uint8Array): ProposedProtocolParameterUpdates;
|
|
2414
|
+
static from_hex(hex_str: string): ProposedProtocolParameterUpdates;
|
|
2415
|
+
static from_json(json: string): ProposedProtocolParameterUpdates;
|
|
2416
|
+
get(key: GenesisHash): ProtocolParamUpdate | undefined;
|
|
2417
|
+
insert(key: GenesisHash, value: ProtocolParamUpdate): ProtocolParamUpdate | undefined;
|
|
2418
|
+
keys(): GenesisHashes;
|
|
2419
|
+
len(): number;
|
|
2420
|
+
static new(): ProposedProtocolParameterUpdates;
|
|
2421
|
+
to_bytes(): Uint8Array;
|
|
2422
|
+
to_hex(): string;
|
|
2423
|
+
to_js_value(): any;
|
|
2424
|
+
to_json(): string;
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
export class ProtocolParamUpdate {
|
|
2428
|
+
private constructor();
|
|
2429
|
+
free(): void;
|
|
2430
|
+
[Symbol.dispose](): void;
|
|
2431
|
+
ada_per_utxo_byte(): BigNum | undefined;
|
|
2432
|
+
collateral_percentage(): number | undefined;
|
|
2433
|
+
committee_term_limit(): number | undefined;
|
|
2434
|
+
cost_models(): Costmdls | undefined;
|
|
2435
|
+
/**
|
|
2436
|
+
* !!! DEPRECATED !!!
|
|
2437
|
+
* Since babbage era this param is outdated. But this param you can meet in a pre-babbage block.
|
|
2438
|
+
*/
|
|
2439
|
+
d(): UnitInterval | undefined;
|
|
2440
|
+
drep_deposit(): BigNum | undefined;
|
|
2441
|
+
drep_inactivity_period(): number | undefined;
|
|
2442
|
+
drep_voting_thresholds(): DRepVotingThresholds | undefined;
|
|
2443
|
+
execution_costs(): ExUnitPrices | undefined;
|
|
2444
|
+
expansion_rate(): UnitInterval | undefined;
|
|
2445
|
+
/**
|
|
2446
|
+
* !!! DEPRECATED !!!
|
|
2447
|
+
* Since babbage era this param is outdated. But this param you can meet in a pre-babbage block.
|
|
2448
|
+
*/
|
|
2449
|
+
extra_entropy(): Nonce | undefined;
|
|
2450
|
+
static from_bytes(bytes: Uint8Array): ProtocolParamUpdate;
|
|
2451
|
+
static from_hex(hex_str: string): ProtocolParamUpdate;
|
|
2452
|
+
static from_json(json: string): ProtocolParamUpdate;
|
|
2453
|
+
governance_action_deposit(): BigNum | undefined;
|
|
2454
|
+
governance_action_validity_period(): number | undefined;
|
|
2455
|
+
key_deposit(): BigNum | undefined;
|
|
2456
|
+
max_block_body_size(): number | undefined;
|
|
2457
|
+
max_block_ex_units(): ExUnits | undefined;
|
|
2458
|
+
max_block_header_size(): number | undefined;
|
|
2459
|
+
max_collateral_inputs(): number | undefined;
|
|
2460
|
+
max_epoch(): number | undefined;
|
|
2461
|
+
max_tx_ex_units(): ExUnits | undefined;
|
|
2462
|
+
max_tx_size(): number | undefined;
|
|
2463
|
+
max_value_size(): number | undefined;
|
|
2464
|
+
min_committee_size(): number | undefined;
|
|
2465
|
+
min_pool_cost(): BigNum | undefined;
|
|
2466
|
+
minfee_a(): BigNum | undefined;
|
|
2467
|
+
minfee_b(): BigNum | undefined;
|
|
2468
|
+
n_opt(): number | undefined;
|
|
2469
|
+
static new(): ProtocolParamUpdate;
|
|
2470
|
+
pool_deposit(): BigNum | undefined;
|
|
2471
|
+
pool_pledge_influence(): UnitInterval | undefined;
|
|
2472
|
+
pool_voting_thresholds(): PoolVotingThresholds | undefined;
|
|
2473
|
+
protocol_version(): ProtocolVersion | undefined;
|
|
2474
|
+
ref_script_coins_per_byte(): UnitInterval | undefined;
|
|
2475
|
+
set_ada_per_utxo_byte(ada_per_utxo_byte: BigNum): void;
|
|
2476
|
+
set_collateral_percentage(collateral_percentage: number): void;
|
|
2477
|
+
set_committee_term_limit(committee_term_limit: number): void;
|
|
2478
|
+
set_cost_models(cost_models: Costmdls): void;
|
|
2479
|
+
set_drep_deposit(drep_deposit: BigNum): void;
|
|
2480
|
+
set_drep_inactivity_period(drep_inactivity_period: number): void;
|
|
2481
|
+
set_drep_voting_thresholds(drep_voting_thresholds: DRepVotingThresholds): void;
|
|
2482
|
+
set_execution_costs(execution_costs: ExUnitPrices): void;
|
|
2483
|
+
set_expansion_rate(expansion_rate: UnitInterval): void;
|
|
2484
|
+
set_governance_action_deposit(governance_action_deposit: BigNum): void;
|
|
2485
|
+
set_governance_action_validity_period(governance_action_validity_period: number): void;
|
|
2486
|
+
set_key_deposit(key_deposit: BigNum): void;
|
|
2487
|
+
set_max_block_body_size(max_block_body_size: number): void;
|
|
2488
|
+
set_max_block_ex_units(max_block_ex_units: ExUnits): void;
|
|
2489
|
+
set_max_block_header_size(max_block_header_size: number): void;
|
|
2490
|
+
set_max_collateral_inputs(max_collateral_inputs: number): void;
|
|
2491
|
+
set_max_epoch(max_epoch: number): void;
|
|
2492
|
+
set_max_tx_ex_units(max_tx_ex_units: ExUnits): void;
|
|
2493
|
+
set_max_tx_size(max_tx_size: number): void;
|
|
2494
|
+
set_max_value_size(max_value_size: number): void;
|
|
2495
|
+
set_min_committee_size(min_committee_size: number): void;
|
|
2496
|
+
set_min_pool_cost(min_pool_cost: BigNum): void;
|
|
2497
|
+
set_minfee_a(minfee_a: BigNum): void;
|
|
2498
|
+
set_minfee_b(minfee_b: BigNum): void;
|
|
2499
|
+
set_n_opt(n_opt: number): void;
|
|
2500
|
+
set_pool_deposit(pool_deposit: BigNum): void;
|
|
2501
|
+
set_pool_pledge_influence(pool_pledge_influence: UnitInterval): void;
|
|
2502
|
+
set_pool_voting_thresholds(pool_voting_thresholds: PoolVotingThresholds): void;
|
|
2503
|
+
/**
|
|
2504
|
+
* !!! DEPRECATED !!!
|
|
2505
|
+
* Since conway era this param is outdated. But this param you can meet in a pre-conway block.
|
|
2506
|
+
*/
|
|
2507
|
+
set_protocol_version(protocol_version: ProtocolVersion): void;
|
|
2508
|
+
set_ref_script_coins_per_byte(ref_script_coins_per_byte: UnitInterval): void;
|
|
2509
|
+
set_treasury_growth_rate(treasury_growth_rate: UnitInterval): void;
|
|
2510
|
+
to_bytes(): Uint8Array;
|
|
2511
|
+
to_hex(): string;
|
|
2512
|
+
to_js_value(): any;
|
|
2513
|
+
to_json(): string;
|
|
2514
|
+
treasury_growth_rate(): UnitInterval | undefined;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
export class ProtocolVersion {
|
|
2518
|
+
private constructor();
|
|
2519
|
+
free(): void;
|
|
2520
|
+
[Symbol.dispose](): void;
|
|
2521
|
+
static from_bytes(bytes: Uint8Array): ProtocolVersion;
|
|
2522
|
+
static from_hex(hex_str: string): ProtocolVersion;
|
|
2523
|
+
static from_json(json: string): ProtocolVersion;
|
|
2524
|
+
major(): number;
|
|
2525
|
+
minor(): number;
|
|
2526
|
+
static new(major: number, minor: number): ProtocolVersion;
|
|
2527
|
+
to_bytes(): Uint8Array;
|
|
2528
|
+
to_hex(): string;
|
|
2529
|
+
to_js_value(): any;
|
|
2530
|
+
to_json(): string;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
/**
|
|
2534
|
+
* ED25519 key used as public key
|
|
2535
|
+
*/
|
|
2536
|
+
export class PublicKey {
|
|
2537
|
+
private constructor();
|
|
2538
|
+
free(): void;
|
|
2539
|
+
[Symbol.dispose](): void;
|
|
2540
|
+
as_bytes(): Uint8Array;
|
|
2541
|
+
/**
|
|
2542
|
+
* Get public key from its bech32 representation
|
|
2543
|
+
* Example:
|
|
2544
|
+
* ```javascript
|
|
2545
|
+
* const pkey = PublicKey.from_bech32('ed25519_pk1dgaagyh470y66p899txcl3r0jaeaxu6yd7z2dxyk55qcycdml8gszkxze2');
|
|
2546
|
+
* ```
|
|
2547
|
+
*/
|
|
2548
|
+
static from_bech32(bech32_str: string): PublicKey;
|
|
2549
|
+
static from_bytes(bytes: Uint8Array): PublicKey;
|
|
2550
|
+
static from_hex(hex_str: string): PublicKey;
|
|
2551
|
+
hash(): Ed25519KeyHash;
|
|
2552
|
+
to_bech32(): string;
|
|
2553
|
+
to_hex(): string;
|
|
2554
|
+
verify(data: Uint8Array, signature: Ed25519Signature): boolean;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
export class PublicKeys {
|
|
2558
|
+
free(): void;
|
|
2559
|
+
[Symbol.dispose](): void;
|
|
2560
|
+
add(key: PublicKey): void;
|
|
2561
|
+
get(index: number): PublicKey;
|
|
2562
|
+
constructor();
|
|
2563
|
+
size(): number;
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
export class Redeemer {
|
|
2567
|
+
private constructor();
|
|
2568
|
+
free(): void;
|
|
2569
|
+
[Symbol.dispose](): void;
|
|
2570
|
+
data(): PlutusData;
|
|
2571
|
+
ex_units(): ExUnits;
|
|
2572
|
+
static from_bytes(bytes: Uint8Array): Redeemer;
|
|
2573
|
+
static from_hex(hex_str: string): Redeemer;
|
|
2574
|
+
static from_json(json: string): Redeemer;
|
|
2575
|
+
index(): BigNum;
|
|
2576
|
+
static new(tag: RedeemerTag, index: BigNum, data: PlutusData, ex_units: ExUnits): Redeemer;
|
|
2577
|
+
tag(): RedeemerTag;
|
|
2578
|
+
to_bytes(): Uint8Array;
|
|
2579
|
+
to_hex(): string;
|
|
2580
|
+
to_js_value(): any;
|
|
2581
|
+
to_json(): string;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
export class RedeemerTag {
|
|
2585
|
+
private constructor();
|
|
2586
|
+
free(): void;
|
|
2587
|
+
[Symbol.dispose](): void;
|
|
2588
|
+
static from_bytes(bytes: Uint8Array): RedeemerTag;
|
|
2589
|
+
static from_hex(hex_str: string): RedeemerTag;
|
|
2590
|
+
static from_json(json: string): RedeemerTag;
|
|
2591
|
+
kind(): RedeemerTagKind;
|
|
2592
|
+
static new_cert(): RedeemerTag;
|
|
2593
|
+
static new_mint(): RedeemerTag;
|
|
2594
|
+
static new_reward(): RedeemerTag;
|
|
2595
|
+
static new_spend(): RedeemerTag;
|
|
2596
|
+
static new_vote(): RedeemerTag;
|
|
2597
|
+
static new_voting_proposal(): RedeemerTag;
|
|
2598
|
+
to_bytes(): Uint8Array;
|
|
2599
|
+
to_hex(): string;
|
|
2600
|
+
to_js_value(): any;
|
|
2601
|
+
to_json(): string;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
export enum RedeemerTagKind {
|
|
2605
|
+
Spend = 0,
|
|
2606
|
+
Mint = 1,
|
|
2607
|
+
Cert = 2,
|
|
2608
|
+
Reward = 3,
|
|
2609
|
+
Vote = 4,
|
|
2610
|
+
VotingProposal = 5,
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
export class Redeemers {
|
|
2614
|
+
private constructor();
|
|
2615
|
+
free(): void;
|
|
2616
|
+
[Symbol.dispose](): void;
|
|
2617
|
+
add(elem: Redeemer): void;
|
|
2618
|
+
static from_bytes(bytes: Uint8Array): Redeemers;
|
|
2619
|
+
static from_hex(hex_str: string): Redeemers;
|
|
2620
|
+
static from_json(json: string): Redeemers;
|
|
2621
|
+
get(index: number): Redeemer;
|
|
2622
|
+
/**
|
|
2623
|
+
* WARNING: This function will be removed in after next hard fork
|
|
2624
|
+
*/
|
|
2625
|
+
get_container_type(): CborContainerType;
|
|
2626
|
+
len(): number;
|
|
2627
|
+
static new(): Redeemers;
|
|
2628
|
+
to_bytes(): Uint8Array;
|
|
2629
|
+
to_hex(): string;
|
|
2630
|
+
to_js_value(): any;
|
|
2631
|
+
to_json(): string;
|
|
2632
|
+
total_ex_units(): ExUnits;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
export class Relay {
|
|
2636
|
+
private constructor();
|
|
2637
|
+
free(): void;
|
|
2638
|
+
[Symbol.dispose](): void;
|
|
2639
|
+
as_multi_host_name(): MultiHostName | undefined;
|
|
2640
|
+
as_single_host_addr(): SingleHostAddr | undefined;
|
|
2641
|
+
as_single_host_name(): SingleHostName | undefined;
|
|
2642
|
+
static from_bytes(bytes: Uint8Array): Relay;
|
|
2643
|
+
static from_hex(hex_str: string): Relay;
|
|
2644
|
+
static from_json(json: string): Relay;
|
|
2645
|
+
kind(): RelayKind;
|
|
2646
|
+
static new_multi_host_name(multi_host_name: MultiHostName): Relay;
|
|
2647
|
+
static new_single_host_addr(single_host_addr: SingleHostAddr): Relay;
|
|
2648
|
+
static new_single_host_name(single_host_name: SingleHostName): Relay;
|
|
2649
|
+
to_bytes(): Uint8Array;
|
|
2650
|
+
to_hex(): string;
|
|
2651
|
+
to_js_value(): any;
|
|
2652
|
+
to_json(): string;
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
export enum RelayKind {
|
|
2656
|
+
SingleHostAddr = 0,
|
|
2657
|
+
SingleHostName = 1,
|
|
2658
|
+
MultiHostName = 2,
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
export class Relays {
|
|
2662
|
+
private constructor();
|
|
2663
|
+
free(): void;
|
|
2664
|
+
[Symbol.dispose](): void;
|
|
2665
|
+
add(elem: Relay): void;
|
|
2666
|
+
static from_bytes(bytes: Uint8Array): Relays;
|
|
2667
|
+
static from_hex(hex_str: string): Relays;
|
|
2668
|
+
static from_json(json: string): Relays;
|
|
2669
|
+
get(index: number): Relay;
|
|
2670
|
+
len(): number;
|
|
2671
|
+
static new(): Relays;
|
|
2672
|
+
to_bytes(): Uint8Array;
|
|
2673
|
+
to_hex(): string;
|
|
2674
|
+
to_js_value(): any;
|
|
2675
|
+
to_json(): string;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
export class RewardAddress {
|
|
2679
|
+
private constructor();
|
|
2680
|
+
free(): void;
|
|
2681
|
+
[Symbol.dispose](): void;
|
|
2682
|
+
static from_address(addr: Address): RewardAddress | undefined;
|
|
2683
|
+
network_id(): number;
|
|
2684
|
+
static new(network: number, payment: Credential): RewardAddress;
|
|
2685
|
+
payment_cred(): Credential;
|
|
2686
|
+
to_address(): Address;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
export class RewardAddresses {
|
|
2690
|
+
private constructor();
|
|
2691
|
+
free(): void;
|
|
2692
|
+
[Symbol.dispose](): void;
|
|
2693
|
+
add(elem: RewardAddress): void;
|
|
2694
|
+
static from_bytes(bytes: Uint8Array): RewardAddresses;
|
|
2695
|
+
static from_hex(hex_str: string): RewardAddresses;
|
|
2696
|
+
static from_json(json: string): RewardAddresses;
|
|
2697
|
+
get(index: number): RewardAddress;
|
|
2698
|
+
len(): number;
|
|
2699
|
+
static new(): RewardAddresses;
|
|
2700
|
+
to_bytes(): Uint8Array;
|
|
2701
|
+
to_hex(): string;
|
|
2702
|
+
to_js_value(): any;
|
|
2703
|
+
to_json(): string;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
export class ScriptAll {
|
|
2707
|
+
private constructor();
|
|
2708
|
+
free(): void;
|
|
2709
|
+
[Symbol.dispose](): void;
|
|
2710
|
+
static from_bytes(bytes: Uint8Array): ScriptAll;
|
|
2711
|
+
static from_hex(hex_str: string): ScriptAll;
|
|
2712
|
+
static from_json(json: string): ScriptAll;
|
|
2713
|
+
native_scripts(): NativeScripts;
|
|
2714
|
+
static new(native_scripts: NativeScripts): ScriptAll;
|
|
2715
|
+
to_bytes(): Uint8Array;
|
|
2716
|
+
to_hex(): string;
|
|
2717
|
+
to_js_value(): any;
|
|
2718
|
+
to_json(): string;
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2721
|
+
export class ScriptAny {
|
|
2722
|
+
private constructor();
|
|
2723
|
+
free(): void;
|
|
2724
|
+
[Symbol.dispose](): void;
|
|
2725
|
+
static from_bytes(bytes: Uint8Array): ScriptAny;
|
|
2726
|
+
static from_hex(hex_str: string): ScriptAny;
|
|
2727
|
+
static from_json(json: string): ScriptAny;
|
|
2728
|
+
native_scripts(): NativeScripts;
|
|
2729
|
+
static new(native_scripts: NativeScripts): ScriptAny;
|
|
2730
|
+
to_bytes(): Uint8Array;
|
|
2731
|
+
to_hex(): string;
|
|
2732
|
+
to_js_value(): any;
|
|
2733
|
+
to_json(): string;
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
export class ScriptDataHash {
|
|
2737
|
+
private constructor();
|
|
2738
|
+
free(): void;
|
|
2739
|
+
[Symbol.dispose](): void;
|
|
2740
|
+
static from_bech32(bech_str: string): ScriptDataHash;
|
|
2741
|
+
static from_bytes(bytes: Uint8Array): ScriptDataHash;
|
|
2742
|
+
static from_hex(hex: string): ScriptDataHash;
|
|
2743
|
+
to_bech32(prefix: string): string;
|
|
2744
|
+
to_bytes(): Uint8Array;
|
|
2745
|
+
to_hex(): string;
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
export class ScriptHash {
|
|
2749
|
+
private constructor();
|
|
2750
|
+
free(): void;
|
|
2751
|
+
[Symbol.dispose](): void;
|
|
2752
|
+
static from_bech32(bech_str: string): ScriptHash;
|
|
2753
|
+
static from_bytes(bytes: Uint8Array): ScriptHash;
|
|
2754
|
+
static from_hex(hex: string): ScriptHash;
|
|
2755
|
+
to_bech32(prefix: string): string;
|
|
2756
|
+
to_bytes(): Uint8Array;
|
|
2757
|
+
to_hex(): string;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
/**
|
|
2761
|
+
* Each new language uses a different namespace for hashing its script
|
|
2762
|
+
* This is because you could have a language where the same bytes have different semantics
|
|
2763
|
+
* So this avoids scripts in different languages mapping to the same hash
|
|
2764
|
+
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
2765
|
+
*/
|
|
2766
|
+
export enum ScriptHashNamespace {
|
|
2767
|
+
NativeScript = 0,
|
|
2768
|
+
PlutusScript = 1,
|
|
2769
|
+
PlutusScriptV2 = 2,
|
|
2770
|
+
PlutusScriptV3 = 3,
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
export class ScriptHashes {
|
|
2774
|
+
private constructor();
|
|
2775
|
+
free(): void;
|
|
2776
|
+
[Symbol.dispose](): void;
|
|
2777
|
+
add(elem: ScriptHash): void;
|
|
2778
|
+
static from_bytes(bytes: Uint8Array): ScriptHashes;
|
|
2779
|
+
static from_hex(hex_str: string): ScriptHashes;
|
|
2780
|
+
static from_json(json: string): ScriptHashes;
|
|
2781
|
+
get(index: number): ScriptHash;
|
|
2782
|
+
len(): number;
|
|
2783
|
+
static new(): ScriptHashes;
|
|
2784
|
+
to_bytes(): Uint8Array;
|
|
2785
|
+
to_hex(): string;
|
|
2786
|
+
to_js_value(): any;
|
|
2787
|
+
to_json(): string;
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
export class ScriptNOfK {
|
|
2791
|
+
private constructor();
|
|
2792
|
+
free(): void;
|
|
2793
|
+
[Symbol.dispose](): void;
|
|
2794
|
+
static from_bytes(bytes: Uint8Array): ScriptNOfK;
|
|
2795
|
+
static from_hex(hex_str: string): ScriptNOfK;
|
|
2796
|
+
static from_json(json: string): ScriptNOfK;
|
|
2797
|
+
n(): number;
|
|
2798
|
+
native_scripts(): NativeScripts;
|
|
2799
|
+
static new(n: number, native_scripts: NativeScripts): ScriptNOfK;
|
|
2800
|
+
to_bytes(): Uint8Array;
|
|
2801
|
+
to_hex(): string;
|
|
2802
|
+
to_js_value(): any;
|
|
2803
|
+
to_json(): string;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
export class ScriptPubkey {
|
|
2807
|
+
private constructor();
|
|
2808
|
+
free(): void;
|
|
2809
|
+
[Symbol.dispose](): void;
|
|
2810
|
+
addr_keyhash(): Ed25519KeyHash;
|
|
2811
|
+
static from_bytes(bytes: Uint8Array): ScriptPubkey;
|
|
2812
|
+
static from_hex(hex_str: string): ScriptPubkey;
|
|
2813
|
+
static from_json(json: string): ScriptPubkey;
|
|
2814
|
+
static new(addr_keyhash: Ed25519KeyHash): ScriptPubkey;
|
|
2815
|
+
to_bytes(): Uint8Array;
|
|
2816
|
+
to_hex(): string;
|
|
2817
|
+
to_js_value(): any;
|
|
2818
|
+
to_json(): string;
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
export class ScriptRef {
|
|
2822
|
+
private constructor();
|
|
2823
|
+
free(): void;
|
|
2824
|
+
[Symbol.dispose](): void;
|
|
2825
|
+
static from_bytes(bytes: Uint8Array): ScriptRef;
|
|
2826
|
+
static from_hex(hex_str: string): ScriptRef;
|
|
2827
|
+
static from_json(json: string): ScriptRef;
|
|
2828
|
+
is_native_script(): boolean;
|
|
2829
|
+
is_plutus_script(): boolean;
|
|
2830
|
+
native_script(): NativeScript | undefined;
|
|
2831
|
+
static new_native_script(native_script: NativeScript): ScriptRef;
|
|
2832
|
+
static new_plutus_script(plutus_script: PlutusScript): ScriptRef;
|
|
2833
|
+
plutus_script(): PlutusScript | undefined;
|
|
2834
|
+
to_bytes(): Uint8Array;
|
|
2835
|
+
to_hex(): string;
|
|
2836
|
+
to_js_value(): any;
|
|
2837
|
+
to_json(): string;
|
|
2838
|
+
/**
|
|
2839
|
+
* Return bytes array of script ref struct but without wrapping into CBOR array under the tag
|
|
2840
|
+
* to_bytes returns "#6.24(bytes .cbor script)" from CDDL
|
|
2841
|
+
* to_unwrapped_bytes return "script" from CDDL
|
|
2842
|
+
*/
|
|
2843
|
+
to_unwrapped_bytes(): Uint8Array;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
/**
|
|
2847
|
+
* Used to choosed the schema for a script JSON string
|
|
2848
|
+
*/
|
|
2849
|
+
export enum ScriptSchema {
|
|
2850
|
+
Wallet = 0,
|
|
2851
|
+
Node = 1,
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
export class SingleHostAddr {
|
|
2855
|
+
private constructor();
|
|
2856
|
+
free(): void;
|
|
2857
|
+
[Symbol.dispose](): void;
|
|
2858
|
+
static from_bytes(bytes: Uint8Array): SingleHostAddr;
|
|
2859
|
+
static from_hex(hex_str: string): SingleHostAddr;
|
|
2860
|
+
static from_json(json: string): SingleHostAddr;
|
|
2861
|
+
ipv4(): Ipv4 | undefined;
|
|
2862
|
+
ipv6(): Ipv6 | undefined;
|
|
2863
|
+
static new(port?: number | null, ipv4?: Ipv4 | null, ipv6?: Ipv6 | null): SingleHostAddr;
|
|
2864
|
+
port(): number | undefined;
|
|
2865
|
+
to_bytes(): Uint8Array;
|
|
2866
|
+
to_hex(): string;
|
|
2867
|
+
to_js_value(): any;
|
|
2868
|
+
to_json(): string;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
export class SingleHostName {
|
|
2872
|
+
private constructor();
|
|
2873
|
+
free(): void;
|
|
2874
|
+
[Symbol.dispose](): void;
|
|
2875
|
+
dns_name(): DNSRecordAorAAAA;
|
|
2876
|
+
static from_bytes(bytes: Uint8Array): SingleHostName;
|
|
2877
|
+
static from_hex(hex_str: string): SingleHostName;
|
|
2878
|
+
static from_json(json: string): SingleHostName;
|
|
2879
|
+
static new(port: number | null | undefined, dns_name: DNSRecordAorAAAA): SingleHostName;
|
|
2880
|
+
port(): number | undefined;
|
|
2881
|
+
to_bytes(): Uint8Array;
|
|
2882
|
+
to_hex(): string;
|
|
2883
|
+
to_js_value(): any;
|
|
2884
|
+
to_json(): string;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
export class StakeAndVoteDelegation {
|
|
2888
|
+
private constructor();
|
|
2889
|
+
free(): void;
|
|
2890
|
+
[Symbol.dispose](): void;
|
|
2891
|
+
drep(): DRep;
|
|
2892
|
+
static from_bytes(bytes: Uint8Array): StakeAndVoteDelegation;
|
|
2893
|
+
static from_hex(hex_str: string): StakeAndVoteDelegation;
|
|
2894
|
+
static from_json(json: string): StakeAndVoteDelegation;
|
|
2895
|
+
has_script_credentials(): boolean;
|
|
2896
|
+
static new(stake_credential: Credential, pool_keyhash: Ed25519KeyHash, drep: DRep): StakeAndVoteDelegation;
|
|
2897
|
+
pool_keyhash(): Ed25519KeyHash;
|
|
2898
|
+
stake_credential(): Credential;
|
|
2899
|
+
to_bytes(): Uint8Array;
|
|
2900
|
+
to_hex(): string;
|
|
2901
|
+
to_js_value(): any;
|
|
2902
|
+
to_json(): string;
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
export class StakeDelegation {
|
|
2906
|
+
private constructor();
|
|
2907
|
+
free(): void;
|
|
2908
|
+
[Symbol.dispose](): void;
|
|
2909
|
+
static from_bytes(bytes: Uint8Array): StakeDelegation;
|
|
2910
|
+
static from_hex(hex_str: string): StakeDelegation;
|
|
2911
|
+
static from_json(json: string): StakeDelegation;
|
|
2912
|
+
has_script_credentials(): boolean;
|
|
2913
|
+
static new(stake_credential: Credential, pool_keyhash: Ed25519KeyHash): StakeDelegation;
|
|
2914
|
+
pool_keyhash(): Ed25519KeyHash;
|
|
2915
|
+
stake_credential(): Credential;
|
|
2916
|
+
to_bytes(): Uint8Array;
|
|
2917
|
+
to_hex(): string;
|
|
2918
|
+
to_js_value(): any;
|
|
2919
|
+
to_json(): string;
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
export class StakeDeregistration {
|
|
2923
|
+
private constructor();
|
|
2924
|
+
free(): void;
|
|
2925
|
+
[Symbol.dispose](): void;
|
|
2926
|
+
coin(): BigNum | undefined;
|
|
2927
|
+
static from_bytes(bytes: Uint8Array): StakeDeregistration;
|
|
2928
|
+
static from_hex(hex_str: string): StakeDeregistration;
|
|
2929
|
+
static from_json(json: string): StakeDeregistration;
|
|
2930
|
+
has_script_credentials(): boolean;
|
|
2931
|
+
static new(stake_credential: Credential): StakeDeregistration;
|
|
2932
|
+
static new_with_explicit_refund(stake_credential: Credential, coin: BigNum): StakeDeregistration;
|
|
2933
|
+
stake_credential(): Credential;
|
|
2934
|
+
to_bytes(): Uint8Array;
|
|
2935
|
+
to_hex(): string;
|
|
2936
|
+
to_js_value(): any;
|
|
2937
|
+
to_json(): string;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
export class StakeRegistration {
|
|
2941
|
+
private constructor();
|
|
2942
|
+
free(): void;
|
|
2943
|
+
[Symbol.dispose](): void;
|
|
2944
|
+
coin(): BigNum | undefined;
|
|
2945
|
+
static from_bytes(bytes: Uint8Array): StakeRegistration;
|
|
2946
|
+
static from_hex(hex_str: string): StakeRegistration;
|
|
2947
|
+
static from_json(json: string): StakeRegistration;
|
|
2948
|
+
has_script_credentials(): boolean;
|
|
2949
|
+
static new(stake_credential: Credential): StakeRegistration;
|
|
2950
|
+
static new_with_explicit_deposit(stake_credential: Credential, coin: BigNum): StakeRegistration;
|
|
2951
|
+
stake_credential(): Credential;
|
|
2952
|
+
to_bytes(): Uint8Array;
|
|
2953
|
+
to_hex(): string;
|
|
2954
|
+
to_js_value(): any;
|
|
2955
|
+
to_json(): string;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
export class StakeRegistrationAndDelegation {
|
|
2959
|
+
private constructor();
|
|
2960
|
+
free(): void;
|
|
2961
|
+
[Symbol.dispose](): void;
|
|
2962
|
+
coin(): BigNum;
|
|
2963
|
+
static from_bytes(bytes: Uint8Array): StakeRegistrationAndDelegation;
|
|
2964
|
+
static from_hex(hex_str: string): StakeRegistrationAndDelegation;
|
|
2965
|
+
static from_json(json: string): StakeRegistrationAndDelegation;
|
|
2966
|
+
has_script_credentials(): boolean;
|
|
2967
|
+
static new(stake_credential: Credential, pool_keyhash: Ed25519KeyHash, coin: BigNum): StakeRegistrationAndDelegation;
|
|
2968
|
+
pool_keyhash(): Ed25519KeyHash;
|
|
2969
|
+
stake_credential(): Credential;
|
|
2970
|
+
to_bytes(): Uint8Array;
|
|
2971
|
+
to_hex(): string;
|
|
2972
|
+
to_js_value(): any;
|
|
2973
|
+
to_json(): string;
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
export class StakeVoteRegistrationAndDelegation {
|
|
2977
|
+
private constructor();
|
|
2978
|
+
free(): void;
|
|
2979
|
+
[Symbol.dispose](): void;
|
|
2980
|
+
coin(): BigNum;
|
|
2981
|
+
drep(): DRep;
|
|
2982
|
+
static from_bytes(bytes: Uint8Array): StakeVoteRegistrationAndDelegation;
|
|
2983
|
+
static from_hex(hex_str: string): StakeVoteRegistrationAndDelegation;
|
|
2984
|
+
static from_json(json: string): StakeVoteRegistrationAndDelegation;
|
|
2985
|
+
has_script_credentials(): boolean;
|
|
2986
|
+
static new(stake_credential: Credential, pool_keyhash: Ed25519KeyHash, drep: DRep, coin: BigNum): StakeVoteRegistrationAndDelegation;
|
|
2987
|
+
pool_keyhash(): Ed25519KeyHash;
|
|
2988
|
+
stake_credential(): Credential;
|
|
2989
|
+
to_bytes(): Uint8Array;
|
|
2990
|
+
to_hex(): string;
|
|
2991
|
+
to_js_value(): any;
|
|
2992
|
+
to_json(): string;
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
export class Strings {
|
|
2996
|
+
private constructor();
|
|
2997
|
+
free(): void;
|
|
2998
|
+
[Symbol.dispose](): void;
|
|
2999
|
+
add(elem: string): void;
|
|
3000
|
+
get(index: number): string;
|
|
3001
|
+
len(): number;
|
|
3002
|
+
static new(): Strings;
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
export class TimelockExpiry {
|
|
3006
|
+
private constructor();
|
|
3007
|
+
free(): void;
|
|
3008
|
+
[Symbol.dispose](): void;
|
|
3009
|
+
static from_bytes(bytes: Uint8Array): TimelockExpiry;
|
|
3010
|
+
static from_hex(hex_str: string): TimelockExpiry;
|
|
3011
|
+
static from_json(json: string): TimelockExpiry;
|
|
3012
|
+
/**
|
|
3013
|
+
* !!! DEPRECATED !!!
|
|
3014
|
+
* This constructor uses outdated slot number format.
|
|
3015
|
+
* Use `.new_timelockexpiry` instead
|
|
3016
|
+
*/
|
|
3017
|
+
static new(slot: number): TimelockExpiry;
|
|
3018
|
+
static new_timelockexpiry(slot: BigNum): TimelockExpiry;
|
|
3019
|
+
slot(): number;
|
|
3020
|
+
slot_bignum(): BigNum;
|
|
3021
|
+
to_bytes(): Uint8Array;
|
|
3022
|
+
to_hex(): string;
|
|
3023
|
+
to_js_value(): any;
|
|
3024
|
+
to_json(): string;
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
export class TimelockStart {
|
|
3028
|
+
private constructor();
|
|
3029
|
+
free(): void;
|
|
3030
|
+
[Symbol.dispose](): void;
|
|
3031
|
+
static from_bytes(bytes: Uint8Array): TimelockStart;
|
|
3032
|
+
static from_hex(hex_str: string): TimelockStart;
|
|
3033
|
+
static from_json(json: string): TimelockStart;
|
|
3034
|
+
/**
|
|
3035
|
+
* !!! DEPRECATED !!!
|
|
3036
|
+
* This constructor uses outdated slot number format.
|
|
3037
|
+
* Use `.new_timelockstart` instead.
|
|
3038
|
+
*/
|
|
3039
|
+
static new(slot: number): TimelockStart;
|
|
3040
|
+
static new_timelockstart(slot: BigNum): TimelockStart;
|
|
3041
|
+
/**
|
|
3042
|
+
* !!! DEPRECATED !!!
|
|
3043
|
+
* Returns a Slot32 (u32) value in case the underlying original BigNum (u64) value is within the limits.
|
|
3044
|
+
* Otherwise will just raise an error.
|
|
3045
|
+
* Use `.slot_bignum` instead
|
|
3046
|
+
*/
|
|
3047
|
+
slot(): number;
|
|
3048
|
+
slot_bignum(): BigNum;
|
|
3049
|
+
to_bytes(): Uint8Array;
|
|
3050
|
+
to_hex(): string;
|
|
3051
|
+
to_js_value(): any;
|
|
3052
|
+
to_json(): string;
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
export class Transaction {
|
|
3056
|
+
private constructor();
|
|
3057
|
+
free(): void;
|
|
3058
|
+
[Symbol.dispose](): void;
|
|
3059
|
+
auxiliary_data(): AuxiliaryData | undefined;
|
|
3060
|
+
body(): TransactionBody;
|
|
3061
|
+
static from_bytes(bytes: Uint8Array): Transaction;
|
|
3062
|
+
static from_hex(hex_str: string): Transaction;
|
|
3063
|
+
static from_json(json: string): Transaction;
|
|
3064
|
+
is_valid(): boolean;
|
|
3065
|
+
static new(body: TransactionBody, witness_set: TransactionWitnessSet, auxiliary_data?: AuxiliaryData | null): Transaction;
|
|
3066
|
+
set_is_valid(valid: boolean): void;
|
|
3067
|
+
to_bytes(): Uint8Array;
|
|
3068
|
+
to_hex(): string;
|
|
3069
|
+
to_js_value(): any;
|
|
3070
|
+
to_json(): string;
|
|
3071
|
+
witness_set(): TransactionWitnessSet;
|
|
3072
|
+
}
|
|
3073
|
+
|
|
3074
|
+
export class TransactionBatch {
|
|
3075
|
+
private constructor();
|
|
3076
|
+
free(): void;
|
|
3077
|
+
[Symbol.dispose](): void;
|
|
3078
|
+
get(index: number): Transaction;
|
|
3079
|
+
len(): number;
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
export class TransactionBatchList {
|
|
3083
|
+
private constructor();
|
|
3084
|
+
free(): void;
|
|
3085
|
+
[Symbol.dispose](): void;
|
|
3086
|
+
get(index: number): TransactionBatch;
|
|
3087
|
+
len(): number;
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
export class TransactionBodies {
|
|
3091
|
+
private constructor();
|
|
3092
|
+
free(): void;
|
|
3093
|
+
[Symbol.dispose](): void;
|
|
3094
|
+
add(elem: TransactionBody): void;
|
|
3095
|
+
static from_bytes(bytes: Uint8Array): TransactionBodies;
|
|
3096
|
+
static from_hex(hex_str: string): TransactionBodies;
|
|
3097
|
+
static from_json(json: string): TransactionBodies;
|
|
3098
|
+
get(index: number): TransactionBody;
|
|
3099
|
+
len(): number;
|
|
3100
|
+
static new(): TransactionBodies;
|
|
3101
|
+
to_bytes(): Uint8Array;
|
|
3102
|
+
to_hex(): string;
|
|
3103
|
+
to_js_value(): any;
|
|
3104
|
+
to_json(): string;
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
export class TransactionBody {
|
|
3108
|
+
private constructor();
|
|
3109
|
+
free(): void;
|
|
3110
|
+
[Symbol.dispose](): void;
|
|
3111
|
+
auxiliary_data_hash(): AuxiliaryDataHash | undefined;
|
|
3112
|
+
certs(): Certificates | undefined;
|
|
3113
|
+
collateral(): TransactionInputs | undefined;
|
|
3114
|
+
collateral_return(): TransactionOutput | undefined;
|
|
3115
|
+
current_treasury_value(): BigNum | undefined;
|
|
3116
|
+
donation(): BigNum | undefined;
|
|
3117
|
+
fee(): BigNum;
|
|
3118
|
+
static from_bytes(bytes: Uint8Array): TransactionBody;
|
|
3119
|
+
static from_hex(hex_str: string): TransactionBody;
|
|
3120
|
+
static from_json(json: string): TransactionBody;
|
|
3121
|
+
inputs(): TransactionInputs;
|
|
3122
|
+
mint(): Mint | undefined;
|
|
3123
|
+
network_id(): NetworkId | undefined;
|
|
3124
|
+
/**
|
|
3125
|
+
* !!! DEPRECATED !!!
|
|
3126
|
+
* This constructor uses outdated slot number format for the ttl value.
|
|
3127
|
+
* Use `.new_tx_body` and then `.set_ttl` instead
|
|
3128
|
+
*/
|
|
3129
|
+
static new(inputs: TransactionInputs, outputs: TransactionOutputs, fee: BigNum, ttl?: number | null): TransactionBody;
|
|
3130
|
+
/**
|
|
3131
|
+
* Returns a new TransactionBody.
|
|
3132
|
+
* In the new version of "new" we removed optional ttl for support it by wasm_bingen.
|
|
3133
|
+
* Your can use "set_ttl" and "remove_ttl" to set a new value for ttl or set it as None.
|
|
3134
|
+
*/
|
|
3135
|
+
static new_tx_body(inputs: TransactionInputs, outputs: TransactionOutputs, fee: BigNum): TransactionBody;
|
|
3136
|
+
outputs(): TransactionOutputs;
|
|
3137
|
+
reference_inputs(): TransactionInputs | undefined;
|
|
3138
|
+
remove_ttl(): void;
|
|
3139
|
+
required_signers(): Ed25519KeyHashes | undefined;
|
|
3140
|
+
script_data_hash(): ScriptDataHash | undefined;
|
|
3141
|
+
set_auxiliary_data_hash(auxiliary_data_hash: AuxiliaryDataHash): void;
|
|
3142
|
+
set_certs(certs: Certificates): void;
|
|
3143
|
+
set_collateral(collateral: TransactionInputs): void;
|
|
3144
|
+
set_collateral_return(collateral_return: TransactionOutput): void;
|
|
3145
|
+
set_current_treasury_value(current_treasury_value: BigNum): void;
|
|
3146
|
+
set_donation(donation: BigNum): void;
|
|
3147
|
+
set_mint(mint: Mint): void;
|
|
3148
|
+
set_network_id(network_id: NetworkId): void;
|
|
3149
|
+
set_reference_inputs(reference_inputs: TransactionInputs): void;
|
|
3150
|
+
set_required_signers(required_signers: Ed25519KeyHashes): void;
|
|
3151
|
+
set_script_data_hash(script_data_hash: ScriptDataHash): void;
|
|
3152
|
+
set_total_collateral(total_collateral: BigNum): void;
|
|
3153
|
+
set_ttl(ttl: BigNum): void;
|
|
3154
|
+
set_update(update: Update): void;
|
|
3155
|
+
/**
|
|
3156
|
+
* !!! DEPRECATED !!!
|
|
3157
|
+
* Uses outdated slot number format.
|
|
3158
|
+
*/
|
|
3159
|
+
set_validity_start_interval(validity_start_interval: number): void;
|
|
3160
|
+
set_validity_start_interval_bignum(validity_start_interval: BigNum): void;
|
|
3161
|
+
set_voting_procedures(voting_procedures: VotingProcedures): void;
|
|
3162
|
+
set_voting_proposals(voting_proposals: VotingProposals): void;
|
|
3163
|
+
set_withdrawals(withdrawals: Withdrawals): void;
|
|
3164
|
+
to_bytes(): Uint8Array;
|
|
3165
|
+
to_hex(): string;
|
|
3166
|
+
to_js_value(): any;
|
|
3167
|
+
to_json(): string;
|
|
3168
|
+
total_collateral(): BigNum | undefined;
|
|
3169
|
+
/**
|
|
3170
|
+
* !!! DEPRECATED !!!
|
|
3171
|
+
* Returns a Slot32 (u32) value in case the underlying original BigNum (u64) value is within the limits.
|
|
3172
|
+
* Otherwise will just raise an error.
|
|
3173
|
+
*/
|
|
3174
|
+
ttl(): number | undefined;
|
|
3175
|
+
ttl_bignum(): BigNum | undefined;
|
|
3176
|
+
update(): Update | undefined;
|
|
3177
|
+
/**
|
|
3178
|
+
* !!! DEPRECATED !!!
|
|
3179
|
+
* Returns a Option<Slot32> (u32) value in case the underlying original Option<BigNum> (u64) value is within the limits.
|
|
3180
|
+
* Otherwise will just raise an error.
|
|
3181
|
+
* Use `.validity_start_interval_bignum` instead.
|
|
3182
|
+
*/
|
|
3183
|
+
validity_start_interval(): number | undefined;
|
|
3184
|
+
validity_start_interval_bignum(): BigNum | undefined;
|
|
3185
|
+
voting_procedures(): VotingProcedures | undefined;
|
|
3186
|
+
voting_proposals(): VotingProposals | undefined;
|
|
3187
|
+
withdrawals(): Withdrawals | undefined;
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
export class TransactionBuilder {
|
|
3191
|
+
private constructor();
|
|
3192
|
+
free(): void;
|
|
3193
|
+
[Symbol.dispose](): void;
|
|
3194
|
+
add_bootstrap_input(hash: ByronAddress, input: TransactionInput, amount: Value): void;
|
|
3195
|
+
/**
|
|
3196
|
+
* Warning: this function will mutate the /fee/ field
|
|
3197
|
+
* Make sure to call this function last after setting all other tx-body properties
|
|
3198
|
+
* Editing inputs, outputs, mint, etc. after change been calculated
|
|
3199
|
+
* might cause a mismatch in calculated fee versus the required fee
|
|
3200
|
+
*/
|
|
3201
|
+
add_change_if_needed(address: Address): boolean;
|
|
3202
|
+
add_change_if_needed_with_datum(address: Address, plutus_data: OutputDatum): boolean;
|
|
3203
|
+
add_extra_witness_datum(datum: PlutusData): void;
|
|
3204
|
+
/**
|
|
3205
|
+
* This automatically selects and adds inputs from {inputs} consisting of just enough to cover
|
|
3206
|
+
* the outputs that have already been added.
|
|
3207
|
+
* This should be called after adding all certs/outputs/etc and will be an error otherwise.
|
|
3208
|
+
* Uses CIP2: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0002/CIP-0002.md
|
|
3209
|
+
* Adding a change output must be called after via TransactionBuilder::add_change_if_needed()
|
|
3210
|
+
* This function, diverging from CIP2, takes into account fees and will attempt to add additional
|
|
3211
|
+
* inputs to cover the minimum fees. This does not, however, set the txbuilder's fee.
|
|
3212
|
+
*/
|
|
3213
|
+
add_inputs_from(inputs: TransactionUnspentOutputs, strategy: CoinSelectionStrategyCIP2): void;
|
|
3214
|
+
add_inputs_from_and_change(inputs: TransactionUnspentOutputs, strategy: CoinSelectionStrategyCIP2, change_config: ChangeConfig): boolean;
|
|
3215
|
+
add_inputs_from_and_change_with_collateral_return(inputs: TransactionUnspentOutputs, strategy: CoinSelectionStrategyCIP2, change_config: ChangeConfig, collateral_percentage: BigNum): void;
|
|
3216
|
+
/**
|
|
3217
|
+
* Add a single JSON metadatum using a TransactionMetadatumLabel and a String
|
|
3218
|
+
* It will be securely added to existing or new metadata in this builder
|
|
3219
|
+
*/
|
|
3220
|
+
add_json_metadatum(key: BigNum, val: string): void;
|
|
3221
|
+
/**
|
|
3222
|
+
* Add a single JSON metadatum using a TransactionMetadatumLabel, a String, and a MetadataJsonSchema object
|
|
3223
|
+
* It will be securely added to existing or new metadata in this builder
|
|
3224
|
+
*/
|
|
3225
|
+
add_json_metadatum_with_schema(key: BigNum, val: string, schema: MetadataJsonSchema): void;
|
|
3226
|
+
/**
|
|
3227
|
+
* We have to know what kind of inputs these are to know what kind of mock witnesses to create since
|
|
3228
|
+
* 1) mock witnesses have different lengths depending on the type which changes the expecting fee
|
|
3229
|
+
* 2) Witnesses are a set so we need to get rid of duplicates to avoid over-estimating the fee
|
|
3230
|
+
*/
|
|
3231
|
+
add_key_input(hash: Ed25519KeyHash, input: TransactionInput, amount: Value): void;
|
|
3232
|
+
/**
|
|
3233
|
+
* Add a single metadatum using TransactionMetadatumLabel and TransactionMetadatum objects
|
|
3234
|
+
* It will be securely added to existing or new metadata in this builder
|
|
3235
|
+
*/
|
|
3236
|
+
add_metadatum(key: BigNum, val: TransactionMetadatum): void;
|
|
3237
|
+
/**
|
|
3238
|
+
* !!! DEPRECATED !!!
|
|
3239
|
+
* Mints are defining by MintBuilder now.
|
|
3240
|
+
* Use `.set_mint_builder()` and `MintBuilder` instead.
|
|
3241
|
+
* Add a mint entry to this builder using a PolicyID, AssetName, and Int object for amount
|
|
3242
|
+
* It will be securely added to existing or new Mint in this builder
|
|
3243
|
+
* It will replace any previous existing amount same PolicyID and AssetName
|
|
3244
|
+
*/
|
|
3245
|
+
add_mint_asset(policy_script: NativeScript, asset_name: AssetName, amount: Int): void;
|
|
3246
|
+
/**
|
|
3247
|
+
* Add a mint entry together with an output to this builder
|
|
3248
|
+
* Using a PolicyID, AssetName, Int for amount, Address, and Coin (BigNum) objects
|
|
3249
|
+
* The asset will be securely added to existing or new Mint in this builder
|
|
3250
|
+
* A new output will be added with the specified Address, the Coin value, and the minted asset
|
|
3251
|
+
*/
|
|
3252
|
+
add_mint_asset_and_output(policy_script: NativeScript, asset_name: AssetName, amount: Int, output_builder: TransactionOutputAmountBuilder, output_coin: BigNum): void;
|
|
3253
|
+
/**
|
|
3254
|
+
* Add a mint entry together with an output to this builder
|
|
3255
|
+
* Using a PolicyID, AssetName, Int for amount, and Address objects
|
|
3256
|
+
* The asset will be securely added to existing or new Mint in this builder
|
|
3257
|
+
* A new output will be added with the specified Address and the minted asset
|
|
3258
|
+
* The output will be set to contain the minimum required amount of Coin
|
|
3259
|
+
*/
|
|
3260
|
+
add_mint_asset_and_output_min_required_coin(policy_script: NativeScript, asset_name: AssetName, amount: Int, output_builder: TransactionOutputAmountBuilder): void;
|
|
3261
|
+
/**
|
|
3262
|
+
* This method will add the input to the builder and also register the required native script witness
|
|
3263
|
+
*/
|
|
3264
|
+
add_native_script_input(script: NativeScript, input: TransactionInput, amount: Value): void;
|
|
3265
|
+
/**
|
|
3266
|
+
* Add explicit output via a TransactionOutput object
|
|
3267
|
+
*/
|
|
3268
|
+
add_output(output: TransactionOutput): void;
|
|
3269
|
+
/**
|
|
3270
|
+
* This method will add the input to the builder and also register the required plutus witness
|
|
3271
|
+
*/
|
|
3272
|
+
add_plutus_script_input(witness: PlutusWitness, input: TransactionInput, amount: Value): void;
|
|
3273
|
+
add_reference_input(reference_input: TransactionInput): void;
|
|
3274
|
+
/**
|
|
3275
|
+
* This function is replace for previous one add_input.
|
|
3276
|
+
* The functions adds a non script input, if it is a script input it returns an error.
|
|
3277
|
+
* To add script input you need to use add_native_script_input or add_plutus_script_input.
|
|
3278
|
+
* Also we recommend to use TxInputsBuilder and .set_inputs, because all add_*_input functions might be removed from transaction builder.
|
|
3279
|
+
*/
|
|
3280
|
+
add_regular_input(address: Address, input: TransactionInput, amount: Value): void;
|
|
3281
|
+
add_required_signer(key: Ed25519KeyHash): void;
|
|
3282
|
+
add_script_reference_input(reference_input: TransactionInput, script_size: number): void;
|
|
3283
|
+
/**
|
|
3284
|
+
* Returns object the body of the new transaction
|
|
3285
|
+
* Auxiliary data itself is not included
|
|
3286
|
+
* You can use `get_auxiliary_data` or `build_tx`
|
|
3287
|
+
*/
|
|
3288
|
+
build(): TransactionBody;
|
|
3289
|
+
/**
|
|
3290
|
+
* Returns full Transaction object with the body and the auxiliary data
|
|
3291
|
+
* NOTE: witness_set will contain all mint_scripts if any been added or set
|
|
3292
|
+
* NOTE: is_valid set to true
|
|
3293
|
+
* NOTE: Will fail in case there are any script inputs added with no corresponding witness
|
|
3294
|
+
*/
|
|
3295
|
+
build_tx(): Transaction;
|
|
3296
|
+
/**
|
|
3297
|
+
* Similar to `.build_tx()` but will NOT fail in case there are missing script witnesses
|
|
3298
|
+
*/
|
|
3299
|
+
build_tx_unsafe(): Transaction;
|
|
3300
|
+
/**
|
|
3301
|
+
* This method will calculate the script hash data
|
|
3302
|
+
* using the plutus datums and redeemers already present in the builder
|
|
3303
|
+
* along with the provided cost model, and will register the calculated value
|
|
3304
|
+
* in the builder to be used when building the tx body.
|
|
3305
|
+
* In case there are no plutus input witnesses present - nothing will change
|
|
3306
|
+
* You can set specific hash value using `.set_script_data_hash`
|
|
3307
|
+
* NOTE: this function will check which language versions are used in the present scripts
|
|
3308
|
+
* and will assert and require for a corresponding cost-model to be present in the passed map.
|
|
3309
|
+
* Only the cost-models for the present language versions will be used in the hash calculation.
|
|
3310
|
+
*/
|
|
3311
|
+
calc_script_data_hash(cost_models: Costmdls): void;
|
|
3312
|
+
/**
|
|
3313
|
+
* calculates how much the fee would increase if you added a given output
|
|
3314
|
+
*/
|
|
3315
|
+
fee_for_input(address: Address, input: TransactionInput, amount: Value): BigNum;
|
|
3316
|
+
/**
|
|
3317
|
+
* calculates how much the fee would increase if you added a given output
|
|
3318
|
+
*/
|
|
3319
|
+
fee_for_output(output: TransactionOutput): BigNum;
|
|
3320
|
+
full_size(): number;
|
|
3321
|
+
get_auxiliary_data(): AuxiliaryData | undefined;
|
|
3322
|
+
get_current_treasury_value(): BigNum | undefined;
|
|
3323
|
+
get_deposit(): BigNum;
|
|
3324
|
+
get_donation(): BigNum | undefined;
|
|
3325
|
+
/**
|
|
3326
|
+
* does not include refunds or withdrawals
|
|
3327
|
+
*/
|
|
3328
|
+
get_explicit_input(): Value;
|
|
3329
|
+
/**
|
|
3330
|
+
* does not include fee
|
|
3331
|
+
*/
|
|
3332
|
+
get_explicit_output(): Value;
|
|
3333
|
+
get_extra_witness_datums(): PlutusList | undefined;
|
|
3334
|
+
get_fee_if_set(): BigNum | undefined;
|
|
3335
|
+
/**
|
|
3336
|
+
* withdrawals and refunds
|
|
3337
|
+
*/
|
|
3338
|
+
get_implicit_input(): Value;
|
|
3339
|
+
/**
|
|
3340
|
+
* !!! DEPRECATED !!!
|
|
3341
|
+
* Mints are defining by MintBuilder now.
|
|
3342
|
+
* Use `.get_mint_builder()` and `.build()` instead.
|
|
3343
|
+
* Returns a copy of the current mint state in the builder
|
|
3344
|
+
*/
|
|
3345
|
+
get_mint(): Mint | undefined;
|
|
3346
|
+
get_mint_builder(): MintBuilder | undefined;
|
|
3347
|
+
/**
|
|
3348
|
+
* Returns a copy of the current mint witness scripts in the builder
|
|
3349
|
+
*/
|
|
3350
|
+
get_mint_scripts(): NativeScripts | undefined;
|
|
3351
|
+
/**
|
|
3352
|
+
* Returns a copy of the current script input witness scripts in the builder
|
|
3353
|
+
*/
|
|
3354
|
+
get_native_input_scripts(): NativeScripts | undefined;
|
|
3355
|
+
/**
|
|
3356
|
+
* Returns a copy of the current plutus input witness scripts in the builder.
|
|
3357
|
+
* NOTE: each plutus witness will be cloned with a specific corresponding input index
|
|
3358
|
+
*/
|
|
3359
|
+
get_plutus_input_scripts(): PlutusWitnesses | undefined;
|
|
3360
|
+
get_reference_inputs(): TransactionInputs;
|
|
3361
|
+
/**
|
|
3362
|
+
* Return explicit input plus implicit input plus mint
|
|
3363
|
+
*/
|
|
3364
|
+
get_total_input(): Value;
|
|
3365
|
+
/**
|
|
3366
|
+
* Return explicit output plus deposit plus burn
|
|
3367
|
+
*/
|
|
3368
|
+
get_total_output(): Value;
|
|
3369
|
+
/**
|
|
3370
|
+
* warning: sum of all parts of a transaction must equal 0. You cannot just set the fee to the min value and forget about it
|
|
3371
|
+
* warning: min_fee may be slightly larger than the actual minimum fee (ex: a few lovelaces)
|
|
3372
|
+
* this is done to simplify the library code, but can be fixed later
|
|
3373
|
+
*/
|
|
3374
|
+
min_fee(): BigNum;
|
|
3375
|
+
static new(cfg: TransactionBuilderConfig): TransactionBuilder;
|
|
3376
|
+
output_sizes(): Uint32Array;
|
|
3377
|
+
remove_auxiliary_data(): void;
|
|
3378
|
+
remove_certs(): void;
|
|
3379
|
+
remove_collateral_return(): void;
|
|
3380
|
+
remove_mint_builder(): void;
|
|
3381
|
+
/**
|
|
3382
|
+
* Deletes any previously set plutus data hash value.
|
|
3383
|
+
* Use `.set_script_data_hash` or `.calc_script_data_hash` to set it.
|
|
3384
|
+
*/
|
|
3385
|
+
remove_script_data_hash(): void;
|
|
3386
|
+
remove_total_collateral(): void;
|
|
3387
|
+
remove_ttl(): void;
|
|
3388
|
+
remove_validity_start_interval(): void;
|
|
3389
|
+
remove_withdrawals(): void;
|
|
3390
|
+
/**
|
|
3391
|
+
* Set explicit auxiliary data via an AuxiliaryData object
|
|
3392
|
+
* It might contain some metadata plus native or Plutus scripts
|
|
3393
|
+
*/
|
|
3394
|
+
set_auxiliary_data(auxiliary_data: AuxiliaryData): void;
|
|
3395
|
+
/**
|
|
3396
|
+
* !!! DEPRECATED !!!
|
|
3397
|
+
* Can emit error if add a cert with script credential.
|
|
3398
|
+
* Use set_certs_builder instead.
|
|
3399
|
+
*/
|
|
3400
|
+
set_certs(certs: Certificates): void;
|
|
3401
|
+
set_certs_builder(certs: CertificatesBuilder): void;
|
|
3402
|
+
set_collateral(collateral: TxInputsBuilder): void;
|
|
3403
|
+
set_collateral_return(collateral_return: TransactionOutput): void;
|
|
3404
|
+
/**
|
|
3405
|
+
* This function will set the collateral-return value and then auto-calculate and assign
|
|
3406
|
+
* the total collateral coin value. Will raise an error in case no collateral inputs are set
|
|
3407
|
+
* or in case the total collateral value will have any assets in it except coin.
|
|
3408
|
+
*/
|
|
3409
|
+
set_collateral_return_and_total(collateral_return: TransactionOutput): void;
|
|
3410
|
+
set_current_treasury_value(current_treasury_value: BigNum): void;
|
|
3411
|
+
set_donation(donation: BigNum): void;
|
|
3412
|
+
/**
|
|
3413
|
+
* Set exact fee for the transaction. If the real fee will be bigger then the set value, the transaction will not be created on .build_tx()
|
|
3414
|
+
*/
|
|
3415
|
+
set_fee(fee: BigNum): void;
|
|
3416
|
+
set_inputs(inputs: TxInputsBuilder): void;
|
|
3417
|
+
/**
|
|
3418
|
+
* Set metadata using a GeneralTransactionMetadata object
|
|
3419
|
+
* It will be set to the existing or new auxiliary data in this builder
|
|
3420
|
+
*/
|
|
3421
|
+
set_metadata(metadata: GeneralTransactionMetadata): void;
|
|
3422
|
+
/**
|
|
3423
|
+
* Set minimal fee for the transaction. If the real fee will be bigger then the set value, the transaction will be created with the real fee.
|
|
3424
|
+
*/
|
|
3425
|
+
set_min_fee(fee: BigNum): void;
|
|
3426
|
+
/**
|
|
3427
|
+
* !!! DEPRECATED !!!
|
|
3428
|
+
* Mints are defining by MintBuilder now.
|
|
3429
|
+
* Use `.set_mint_builder()` and `MintBuilder` instead.
|
|
3430
|
+
* Set explicit Mint object and the required witnesses to this builder
|
|
3431
|
+
* it will replace any previously existing mint and mint scripts
|
|
3432
|
+
* NOTE! Error will be returned in case a mint policy does not have a matching script
|
|
3433
|
+
*/
|
|
3434
|
+
set_mint(mint: Mint, mint_scripts: NativeScripts): void;
|
|
3435
|
+
/**
|
|
3436
|
+
* !!! DEPRECATED !!!
|
|
3437
|
+
* Mints are defining by MintBuilder now.
|
|
3438
|
+
* Use `.set_mint_builder()` and `MintBuilder` instead.
|
|
3439
|
+
* Add a mint entry to this builder using a PolicyID and MintAssets object
|
|
3440
|
+
* It will be securely added to existing or new Mint in this builder
|
|
3441
|
+
* It will replace any existing mint assets with the same PolicyID
|
|
3442
|
+
*/
|
|
3443
|
+
set_mint_asset(policy_script: NativeScript, mint_assets: MintAssets): void;
|
|
3444
|
+
set_mint_builder(mint_builder: MintBuilder): void;
|
|
3445
|
+
/**
|
|
3446
|
+
* Sets the specified hash value.
|
|
3447
|
+
* Alternatively you can use `.calc_script_data_hash` to calculate the hash automatically.
|
|
3448
|
+
* Or use `.remove_script_data_hash` to delete the previously set value
|
|
3449
|
+
*/
|
|
3450
|
+
set_script_data_hash(hash: ScriptDataHash): void;
|
|
3451
|
+
set_total_collateral(total_collateral: BigNum): void;
|
|
3452
|
+
/**
|
|
3453
|
+
* This function will set the total-collateral coin and then auto-calculate and assign
|
|
3454
|
+
* the collateral return value. Will raise an error in case no collateral inputs are set.
|
|
3455
|
+
* The specified address will be the received of the collateral return
|
|
3456
|
+
*/
|
|
3457
|
+
set_total_collateral_and_return(total_collateral: BigNum, return_address: Address): void;
|
|
3458
|
+
/**
|
|
3459
|
+
* !!! DEPRECATED !!!
|
|
3460
|
+
* Set ttl value.
|
|
3461
|
+
*/
|
|
3462
|
+
set_ttl(ttl: number): void;
|
|
3463
|
+
set_ttl_bignum(ttl: BigNum): void;
|
|
3464
|
+
/**
|
|
3465
|
+
* !!! DEPRECATED !!!
|
|
3466
|
+
* Uses outdated slot number format.
|
|
3467
|
+
*/
|
|
3468
|
+
set_validity_start_interval(validity_start_interval: number): void;
|
|
3469
|
+
set_validity_start_interval_bignum(validity_start_interval: BigNum): void;
|
|
3470
|
+
set_voting_builder(voting_builder: VotingBuilder): void;
|
|
3471
|
+
set_voting_proposal_builder(voting_proposal_builder: VotingProposalBuilder): void;
|
|
3472
|
+
/**
|
|
3473
|
+
* !!! DEPRECATED !!!
|
|
3474
|
+
* Can emit error if add a withdrawal with script credential.
|
|
3475
|
+
* Use set_withdrawals_builder instead.
|
|
3476
|
+
*/
|
|
3477
|
+
set_withdrawals(withdrawals: Withdrawals): void;
|
|
3478
|
+
set_withdrawals_builder(withdrawals: WithdrawalsBuilder): void;
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
export class TransactionBuilderConfig {
|
|
3482
|
+
private constructor();
|
|
3483
|
+
free(): void;
|
|
3484
|
+
[Symbol.dispose](): void;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3487
|
+
export class TransactionBuilderConfigBuilder {
|
|
3488
|
+
private constructor();
|
|
3489
|
+
free(): void;
|
|
3490
|
+
[Symbol.dispose](): void;
|
|
3491
|
+
build(): TransactionBuilderConfig;
|
|
3492
|
+
coins_per_utxo_byte(coins_per_utxo_byte: BigNum): TransactionBuilderConfigBuilder;
|
|
3493
|
+
/**
|
|
3494
|
+
* Removes a ref input (that was set via set_reference_inputs) if the ref inputs was presented in regular tx inputs
|
|
3495
|
+
*/
|
|
3496
|
+
deduplicate_explicit_ref_inputs_with_regular_inputs(deduplicate_explicit_ref_inputs_with_regular_inputs: boolean): TransactionBuilderConfigBuilder;
|
|
3497
|
+
/**
|
|
3498
|
+
* If set to true, the transaction builder will not burn extra change if it's impossible to crate change output
|
|
3499
|
+
* due to the value being too small to cover min ada for change output. Instead, tx builder will throw an error.
|
|
3500
|
+
*/
|
|
3501
|
+
do_not_burn_extra_change(do_not_burn_extra_change: boolean): TransactionBuilderConfigBuilder;
|
|
3502
|
+
ex_unit_prices(ex_unit_prices: ExUnitPrices): TransactionBuilderConfigBuilder;
|
|
3503
|
+
fee_algo(fee_algo: LinearFee): TransactionBuilderConfigBuilder;
|
|
3504
|
+
key_deposit(key_deposit: BigNum): TransactionBuilderConfigBuilder;
|
|
3505
|
+
max_tx_size(max_tx_size: number): TransactionBuilderConfigBuilder;
|
|
3506
|
+
max_value_size(max_value_size: number): TransactionBuilderConfigBuilder;
|
|
3507
|
+
static new(): TransactionBuilderConfigBuilder;
|
|
3508
|
+
pool_deposit(pool_deposit: BigNum): TransactionBuilderConfigBuilder;
|
|
3509
|
+
prefer_pure_change(prefer_pure_change: boolean): TransactionBuilderConfigBuilder;
|
|
3510
|
+
ref_script_coins_per_byte(ref_script_coins_per_byte: UnitInterval): TransactionBuilderConfigBuilder;
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
export class TransactionHash {
|
|
3514
|
+
private constructor();
|
|
3515
|
+
free(): void;
|
|
3516
|
+
[Symbol.dispose](): void;
|
|
3517
|
+
static from_bech32(bech_str: string): TransactionHash;
|
|
3518
|
+
static from_bytes(bytes: Uint8Array): TransactionHash;
|
|
3519
|
+
static from_hex(hex: string): TransactionHash;
|
|
3520
|
+
to_bech32(prefix: string): string;
|
|
3521
|
+
to_bytes(): Uint8Array;
|
|
3522
|
+
to_hex(): string;
|
|
3523
|
+
}
|
|
3524
|
+
|
|
3525
|
+
export class TransactionInput {
|
|
3526
|
+
private constructor();
|
|
3527
|
+
free(): void;
|
|
3528
|
+
[Symbol.dispose](): void;
|
|
3529
|
+
static from_bytes(bytes: Uint8Array): TransactionInput;
|
|
3530
|
+
static from_hex(hex_str: string): TransactionInput;
|
|
3531
|
+
static from_json(json: string): TransactionInput;
|
|
3532
|
+
index(): number;
|
|
3533
|
+
static new(transaction_id: TransactionHash, index: number): TransactionInput;
|
|
3534
|
+
to_bytes(): Uint8Array;
|
|
3535
|
+
to_hex(): string;
|
|
3536
|
+
to_js_value(): any;
|
|
3537
|
+
to_json(): string;
|
|
3538
|
+
transaction_id(): TransactionHash;
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
export class TransactionInputs {
|
|
3542
|
+
private constructor();
|
|
3543
|
+
free(): void;
|
|
3544
|
+
[Symbol.dispose](): void;
|
|
3545
|
+
/**
|
|
3546
|
+
* Add a new `TransactionInput` to the set.
|
|
3547
|
+
* Returns `true` if the element was not already present in the set.
|
|
3548
|
+
*/
|
|
3549
|
+
add(input: TransactionInput): boolean;
|
|
3550
|
+
static from_bytes(bytes: Uint8Array): TransactionInputs;
|
|
3551
|
+
static from_hex(hex_str: string): TransactionInputs;
|
|
3552
|
+
static from_json(json: string): TransactionInputs;
|
|
3553
|
+
get(index: number): TransactionInput;
|
|
3554
|
+
len(): number;
|
|
3555
|
+
static new(): TransactionInputs;
|
|
3556
|
+
to_bytes(): Uint8Array;
|
|
3557
|
+
to_hex(): string;
|
|
3558
|
+
to_js_value(): any;
|
|
3559
|
+
to_json(): string;
|
|
3560
|
+
to_option(): TransactionInputs | undefined;
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
export class TransactionMetadatum {
|
|
3564
|
+
private constructor();
|
|
3565
|
+
free(): void;
|
|
3566
|
+
[Symbol.dispose](): void;
|
|
3567
|
+
as_bytes(): Uint8Array;
|
|
3568
|
+
as_int(): Int;
|
|
3569
|
+
as_list(): MetadataList;
|
|
3570
|
+
as_map(): MetadataMap;
|
|
3571
|
+
as_text(): string;
|
|
3572
|
+
static from_bytes(bytes: Uint8Array): TransactionMetadatum;
|
|
3573
|
+
static from_hex(hex_str: string): TransactionMetadatum;
|
|
3574
|
+
kind(): TransactionMetadatumKind;
|
|
3575
|
+
static new_bytes(bytes: Uint8Array): TransactionMetadatum;
|
|
3576
|
+
static new_int(int: Int): TransactionMetadatum;
|
|
3577
|
+
static new_list(list: MetadataList): TransactionMetadatum;
|
|
3578
|
+
static new_map(map: MetadataMap): TransactionMetadatum;
|
|
3579
|
+
static new_text(text: string): TransactionMetadatum;
|
|
3580
|
+
to_bytes(): Uint8Array;
|
|
3581
|
+
to_hex(): string;
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
export enum TransactionMetadatumKind {
|
|
3585
|
+
MetadataMap = 0,
|
|
3586
|
+
MetadataList = 1,
|
|
3587
|
+
Int = 2,
|
|
3588
|
+
Bytes = 3,
|
|
3589
|
+
Text = 4,
|
|
3590
|
+
}
|
|
3591
|
+
|
|
3592
|
+
export class TransactionMetadatumLabels {
|
|
3593
|
+
private constructor();
|
|
3594
|
+
free(): void;
|
|
3595
|
+
[Symbol.dispose](): void;
|
|
3596
|
+
add(elem: BigNum): void;
|
|
3597
|
+
static from_bytes(bytes: Uint8Array): TransactionMetadatumLabels;
|
|
3598
|
+
static from_hex(hex_str: string): TransactionMetadatumLabels;
|
|
3599
|
+
get(index: number): BigNum;
|
|
3600
|
+
len(): number;
|
|
3601
|
+
static new(): TransactionMetadatumLabels;
|
|
3602
|
+
to_bytes(): Uint8Array;
|
|
3603
|
+
to_hex(): string;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
export class TransactionOutput {
|
|
3607
|
+
private constructor();
|
|
3608
|
+
free(): void;
|
|
3609
|
+
[Symbol.dispose](): void;
|
|
3610
|
+
address(): Address;
|
|
3611
|
+
amount(): Value;
|
|
3612
|
+
data_hash(): DataHash | undefined;
|
|
3613
|
+
static from_bytes(bytes: Uint8Array): TransactionOutput;
|
|
3614
|
+
static from_hex(hex_str: string): TransactionOutput;
|
|
3615
|
+
static from_json(json: string): TransactionOutput;
|
|
3616
|
+
has_data_hash(): boolean;
|
|
3617
|
+
has_plutus_data(): boolean;
|
|
3618
|
+
has_script_ref(): boolean;
|
|
3619
|
+
static new(address: Address, amount: Value): TransactionOutput;
|
|
3620
|
+
plutus_data(): PlutusData | undefined;
|
|
3621
|
+
script_ref(): ScriptRef | undefined;
|
|
3622
|
+
serialization_format(): CborContainerType | undefined;
|
|
3623
|
+
set_data_hash(data_hash: DataHash): void;
|
|
3624
|
+
set_plutus_data(data: PlutusData): void;
|
|
3625
|
+
set_script_ref(script_ref: ScriptRef): void;
|
|
3626
|
+
to_bytes(): Uint8Array;
|
|
3627
|
+
to_hex(): string;
|
|
3628
|
+
to_js_value(): any;
|
|
3629
|
+
to_json(): string;
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
export class TransactionOutputAmountBuilder {
|
|
3633
|
+
private constructor();
|
|
3634
|
+
free(): void;
|
|
3635
|
+
[Symbol.dispose](): void;
|
|
3636
|
+
build(): TransactionOutput;
|
|
3637
|
+
with_asset_and_min_required_coin_by_utxo_cost(multiasset: MultiAsset, data_cost: DataCost): TransactionOutputAmountBuilder;
|
|
3638
|
+
with_coin(coin: BigNum): TransactionOutputAmountBuilder;
|
|
3639
|
+
with_coin_and_asset(coin: BigNum, multiasset: MultiAsset): TransactionOutputAmountBuilder;
|
|
3640
|
+
with_value(amount: Value): TransactionOutputAmountBuilder;
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
/**
|
|
3644
|
+
* We introduce a builder-pattern format for creating transaction outputs
|
|
3645
|
+
* This is because:
|
|
3646
|
+
* 1. Some fields (i.e. data hash) are optional, and we can't easily expose Option<> in WASM
|
|
3647
|
+
* 2. Some fields like amounts have many ways it could be set (some depending on other field values being known)
|
|
3648
|
+
* 3. Easier to adapt as the output format gets more complicated in future Cardano releases
|
|
3649
|
+
*/
|
|
3650
|
+
export class TransactionOutputBuilder {
|
|
3651
|
+
private constructor();
|
|
3652
|
+
free(): void;
|
|
3653
|
+
[Symbol.dispose](): void;
|
|
3654
|
+
static new(): TransactionOutputBuilder;
|
|
3655
|
+
next(): TransactionOutputAmountBuilder;
|
|
3656
|
+
with_address(address: Address): TransactionOutputBuilder;
|
|
3657
|
+
with_data_hash(data_hash: DataHash): TransactionOutputBuilder;
|
|
3658
|
+
with_plutus_data(data: PlutusData): TransactionOutputBuilder;
|
|
3659
|
+
with_script_ref(script_ref: ScriptRef): TransactionOutputBuilder;
|
|
3660
|
+
}
|
|
3661
|
+
|
|
3662
|
+
export class TransactionOutputs {
|
|
3663
|
+
private constructor();
|
|
3664
|
+
free(): void;
|
|
3665
|
+
[Symbol.dispose](): void;
|
|
3666
|
+
add(elem: TransactionOutput): void;
|
|
3667
|
+
static from_bytes(bytes: Uint8Array): TransactionOutputs;
|
|
3668
|
+
static from_hex(hex_str: string): TransactionOutputs;
|
|
3669
|
+
static from_json(json: string): TransactionOutputs;
|
|
3670
|
+
get(index: number): TransactionOutput;
|
|
3671
|
+
len(): number;
|
|
3672
|
+
static new(): TransactionOutputs;
|
|
3673
|
+
to_bytes(): Uint8Array;
|
|
3674
|
+
to_hex(): string;
|
|
3675
|
+
to_js_value(): any;
|
|
3676
|
+
to_json(): string;
|
|
3677
|
+
}
|
|
3678
|
+
|
|
3679
|
+
export enum TransactionSetsState {
|
|
3680
|
+
AllSetsHaveTag = 0,
|
|
3681
|
+
AllSetsHaveNoTag = 1,
|
|
3682
|
+
MixedSets = 2,
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
export class TransactionUnspentOutput {
|
|
3686
|
+
private constructor();
|
|
3687
|
+
free(): void;
|
|
3688
|
+
[Symbol.dispose](): void;
|
|
3689
|
+
static from_bytes(bytes: Uint8Array): TransactionUnspentOutput;
|
|
3690
|
+
static from_hex(hex_str: string): TransactionUnspentOutput;
|
|
3691
|
+
static from_json(json: string): TransactionUnspentOutput;
|
|
3692
|
+
input(): TransactionInput;
|
|
3693
|
+
static new(input: TransactionInput, output: TransactionOutput): TransactionUnspentOutput;
|
|
3694
|
+
output(): TransactionOutput;
|
|
3695
|
+
to_bytes(): Uint8Array;
|
|
3696
|
+
to_hex(): string;
|
|
3697
|
+
to_js_value(): any;
|
|
3698
|
+
to_json(): string;
|
|
3699
|
+
}
|
|
3700
|
+
|
|
3701
|
+
export class TransactionUnspentOutputs {
|
|
3702
|
+
private constructor();
|
|
3703
|
+
free(): void;
|
|
3704
|
+
[Symbol.dispose](): void;
|
|
3705
|
+
add(elem: TransactionUnspentOutput): void;
|
|
3706
|
+
static from_json(json: string): TransactionUnspentOutputs;
|
|
3707
|
+
get(index: number): TransactionUnspentOutput;
|
|
3708
|
+
len(): number;
|
|
3709
|
+
static new(): TransactionUnspentOutputs;
|
|
3710
|
+
to_js_value(): any;
|
|
3711
|
+
to_json(): string;
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3714
|
+
export class TransactionWitnessSet {
|
|
3715
|
+
private constructor();
|
|
3716
|
+
free(): void;
|
|
3717
|
+
[Symbol.dispose](): void;
|
|
3718
|
+
bootstraps(): BootstrapWitnesses | undefined;
|
|
3719
|
+
static from_bytes(bytes: Uint8Array): TransactionWitnessSet;
|
|
3720
|
+
static from_hex(hex_str: string): TransactionWitnessSet;
|
|
3721
|
+
static from_json(json: string): TransactionWitnessSet;
|
|
3722
|
+
native_scripts(): NativeScripts | undefined;
|
|
3723
|
+
static new(): TransactionWitnessSet;
|
|
3724
|
+
plutus_data(): PlutusList | undefined;
|
|
3725
|
+
plutus_scripts(): PlutusScripts | undefined;
|
|
3726
|
+
redeemers(): Redeemers | undefined;
|
|
3727
|
+
set_bootstraps(bootstraps: BootstrapWitnesses): void;
|
|
3728
|
+
set_native_scripts(native_scripts: NativeScripts): void;
|
|
3729
|
+
set_plutus_data(plutus_data: PlutusList): void;
|
|
3730
|
+
set_plutus_scripts(plutus_scripts: PlutusScripts): void;
|
|
3731
|
+
set_redeemers(redeemers: Redeemers): void;
|
|
3732
|
+
set_vkeys(vkeys: Vkeywitnesses): void;
|
|
3733
|
+
to_bytes(): Uint8Array;
|
|
3734
|
+
to_hex(): string;
|
|
3735
|
+
to_js_value(): any;
|
|
3736
|
+
to_json(): string;
|
|
3737
|
+
vkeys(): Vkeywitnesses | undefined;
|
|
3738
|
+
}
|
|
3739
|
+
|
|
3740
|
+
export class TransactionWitnessSets {
|
|
3741
|
+
private constructor();
|
|
3742
|
+
free(): void;
|
|
3743
|
+
[Symbol.dispose](): void;
|
|
3744
|
+
add(elem: TransactionWitnessSet): void;
|
|
3745
|
+
static from_bytes(bytes: Uint8Array): TransactionWitnessSets;
|
|
3746
|
+
static from_hex(hex_str: string): TransactionWitnessSets;
|
|
3747
|
+
static from_json(json: string): TransactionWitnessSets;
|
|
3748
|
+
get(index: number): TransactionWitnessSet;
|
|
3749
|
+
len(): number;
|
|
3750
|
+
static new(): TransactionWitnessSets;
|
|
3751
|
+
to_bytes(): Uint8Array;
|
|
3752
|
+
to_hex(): string;
|
|
3753
|
+
to_js_value(): any;
|
|
3754
|
+
to_json(): string;
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
export class TreasuryWithdrawals {
|
|
3758
|
+
private constructor();
|
|
3759
|
+
free(): void;
|
|
3760
|
+
[Symbol.dispose](): void;
|
|
3761
|
+
static from_json(json: string): TreasuryWithdrawals;
|
|
3762
|
+
get(key: RewardAddress): BigNum | undefined;
|
|
3763
|
+
insert(key: RewardAddress, value: BigNum): void;
|
|
3764
|
+
keys(): RewardAddresses;
|
|
3765
|
+
len(): number;
|
|
3766
|
+
static new(): TreasuryWithdrawals;
|
|
3767
|
+
to_js_value(): any;
|
|
3768
|
+
to_json(): string;
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
export class TreasuryWithdrawalsAction {
|
|
3772
|
+
private constructor();
|
|
3773
|
+
free(): void;
|
|
3774
|
+
[Symbol.dispose](): void;
|
|
3775
|
+
static from_bytes(bytes: Uint8Array): TreasuryWithdrawalsAction;
|
|
3776
|
+
static from_hex(hex_str: string): TreasuryWithdrawalsAction;
|
|
3777
|
+
static from_json(json: string): TreasuryWithdrawalsAction;
|
|
3778
|
+
static new(withdrawals: TreasuryWithdrawals): TreasuryWithdrawalsAction;
|
|
3779
|
+
static new_with_policy_hash(withdrawals: TreasuryWithdrawals, policy_hash: ScriptHash): TreasuryWithdrawalsAction;
|
|
3780
|
+
policy_hash(): ScriptHash | undefined;
|
|
3781
|
+
to_bytes(): Uint8Array;
|
|
3782
|
+
to_hex(): string;
|
|
3783
|
+
to_js_value(): any;
|
|
3784
|
+
to_json(): string;
|
|
3785
|
+
withdrawals(): TreasuryWithdrawals;
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
export class TxInputsBuilder {
|
|
3789
|
+
private constructor();
|
|
3790
|
+
free(): void;
|
|
3791
|
+
[Symbol.dispose](): void;
|
|
3792
|
+
add_bootstrap_input(address: ByronAddress, input: TransactionInput, amount: Value): void;
|
|
3793
|
+
/**
|
|
3794
|
+
* We have to know what kind of inputs these are to know what kind of mock witnesses to create since
|
|
3795
|
+
* 1) mock witnesses have different lengths depending on the type which changes the expecting fee
|
|
3796
|
+
* 2) Witnesses are a set so we need to get rid of duplicates to avoid over-estimating the fee
|
|
3797
|
+
*/
|
|
3798
|
+
add_key_input(hash: Ed25519KeyHash, input: TransactionInput, amount: Value): void;
|
|
3799
|
+
/**
|
|
3800
|
+
* This method will add the input to the builder and also register the required native script witness
|
|
3801
|
+
*/
|
|
3802
|
+
add_native_script_input(script: NativeScriptSource, input: TransactionInput, amount: Value): void;
|
|
3803
|
+
add_native_script_utxo(utxo: TransactionUnspentOutput, witness: NativeScriptSource): void;
|
|
3804
|
+
/**
|
|
3805
|
+
* This method will add the input to the builder and also register the required plutus witness
|
|
3806
|
+
*/
|
|
3807
|
+
add_plutus_script_input(witness: PlutusWitness, input: TransactionInput, amount: Value): void;
|
|
3808
|
+
add_plutus_script_utxo(utxo: TransactionUnspentOutput, witness: PlutusWitness): void;
|
|
3809
|
+
/**
|
|
3810
|
+
* Adds non script input, in case of script or reward address input it will return an error
|
|
3811
|
+
*/
|
|
3812
|
+
add_regular_input(address: Address, input: TransactionInput, amount: Value): void;
|
|
3813
|
+
add_regular_utxo(utxo: TransactionUnspentOutput): void;
|
|
3814
|
+
add_required_signer(key: Ed25519KeyHash): void;
|
|
3815
|
+
add_required_signers(keys: Ed25519KeyHashes): void;
|
|
3816
|
+
/**
|
|
3817
|
+
* Returns a copy of the current script input witness scripts in the builder
|
|
3818
|
+
*/
|
|
3819
|
+
get_native_input_scripts(): NativeScripts | undefined;
|
|
3820
|
+
/**
|
|
3821
|
+
* Returns a copy of the current plutus input witness scripts in the builder.
|
|
3822
|
+
* NOTE: each plutus witness will be cloned with a specific corresponding input index
|
|
3823
|
+
*/
|
|
3824
|
+
get_plutus_input_scripts(): PlutusWitnesses | undefined;
|
|
3825
|
+
get_ref_inputs(): TransactionInputs;
|
|
3826
|
+
inputs(): TransactionInputs;
|
|
3827
|
+
inputs_option(): TransactionInputs | undefined;
|
|
3828
|
+
len(): number;
|
|
3829
|
+
static new(): TxInputsBuilder;
|
|
3830
|
+
total_value(): Value;
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
export class URL {
|
|
3834
|
+
private constructor();
|
|
3835
|
+
free(): void;
|
|
3836
|
+
[Symbol.dispose](): void;
|
|
3837
|
+
static from_bytes(bytes: Uint8Array): URL;
|
|
3838
|
+
static from_hex(hex_str: string): URL;
|
|
3839
|
+
static from_json(json: string): URL;
|
|
3840
|
+
static new(url: string): URL;
|
|
3841
|
+
to_bytes(): Uint8Array;
|
|
3842
|
+
to_hex(): string;
|
|
3843
|
+
to_js_value(): any;
|
|
3844
|
+
to_json(): string;
|
|
3845
|
+
url(): string;
|
|
3846
|
+
}
|
|
3847
|
+
|
|
3848
|
+
export class UnitInterval {
|
|
3849
|
+
private constructor();
|
|
3850
|
+
free(): void;
|
|
3851
|
+
[Symbol.dispose](): void;
|
|
3852
|
+
denominator(): BigNum;
|
|
3853
|
+
static from_bytes(bytes: Uint8Array): UnitInterval;
|
|
3854
|
+
static from_hex(hex_str: string): UnitInterval;
|
|
3855
|
+
static from_json(json: string): UnitInterval;
|
|
3856
|
+
static new(numerator: BigNum, denominator: BigNum): UnitInterval;
|
|
3857
|
+
numerator(): BigNum;
|
|
3858
|
+
to_bytes(): Uint8Array;
|
|
3859
|
+
to_hex(): string;
|
|
3860
|
+
to_js_value(): any;
|
|
3861
|
+
to_json(): string;
|
|
3862
|
+
}
|
|
3863
|
+
|
|
3864
|
+
export class Update {
|
|
3865
|
+
private constructor();
|
|
3866
|
+
free(): void;
|
|
3867
|
+
[Symbol.dispose](): void;
|
|
3868
|
+
epoch(): number;
|
|
3869
|
+
static from_bytes(bytes: Uint8Array): Update;
|
|
3870
|
+
static from_hex(hex_str: string): Update;
|
|
3871
|
+
static from_json(json: string): Update;
|
|
3872
|
+
static new(proposed_protocol_parameter_updates: ProposedProtocolParameterUpdates, epoch: number): Update;
|
|
3873
|
+
proposed_protocol_parameter_updates(): ProposedProtocolParameterUpdates;
|
|
3874
|
+
to_bytes(): Uint8Array;
|
|
3875
|
+
to_hex(): string;
|
|
3876
|
+
to_js_value(): any;
|
|
3877
|
+
to_json(): string;
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
export class UpdateCommitteeAction {
|
|
3881
|
+
private constructor();
|
|
3882
|
+
free(): void;
|
|
3883
|
+
[Symbol.dispose](): void;
|
|
3884
|
+
committee(): Committee;
|
|
3885
|
+
static from_bytes(bytes: Uint8Array): UpdateCommitteeAction;
|
|
3886
|
+
static from_hex(hex_str: string): UpdateCommitteeAction;
|
|
3887
|
+
static from_json(json: string): UpdateCommitteeAction;
|
|
3888
|
+
gov_action_id(): GovernanceActionId | undefined;
|
|
3889
|
+
members_to_remove(): Credentials;
|
|
3890
|
+
static new(committee: Committee, members_to_remove: Credentials): UpdateCommitteeAction;
|
|
3891
|
+
static new_with_action_id(gov_action_id: GovernanceActionId, committee: Committee, members_to_remove: Credentials): UpdateCommitteeAction;
|
|
3892
|
+
to_bytes(): Uint8Array;
|
|
3893
|
+
to_hex(): string;
|
|
3894
|
+
to_js_value(): any;
|
|
3895
|
+
to_json(): string;
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3898
|
+
export class VRFCert {
|
|
3899
|
+
private constructor();
|
|
3900
|
+
free(): void;
|
|
3901
|
+
[Symbol.dispose](): void;
|
|
3902
|
+
static from_bytes(bytes: Uint8Array): VRFCert;
|
|
3903
|
+
static from_hex(hex_str: string): VRFCert;
|
|
3904
|
+
static from_json(json: string): VRFCert;
|
|
3905
|
+
static new(output: Uint8Array, proof: Uint8Array): VRFCert;
|
|
3906
|
+
output(): Uint8Array;
|
|
3907
|
+
proof(): Uint8Array;
|
|
3908
|
+
to_bytes(): Uint8Array;
|
|
3909
|
+
to_hex(): string;
|
|
3910
|
+
to_js_value(): any;
|
|
3911
|
+
to_json(): string;
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
export class VRFKeyHash {
|
|
3915
|
+
private constructor();
|
|
3916
|
+
free(): void;
|
|
3917
|
+
[Symbol.dispose](): void;
|
|
3918
|
+
static from_bech32(bech_str: string): VRFKeyHash;
|
|
3919
|
+
static from_bytes(bytes: Uint8Array): VRFKeyHash;
|
|
3920
|
+
static from_hex(hex: string): VRFKeyHash;
|
|
3921
|
+
to_bech32(prefix: string): string;
|
|
3922
|
+
to_bytes(): Uint8Array;
|
|
3923
|
+
to_hex(): string;
|
|
3924
|
+
}
|
|
3925
|
+
|
|
3926
|
+
export class VRFVKey {
|
|
3927
|
+
private constructor();
|
|
3928
|
+
free(): void;
|
|
3929
|
+
[Symbol.dispose](): void;
|
|
3930
|
+
static from_bech32(bech_str: string): VRFVKey;
|
|
3931
|
+
static from_bytes(bytes: Uint8Array): VRFVKey;
|
|
3932
|
+
static from_hex(hex: string): VRFVKey;
|
|
3933
|
+
to_bech32(prefix: string): string;
|
|
3934
|
+
to_bytes(): Uint8Array;
|
|
3935
|
+
to_hex(): string;
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
export class Value {
|
|
3939
|
+
private constructor();
|
|
3940
|
+
free(): void;
|
|
3941
|
+
[Symbol.dispose](): void;
|
|
3942
|
+
checked_add(rhs: Value): Value;
|
|
3943
|
+
checked_sub(rhs_value: Value): Value;
|
|
3944
|
+
clamped_sub(rhs_value: Value): Value;
|
|
3945
|
+
coin(): BigNum;
|
|
3946
|
+
/**
|
|
3947
|
+
* note: values are only partially comparable
|
|
3948
|
+
*/
|
|
3949
|
+
compare(rhs_value: Value): number | undefined;
|
|
3950
|
+
static from_bytes(bytes: Uint8Array): Value;
|
|
3951
|
+
static from_hex(hex_str: string): Value;
|
|
3952
|
+
static from_json(json: string): Value;
|
|
3953
|
+
is_zero(): boolean;
|
|
3954
|
+
multiasset(): MultiAsset | undefined;
|
|
3955
|
+
static new(coin: BigNum): Value;
|
|
3956
|
+
static new_from_assets(multiasset: MultiAsset): Value;
|
|
3957
|
+
static new_with_assets(coin: BigNum, multiasset: MultiAsset): Value;
|
|
3958
|
+
set_coin(coin: BigNum): void;
|
|
3959
|
+
set_multiasset(multiasset: MultiAsset): void;
|
|
3960
|
+
to_bytes(): Uint8Array;
|
|
3961
|
+
to_hex(): string;
|
|
3962
|
+
to_js_value(): any;
|
|
3963
|
+
to_json(): string;
|
|
3964
|
+
static zero(): Value;
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
export class VersionedBlock {
|
|
3968
|
+
private constructor();
|
|
3969
|
+
free(): void;
|
|
3970
|
+
[Symbol.dispose](): void;
|
|
3971
|
+
block(): Block;
|
|
3972
|
+
era(): BlockEra;
|
|
3973
|
+
static from_bytes(bytes: Uint8Array): VersionedBlock;
|
|
3974
|
+
static from_hex(hex_str: string): VersionedBlock;
|
|
3975
|
+
static from_json(json: string): VersionedBlock;
|
|
3976
|
+
static new(block: Block, era_code: number): VersionedBlock;
|
|
3977
|
+
to_bytes(): Uint8Array;
|
|
3978
|
+
to_hex(): string;
|
|
3979
|
+
to_js_value(): any;
|
|
3980
|
+
to_json(): string;
|
|
3981
|
+
}
|
|
3982
|
+
|
|
3983
|
+
export class Vkey {
|
|
3984
|
+
private constructor();
|
|
3985
|
+
free(): void;
|
|
3986
|
+
[Symbol.dispose](): void;
|
|
3987
|
+
static from_bytes(bytes: Uint8Array): Vkey;
|
|
3988
|
+
static from_hex(hex_str: string): Vkey;
|
|
3989
|
+
static from_json(json: string): Vkey;
|
|
3990
|
+
static new(pk: PublicKey): Vkey;
|
|
3991
|
+
public_key(): PublicKey;
|
|
3992
|
+
to_bytes(): Uint8Array;
|
|
3993
|
+
to_hex(): string;
|
|
3994
|
+
to_js_value(): any;
|
|
3995
|
+
to_json(): string;
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3998
|
+
export class Vkeys {
|
|
3999
|
+
private constructor();
|
|
4000
|
+
free(): void;
|
|
4001
|
+
[Symbol.dispose](): void;
|
|
4002
|
+
add(elem: Vkey): void;
|
|
4003
|
+
get(index: number): Vkey;
|
|
4004
|
+
len(): number;
|
|
4005
|
+
static new(): Vkeys;
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
export class Vkeywitness {
|
|
4009
|
+
private constructor();
|
|
4010
|
+
free(): void;
|
|
4011
|
+
[Symbol.dispose](): void;
|
|
4012
|
+
static from_bytes(bytes: Uint8Array): Vkeywitness;
|
|
4013
|
+
static from_hex(hex_str: string): Vkeywitness;
|
|
4014
|
+
static from_json(json: string): Vkeywitness;
|
|
4015
|
+
static new(vkey: Vkey, signature: Ed25519Signature): Vkeywitness;
|
|
4016
|
+
signature(): Ed25519Signature;
|
|
4017
|
+
to_bytes(): Uint8Array;
|
|
4018
|
+
to_hex(): string;
|
|
4019
|
+
to_js_value(): any;
|
|
4020
|
+
to_json(): string;
|
|
4021
|
+
vkey(): Vkey;
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
export class Vkeywitnesses {
|
|
4025
|
+
private constructor();
|
|
4026
|
+
free(): void;
|
|
4027
|
+
[Symbol.dispose](): void;
|
|
4028
|
+
/**
|
|
4029
|
+
* Add a new `Vkeywitness` to the set.
|
|
4030
|
+
* Returns `true` if the element was not already present in the set.
|
|
4031
|
+
*/
|
|
4032
|
+
add(witness: Vkeywitness): boolean;
|
|
4033
|
+
static from_bytes(bytes: Uint8Array): Vkeywitnesses;
|
|
4034
|
+
static from_hex(hex_str: string): Vkeywitnesses;
|
|
4035
|
+
static from_json(json: string): Vkeywitnesses;
|
|
4036
|
+
get(index: number): Vkeywitness;
|
|
4037
|
+
len(): number;
|
|
4038
|
+
static new(): Vkeywitnesses;
|
|
4039
|
+
to_bytes(): Uint8Array;
|
|
4040
|
+
to_hex(): string;
|
|
4041
|
+
to_js_value(): any;
|
|
4042
|
+
to_json(): string;
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
export class VoteDelegation {
|
|
4046
|
+
private constructor();
|
|
4047
|
+
free(): void;
|
|
4048
|
+
[Symbol.dispose](): void;
|
|
4049
|
+
drep(): DRep;
|
|
4050
|
+
static from_bytes(bytes: Uint8Array): VoteDelegation;
|
|
4051
|
+
static from_hex(hex_str: string): VoteDelegation;
|
|
4052
|
+
static from_json(json: string): VoteDelegation;
|
|
4053
|
+
has_script_credentials(): boolean;
|
|
4054
|
+
static new(stake_credential: Credential, drep: DRep): VoteDelegation;
|
|
4055
|
+
stake_credential(): Credential;
|
|
4056
|
+
to_bytes(): Uint8Array;
|
|
4057
|
+
to_hex(): string;
|
|
4058
|
+
to_js_value(): any;
|
|
4059
|
+
to_json(): string;
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
export enum VoteKind {
|
|
4063
|
+
No = 0,
|
|
4064
|
+
Yes = 1,
|
|
4065
|
+
Abstain = 2,
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4068
|
+
export class VoteRegistrationAndDelegation {
|
|
4069
|
+
private constructor();
|
|
4070
|
+
free(): void;
|
|
4071
|
+
[Symbol.dispose](): void;
|
|
4072
|
+
coin(): BigNum;
|
|
4073
|
+
drep(): DRep;
|
|
4074
|
+
static from_bytes(bytes: Uint8Array): VoteRegistrationAndDelegation;
|
|
4075
|
+
static from_hex(hex_str: string): VoteRegistrationAndDelegation;
|
|
4076
|
+
static from_json(json: string): VoteRegistrationAndDelegation;
|
|
4077
|
+
has_script_credentials(): boolean;
|
|
4078
|
+
static new(stake_credential: Credential, drep: DRep, coin: BigNum): VoteRegistrationAndDelegation;
|
|
4079
|
+
stake_credential(): Credential;
|
|
4080
|
+
to_bytes(): Uint8Array;
|
|
4081
|
+
to_hex(): string;
|
|
4082
|
+
to_js_value(): any;
|
|
4083
|
+
to_json(): string;
|
|
4084
|
+
}
|
|
4085
|
+
|
|
4086
|
+
export class Voter {
|
|
4087
|
+
private constructor();
|
|
4088
|
+
free(): void;
|
|
4089
|
+
[Symbol.dispose](): void;
|
|
4090
|
+
static from_bytes(bytes: Uint8Array): Voter;
|
|
4091
|
+
static from_hex(hex_str: string): Voter;
|
|
4092
|
+
static from_json(json: string): Voter;
|
|
4093
|
+
has_script_credentials(): boolean;
|
|
4094
|
+
kind(): VoterKind;
|
|
4095
|
+
static new_constitutional_committee_hot_credential(cred: Credential): Voter;
|
|
4096
|
+
static new_drep_credential(cred: Credential): Voter;
|
|
4097
|
+
static new_stake_pool_key_hash(key_hash: Ed25519KeyHash): Voter;
|
|
4098
|
+
to_bytes(): Uint8Array;
|
|
4099
|
+
to_constitutional_committee_hot_credential(): Credential | undefined;
|
|
4100
|
+
to_drep_credential(): Credential | undefined;
|
|
4101
|
+
to_hex(): string;
|
|
4102
|
+
to_js_value(): any;
|
|
4103
|
+
to_json(): string;
|
|
4104
|
+
to_key_hash(): Ed25519KeyHash | undefined;
|
|
4105
|
+
to_stake_pool_key_hash(): Ed25519KeyHash | undefined;
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
export enum VoterKind {
|
|
4109
|
+
ConstitutionalCommitteeHotKeyHash = 0,
|
|
4110
|
+
ConstitutionalCommitteeHotScriptHash = 1,
|
|
4111
|
+
DRepKeyHash = 2,
|
|
4112
|
+
DRepScriptHash = 3,
|
|
4113
|
+
StakingPoolKeyHash = 4,
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
export class Voters {
|
|
4117
|
+
private constructor();
|
|
4118
|
+
free(): void;
|
|
4119
|
+
[Symbol.dispose](): void;
|
|
4120
|
+
add(voter: Voter): void;
|
|
4121
|
+
static from_json(json: string): Voters;
|
|
4122
|
+
get(index: number): Voter | undefined;
|
|
4123
|
+
len(): number;
|
|
4124
|
+
static new(): Voters;
|
|
4125
|
+
to_js_value(): any;
|
|
4126
|
+
to_json(): string;
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
export class VotingBuilder {
|
|
4130
|
+
private constructor();
|
|
4131
|
+
free(): void;
|
|
4132
|
+
[Symbol.dispose](): void;
|
|
4133
|
+
add(voter: Voter, gov_action_id: GovernanceActionId, voting_procedure: VotingProcedure): void;
|
|
4134
|
+
add_with_native_script(voter: Voter, gov_action_id: GovernanceActionId, voting_procedure: VotingProcedure, native_script_source: NativeScriptSource): void;
|
|
4135
|
+
add_with_plutus_witness(voter: Voter, gov_action_id: GovernanceActionId, voting_procedure: VotingProcedure, witness: PlutusWitness): void;
|
|
4136
|
+
build(): VotingProcedures;
|
|
4137
|
+
get_native_scripts(): NativeScripts;
|
|
4138
|
+
get_plutus_witnesses(): PlutusWitnesses;
|
|
4139
|
+
get_ref_inputs(): TransactionInputs;
|
|
4140
|
+
has_plutus_scripts(): boolean;
|
|
4141
|
+
static new(): VotingBuilder;
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
export class VotingProcedure {
|
|
4145
|
+
private constructor();
|
|
4146
|
+
free(): void;
|
|
4147
|
+
[Symbol.dispose](): void;
|
|
4148
|
+
anchor(): Anchor | undefined;
|
|
4149
|
+
static from_bytes(bytes: Uint8Array): VotingProcedure;
|
|
4150
|
+
static from_hex(hex_str: string): VotingProcedure;
|
|
4151
|
+
static from_json(json: string): VotingProcedure;
|
|
4152
|
+
static new(vote: VoteKind): VotingProcedure;
|
|
4153
|
+
static new_with_anchor(vote: VoteKind, anchor: Anchor): VotingProcedure;
|
|
4154
|
+
to_bytes(): Uint8Array;
|
|
4155
|
+
to_hex(): string;
|
|
4156
|
+
to_js_value(): any;
|
|
4157
|
+
to_json(): string;
|
|
4158
|
+
vote_kind(): VoteKind;
|
|
4159
|
+
}
|
|
4160
|
+
|
|
4161
|
+
export class VotingProcedures {
|
|
4162
|
+
private constructor();
|
|
4163
|
+
free(): void;
|
|
4164
|
+
[Symbol.dispose](): void;
|
|
4165
|
+
static from_bytes(bytes: Uint8Array): VotingProcedures;
|
|
4166
|
+
static from_hex(hex_str: string): VotingProcedures;
|
|
4167
|
+
static from_json(json: string): VotingProcedures;
|
|
4168
|
+
get(voter: Voter, governance_action_id: GovernanceActionId): VotingProcedure | undefined;
|
|
4169
|
+
get_governance_action_ids_by_voter(voter: Voter): GovernanceActionIds;
|
|
4170
|
+
get_voters(): Voters;
|
|
4171
|
+
insert(voter: Voter, governance_action_id: GovernanceActionId, voting_procedure: VotingProcedure): void;
|
|
4172
|
+
static new(): VotingProcedures;
|
|
4173
|
+
to_bytes(): Uint8Array;
|
|
4174
|
+
to_hex(): string;
|
|
4175
|
+
to_js_value(): any;
|
|
4176
|
+
to_json(): string;
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
export class VotingProposal {
|
|
4180
|
+
private constructor();
|
|
4181
|
+
free(): void;
|
|
4182
|
+
[Symbol.dispose](): void;
|
|
4183
|
+
anchor(): Anchor;
|
|
4184
|
+
deposit(): BigNum;
|
|
4185
|
+
static from_bytes(bytes: Uint8Array): VotingProposal;
|
|
4186
|
+
static from_hex(hex_str: string): VotingProposal;
|
|
4187
|
+
static from_json(json: string): VotingProposal;
|
|
4188
|
+
governance_action(): GovernanceAction;
|
|
4189
|
+
static new(governance_action: GovernanceAction, anchor: Anchor, reward_account: RewardAddress, deposit: BigNum): VotingProposal;
|
|
4190
|
+
reward_account(): RewardAddress;
|
|
4191
|
+
to_bytes(): Uint8Array;
|
|
4192
|
+
to_hex(): string;
|
|
4193
|
+
to_js_value(): any;
|
|
4194
|
+
to_json(): string;
|
|
4195
|
+
}
|
|
4196
|
+
|
|
4197
|
+
export class VotingProposalBuilder {
|
|
4198
|
+
private constructor();
|
|
4199
|
+
free(): void;
|
|
4200
|
+
[Symbol.dispose](): void;
|
|
4201
|
+
add(proposal: VotingProposal): void;
|
|
4202
|
+
add_with_plutus_witness(proposal: VotingProposal, witness: PlutusWitness): void;
|
|
4203
|
+
build(): VotingProposals;
|
|
4204
|
+
get_plutus_witnesses(): PlutusWitnesses;
|
|
4205
|
+
get_ref_inputs(): TransactionInputs;
|
|
4206
|
+
has_plutus_scripts(): boolean;
|
|
4207
|
+
static new(): VotingProposalBuilder;
|
|
4208
|
+
}
|
|
4209
|
+
|
|
4210
|
+
export class VotingProposals {
|
|
4211
|
+
private constructor();
|
|
4212
|
+
free(): void;
|
|
4213
|
+
[Symbol.dispose](): void;
|
|
4214
|
+
/**
|
|
4215
|
+
* Add a new `VotingProposal` to the set.
|
|
4216
|
+
* Returns `true` if the element was not already present in the set.
|
|
4217
|
+
*/
|
|
4218
|
+
add(proposal: VotingProposal): boolean;
|
|
4219
|
+
contains(elem: VotingProposal): boolean;
|
|
4220
|
+
static from_bytes(bytes: Uint8Array): VotingProposals;
|
|
4221
|
+
static from_hex(hex_str: string): VotingProposals;
|
|
4222
|
+
static from_json(json: string): VotingProposals;
|
|
4223
|
+
get(index: number): VotingProposal;
|
|
4224
|
+
len(): number;
|
|
4225
|
+
static new(): VotingProposals;
|
|
4226
|
+
to_bytes(): Uint8Array;
|
|
4227
|
+
to_hex(): string;
|
|
4228
|
+
to_js_value(): any;
|
|
4229
|
+
to_json(): string;
|
|
4230
|
+
to_option(): VotingProposals | undefined;
|
|
4231
|
+
}
|
|
4232
|
+
|
|
4233
|
+
export class Withdrawals {
|
|
4234
|
+
private constructor();
|
|
4235
|
+
free(): void;
|
|
4236
|
+
[Symbol.dispose](): void;
|
|
4237
|
+
static from_bytes(bytes: Uint8Array): Withdrawals;
|
|
4238
|
+
static from_hex(hex_str: string): Withdrawals;
|
|
4239
|
+
static from_json(json: string): Withdrawals;
|
|
4240
|
+
get(key: RewardAddress): BigNum | undefined;
|
|
4241
|
+
insert(key: RewardAddress, value: BigNum): BigNum | undefined;
|
|
4242
|
+
keys(): RewardAddresses;
|
|
4243
|
+
len(): number;
|
|
4244
|
+
static new(): Withdrawals;
|
|
4245
|
+
to_bytes(): Uint8Array;
|
|
4246
|
+
to_hex(): string;
|
|
4247
|
+
to_js_value(): any;
|
|
4248
|
+
to_json(): string;
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4251
|
+
export class WithdrawalsBuilder {
|
|
4252
|
+
private constructor();
|
|
4253
|
+
free(): void;
|
|
4254
|
+
[Symbol.dispose](): void;
|
|
4255
|
+
add(address: RewardAddress, coin: BigNum): void;
|
|
4256
|
+
add_with_native_script(address: RewardAddress, coin: BigNum, native_script_source: NativeScriptSource): void;
|
|
4257
|
+
add_with_plutus_witness(address: RewardAddress, coin: BigNum, witness: PlutusWitness): void;
|
|
4258
|
+
build(): Withdrawals;
|
|
4259
|
+
get_native_scripts(): NativeScripts;
|
|
4260
|
+
get_plutus_witnesses(): PlutusWitnesses;
|
|
4261
|
+
get_ref_inputs(): TransactionInputs;
|
|
4262
|
+
get_total_withdrawals(): Value;
|
|
4263
|
+
has_plutus_scripts(): boolean;
|
|
4264
|
+
static new(): WithdrawalsBuilder;
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4267
|
+
export function buildAndSign(request_json: string): Uint8Array;
|
|
4268
|
+
|
|
4269
|
+
export function buildAndSignFromPrivateKey(request_json: string): Uint8Array;
|
|
4270
|
+
|
|
4271
|
+
export function calculate_ex_units_ceil_cost(ex_units: ExUnits, ex_unit_prices: ExUnitPrices): BigNum;
|
|
4272
|
+
|
|
4273
|
+
export function create_send_all(address: Address, utxos: TransactionUnspentOutputs, config: TransactionBuilderConfig): TransactionBatchList;
|
|
4274
|
+
|
|
4275
|
+
export function decode_arbitrary_bytes_from_metadatum(metadata: TransactionMetadatum): Uint8Array;
|
|
4276
|
+
|
|
4277
|
+
export function decode_metadatum_to_json_str(metadatum: TransactionMetadatum, schema: MetadataJsonSchema): string;
|
|
4278
|
+
|
|
4279
|
+
export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: PlutusDatumSchema): string;
|
|
4280
|
+
|
|
4281
|
+
export function decrypt_with_password(password: string, data: string): string;
|
|
4282
|
+
|
|
4283
|
+
export function deriveAddress(request_json: string): string;
|
|
4284
|
+
|
|
4285
|
+
export function deriveAddressFromPrivateKey(request_json: string): string;
|
|
4286
|
+
|
|
4287
|
+
export function deriveWallet(request_json: string): string;
|
|
4288
|
+
|
|
4289
|
+
export function deriveWalletFromPrivateKey(request_json: string): string;
|
|
4290
|
+
|
|
4291
|
+
export function encode_arbitrary_bytes_as_metadatum(bytes: Uint8Array): TransactionMetadatum;
|
|
4292
|
+
|
|
4293
|
+
export function encode_json_str_to_metadatum(json: string, schema: MetadataJsonSchema): TransactionMetadatum;
|
|
4294
|
+
|
|
4295
|
+
/**
|
|
4296
|
+
* Receives a script JSON string
|
|
4297
|
+
* and returns a NativeScript.
|
|
4298
|
+
* Cardano Wallet and Node styles are supported.
|
|
4299
|
+
*
|
|
4300
|
+
* * wallet: https://github.com/input-output-hk/cardano-wallet/blob/master/specifications/api/swagger.yaml
|
|
4301
|
+
* * node: https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/simple-scripts.md
|
|
4302
|
+
*
|
|
4303
|
+
* self_xpub is expected to be a Bip32PublicKey as hex-encoded bytes
|
|
4304
|
+
*/
|
|
4305
|
+
export function encode_json_str_to_native_script(json: string, self_xpub: string, schema: ScriptSchema): NativeScript;
|
|
4306
|
+
|
|
4307
|
+
export function encode_json_str_to_plutus_datum(json: string, schema: PlutusDatumSchema): PlutusData;
|
|
4308
|
+
|
|
4309
|
+
export function encrypt_with_password(password: string, salt: string, nonce: string, data: string): string;
|
|
4310
|
+
|
|
4311
|
+
export function get_deposit(txbody: TransactionBody, pool_deposit: BigNum, key_deposit: BigNum): BigNum;
|
|
4312
|
+
|
|
4313
|
+
export function get_implicit_input(txbody: TransactionBody, pool_deposit: BigNum, key_deposit: BigNum): Value;
|
|
4314
|
+
|
|
4315
|
+
/**
|
|
4316
|
+
* Returns the state of the transaction sets.
|
|
4317
|
+
* If all sets have a tag, it returns AllSetsHaveTag.
|
|
4318
|
+
* If all sets have no tag, it returns AllSetsHaveNoTag.
|
|
4319
|
+
* If there is a mix of tagged and untagged sets, it returns MixedSets.
|
|
4320
|
+
* This function is useful for checking if a transaction might be signed by a hardware wallet.
|
|
4321
|
+
* And for checking which parameter should be used in a hardware wallet api.
|
|
4322
|
+
* WARNING this function will be deleted after all tags for set types will be mandatory. Approx after next hf
|
|
4323
|
+
*/
|
|
4324
|
+
export function has_transaction_set_tag(tx_bytes: Uint8Array): TransactionSetsState;
|
|
4325
|
+
|
|
4326
|
+
export function hash_auxiliary_data(auxiliary_data: AuxiliaryData): AuxiliaryDataHash;
|
|
4327
|
+
|
|
4328
|
+
export function hash_plutus_data(plutus_data: PlutusData): DataHash;
|
|
4329
|
+
|
|
4330
|
+
export function hash_script_data(redeemers: Redeemers, cost_models: Costmdls, datums?: PlutusList | null): ScriptDataHash;
|
|
4331
|
+
|
|
4332
|
+
export function init(): void;
|
|
4333
|
+
|
|
4334
|
+
export function invokeChainExtension(chain_id: string, method: string, payload_json: string): string;
|
|
4335
|
+
|
|
4336
|
+
export function listChainExtensions(): string;
|
|
4337
|
+
|
|
4338
|
+
export function listSupportedChains(): string;
|
|
4339
|
+
|
|
4340
|
+
export function make_daedalus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: LegacyDaedalusPrivateKey): BootstrapWitness;
|
|
4341
|
+
|
|
4342
|
+
export function make_icarus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: Bip32PrivateKey): BootstrapWitness;
|
|
4343
|
+
|
|
4344
|
+
export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
|
|
4345
|
+
|
|
4346
|
+
/**
|
|
4347
|
+
* returns minimal amount of ada for the output for case when the amount is included to the output
|
|
4348
|
+
*/
|
|
4349
|
+
export function min_ada_for_output(output: TransactionOutput, data_cost: DataCost): BigNum;
|
|
4350
|
+
|
|
4351
|
+
export function min_fee(tx: Transaction, linear_fee: LinearFee): BigNum;
|
|
4352
|
+
|
|
4353
|
+
export function min_ref_script_fee(total_ref_scripts_size: number, ref_script_coins_per_byte: UnitInterval): BigNum;
|
|
4354
|
+
|
|
4355
|
+
export function min_script_fee(tx: Transaction, ex_unit_prices: ExUnitPrices): BigNum;
|
|
4356
|
+
|
|
4357
|
+
export function signBytes(request_json: string): Uint8Array;
|
|
4358
|
+
|
|
4359
|
+
export function signBytesFromPrivateKey(request_json: string): Uint8Array;
|
|
4360
|
+
|
|
4361
|
+
export function signMessage(request_json: string): Uint8Array;
|
|
4362
|
+
|
|
4363
|
+
export function signMessageFromPrivateKey(request_json: string): Uint8Array;
|
|
4364
|
+
|
|
4365
|
+
export function signTypedData(request_json: string): Uint8Array;
|
|
4366
|
+
|
|
4367
|
+
export function signTypedDataFromPrivateKey(request_json: string): Uint8Array;
|