@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.
- package/browser/cquisitor_lib.d.ts +960 -891
- package/browser/cquisitor_lib_bg.js +89 -56
- package/browser/cquisitor_lib_bg.wasm +0 -0
- package/browser/cquisitor_lib_bg.wasm.d.ts +2 -1
- package/node/cquisitor_lib.d.ts +960 -891
- package/node/cquisitor_lib.js +106 -73
- package/node/cquisitor_lib_bg.wasm +0 -0
- package/node/cquisitor_lib_bg.wasm.d.ts +2 -1
- package/package.json +1 -1
|
@@ -376,6 +376,39 @@ export function validate_transaction_js(tx_hex, validation_context) {
|
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
+
/**
|
|
380
|
+
* WASM export: Extracts all script and datum hashes from a transaction
|
|
381
|
+
* Returns JSON string with ExtractedHashes structure
|
|
382
|
+
* @param {string} tx_hex
|
|
383
|
+
* @returns {string}
|
|
384
|
+
*/
|
|
385
|
+
export function extract_hashes_from_transaction_js(tx_hex) {
|
|
386
|
+
let deferred3_0;
|
|
387
|
+
let deferred3_1;
|
|
388
|
+
try {
|
|
389
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
390
|
+
const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
391
|
+
const len0 = WASM_VECTOR_LEN;
|
|
392
|
+
wasm.extract_hashes_from_transaction_js(retptr, ptr0, len0);
|
|
393
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
394
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
395
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
396
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
397
|
+
var ptr2 = r0;
|
|
398
|
+
var len2 = r1;
|
|
399
|
+
if (r3) {
|
|
400
|
+
ptr2 = 0; len2 = 0;
|
|
401
|
+
throw takeObject(r2);
|
|
402
|
+
}
|
|
403
|
+
deferred3_0 = ptr2;
|
|
404
|
+
deferred3_1 = len2;
|
|
405
|
+
return getStringFromWasm0(ptr2, len2);
|
|
406
|
+
} finally {
|
|
407
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
408
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
379
412
|
/**
|
|
380
413
|
* @param {string} hex
|
|
381
414
|
* @returns {any}
|
|
@@ -478,28 +511,6 @@ export function execute_tx_scripts(tx_hex, utxo_json, cost_models_json) {
|
|
|
478
511
|
}
|
|
479
512
|
}
|
|
480
513
|
|
|
481
|
-
/**
|
|
482
|
-
* @param {string} cbor_hex
|
|
483
|
-
* @returns {any}
|
|
484
|
-
*/
|
|
485
|
-
export function cbor_to_json(cbor_hex) {
|
|
486
|
-
try {
|
|
487
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
488
|
-
const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
489
|
-
const len0 = WASM_VECTOR_LEN;
|
|
490
|
-
wasm.cbor_to_json(retptr, ptr0, len0);
|
|
491
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
492
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
493
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
494
|
-
if (r2) {
|
|
495
|
-
throw takeObject(r1);
|
|
496
|
-
}
|
|
497
|
-
return takeObject(r0);
|
|
498
|
-
} finally {
|
|
499
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
|
|
503
514
|
/**
|
|
504
515
|
* @param {string} tx_hex
|
|
505
516
|
* @param {number} output_index
|
|
@@ -532,6 +543,28 @@ export function get_ref_script_bytes(tx_hex, output_index) {
|
|
|
532
543
|
}
|
|
533
544
|
}
|
|
534
545
|
|
|
546
|
+
/**
|
|
547
|
+
* @param {string} cbor_hex
|
|
548
|
+
* @returns {any}
|
|
549
|
+
*/
|
|
550
|
+
export function cbor_to_json(cbor_hex) {
|
|
551
|
+
try {
|
|
552
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
553
|
+
const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
554
|
+
const len0 = WASM_VECTOR_LEN;
|
|
555
|
+
wasm.cbor_to_json(retptr, ptr0, len0);
|
|
556
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
557
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
558
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
559
|
+
if (r2) {
|
|
560
|
+
throw takeObject(r1);
|
|
561
|
+
}
|
|
562
|
+
return takeObject(r0);
|
|
563
|
+
} finally {
|
|
564
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
535
568
|
function getArrayU8FromWasm0(ptr, len) {
|
|
536
569
|
ptr = ptr >>> 0;
|
|
537
570
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -1118,54 +1151,40 @@ function handleError(f, args) {
|
|
|
1118
1151
|
}
|
|
1119
1152
|
/**
|
|
1120
1153
|
*/
|
|
1121
|
-
export const
|
|
1154
|
+
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", });
|
|
1122
1155
|
/**
|
|
1123
1156
|
*/
|
|
1124
|
-
export const
|
|
1157
|
+
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", });
|
|
1125
1158
|
/**
|
|
1126
|
-
* Each new language uses a different namespace for hashing its script
|
|
1127
|
-
* This is because you could have a language where the same bytes have different semantics
|
|
1128
|
-
* So this avoids scripts in different languages mapping to the same hash
|
|
1129
|
-
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
1130
1159
|
*/
|
|
1131
|
-
export const
|
|
1160
|
+
export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
|
|
1132
1161
|
/**
|
|
1133
1162
|
*/
|
|
1134
|
-
export const
|
|
1163
|
+
export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
1135
1164
|
/**
|
|
1136
1165
|
*/
|
|
1137
1166
|
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", });
|
|
1138
1167
|
/**
|
|
1139
1168
|
*/
|
|
1140
|
-
export const
|
|
1141
|
-
/**
|
|
1142
|
-
*/
|
|
1143
|
-
export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
1144
|
-
/**
|
|
1145
|
-
* Used to choosed the schema for a script JSON string
|
|
1146
|
-
*/
|
|
1147
|
-
export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
|
|
1148
|
-
/**
|
|
1149
|
-
*/
|
|
1150
|
-
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", });
|
|
1169
|
+
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", });
|
|
1151
1170
|
/**
|
|
1152
1171
|
*/
|
|
1153
|
-
export const
|
|
1172
|
+
export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
|
|
1154
1173
|
/**
|
|
1155
1174
|
*/
|
|
1156
|
-
export const
|
|
1175
|
+
export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
1157
1176
|
/**
|
|
1158
1177
|
*/
|
|
1159
|
-
export const
|
|
1178
|
+
export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
1160
1179
|
/**
|
|
1161
1180
|
*/
|
|
1162
|
-
export const
|
|
1181
|
+
export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
1163
1182
|
/**
|
|
1164
1183
|
*/
|
|
1165
|
-
export const
|
|
1184
|
+
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", });
|
|
1166
1185
|
/**
|
|
1167
1186
|
*/
|
|
1168
|
-
export const
|
|
1187
|
+
export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
|
|
1169
1188
|
/**
|
|
1170
1189
|
* JSON <-> PlutusData conversion schemas.
|
|
1171
1190
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
@@ -1218,29 +1237,31 @@ BasicConversions:0,"0":"BasicConversions",
|
|
|
1218
1237
|
*/
|
|
1219
1238
|
DetailedSchema:1,"1":"DetailedSchema", });
|
|
1220
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
|
|
1221
1244
|
*/
|
|
1222
|
-
export const
|
|
1245
|
+
export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
|
|
1223
1246
|
/**
|
|
1224
1247
|
*/
|
|
1225
|
-
export const
|
|
1248
|
+
export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
|
|
1226
1249
|
/**
|
|
1227
1250
|
*/
|
|
1228
1251
|
export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
1229
1252
|
/**
|
|
1230
1253
|
*/
|
|
1231
|
-
export const
|
|
1232
|
-
/**
|
|
1233
|
-
*/
|
|
1234
|
-
export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
1254
|
+
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", });
|
|
1235
1255
|
/**
|
|
1236
1256
|
*/
|
|
1237
|
-
export const
|
|
1257
|
+
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", });
|
|
1238
1258
|
/**
|
|
1239
1259
|
*/
|
|
1240
|
-
export const
|
|
1260
|
+
export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
|
|
1241
1261
|
/**
|
|
1262
|
+
* Used to choosed the schema for a script JSON string
|
|
1242
1263
|
*/
|
|
1243
|
-
export const
|
|
1264
|
+
export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
|
|
1244
1265
|
/**
|
|
1245
1266
|
*/
|
|
1246
1267
|
export const CoinSelectionStrategyCIP2 = Object.freeze({
|
|
@@ -1263,6 +1284,18 @@ RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
|
1263
1284
|
/**
|
|
1264
1285
|
*/
|
|
1265
1286
|
export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
1287
|
+
/**
|
|
1288
|
+
*/
|
|
1289
|
+
export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
|
|
1290
|
+
/**
|
|
1291
|
+
*/
|
|
1292
|
+
export const RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
|
|
1293
|
+
/**
|
|
1294
|
+
*/
|
|
1295
|
+
export const VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
|
|
1296
|
+
/**
|
|
1297
|
+
*/
|
|
1298
|
+
export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
|
|
1266
1299
|
|
|
1267
1300
|
const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1268
1301
|
? { 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;
|