@cardananium/cquisitor-lib 0.1.0-beta.35 → 0.1.0-beta.37
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/browser/cquisitor_lib.d.ts +2 -1
- package/browser/cquisitor_lib_bg.js +130 -127
- package/browser/cquisitor_lib_bg.wasm +0 -0
- package/browser/cquisitor_lib_bg.wasm.d.ts +4 -4
- package/node/cquisitor_lib.d.ts +2 -1
- package/node/cquisitor_lib.js +171 -168
- package/node/cquisitor_lib_bg.wasm +0 -0
- package/node/cquisitor_lib_bg.wasm.d.ts +4 -4
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {string} tx_hex
|
|
3
|
+
* @param {NetworkType} network_type
|
|
3
4
|
* @returns {string}
|
|
4
5
|
*/
|
|
5
|
-
export function get_necessary_data_list_js(tx_hex: string): string;
|
|
6
|
+
export function get_necessary_data_list_js(tx_hex: string, network_type: NetworkType): string;
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Extracts all script and datum hashes from a transaction
|
|
@@ -290,15 +290,15 @@ export function get_possible_types_for_input(input) {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
|
-
* @param {string}
|
|
293
|
+
* @param {string} cbor_hex
|
|
294
294
|
* @returns {any}
|
|
295
295
|
*/
|
|
296
|
-
export function
|
|
296
|
+
export function cbor_to_json(cbor_hex) {
|
|
297
297
|
try {
|
|
298
298
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
299
|
-
const ptr0 = passStringToWasm0(
|
|
299
|
+
const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
300
300
|
const len0 = WASM_VECTOR_LEN;
|
|
301
|
-
wasm.
|
|
301
|
+
wasm.cbor_to_json(retptr, ptr0, len0);
|
|
302
302
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
303
303
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
304
304
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -312,84 +312,61 @@ export function check_block_or_tx_signatures(hex_str) {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
/**
|
|
315
|
-
* @param {string}
|
|
316
|
-
* @returns {
|
|
315
|
+
* @param {string} hex_str
|
|
316
|
+
* @returns {any}
|
|
317
317
|
*/
|
|
318
|
-
export function
|
|
319
|
-
let deferred3_0;
|
|
320
|
-
let deferred3_1;
|
|
318
|
+
export function check_block_or_tx_signatures(hex_str) {
|
|
321
319
|
try {
|
|
322
320
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
323
|
-
const ptr0 = passStringToWasm0(
|
|
321
|
+
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
324
322
|
const len0 = WASM_VECTOR_LEN;
|
|
325
|
-
wasm.
|
|
323
|
+
wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
|
|
326
324
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
327
325
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
328
326
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
var len2 = r1;
|
|
332
|
-
if (r3) {
|
|
333
|
-
ptr2 = 0; len2 = 0;
|
|
334
|
-
throw takeObject(r2);
|
|
327
|
+
if (r2) {
|
|
328
|
+
throw takeObject(r1);
|
|
335
329
|
}
|
|
336
|
-
|
|
337
|
-
deferred3_1 = len2;
|
|
338
|
-
return getStringFromWasm0(ptr2, len2);
|
|
330
|
+
return takeObject(r0);
|
|
339
331
|
} finally {
|
|
340
332
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
341
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
342
333
|
}
|
|
343
334
|
}
|
|
344
335
|
|
|
345
336
|
/**
|
|
346
|
-
* @param {string}
|
|
347
|
-
* @
|
|
348
|
-
* @returns {string}
|
|
337
|
+
* @param {string} hex
|
|
338
|
+
* @returns {any}
|
|
349
339
|
*/
|
|
350
|
-
export function
|
|
351
|
-
let deferred4_0;
|
|
352
|
-
let deferred4_1;
|
|
340
|
+
export function decode_plutus_program_uplc_json(hex) {
|
|
353
341
|
try {
|
|
354
342
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
355
|
-
const ptr0 = passStringToWasm0(
|
|
343
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
356
344
|
const len0 = WASM_VECTOR_LEN;
|
|
357
|
-
|
|
358
|
-
const len1 = WASM_VECTOR_LEN;
|
|
359
|
-
wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
|
|
345
|
+
wasm.decode_plutus_program_uplc_json(retptr, ptr0, len0);
|
|
360
346
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
361
347
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
362
348
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
var len3 = r1;
|
|
366
|
-
if (r3) {
|
|
367
|
-
ptr3 = 0; len3 = 0;
|
|
368
|
-
throw takeObject(r2);
|
|
349
|
+
if (r2) {
|
|
350
|
+
throw takeObject(r1);
|
|
369
351
|
}
|
|
370
|
-
|
|
371
|
-
deferred4_1 = len3;
|
|
372
|
-
return getStringFromWasm0(ptr3, len3);
|
|
352
|
+
return takeObject(r0);
|
|
373
353
|
} finally {
|
|
374
354
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
375
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
376
355
|
}
|
|
377
356
|
}
|
|
378
357
|
|
|
379
358
|
/**
|
|
380
|
-
*
|
|
381
|
-
* Returns JSON string with ExtractedHashes structure
|
|
382
|
-
* @param {string} tx_hex
|
|
359
|
+
* @param {string} hex
|
|
383
360
|
* @returns {string}
|
|
384
361
|
*/
|
|
385
|
-
export function
|
|
362
|
+
export function decode_plutus_program_pretty_uplc(hex) {
|
|
386
363
|
let deferred3_0;
|
|
387
364
|
let deferred3_1;
|
|
388
365
|
try {
|
|
389
366
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
390
|
-
const ptr0 = passStringToWasm0(
|
|
367
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
391
368
|
const len0 = WASM_VECTOR_LEN;
|
|
392
|
-
wasm.
|
|
369
|
+
wasm.decode_plutus_program_pretty_uplc(retptr, ptr0, len0);
|
|
393
370
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
394
371
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
395
372
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -410,37 +387,42 @@ export function extract_hashes_from_transaction_js(tx_hex) {
|
|
|
410
387
|
}
|
|
411
388
|
|
|
412
389
|
/**
|
|
413
|
-
* @param {string}
|
|
414
|
-
* @returns {
|
|
390
|
+
* @param {string} tx_hex
|
|
391
|
+
* @returns {(string)[]}
|
|
415
392
|
*/
|
|
416
|
-
export function
|
|
393
|
+
export function get_utxo_list_from_tx(tx_hex) {
|
|
417
394
|
try {
|
|
418
395
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
419
|
-
const ptr0 = passStringToWasm0(
|
|
396
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
420
397
|
const len0 = WASM_VECTOR_LEN;
|
|
421
|
-
wasm.
|
|
398
|
+
wasm.get_utxo_list_from_tx(retptr, ptr0, len0);
|
|
422
399
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
423
400
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
424
401
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
425
|
-
|
|
426
|
-
|
|
402
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
403
|
+
if (r3) {
|
|
404
|
+
throw takeObject(r2);
|
|
427
405
|
}
|
|
428
|
-
|
|
406
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
407
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
408
|
+
return v2;
|
|
429
409
|
} finally {
|
|
430
410
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
431
411
|
}
|
|
432
412
|
}
|
|
433
413
|
|
|
434
414
|
/**
|
|
435
|
-
* @param {string}
|
|
415
|
+
* @param {string} tx_hex
|
|
416
|
+
* @param {any} utxo_json
|
|
417
|
+
* @param {any} cost_models_json
|
|
436
418
|
* @returns {any}
|
|
437
419
|
*/
|
|
438
|
-
export function
|
|
420
|
+
export function execute_tx_scripts(tx_hex, utxo_json, cost_models_json) {
|
|
439
421
|
try {
|
|
440
422
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
441
|
-
const ptr0 = passStringToWasm0(
|
|
423
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
442
424
|
const len0 = WASM_VECTOR_LEN;
|
|
443
|
-
wasm.
|
|
425
|
+
wasm.execute_tx_scripts(retptr, ptr0, len0, addHeapObject(utxo_json), addHeapObject(cost_models_json));
|
|
444
426
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
445
427
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
446
428
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -454,17 +436,18 @@ export function decode_plutus_program_uplc_json(hex) {
|
|
|
454
436
|
}
|
|
455
437
|
|
|
456
438
|
/**
|
|
457
|
-
* @param {string}
|
|
439
|
+
* @param {string} tx_hex
|
|
440
|
+
* @param {number} output_index
|
|
458
441
|
* @returns {string}
|
|
459
442
|
*/
|
|
460
|
-
export function
|
|
443
|
+
export function get_ref_script_bytes(tx_hex, output_index) {
|
|
461
444
|
let deferred3_0;
|
|
462
445
|
let deferred3_1;
|
|
463
446
|
try {
|
|
464
447
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
465
|
-
const ptr0 = passStringToWasm0(
|
|
448
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
466
449
|
const len0 = WASM_VECTOR_LEN;
|
|
467
|
-
wasm.
|
|
450
|
+
wasm.get_ref_script_bytes(retptr, ptr0, len0, output_index);
|
|
468
451
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
469
452
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
470
453
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -486,66 +469,86 @@ export function decode_plutus_program_pretty_uplc(hex) {
|
|
|
486
469
|
|
|
487
470
|
/**
|
|
488
471
|
* @param {string} tx_hex
|
|
489
|
-
* @
|
|
472
|
+
* @param {string} network_type
|
|
473
|
+
* @returns {string}
|
|
490
474
|
*/
|
|
491
|
-
export function
|
|
475
|
+
export function get_necessary_data_list_js(tx_hex, network_type) {
|
|
476
|
+
let deferred4_0;
|
|
477
|
+
let deferred4_1;
|
|
492
478
|
try {
|
|
493
479
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
494
480
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
495
481
|
const len0 = WASM_VECTOR_LEN;
|
|
496
|
-
|
|
482
|
+
const ptr1 = passStringToWasm0(network_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
483
|
+
const len1 = WASM_VECTOR_LEN;
|
|
484
|
+
wasm.get_necessary_data_list_js(retptr, ptr0, len0, ptr1, len1);
|
|
497
485
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
498
486
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
499
487
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
500
488
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
489
|
+
var ptr3 = r0;
|
|
490
|
+
var len3 = r1;
|
|
501
491
|
if (r3) {
|
|
492
|
+
ptr3 = 0; len3 = 0;
|
|
502
493
|
throw takeObject(r2);
|
|
503
494
|
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
return
|
|
495
|
+
deferred4_0 = ptr3;
|
|
496
|
+
deferred4_1 = len3;
|
|
497
|
+
return getStringFromWasm0(ptr3, len3);
|
|
507
498
|
} finally {
|
|
508
499
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
500
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
509
501
|
}
|
|
510
502
|
}
|
|
511
503
|
|
|
512
504
|
/**
|
|
513
505
|
* @param {string} tx_hex
|
|
514
|
-
* @param {
|
|
515
|
-
* @
|
|
516
|
-
* @returns {any}
|
|
506
|
+
* @param {string} validation_context
|
|
507
|
+
* @returns {string}
|
|
517
508
|
*/
|
|
518
|
-
export function
|
|
509
|
+
export function validate_transaction_js(tx_hex, validation_context) {
|
|
510
|
+
let deferred4_0;
|
|
511
|
+
let deferred4_1;
|
|
519
512
|
try {
|
|
520
513
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
521
514
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
522
515
|
const len0 = WASM_VECTOR_LEN;
|
|
523
|
-
|
|
516
|
+
const ptr1 = passStringToWasm0(validation_context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
517
|
+
const len1 = WASM_VECTOR_LEN;
|
|
518
|
+
wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
|
|
524
519
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
525
520
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
526
521
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
527
|
-
|
|
528
|
-
|
|
522
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
523
|
+
var ptr3 = r0;
|
|
524
|
+
var len3 = r1;
|
|
525
|
+
if (r3) {
|
|
526
|
+
ptr3 = 0; len3 = 0;
|
|
527
|
+
throw takeObject(r2);
|
|
529
528
|
}
|
|
530
|
-
|
|
529
|
+
deferred4_0 = ptr3;
|
|
530
|
+
deferred4_1 = len3;
|
|
531
|
+
return getStringFromWasm0(ptr3, len3);
|
|
531
532
|
} finally {
|
|
532
533
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
534
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
533
535
|
}
|
|
534
536
|
}
|
|
535
537
|
|
|
536
538
|
/**
|
|
539
|
+
* WASM export: Extracts all script and datum hashes from a transaction
|
|
540
|
+
* Returns JSON string with ExtractedHashes structure
|
|
537
541
|
* @param {string} tx_hex
|
|
538
|
-
* @param {number} output_index
|
|
539
542
|
* @returns {string}
|
|
540
543
|
*/
|
|
541
|
-
export function
|
|
544
|
+
export function extract_hashes_from_transaction_js(tx_hex) {
|
|
542
545
|
let deferred3_0;
|
|
543
546
|
let deferred3_1;
|
|
544
547
|
try {
|
|
545
548
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
546
549
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
547
550
|
const len0 = WASM_VECTOR_LEN;
|
|
548
|
-
wasm.
|
|
551
|
+
wasm.extract_hashes_from_transaction_js(retptr, ptr0, len0);
|
|
549
552
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
550
553
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
551
554
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -1151,37 +1154,10 @@ function handleError(f, args) {
|
|
|
1151
1154
|
}
|
|
1152
1155
|
/**
|
|
1153
1156
|
*/
|
|
1154
|
-
export const AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
|
|
1155
|
-
/**
|
|
1156
|
-
*/
|
|
1157
|
-
export const RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
|
|
1158
|
-
/**
|
|
1159
|
-
*/
|
|
1160
|
-
export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
|
|
1161
|
-
/**
|
|
1162
|
-
*/
|
|
1163
|
-
export const VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
|
|
1164
|
-
/**
|
|
1165
|
-
*/
|
|
1166
1157
|
export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
1167
1158
|
/**
|
|
1168
1159
|
*/
|
|
1169
|
-
export const
|
|
1170
|
-
/**
|
|
1171
|
-
*/
|
|
1172
|
-
export const TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"MetadataMap",MetadataList:1,"1":"MetadataList",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
|
|
1173
|
-
/**
|
|
1174
|
-
*/
|
|
1175
|
-
export const PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
|
|
1176
|
-
/**
|
|
1177
|
-
*/
|
|
1178
|
-
export const NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
|
|
1179
|
-
/**
|
|
1180
|
-
*/
|
|
1181
|
-
export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
|
|
1182
|
-
/**
|
|
1183
|
-
*/
|
|
1184
|
-
export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
1160
|
+
export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
|
|
1185
1161
|
/**
|
|
1186
1162
|
* JSON <-> PlutusData conversion schemas.
|
|
1187
1163
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
@@ -1235,26 +1211,29 @@ BasicConversions:0,"0":"BasicConversions",
|
|
|
1235
1211
|
DetailedSchema:1,"1":"DetailedSchema", });
|
|
1236
1212
|
/**
|
|
1237
1213
|
*/
|
|
1238
|
-
export const
|
|
1214
|
+
export const TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"MetadataMap",MetadataList:1,"1":"MetadataList",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
|
|
1239
1215
|
/**
|
|
1240
|
-
* Each new language uses a different namespace for hashing its script
|
|
1241
|
-
* This is because you could have a language where the same bytes have different semantics
|
|
1242
|
-
* So this avoids scripts in different languages mapping to the same hash
|
|
1243
|
-
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
1244
1216
|
*/
|
|
1245
|
-
export const
|
|
1217
|
+
export const CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",GenesisKeyDelegation:5,"5":"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,"6":"MoveInstantaneousRewardsCert",CommitteeHotAuth:7,"7":"CommitteeHotAuth",CommitteeColdResign:8,"8":"CommitteeColdResign",DRepDeregistration:9,"9":"DRepDeregistration",DRepRegistration:10,"10":"DRepRegistration",DRepUpdate:11,"11":"DRepUpdate",StakeAndVoteDelegation:12,"12":"StakeAndVoteDelegation",StakeRegistrationAndDelegation:13,"13":"StakeRegistrationAndDelegation",StakeVoteRegistrationAndDelegation:14,"14":"StakeVoteRegistrationAndDelegation",VoteDelegation:15,"15":"VoteDelegation",VoteRegistrationAndDelegation:16,"16":"VoteRegistrationAndDelegation", });
|
|
1246
1218
|
/**
|
|
1247
1219
|
*/
|
|
1248
|
-
export const
|
|
1220
|
+
export const BlockEra = Object.freeze({ Byron:0,"0":"Byron",Shelley:1,"1":"Shelley",Allegra:2,"2":"Allegra",Mary:3,"3":"Mary",Alonzo:4,"4":"Alonzo",Babbage:5,"5":"Babbage",Conway:6,"6":"Conway",Unknown:7,"7":"Unknown", });
|
|
1221
|
+
/**
|
|
1222
|
+
*/
|
|
1223
|
+
export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
|
|
1249
1224
|
/**
|
|
1250
1225
|
*/
|
|
1251
1226
|
export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
1252
1227
|
/**
|
|
1228
|
+
* Used to choosed the schema for a script JSON string
|
|
1229
|
+
*/
|
|
1230
|
+
export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
|
|
1231
|
+
/**
|
|
1253
1232
|
*/
|
|
1254
1233
|
export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
1255
1234
|
/**
|
|
1256
1235
|
*/
|
|
1257
|
-
export const
|
|
1236
|
+
export const GovernanceActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidenceAction:3,"3":"NoConfidenceAction",UpdateCommitteeAction:4,"4":"UpdateCommitteeAction",NewConstitutionAction:5,"5":"NewConstitutionAction",InfoAction:6,"6":"InfoAction", });
|
|
1258
1237
|
/**
|
|
1259
1238
|
*/
|
|
1260
1239
|
export const CoinSelectionStrategyCIP2 = Object.freeze({
|
|
@@ -1276,26 +1255,50 @@ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
|
1276
1255
|
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
1277
1256
|
/**
|
|
1278
1257
|
*/
|
|
1279
|
-
export const
|
|
1258
|
+
export const VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
|
|
1280
1259
|
/**
|
|
1281
1260
|
*/
|
|
1282
|
-
export const
|
|
1261
|
+
export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
|
|
1262
|
+
/**
|
|
1263
|
+
*/
|
|
1264
|
+
export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
|
|
1265
|
+
/**
|
|
1266
|
+
* Each new language uses a different namespace for hashing its script
|
|
1267
|
+
* This is because you could have a language where the same bytes have different semantics
|
|
1268
|
+
* So this avoids scripts in different languages mapping to the same hash
|
|
1269
|
+
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
1270
|
+
*/
|
|
1271
|
+
export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
|
|
1272
|
+
/**
|
|
1273
|
+
*/
|
|
1274
|
+
export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
|
|
1275
|
+
/**
|
|
1276
|
+
*/
|
|
1277
|
+
export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
1283
1278
|
/**
|
|
1284
1279
|
*/
|
|
1285
1280
|
export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
1286
1281
|
/**
|
|
1287
1282
|
*/
|
|
1288
|
-
export const
|
|
1283
|
+
export const AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
|
|
1289
1284
|
/**
|
|
1290
|
-
* Used to choosed the schema for a script JSON string
|
|
1291
1285
|
*/
|
|
1292
|
-
export const
|
|
1286
|
+
export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
1287
|
+
/**
|
|
1288
|
+
*/
|
|
1289
|
+
export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
|
|
1290
|
+
/**
|
|
1291
|
+
*/
|
|
1292
|
+
export const RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
|
|
1293
|
+
/**
|
|
1294
|
+
*/
|
|
1295
|
+
export const PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
|
|
1293
1296
|
/**
|
|
1294
1297
|
*/
|
|
1295
1298
|
export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
|
|
1296
1299
|
/**
|
|
1297
1300
|
*/
|
|
1298
|
-
export const
|
|
1301
|
+
export const NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
|
|
1299
1302
|
|
|
1300
1303
|
const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1301
1304
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -39134,11 +39137,6 @@ export function __wbindgen_string_new(arg0, arg1) {
|
|
|
39134
39137
|
return addHeapObject(ret);
|
|
39135
39138
|
};
|
|
39136
39139
|
|
|
39137
|
-
export function __wbindgen_error_new(arg0, arg1) {
|
|
39138
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
39139
|
-
return addHeapObject(ret);
|
|
39140
|
-
};
|
|
39141
|
-
|
|
39142
39140
|
export function __wbindgen_is_undefined(arg0) {
|
|
39143
39141
|
const ret = getObject(arg0) === undefined;
|
|
39144
39142
|
return ret;
|
|
@@ -39184,6 +39182,11 @@ export function __wbindgen_is_object(arg0) {
|
|
|
39184
39182
|
return ret;
|
|
39185
39183
|
};
|
|
39186
39184
|
|
|
39185
|
+
export function __wbindgen_error_new(arg0, arg1) {
|
|
39186
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
39187
|
+
return addHeapObject(ret);
|
|
39188
|
+
};
|
|
39189
|
+
|
|
39187
39190
|
export function __wbindgen_object_clone_ref(arg0) {
|
|
39188
39191
|
const ret = getObject(arg0);
|
|
39189
39192
|
return addHeapObject(ret);
|
|
Binary file
|
|
@@ -4,16 +4,16 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export function get_decodable_types(a: number): void;
|
|
5
5
|
export function decode_specific_type(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
6
6
|
export function get_possible_types_for_input(a: number, b: number, c: number): void;
|
|
7
|
-
export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
|
|
8
|
-
export function get_necessary_data_list_js(a: number, b: number, c: number): void;
|
|
9
|
-
export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
10
|
-
export function extract_hashes_from_transaction_js(a: number, b: number, c: number): void;
|
|
11
7
|
export function cbor_to_json(a: number, b: number, c: number): void;
|
|
8
|
+
export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
|
|
12
9
|
export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
|
|
13
10
|
export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
|
|
14
11
|
export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
|
|
15
12
|
export function execute_tx_scripts(a: number, b: number, c: number, d: number, e: number): void;
|
|
16
13
|
export function get_ref_script_bytes(a: number, b: number, c: number, d: number): void;
|
|
14
|
+
export function get_necessary_data_list_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
15
|
+
export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
16
|
+
export function extract_hashes_from_transaction_js(a: number, b: number, c: number): void;
|
|
17
17
|
export function __wbg_noconfidenceaction_free(a: number): void;
|
|
18
18
|
export function noconfidenceaction_to_bytes(a: number, b: number): void;
|
|
19
19
|
export function noconfidenceaction_from_bytes(a: number, b: number, c: number): void;
|
package/node/cquisitor_lib.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {string} tx_hex
|
|
3
|
+
* @param {NetworkType} network_type
|
|
3
4
|
* @returns {string}
|
|
4
5
|
*/
|
|
5
|
-
export function get_necessary_data_list_js(tx_hex: string): string;
|
|
6
|
+
export function get_necessary_data_list_js(tx_hex: string, network_type: NetworkType): string;
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Extracts all script and datum hashes from a transaction
|
package/node/cquisitor_lib.js
CHANGED
|
@@ -285,15 +285,15 @@ module.exports.get_possible_types_for_input = function(input) {
|
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
|
-
* @param {string}
|
|
288
|
+
* @param {string} cbor_hex
|
|
289
289
|
* @returns {any}
|
|
290
290
|
*/
|
|
291
|
-
module.exports.
|
|
291
|
+
module.exports.cbor_to_json = function(cbor_hex) {
|
|
292
292
|
try {
|
|
293
293
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
294
|
-
const ptr0 = passStringToWasm0(
|
|
294
|
+
const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
295
295
|
const len0 = WASM_VECTOR_LEN;
|
|
296
|
-
wasm.
|
|
296
|
+
wasm.cbor_to_json(retptr, ptr0, len0);
|
|
297
297
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
298
298
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
299
299
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -307,84 +307,61 @@ module.exports.check_block_or_tx_signatures = function(hex_str) {
|
|
|
307
307
|
};
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
|
-
* @param {string}
|
|
311
|
-
* @returns {
|
|
310
|
+
* @param {string} hex_str
|
|
311
|
+
* @returns {any}
|
|
312
312
|
*/
|
|
313
|
-
module.exports.
|
|
314
|
-
let deferred3_0;
|
|
315
|
-
let deferred3_1;
|
|
313
|
+
module.exports.check_block_or_tx_signatures = function(hex_str) {
|
|
316
314
|
try {
|
|
317
315
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
318
|
-
const ptr0 = passStringToWasm0(
|
|
316
|
+
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
319
317
|
const len0 = WASM_VECTOR_LEN;
|
|
320
|
-
wasm.
|
|
318
|
+
wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
|
|
321
319
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
322
320
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
323
321
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
var len2 = r1;
|
|
327
|
-
if (r3) {
|
|
328
|
-
ptr2 = 0; len2 = 0;
|
|
329
|
-
throw takeObject(r2);
|
|
322
|
+
if (r2) {
|
|
323
|
+
throw takeObject(r1);
|
|
330
324
|
}
|
|
331
|
-
|
|
332
|
-
deferred3_1 = len2;
|
|
333
|
-
return getStringFromWasm0(ptr2, len2);
|
|
325
|
+
return takeObject(r0);
|
|
334
326
|
} finally {
|
|
335
327
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
336
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
337
328
|
}
|
|
338
329
|
};
|
|
339
330
|
|
|
340
331
|
/**
|
|
341
|
-
* @param {string}
|
|
342
|
-
* @
|
|
343
|
-
* @returns {string}
|
|
332
|
+
* @param {string} hex
|
|
333
|
+
* @returns {any}
|
|
344
334
|
*/
|
|
345
|
-
module.exports.
|
|
346
|
-
let deferred4_0;
|
|
347
|
-
let deferred4_1;
|
|
335
|
+
module.exports.decode_plutus_program_uplc_json = function(hex) {
|
|
348
336
|
try {
|
|
349
337
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
350
|
-
const ptr0 = passStringToWasm0(
|
|
338
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
351
339
|
const len0 = WASM_VECTOR_LEN;
|
|
352
|
-
|
|
353
|
-
const len1 = WASM_VECTOR_LEN;
|
|
354
|
-
wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
|
|
340
|
+
wasm.decode_plutus_program_uplc_json(retptr, ptr0, len0);
|
|
355
341
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
356
342
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
357
343
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
var len3 = r1;
|
|
361
|
-
if (r3) {
|
|
362
|
-
ptr3 = 0; len3 = 0;
|
|
363
|
-
throw takeObject(r2);
|
|
344
|
+
if (r2) {
|
|
345
|
+
throw takeObject(r1);
|
|
364
346
|
}
|
|
365
|
-
|
|
366
|
-
deferred4_1 = len3;
|
|
367
|
-
return getStringFromWasm0(ptr3, len3);
|
|
347
|
+
return takeObject(r0);
|
|
368
348
|
} finally {
|
|
369
349
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
370
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
371
350
|
}
|
|
372
351
|
};
|
|
373
352
|
|
|
374
353
|
/**
|
|
375
|
-
*
|
|
376
|
-
* Returns JSON string with ExtractedHashes structure
|
|
377
|
-
* @param {string} tx_hex
|
|
354
|
+
* @param {string} hex
|
|
378
355
|
* @returns {string}
|
|
379
356
|
*/
|
|
380
|
-
module.exports.
|
|
357
|
+
module.exports.decode_plutus_program_pretty_uplc = function(hex) {
|
|
381
358
|
let deferred3_0;
|
|
382
359
|
let deferred3_1;
|
|
383
360
|
try {
|
|
384
361
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
385
|
-
const ptr0 = passStringToWasm0(
|
|
362
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
386
363
|
const len0 = WASM_VECTOR_LEN;
|
|
387
|
-
wasm.
|
|
364
|
+
wasm.decode_plutus_program_pretty_uplc(retptr, ptr0, len0);
|
|
388
365
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
389
366
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
390
367
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -405,37 +382,42 @@ module.exports.extract_hashes_from_transaction_js = function(tx_hex) {
|
|
|
405
382
|
};
|
|
406
383
|
|
|
407
384
|
/**
|
|
408
|
-
* @param {string}
|
|
409
|
-
* @returns {
|
|
385
|
+
* @param {string} tx_hex
|
|
386
|
+
* @returns {(string)[]}
|
|
410
387
|
*/
|
|
411
|
-
module.exports.
|
|
388
|
+
module.exports.get_utxo_list_from_tx = function(tx_hex) {
|
|
412
389
|
try {
|
|
413
390
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
414
|
-
const ptr0 = passStringToWasm0(
|
|
391
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
415
392
|
const len0 = WASM_VECTOR_LEN;
|
|
416
|
-
wasm.
|
|
393
|
+
wasm.get_utxo_list_from_tx(retptr, ptr0, len0);
|
|
417
394
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
418
395
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
419
396
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
420
|
-
|
|
421
|
-
|
|
397
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
398
|
+
if (r3) {
|
|
399
|
+
throw takeObject(r2);
|
|
422
400
|
}
|
|
423
|
-
|
|
401
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
402
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
403
|
+
return v2;
|
|
424
404
|
} finally {
|
|
425
405
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
426
406
|
}
|
|
427
407
|
};
|
|
428
408
|
|
|
429
409
|
/**
|
|
430
|
-
* @param {string}
|
|
410
|
+
* @param {string} tx_hex
|
|
411
|
+
* @param {any} utxo_json
|
|
412
|
+
* @param {any} cost_models_json
|
|
431
413
|
* @returns {any}
|
|
432
414
|
*/
|
|
433
|
-
module.exports.
|
|
415
|
+
module.exports.execute_tx_scripts = function(tx_hex, utxo_json, cost_models_json) {
|
|
434
416
|
try {
|
|
435
417
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
436
|
-
const ptr0 = passStringToWasm0(
|
|
418
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
437
419
|
const len0 = WASM_VECTOR_LEN;
|
|
438
|
-
wasm.
|
|
420
|
+
wasm.execute_tx_scripts(retptr, ptr0, len0, addHeapObject(utxo_json), addHeapObject(cost_models_json));
|
|
439
421
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
440
422
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
441
423
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -449,17 +431,18 @@ module.exports.decode_plutus_program_uplc_json = function(hex) {
|
|
|
449
431
|
};
|
|
450
432
|
|
|
451
433
|
/**
|
|
452
|
-
* @param {string}
|
|
434
|
+
* @param {string} tx_hex
|
|
435
|
+
* @param {number} output_index
|
|
453
436
|
* @returns {string}
|
|
454
437
|
*/
|
|
455
|
-
module.exports.
|
|
438
|
+
module.exports.get_ref_script_bytes = function(tx_hex, output_index) {
|
|
456
439
|
let deferred3_0;
|
|
457
440
|
let deferred3_1;
|
|
458
441
|
try {
|
|
459
442
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
460
|
-
const ptr0 = passStringToWasm0(
|
|
443
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
461
444
|
const len0 = WASM_VECTOR_LEN;
|
|
462
|
-
wasm.
|
|
445
|
+
wasm.get_ref_script_bytes(retptr, ptr0, len0, output_index);
|
|
463
446
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
464
447
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
465
448
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -481,66 +464,86 @@ module.exports.decode_plutus_program_pretty_uplc = function(hex) {
|
|
|
481
464
|
|
|
482
465
|
/**
|
|
483
466
|
* @param {string} tx_hex
|
|
484
|
-
* @
|
|
467
|
+
* @param {string} network_type
|
|
468
|
+
* @returns {string}
|
|
485
469
|
*/
|
|
486
|
-
module.exports.
|
|
470
|
+
module.exports.get_necessary_data_list_js = function(tx_hex, network_type) {
|
|
471
|
+
let deferred4_0;
|
|
472
|
+
let deferred4_1;
|
|
487
473
|
try {
|
|
488
474
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
489
475
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
490
476
|
const len0 = WASM_VECTOR_LEN;
|
|
491
|
-
|
|
477
|
+
const ptr1 = passStringToWasm0(network_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
478
|
+
const len1 = WASM_VECTOR_LEN;
|
|
479
|
+
wasm.get_necessary_data_list_js(retptr, ptr0, len0, ptr1, len1);
|
|
492
480
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
493
481
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
494
482
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
495
483
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
484
|
+
var ptr3 = r0;
|
|
485
|
+
var len3 = r1;
|
|
496
486
|
if (r3) {
|
|
487
|
+
ptr3 = 0; len3 = 0;
|
|
497
488
|
throw takeObject(r2);
|
|
498
489
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return
|
|
490
|
+
deferred4_0 = ptr3;
|
|
491
|
+
deferred4_1 = len3;
|
|
492
|
+
return getStringFromWasm0(ptr3, len3);
|
|
502
493
|
} finally {
|
|
503
494
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
495
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
504
496
|
}
|
|
505
497
|
};
|
|
506
498
|
|
|
507
499
|
/**
|
|
508
500
|
* @param {string} tx_hex
|
|
509
|
-
* @param {
|
|
510
|
-
* @
|
|
511
|
-
* @returns {any}
|
|
501
|
+
* @param {string} validation_context
|
|
502
|
+
* @returns {string}
|
|
512
503
|
*/
|
|
513
|
-
module.exports.
|
|
504
|
+
module.exports.validate_transaction_js = function(tx_hex, validation_context) {
|
|
505
|
+
let deferred4_0;
|
|
506
|
+
let deferred4_1;
|
|
514
507
|
try {
|
|
515
508
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
516
509
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
517
510
|
const len0 = WASM_VECTOR_LEN;
|
|
518
|
-
|
|
511
|
+
const ptr1 = passStringToWasm0(validation_context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
512
|
+
const len1 = WASM_VECTOR_LEN;
|
|
513
|
+
wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
|
|
519
514
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
520
515
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
521
516
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
522
|
-
|
|
523
|
-
|
|
517
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
518
|
+
var ptr3 = r0;
|
|
519
|
+
var len3 = r1;
|
|
520
|
+
if (r3) {
|
|
521
|
+
ptr3 = 0; len3 = 0;
|
|
522
|
+
throw takeObject(r2);
|
|
524
523
|
}
|
|
525
|
-
|
|
524
|
+
deferred4_0 = ptr3;
|
|
525
|
+
deferred4_1 = len3;
|
|
526
|
+
return getStringFromWasm0(ptr3, len3);
|
|
526
527
|
} finally {
|
|
527
528
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
529
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
528
530
|
}
|
|
529
531
|
};
|
|
530
532
|
|
|
531
533
|
/**
|
|
534
|
+
* WASM export: Extracts all script and datum hashes from a transaction
|
|
535
|
+
* Returns JSON string with ExtractedHashes structure
|
|
532
536
|
* @param {string} tx_hex
|
|
533
|
-
* @param {number} output_index
|
|
534
537
|
* @returns {string}
|
|
535
538
|
*/
|
|
536
|
-
module.exports.
|
|
539
|
+
module.exports.extract_hashes_from_transaction_js = function(tx_hex) {
|
|
537
540
|
let deferred3_0;
|
|
538
541
|
let deferred3_1;
|
|
539
542
|
try {
|
|
540
543
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
541
544
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
542
545
|
const len0 = WASM_VECTOR_LEN;
|
|
543
|
-
wasm.
|
|
546
|
+
wasm.extract_hashes_from_transaction_js(retptr, ptr0, len0);
|
|
544
547
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
545
548
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
546
549
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -1145,152 +1148,152 @@ function handleError(f, args) {
|
|
|
1145
1148
|
}
|
|
1146
1149
|
}
|
|
1147
1150
|
/**
|
|
1148
|
-
*
|
|
1151
|
+
* JSON <-> PlutusData conversion schemas.
|
|
1152
|
+
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
1153
|
+
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
1154
|
+
*
|
|
1155
|
+
* All methods here have the following restrictions due to limitations on dependencies:
|
|
1156
|
+
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
1157
|
+
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
1158
|
+
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
1159
|
+
* on either side when tested so proceed with caution
|
|
1149
1160
|
*/
|
|
1150
|
-
module.exports.
|
|
1161
|
+
module.exports.PlutusDatumSchema = Object.freeze({
|
|
1151
1162
|
/**
|
|
1163
|
+
* ScriptDataJsonNoSchema in cardano-node.
|
|
1164
|
+
*
|
|
1165
|
+
* This is the format used by --script-data-value in cardano-cli
|
|
1166
|
+
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
1167
|
+
* From JSON:
|
|
1168
|
+
* * null/true/false/floats NOT supported
|
|
1169
|
+
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
1170
|
+
* To JSON:
|
|
1171
|
+
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
1172
|
+
* * Lists not supported in keys
|
|
1173
|
+
* * Maps not supported in keys
|
|
1152
1174
|
*/
|
|
1153
|
-
|
|
1175
|
+
BasicConversions:0,"0":"BasicConversions",
|
|
1154
1176
|
/**
|
|
1177
|
+
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
1178
|
+
*
|
|
1179
|
+
* This is the format used by --script-data-file in cardano-cli
|
|
1180
|
+
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
1181
|
+
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
1182
|
+
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
1183
|
+
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
1184
|
+
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
1185
|
+
* Integer's value is a JSON number e.g. {"int": 100}
|
|
1186
|
+
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
1187
|
+
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
1188
|
+
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
1189
|
+
* respectively with their values being the plutus datum encoded via this same schema
|
|
1190
|
+
* e.g. {"map": [
|
|
1191
|
+
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
1192
|
+
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
1193
|
+
* ]}
|
|
1194
|
+
* From JSON:
|
|
1195
|
+
* * null/true/false/floats NOT supported
|
|
1196
|
+
* * the JSON must conform to a very specific schema
|
|
1197
|
+
* To JSON:
|
|
1198
|
+
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
1155
1199
|
*/
|
|
1156
|
-
|
|
1200
|
+
DetailedSchema:1,"1":"DetailedSchema", });
|
|
1157
1201
|
/**
|
|
1158
1202
|
*/
|
|
1159
|
-
module.exports.
|
|
1203
|
+
module.exports.NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
|
|
1160
1204
|
/**
|
|
1161
1205
|
*/
|
|
1162
|
-
module.exports.
|
|
1206
|
+
module.exports.TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"MetadataMap",MetadataList:1,"1":"MetadataList",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
|
|
1163
1207
|
/**
|
|
1164
1208
|
*/
|
|
1165
|
-
module.exports.
|
|
1209
|
+
module.exports.RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
|
|
1166
1210
|
/**
|
|
1167
|
-
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1168
1211
|
*/
|
|
1169
|
-
|
|
1212
|
+
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", });
|
|
1170
1213
|
/**
|
|
1171
|
-
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1172
1214
|
*/
|
|
1173
|
-
|
|
1215
|
+
module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
1174
1216
|
/**
|
|
1175
|
-
*
|
|
1217
|
+
* Used to choosed the schema for a script JSON string
|
|
1176
1218
|
*/
|
|
1177
|
-
|
|
1219
|
+
module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
|
|
1178
1220
|
/**
|
|
1179
|
-
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
1180
1221
|
*/
|
|
1181
|
-
|
|
1222
|
+
module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
1182
1223
|
/**
|
|
1183
1224
|
*/
|
|
1184
|
-
module.exports.
|
|
1225
|
+
module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
1185
1226
|
/**
|
|
1186
1227
|
*/
|
|
1187
|
-
module.exports.
|
|
1228
|
+
module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
1188
1229
|
/**
|
|
1189
1230
|
*/
|
|
1190
|
-
module.exports.
|
|
1231
|
+
module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
|
|
1191
1232
|
/**
|
|
1192
1233
|
*/
|
|
1193
|
-
module.exports.
|
|
1234
|
+
module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
|
|
1194
1235
|
/**
|
|
1195
1236
|
*/
|
|
1196
|
-
module.exports.
|
|
1237
|
+
module.exports.GovernanceActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidenceAction:3,"3":"NoConfidenceAction",UpdateCommitteeAction:4,"4":"UpdateCommitteeAction",NewConstitutionAction:5,"5":"NewConstitutionAction",InfoAction:6,"6":"InfoAction", });
|
|
1197
1238
|
/**
|
|
1198
1239
|
*/
|
|
1199
|
-
module.exports.
|
|
1240
|
+
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",GenesisKeyDelegation:5,"5":"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,"6":"MoveInstantaneousRewardsCert",CommitteeHotAuth:7,"7":"CommitteeHotAuth",CommitteeColdResign:8,"8":"CommitteeColdResign",DRepDeregistration:9,"9":"DRepDeregistration",DRepRegistration:10,"10":"DRepRegistration",DRepUpdate:11,"11":"DRepUpdate",StakeAndVoteDelegation:12,"12":"StakeAndVoteDelegation",StakeRegistrationAndDelegation:13,"13":"StakeRegistrationAndDelegation",StakeVoteRegistrationAndDelegation:14,"14":"StakeVoteRegistrationAndDelegation",VoteDelegation:15,"15":"VoteDelegation",VoteRegistrationAndDelegation:16,"16":"VoteRegistrationAndDelegation", });
|
|
1200
1241
|
/**
|
|
1201
1242
|
*/
|
|
1202
|
-
module.exports.
|
|
1243
|
+
module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
1203
1244
|
/**
|
|
1204
1245
|
*/
|
|
1205
|
-
module.exports.
|
|
1246
|
+
module.exports.AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
|
|
1206
1247
|
/**
|
|
1207
1248
|
*/
|
|
1208
|
-
module.exports.
|
|
1249
|
+
module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
1209
1250
|
/**
|
|
1210
1251
|
*/
|
|
1211
|
-
module.exports.
|
|
1252
|
+
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", });
|
|
1212
1253
|
/**
|
|
1213
1254
|
*/
|
|
1214
|
-
module.exports.
|
|
1255
|
+
module.exports.BlockEra = Object.freeze({ Byron:0,"0":"Byron",Shelley:1,"1":"Shelley",Allegra:2,"2":"Allegra",Mary:3,"3":"Mary",Alonzo:4,"4":"Alonzo",Babbage:5,"5":"Babbage",Conway:6,"6":"Conway",Unknown:7,"7":"Unknown", });
|
|
1215
1256
|
/**
|
|
1216
1257
|
*/
|
|
1217
|
-
module.exports.
|
|
1258
|
+
module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
|
|
1218
1259
|
/**
|
|
1219
|
-
* Each new language uses a different namespace for hashing its script
|
|
1220
|
-
* This is because you could have a language where the same bytes have different semantics
|
|
1221
|
-
* So this avoids scripts in different languages mapping to the same hash
|
|
1222
|
-
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
1223
1260
|
*/
|
|
1224
|
-
module.exports.
|
|
1261
|
+
module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
|
|
1225
1262
|
/**
|
|
1226
1263
|
*/
|
|
1227
|
-
module.exports.
|
|
1264
|
+
module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
|
|
1228
1265
|
/**
|
|
1229
1266
|
*/
|
|
1230
|
-
module.exports.
|
|
1267
|
+
module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
|
|
1231
1268
|
/**
|
|
1232
1269
|
*/
|
|
1233
|
-
module.exports.
|
|
1270
|
+
module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
|
|
1234
1271
|
/**
|
|
1272
|
+
* Each new language uses a different namespace for hashing its script
|
|
1273
|
+
* This is because you could have a language where the same bytes have different semantics
|
|
1274
|
+
* So this avoids scripts in different languages mapping to the same hash
|
|
1275
|
+
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
1235
1276
|
*/
|
|
1236
|
-
module.exports.
|
|
1277
|
+
module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
|
|
1237
1278
|
/**
|
|
1238
1279
|
*/
|
|
1239
|
-
module.exports.
|
|
1280
|
+
module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
|
|
1240
1281
|
/**
|
|
1282
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1241
1283
|
*/
|
|
1242
|
-
|
|
1284
|
+
LargestFirst:0,"0":"LargestFirst",
|
|
1243
1285
|
/**
|
|
1244
|
-
*
|
|
1245
|
-
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
1246
|
-
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
1247
|
-
*
|
|
1248
|
-
* All methods here have the following restrictions due to limitations on dependencies:
|
|
1249
|
-
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
1250
|
-
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
1251
|
-
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
1252
|
-
* on either side when tested so proceed with caution
|
|
1286
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1253
1287
|
*/
|
|
1254
|
-
|
|
1288
|
+
RandomImprove:1,"1":"RandomImprove",
|
|
1255
1289
|
/**
|
|
1256
|
-
*
|
|
1257
|
-
*
|
|
1258
|
-
* This is the format used by --script-data-value in cardano-cli
|
|
1259
|
-
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
1260
|
-
* From JSON:
|
|
1261
|
-
* * null/true/false/floats NOT supported
|
|
1262
|
-
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
1263
|
-
* To JSON:
|
|
1264
|
-
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
1265
|
-
* * Lists not supported in keys
|
|
1266
|
-
* * Maps not supported in keys
|
|
1290
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
1267
1291
|
*/
|
|
1268
|
-
|
|
1292
|
+
LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
1269
1293
|
/**
|
|
1270
|
-
*
|
|
1271
|
-
*
|
|
1272
|
-
* This is the format used by --script-data-file in cardano-cli
|
|
1273
|
-
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
1274
|
-
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
1275
|
-
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
1276
|
-
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
1277
|
-
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
1278
|
-
* Integer's value is a JSON number e.g. {"int": 100}
|
|
1279
|
-
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
1280
|
-
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
1281
|
-
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
1282
|
-
* respectively with their values being the plutus datum encoded via this same schema
|
|
1283
|
-
* e.g. {"map": [
|
|
1284
|
-
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
1285
|
-
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
1286
|
-
* ]}
|
|
1287
|
-
* From JSON:
|
|
1288
|
-
* * null/true/false/floats NOT supported
|
|
1289
|
-
* * the JSON must conform to a very specific schema
|
|
1290
|
-
* To JSON:
|
|
1291
|
-
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
1294
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
1292
1295
|
*/
|
|
1293
|
-
|
|
1296
|
+
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
1294
1297
|
|
|
1295
1298
|
const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1296
1299
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -39326,11 +39329,6 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
|
39326
39329
|
return addHeapObject(ret);
|
|
39327
39330
|
};
|
|
39328
39331
|
|
|
39329
|
-
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
39330
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
39331
|
-
return addHeapObject(ret);
|
|
39332
|
-
};
|
|
39333
|
-
|
|
39334
39332
|
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
39335
39333
|
const ret = getObject(arg0) === undefined;
|
|
39336
39334
|
return ret;
|
|
@@ -39376,6 +39374,11 @@ module.exports.__wbindgen_is_object = function(arg0) {
|
|
|
39376
39374
|
return ret;
|
|
39377
39375
|
};
|
|
39378
39376
|
|
|
39377
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
39378
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
39379
|
+
return addHeapObject(ret);
|
|
39380
|
+
};
|
|
39381
|
+
|
|
39379
39382
|
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
39380
39383
|
const ret = getObject(arg0);
|
|
39381
39384
|
return addHeapObject(ret);
|
|
Binary file
|
|
@@ -4,16 +4,16 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export function get_decodable_types(a: number): void;
|
|
5
5
|
export function decode_specific_type(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
6
6
|
export function get_possible_types_for_input(a: number, b: number, c: number): void;
|
|
7
|
-
export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
|
|
8
|
-
export function get_necessary_data_list_js(a: number, b: number, c: number): void;
|
|
9
|
-
export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
10
|
-
export function extract_hashes_from_transaction_js(a: number, b: number, c: number): void;
|
|
11
7
|
export function cbor_to_json(a: number, b: number, c: number): void;
|
|
8
|
+
export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
|
|
12
9
|
export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
|
|
13
10
|
export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
|
|
14
11
|
export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
|
|
15
12
|
export function execute_tx_scripts(a: number, b: number, c: number, d: number, e: number): void;
|
|
16
13
|
export function get_ref_script_bytes(a: number, b: number, c: number, d: number): void;
|
|
14
|
+
export function get_necessary_data_list_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
15
|
+
export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
16
|
+
export function extract_hashes_from_transaction_js(a: number, b: number, c: number): void;
|
|
17
17
|
export function __wbg_noconfidenceaction_free(a: number): void;
|
|
18
18
|
export function noconfidenceaction_to_bytes(a: number, b: number): void;
|
|
19
19
|
export function noconfidenceaction_from_bytes(a: number, b: number, c: number): void;
|
package/package.json
CHANGED