@cardananium/cquisitor-lib 0.1.0-beta.33 → 0.1.0-beta.35

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.
@@ -371,6 +371,61 @@ module.exports.validate_transaction_js = function(tx_hex, validation_context) {
371
371
  }
372
372
  };
373
373
 
374
+ /**
375
+ * WASM export: Extracts all script and datum hashes from a transaction
376
+ * Returns JSON string with ExtractedHashes structure
377
+ * @param {string} tx_hex
378
+ * @returns {string}
379
+ */
380
+ module.exports.extract_hashes_from_transaction_js = function(tx_hex) {
381
+ let deferred3_0;
382
+ let deferred3_1;
383
+ try {
384
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
385
+ const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
386
+ const len0 = WASM_VECTOR_LEN;
387
+ wasm.extract_hashes_from_transaction_js(retptr, ptr0, len0);
388
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
389
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
390
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
391
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
392
+ var ptr2 = r0;
393
+ var len2 = r1;
394
+ if (r3) {
395
+ ptr2 = 0; len2 = 0;
396
+ throw takeObject(r2);
397
+ }
398
+ deferred3_0 = ptr2;
399
+ deferred3_1 = len2;
400
+ return getStringFromWasm0(ptr2, len2);
401
+ } finally {
402
+ wasm.__wbindgen_add_to_stack_pointer(16);
403
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
404
+ }
405
+ };
406
+
407
+ /**
408
+ * @param {string} cbor_hex
409
+ * @returns {any}
410
+ */
411
+ module.exports.cbor_to_json = function(cbor_hex) {
412
+ try {
413
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
414
+ const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
415
+ const len0 = WASM_VECTOR_LEN;
416
+ wasm.cbor_to_json(retptr, ptr0, len0);
417
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
418
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
419
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
420
+ if (r2) {
421
+ throw takeObject(r1);
422
+ }
423
+ return takeObject(r0);
424
+ } finally {
425
+ wasm.__wbindgen_add_to_stack_pointer(16);
426
+ }
427
+ };
428
+
374
429
  /**
375
430
  * @param {string} hex
376
431
  * @returns {any}
@@ -473,28 +528,6 @@ module.exports.execute_tx_scripts = function(tx_hex, utxo_json, cost_models_json
473
528
  }
474
529
  };
475
530
 
476
- /**
477
- * @param {string} cbor_hex
478
- * @returns {any}
479
- */
480
- module.exports.cbor_to_json = function(cbor_hex) {
481
- try {
482
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
483
- const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
484
- const len0 = WASM_VECTOR_LEN;
485
- wasm.cbor_to_json(retptr, ptr0, len0);
486
- var r0 = getInt32Memory0()[retptr / 4 + 0];
487
- var r1 = getInt32Memory0()[retptr / 4 + 1];
488
- var r2 = getInt32Memory0()[retptr / 4 + 2];
489
- if (r2) {
490
- throw takeObject(r1);
491
- }
492
- return takeObject(r0);
493
- } finally {
494
- wasm.__wbindgen_add_to_stack_pointer(16);
495
- }
496
- };
497
-
498
531
  /**
499
532
  * @param {string} tx_hex
500
533
  * @param {number} output_index
@@ -1112,36 +1145,21 @@ function handleError(f, args) {
1112
1145
  }
1113
1146
  }
1114
1147
  /**
1148
+ * Used to choosed the schema for a script JSON string
1115
1149
  */
1116
- 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", });
1117
- /**
1118
- */
1119
- module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1120
- /**
1121
- * Each new language uses a different namespace for hashing its script
1122
- * This is because you could have a language where the same bytes have different semantics
1123
- * So this avoids scripts in different languages mapping to the same hash
1124
- * Note that the enum value here is different than the enum value for deciding the cost model of a script
1125
- */
1126
- module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1127
- /**
1128
- */
1129
- module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1130
- /**
1131
- */
1132
- module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1150
+ module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1133
1151
  /**
1134
1152
  */
1135
1153
  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", });
1136
1154
  /**
1137
1155
  */
1138
- module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1156
+ 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", });
1139
1157
  /**
1140
1158
  */
1141
- module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1159
+ 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", });
1142
1160
  /**
1143
1161
  */
1144
- module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1162
+ 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", });
1145
1163
  /**
1146
1164
  */
1147
1165
  module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
@@ -1163,14 +1181,28 @@ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1163
1181
  RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1164
