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

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.
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @param {string} tx_hex
3
+ * @param {NetworkType} network_type
3
4
  * @returns {string}
4
5
  */
5
- export function get_necessary_data_list_js(tx_hex: string): string;
6
+ export function get_necessary_data_list_js(tx_hex: string, network_type: NetworkType): string;
6
7
 
7
8
  /**
8
9
  * Extracts all script and datum hashes from a transaction
@@ -289,6 +289,28 @@ export function get_possible_types_for_input(input) {
289
289
  }
290
290
  }
291
291
 
292
+ /**
293
+ * @param {string} cbor_hex
294
+ * @returns {any}
295
+ */
296
+ export function cbor_to_json(cbor_hex) {
297
+ try {
298
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
299
+ const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
300
+ const len0 = WASM_VECTOR_LEN;
301
+ wasm.cbor_to_json(retptr, ptr0, len0);
302
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
303
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
304
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
305
+ if (r2) {
306
+ throw takeObject(r1);
307
+ }
308
+ return takeObject(r0);
309
+ } finally {
310
+ wasm.__wbindgen_add_to_stack_pointer(16);
311
+ }
312
+ }
313
+
292
314
  /**
293
315
  * @param {string} hex_str
294
316
  * @returns {any}
@@ -313,32 +335,35 @@ export function check_block_or_tx_signatures(hex_str) {
313
335
 
314
336
  /**
315
337
  * @param {string} tx_hex
338
+ * @param {string} network_type
316
339
  * @returns {string}
317
340
  */
