niors 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/niors.d.ts +946 -0
- package/niors.js +3048 -0
- package/niors_bg.wasm +0 -0
- package/package.json +16 -0
package/niors.d.ts
ADDED
|
@@ -0,0 +1,946 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Progress callback for wallet actions (delegation, voting, etc.).
|
|
6
|
+
*
|
|
7
|
+
* JS consumers pass a function `(progress: ActionProgress) => void`.
|
|
8
|
+
*/
|
|
9
|
+
export class ActionProgress {
|
|
10
|
+
private constructor();
|
|
11
|
+
free(): void;
|
|
12
|
+
[Symbol.dispose](): void;
|
|
13
|
+
readonly detail: string;
|
|
14
|
+
readonly step: string;
|
|
15
|
+
readonly tx_hash: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* CIP-30 error codes.
|
|
20
|
+
*/
|
|
21
|
+
export enum Cip30ErrorCode {
|
|
22
|
+
InvalidRequest = -1,
|
|
23
|
+
InternalError = -2,
|
|
24
|
+
Refused = -3,
|
|
25
|
+
AccountChange = -4,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* CIP-0008 data signature returned by signData.
|
|
30
|
+
*/
|
|
31
|
+
export class DataSignature {
|
|
32
|
+
private constructor();
|
|
33
|
+
free(): void;
|
|
34
|
+
[Symbol.dispose](): void;
|
|
35
|
+
readonly key: string;
|
|
36
|
+
readonly signature: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* CIP-30 wallet extension descriptor.
|
|
41
|
+
*/
|
|
42
|
+
export class Extension {
|
|
43
|
+
free(): void;
|
|
44
|
+
[Symbol.dispose](): void;
|
|
45
|
+
constructor(cip: number);
|
|
46
|
+
readonly cip: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Cardano network identifier.
|
|
51
|
+
*/
|
|
52
|
+
export enum NetworkId {
|
|
53
|
+
Testnet = 0,
|
|
54
|
+
Mainnet = 1,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A Cardano address (Base, Enterprise, Reward, Pointer, or Byron).
|
|
59
|
+
*/
|
|
60
|
+
export class NioAddress {
|
|
61
|
+
free(): void;
|
|
62
|
+
[Symbol.dispose](): void;
|
|
63
|
+
/**
|
|
64
|
+
* Create from a bech32 string (e.g. "addr1q..." or "addr_test1q...").
|
|
65
|
+
*/
|
|
66
|
+
constructor(bech32: string);
|
|
67
|
+
/**
|
|
68
|
+
* Deserialize from CBOR hex (as returned by CIP-30 wallet APIs).
|
|
69
|
+
*/
|
|
70
|
+
static from_cbor_hex(hex_str: string): NioAddress;
|
|
71
|
+
/**
|
|
72
|
+
* Deserialize from raw bytes hex.
|
|
73
|
+
*/
|
|
74
|
+
static from_raw_bytes_hex(hex_str: string): NioAddress;
|
|
75
|
+
/**
|
|
76
|
+
* Get the network ID (0 = testnet, 1 = mainnet).
|
|
77
|
+
*/
|
|
78
|
+
network_id(): number;
|
|
79
|
+
/**
|
|
80
|
+
* Get the payment credential, if present.
|
|
81
|
+
*/
|
|
82
|
+
payment_credential(): NioCredential | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Get the staking/delegation credential, if present.
|
|
85
|
+
*/
|
|
86
|
+
staking_credential(): NioCredential | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Serialize to bech32 string.
|
|
89
|
+
*/
|
|
90
|
+
to_bech32(): string;
|
|
91
|
+
/**
|
|
92
|
+
* Serialize to CBOR hex.
|
|
93
|
+
*/
|
|
94
|
+
to_cbor_hex(): string;
|
|
95
|
+
/**
|
|
96
|
+
* Serialize to raw bytes hex.
|
|
97
|
+
*/
|
|
98
|
+
to_raw_bytes_hex(): string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A wrapped Cardano certificate.
|
|
103
|
+
*/
|
|
104
|
+
export class NioCertificate {
|
|
105
|
+
private constructor();
|
|
106
|
+
free(): void;
|
|
107
|
+
[Symbol.dispose](): void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Factory for creating Cardano certificates.
|
|
112
|
+
*/
|
|
113
|
+
export class NioCertificateFactory {
|
|
114
|
+
private constructor();
|
|
115
|
+
free(): void;
|
|
116
|
+
[Symbol.dispose](): void;
|
|
117
|
+
/**
|
|
118
|
+
* Create a Conway-era registration certificate (with deposit).
|
|
119
|
+
*/
|
|
120
|
+
static reg_cert(stake_credential_hex: string, is_script: boolean, deposit: bigint): NioCertificate;
|
|
121
|
+
/**
|
|
122
|
+
* Register a DRep.
|
|
123
|
+
*/
|
|
124
|
+
static reg_drep_cert(drep_credential_hex: string, is_script: boolean, deposit: bigint, anchor_url?: string | null, anchor_hash_hex?: string | null): NioCertificate;
|
|
125
|
+
/**
|
|
126
|
+
* Create a stake delegation certificate to a pool.
|
|
127
|
+
*/
|
|
128
|
+
static stake_delegation(stake_credential_hex: string, is_script: boolean, pool_keyhash_hex: string): NioCertificate;
|
|
129
|
+
/**
|
|
130
|
+
* Create a stake deregistration certificate (legacy, no deposit refund).
|
|
131
|
+
*/
|
|
132
|
+
static stake_deregistration(stake_credential_hex: string, is_script: boolean): NioCertificate;
|
|
133
|
+
/**
|
|
134
|
+
* Create a stake registration certificate (legacy, no deposit).
|
|
135
|
+
*/
|
|
136
|
+
static stake_registration(stake_credential_hex: string, is_script: boolean): NioCertificate;
|
|
137
|
+
/**
|
|
138
|
+
* Create a combined stake + vote delegation certificate.
|
|
139
|
+
*/
|
|
140
|
+
static stake_vote_deleg_cert(stake_credential_hex: string, is_script: boolean, pool_keyhash_hex: string, drep: NioDRep): NioCertificate;
|
|
141
|
+
/**
|
|
142
|
+
* Create a Conway-era unregistration certificate (with deposit refund).
|
|
143
|
+
*/
|
|
144
|
+
static unreg_cert(stake_credential_hex: string, is_script: boolean, deposit: bigint): NioCertificate;
|
|
145
|
+
/**
|
|
146
|
+
* Unregister a DRep.
|
|
147
|
+
*/
|
|
148
|
+
static unreg_drep_cert(drep_credential_hex: string, is_script: boolean, deposit: bigint): NioCertificate;
|
|
149
|
+
/**
|
|
150
|
+
* Update a DRep.
|
|
151
|
+
*/
|
|
152
|
+
static update_drep_cert(drep_credential_hex: string, is_script: boolean, anchor_url?: string | null, anchor_hash_hex?: string | null): NioCertificate;
|
|
153
|
+
/**
|
|
154
|
+
* Create a vote delegation certificate.
|
|
155
|
+
*/
|
|
156
|
+
static vote_deleg_cert(stake_credential_hex: string, is_script: boolean, drep: NioDRep): NioCertificate;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* A credential (key hash or script hash).
|
|
161
|
+
*/
|
|
162
|
+
export class NioCredential {
|
|
163
|
+
private constructor();
|
|
164
|
+
free(): void;
|
|
165
|
+
[Symbol.dispose](): void;
|
|
166
|
+
/**
|
|
167
|
+
* Create a key-hash credential from a hex-encoded Ed25519 key hash.
|
|
168
|
+
*/
|
|
169
|
+
static from_keyhash(hex_str: string): NioCredential;
|
|
170
|
+
/**
|
|
171
|
+
* Create a script-hash credential from a hex-encoded script hash.
|
|
172
|
+
*/
|
|
173
|
+
static from_scripthash(hex_str: string): NioCredential;
|
|
174
|
+
/**
|
|
175
|
+
* Check if this is a key-hash credential.
|
|
176
|
+
*/
|
|
177
|
+
is_key(): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Check if this is a script-hash credential.
|
|
180
|
+
*/
|
|
181
|
+
is_script(): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Get the hash as hex string.
|
|
184
|
+
*/
|
|
185
|
+
to_hex(): string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* A Delegation Representative (DRep) for governance voting.
|
|
190
|
+
*/
|
|
191
|
+
export class NioDRep {
|
|
192
|
+
private constructor();
|
|
193
|
+
free(): void;
|
|
194
|
+
[Symbol.dispose](): void;
|
|
195
|
+
/**
|
|
196
|
+
* Always-Abstain DRep.
|
|
197
|
+
*/
|
|
198
|
+
static always_abstain(): NioDRep;
|
|
199
|
+
/**
|
|
200
|
+
* Always-NoConfidence DRep.
|
|
201
|
+
*/
|
|
202
|
+
static always_no_confidence(): NioDRep;
|
|
203
|
+
/**
|
|
204
|
+
* DRep from a key hash.
|
|
205
|
+
*/
|
|
206
|
+
static from_keyhash(hex_str: string): NioDRep;
|
|
207
|
+
/**
|
|
208
|
+
* DRep from a script hash.
|
|
209
|
+
*/
|
|
210
|
+
static from_scripthash(hex_str: string): NioDRep;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Execution units for Plutus script evaluation.
|
|
215
|
+
*/
|
|
216
|
+
export class NioExUnits {
|
|
217
|
+
free(): void;
|
|
218
|
+
[Symbol.dispose](): void;
|
|
219
|
+
mem(): bigint;
|
|
220
|
+
constructor(mem: bigint, steps: bigint);
|
|
221
|
+
steps(): bigint;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* A governance action ID (transaction hash + index).
|
|
226
|
+
*/
|
|
227
|
+
export class NioGovActionId {
|
|
228
|
+
free(): void;
|
|
229
|
+
[Symbol.dispose](): void;
|
|
230
|
+
constructor(tx_hash_hex: string, index: bigint);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Transaction metadata (auxiliary data).
|
|
235
|
+
*/
|
|
236
|
+
export class NioMetadata {
|
|
237
|
+
free(): void;
|
|
238
|
+
[Symbol.dispose](): void;
|
|
239
|
+
/**
|
|
240
|
+
* Deserialize from CBOR hex.
|
|
241
|
+
*/
|
|
242
|
+
static from_cbor_hex(hex_str: string): NioMetadata;
|
|
243
|
+
/**
|
|
244
|
+
* Create empty metadata.
|
|
245
|
+
*/
|
|
246
|
+
constructor();
|
|
247
|
+
/**
|
|
248
|
+
* Set bytes (hex-encoded) at the given label.
|
|
249
|
+
*/
|
|
250
|
+
set_bytes(label: bigint, hex_str: string): void;
|
|
251
|
+
/**
|
|
252
|
+
* Set an integer at the given label.
|
|
253
|
+
*/
|
|
254
|
+
set_int(label: bigint, value: bigint): void;
|
|
255
|
+
/**
|
|
256
|
+
* Set a text string at the given label.
|
|
257
|
+
*/
|
|
258
|
+
set_text(label: bigint, text: string): void;
|
|
259
|
+
/**
|
|
260
|
+
* Serialize to CBOR hex.
|
|
261
|
+
*/
|
|
262
|
+
to_cbor_hex(): string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* PlutusData — the data type used in Cardano smart contracts.
|
|
267
|
+
*/
|
|
268
|
+
export class NioPlutusData {
|
|
269
|
+
private constructor();
|
|
270
|
+
free(): void;
|
|
271
|
+
[Symbol.dispose](): void;
|
|
272
|
+
/**
|
|
273
|
+
* Deserialize from CBOR hex.
|
|
274
|
+
*/
|
|
275
|
+
static from_cbor_hex(hex_str: string): NioPlutusData;
|
|
276
|
+
/**
|
|
277
|
+
* Create a bytes PlutusData from hex-encoded bytes.
|
|
278
|
+
*/
|
|
279
|
+
static new_bytes(hex_str: string): NioPlutusData;
|
|
280
|
+
/**
|
|
281
|
+
* Create a constructor-tagged PlutusData (Constr alternative data).
|
|
282
|
+
*/
|
|
283
|
+
static new_constr(alternative: bigint, fields: NioPlutusData[]): NioPlutusData;
|
|
284
|
+
/**
|
|
285
|
+
* Create an integer PlutusData.
|
|
286
|
+
*/
|
|
287
|
+
static new_integer(value: bigint): NioPlutusData;
|
|
288
|
+
/**
|
|
289
|
+
* Create a list PlutusData.
|
|
290
|
+
*/
|
|
291
|
+
static new_list(items: NioPlutusData[]): NioPlutusData;
|
|
292
|
+
/**
|
|
293
|
+
* Create a map PlutusData.
|
|
294
|
+
*/
|
|
295
|
+
static new_map(keys: NioPlutusData[], values: NioPlutusData[]): NioPlutusData;
|
|
296
|
+
/**
|
|
297
|
+
* Serialize to CBOR hex.
|
|
298
|
+
*/
|
|
299
|
+
to_cbor_hex(): string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* A Plutus script (V1, V2, or V3).
|
|
304
|
+
*/
|
|
305
|
+
export class NioPlutusScript {
|
|
306
|
+
free(): void;
|
|
307
|
+
[Symbol.dispose](): void;
|
|
308
|
+
/**
|
|
309
|
+
* Create a Plutus script from CBOR hex and version.
|
|
310
|
+
*/
|
|
311
|
+
constructor(cbor_hex: string, version: NioPlutusVersion);
|
|
312
|
+
to_cbor_hex(): string;
|
|
313
|
+
version(): NioPlutusVersion;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export enum NioPlutusVersion {
|
|
317
|
+
V1 = 1,
|
|
318
|
+
V2 = 2,
|
|
319
|
+
V3 = 3,
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* A governance proposal procedure.
|
|
324
|
+
*/
|
|
325
|
+
export class NioProposalProcedure {
|
|
326
|
+
private constructor();
|
|
327
|
+
free(): void;
|
|
328
|
+
[Symbol.dispose](): void;
|
|
329
|
+
/**
|
|
330
|
+
* Create an Info governance action proposal.
|
|
331
|
+
*
|
|
332
|
+
* - `deposit`: required deposit in lovelace
|
|
333
|
+
* - `reward_account_hex`: reward account address in raw bytes hex
|
|
334
|
+
* - `anchor_url`: URL to the proposal document
|
|
335
|
+
* - `anchor_hash_hex`: Blake2b-256 hash of the proposal document
|
|
336
|
+
*/
|
|
337
|
+
static new_info_action(deposit: bigint, reward_account_hex: string, anchor_url: string, anchor_hash_hex: string): NioProposalProcedure;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Protocol parameters required for transaction building and fee calculation.
|
|
342
|
+
*/
|
|
343
|
+
export class NioProtocolParameters {
|
|
344
|
+
free(): void;
|
|
345
|
+
[Symbol.dispose](): void;
|
|
346
|
+
/**
|
|
347
|
+
* Create protocol parameters from a JSON string (e.g. Blockfrost API response).
|
|
348
|
+
*/
|
|
349
|
+
static from_json(json: string): NioProtocolParameters;
|
|
350
|
+
constructor(min_fee_a: bigint, min_fee_b: bigint, max_tx_size: number, max_value_size: number, coins_per_utxo_byte: bigint, key_deposit: bigint, pool_deposit: bigint, drep_deposit: bigint, collateral_percentage: number, max_collateral_inputs: number);
|
|
351
|
+
readonly coins_per_utxo_byte: bigint;
|
|
352
|
+
readonly collateral_percentage: number;
|
|
353
|
+
readonly drep_deposit: bigint;
|
|
354
|
+
readonly key_deposit: bigint;
|
|
355
|
+
readonly max_collateral_inputs: number;
|
|
356
|
+
readonly max_tx_size: number;
|
|
357
|
+
readonly max_value_size: number;
|
|
358
|
+
readonly min_fee_a: bigint;
|
|
359
|
+
readonly min_fee_b: bigint;
|
|
360
|
+
readonly pool_deposit: bigint;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Redeemer tag indicating the purpose of a redeemer.
|
|
365
|
+
*/
|
|
366
|
+
export enum NioRedeemerTag {
|
|
367
|
+
Spend = 0,
|
|
368
|
+
Mint = 1,
|
|
369
|
+
Cert = 2,
|
|
370
|
+
Reward = 3,
|
|
371
|
+
Voting = 4,
|
|
372
|
+
Proposing = 5,
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* A complete Cardano transaction (body + witness set + auxiliary data).
|
|
377
|
+
*/
|
|
378
|
+
export class NioTransaction {
|
|
379
|
+
private constructor();
|
|
380
|
+
free(): void;
|
|
381
|
+
[Symbol.dispose](): void;
|
|
382
|
+
/**
|
|
383
|
+
* Get the fee in lovelace.
|
|
384
|
+
*/
|
|
385
|
+
fee(): bigint;
|
|
386
|
+
/**
|
|
387
|
+
* Deserialize from CBOR hex string.
|
|
388
|
+
*/
|
|
389
|
+
static from_cbor_hex(hex_str: string): NioTransaction;
|
|
390
|
+
/**
|
|
391
|
+
* Get the transaction hash (Blake2b-256 of the body).
|
|
392
|
+
*/
|
|
393
|
+
hash(): string;
|
|
394
|
+
/**
|
|
395
|
+
* Serialize to CBOR hex string.
|
|
396
|
+
*/
|
|
397
|
+
to_cbor_hex(): string;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* High-level transaction builder wrapping CML's TransactionBuilder.
|
|
402
|
+
*
|
|
403
|
+
* Provides UTXO selection, fee estimation, change handling, and a fluent API.
|
|
404
|
+
*/
|
|
405
|
+
export class NioTransactionBuilder {
|
|
406
|
+
free(): void;
|
|
407
|
+
[Symbol.dispose](): void;
|
|
408
|
+
/**
|
|
409
|
+
* Add a certificate to the transaction.
|
|
410
|
+
*/
|
|
411
|
+
add_certificate(cert: NioCertificate): void;
|
|
412
|
+
/**
|
|
413
|
+
* Add a collateral UTXO (for Plutus script transactions).
|
|
414
|
+
*/
|
|
415
|
+
add_collateral(utxo: NioUtxo): void;
|
|
416
|
+
/**
|
|
417
|
+
* Add a specific input (UTXO to spend).
|
|
418
|
+
*/
|
|
419
|
+
add_input(utxo: NioUtxo): void;
|
|
420
|
+
/**
|
|
421
|
+
* Add an output (destination address + value).
|
|
422
|
+
*/
|
|
423
|
+
add_output_to(address: NioAddress, coin: bigint): void;
|
|
424
|
+
/**
|
|
425
|
+
* Add a required signer (Ed25519 key hash hex).
|
|
426
|
+
*/
|
|
427
|
+
add_required_signer(keyhash_hex: string): void;
|
|
428
|
+
/**
|
|
429
|
+
* Add UTXOs to the available pool for automatic coin selection.
|
|
430
|
+
*/
|
|
431
|
+
add_utxos_from(utxos: NioUtxo[]): void;
|
|
432
|
+
/**
|
|
433
|
+
* Build the transaction with automatic UTXO selection and fee estimation.
|
|
434
|
+
*/
|
|
435
|
+
build(): NioTransaction;
|
|
436
|
+
/**
|
|
437
|
+
* Create a new transaction builder with the given protocol parameters.
|
|
438
|
+
*/
|
|
439
|
+
constructor(params: NioProtocolParameters);
|
|
440
|
+
/**
|
|
441
|
+
* Set the change address (where leftover ADA goes).
|
|
442
|
+
*/
|
|
443
|
+
set_change_address(address: NioAddress): void;
|
|
444
|
+
/**
|
|
445
|
+
* Set transaction metadata.
|
|
446
|
+
*/
|
|
447
|
+
set_metadata(metadata: NioMetadata): void;
|
|
448
|
+
/**
|
|
449
|
+
* Set the transaction time-to-live (TTL) in slots.
|
|
450
|
+
*/
|
|
451
|
+
set_ttl(ttl: bigint): void;
|
|
452
|
+
/**
|
|
453
|
+
* Set the validity start interval in slots.
|
|
454
|
+
*/
|
|
455
|
+
set_validity_start(slot: bigint): void;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* A transaction input (reference to a previous output).
|
|
460
|
+
*/
|
|
461
|
+
export class NioTransactionInput {
|
|
462
|
+
free(): void;
|
|
463
|
+
[Symbol.dispose](): void;
|
|
464
|
+
/**
|
|
465
|
+
* Deserialize from CBOR hex.
|
|
466
|
+
*/
|
|
467
|
+
static from_cbor_hex(hex_str: string): NioTransactionInput;
|
|
468
|
+
/**
|
|
469
|
+
* Get the output index.
|
|
470
|
+
*/
|
|
471
|
+
index(): bigint;
|
|
472
|
+
/**
|
|
473
|
+
* Create from a transaction hash and output index.
|
|
474
|
+
*/
|
|
475
|
+
constructor(transaction_id: string, index: bigint);
|
|
476
|
+
/**
|
|
477
|
+
* Serialize to CBOR hex.
|
|
478
|
+
*/
|
|
479
|
+
to_cbor_hex(): string;
|
|
480
|
+
/**
|
|
481
|
+
* Get the transaction hash as hex.
|
|
482
|
+
*/
|
|
483
|
+
transaction_id(): string;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* A transaction output (address + value + optional datum/script).
|
|
488
|
+
*/
|
|
489
|
+
export class NioTransactionOutput {
|
|
490
|
+
private constructor();
|
|
491
|
+
free(): void;
|
|
492
|
+
[Symbol.dispose](): void;
|
|
493
|
+
/**
|
|
494
|
+
* Get the output address as bech32.
|
|
495
|
+
*/
|
|
496
|
+
address_bech32(): string;
|
|
497
|
+
/**
|
|
498
|
+
* Deserialize from CBOR hex.
|
|
499
|
+
*/
|
|
500
|
+
static from_cbor_hex(hex_str: string): NioTransactionOutput;
|
|
501
|
+
/**
|
|
502
|
+
* Serialize to CBOR hex.
|
|
503
|
+
*/
|
|
504
|
+
to_cbor_hex(): string;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* An unspent transaction output (UTXO) — input + output pair.
|
|
509
|
+
*/
|
|
510
|
+
export class NioUtxo {
|
|
511
|
+
private constructor();
|
|
512
|
+
free(): void;
|
|
513
|
+
[Symbol.dispose](): void;
|
|
514
|
+
/**
|
|
515
|
+
* Deserialize from CBOR hex (as returned by CIP-30 getUtxos).
|
|
516
|
+
*/
|
|
517
|
+
static from_cbor_hex(hex_str: string): NioUtxo;
|
|
518
|
+
/**
|
|
519
|
+
* Get the transaction input.
|
|
520
|
+
*/
|
|
521
|
+
input(): NioTransactionInput;
|
|
522
|
+
/**
|
|
523
|
+
* Get the transaction output.
|
|
524
|
+
*/
|
|
525
|
+
output(): NioTransactionOutput;
|
|
526
|
+
/**
|
|
527
|
+
* Serialize to CBOR hex.
|
|
528
|
+
*/
|
|
529
|
+
to_cbor_hex(): string;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* A Cardano value (ADA coin amount + optional multi-asset tokens).
|
|
534
|
+
*/
|
|
535
|
+
export class NioValue {
|
|
536
|
+
free(): void;
|
|
537
|
+
[Symbol.dispose](): void;
|
|
538
|
+
/**
|
|
539
|
+
* Get the ADA amount in lovelace.
|
|
540
|
+
*/
|
|
541
|
+
coin(): bigint;
|
|
542
|
+
/**
|
|
543
|
+
* Deserialize from CBOR hex (as returned by CIP-30 getBalance).
|
|
544
|
+
*/
|
|
545
|
+
static from_cbor_hex(hex_str: string): NioValue;
|
|
546
|
+
/**
|
|
547
|
+
* Create from a coin amount only (no multi-assets).
|
|
548
|
+
*/
|
|
549
|
+
static from_coin(coin: bigint): NioValue;
|
|
550
|
+
/**
|
|
551
|
+
* Check if this value contains multi-asset tokens.
|
|
552
|
+
*/
|
|
553
|
+
has_multiassets(): boolean;
|
|
554
|
+
/**
|
|
555
|
+
* Get the multi-asset portion as a JSON string.
|
|
556
|
+
* Format: `[{"policy_id": "hex", "assets": [{"name": "hex", "quantity": "string"}]}]`
|
|
557
|
+
*/
|
|
558
|
+
multiassets_json(): string;
|
|
559
|
+
/**
|
|
560
|
+
* Create a value with only ADA (in lovelace).
|
|
561
|
+
*/
|
|
562
|
+
constructor(coin: bigint);
|
|
563
|
+
/**
|
|
564
|
+
* Serialize to CBOR hex.
|
|
565
|
+
*/
|
|
566
|
+
to_cbor_hex(): string;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* A voter identity for governance.
|
|
571
|
+
*/
|
|
572
|
+
export class NioVoter {
|
|
573
|
+
private constructor();
|
|
574
|
+
free(): void;
|
|
575
|
+
[Symbol.dispose](): void;
|
|
576
|
+
/**
|
|
577
|
+
* Create a DRep voter from a key hash.
|
|
578
|
+
*/
|
|
579
|
+
static drep_key(keyhash_hex: string): NioVoter;
|
|
580
|
+
/**
|
|
581
|
+
* Create a DRep voter from a script hash.
|
|
582
|
+
*/
|
|
583
|
+
static drep_script(scripthash_hex: string): NioVoter;
|
|
584
|
+
/**
|
|
585
|
+
* Create a staking pool voter.
|
|
586
|
+
*/
|
|
587
|
+
static staking_pool(pool_keyhash_hex: string): NioVoter;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Voting procedure for governance actions.
|
|
592
|
+
*/
|
|
593
|
+
export class NioVotingProcedure {
|
|
594
|
+
free(): void;
|
|
595
|
+
[Symbol.dispose](): void;
|
|
596
|
+
/**
|
|
597
|
+
* Create a voting procedure.
|
|
598
|
+
*
|
|
599
|
+
* - `vote`: 0 = No, 1 = Yes, 2 = Abstain
|
|
600
|
+
* - `anchor_url` / `anchor_hash_hex`: optional rationale reference
|
|
601
|
+
*/
|
|
602
|
+
constructor(vote: number, anchor_url?: string | null, anchor_hash_hex?: string | null);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* A transaction witness set (signatures, scripts, redeemers, datums).
|
|
607
|
+
*/
|
|
608
|
+
export class NioWitnessSet {
|
|
609
|
+
private constructor();
|
|
610
|
+
free(): void;
|
|
611
|
+
[Symbol.dispose](): void;
|
|
612
|
+
/**
|
|
613
|
+
* Deserialize from CBOR hex (as returned by CIP-30 signTx).
|
|
614
|
+
*/
|
|
615
|
+
static from_cbor_hex(hex_str: string): NioWitnessSet;
|
|
616
|
+
/**
|
|
617
|
+
* Serialize to CBOR hex.
|
|
618
|
+
*/
|
|
619
|
+
to_cbor_hex(): string;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* CIP-30 transaction send error codes.
|
|
624
|
+
*/
|
|
625
|
+
export enum TxSendErrorCode {
|
|
626
|
+
Refused = 1,
|
|
627
|
+
Failure = 2,
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* CIP-30 transaction sign error codes.
|
|
632
|
+
*/
|
|
633
|
+
export enum TxSignErrorCode {
|
|
634
|
+
ProofGeneration = 1,
|
|
635
|
+
UserDeclined = 2,
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* The full CIP-30 wallet API handle (returned after enable).
|
|
640
|
+
*/
|
|
641
|
+
export class WalletApi {
|
|
642
|
+
private constructor();
|
|
643
|
+
free(): void;
|
|
644
|
+
[Symbol.dispose](): void;
|
|
645
|
+
/**
|
|
646
|
+
* Get the wallet balance as a NioValue.
|
|
647
|
+
*/
|
|
648
|
+
get_balance(): Promise<NioValue>;
|
|
649
|
+
/**
|
|
650
|
+
* Get the change address.
|
|
651
|
+
*/
|
|
652
|
+
get_change_address(): Promise<NioAddress>;
|
|
653
|
+
/**
|
|
654
|
+
* Get collateral UTXOs for script execution.
|
|
655
|
+
*/
|
|
656
|
+
get_collateral(): Promise<NioUtxo[]>;
|
|
657
|
+
/**
|
|
658
|
+
* Get wallet extensions (CIP-30).
|
|
659
|
+
*/
|
|
660
|
+
get_extensions(): Promise<Uint32Array>;
|
|
661
|
+
/**
|
|
662
|
+
* Get the network ID (0 = testnet, 1 = mainnet).
|
|
663
|
+
*/
|
|
664
|
+
get_network_id(): Promise<number>;
|
|
665
|
+
/**
|
|
666
|
+
* Get reward addresses (stake addresses).
|
|
667
|
+
*/
|
|
668
|
+
get_reward_addresses(): Promise<NioAddress[]>;
|
|
669
|
+
/**
|
|
670
|
+
* Get unused addresses.
|
|
671
|
+
*/
|
|
672
|
+
get_unused_addresses(): Promise<NioAddress[]>;
|
|
673
|
+
/**
|
|
674
|
+
* Get used addresses.
|
|
675
|
+
*/
|
|
676
|
+
get_used_addresses(): Promise<NioAddress[]>;
|
|
677
|
+
/**
|
|
678
|
+
* Get all UTXOs from the wallet.
|
|
679
|
+
*/
|
|
680
|
+
get_utxos(): Promise<NioUtxo[]>;
|
|
681
|
+
/**
|
|
682
|
+
* Sign arbitrary data (CIP-0008). Returns a DataSignature.
|
|
683
|
+
*/
|
|
684
|
+
sign_data(addr_hex: string, payload_hex: string): Promise<DataSignature>;
|
|
685
|
+
/**
|
|
686
|
+
* Sign a transaction. Returns the CBOR hex of the witness set.
|
|
687
|
+
*
|
|
688
|
+
* - `tx_cbor_hex`: the CBOR-hex encoded unsigned transaction
|
|
689
|
+
* - `partial_sign`: if true, only signs with keys the wallet controls
|
|
690
|
+
*/
|
|
691
|
+
sign_tx(tx_cbor_hex: string, partial_sign: boolean): Promise<string>;
|
|
692
|
+
/**
|
|
693
|
+
* Submit a signed transaction. Returns the transaction hash.
|
|
694
|
+
*/
|
|
695
|
+
submit_tx(tx_cbor_hex: string): Promise<string>;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* A CIP-30 wallet provider discovered via `window.cardano`.
|
|
700
|
+
*/
|
|
701
|
+
export class WalletProvider {
|
|
702
|
+
private constructor();
|
|
703
|
+
free(): void;
|
|
704
|
+
[Symbol.dispose](): void;
|
|
705
|
+
/**
|
|
706
|
+
* Enable this wallet, returning the full CIP-30 API handle.
|
|
707
|
+
*/
|
|
708
|
+
enable(): Promise<WalletApi>;
|
|
709
|
+
/**
|
|
710
|
+
* Enable this wallet with CIP-95 governance extension.
|
|
711
|
+
*/
|
|
712
|
+
enable_with_cip95(): Promise<WalletApi>;
|
|
713
|
+
/**
|
|
714
|
+
* Check if this wallet extension is already enabled.
|
|
715
|
+
*/
|
|
716
|
+
is_enabled(): Promise<boolean>;
|
|
717
|
+
readonly api_version: string;
|
|
718
|
+
readonly icon: string;
|
|
719
|
+
readonly name: string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Delegate stake to a pool.
|
|
724
|
+
*
|
|
725
|
+
* Full flow:
|
|
726
|
+
* 1. Get wallet addresses and UTXOs
|
|
727
|
+
* 2. Build transaction with StakeRegistration (if needed) + StakeDelegation
|
|
728
|
+
* 3. Sign via CIP-30 wallet
|
|
729
|
+
* 4. Submit and return transaction hash
|
|
730
|
+
*/
|
|
731
|
+
export function delegate_stake_pool(wallet: WalletApi, protocol_params: NioProtocolParameters, pool_id_hex: string, callback: any): Promise<string>;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Discover all available CIP-30 wallet providers from `window.cardano`.
|
|
735
|
+
*/
|
|
736
|
+
export function discover_wallets(): Promise<WalletProvider[]>;
|
|
737
|
+
|
|
738
|
+
export function init(): void;
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Delegate voting power to a DRep.
|
|
742
|
+
*
|
|
743
|
+
* Full flow:
|
|
744
|
+
* 1. Get wallet addresses and UTXOs
|
|
745
|
+
* 2. Build transaction with VoteDelegCert
|
|
746
|
+
* 3. Sign via CIP-30 wallet
|
|
747
|
+
* 4. Submit and return transaction hash
|
|
748
|
+
*/
|
|
749
|
+
export function vote_delegation(wallet: WalletApi, protocol_params: NioProtocolParameters, drep: NioDRep, callback: any): Promise<string>;
|
|
750
|
+
|
|
751
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
752
|
+
|
|
753
|
+
export interface InitOutput {
|
|
754
|
+
readonly memory: WebAssembly.Memory;
|
|
755
|
+
readonly __wbg_walletapi_free: (a: number, b: number) => void;
|
|
756
|
+
readonly walletapi_get_network_id: (a: number) => any;
|
|
757
|
+
readonly walletapi_get_balance: (a: number) => any;
|
|
758
|
+
readonly walletapi_get_utxos: (a: number) => any;
|
|
759
|
+
readonly walletapi_get_used_addresses: (a: number) => any;
|
|
760
|
+
readonly walletapi_get_unused_addresses: (a: number) => any;
|
|
761
|
+
readonly walletapi_get_change_address: (a: number) => any;
|
|
762
|
+
readonly walletapi_get_reward_addresses: (a: number) => any;
|
|
763
|
+
readonly walletapi_get_collateral: (a: number) => any;
|
|
764
|
+
readonly walletapi_sign_tx: (a: number, b: number, c: number, d: number) => any;
|
|
765
|
+
readonly walletapi_submit_tx: (a: number, b: number, c: number) => any;
|
|
766
|
+
readonly walletapi_sign_data: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
767
|
+
readonly walletapi_get_extensions: (a: number) => any;
|
|
768
|
+
readonly __wbg_nioaddress_free: (a: number, b: number) => void;
|
|
769
|
+
readonly nioaddress_from_bech32: (a: number, b: number) => [number, number, number];
|
|
770
|
+
readonly nioaddress_to_bech32: (a: number) => [number, number, number, number];
|
|
771
|
+
readonly nioaddress_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
772
|
+
readonly nioaddress_from_raw_bytes_hex: (a: number, b: number) => [number, number, number];
|
|
773
|
+
readonly nioaddress_to_cbor_hex: (a: number) => [number, number];
|
|
774
|
+
readonly nioaddress_to_raw_bytes_hex: (a: number) => [number, number];
|
|
775
|
+
readonly nioaddress_network_id: (a: number) => [number, number, number];
|
|
776
|
+
readonly nioaddress_payment_credential: (a: number) => number;
|
|
777
|
+
readonly nioaddress_staking_credential: (a: number) => number;
|
|
778
|
+
readonly __wbg_niocredential_free: (a: number, b: number) => void;
|
|
779
|
+
readonly niocredential_from_keyhash: (a: number, b: number) => [number, number, number];
|
|
780
|
+
readonly niocredential_from_scripthash: (a: number, b: number) => [number, number, number];
|
|
781
|
+
readonly niocredential_to_hex: (a: number) => [number, number];
|
|
782
|
+
readonly niocredential_is_key: (a: number) => number;
|
|
783
|
+
readonly niocredential_is_script: (a: number) => number;
|
|
784
|
+
readonly __wbg_niometadata_free: (a: number, b: number) => void;
|
|
785
|
+
readonly niometadata_new: () => number;
|
|
786
|
+
readonly niometadata_set_text: (a: number, b: bigint, c: number, d: number) => [number, number];
|
|
787
|
+
readonly niometadata_set_int: (a: number, b: bigint, c: bigint) => void;
|
|
788
|
+
readonly niometadata_set_bytes: (a: number, b: bigint, c: number, d: number) => [number, number];
|
|
789
|
+
readonly niometadata_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
790
|
+
readonly niometadata_to_cbor_hex: (a: number) => [number, number];
|
|
791
|
+
readonly __wbg_niotransaction_free: (a: number, b: number) => void;
|
|
792
|
+
readonly niotransaction_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
793
|
+
readonly niotransaction_to_cbor_hex: (a: number) => [number, number];
|
|
794
|
+
readonly niotransaction_hash: (a: number) => [number, number];
|
|
795
|
+
readonly niotransaction_fee: (a: number) => bigint;
|
|
796
|
+
readonly __wbg_niotransactioninput_free: (a: number, b: number) => void;
|
|
797
|
+
readonly niotransactioninput_new: (a: number, b: number, c: bigint) => [number, number, number];
|
|
798
|
+
readonly niotransactioninput_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
799
|
+
readonly niotransactioninput_to_cbor_hex: (a: number) => [number, number];
|
|
800
|
+
readonly niotransactioninput_transaction_id: (a: number) => [number, number];
|
|
801
|
+
readonly niotransactioninput_index: (a: number) => bigint;
|
|
802
|
+
readonly __wbg_niotransactionoutput_free: (a: number, b: number) => void;
|
|
803
|
+
readonly niotransactionoutput_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
804
|
+
readonly niotransactionoutput_to_cbor_hex: (a: number) => [number, number];
|
|
805
|
+
readonly niotransactionoutput_address_bech32: (a: number) => [number, number, number, number];
|
|
806
|
+
readonly __wbg_nioutxo_free: (a: number, b: number) => void;
|
|
807
|
+
readonly nioutxo_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
808
|
+
readonly nioutxo_to_cbor_hex: (a: number) => [number, number];
|
|
809
|
+
readonly nioutxo_input: (a: number) => number;
|
|
810
|
+
readonly nioutxo_output: (a: number) => number;
|
|
811
|
+
readonly __wbg_niowitnessset_free: (a: number, b: number) => void;
|
|
812
|
+
readonly niowitnessset_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
813
|
+
readonly niowitnessset_to_cbor_hex: (a: number) => [number, number];
|
|
814
|
+
readonly delegate_stake_pool: (a: number, b: number, c: number, d: number, e: any) => any;
|
|
815
|
+
readonly vote_delegation: (a: number, b: number, c: number, d: any) => any;
|
|
816
|
+
readonly __wbg_actionprogress_free: (a: number, b: number) => void;
|
|
817
|
+
readonly actionprogress_step: (a: number) => [number, number];
|
|
818
|
+
readonly actionprogress_detail: (a: number) => [number, number];
|
|
819
|
+
readonly actionprogress_tx_hash: (a: number) => [number, number];
|
|
820
|
+
readonly init: () => void;
|
|
821
|
+
readonly __wbg_nioprotocolparameters_free: (a: number, b: number) => void;
|
|
822
|
+
readonly nioprotocolparameters_new: (a: bigint, b: bigint, c: number, d: number, e: bigint, f: bigint, g: bigint, h: bigint, i: number, j: number) => number;
|
|
823
|
+
readonly nioprotocolparameters_from_json: (a: number, b: number) => [number, number, number];
|
|
824
|
+
readonly nioprotocolparameters_min_fee_a: (a: number) => bigint;
|
|
825
|
+
readonly nioprotocolparameters_min_fee_b: (a: number) => bigint;
|
|
826
|
+
readonly nioprotocolparameters_max_tx_size: (a: number) => number;
|
|
827
|
+
readonly nioprotocolparameters_max_value_size: (a: number) => number;
|
|
828
|
+
readonly nioprotocolparameters_coins_per_utxo_byte: (a: number) => bigint;
|
|
829
|
+
readonly nioprotocolparameters_key_deposit: (a: number) => bigint;
|
|
830
|
+
readonly nioprotocolparameters_pool_deposit: (a: number) => bigint;
|
|
831
|
+
readonly nioprotocolparameters_drep_deposit: (a: number) => bigint;
|
|
832
|
+
readonly nioprotocolparameters_collateral_percentage: (a: number) => number;
|
|
833
|
+
readonly nioprotocolparameters_max_collateral_inputs: (a: number) => number;
|
|
834
|
+
readonly __wbg_niotransactionbuilder_free: (a: number, b: number) => void;
|
|
835
|
+
readonly niotransactionbuilder_new: (a: number) => [number, number, number];
|
|
836
|
+
readonly niotransactionbuilder_set_change_address: (a: number, b: number) => void;
|
|
837
|
+
readonly niotransactionbuilder_add_utxos_from: (a: number, b: number, c: number) => void;
|
|
838
|
+
readonly niotransactionbuilder_add_input: (a: number, b: number) => [number, number];
|
|
839
|
+
readonly niotransactionbuilder_add_output_to: (a: number, b: number, c: bigint) => [number, number];
|
|
840
|
+
readonly niotransactionbuilder_add_certificate: (a: number, b: number) => [number, number];
|
|
841
|
+
readonly niotransactionbuilder_add_collateral: (a: number, b: number) => [number, number];
|
|
842
|
+
readonly niotransactionbuilder_set_ttl: (a: number, b: bigint) => void;
|
|
843
|
+
readonly niotransactionbuilder_set_validity_start: (a: number, b: bigint) => void;
|
|
844
|
+
readonly niotransactionbuilder_set_metadata: (a: number, b: number) => void;
|
|
845
|
+
readonly niotransactionbuilder_add_required_signer: (a: number, b: number, c: number) => [number, number];
|
|
846
|
+
readonly niotransactionbuilder_build: (a: number) => [number, number, number];
|
|
847
|
+
readonly __wbg_walletprovider_free: (a: number, b: number) => void;
|
|
848
|
+
readonly walletprovider_name: (a: number) => [number, number];
|
|
849
|
+
readonly walletprovider_api_version: (a: number) => [number, number];
|
|
850
|
+
readonly walletprovider_icon: (a: number) => [number, number];
|
|
851
|
+
readonly walletprovider_is_enabled: (a: number) => any;
|
|
852
|
+
readonly walletprovider_enable: (a: number) => any;
|
|
853
|
+
readonly walletprovider_enable_with_cip95: (a: number) => any;
|
|
854
|
+
readonly discover_wallets: () => any;
|
|
855
|
+
readonly __wbg_niocertificatefactory_free: (a: number, b: number) => void;
|
|
856
|
+
readonly niocertificatefactory_stake_registration: (a: number, b: number, c: number) => [number, number, number];
|
|
857
|
+
readonly niocertificatefactory_stake_deregistration: (a: number, b: number, c: number) => [number, number, number];
|
|
858
|
+
readonly niocertificatefactory_stake_delegation: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
859
|
+
readonly niocertificatefactory_reg_cert: (a: number, b: number, c: number, d: bigint) => [number, number, number];
|
|
860
|
+
readonly niocertificatefactory_unreg_cert: (a: number, b: number, c: number, d: bigint) => [number, number, number];
|
|
861
|
+
readonly niocertificatefactory_vote_deleg_cert: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
862
|
+
readonly niocertificatefactory_stake_vote_deleg_cert: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
863
|
+
readonly niocertificatefactory_reg_drep_cert: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
864
|
+
readonly niocertificatefactory_unreg_drep_cert: (a: number, b: number, c: number, d: bigint) => [number, number, number];
|
|
865
|
+
readonly niocertificatefactory_update_drep_cert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
866
|
+
readonly __wbg_niocertificate_free: (a: number, b: number) => void;
|
|
867
|
+
readonly __wbg_niodrep_free: (a: number, b: number) => void;
|
|
868
|
+
readonly niodrep_from_keyhash: (a: number, b: number) => [number, number, number];
|
|
869
|
+
readonly niodrep_from_scripthash: (a: number, b: number) => [number, number, number];
|
|
870
|
+
readonly niodrep_always_abstain: () => number;
|
|
871
|
+
readonly niodrep_always_no_confidence: () => number;
|
|
872
|
+
readonly __wbg_nioproposalprocedure_free: (a: number, b: number) => void;
|
|
873
|
+
readonly nioproposalprocedure_new_info_action: (a: bigint, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
874
|
+
readonly __wbg_niovotingprocedure_free: (a: number, b: number) => void;
|
|
875
|
+
readonly niovotingprocedure_new: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
876
|
+
readonly __wbg_niovoter_free: (a: number, b: number) => void;
|
|
877
|
+
readonly niovoter_drep_key: (a: number, b: number) => [number, number, number];
|
|
878
|
+
readonly niovoter_drep_script: (a: number, b: number) => [number, number, number];
|
|
879
|
+
readonly niovoter_staking_pool: (a: number, b: number) => [number, number, number];
|
|
880
|
+
readonly __wbg_niogovactionid_free: (a: number, b: number) => void;
|
|
881
|
+
readonly niogovactionid_new: (a: number, b: number, c: bigint) => [number, number, number];
|
|
882
|
+
readonly __wbg_datasignature_free: (a: number, b: number) => void;
|
|
883
|
+
readonly datasignature_signature: (a: number) => [number, number];
|
|
884
|
+
readonly datasignature_key: (a: number) => [number, number];
|
|
885
|
+
readonly __wbg_extension_free: (a: number, b: number) => void;
|
|
886
|
+
readonly extension_new: (a: number) => number;
|
|
887
|
+
readonly extension_cip: (a: number) => number;
|
|
888
|
+
readonly __wbg_nioplutusdata_free: (a: number, b: number) => void;
|
|
889
|
+
readonly nioplutusdata_new_constr: (a: bigint, b: number, c: number) => number;
|
|
890
|
+
readonly nioplutusdata_new_integer: (a: bigint) => number;
|
|
891
|
+
readonly nioplutusdata_new_bytes: (a: number, b: number) => [number, number, number];
|
|
892
|
+
readonly nioplutusdata_new_list: (a: number, b: number) => number;
|
|
893
|
+
readonly nioplutusdata_new_map: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
894
|
+
readonly nioplutusdata_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
895
|
+
readonly nioplutusdata_to_cbor_hex: (a: number) => [number, number];
|
|
896
|
+
readonly __wbg_nioexunits_free: (a: number, b: number) => void;
|
|
897
|
+
readonly nioexunits_new: (a: bigint, b: bigint) => number;
|
|
898
|
+
readonly nioexunits_mem: (a: number) => bigint;
|
|
899
|
+
readonly nioexunits_steps: (a: number) => bigint;
|
|
900
|
+
readonly __wbg_nioplutusscript_free: (a: number, b: number) => void;
|
|
901
|
+
readonly nioplutusscript_new: (a: number, b: number, c: number) => [number, number, number];
|
|
902
|
+
readonly nioplutusscript_to_cbor_hex: (a: number) => [number, number];
|
|
903
|
+
readonly nioplutusscript_version: (a: number) => number;
|
|
904
|
+
readonly __wbg_niovalue_free: (a: number, b: number) => void;
|
|
905
|
+
readonly niovalue_from_coin: (a: bigint) => number;
|
|
906
|
+
readonly niovalue_from_cbor_hex: (a: number, b: number) => [number, number, number];
|
|
907
|
+
readonly niovalue_to_cbor_hex: (a: number) => [number, number];
|
|
908
|
+
readonly niovalue_coin: (a: number) => bigint;
|
|
909
|
+
readonly niovalue_has_multiassets: (a: number) => number;
|
|
910
|
+
readonly niovalue_multiassets_json: (a: number) => [number, number];
|
|
911
|
+
readonly niovalue_new: (a: bigint) => number;
|
|
912
|
+
readonly wasm_bindgen__closure__destroy__haa43d5c6a389c195: (a: number, b: number) => void;
|
|
913
|
+
readonly wasm_bindgen__convert__closures_____invoke__h14edc2e78c1d66d9: (a: number, b: number, c: any, d: any) => void;
|
|
914
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd58e0b50222c8226: (a: number, b: number, c: any) => void;
|
|
915
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
916
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
917
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
918
|
+
readonly __externref_table_alloc: () => number;
|
|
919
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
920
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
921
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
922
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
923
|
+
readonly __wbindgen_start: () => void;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
930
|
+
* a precompiled `WebAssembly.Module`.
|
|
931
|
+
*
|
|
932
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
933
|
+
*
|
|
934
|
+
* @returns {InitOutput}
|
|
935
|
+
*/
|
|
936
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
940
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
941
|
+
*
|
|
942
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
943
|
+
*
|
|
944
|
+
* @returns {Promise<InitOutput>}
|
|
945
|
+
*/
|
|
946
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|