@cardananium/cquisitor-lib 0.1.0-beta.13 → 0.1.0-beta.15

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.
@@ -290,24 +290,65 @@ export function get_possible_types_for_input(input) {
290
290
  }
291
291
 
292
292
  /**
293
- * @param {string} hex_str
294
- * @returns {any}
293
+ * @param {string} tx_hex
294
+ * @returns {string}
295
295
  */
296
- export function check_block_or_tx_signatures(hex_str) {
296
+ export function get_necessary_data_list_js(tx_hex) {
297
+ let deferred3_0;
298
+ let deferred3_1;
297
299
  try {
298
300
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
299
- const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
301
+ const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
300
302
  const len0 = WASM_VECTOR_LEN;
301
- wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
303
+ wasm.get_necessary_data_list_js(retptr, ptr0, len0);
302
304
  var r0 = getInt32Memory0()[retptr / 4 + 0];
303
305
  var r1 = getInt32Memory0()[retptr / 4 + 1];
304
306
  var r2 = getInt32Memory0()[retptr / 4 + 2];
305
- if (r2) {
306
- throw takeObject(r1);
307
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
308
+ var ptr2 = r0;
309
+ var len2 = r1;
310
+ if (r3) {
311
+ ptr2 = 0; len2 = 0;
312
+ throw takeObject(r2);
307
313
  }
308
- return takeObject(r0);
314
+ deferred3_0 = ptr2;
315
+ deferred3_1 = len2;
316
+ return getStringFromWasm0(ptr2, len2);
317
+ } finally {
318
+ wasm.__wbindgen_add_to_stack_pointer(16);
319
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
320
+ }
321
+ }
322
+
323
+ /**
324
+ * @param {string} tx_hex
325
+ * @param {any} validation_context
326
+ * @returns {string}
327
+ */
328
+ export function validate_transaction_js(tx_hex, validation_context) {
329
+ let deferred3_0;
330
+ let deferred3_1;
331
+ try {
332
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
333
+ const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ wasm.validate_transaction_js(retptr, ptr0, len0, addHeapObject(validation_context));
336
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
337
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
338
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
339
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
340
+ var ptr2 = r0;
341
+ var len2 = r1;
342
+ if (r3) {
343
+ ptr2 = 0; len2 = 0;
344
+ throw takeObject(r2);
345
+ }
346
+ deferred3_0 = ptr2;
347
+ deferred3_1 = len2;
348
+ return getStringFromWasm0(ptr2, len2);
309
349
  } finally {
310
350
  wasm.__wbindgen_add_to_stack_pointer(16);
351
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
311
352
  }
312
353
  }
313
354
 
@@ -361,15 +402,15 @@ export function execute_tx_scripts(tx_hex, utxo_json, cost_models_json) {
361
402
  }
362
403
 
363
404
  /**
364
- * @param {string} cbor_hex
405
+ * @param {string} hex_str
365
406
  * @returns {any}
366
407
  */
367
- export function cbor_to_json(cbor_hex) {
408
+ export function check_block_or_tx_signatures(hex_str) {
368
409
  try {
369
410
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
370
- const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
411
+ const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
371
412
  const len0 = WASM_VECTOR_LEN;
372
- wasm.cbor_to_json(retptr, ptr0, len0);
413
+ wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
373
414
  var r0 = getInt32Memory0()[retptr / 4 + 0];
374
415
  var r1 = getInt32Memory0()[retptr / 4 + 1];
375
416
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -435,6 +476,28 @@ export function decode_plutus_program_pretty_uplc(hex) {
435
476
  }
436
477
  }
437
478
 
479
+ /**
480
+ * @param {string} cbor_hex
481
+ * @returns {any}
482
+ */
483
+ export function cbor_to_json(cbor_hex) {
484
+ try {
485
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
486
+ const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
487
+ const len0 = WASM_VECTOR_LEN;
488
+ wasm.cbor_to_json(retptr, ptr0, len0);
489
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
490
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
491
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
492
+ if (r2) {
493
+ throw takeObject(r1);
494
+ }
495
+ return takeObject(r0);
496
+ } finally {
497
+ wasm.__wbindgen_add_to_stack_pointer(16);
498
+ }
499
+ }
500
+
438
501
  function _assertClass(instance, klass) {
439
502
  if (!(instance instanceof klass)) {
440
503
  throw new Error(`expected instance of ${klass.name}`);
@@ -1021,28 +1084,19 @@ function handleError(f, args) {
1021
1084
  }
1022
1085
  /**
1023
1086
  */
1024
- export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1025
- /**
1026
- */
1027
- 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", });
1028
- /**
1029
- */
1030
- export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1031
- /**
1032
- */
1033
1087
  export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1034
1088
  /**
1035
1089
  */
1036
- 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", });
1090
+ export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1037
1091
  /**
1038
1092
  */
1039
1093
  export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1040
1094
  /**
1041
1095
  */
1042
- export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1096
+ 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", });
1043
1097
  /**
1044
1098
  */
1045
- 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", });
1099
+ export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1046
1100
  /**
1047
1101
  */
1048
1102
  export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
@@ -1051,51 +1105,23 @@ export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":
1051
1105
  export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1052
1106
  /**
1053
1107
  */
1054
- export const CoinSelectionStrategyCIP2 = Object.freeze({
1055
- /**
1056
- * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
1057
- */
1058
- LargestFirst:0,"0":"LargestFirst",
1059
- /**
1060
- * Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
1061
- */
1062
- RandomImprove:1,"1":"RandomImprove",
1063
- /**
1064
- * Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
1065
- */
1066
- LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1108
+ export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1067
1109
  /**
1068
- * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1069
1110
  */
1070
- RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1111
+ 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", });
1071
1112
  /**
1072
1113
  */
1073
1114
  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", });
1074
1115
  /**
1075
- * Each new language uses a different namespace for hashing its script
1076
- * This is because you could have a language where the same bytes have different semantics
1077
- * So this avoids scripts in different languages mapping to the same hash
1078
- * Note that the enum value here is different than the enum value for deciding the cost model of a script
1079
- */
1080
- export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1081
- /**
1082
- */
1083
- 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", });
1084
- /**
1085
- */
1086
- export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1087
- /**
1088
- */
1089
- export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1090
- /**
1091
1116
  */
1092
1117
  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", });
1093
1118
  /**
1094
1119
  */
1095
- 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", });
1120
+ export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1096
1121
  /**
1122
+ * Used to choosed the schema for a script JSON string
1097
1123
  */
1098
- export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1124
+ export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1099
1125
  /**
1100
1126
  * JSON <-> PlutusData conversion schemas.
1101
1127
  * Follows ScriptDataJsonSchema in cardano-cli defined at:
@@ -1158,14 +1184,51 @@ export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCred
1158
1184
  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", });
1159
1185
  /**
1160
1186
  */
1161
- export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1187
+ export const CoinSelectionStrategyCIP2 = Object.freeze({
1162
1188
  /**
1163
- * Used to choosed the schema for a script JSON string
1189
+ * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
1164
1190
  */
1165
- export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1191
+ LargestFirst:0,"0":"LargestFirst",
1192
+ /**
1193
+ * Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
1194
+ */
1195
+ RandomImprove:1,"1":"RandomImprove",
1196
+ /**
1197
+ * Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
1198
+ */
1199
+ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1200
+ /**
1201
+ * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1202
+ */
1203
+ RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1204
+ /**
1205
+ */
1206
+ 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", });
1166
1207
  /**
1167
1208
  */
1168
1209
  export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1210
+ /**
1211
+ */
1212
+ 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", });
1213
+ /**
1214
+ */
1215
+ 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", });
1216
+ /**
1217
+ */
1218
+ export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1219
+ /**
1220
+ * Each new language uses a different namespace for hashing its script
1221
+ * This is because you could have a language where the same bytes have different semantics
1222
+ * So this avoids scripts in different languages mapping to the same hash
1223
+ * Note that the enum value here is different than the enum value for deciding the cost model of a script
1224
+ */
1225
+ export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1226
+ /**
1227
+ */
1228
+ export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1229
+ /**
1230
+ */
1231
+ export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1169
1232
 
1170
1233
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1171
1234
  ? { register: () => {}, unregister: () => {} }
@@ -39004,11 +39067,6 @@ export function __wbindgen_string_new(arg0, arg1) {
39004
39067
  return addHeapObject(ret);
39005
39068
  };
39006
39069
 
39007
- export function __wbindgen_error_new(arg0, arg1) {
39008
- const ret = new Error(getStringFromWasm0(arg0, arg1));
39009
- return addHeapObject(ret);
39010
- };
39011
-
39012
39070
  export function __wbindgen_is_undefined(arg0) {
39013
39071
  const ret = getObject(arg0) === undefined;
39014
39072
  return ret;
@@ -39034,6 +39092,17 @@ export function __wbindgen_jsval_eq(arg0, arg1) {
39034
39092
  return ret;
39035
39093
  };
39036
39094
 
39095
+ export function __wbindgen_bigint_from_u64(arg0) {
39096
+ const ret = BigInt.asUintN(64, arg0);
39097
+ return addHeapObject(ret);
39098
+ };
39099
+
39100
+ export function __wbindgen_boolean_get(arg0) {
39101
+ const v = getObject(arg0);
39102
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
39103
+ return ret;
39104
+ };
39105
+
39037
39106
  export function __wbindgen_is_string(arg0) {
39038
39107
  const ret = typeof(getObject(arg0)) === 'string';
39039
39108
  return ret;
@@ -39054,6 +39123,11 @@ export function __wbindgen_is_object(arg0) {
39054
39123
  return ret;
39055
39124
  };
39056
39125
 
39126
+ export function __wbindgen_error_new(arg0, arg1) {
39127
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
39128
+ return addHeapObject(ret);
39129
+ };
39130
+
39057
39131
  export function __wbindgen_object_clone_ref(arg0) {
39058
39132
  const ret = getObject(arg0);
39059
39133
  return addHeapObject(ret);
@@ -39064,12 +39138,6 @@ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
39064
39138
  return ret;
39065
39139
  };
39066
39140
 
39067
- export function __wbindgen_boolean_get(arg0) {
39068
- const v = getObject(arg0);
39069
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
39070
- return ret;
39071
- };
39072
-
39073
39141
  export function __wbindgen_number_get(arg0, arg1) {
39074
39142
  const obj = getObject(arg1);
39075
39143
  const ret = typeof(obj) === 'number' ? obj : undefined;
Binary file
@@ -4,12 +4,14 @@ 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;
7
+ export function get_necessary_data_list_js(a: number, b: number, c: number): void;
8
+ export function validate_transaction_js(a: number, b: number, c: number, d: number): void;
8
9
  export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
9
10
  export function execute_tx_scripts(a: number, b: number, c: number, d: number, e: number): void;
10
- export function cbor_to_json(a: number, b: number, c: number): void;
11
+ export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
11
12
  export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
12
13
  export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
14
+ export function cbor_to_json(a: number, b: number, c: number): void;
13
15
  export function __wbg_governanceactionids_free(a: number): void;
14
16
  export function governanceactionids_to_json(a: number, b: number): void;
15
17
  export function governanceactionids_to_js_value(a: number, b: number): void;