@cardananium/cquisitor-lib 0.1.0-beta.36 → 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.
|
@@ -334,116 +334,95 @@ export function check_block_or_tx_signatures(hex_str) {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
/**
|
|
337
|
-
* @param {string}
|
|
338
|
-
* @
|
|
339
|
-
* @returns {string}
|
|
337
|
+
* @param {string} hex
|
|
338
|
+
* @returns {any}
|
|
340
339
|
*/
|
|
341
|
-
export function
|
|
342
|
-
let deferred4_0;
|
|
343
|
-
let deferred4_1;
|
|
340
|
+
export function decode_plutus_program_uplc_json(hex) {
|
|
344
341
|
try {
|
|
345
342
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
346
|
-
const ptr0 = passStringToWasm0(
|
|
343
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
347
344
|
const len0 = WASM_VECTOR_LEN;
|
|
348
|
-
|
|
349
|
-
const len1 = WASM_VECTOR_LEN;
|
|
350
|
-
wasm.get_necessary_data_list_js(retptr, ptr0, len0, ptr1, len1);
|
|
345
|
+
wasm.decode_plutus_program_uplc_json(retptr, ptr0, len0);
|
|
351
346
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
352
347
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
353
348
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
var len3 = r1;
|
|
357
|
-
if (r3) {
|
|
358
|
-
ptr3 = 0; len3 = 0;
|
|
359
|
-
throw takeObject(r2);
|
|
349
|
+
if (r2) {
|
|
350
|
+
throw takeObject(r1);
|
|
360
351
|
}
|
|
361
|
-
|
|
362
|
-
deferred4_1 = len3;
|
|
363
|
-
return getStringFromWasm0(ptr3, len3);
|
|
352
|
+
return takeObject(r0);
|
|
364
353
|
} finally {
|
|
365
354
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
366
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
367
355
|
}
|
|
368
356
|
}
|
|
369
357
|
|
|
370
358
|
/**
|
|
371
|
-
* @param {string}
|
|
372
|
-
* @param {string} validation_context
|
|
359
|
+
* @param {string} hex
|
|
373
360
|
* @returns {string}
|
|
374
361
|
*/
|
|
375
|
-
export function
|
|
376
|
-
let
|
|
377
|
-
let
|
|
362
|
+
export function decode_plutus_program_pretty_uplc(hex) {
|
|
363
|
+
let deferred3_0;
|
|
364
|
+
let deferred3_1;
|
|
378
365
|
try {
|
|
379
366
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
380
|
-
const ptr0 = passStringToWasm0(
|
|
367
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
381
368
|
const len0 = WASM_VECTOR_LEN;
|
|
382
|
-
|
|
383
|
-
const len1 = WASM_VECTOR_LEN;
|
|
384
|
-
wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
|
|
369
|
+
wasm.decode_plutus_program_pretty_uplc(retptr, ptr0, len0);
|
|
385
370
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
386
371
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
387
372
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
388
373
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
389
|
-
var
|
|
390
|
-
var
|
|
374
|
+
var ptr2 = r0;
|
|
375
|
+
var len2 = r1;
|
|
391
376
|
if (r3) {
|
|
392
|
-
|
|
377
|
+
ptr2 = 0; len2 = 0;
|
|
393
378
|
throw takeObject(r2);
|
|
394
379
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
return getStringFromWasm0(
|
|
380
|
+
deferred3_0 = ptr2;
|
|
381
|
+
deferred3_1 = len2;
|
|
382
|
+
return getStringFromWasm0(ptr2, len2);
|
|
398
383
|
} finally {
|
|
399
384
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
400
|
-
wasm.__wbindgen_free(
|
|
385
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
401
386
|
}
|
|
402
387
|
}
|
|
403
388
|
|
|
404
389
|
/**
|
|
405
|
-
* WASM export: Extracts all script and datum hashes from a transaction
|
|
406
|
-
* Returns JSON string with ExtractedHashes structure
|
|
407
390
|
* @param {string} tx_hex
|
|
408
|
-
* @returns {string}
|
|
391
|
+
* @returns {(string)[]}
|
|
409
392
|
*/
|
|
410
|
-
export function
|
|
411
|
-
let deferred3_0;
|
|
412
|
-
let deferred3_1;
|
|
393
|
+
export function get_utxo_list_from_tx(tx_hex) {
|
|
413
394
|
try {
|
|
414
395
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
415
396
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
416
397
|
const len0 = WASM_VECTOR_LEN;
|
|
417
|
-
wasm.
|
|
398
|
+
wasm.get_utxo_list_from_tx(retptr, ptr0, len0);
|
|
418
399
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
419
400
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
420
401
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
421
402
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
422
|
-
var ptr2 = r0;
|
|
423
|
-
var len2 = r1;
|
|
424
403
|
if (r3) {
|
|
425
|
-
ptr2 = 0; len2 = 0;
|
|
426
404
|
throw takeObject(r2);
|
|
427
405
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
return
|
|
406
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
407
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
408
|
+
return v2;
|
|
431
409
|
} finally {
|
|
432
410
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
433
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
434
411
|
}
|
|
435
412
|
}
|
|
436
413
|
|
|
437
414
|
/**
|
|
438
|
-
* @param {string}
|
|
415
|
+
* @param {string} tx_hex
|
|
416
|
+
* @param {any} utxo_json
|
|
417
|
+
* @param {any} cost_models_json
|
|
439
418
|
* @returns {any}
|
|
440
419
|
*/
|
|
441
|
-
export function
|
|
420
|
+
export function execute_tx_scripts(tx_hex, utxo_json, cost_models_json) {
|
|
442
421
|
try {
|
|
443
422
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
444
|
-
const ptr0 = passStringToWasm0(
|
|
423
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
445
424
|
const len0 = WASM_VECTOR_LEN;
|
|
446
|
-
wasm.
|
|
425
|
+
wasm.execute_tx_scripts(retptr, ptr0, len0, addHeapObject(utxo_json), addHeapObject(cost_models_json));
|
|
447
426
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
448
427
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
449
428
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -457,17 +436,18 @@ export function decode_plutus_program_uplc_json(hex) {
|
|
|
457
436
|
}
|
|
458
437
|
|
|
459
438
|
/**
|
|
460
|
-
* @param {string}
|
|
439
|
+
* @param {string} tx_hex
|
|
440
|
+
* @param {number} output_index
|
|
461
441
|
* @returns {string}
|
|
462
442
|
*/
|
|
463
|
-
export function
|
|
443
|
+
export function get_ref_script_bytes(tx_hex, output_index) {
|
|
464
444
|
let deferred3_0;
|
|
465
445
|
let deferred3_1;
|
|
466
446
|
try {
|
|
467
447
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
468
|
-
const ptr0 = passStringToWasm0(
|
|
448
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
469
449
|
const len0 = WASM_VECTOR_LEN;
|
|
470
|
-
wasm.
|
|
450
|
+
wasm.get_ref_script_bytes(retptr, ptr0, len0, output_index);
|
|
471
451
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
472
452
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
473
453
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -489,66 +469,86 @@ export function decode_plutus_program_pretty_uplc(hex) {
|
|
|
489
469
|
|
|
490
470
|
/**
|
|
491
471
|
* @param {string} tx_hex
|
|
492
|
-
* @
|
|
472
|
+
* @param {string} network_type
|
|
473
|
+
* @returns {string}
|
|
493
474
|
*/
|
|
494
|
-
export function
|
|
475
|
+
export function get_necessary_data_list_js(tx_hex, network_type) {
|
|
476
|
+
let deferred4_0;
|
|
477
|
+
let deferred4_1;
|
|
495
478
|
try {
|
|
496
479
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
497
480
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
498
481
|
const len0 = WASM_VECTOR_LEN;
|
|
499
|
-
|
|
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);
|
|
500
485
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
501
486
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
502
487
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
503
488
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
489
|
+
var ptr3 = r0;
|
|
490
|
+
var len3 = r1;
|
|
504
491
|
if (r3) {
|
|
492
|
+
ptr3 = 0; len3 = 0;
|
|
505
493
|
throw takeObject(r2);
|
|
506
494
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
return
|
|
495
|
+
deferred4_0 = ptr3;
|
|
496
|
+
deferred4_1 = len3;
|
|
497
|
+
return getStringFromWasm0(ptr3, len3);
|
|
510
498
|
} finally {
|
|
511
499
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
500
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
512
501
|
}
|
|
513
502
|
}
|
|
514
503
|
|
|
515
504
|
/**
|
|
516
505
|
* @param {string} tx_hex
|
|
517
|
-
* @param {
|
|
518
|
-
* @
|
|
519
|
-
* @returns {any}
|
|
506
|
+
* @param {string} validation_context
|
|
507
|
+
* @returns {string}
|
|
520
508
|
*/
|
|
521
|
-
export function
|
|
509
|
+
export function validate_transaction_js(tx_hex, validation_context) {
|
|
510
|
+
let deferred4_0;
|
|
511
|
+
let deferred4_1;
|
|
522
512
|
try {
|
|
523
513
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
524
514
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
525
515
|
const len0 = WASM_VECTOR_LEN;
|
|
526
|
-
|
|
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);
|
|
527
519
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
528
520
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
529
521
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
530
|
-
|
|
531
|
-
|
|
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);
|
|
532
528
|
}
|
|
533
|
-
|
|
529
|
+
deferred4_0 = ptr3;
|
|
530
|
+
deferred4_1 = len3;
|
|
531
|
+
return getStringFromWasm0(ptr3, len3);
|
|
534
532
|
} finally {
|
|
535
533
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
534
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
536
535
|
}
|
|
537
536
|
}
|
|
538
537
|
|
|
539
538
|
/**
|
|
539
|
+
* WASM export: Extracts all script and datum hashes from a transaction
|
|
540
|
+
* Returns JSON string with ExtractedHashes structure
|
|
540
541
|
* @param {string} tx_hex
|
|
541
|
-
* @param {number} output_index
|
|
542
542
|
* @returns {string}
|
|
543
543
|
*/
|
|
544
|
-
export function
|
|
544
|
+
export function extract_hashes_from_transaction_js(tx_hex) {
|
|
545
545
|
let deferred3_0;
|
|
546
546
|
let deferred3_1;
|
|
547
547
|
try {
|
|
548
548
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
549
549
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
550
550
|
const len0 = WASM_VECTOR_LEN;
|
|
551
|
-
wasm.
|
|
551
|
+
wasm.extract_hashes_from_transaction_js(retptr, ptr0, len0);
|
|
552
552
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
553
553
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
554
554
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -1154,72 +1154,10 @@ function handleError(f, args) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
/**
|
|
1156
1156
|
*/
|
|
1157
|
-
export const CoinSelectionStrategyCIP2 = Object.freeze({
|
|
1158
|
-
/**
|
|
1159
|
-
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1160
|
-
*/
|
|
1161
|
-
LargestFirst:0,"0":"LargestFirst",
|
|
1162
|
-
/**
|
|
1163
|
-
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1164
|
-
*/
|
|
1165
|
-
RandomImprove:1,"1":"RandomImprove",
|
|
1166
|
-
/**
|
|
1167
|
-
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
1168
|
-
*/
|
|
1169
|
-
LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
1170
|
-
/**
|
|
1171
|
-
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
1172
|
-
*/
|
|
1173
|
-
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
1174
|
-
/**
|
|
1175
|
-
* Each new language uses a different namespace for hashing its script
|
|
1176
|
-
* This is because you could have a language where the same bytes have different semantics
|
|
1177
|
-
* So this avoids scripts in different languages mapping to the same hash
|
|
1178
|
-
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
1179
|
-
*/
|
|
1180
|
-
export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
|
|
1181
|
-
/**
|
|
1182
|
-
*/
|
|
1183
|
-
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", });
|
|
1184
|
-
/**
|
|
1185
|
-
*/
|
|
1186
|
-
export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
|
|
1187
|
-
/**
|
|
1188
|
-
*/
|
|
1189
|
-
export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
1190
|
-
/**
|
|
1191
|
-
*/
|
|
1192
|
-
export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
|
|
1193
|
-
/**
|
|
1194
|
-
*/
|
|
1195
|
-
export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
1196
|
-
/**
|
|
1197
|
-
*/
|
|
1198
|
-
export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
1199
|
-
/**
|
|
1200
|
-
*/
|
|
1201
|
-
export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
1202
|
-
/**
|
|
1203
|
-
*/
|
|
1204
|
-
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", });
|
|
1205
|
-
/**
|
|
1206
|
-
*/
|
|
1207
|
-
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", });
|
|
1208
|
-
/**
|
|
1209
|
-
*/
|
|
1210
1157
|
export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
1211
1158
|
/**
|
|
1212
1159
|
*/
|
|
1213
|
-
export const
|
|
1214
|
-
/**
|
|
1215
|
-
*/
|
|
1216
|
-
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", });
|
|
1217
|
-
/**
|
|
1218
|
-
*/
|
|
1219
|
-
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", });
|
|
1220
|
-
/**
|
|
1221
|
-
*/
|
|
1222
|
-
export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
|
|
1160
|
+
export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
|
|
1223
1161
|
/**
|
|
1224
1162
|
* JSON <-> PlutusData conversion schemas.
|
|
1225
1163
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
@@ -1273,32 +1211,94 @@ BasicConversions:0,"0":"BasicConversions",
|
|
|
1273
1211
|
DetailedSchema:1,"1":"DetailedSchema", });
|
|
1274
1212
|
/**
|
|
1275
1213
|
*/
|
|
1276
|
-
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", });
|
|
1277
1215
|
/**
|
|
1278
1216
|
*/
|
|
1279
|
-
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", });
|
|
1280
1218
|
/**
|
|
1281
1219
|
*/
|
|
1282
|
-
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", });
|
|
1283
1221
|
/**
|
|
1284
1222
|
*/
|
|
1285
1223
|
export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
|
|
1286
1224
|
/**
|
|
1287
1225
|
*/
|
|
1288
|
-
export const
|
|
1226
|
+
export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
1289
1227
|
/**
|
|
1228
|
+
* Used to choosed the schema for a script JSON string
|
|
1290
1229
|
*/
|
|
1291
|
-
export const
|
|
1230
|
+
export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
|
|
1292
1231
|
/**
|
|
1293
1232
|
*/
|
|
1294
|
-
export const
|
|
1233
|
+
export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
1234
|
+
/**
|
|
1235
|
+
*/
|
|
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", });
|
|
1237
|
+
/**
|
|
1238
|
+
*/
|
|
1239
|
+
export const CoinSelectionStrategyCIP2 = Object.freeze({
|
|
1240
|
+
/**
|
|
1241
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1242
|
+
*/
|
|
1243
|
+
LargestFirst:0,"0":"LargestFirst",
|
|
1244
|
+
/**
|
|
1245
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1246
|
+
*/
|
|
1247
|
+
RandomImprove:1,"1":"RandomImprove",
|
|
1248
|
+
/**
|
|
1249
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
1250
|
+
*/
|
|
1251
|
+
LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
1252
|
+
/**
|
|
1253
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
1254
|
+
*/
|
|
1255
|
+
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
1256
|
+
/**
|
|
1257
|
+
*/
|
|
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", });
|
|
1295
1259
|
/**
|
|
1296
1260
|
*/
|
|
1297
1261
|
export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
|
|
1298
1262
|
/**
|
|
1299
|
-
* Used to choosed the schema for a script JSON string
|
|
1300
1263
|
*/
|
|
1301
|
-
export const
|
|
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", });
|
|
1278
|
+
/**
|
|
1279
|
+
*/
|
|
1280
|
+
export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
1281
|
+
/**
|
|
1282
|
+
*/
|
|
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", });
|
|
1284
|
+
/**
|
|
1285
|
+
*/
|
|
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", });
|
|
1296
|
+
/**
|
|
1297
|
+
*/
|
|
1298
|
+
export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
|
|
1299
|
+
/**
|
|
1300
|
+
*/
|
|
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", });
|
|
1302
1302
|
|
|
1303
1303
|
const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1304
1304
|
? { register: () => {}, unregister: () => {} }
|
|
Binary file
|
|
@@ -6,14 +6,14 @@ export function decode_specific_type(a: number, b: number, c: number, d: number,
|
|
|
6
6
|
export function get_possible_types_for_input(a: number, b: number, c: number): void;
|
|
7
7
|
export function cbor_to_json(a: number, b: number, c: number): void;
|
|
8
8
|
export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
|
|
9
|
-
export function get_necessary_data_list_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
10
|
-
export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
11
|
-
export function extract_hashes_from_transaction_js(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.js
CHANGED
|
@@ -329,116 +329,95 @@ module.exports.check_block_or_tx_signatures = function(hex_str) {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
/**
|
|
332
|
-
* @param {string}
|
|
333
|
-
* @
|
|
334
|
-
* @returns {string}
|
|
332
|
+
* @param {string} hex
|
|
333
|
+
* @returns {any}
|
|
335
334
|
*/
|
|
336
|
-
module.exports.
|
|
337
|
-
let deferred4_0;
|
|
338
|
-
let deferred4_1;
|
|
335
|
+
module.exports.decode_plutus_program_uplc_json = function(hex) {
|
|
339
336
|
try {
|
|
340
337
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
341
|
-
const ptr0 = passStringToWasm0(
|
|
338
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
342
339
|
const len0 = WASM_VECTOR_LEN;
|
|
343
|
-
|
|
344
|
-
const len1 = WASM_VECTOR_LEN;
|
|
345
|
-
wasm.get_necessary_data_list_js(retptr, ptr0, len0, ptr1, len1);
|
|
340
|
+
wasm.decode_plutus_program_uplc_json(retptr, ptr0, len0);
|
|
346
341
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
347
342
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
348
343
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
var len3 = r1;
|
|
352
|
-
if (r3) {
|
|
353
|
-
ptr3 = 0; len3 = 0;
|
|
354
|
-
throw takeObject(r2);
|
|
344
|
+
if (r2) {
|
|
345
|
+
throw takeObject(r1);
|
|
355
346
|
}
|
|
356
|
-
|
|
357
|
-
deferred4_1 = len3;
|
|
358
|
-
return getStringFromWasm0(ptr3, len3);
|
|
347
|
+
return takeObject(r0);
|
|
359
348
|
} finally {
|
|
360
349
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
361
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
362
350
|
}
|
|
363
351
|
};
|
|
364
352
|
|
|
365
353
|
/**
|
|
366
|
-
* @param {string}
|
|
367
|
-
* @param {string} validation_context
|
|
354
|
+
* @param {string} hex
|
|
368
355
|
* @returns {string}
|
|
369
356
|
*/
|
|
370
|
-
module.exports.
|
|
371
|
-
let
|
|
372
|
-
let
|
|
357
|
+
module.exports.decode_plutus_program_pretty_uplc = function(hex) {
|
|
358
|
+
let deferred3_0;
|
|
359
|
+
let deferred3_1;
|
|
373
360
|
try {
|
|
374
361
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
375
|
-
const ptr0 = passStringToWasm0(
|
|
362
|
+
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
376
363
|
const len0 = WASM_VECTOR_LEN;
|
|
377
|
-
|
|
378
|
-
const len1 = WASM_VECTOR_LEN;
|
|
379
|
-
wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
|
|
364
|
+
wasm.decode_plutus_program_pretty_uplc(retptr, ptr0, len0);
|
|
380
365
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
381
366
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
382
367
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
383
368
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
384
|
-
var
|
|
385
|
-
var
|
|
369
|
+
var ptr2 = r0;
|
|
370
|
+
var len2 = r1;
|
|
386
371
|
if (r3) {
|
|
387
|
-
|
|
372
|
+
ptr2 = 0; len2 = 0;
|
|
388
373
|
throw takeObject(r2);
|
|
389
374
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
return getStringFromWasm0(
|
|
375
|
+
deferred3_0 = ptr2;
|
|
376
|
+
deferred3_1 = len2;
|
|
377
|
+
return getStringFromWasm0(ptr2, len2);
|
|
393
378
|
} finally {
|
|
394
379
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
395
|
-
wasm.__wbindgen_free(
|
|
380
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
396
381
|
}
|
|
397
382
|
};
|
|
398
383
|
|
|
399
384
|
/**
|
|
400
|
-
* WASM export: Extracts all script and datum hashes from a transaction
|
|
401
|
-
* Returns JSON string with ExtractedHashes structure
|
|
402
385
|
* @param {string} tx_hex
|
|
403
|
-
* @returns {string}
|
|
386
|
+
* @returns {(string)[]}
|
|
404
387
|
*/
|
|
405
|
-
module.exports.
|
|
406
|
-
let deferred3_0;
|
|
407
|
-
let deferred3_1;
|
|
388
|
+
module.exports.get_utxo_list_from_tx = function(tx_hex) {
|
|
408
389
|
try {
|
|
409
390
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
410
391
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
411
392
|
const len0 = WASM_VECTOR_LEN;
|
|
412
|
-
wasm.
|
|
393
|
+
wasm.get_utxo_list_from_tx(retptr, ptr0, len0);
|
|
413
394
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
414
395
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
415
396
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
416
397
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
417
|
-
var ptr2 = r0;
|
|
418
|
-
var len2 = r1;
|
|
419
398
|
if (r3) {
|
|
420
|
-
ptr2 = 0; len2 = 0;
|
|
421
399
|
throw takeObject(r2);
|
|
422
400
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
return
|
|
401
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
402
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
403
|
+
return v2;
|
|
426
404
|
} finally {
|
|
427
405
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
428
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
429
406
|
}
|
|
430
407
|
};
|
|
431
408
|
|
|
432
409
|
/**
|
|
433
|
-
* @param {string}
|
|
410
|
+
* @param {string} tx_hex
|
|
411
|
+
* @param {any} utxo_json
|
|
412
|
+
* @param {any} cost_models_json
|
|
434
413
|
* @returns {any}
|
|
435
414
|
*/
|
|
436
|
-
module.exports.
|
|
415
|
+
module.exports.execute_tx_scripts = function(tx_hex, utxo_json, cost_models_json) {
|
|
437
416
|
try {
|
|
438
417
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
439
|
-
const ptr0 = passStringToWasm0(
|
|
418
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
440
419
|
const len0 = WASM_VECTOR_LEN;
|
|
441
|
-
wasm.
|
|
420
|
+
wasm.execute_tx_scripts(retptr, ptr0, len0, addHeapObject(utxo_json), addHeapObject(cost_models_json));
|
|
442
421
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
443
422
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
444
423
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -452,17 +431,18 @@ module.exports.decode_plutus_program_uplc_json = function(hex) {
|
|
|
452
431
|
};
|
|
453
432
|
|
|
454
433
|
/**
|
|
455
|
-
* @param {string}
|
|
434
|
+
* @param {string} tx_hex
|
|
435
|
+
* @param {number} output_index
|
|
456
436
|
* @returns {string}
|
|
457
437
|
*/
|
|
458
|
-
module.exports.
|
|
438
|
+
module.exports.get_ref_script_bytes = function(tx_hex, output_index) {
|
|
459
439
|
let deferred3_0;
|
|
460
440
|
let deferred3_1;
|
|
461
441
|
try {
|
|
462
442
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
463
|
-
const ptr0 = passStringToWasm0(
|
|
443
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
464
444
|
const len0 = WASM_VECTOR_LEN;
|
|
465
|
-
wasm.
|
|
445
|
+
wasm.get_ref_script_bytes(retptr, ptr0, len0, output_index);
|
|
466
446
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
467
447
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
468
448
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -484,66 +464,86 @@ module.exports.decode_plutus_program_pretty_uplc = function(hex) {
|
|
|
484
464
|
|
|
485
465
|
/**
|
|
486
466
|
* @param {string} tx_hex
|
|
487
|
-
* @
|
|
467
|
+
* @param {string} network_type
|
|
468
|
+
* @returns {string}
|
|
488
469
|
*/
|
|
489
|
-
module.exports.
|
|
470
|
+
module.exports.get_necessary_data_list_js = function(tx_hex, network_type) {
|
|
471
|
+
let deferred4_0;
|
|
472
|
+
let deferred4_1;
|
|
490
473
|
try {
|
|
491
474
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
492
475
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
493
476
|
const len0 = WASM_VECTOR_LEN;
|
|
494
|
-
|
|
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);
|
|
495
480
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
496
481
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
497
482
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
498
483
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
484
|
+
var ptr3 = r0;
|
|
485
|
+
var len3 = r1;
|
|
499
486
|
if (r3) {
|
|
487
|
+
ptr3 = 0; len3 = 0;
|
|
500
488
|
throw takeObject(r2);
|
|
501
489
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return
|
|
490
|
+
deferred4_0 = ptr3;
|
|
491
|
+
deferred4_1 = len3;
|
|
492
|
+
return getStringFromWasm0(ptr3, len3);
|
|
505
493
|
} finally {
|
|
506
494
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
495
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
507
496
|
}
|
|
508
497
|
};
|
|
509
498
|
|
|
510
499
|
/**
|
|
511
500
|
* @param {string} tx_hex
|
|
512
|
-
* @param {
|
|
513
|
-
* @
|
|
514
|
-
* @returns {any}
|
|
501
|
+
* @param {string} validation_context
|
|
502
|
+
* @returns {string}
|
|
515
503
|
*/
|
|
516
|
-
module.exports.
|
|
504
|
+
module.exports.validate_transaction_js = function(tx_hex, validation_context) {
|
|
505
|
+
let deferred4_0;
|
|
506
|
+
let deferred4_1;
|
|
517
507
|
try {
|
|
518
508
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
519
509
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
520
510
|
const len0 = WASM_VECTOR_LEN;
|
|
521
|
-
|
|
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);
|
|
522
514
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
523
515
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
524
516
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
525
|
-
|
|
526
|
-
|
|
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);
|
|
527
523
|
}
|
|
528
|
-
|
|
524
|
+
deferred4_0 = ptr3;
|
|
525
|
+
deferred4_1 = len3;
|
|
526
|
+
return getStringFromWasm0(ptr3, len3);
|
|
529
527
|
} finally {
|
|
530
528
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
529
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
531
530
|
}
|
|
532
531
|
};
|
|
533
532
|
|
|
534
533
|
/**
|
|
534
|
+
* WASM export: Extracts all script and datum hashes from a transaction
|
|
535
|
+
* Returns JSON string with ExtractedHashes structure
|
|
535
536
|
* @param {string} tx_hex
|
|
536
|
-
* @param {number} output_index
|
|
537
537
|
* @returns {string}
|
|
538
538
|
*/
|
|
539
|
-
module.exports.
|
|
539
|
+
module.exports.extract_hashes_from_transaction_js = function(tx_hex) {
|
|
540
540
|
let deferred3_0;
|
|
541
541
|
let deferred3_1;
|
|
542
542
|
try {
|
|
543
543
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
544
544
|
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
545
545
|
const len0 = WASM_VECTOR_LEN;
|
|
546
|
-
wasm.
|
|
546
|
+
wasm.extract_hashes_from_transaction_js(retptr, ptr0, len0);
|
|
547
547
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
548
548
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
549
549
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -1148,9 +1148,6 @@ function handleError(f, args) {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
/**
|
|
1151
|
-
*/
|
|
1152
|
-
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", });
|
|
1153
|
-
/**
|
|
1154
1151
|
* JSON <-> PlutusData conversion schemas.
|
|
1155
1152
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
1156
1153
|
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
@@ -1203,84 +1200,74 @@ BasicConversions:0,"0":"BasicConversions",
|
|
|
1203
1200
|
DetailedSchema:1,"1":"DetailedSchema", });
|
|
1204
1201
|
/**
|
|
1205
1202
|
*/
|
|
1206
|
-
module.exports.
|
|
1207
|
-
/**
|
|
1208
|
-
*/
|
|
1209
|
-
module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
|
|
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", });
|
|
1210
1204
|
/**
|
|
1211
1205
|
*/
|
|
1212
|
-
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", });
|
|
1213
1207
|
/**
|
|
1214
1208
|
*/
|
|
1215
|
-
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", });
|
|
1216
1210
|
/**
|
|
1217
1211
|
*/
|
|
1218
|
-
module.exports.
|
|
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", });
|
|
1219
1213
|
/**
|
|
1220
1214
|
*/
|
|
1221
|
-
module.exports.
|
|
1215
|
+
module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
1222
1216
|
/**
|
|
1217
|
+
* Used to choosed the schema for a script JSON string
|
|
1223
1218
|
*/
|
|
1224
|
-
module.exports.
|
|
1219
|
+
module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
|
|
1225
1220
|
/**
|
|
1226
1221
|
*/
|
|
1227
|
-
module.exports.
|
|
1222
|
+
module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
1228
1223
|
/**
|
|
1229
1224
|
*/
|
|
1230
|
-
module.exports.
|
|
1225
|
+
module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
1231
1226
|
/**
|
|
1232
1227
|
*/
|
|
1233
|
-
module.exports.
|
|
1228
|
+
module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
1234
1229
|
/**
|
|
1235
1230
|
*/
|
|
1236
|
-
module.exports.
|
|
1231
|
+
module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
|
|
1237
1232
|
/**
|
|
1238
1233
|
*/
|
|
1239
|
-
module.exports.
|
|
1234
|
+
module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
|
|
1240
1235
|
/**
|
|
1241
1236
|
*/
|
|
1242
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", });
|
|
1243
1238
|
/**
|
|
1244
1239
|
*/
|
|
1245
|
-
module.exports.
|
|
1246
|
-
/**
|
|
1247
|
-
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1248
|
-
*/
|
|
1249
|
-
LargestFirst:0,"0":"LargestFirst",
|
|
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", });
|
|
1250
1241
|
/**
|
|
1251
|
-
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1252
1242
|
*/
|
|
1253
|
-
|
|
1243
|
+
module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
1254
1244
|
/**
|
|
1255
|
-
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
1256
1245
|
*/
|
|
1257
|
-
|
|
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", });
|
|
1258
1247
|
/**
|
|
1259
|
-
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
1260
1248
|
*/
|
|
1261
|
-
|
|
1249
|
+
module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
1262
1250
|
/**
|
|
1263
1251
|
*/
|
|
1264
|
-
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", });
|
|
1265
1253
|
/**
|
|
1266
1254
|
*/
|
|
1267
|
-
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", });
|
|
1268
1256
|
/**
|
|
1269
1257
|
*/
|
|
1270
|
-
module.exports.
|
|
1258
|
+
module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
|
|
1271
1259
|
/**
|
|
1272
1260
|
*/
|
|
1273
|
-
module.exports.
|
|
1261
|
+
module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
|
|
1274
1262
|
/**
|
|
1275
|
-
* Used to choosed the schema for a script JSON string
|
|
1276
1263
|
*/
|
|
1277
|
-
module.exports.
|
|
1264
|
+
module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
|
|
1278
1265
|
/**
|
|
1279
1266
|
*/
|
|
1280
|
-
module.exports.
|
|
1267
|
+
module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
|
|
1281
1268
|
/**
|
|
1282
1269
|
*/
|
|
1283
|
-
module.exports.
|
|
1270
|
+
module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
|
|
1284
1271
|
/**
|
|
1285
1272
|
* Each new language uses a different namespace for hashing its script
|
|
1286
1273
|
* This is because you could have a language where the same bytes have different semantics
|
|
@@ -1290,10 +1277,23 @@ module.exports.TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"Met
|
|
|
1290
1277
|
module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
|
|
1291
1278
|
/**
|
|
1292
1279
|
*/
|
|
1293
|
-
module.exports.
|
|
1280
|
+
module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
|
|
1281
|
+
/**
|
|
1282
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1283
|
+
*/
|
|
1284
|
+
LargestFirst:0,"0":"LargestFirst",
|
|
1294
1285
|
/**
|
|
1286
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
1295
1287
|
*/
|
|
1296
|
-
|
|
1288
|
+
RandomImprove:1,"1":"RandomImprove",
|
|
1289
|
+
/**
|
|
1290
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
1291
|
+
*/
|
|
1292
|
+
LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
1293
|
+
/**
|
|
1294
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
1295
|
+
*/
|
|
1296
|
+
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
1297
1297
|
|
|
1298
1298
|
const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1299
1299
|
? { register: () => {}, unregister: () => {} }
|
|
Binary file
|
|
@@ -6,14 +6,14 @@ export function decode_specific_type(a: number, b: number, c: number, d: number,
|
|
|
6
6
|
export function get_possible_types_for_input(a: number, b: number, c: number): void;
|
|
7
7
|
export function cbor_to_json(a: number, b: number, c: number): void;
|
|
8
8
|
export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
|
|
9
|
-
export function get_necessary_data_list_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
10
|
-
export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
|
|
11
|
-
export function extract_hashes_from_transaction_js(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