318
- export function get_necessary_data_list_js(tx_hex) {
319
- let deferred3_0;
320
- let deferred3_1;
341
+ export function get_necessary_data_list_js(tx_hex, network_type) {
342
+ let deferred4_0;
343
+ let deferred4_1;
321
344
  try {
322
345
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
323
346
  const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
324
347
  const len0 = WASM_VECTOR_LEN;
325
- wasm.get_necessary_data_list_js(retptr, ptr0, len0);
348
+ const ptr1 = passStringToWasm0(network_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
349
+ const len1 = WASM_VECTOR_LEN;
350
+ wasm.get_necessary_data_list_js(retptr, ptr0, len0, ptr1, len1);
326
351
  var r0 = getInt32Memory0()[retptr / 4 + 0];
327
352
  var r1 = getInt32Memory0()[retptr / 4 + 1];
328
353
  var r2 = getInt32Memory0()[retptr / 4 + 2];
329
354
  var r3 = getInt32Memory0()[retptr / 4 + 3];
330
- var ptr2 = r0;
331
- var len2 = r1;
355
+ var ptr3 = r0;
356
+ var len3 = r1;
332
357
  if (r3) {
333
- ptr2 = 0; len2 = 0;
358
+ ptr3 = 0; len3 = 0;
334
359
  throw takeObject(r2);
335
360
  }
336
- deferred3_0 = ptr2;
337
- deferred3_1 = len2;
338
- return getStringFromWasm0(ptr2, len2);
361
+ deferred4_0 = ptr3;
362
+ deferred4_1 = len3;
363
+ return getStringFromWasm0(ptr3, len3);
339
364
  } finally {
340
365
  wasm.__wbindgen_add_to_stack_pointer(16);
341
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
366
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
342
367
  }
343
368
  }
344
369
 
@@ -409,28 +434,6 @@ export function extract_hashes_from_transaction_js(tx_hex) {
409
434
  }
410
435
  }
411
436
 
412
- /**
413
- * @param {string} cbor_hex
414
- * @returns {any}
415
- */
416
- export function cbor_to_json(cbor_hex) {
417
- try {
418
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
419
- const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
420
- const len0 = WASM_VECTOR_LEN;
421
- wasm.cbor_to_json(retptr, ptr0, len0);
422
- var r0 = getInt32Memory0()[retptr / 4 + 0];
423
- var r1 = getInt32Memory0()[retptr / 4 + 1];
424
- var r2 = getInt32Memory0()[retptr / 4 + 2];
425
- if (r2) {
426
- throw takeObject(r1);
427
- }
428
- return takeObject(r0);
429
- } finally {
430
- wasm.__wbindgen_add_to_stack_pointer(16);
431
- }
432
- }
433
-
434
437
  /**
435
438
  * @param {string} hex
436
439
  * @returns {any}
@@ -1151,37 +1154,72 @@ function handleError(f, args) {
1151
1154
  }
1152
1155
  /**
1153
1156
  */
1154
- export const AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
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", });
1155
1181
  /**
1156
1182
  */
1157
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", });
1158
1184
  /**
1159
1185
  */
1160
- export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1186
+ export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1161
1187
  /**
1162
1188
  */
1163
- export const VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
1189
+ export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1164
1190
  /**
1165
1191
  */
1166
- export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1192
+ export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1167
1193
  /**
1168
1194
  */
1169
- export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
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", });
1170
1205
  /**
1171
1206
  */
1172
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", });
1173
1208
  /**
1174
1209
  */
1175
- export const PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
1210
+ export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1176
1211
  /**
1177
1212
  */
1178
- export const NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
1213
+ 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", });
1179
1214
  /**
1180
1215
  */
1181
- export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
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", });
1182
1217
  /**
1183
1218
  */
1184
- export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
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", });
1185
1223
  /**
1186
1224
  * JSON <-> PlutusData conversion schemas.
1187
1225
  * Follows ScriptDataJsonSchema in cardano-cli defined at:
@@ -1235,67 +1273,32 @@ BasicConversions:0,"0":"BasicConversions",
1235
1273
  DetailedSchema:1,"1":"DetailedSchema", });
1236
1274
  /**
1237
1275
  */
1238
- export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1239
- /**
1240
- * Each new language uses a different namespace for hashing its script
1241
- * This is because you could have a language where the same bytes have different semantics
1242
- * So this avoids scripts in different languages mapping to the same hash
1243
- * Note that the enum value here is different than the enum value for deciding the cost model of a script
1244
- */
1245
- export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1246
- /**
1247
- */
1248
- export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1276
+ 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", });
1249
1277
  /**
1250
1278
  */
1251
- export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1279
+ export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1252
1280
  /**
1253
1281
  */
1254
- export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1282
+ 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", });
1255
1283
  /**
1256
1284
  */
1257
1285
  export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1258
1286
  /**
1259
1287
  */
1260
- export const CoinSelectionStrategyCIP2 = Object.freeze({
1261
- /**
1262
- * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
1263
- */
1264
- LargestFirst:0,"0":"LargestFirst",
1265
- /**
1266
- * Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
1267
- */
1268
- RandomImprove:1,"1":"RandomImprove",
1269
- /**
1270
- * Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
1271
- */
1272
- LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1273
- /**
1274
- * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1275
- */
1276
- RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1277
- /**
1278
- */
1279
- 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", });
1288
+ export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1280
1289
  /**
1281
1290
  */
1282
- export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1291
+ 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", });
1283
1292
  /**
1284
1293
  */
1285
- export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1294
+ export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1286
1295
  /**
1287
1296
  */
1288
- 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", });
1297
+ export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1289
1298
  /**
1290
1299
  * Used to choosed the schema for a script JSON string
1291
1300
  */
1292
1301
  export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1293
- /**
1294
- */
1295
- export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1296
- /**
1297
- */
1298
- 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", });
1299
1302
 
1300
1303
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1301
1304
  ? { register: () => {}, unregister: () => {} }
@@ -39134,11 +39137,6 @@ export function __wbindgen_string_new(arg0, arg1) {
39134
39137
  return addHeapObject(ret);
39135
39138
  };
39136
39139
 
39137
- export function __wbindgen_error_new(arg0, arg1) {
39138
- const ret = new Error(getStringFromWasm0(arg0, arg1));
39139
- return addHeapObject(ret);
39140
- };
39141
-
39142
39140
  export function __wbindgen_is_undefined(arg0) {
39143
39141
  const ret = getObject(arg0) === undefined;
39144
39142
  return ret;
@@ -39184,6 +39182,11 @@ export function __wbindgen_is_object(arg0) {
39184
39182
  return ret;
39185
39183
  };
39186
39184
 
39185
+ export function __wbindgen_error_new(arg0, arg1) {
39186
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
39187
+ return addHeapObject(ret);
39188
+ };
39189
+
39187
39190
  export function __wbindgen_object_clone_ref(arg0) {
39188
39191
  const ret = getObject(arg0);
39189
39192
  return addHeapObject(ret);
Binary file
@@ -4,11 +4,11 @@ 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 cbor_to_json(a: number, b: number, c: number): void;
7
8
  export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
8
- export function get_necessary_data_list_js(a: number, b: number, c: number): void;
9
+ export function get_necessary_data_list_js(a: number, b: number, c: number, d: number, e: number): void;
9
10
  export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
10
11
  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;
12
12
  export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
13
13
  export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
14
14
  export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @param {string} tx_hex
3
+ * @param {NetworkType} network_type
3
4
  * @returns {string}
4
5
  */
5
- export function get_necessary_data_list_js(tx_hex: string): string;
6
+ export function get_necessary_data_list_js(tx_hex: string, network_type: NetworkType): string;
6
7
 
7
8
  /**
8
9
  * Extracts all script and datum hashes from a transaction
@@ -284,6 +284,28 @@ module.exports.get_possible_types_for_input = function(input) {
284
284
  }
285
285
  };
286
286
 
287
+ /**
288
+ * @param {string} cbor_hex
289
+ * @returns {any}
290
+ */
291
+ module.exports.cbor_to_json = function(cbor_hex) {
292
+ try {
293
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
294
+ const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
295
+ const len0 = WASM_VECTOR_LEN;
296
+ wasm.cbor_to_json(retptr, ptr0, len0);
297
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
298
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
299
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
300
+ if (r2) {
301
+ throw takeObject(r1);
302
+ }
303
+ return takeObject(r0);
304
+ } finally {
305
+ wasm.__wbindgen_add_to_stack_pointer(16);
306
+ }
307
+ };
308
+
287
309
  /**
288
310
  * @param {string} hex_str
289
311
  * @returns {any}
@@ -308,32 +330,35 @@ module.exports.check_block_or_tx_signatures = function(hex_str) {
308
330
 
309
331
  /**
310
332
  * @param {string} tx_hex
333
+ * @param {string} network_type
311
334
  * @returns {string}
312
335
  */
313
- module.exports.get_necessary_data_list_js = function(tx_hex) {
314
- let deferred3_0;
315
- let deferred3_1;
336
+ module.exports.get_necessary_data_list_js = function(tx_hex, network_type) {
337
+ let deferred4_0;
338
+ let deferred4_1;
316
339
  try {
317
340
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
318
341
  const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
319
342
  const len0 = WASM_VECTOR_LEN;
320
- wasm.get_necessary_data_list_js(retptr, ptr0, len0);
343
+ const ptr1 = passStringToWasm0(network_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
344
+ const len1 = WASM_VECTOR_LEN;
345
+ wasm.get_necessary_data_list_js(retptr, ptr0, len0, ptr1, len1);
321
346
  var r0 = getInt32Memory0()[retptr / 4 + 0];
322
347
  var r1 = getInt32Memory0()[retptr / 4 + 1];
323
348
  var r2 = getInt32Memory0()[retptr / 4 + 2];
324
349
  var r3 = getInt32Memory0()[retptr / 4 + 3];
325
- var ptr2 = r0;
326
- var len2 = r1;
350
+ var ptr3 = r0;
351
+ var len3 = r1;
327
352
  if (r3) {
328
- ptr2 = 0; len2 = 0;
353
+ ptr3 = 0; len3 = 0;
329
354
  throw takeObject(r2);
330
355
  }
331
- deferred3_0 = ptr2;
332
- deferred3_1 = len2;
333
- return getStringFromWasm0(ptr2, len2);
356
+ deferred4_0 = ptr3;
357
+ deferred4_1 = len3;
358
+ return getStringFromWasm0(ptr3, len3);
334
359
  } finally {
335
360
  wasm.__wbindgen_add_to_stack_pointer(16);
336
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
361
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
337
362
  }
338
363
  };
339
364
 
@@ -404,28 +429,6 @@ module.exports.extract_hashes_from_transaction_js = function(tx_hex) {
404
429
  }
405
430
  };
406
431
 
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
-
429
432
  /**
430
433
  * @param {string} hex
431
434
  * @returns {any}
@@ -1145,52 +1148,89 @@ function handleError(f, args) {
1145
1148
  }
1146
1149
  }
1147
1150
  /**
1148
- * Used to choosed the schema for a script JSON string
1149
1151
  */
1150
- module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
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", });
1151
1153
  /**
1154
+ * JSON <-> PlutusData conversion schemas.
1155
+ * Follows ScriptDataJsonSchema in cardano-cli defined at:
1156
+ * https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
1157
+ *
1158
+ * All methods here have the following restrictions due to limitations on dependencies:
1159
+ * * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
1160
+ * * Hex strings for bytes don't accept odd-length (half-byte) strings.
1161
+ * cardano-cli seems to support these however but it seems to be different than just 0-padding
1162
+ * on either side when tested so proceed with caution
1152
1163
  */
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", });
1164
+ module.exports.PlutusDatumSchema = Object.freeze({
1154
1165
  /**
1166
+ * ScriptDataJsonNoSchema in cardano-node.
1167
+ *
1168
+ * This is the format used by --script-data-value in cardano-cli
1169
+ * This tries to accept most JSON but does not support the full spectrum of Plutus datums.
1170
+ * From JSON:
1171
+ * * null/true/false/floats NOT supported
1172
+ * * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
1173
+ * To JSON:
1174
+ * * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
1175
+ * * Lists not supported in keys
1176
+ * * Maps not supported in keys
1155
1177
  */
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", });
1178
+ BasicConversions:0,"0":"BasicConversions",
1157
1179
  /**
1180
+ * ScriptDataJsonDetailedSchema in cardano-node.
1181
+ *
1182
+ * This is the format used by --script-data-file in cardano-cli
1183
+ * This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
1184
+ * The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
1185
+ * 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
1186
+ * e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
1187
+ * 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
1188
+ * Integer's value is a JSON number e.g. {"int": 100}
1189
+ * Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
1190
+ * Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
1191
+ * Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
1192
+ * respectively with their values being the plutus datum encoded via this same schema
1193
+ * e.g. {"map": [
1194
+ * {"k": {"int": 2}, "v": {"int": 5}},
1195
+ * {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
1196
+ * ]}
1197
+ * From JSON:
1198
+ * * null/true/false/floats NOT supported
1199
+ * * the JSON must conform to a very specific schema
1200
+ * To JSON:
1201
+ * * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
1158
1202
  */
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", });
1203
+ DetailedSchema:1,"1":"DetailedSchema", });
1160
1204
  /**
1161
1205
  */
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", });
1206
+ 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", });
1163
1207
  /**
1164
1208
  */
1165
- module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
1209
+ module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1166
1210
  /**
1167
- * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
1168
1211
  */
1169
- LargestFirst:0,"0":"LargestFirst",
1212
+ module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1170
1213
  /**
1171
- * Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
1172
1214
  */
1173
- RandomImprove:1,"1":"RandomImprove",
1215
+ 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", });
1174
1216
  /**
1175
- * Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
1176
1217
  */
1177
- LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1218
+ module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1178
1219
  /**
1179
- * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1180
1220
  */
1181
- RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1221
+ module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1182
1222
  /**
1183
1223
  */
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", });
1224
+ module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1185
1225
  /**
1186
1226
  */
1187
- module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1227
+ module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1188
1228
  /**
1189
1229
  */
1190
- module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1230
+ module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1191
1231
  /**
1192
1232
  */
1193
- module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1233
+ 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", });
1194
1234
  /**
1195
1235
  */
1196
1236
  module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
@@ -1199,98 +1239,61 @@ module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCr
1199
1239
  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
1240
  /**
1201
1241
  */
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", });
1242
+ 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", });
1203
1243
  /**
1204
1244
  */
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", });
1245
+ module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
1206
1246
  /**
1247
+ * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
1207
1248
  */
1208
- module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1249
+ LargestFirst:0,"0":"LargestFirst",
1209
1250
  /**
1251
+ * Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
1210
1252
  */
1211
- module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1253
+ RandomImprove:1,"1":"RandomImprove",
1212
1254
  /**
1255
+ * Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
1213
1256
  */
1214
- module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1257
+ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1215
1258
  /**
1259
+ * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1216
1260
  */
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", });
1261
+ RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1218
1262
  /**
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
1263
  */
1224
- module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1264
+ module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1225
1265
  /**
1226
1266
  */
1227
- module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1267
+ module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1228
1268
  /**
1229
1269
  */
1230
- module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1270
+ 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", });
1231
1271
  /**
1232
1272
  */
1233
- module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1273
+ module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1234
1274
  /**
1275
+ * Used to choosed the schema for a script JSON string
1235
1276
  */
1236
- module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1277
+ module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1237
1278
  /**
1238
1279
  */
1239
- module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1280
+ module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1240
1281
  /**
1241
1282
  */
1242
- module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1283
+ 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", });
1243
1284
  /**
1244
- * JSON <-> PlutusData conversion schemas.
1245
- * Follows ScriptDataJsonSchema in cardano-cli defined at:
1246
- * https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
1247
- *
1248
- * All methods here have the following restrictions due to limitations on dependencies:
1249
- * * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
1250
- * * Hex strings for bytes don't accept odd-length (half-byte) strings.
1251
- * cardano-cli seems to support these however but it seems to be different than just 0-padding
1252
- * on either side when tested so proceed with caution
1285
+ * Each new language uses a different namespace for hashing its script
1286
+ * This is because you could have a language where the same bytes have different semantics
1287
+ * So this avoids scripts in different languages mapping to the same hash
1288
+ * Note that the enum value here is different than the enum value for deciding the cost model of a script
1253
1289
  */
1254
- module.exports.PlutusDatumSchema = Object.freeze({
1290
+ module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1255
1291
  /**
1256
- * ScriptDataJsonNoSchema in cardano-node.
1257
- *
1258
- * This is the format used by --script-data-value in cardano-cli
1259
- * This tries to accept most JSON but does not support the full spectrum of Plutus datums.
1260
- * From JSON:
1261
- * * null/true/false/floats NOT supported
1262
- * * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
1263
- * To JSON:
1264
- * * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
1265
- * * Lists not supported in keys
1266
- * * Maps not supported in keys
1267
1292
  */
1268
- BasicConversions:0,"0":"BasicConversions",
1293
+ module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1269
1294
  /**
1270
- * ScriptDataJsonDetailedSchema in cardano-node.
1271
- *
1272
- * This is the format used by --script-data-file in cardano-cli
1273
- * This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
1274
- * The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
1275
- * 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
1276
- * e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
1277
- * 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
1278
- * Integer's value is a JSON number e.g. {"int": 100}
1279
- * Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
1280
- * Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
1281
- * Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
1282
- * respectively with their values being the plutus datum encoded via this same schema
1283
- * e.g. {"map": [
1284
- * {"k": {"int": 2}, "v": {"int": 5}},
1285
- * {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
1286
- * ]}
1287
- * From JSON:
1288
- * * null/true/false/floats NOT supported
1289
- * * the JSON must conform to a very specific schema
1290
- * To JSON:
1291
- * * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
1292
1295
  */
1293
- DetailedSchema:1,"1":"DetailedSchema", });
1296
+ 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", });
1294
1297
 
1295
1298
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1296
1299
  ? { register: () => {}, unregister: () => {} }
@@ -39326,11 +39329,6 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
39326
39329
  return addHeapObject(ret);
39327
39330
  };
39328
39331
 
39329
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
39330
- const ret = new Error(getStringFromWasm0(arg0, arg1));
39331
- return addHeapObject(ret);
39332
- };
39333
-
39334
39332
  module.exports.__wbindgen_is_undefined = function(arg0) {
39335
39333
  const ret = getObject(arg0) === undefined;
39336
39334
  return ret;
@@ -39376,6 +39374,11 @@ module.exports.__wbindgen_is_object = function(arg0) {
39376
39374
  return ret;
39377
39375
  };
39378
39376
 
39377
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
39378
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
39379
+ return addHeapObject(ret);
39380
+ };
39381
+
39379
39382
  module.exports.__wbindgen_object_clone_ref = function(arg0) {
39380
39383
  const ret = getObject(arg0);
39381
39384
  return addHeapObject(ret);
Binary file
@@ -4,11 +4,11 @@ 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 cbor_to_json(a: number, b: number, c: number): void;
7
8
  export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
8
- export function get_necessary_data_list_js(a: number, b: number, c: number): void;
9
+ export function get_necessary_data_list_js(a: number, b: number, c: number, d: number, e: number): void;
9
10
  export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
10
11
  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;
12
12
  export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
13
13
  export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
14
14
  export function get_utxo_list_from_tx(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.35",
7
+ "version": "0.1.0-beta.36",
8
8
  "license": "Apache-2.0",
9
9
  "files": [
10
10
  "node/cquisitor_lib_bg.wasm",