1182
  /**
1165
1183
  */
1166
- 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", });
1184
+ 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", });
1167
1185
  /**
1168
- * Used to choosed the schema for a script JSON string
1169
1186
  */
1170
- module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1187
+ module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1171
1188
  /**
1172
1189
  */
1173
- module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1190
+ module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1191
+ /**
1192
+ */
1193
+ module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1194
+ /**
1195
+ */
1196
+ module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1197
+ /**
1198
+ */
1199
+ 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", });
1200
+ /**
1201
+ */
1202
+ 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", });
1203
+ /**
1204
+ */
1205
+ 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", });
1174
1206
  /**
1175
1207
  */
1176
1208
  module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
@@ -1179,7 +1211,35 @@ module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConve
1179
1211
  module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1180
1212
  /**
1181
1213
  */
1182
- 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", });
1214
+ module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1215
+ /**
1216
+ */
1217
+ 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", });
1218
+ /**
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
+ */
1224
+ module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1225
+ /**
1226
+ */
1227
+ module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1228
+ /**
1229
+ */
1230
+ module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1231
+ /**
1232
+ */
1233
+ module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1234
+ /**
1235
+ */
1236
+ module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1237
+ /**
1238
+ */
1239
+ module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1240
+ /**
1241
+ */
1242
+ module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1183
1243
  /**
1184
1244
  * JSON <-> PlutusData conversion schemas.
1185
1245
  * Follows ScriptDataJsonSchema in cardano-cli defined at:
@@ -1231,33 +1291,6 @@ BasicConversions:0,"0":"BasicConversions",
1231
1291
  * * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
1232
1292
  */
1233
1293
  DetailedSchema:1,"1":"DetailedSchema", });
1234
- /**
1235
- */
1236
- module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1237
- /**
1238
- */
1239
- 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", });
1240
- /**
1241
- */
1242
- module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1243
- /**
1244
- */
1245
- 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", });
1246
- /**
1247
- */
1248
- 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", });
1249
- /**
1250
- */
1251
- 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", });
1252
- /**
1253
- */
1254
- module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1255
- /**
1256
- */
1257
- module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1258
- /**
1259
- */
1260
- 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", });
1261
1294
 
1262
1295
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1263
1296
  ? { register: () => {}, unregister: () => {} }
@@ -39293,6 +39326,11 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
39293
39326
  return addHeapObject(ret);
39294
39327
  };
39295
39328
 
39329
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
39330
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
39331
+ return addHeapObject(ret);
39332
+ };
39333
+
39296
39334
  module.exports.__wbindgen_is_undefined = function(arg0) {
39297
39335
  const ret = getObject(arg0) === undefined;
39298
39336
  return ret;
@@ -39338,11 +39376,6 @@ module.exports.__wbindgen_is_object = function(arg0) {
39338
39376
  return ret;
39339
39377
  };
39340
39378
 
39341
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
39342
- const ret = new Error(getStringFromWasm0(arg0, arg1));
39343
- return addHeapObject(ret);
39344
- };
39345
-
39346
39379
  module.exports.__wbindgen_object_clone_ref = function(arg0) {
39347
39380
  const ret = getObject(arg0);
39348
39381
  return addHeapObject(ret);
Binary file
@@ -7,11 +7,12 @@ export function get_possible_types_for_input(a: number, b: number, c: number): v
7
7
  export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
8
8
  export function get_necessary_data_list_js(a: number, b: number, c: number): void;
9
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
+ export function cbor_to_json(a: number, b: number, c: number): void;
10
12
  export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
11
13
  export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
12
14
  export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
13
15
  export function execute_tx_scripts(a: number, b: number, c: number, d: number, e: number): void;
14
- export function cbor_to_json(a: number, b: number, c: number): void;
15
16
  export function get_ref_script_bytes(a: number, b: number, c: number, d: number): void;
16
17
  export function __wbg_noconfidenceaction_free(a: number): void;
17
18
  export function noconfidenceaction_to_bytes(a: number, b: number): void;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Evgenii Lisitskii <evgeniilisitskii@gmail.com>"
5
5
  ],
6
6
  "description": "Cardano transaction validation library",
7
- "version": "0.1.0-beta.33",
7
+ "version": "0.1.0-beta.35",
8
8
  "license": "Apache-2.0",
9
9
  "files": [
10
10
  "node/cquisitor_lib_bg.wasm",