@anastasia-labs/cardano-multiplatform-lib-nodejs 6.0.2-2 → 6.0.2-3
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/cardano_multiplatform_lib.d.ts +307 -307
- package/cardano_multiplatform_lib.js +498 -498
- package/cardano_multiplatform_lib_bg.wasm +0 -0
- package/package.json +1 -1
|
@@ -4,6 +4,12 @@ imports['__wbindgen_placeholder__'] = module.exports;
|
|
|
4
4
|
let wasm;
|
|
5
5
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
|
+
const heap = new Array(128).fill(undefined);
|
|
8
|
+
|
|
9
|
+
heap.push(undefined, null, true, false);
|
|
10
|
+
|
|
11
|
+
function getObject(idx) { return heap[idx]; }
|
|
12
|
+
|
|
7
13
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
8
14
|
|
|
9
15
|
cachedTextDecoder.decode();
|
|
@@ -22,10 +28,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
22
28
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
const heap = new Array(128).fill(undefined);
|
|
26
|
-
|
|
27
|
-
heap.push(undefined, null, true, false);
|
|
28
|
-
|
|
29
31
|
let heap_next = heap.length;
|
|
30
32
|
|
|
31
33
|
function addHeapObject(obj) {
|
|
@@ -37,8 +39,6 @@ function addHeapObject(obj) {
|
|
|
37
39
|
return idx;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
function getObject(idx) { return heap[idx]; }
|
|
41
|
-
|
|
42
42
|
function dropObject(idx) {
|
|
43
43
|
if (idx < 132) return;
|
|
44
44
|
heap[idx] = heap_next;
|
|
@@ -135,6 +135,13 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
135
135
|
WASM_VECTOR_LEN = arg.length;
|
|
136
136
|
return ptr;
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
function _assertClass(instance, klass) {
|
|
140
|
+
if (!(instance instanceof klass)) {
|
|
141
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
142
|
+
}
|
|
143
|
+
return instance.ptr;
|
|
144
|
+
}
|
|
138
145
|
/**
|
|
139
146
|
* Encrypt using Emip3: https://github.com/Emurgo/EmIPs/blob/master/specs/emip-003.md
|
|
140
147
|
* @param {string} password
|
|
@@ -211,34 +218,6 @@ module.exports.emip3_decrypt_with_password = function(password, data) {
|
|
|
211
218
|
}
|
|
212
219
|
};
|
|
213
220
|
|
|
214
|
-
function _assertClass(instance, klass) {
|
|
215
|
-
if (!(instance instanceof klass)) {
|
|
216
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
217
|
-
}
|
|
218
|
-
return instance.ptr;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
let cachedUint16ArrayMemory0 = null;
|
|
222
|
-
|
|
223
|
-
function getUint16ArrayMemory0() {
|
|
224
|
-
if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) {
|
|
225
|
-
cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
|
|
226
|
-
}
|
|
227
|
-
return cachedUint16ArrayMemory0;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function getArrayU16FromWasm0(ptr, len) {
|
|
231
|
-
ptr = ptr >>> 0;
|
|
232
|
-
return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function passArray16ToWasm0(arg, malloc) {
|
|
236
|
-
const ptr = malloc(arg.length * 2, 2) >>> 0;
|
|
237
|
-
getUint16ArrayMemory0().set(arg, ptr / 2);
|
|
238
|
-
WASM_VECTOR_LEN = arg.length;
|
|
239
|
-
return ptr;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
221
|
function isLikeNone(x) {
|
|
243
222
|
return x === undefined || x === null;
|
|
244
223
|
}
|
|
@@ -277,6 +256,170 @@ module.exports.decode_arbitrary_bytes_from_metadatum = function(metadata) {
|
|
|
277
256
|
}
|
|
278
257
|
};
|
|
279
258
|
|
|
259
|
+
/**
|
|
260
|
+
*
|
|
261
|
+
* * Min fee for JUST the script, NOT including ref inputs
|
|
262
|
+
*
|
|
263
|
+
* @param {Transaction} tx
|
|
264
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
265
|
+
* @returns {bigint}
|
|
266
|
+
*/
|
|
267
|
+
module.exports.min_script_fee = function(tx, ex_unit_prices) {
|
|
268
|
+
try {
|
|
269
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
270
|
+
_assertClass(tx, Transaction);
|
|
271
|
+
_assertClass(ex_unit_prices, ExUnitPrices);
|
|
272
|
+
wasm.min_script_fee(retptr, tx.__wbg_ptr, ex_unit_prices.__wbg_ptr);
|
|
273
|
+
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
274
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
275
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
276
|
+
if (r3) {
|
|
277
|
+
throw takeObject(r2);
|
|
278
|
+
}
|
|
279
|
+
return BigInt.asUintN(64, r0);
|
|
280
|
+
} finally {
|
|
281
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @param {Transaction} tx
|
|
287
|
+
* @param {LinearFee} linear_fee
|
|
288
|
+
* @returns {bigint}
|
|
289
|
+
*/
|
|
290
|
+
module.exports.min_no_script_fee = function(tx, linear_fee) {
|
|
291
|
+
try {
|
|
292
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
293
|
+
_assertClass(tx, Transaction);
|
|
294
|
+
_assertClass(linear_fee, LinearFee);
|
|
295
|
+
wasm.min_no_script_fee(retptr, tx.__wbg_ptr, linear_fee.__wbg_ptr);
|
|
296
|
+
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
297
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
298
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
299
|
+
if (r3) {
|
|
300
|
+
throw takeObject(r2);
|
|
301
|
+
}
|
|
302
|
+
return BigInt.asUintN(64, r0);
|
|
303
|
+
} finally {
|
|
304
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* * Calculates the cost of all ref scripts
|
|
311
|
+
* * * `total_ref_script_size` - Total size (original, not hashes) of all ref scripts. Duplicate scripts are counted as many times as they occur
|
|
312
|
+
*
|
|
313
|
+
* @param {Transaction} tx
|
|
314
|
+
* @param {LinearFee} linear_fee
|
|
315
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
316
|
+
* @param {bigint} total_ref_script_size
|
|
317
|
+
* @returns {bigint}
|
|
318
|
+
*/
|
|
319
|
+
module.exports.min_fee = function(tx, linear_fee, ex_unit_prices, total_ref_script_size) {
|
|
320
|
+
try {
|
|
321
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
322
|
+
_assertClass(tx, Transaction);
|
|
323
|
+
_assertClass(linear_fee, LinearFee);
|
|
324
|
+
_assertClass(ex_unit_prices, ExUnitPrices);
|
|
325
|
+
wasm.min_fee(retptr, tx.__wbg_ptr, linear_fee.__wbg_ptr, ex_unit_prices.__wbg_ptr, total_ref_script_size);
|
|
326
|
+
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
327
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
328
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
329
|
+
if (r3) {
|
|
330
|
+
throw takeObject(r2);
|
|
331
|
+
}
|
|
332
|
+
return BigInt.asUintN(64, r0);
|
|
333
|
+
} finally {
|
|
334
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* @param {TransactionHash} tx_body_hash
|
|
340
|
+
* @param {ByronAddress} addr
|
|
341
|
+
* @param {LegacyDaedalusPrivateKey} key
|
|
342
|
+
* @returns {BootstrapWitness}
|
|
343
|
+
*/
|
|
344
|
+
module.exports.make_daedalus_bootstrap_witness = function(tx_body_hash, addr, key) {
|
|
345
|
+
_assertClass(tx_body_hash, TransactionHash);
|
|
346
|
+
_assertClass(addr, ByronAddress);
|
|
347
|
+
_assertClass(key, LegacyDaedalusPrivateKey);
|
|
348
|
+
const ret = wasm.make_daedalus_bootstrap_witness(tx_body_hash.__wbg_ptr, addr.__wbg_ptr, key.__wbg_ptr);
|
|
349
|
+
return BootstrapWitness.__wrap(ret);
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* @param {TransactionHash} tx_body_hash
|
|
354
|
+
* @param {ByronAddress} addr
|
|
355
|
+
* @param {Bip32PrivateKey} key
|
|
356
|
+
* @returns {BootstrapWitness}
|
|
357
|
+
*/
|
|
358
|
+
module.exports.make_icarus_bootstrap_witness = function(tx_body_hash, addr, key) {
|
|
359
|
+
_assertClass(tx_body_hash, TransactionHash);
|
|
360
|
+
var ptr0 = tx_body_hash.__destroy_into_raw();
|
|
361
|
+
_assertClass(addr, ByronAddress);
|
|
362
|
+
var ptr1 = addr.__destroy_into_raw();
|
|
363
|
+
_assertClass(key, Bip32PrivateKey);
|
|
364
|
+
const ret = wasm.make_icarus_bootstrap_witness(ptr0, ptr1, key.__wbg_ptr);
|
|
365
|
+
return BootstrapWitness.__wrap(ret);
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* @param {Redeemers} redeemers
|
|
370
|
+
* @returns {ExUnits}
|
|
371
|
+
*/
|
|
372
|
+
module.exports.compute_total_ex_units = function(redeemers) {
|
|
373
|
+
try {
|
|
374
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
375
|
+
_assertClass(redeemers, Redeemers);
|
|
376
|
+
wasm.compute_total_ex_units(retptr, redeemers.__wbg_ptr);
|
|
377
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
378
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
379
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
380
|
+
if (r2) {
|
|
381
|
+
throw takeObject(r1);
|
|
382
|
+
}
|
|
383
|
+
return ExUnits.__wrap(r0);
|
|
384
|
+
} finally {
|
|
385
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
let cachedUint16ArrayMemory0 = null;
|
|
390
|
+
|
|
391
|
+
function getUint16ArrayMemory0() {
|
|
392
|
+
if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) {
|
|
393
|
+
cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
|
|
394
|
+
}
|
|
395
|
+
return cachedUint16ArrayMemory0;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function getArrayU16FromWasm0(ptr, len) {
|
|
399
|
+
ptr = ptr >>> 0;
|
|
400
|
+
return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function passArray16ToWasm0(arg, malloc) {
|
|
404
|
+
const ptr = malloc(arg.length * 2, 2) >>> 0;
|
|
405
|
+
getUint16ArrayMemory0().set(arg, ptr / 2);
|
|
406
|
+
WASM_VECTOR_LEN = arg.length;
|
|
407
|
+
return ptr;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
let cachedUint32ArrayMemory0 = null;
|
|
411
|
+
|
|
412
|
+
function getUint32ArrayMemory0() {
|
|
413
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
414
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
415
|
+
}
|
|
416
|
+
return cachedUint32ArrayMemory0;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
420
|
+
ptr = ptr >>> 0;
|
|
421
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
422
|
+
}
|
|
280
423
|
/**
|
|
281
424
|
* @param {AuxiliaryData} auxiliary_data
|
|
282
425
|
* @returns {AuxiliaryDataHash}
|
|
@@ -400,6 +543,18 @@ module.exports.calc_script_data_hash_from_witness = function(witnesses, cost_mod
|
|
|
400
543
|
}
|
|
401
544
|
};
|
|
402
545
|
|
|
546
|
+
/**
|
|
547
|
+
* @param {TransactionHash} tx_body_hash
|
|
548
|
+
* @param {PrivateKey} sk
|
|
549
|
+
* @returns {Vkeywitness}
|
|
550
|
+
*/
|
|
551
|
+
module.exports.make_vkey_witness = function(tx_body_hash, sk) {
|
|
552
|
+
_assertClass(tx_body_hash, TransactionHash);
|
|
553
|
+
_assertClass(sk, PrivateKey);
|
|
554
|
+
const ret = wasm.make_vkey_witness(tx_body_hash.__wbg_ptr, sk.__wbg_ptr);
|
|
555
|
+
return Vkeywitness.__wrap(ret);
|
|
556
|
+
};
|
|
557
|
+
|
|
403
558
|
/**
|
|
404
559
|
* @param {TransactionBody} txbody
|
|
405
560
|
* @param {bigint} pool_deposit
|
|
@@ -446,85 +601,6 @@ module.exports.get_deposit = function(txbody, pool_deposit, key_deposit) {
|
|
|
446
601
|
}
|
|
447
602
|
};
|
|
448
603
|
|
|
449
|
-
/**
|
|
450
|
-
*
|
|
451
|
-
* * Min fee for JUST the script, NOT including ref inputs
|
|
452
|
-
*
|
|
453
|
-
* @param {Transaction} tx
|
|
454
|
-
* @param {ExUnitPrices} ex_unit_prices
|
|
455
|
-
* @returns {bigint}
|
|
456
|
-
*/
|
|
457
|
-
module.exports.min_script_fee = function(tx, ex_unit_prices) {
|
|
458
|
-
try {
|
|
459
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
460
|
-
_assertClass(tx, Transaction);
|
|
461
|
-
_assertClass(ex_unit_prices, ExUnitPrices);
|
|
462
|
-
wasm.min_script_fee(retptr, tx.__wbg_ptr, ex_unit_prices.__wbg_ptr);
|
|
463
|
-
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
464
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
465
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
466
|
-
if (r3) {
|
|
467
|
-
throw takeObject(r2);
|
|
468
|
-
}
|
|
469
|
-
return BigInt.asUintN(64, r0);
|
|
470
|
-
} finally {
|
|
471
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* @param {Transaction} tx
|
|
477
|
-
* @param {LinearFee} linear_fee
|
|
478
|
-
* @returns {bigint}
|
|
479
|
-
*/
|
|
480
|
-
module.exports.min_no_script_fee = function(tx, linear_fee) {
|
|
481
|
-
try {
|
|
482
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
483
|
-
_assertClass(tx, Transaction);
|
|
484
|
-
_assertClass(linear_fee, LinearFee);
|
|
485
|
-
wasm.min_no_script_fee(retptr, tx.__wbg_ptr, linear_fee.__wbg_ptr);
|
|
486
|
-
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
487
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
488
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
489
|
-
if (r3) {
|
|
490
|
-
throw takeObject(r2);
|
|
491
|
-
}
|
|
492
|
-
return BigInt.asUintN(64, r0);
|
|
493
|
-
} finally {
|
|
494
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
495
|
-
}
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
*
|
|
500
|
-
* * Calculates the cost of all ref scripts
|
|
501
|
-
* * * `total_ref_script_size` - Total size (original, not hashes) of all ref scripts. Duplicate scripts are counted as many times as they occur
|
|
502
|
-
*
|
|
503
|
-
* @param {Transaction} tx
|
|
504
|
-
* @param {LinearFee} linear_fee
|
|
505
|
-
* @param {ExUnitPrices} ex_unit_prices
|
|
506
|
-
* @param {bigint} total_ref_script_size
|
|
507
|
-
* @returns {bigint}
|
|
508
|
-
*/
|
|
509
|
-
module.exports.min_fee = function(tx, linear_fee, ex_unit_prices, total_ref_script_size) {
|
|
510
|
-
try {
|
|
511
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
512
|
-
_assertClass(tx, Transaction);
|
|
513
|
-
_assertClass(linear_fee, LinearFee);
|
|
514
|
-
_assertClass(ex_unit_prices, ExUnitPrices);
|
|
515
|
-
wasm.min_fee(retptr, tx.__wbg_ptr, linear_fee.__wbg_ptr, ex_unit_prices.__wbg_ptr, total_ref_script_size);
|
|
516
|
-
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
517
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
518
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
519
|
-
if (r3) {
|
|
520
|
-
throw takeObject(r2);
|
|
521
|
-
}
|
|
522
|
-
return BigInt.asUintN(64, r0);
|
|
523
|
-
} finally {
|
|
524
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
|
|
528
604
|
/**
|
|
529
605
|
* Converts JSON to Metadata according to MetadataJsonSchema
|
|
530
606
|
* @param {string} json
|
|
@@ -581,104 +657,6 @@ module.exports.decode_metadatum_to_json_str = function(metadatum, schema) {
|
|
|
581
657
|
}
|
|
582
658
|
};
|
|
583
659
|
|
|
584
|
-
/**
|
|
585
|
-
* @param {Redeemers} redeemers
|
|
586
|
-
* @returns {ExUnits}
|
|
587
|
-
*/
|
|
588
|
-
module.exports.compute_total_ex_units = function(redeemers) {
|
|
589
|
-
try {
|
|
590
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
591
|
-
_assertClass(redeemers, Redeemers);
|
|
592
|
-
wasm.compute_total_ex_units(retptr, redeemers.__wbg_ptr);
|
|
593
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
594
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
595
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
596
|
-
if (r2) {
|
|
597
|
-
throw takeObject(r1);
|
|
598
|
-
}
|
|
599
|
-
return ExUnits.__wrap(r0);
|
|
600
|
-
} finally {
|
|
601
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* @param {TransactionHash} tx_body_hash
|
|
607
|
-
* @param {ByronAddress} addr
|
|
608
|
-
* @param {LegacyDaedalusPrivateKey} key
|
|
609
|
-
* @returns {BootstrapWitness}
|
|
610
|
-
*/
|
|
611
|
-
module.exports.make_daedalus_bootstrap_witness = function(tx_body_hash, addr, key) {
|
|
612
|
-
_assertClass(tx_body_hash, TransactionHash);
|
|
613
|
-
_assertClass(addr, ByronAddress);
|
|
614
|
-
_assertClass(key, LegacyDaedalusPrivateKey);
|
|
615
|
-
const ret = wasm.make_daedalus_bootstrap_witness(tx_body_hash.__wbg_ptr, addr.__wbg_ptr, key.__wbg_ptr);
|
|
616
|
-
return BootstrapWitness.__wrap(ret);
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* @param {TransactionHash} tx_body_hash
|
|
621
|
-
* @param {ByronAddress} addr
|
|
622
|
-
* @param {Bip32PrivateKey} key
|
|
623
|
-
* @returns {BootstrapWitness}
|
|
624
|
-
*/
|
|
625
|
-
module.exports.make_icarus_bootstrap_witness = function(tx_body_hash, addr, key) {
|
|
626
|
-
_assertClass(tx_body_hash, TransactionHash);
|
|
627
|
-
var ptr0 = tx_body_hash.__destroy_into_raw();
|
|
628
|
-
_assertClass(addr, ByronAddress);
|
|
629
|
-
var ptr1 = addr.__destroy_into_raw();
|
|
630
|
-
_assertClass(key, Bip32PrivateKey);
|
|
631
|
-
const ret = wasm.make_icarus_bootstrap_witness(ptr0, ptr1, key.__wbg_ptr);
|
|
632
|
-
return BootstrapWitness.__wrap(ret);
|
|
633
|
-
};
|
|
634
|
-
|
|
635
|
-
/**
|
|
636
|
-
* @param {TransactionHash} tx_body_hash
|
|
637
|
-
* @param {PrivateKey} sk
|
|
638
|
-
* @returns {Vkeywitness}
|
|
639
|
-
*/
|
|
640
|
-
module.exports.make_vkey_witness = function(tx_body_hash, sk) {
|
|
641
|
-
_assertClass(tx_body_hash, TransactionHash);
|
|
642
|
-
_assertClass(sk, PrivateKey);
|
|
643
|
-
const ret = wasm.make_vkey_witness(tx_body_hash.__wbg_ptr, sk.__wbg_ptr);
|
|
644
|
-
return Vkeywitness.__wrap(ret);
|
|
645
|
-
};
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* @param {TransactionOutput} output
|
|
649
|
-
* @param {bigint} coins_per_utxo_byte
|
|
650
|
-
* @returns {bigint}
|
|
651
|
-
*/
|
|
652
|
-
module.exports.min_ada_required = function(output, coins_per_utxo_byte) {
|
|
653
|
-
try {
|
|
654
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
655
|
-
_assertClass(output, TransactionOutput);
|
|
656
|
-
wasm.min_ada_required(retptr, output.__wbg_ptr, coins_per_utxo_byte);
|
|
657
|
-
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
658
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
659
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
660
|
-
if (r3) {
|
|
661
|
-
throw takeObject(r2);
|
|
662
|
-
}
|
|
663
|
-
return BigInt.asUintN(64, r0);
|
|
664
|
-
} finally {
|
|
665
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
let cachedUint32ArrayMemory0 = null;
|
|
670
|
-
|
|
671
|
-
function getUint32ArrayMemory0() {
|
|
672
|
-
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
673
|
-
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
674
|
-
}
|
|
675
|
-
return cachedUint32ArrayMemory0;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
function getArrayU32FromWasm0(ptr, len) {
|
|
679
|
-
ptr = ptr >>> 0;
|
|
680
|
-
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
681
|
-
}
|
|
682
660
|
/**
|
|
683
661
|
* @param {string} json
|
|
684
662
|
* @param {CardanoNodePlutusDatumSchema} schema
|
|
@@ -733,6 +711,28 @@ module.exports.decode_plutus_datum_to_json_str = function(datum, schema) {
|
|
|
733
711
|
}
|
|
734
712
|
};
|
|
735
713
|
|
|
714
|
+
/**
|
|
715
|
+
* @param {TransactionOutput} output
|
|
716
|
+
* @param {bigint} coins_per_utxo_byte
|
|
717
|
+
* @returns {bigint}
|
|
718
|
+
*/
|
|
719
|
+
module.exports.min_ada_required = function(output, coins_per_utxo_byte) {
|
|
720
|
+
try {
|
|
721
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
722
|
+
_assertClass(output, TransactionOutput);
|
|
723
|
+
wasm.min_ada_required(retptr, output.__wbg_ptr, coins_per_utxo_byte);
|
|
724
|
+
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
725
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
726
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
727
|
+
if (r3) {
|
|
728
|
+
throw takeObject(r2);
|
|
729
|
+
}
|
|
730
|
+
return BigInt.asUintN(64, r0);
|
|
731
|
+
} finally {
|
|
732
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
|
|
736
736
|
let cachedBigInt64ArrayMemory0 = null;
|
|
737
737
|
|
|
738
738
|
function getBigInt64ArrayMemory0() {
|
|
@@ -768,12 +768,6 @@ function getArrayU64FromWasm0(ptr, len) {
|
|
|
768
768
|
return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
769
769
|
}
|
|
770
770
|
/**
|
|
771
|
-
*/
|
|
772
|
-
module.exports.AddressKind = Object.freeze({ Base:0,"0":"Base",Ptr:1,"1":"Ptr",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron", });
|
|
773
|
-
/**
|
|
774
|
-
*/
|
|
775
|
-
module.exports.CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",RegCert:5,"5":"RegCert",UnregCert:6,"6":"UnregCert",VoteDelegCert:7,"7":"VoteDelegCert",StakeVoteDelegCert:8,"8":"StakeVoteDelegCert",StakeRegDelegCert:9,"9":"StakeRegDelegCert",VoteRegDelegCert:10,"10":"VoteRegDelegCert",StakeVoteRegDelegCert:11,"11":"StakeVoteRegDelegCert",AuthCommitteeHotCert:12,"12":"AuthCommitteeHotCert",ResignCommitteeColdCert:13,"13":"ResignCommitteeColdCert",RegDrepCert:14,"14":"RegDrepCert",UnregDrepCert:15,"15":"UnregDrepCert",UpdateDrepCert:16,"16":"UpdateDrepCert", });
|
|
776
|
-
/**
|
|
777
771
|
* JSON <-> PlutusData conversion schemas.
|
|
778
772
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
779
773
|
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
@@ -826,31 +820,46 @@ BasicConversions:0,"0":"BasicConversions",
|
|
|
826
820
|
DetailedSchema:1,"1":"DetailedSchema", });
|
|
827
821
|
/**
|
|
828
822
|
*/
|
|
829
|
-
module.exports.
|
|
823
|
+
module.exports.Language = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
830
824
|
/**
|
|
831
825
|
*/
|
|
832
|
-
module.exports.
|
|
826
|
+
module.exports.DelegationDistributionKind = Object.freeze({ Weighted:0,"0":"Weighted",Legacy:1,"1":"Legacy", });
|
|
833
827
|
/**
|
|
834
|
-
* Careful: this enum doesn't include the network ID part of the header
|
|
835
|
-
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
836
|
-
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
837
828
|
*/
|
|
838
|
-
module.exports.
|
|
829
|
+
module.exports.RedeemerTag = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Voting:4,"4":"Voting",Proposing:5,"5":"Proposing", });
|
|
839
830
|
/**
|
|
840
831
|
*/
|
|
841
|
-
module.exports.
|
|
832
|
+
module.exports.ScriptKind = Object.freeze({ Native:0,"0":"Native",PlutusV1:1,"1":"PlutusV1",PlutusV2:2,"2":"PlutusV2",PlutusV3:3,"3":"PlutusV3", });
|
|
842
833
|
/**
|
|
843
834
|
*/
|
|
844
|
-
module.exports.
|
|
835
|
+
module.exports.TransactionMetadatumKind = Object.freeze({ Map:0,"0":"Map",List:1,"1":"List",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
|
|
845
836
|
/**
|
|
846
837
|
*/
|
|
847
|
-
module.exports.
|
|
838
|
+
module.exports.AuxiliaryDataKind = Object.freeze({ Shelley:0,"0":"Shelley",ShelleyMA:1,"1":"ShelleyMA",Conway:2,"2":"Conway", });
|
|
848
839
|
/**
|
|
849
840
|
*/
|
|
850
841
|
module.exports.ChunkableStringKind = Object.freeze({ Single:0,"0":"Single",Chunked:1,"1":"Chunked", });
|
|
851
842
|
/**
|
|
852
843
|
*/
|
|
853
|
-
module.exports.
|
|
844
|
+
module.exports.VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
|
|
845
|
+
/**
|
|
846
|
+
*/
|
|
847
|
+
module.exports.CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",RegCert:5,"5":"RegCert",UnregCert:6,"6":"UnregCert",VoteDelegCert:7,"7":"VoteDelegCert",StakeVoteDelegCert:8,"8":"StakeVoteDelegCert",StakeRegDelegCert:9,"9":"StakeRegDelegCert",VoteRegDelegCert:10,"10":"VoteRegDelegCert",StakeVoteRegDelegCert:11,"11":"StakeVoteRegDelegCert",AuthCommitteeHotCert:12,"12":"AuthCommitteeHotCert",ResignCommitteeColdCert:13,"13":"ResignCommitteeColdCert",RegDrepCert:14,"14":"RegDrepCert",UnregDrepCert:15,"15":"UnregDrepCert",UpdateDrepCert:16,"16":"UpdateDrepCert", });
|
|
848
|
+
/**
|
|
849
|
+
*/
|
|
850
|
+
module.exports.ByronAddrType = Object.freeze({ PublicKey:0,"0":"PublicKey",Script:1,"1":"Script",Redeem:2,"2":"Redeem", });
|
|
851
|
+
/**
|
|
852
|
+
*/
|
|
853
|
+
module.exports.PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
|
|
854
|
+
/**
|
|
855
|
+
*/
|
|
856
|
+
module.exports.DRepKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
857
|
+
/**
|
|
858
|
+
*/
|
|
859
|
+
module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
860
|
+
/**
|
|
861
|
+
*/
|
|
862
|
+
module.exports.DatumOptionKind = Object.freeze({ Hash:0,"0":"Hash",Datum:1,"1":"Datum", });
|
|
854
863
|
/**
|
|
855
864
|
*/
|
|
856
865
|
module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
|
|
@@ -872,69 +881,60 @@ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
|
872
881
|
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
873
882
|
/**
|
|
874
883
|
*/
|
|
875
|
-
module.exports.
|
|
876
|
-
/**
|
|
877
|
-
*/
|
|
878
|
-
module.exports.Language = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
884
|
+
module.exports.Vote = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
879
885
|
/**
|
|
880
886
|
*/
|
|
881
887
|
module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
882
888
|
/**
|
|
883
889
|
*/
|
|
884
|
-
module.exports.
|
|
885
|
-
/**
|
|
886
|
-
*/
|
|
887
|
-
module.exports.GovActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidence:3,"3":"NoConfidence",UpdateCommittee:4,"4":"UpdateCommittee",NewConstitution:5,"5":"NewConstitution",InfoAction:6,"6":"InfoAction", });
|
|
888
|
-
/**
|
|
889
|
-
*/
|
|
890
|
-
module.exports.VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
|
|
891
|
-
/**
|
|
892
|
-
*/
|
|
893
|
-
module.exports.DRepKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
890
|
+
module.exports.RedeemersKind = Object.freeze({ ArrLegacyRedeemer:0,"0":"ArrLegacyRedeemer",MapRedeemerKeyToRedeemerVal:1,"1":"MapRedeemerKeyToRedeemerVal", });
|
|
894
891
|
/**
|
|
895
892
|
*/
|
|
896
|
-
module.exports.
|
|
893
|
+
module.exports.StakeDistributionKind = Object.freeze({ SingleKey:0,"0":"SingleKey",BootstrapEra:1,"1":"BootstrapEra", });
|
|
897
894
|
/**
|
|
898
|
-
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
899
|
-
* This will change how things are encoded but for the most part contains
|
|
900
|
-
* the same information.
|
|
901
895
|
*/
|
|
902
|
-
module.exports.
|
|
896
|
+
module.exports.AddressKind = Object.freeze({ Base:0,"0":"Base",Ptr:1,"1":"Ptr",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron", });
|
|
903
897
|
/**
|
|
904
|
-
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
905
898
|
*/
|
|
906
|
-
|
|
899
|
+
module.exports.SpendingDataKind = Object.freeze({ SpendingDataPubKey:0,"0":"SpendingDataPubKey",SpendingDataScript:1,"1":"SpendingDataScript",SpendingDataRedeem:2,"2":"SpendingDataRedeem", });
|
|
907
900
|
/**
|
|
908
|
-
* Second version of CIP25. Supports any type of asset names.
|
|
909
901
|
*/
|
|
910
|
-
|
|
902
|
+
module.exports.TransactionOutputKind = Object.freeze({ AlonzoFormatTxOut:0,"0":"AlonzoFormatTxOut",ConwayFormatTxOut:1,"1":"ConwayFormatTxOut", });
|
|
911
903
|
/**
|
|
912
904
|
*/
|
|
913
|
-
module.exports.
|
|
905
|
+
module.exports.ChangeSelectionAlgo = Object.freeze({ Default:0,"0":"Default", });
|
|
914
906
|
/**
|
|
915
907
|
*/
|
|
916
|
-
module.exports.
|
|
908
|
+
module.exports.NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",ScriptInvalidBefore:4,"4":"ScriptInvalidBefore",ScriptInvalidHereafter:5,"5":"ScriptInvalidHereafter", });
|
|
917
909
|
/**
|
|
918
910
|
*/
|
|
919
|
-
module.exports.
|
|
911
|
+
module.exports.CredentialKind = Object.freeze({ PubKey:0,"0":"PubKey",Script:1,"1":"Script", });
|
|
920
912
|
/**
|
|
913
|
+
* Careful: this enum doesn't include the network ID part of the header
|
|
914
|
+
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
915
|
+
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
921
916
|
*/
|
|
922
|
-
module.exports.
|
|
917
|
+
module.exports.AddressHeaderKind = Object.freeze({ BasePaymentKeyStakeKey:0,"0":"BasePaymentKeyStakeKey",BasePaymentScriptStakeKey:1,"1":"BasePaymentScriptStakeKey",BasePaymentKeyStakeScript:2,"2":"BasePaymentKeyStakeScript",BasePaymentScriptStakeScript:3,"3":"BasePaymentScriptStakeScript",PointerKey:4,"4":"PointerKey",PointerScript:5,"5":"PointerScript",EnterpriseKey:6,"6":"EnterpriseKey",EnterpriseScript:7,"7":"EnterpriseScript",Byron:8,"8":"Byron",RewardKey:14,"14":"RewardKey",RewardScript:15,"15":"RewardScript", });
|
|
923
918
|
/**
|
|
924
919
|
*/
|
|
925
|
-
module.exports.
|
|
920
|
+
module.exports.NonceKind = Object.freeze({ Identity:0,"0":"Identity",Hash:1,"1":"Hash", });
|
|
926
921
|
/**
|
|
922
|
+
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
923
|
+
* This will change how things are encoded but for the most part contains
|
|
924
|
+
* the same information.
|
|
927
925
|
*/
|
|
928
|
-
module.exports.
|
|
926
|
+
module.exports.CIP25Version = Object.freeze({
|
|
929
927
|
/**
|
|
928
|
+
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
930
929
|
*/
|
|
931
|
-
|
|
930
|
+
V1:0,"0":"V1",
|
|
932
931
|
/**
|
|
932
|
+
* Second version of CIP25. Supports any type of asset names.
|
|
933
933
|
*/
|
|
934
|
-
|
|
934
|
+
V2:1,"1":"V2", });
|
|
935
935
|
/**
|
|
936
936
|
*/
|
|
937
|
-
module.exports.
|
|
937
|
+
module.exports.GovActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidence:3,"3":"NoConfidence",UpdateCommittee:4,"4":"UpdateCommittee",NewConstitution:5,"5":"NewConstitution",InfoAction:6,"6":"InfoAction", });
|
|
938
938
|
|
|
939
939
|
const AddrAttributesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
940
940
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -963,6 +963,43 @@ class AddrAttributes {
|
|
|
963
963
|
wasm.__wbg_addrattributes_free(ptr, 0);
|
|
964
964
|
}
|
|
965
965
|
/**
|
|
966
|
+
* @param {HDAddressPayload | undefined} [hdap]
|
|
967
|
+
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
968
|
+
* @returns {AddrAttributes}
|
|
969
|
+
*/
|
|
970
|
+
static new_bootstrap_era(hdap, protocol_magic) {
|
|
971
|
+
let ptr0 = 0;
|
|
972
|
+
if (!isLikeNone(hdap)) {
|
|
973
|
+
_assertClass(hdap, HDAddressPayload);
|
|
974
|
+
ptr0 = hdap.__destroy_into_raw();
|
|
975
|
+
}
|
|
976
|
+
let ptr1 = 0;
|
|
977
|
+
if (!isLikeNone(protocol_magic)) {
|
|
978
|
+
_assertClass(protocol_magic, ProtocolMagic);
|
|
979
|
+
ptr1 = protocol_magic.__destroy_into_raw();
|
|
980
|
+
}
|
|
981
|
+
const ret = wasm.addrattributes_new_bootstrap_era(ptr0, ptr1);
|
|
982
|
+
return AddrAttributes.__wrap(ret);
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* @param {Bip32PublicKey} pubk
|
|
986
|
+
* @param {HDAddressPayload | undefined} hdap
|
|
987
|
+
* @param {ProtocolMagic} protocol_magic
|
|
988
|
+
* @returns {AddrAttributes}
|
|
989
|
+
*/
|
|
990
|
+
static new_single_key(pubk, hdap, protocol_magic) {
|
|
991
|
+
_assertClass(pubk, Bip32PublicKey);
|
|
992
|
+
let ptr0 = 0;
|
|
993
|
+
if (!isLikeNone(hdap)) {
|
|
994
|
+
_assertClass(hdap, HDAddressPayload);
|
|
995
|
+
ptr0 = hdap.__destroy_into_raw();
|
|
996
|
+
}
|
|
997
|
+
_assertClass(protocol_magic, ProtocolMagic);
|
|
998
|
+
var ptr1 = protocol_magic.__destroy_into_raw();
|
|
999
|
+
const ret = wasm.addrattributes_new_single_key(pubk.__wbg_ptr, ptr0, ptr1);
|
|
1000
|
+
return AddrAttributes.__wrap(ret);
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
966
1003
|
*
|
|
967
1004
|
* * Serialize this type to CBOR bytes.
|
|
968
1005
|
* * This type does NOT support fine-tuned encoding options so this may or may not be
|
|
@@ -1105,43 +1142,6 @@ class AddrAttributes {
|
|
|
1105
1142
|
const ret = wasm.addrattributes_new();
|
|
1106
1143
|
return AddrAttributes.__wrap(ret);
|
|
1107
1144
|
}
|
|
1108
|
-
/**
|
|
1109
|
-
* @param {HDAddressPayload | undefined} [hdap]
|
|
1110
|
-
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
1111
|
-
* @returns {AddrAttributes}
|
|
1112
|
-
*/
|
|
1113
|
-
static new_bootstrap_era(hdap, protocol_magic) {
|
|
1114
|
-
let ptr0 = 0;
|
|
1115
|
-
if (!isLikeNone(hdap)) {
|
|
1116
|
-
_assertClass(hdap, HDAddressPayload);
|
|
1117
|
-
ptr0 = hdap.__destroy_into_raw();
|
|
1118
|
-
}
|
|
1119
|
-
let ptr1 = 0;
|
|
1120
|
-
if (!isLikeNone(protocol_magic)) {
|
|
1121
|
-
_assertClass(protocol_magic, ProtocolMagic);
|
|
1122
|
-
ptr1 = protocol_magic.__destroy_into_raw();
|
|
1123
|
-
}
|
|
1124
|
-
const ret = wasm.addrattributes_new_bootstrap_era(ptr0, ptr1);
|
|
1125
|
-
return AddrAttributes.__wrap(ret);
|
|
1126
|
-
}
|
|
1127
|
-
/**
|
|
1128
|
-
* @param {Bip32PublicKey} pubk
|
|
1129
|
-
* @param {HDAddressPayload | undefined} hdap
|
|
1130
|
-
* @param {ProtocolMagic} protocol_magic
|
|
1131
|
-
* @returns {AddrAttributes}
|
|
1132
|
-
*/
|
|
1133
|
-
static new_single_key(pubk, hdap, protocol_magic) {
|
|
1134
|
-
_assertClass(pubk, Bip32PublicKey);
|
|
1135
|
-
let ptr0 = 0;
|
|
1136
|
-
if (!isLikeNone(hdap)) {
|
|
1137
|
-
_assertClass(hdap, HDAddressPayload);
|
|
1138
|
-
ptr0 = hdap.__destroy_into_raw();
|
|
1139
|
-
}
|
|
1140
|
-
_assertClass(protocol_magic, ProtocolMagic);
|
|
1141
|
-
var ptr1 = protocol_magic.__destroy_into_raw();
|
|
1142
|
-
const ret = wasm.addrattributes_new_single_key(pubk.__wbg_ptr, ptr0, ptr1);
|
|
1143
|
-
return AddrAttributes.__wrap(ret);
|
|
1144
|
-
}
|
|
1145
1145
|
}
|
|
1146
1146
|
module.exports.AddrAttributes = AddrAttributes;
|
|
1147
1147
|
|
|
@@ -1503,6 +1503,104 @@ class AddressContent {
|
|
|
1503
1503
|
wasm.__wbg_addresscontent_free(ptr, 0);
|
|
1504
1504
|
}
|
|
1505
1505
|
/**
|
|
1506
|
+
* @param {ByronAddrType} addr_type
|
|
1507
|
+
* @param {SpendingData} spending_data
|
|
1508
|
+
* @param {AddrAttributes} attributes
|
|
1509
|
+
* @returns {AddressContent}
|
|
1510
|
+
*/
|
|
1511
|
+
static hash_and_create(addr_type, spending_data, attributes) {
|
|
1512
|
+
_assertClass(spending_data, SpendingData);
|
|
1513
|
+
_assertClass(attributes, AddrAttributes);
|
|
1514
|
+
const ret = wasm.addresscontent_hash_and_create(addr_type, spending_data.__wbg_ptr, attributes.__wbg_ptr);
|
|
1515
|
+
return AddressContent.__wrap(ret);
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* @param {PublicKey} pubkey
|
|
1519
|
+
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
1520
|
+
* @returns {AddressContent}
|
|
1521
|
+
*/
|
|
1522
|
+
static new_redeem(pubkey, protocol_magic) {
|
|
1523
|
+
_assertClass(pubkey, PublicKey);
|
|
1524
|
+
let ptr0 = 0;
|
|
1525
|
+
if (!isLikeNone(protocol_magic)) {
|
|
1526
|
+
_assertClass(protocol_magic, ProtocolMagic);
|
|
1527
|
+
ptr0 = protocol_magic.__destroy_into_raw();
|
|
1528
|
+
}
|
|
1529
|
+
const ret = wasm.addresscontent_new_redeem(pubkey.__wbg_ptr, ptr0);
|
|
1530
|
+
return AddressContent.__wrap(ret);
|
|
1531
|
+
}
|
|
1532
|
+
/**
|
|
1533
|
+
* @param {Bip32PublicKey} xpub
|
|
1534
|
+
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
1535
|
+
* @returns {AddressContent}
|
|
1536
|
+
*/
|
|
1537
|
+
static new_simple(xpub, protocol_magic) {
|
|
1538
|
+
_assertClass(xpub, Bip32PublicKey);
|
|
1539
|
+
let ptr0 = 0;
|
|
1540
|
+
if (!isLikeNone(protocol_magic)) {
|
|
1541
|
+
_assertClass(protocol_magic, ProtocolMagic);
|
|
1542
|
+
ptr0 = protocol_magic.__destroy_into_raw();
|
|
1543
|
+
}
|
|
1544
|
+
const ret = wasm.addresscontent_new_simple(xpub.__wbg_ptr, ptr0);
|
|
1545
|
+
return AddressContent.__wrap(ret);
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Do we want to remove this or keep it for people who were using old Byron code?
|
|
1549
|
+
* @returns {ByronAddress}
|
|
1550
|
+
*/
|
|
1551
|
+
to_address() {
|
|
1552
|
+
const ret = wasm.addresscontent_to_address(this.__wbg_ptr);
|
|
1553
|
+
return ByronAddress.__wrap(ret);
|
|
1554
|
+
}
|
|
1555
|
+
/**
|
|
1556
|
+
* returns the byron protocol magic embedded in the address, or mainnet id if none is present
|
|
1557
|
+
* note: for bech32 addresses, you need to use network_id instead
|
|
1558
|
+
* @returns {ProtocolMagic}
|
|
1559
|
+
*/
|
|
1560
|
+
byron_protocol_magic() {
|
|
1561
|
+
const ret = wasm.addresscontent_byron_protocol_magic(this.__wbg_ptr);
|
|
1562
|
+
return ProtocolMagic.__wrap(ret);
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* @returns {number}
|
|
1566
|
+
*/
|
|
1567
|
+
network_id() {
|
|
1568
|
+
try {
|
|
1569
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1570
|
+
wasm.addresscontent_network_id(retptr, this.__wbg_ptr);
|
|
1571
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1572
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1573
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1574
|
+
if (r2) {
|
|
1575
|
+
throw takeObject(r1);
|
|
1576
|
+
}
|
|
1577
|
+
return r0;
|
|
1578
|
+
} finally {
|
|
1579
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* @param {Bip32PublicKey} key
|
|
1584
|
+
* @param {ProtocolMagic} protocol_magic
|
|
1585
|
+
* @returns {AddressContent}
|
|
1586
|
+
*/
|
|
1587
|
+
static icarus_from_key(key, protocol_magic) {
|
|
1588
|
+
_assertClass(key, Bip32PublicKey);
|
|
1589
|
+
_assertClass(protocol_magic, ProtocolMagic);
|
|
1590
|
+
const ret = wasm.addresscontent_icarus_from_key(key.__wbg_ptr, protocol_magic.__wbg_ptr);
|
|
1591
|
+
return AddressContent.__wrap(ret);
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Check if the Addr can be reconstructed with a specific xpub
|
|
1595
|
+
* @param {Bip32PublicKey} xpub
|
|
1596
|
+
* @returns {boolean}
|
|
1597
|
+
*/
|
|
1598
|
+
identical_with_pubkey(xpub) {
|
|
1599
|
+
_assertClass(xpub, Bip32PublicKey);
|
|
1600
|
+
const ret = wasm.addresscontent_identical_with_pubkey(this.__wbg_ptr, xpub.__wbg_ptr);
|
|
1601
|
+
return ret !== 0;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1506
1604
|
*
|
|
1507
1605
|
* * Serialize this type to CBOR bytes.
|
|
1508
1606
|
* * This type does NOT support fine-tuned encoding options so this may or may not be
|
|
@@ -1629,104 +1727,6 @@ class AddressContent {
|
|
|
1629
1727
|
const ret = wasm.addresscontent_new(address_id.__wbg_ptr, addr_attributes.__wbg_ptr, addr_type);
|
|
1630
1728
|
return AddressContent.__wrap(ret);
|
|
1631
1729
|
}
|
|
1632
|
-
/**
|
|
1633
|
-
* @param {ByronAddrType} addr_type
|
|
1634
|
-
* @param {SpendingData} spending_data
|
|
1635
|
-
* @param {AddrAttributes} attributes
|
|
1636
|
-
* @returns {AddressContent}
|
|
1637
|
-
*/
|
|
1638
|
-
static hash_and_create(addr_type, spending_data, attributes) {
|
|
1639
|
-
_assertClass(spending_data, SpendingData);
|
|
1640
|
-
_assertClass(attributes, AddrAttributes);
|
|
1641
|
-
const ret = wasm.addresscontent_hash_and_create(addr_type, spending_data.__wbg_ptr, attributes.__wbg_ptr);
|
|
1642
|
-
return AddressContent.__wrap(ret);
|
|
1643
|
-
}
|
|
1644
|
-
/**
|
|
1645
|
-
* @param {PublicKey} pubkey
|
|
1646
|
-
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
1647
|
-
* @returns {AddressContent}
|
|
1648
|
-
*/
|
|
1649
|
-
static new_redeem(pubkey, protocol_magic) {
|
|
1650
|
-
_assertClass(pubkey, PublicKey);
|
|
1651
|
-
let ptr0 = 0;
|
|
1652
|
-
if (!isLikeNone(protocol_magic)) {
|
|
1653
|
-
_assertClass(protocol_magic, ProtocolMagic);
|
|
1654
|
-
ptr0 = protocol_magic.__destroy_into_raw();
|
|
1655
|
-
}
|
|
1656
|
-
const ret = wasm.addresscontent_new_redeem(pubkey.__wbg_ptr, ptr0);
|
|
1657
|
-
return AddressContent.__wrap(ret);
|
|
1658
|
-
}
|
|
1659
|
-
/**
|
|
1660
|
-
* @param {Bip32PublicKey} xpub
|
|
1661
|
-
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
1662
|
-
* @returns {AddressContent}
|
|
1663
|
-
*/
|
|
1664
|
-
static new_simple(xpub, protocol_magic) {
|
|
1665
|
-
_assertClass(xpub, Bip32PublicKey);
|
|
1666
|
-
let ptr0 = 0;
|
|
1667
|
-
if (!isLikeNone(protocol_magic)) {
|
|
1668
|
-
_assertClass(protocol_magic, ProtocolMagic);
|
|
1669
|
-
ptr0 = protocol_magic.__destroy_into_raw();
|
|
1670
|
-
}
|
|
1671
|
-
const ret = wasm.addresscontent_new_simple(xpub.__wbg_ptr, ptr0);
|
|
1672
|
-
return AddressContent.__wrap(ret);
|
|
1673
|
-
}
|
|
1674
|
-
/**
|
|
1675
|
-
* Do we want to remove this or keep it for people who were using old Byron code?
|
|
1676
|
-
* @returns {ByronAddress}
|
|
1677
|
-
*/
|
|
1678
|
-
to_address() {
|
|
1679
|
-
const ret = wasm.addresscontent_to_address(this.__wbg_ptr);
|
|
1680
|
-
return ByronAddress.__wrap(ret);
|
|
1681
|
-
}
|
|
1682
|
-
/**
|
|
1683
|
-
* returns the byron protocol magic embedded in the address, or mainnet id if none is present
|
|
1684
|
-
* note: for bech32 addresses, you need to use network_id instead
|
|
1685
|
-
* @returns {ProtocolMagic}
|
|
1686
|
-
*/
|
|
1687
|
-
byron_protocol_magic() {
|
|
1688
|
-
const ret = wasm.addresscontent_byron_protocol_magic(this.__wbg_ptr);
|
|
1689
|
-
return ProtocolMagic.__wrap(ret);
|
|
1690
|
-
}
|
|
1691
|
-
/**
|
|
1692
|
-
* @returns {number}
|
|
1693
|
-
*/
|
|
1694
|
-
network_id() {
|
|
1695
|
-
try {
|
|
1696
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1697
|
-
wasm.addresscontent_network_id(retptr, this.__wbg_ptr);
|
|
1698
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1699
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1700
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1701
|
-
if (r2) {
|
|
1702
|
-
throw takeObject(r1);
|
|
1703
|
-
}
|
|
1704
|
-
return r0;
|
|
1705
|
-
} finally {
|
|
1706
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
/**
|
|
1710
|
-
* @param {Bip32PublicKey} key
|
|
1711
|
-
* @param {ProtocolMagic} protocol_magic
|
|
1712
|
-
* @returns {AddressContent}
|
|
1713
|
-
*/
|
|
1714
|
-
static icarus_from_key(key, protocol_magic) {
|
|
1715
|
-
_assertClass(key, Bip32PublicKey);
|
|
1716
|
-
_assertClass(protocol_magic, ProtocolMagic);
|
|
1717
|
-
const ret = wasm.addresscontent_icarus_from_key(key.__wbg_ptr, protocol_magic.__wbg_ptr);
|
|
1718
|
-
return AddressContent.__wrap(ret);
|
|
1719
|
-
}
|
|
1720
|
-
/**
|
|
1721
|
-
* Check if the Addr can be reconstructed with a specific xpub
|
|
1722
|
-
* @param {Bip32PublicKey} xpub
|
|
1723
|
-
* @returns {boolean}
|
|
1724
|
-
*/
|
|
1725
|
-
identical_with_pubkey(xpub) {
|
|
1726
|
-
_assertClass(xpub, Bip32PublicKey);
|
|
1727
|
-
const ret = wasm.addresscontent_identical_with_pubkey(this.__wbg_ptr, xpub.__wbg_ptr);
|
|
1728
|
-
return ret !== 0;
|
|
1729
|
-
}
|
|
1730
1730
|
}
|
|
1731
1731
|
module.exports.AddressContent = AddressContent;
|
|
1732
1732
|
|
|
@@ -5261,24 +5261,6 @@ class BootstrapWitness {
|
|
|
5261
5261
|
wasm.__wbg_bootstrapwitness_free(ptr, 0);
|
|
5262
5262
|
}
|
|
5263
5263
|
/**
|
|
5264
|
-
* @returns {AddressContent}
|
|
5265
|
-
*/
|
|
5266
|
-
to_address() {
|
|
5267
|
-
try {
|
|
5268
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5269
|
-
wasm.bootstrapwitness_to_address(retptr, this.__wbg_ptr);
|
|
5270
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5271
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5272
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5273
|
-
if (r2) {
|
|
5274
|
-
throw takeObject(r1);
|
|
5275
|
-
}
|
|
5276
|
-
return AddressContent.__wrap(r0);
|
|
5277
|
-
} finally {
|
|
5278
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5279
|
-
}
|
|
5280
|
-
}
|
|
5281
|
-
/**
|
|
5282
5264
|
*
|
|
5283
5265
|
* * Serialize this type to CBOR bytes
|
|
5284
5266
|
* * This type type supports encoding preservation so this will preserve round-trip CBOR formats.
|
|
@@ -5543,6 +5525,24 @@ class BootstrapWitness {
|
|
|
5543
5525
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5544
5526
|
}
|
|
5545
5527
|
}
|
|
5528
|
+
/**
|
|
5529
|
+
* @returns {AddressContent}
|
|
5530
|
+
*/
|
|
5531
|
+
to_address() {
|
|
5532
|
+
try {
|
|
5533
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5534
|
+
wasm.bootstrapwitness_to_address(retptr, this.__wbg_ptr);
|
|
5535
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5536
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5537
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5538
|
+
if (r2) {
|
|
5539
|
+
throw takeObject(r1);
|
|
5540
|
+
}
|
|
5541
|
+
return AddressContent.__wrap(r0);
|
|
5542
|
+
} finally {
|
|
5543
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5544
|
+
}
|
|
5545
|
+
}
|
|
5546
5546
|
}
|
|
5547
5547
|
module.exports.BootstrapWitness = BootstrapWitness;
|
|
5548
5548
|
|
|
@@ -5631,6 +5631,81 @@ class ByronAddress {
|
|
|
5631
5631
|
wasm.__wbg_byronaddress_free(ptr, 0);
|
|
5632
5632
|
}
|
|
5633
5633
|
/**
|
|
5634
|
+
* @returns {string}
|
|
5635
|
+
*/
|
|
5636
|
+
to_base58() {
|
|
5637
|
+
let deferred1_0;
|
|
5638
|
+
let deferred1_1;
|
|
5639
|
+
try {
|
|
5640
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5641
|
+
wasm.byronaddress_to_base58(retptr, this.__wbg_ptr);
|
|
5642
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5643
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5644
|
+
deferred1_0 = r0;
|
|
5645
|
+
deferred1_1 = r1;
|
|
5646
|
+
return getStringFromWasm0(r0, r1);
|
|
5647
|
+
} finally {
|
|
5648
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5649
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
5650
|
+
}
|
|
5651
|
+
}
|
|
5652
|
+
/**
|
|
5653
|
+
* @param {string} s
|
|
5654
|
+
* @returns {ByronAddress}
|
|
5655
|
+
*/
|
|
5656
|
+
static from_base58(s) {
|
|
5657
|
+
try {
|
|
5658
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5659
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5660
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5661
|
+
wasm.byronaddress_from_base58(retptr, ptr0, len0);
|
|
5662
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5663
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5664
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5665
|
+
if (r2) {
|
|
5666
|
+
throw takeObject(r1);
|
|
5667
|
+
}
|
|
5668
|
+
return ByronAddress.__wrap(r0);
|
|
5669
|
+
} finally {
|
|
5670
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5671
|
+
}
|
|
5672
|
+
}
|
|
5673
|
+
/**
|
|
5674
|
+
* @param {string} s
|
|
5675
|
+
* @returns {boolean}
|
|
5676
|
+
*/
|
|
5677
|
+
static is_valid(s) {
|
|
5678
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5679
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5680
|
+
const ret = wasm.byronaddress_is_valid(ptr0, len0);
|
|
5681
|
+
return ret !== 0;
|
|
5682
|
+
}
|
|
5683
|
+
/**
|
|
5684
|
+
* @returns {Address}
|
|
5685
|
+
*/
|
|
5686
|
+
to_address() {
|
|
5687
|
+
const ret = wasm.byronaddress_to_address(this.__wbg_ptr);
|
|
5688
|
+
return Address.__wrap(ret);
|
|
5689
|
+
}
|
|
5690
|
+
/**
|
|
5691
|
+
* @param {Address} addr
|
|
5692
|
+
* @returns {ByronAddress | undefined}
|
|
5693
|
+
*/
|
|
5694
|
+
static from_address(addr) {
|
|
5695
|
+
_assertClass(addr, Address);
|
|
5696
|
+
const ret = wasm.byronaddress_from_address(addr.__wbg_ptr);
|
|
5697
|
+
return ret === 0 ? undefined : ByronAddress.__wrap(ret);
|
|
5698
|
+
}
|
|
5699
|
+
/**
|
|
5700
|
+
* @param {AddressContent} address_content
|
|
5701
|
+
* @returns {ByronAddress}
|
|
5702
|
+
*/
|
|
5703
|
+
static from_address_content(address_content) {
|
|
5704
|
+
_assertClass(address_content, AddressContent);
|
|
5705
|
+
const ret = wasm.byronaddress_from_address_content(address_content.__wbg_ptr);
|
|
5706
|
+
return ByronAddress.__wrap(ret);
|
|
5707
|
+
}
|
|
5708
|
+
/**
|
|
5634
5709
|
*
|
|
5635
5710
|
* * Serialize this type to CBOR bytes.
|
|
5636
5711
|
* * This type does NOT support fine-tuned encoding options so this may or may not be
|
|
@@ -5749,81 +5824,6 @@ class ByronAddress {
|
|
|
5749
5824
|
const ret = wasm.byronaddress_new(content.__wbg_ptr, crc.__wbg_ptr);
|
|
5750
5825
|
return ByronAddress.__wrap(ret);
|
|
5751
5826
|
}
|
|
5752
|
-
/**
|
|
5753
|
-
* @returns {string}
|
|
5754
|
-
*/
|
|
5755
|
-
to_base58() {
|
|
5756
|
-
let deferred1_0;
|
|
5757
|
-
let deferred1_1;
|
|
5758
|
-
try {
|
|
5759
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5760
|
-
wasm.byronaddress_to_base58(retptr, this.__wbg_ptr);
|
|
5761
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5762
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5763
|
-
deferred1_0 = r0;
|
|
5764
|
-
deferred1_1 = r1;
|
|
5765
|
-
return getStringFromWasm0(r0, r1);
|
|
5766
|
-
} finally {
|
|
5767
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5768
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
5769
|
-
}
|
|
5770
|
-
}
|
|
5771
|
-
/**
|
|
5772
|
-
* @param {string} s
|
|
5773
|
-
* @returns {ByronAddress}
|
|
5774
|
-
*/
|
|
5775
|
-
static from_base58(s) {
|
|
5776
|
-
try {
|
|
5777
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5778
|
-
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5779
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5780
|
-
wasm.byronaddress_from_base58(retptr, ptr0, len0);
|
|
5781
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5782
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5783
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5784
|
-
if (r2) {
|
|
5785
|
-
throw takeObject(r1);
|
|
5786
|
-
}
|
|
5787
|
-
return ByronAddress.__wrap(r0);
|
|
5788
|
-
} finally {
|
|
5789
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5790
|
-
}
|
|
5791
|
-
}
|
|
5792
|
-
/**
|
|
5793
|
-
* @param {string} s
|
|
5794
|
-
* @returns {boolean}
|
|
5795
|
-
*/
|
|
5796
|
-
static is_valid(s) {
|
|
5797
|
-
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5798
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5799
|
-
const ret = wasm.byronaddress_is_valid(ptr0, len0);
|
|
5800
|
-
return ret !== 0;
|
|
5801
|
-
}
|
|
5802
|
-
/**
|
|
5803
|
-
* @returns {Address}
|
|
5804
|
-
*/
|
|
5805
|
-
to_address() {
|
|
5806
|
-
const ret = wasm.byronaddress_to_address(this.__wbg_ptr);
|
|
5807
|
-
return Address.__wrap(ret);
|
|
5808
|
-
}
|
|
5809
|
-
/**
|
|
5810
|
-
* @param {Address} addr
|
|
5811
|
-
* @returns {ByronAddress | undefined}
|
|
5812
|
-
*/
|
|
5813
|
-
static from_address(addr) {
|
|
5814
|
-
_assertClass(addr, Address);
|
|
5815
|
-
const ret = wasm.byronaddress_from_address(addr.__wbg_ptr);
|
|
5816
|
-
return ret === 0 ? undefined : ByronAddress.__wrap(ret);
|
|
5817
|
-
}
|
|
5818
|
-
/**
|
|
5819
|
-
* @param {AddressContent} address_content
|
|
5820
|
-
* @returns {ByronAddress}
|
|
5821
|
-
*/
|
|
5822
|
-
static from_address_content(address_content) {
|
|
5823
|
-
_assertClass(address_content, AddressContent);
|
|
5824
|
-
const ret = wasm.byronaddress_from_address_content(address_content.__wbg_ptr);
|
|
5825
|
-
return ByronAddress.__wrap(ret);
|
|
5826
|
-
}
|
|
5827
5827
|
}
|
|
5828
5828
|
module.exports.ByronAddress = ByronAddress;
|
|
5829
5829
|
|
|
@@ -44530,6 +44530,12 @@ class WithdrawalBuilderResult {
|
|
|
44530
44530
|
}
|
|
44531
44531
|
module.exports.WithdrawalBuilderResult = WithdrawalBuilderResult;
|
|
44532
44532
|
|
|
44533
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
44534
|
+
const val = getObject(arg0);
|
|
44535
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
44536
|
+
return ret;
|
|
44537
|
+
};
|
|
44538
|
+
|
|
44533
44539
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
44534
44540
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
44535
44541
|
return addHeapObject(ret);
|
|
@@ -44548,9 +44554,8 @@ module.exports.__wbindgen_memory = function() {
|
|
|
44548
44554
|
return addHeapObject(ret);
|
|
44549
44555
|
};
|
|
44550
44556
|
|
|
44551
|
-
module.exports.
|
|
44552
|
-
const
|
|
44553
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
44557
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
|
44558
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
44554
44559
|
return ret;
|
|
44555
44560
|
};
|
|
44556
44561
|
|
|
@@ -44559,9 +44564,9 @@ module.exports.__wbindgen_is_string = function(arg0) {
|
|
|
44559
44564
|
return ret;
|
|
44560
44565
|
};
|
|
44561
44566
|
|
|
44562
|
-
module.exports.
|
|
44563
|
-
const ret =
|
|
44564
|
-
return ret;
|
|
44567
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
44568
|
+
const ret = getObject(arg0);
|
|
44569
|
+
return addHeapObject(ret);
|
|
44565
44570
|
};
|
|
44566
44571
|
|
|
44567
44572
|
module.exports.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
|
|
@@ -44662,11 +44667,6 @@ module.exports.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
|
|
|
44662
44667
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
44663
44668
|
};
|
|
44664
44669
|
|
|
44665
|
-
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
44666
|
-
const ret = getObject(arg0);
|
|
44667
|
-
return addHeapObject(ret);
|
|
44668
|
-
};
|
|
44669
|
-
|
|
44670
44670
|
module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
44671
44671
|
const ret = getObject(arg0).crypto;
|
|
44672
44672
|
return addHeapObject(ret);
|