@cardananium/cquisitor-lib 0.1.0-beta.32 → 0.1.0-beta.34

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,39 @@ 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
+
374
407
  /**
375
408
  * @param {string} hex
376
409
  * @returns {any}
@@ -473,28 +506,6 @@ module.exports.execute_tx_scripts = function(tx_hex, utxo_json, cost_models_json
473
506
  }
474
507
  };
475
508
 
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
509
  /**
499
510
  * @param {string} tx_hex
500
511
  * @param {number} output_index
@@ -527,6 +538,28 @@ module.exports.get_ref_script_bytes = function(tx_hex, output_index) {
527
538
  }
528
539
  };
529
540
 
541
+ /**
542
+ * @param {string} cbor_hex
543
+ * @returns {any}
544
+ */
545
+ module.exports.cbor_to_json = function(cbor_hex) {
546
+ try {
547
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
548
+ const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
549
+ const len0 = WASM_VECTOR_LEN;
550
+ wasm.cbor_to_json(retptr, ptr0, len0);
551
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
552
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
553
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
554
+ if (r2) {
555
+ throw takeObject(r1);
556
+ }
557
+ return takeObject(r0);
558
+ } finally {
559
+ wasm.__wbindgen_add_to_stack_pointer(16);
560
+ }
561
+ };
562
+
530
563
  function getArrayU8FromWasm0(ptr, len) {
531
564
  ptr = ptr >>> 0;
532
565
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
@@ -1113,26 +1146,51 @@ function handleError(f, args) {
1113
1146
  }
1114
1147
  /**
1115
1148
  */
1116
- module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1149
+ module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1117
1150
  /**
1118
1151
  */
1119
- 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", });
1152
+ 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", });
1120
1153
  /**
1121
1154
  */
1122
- 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", });
1155
+ 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", });
1123
1156
  /**
1124
1157
  */
1125
- 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", });
1158
+ 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", });
1126
1159
  /**
1127
1160
  */
1128
- module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1161
+ module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1129
1162
  /**
1163
+ * Used to choosed the schema for a script JSON string
1130
1164
  */
1131
- module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1165
+ module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1166
+ /**
1167
+ */
1168
+ module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1169
+ /**
1170
+ */
1171
+ 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", });
1172
+ /**
1173
+ */
1174
+ module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1132
1175
  /**
1133
1176
  */
1134
1177
  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", });
1135
1178
  /**
1179
+ */
1180
+ module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1181
+ /**
1182
+ */
1183
+ module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1184
+ /**
1185
+ */
1186
+ module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1187
+ /**
1188
+ */
1189
+ module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1190
+ /**
1191
+ */
1192
+ module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1193
+ /**
1136
1194
  * Each new language uses a different namespace for hashing its script
1137
1195
  * This is because you could have a language where the same bytes have different semantics
1138
1196
  * So this avoids scripts in different languages mapping to the same hash
@@ -1141,7 +1199,25 @@ module.exports.VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"
1141
1199
  module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1142
1200
  /**
1143
1201
  */
1144
- module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1202
+ 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", });
1203
+ /**
1204
+ */
1205
+ module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1206
+ /**
1207
+ */
1208
+ module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1209
+ /**
1210
+ */
1211
+ module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1212
+ /**
1213
+ */
1214
+ 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", });
1215
+ /**
1216
+ */
1217
+ 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", });
1218
+ /**
1219
+ */
1220
+ module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1145
1221
  /**
1146
1222
  * JSON <-> PlutusData conversion schemas.
1147
1223
  * Follows ScriptDataJsonSchema in cardano-cli defined at:
@@ -1195,47 +1271,7 @@ BasicConversions:0,"0":"BasicConversions",
1195
1271
  DetailedSchema:1,"1":"DetailedSchema", });
1196
1272
  /**
1197
1273
  */
1198
- module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1199
- /**
1200
- */
1201
- module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1202
- /**
1203
- */
1204
- module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1205
- /**
1206
- */
1207
- 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", });
1208
- /**
1209
- */
1210
- module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1211
- /**
1212
- */
1213
- module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1214
- /**
1215
- */
1216
- 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", });
1217
- /**
1218
- */
1219
- 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", });
1220
- /**
1221
- */
1222
- 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", });
1223
- /**
1224
- */
1225
- 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", });
1226
- /**
1227
- */
1228
- module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1229
- /**
1230
- */
1231
- module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1232
- /**
1233
- * Used to choosed the schema for a script JSON string
1234
- */
1235
- module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1236
- /**
1237
- */
1238
- module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1274
+ 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", });
1239
1275
  /**
1240
1276
  */
1241
1277
  module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
@@ -1255,9 +1291,6 @@ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1255
1291
  * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1256
1292
  */
1257
1293
  RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1258
- /**
1259
- */
1260
- module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1261
1294
 
1262
1295
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1263
1296
  ? { register: () => {}, unregister: () => {} }
Binary file
@@ -7,12 +7,13 @@ 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;
10
11
  export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
11
12
  export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
12
13
  export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
13
14
  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
15
  export function get_ref_script_bytes(a: number, b: number, c: number, d: number): void;
16
+ export function cbor_to_json(a: number, b: number, c: number): void;
16
17
  export function __wbg_noconfidenceaction_free(a: number): void;
17
18
  export function noconfidenceaction_to_bytes(a: number, b: number): void;
18
19
  export function noconfidenceaction_from_bytes(a: number, b: number, c: 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.32",
7
+ "version": "0.1.0-beta.34",
8
8
  "license": "Apache-2.0",
9
9
  "files": [
10
10
  "node/cquisitor_lib_bg.wasm",