@cardananium/cquisitor-lib 0.1.0-beta.54 → 0.1.0-beta.56
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.
|
@@ -258,7 +258,57 @@ export function cddl_format(cddl: string): string;
|
|
|
258
258
|
|
|
259
259
|
/** One entry from `map_cbor_to_cddl`: a single position of a CBOR
|
|
260
260
|
* node, the type that matched it, and the path it ends up at in the
|
|
261
|
-
* output of `decode_cbor_against_cddl`.
|
|
261
|
+
* output of `decode_cbor_against_cddl`.
|
|
262
|
+
*
|
|
263
|
+
* ## `decoded_path` conventions
|
|
264
|
+
*
|
|
265
|
+
* Every node addressable in the JSON tree returned by
|
|
266
|
+
* `decode_cbor_against_cddl` has at least one entry here — including
|
|
267
|
+
* the synthetic keys the decoder inserts when the data shape doesn't
|
|
268
|
+
* fit a plain JSON object. UI consumers can right-click any tree row
|
|
269
|
+
* and look up `entries.find(e => e.decoded_path === path)` to find
|
|
270
|
+
* the matching CBOR + CDDL spans.
|
|
271
|
+
*
|
|
272
|
+
* Synthetic-key paths:
|
|
273
|
+
*
|
|
274
|
+
* * `<wrapper>["@tag"]` — the tag-number row of an unspecialised
|
|
275
|
+
* tagged value (decoder represents these as `{@tag, @value}`).
|
|
276
|
+
* `cbor_byte_span` covers just the tag header bytes (`d9 0102`,
|
|
277
|
+
* not the whole `Tag(258, …)` extent); `cddl_byte_span` covers the
|
|
278
|
+
* `#6.NNN(...)` form. Tags 0/2/3 are specialised to scalars and
|
|
279
|
+
* don't get this row.
|
|
280
|
+
* * `<wrapper>["@value"]` — the inner value of an unspecialised tag.
|
|
281
|
+
* Resolves to the inner type's CDDL location.
|
|
282
|
+
* * `<arr>["@positional"]` — wrapper row over the unlabelled slots
|
|
283
|
+
* of a mixed (labelled + unlabelled) tuple. No `cddl_byte_span`.
|
|
284
|
+
* `cbor_byte_span` / `cbor_anchor_span` cover the unlabelled items'
|
|
285
|
+
* combined byte extent.
|
|
286
|
+
* * `<arr>["@positional"][N]` — individual unlabelled slot at array
|
|
287
|
+
* index N (kept under `@positional` because the named slots
|
|
288
|
+
* occupy the object level).
|
|
289
|
+
* * `<arr>["@extra"]` — wrapper row over array items past the schema
|
|
290
|
+
* cursor (overlong arrays). No `cddl_byte_span`. `<arr>["@extra"][N]`
|
|
291
|
+
* addresses each leftover item.
|
|
292
|
+
* * `<map>["@extra"]` — wrapper row over map keys not declared in
|
|
293
|
+
* the schema (object form only). `<map>["@extra"][<key>]`
|
|
294
|
+
* addresses each leftover entry's value.
|
|
295
|
+
* * `<map>["@entries"]` — wrapper row over the wire-order array form
|
|
296
|
+
* used when the map has complex keys or duplicate keys (see
|
|
297
|
+
* `decode_cbor_against_cddl` docs). No `cddl_byte_span`.
|
|
298
|
+
* * `<map>["@entries"][N]` — each pair as a single addressable row
|
|
299
|
+
* (covers key+value bytes, `cbor_type: "map_entry"`, `cddl_byte_span`
|
|
300
|
+
* = matched MemberKey's declaration if any).
|
|
301
|
+
* * `<map>["@entries"][N]["key"]` — key bytes of the Nth pair.
|
|
302
|
+
* `entry_role: "key"`.
|
|
303
|
+
* * `<map>["@entries"][N]["value"]` — value bytes of the Nth pair,
|
|
304
|
+
* plus deeper rows under it walking the matched member's value
|
|
305
|
+
* type.
|
|
306
|
+
*
|
|
307
|
+
* Wrapper rows (`@entries`, `@positional`, `@extra`) carry a
|
|
308
|
+
* `cbor_type` like `"map_entries"` / `"array_positional"` /
|
|
309
|
+
* `"map_extra"` / `"array_extra"` and intentionally omit
|
|
310
|
+
* `cddl_byte_span` — they are JSON-shape artefacts with no CDDL
|
|
311
|
+
* counterpart. */
|
|
262
312
|
export interface CborCddlMapEntry {
|
|
263
313
|
/** Path into the *raw* CBOR tree (numeric map keys are bracketed). */
|
|
264
314
|
cbor_path: string;
|
|
@@ -267,7 +317,10 @@ export interface CborCddlMapEntry {
|
|
|
267
317
|
* because decoded JSON has only string keys; identifier-safe keys
|
|
268
318
|
* use dot notation (`.name`). For unspecialised tags (anything
|
|
269
319
|
* except 0 / 2 / 3) the inner gets an extra `["@value"]` segment
|
|
270
|
-
* to match the `{@tag, @value}` wrapper the decoder emits.
|
|
320
|
+
* to match the `{@tag, @value}` wrapper the decoder emits.
|
|
321
|
+
*
|
|
322
|
+
* See the interface comment for the full list of synthetic-key
|
|
323
|
+
* segments (`@tag`, `@value`, `@positional`, `@extra`, `@entries`). */
|
|
271
324
|
decoded_path: string;
|
|
272
325
|
/** Whether this entry describes the value at `cbor_path`, or the
|
|
273
326
|
* *key* of a map entry at that path. Map entries with named keys
|
|
@@ -280,11 +333,17 @@ export interface CborCddlMapEntry {
|
|
|
280
333
|
cbor_byte_span: { offset: number; length: number };
|
|
281
334
|
/** Whole-structure byte range (= `cbor_byte_span` for scalars). */
|
|
282
335
|
cbor_anchor_span: { offset: number; length: number };
|
|
283
|
-
/** Byte range in the CDDL source describing this position.
|
|
284
|
-
|
|
336
|
+
/** Byte range in the CDDL source describing this position. Omitted
|
|
337
|
+
* on synthetic wrapper rows (`@entries`, `@positional`, `@extra`)
|
|
338
|
+
* which have no CDDL counterpart. */
|
|
339
|
+
cddl_byte_span?: SourceSpan;
|
|
285
340
|
/** Name of the CDDL rule that matched, if a rule boundary was crossed. */
|
|
286
341
|
rule_name?: string;
|
|
287
|
-
/** CBOR node's wire type (`U8`, `Bytes`, `Map`, `Array`, `Tag`, …)
|
|
342
|
+
/** CBOR node's wire type (`U8`, `Bytes`, `Map`, `Array`, `Tag`, …),
|
|
343
|
+
* or — for synthetic wrapper rows — a label describing the
|
|
344
|
+
* wrapper's role: `"map_entries"`, `"map_extra"`,
|
|
345
|
+
* `"array_positional"`, `"array_extra"`, `"map_entry"` (per-pair
|
|
346
|
+
* row in `@entries` form). */
|
|
288
347
|
cbor_type?: string;
|
|
289
348
|
}
|
|
290
349
|
|
|
@@ -882,6 +941,527 @@ export interface NecessaryInputData {
|
|
|
882
941
|
utxos: TxInput[];
|
|
883
942
|
}
|
|
884
943
|
|
|
944
|
+
export type SerializableScriptContext =
|
|
945
|
+
| {
|
|
946
|
+
purpose: SerializableScriptPurpose;
|
|
947
|
+
script_context_version: "V1V2";
|
|
948
|
+
tx_info: SerializableTxInfo;
|
|
949
|
+
}
|
|
950
|
+
| {
|
|
951
|
+
purpose: SerializableScriptInfo;
|
|
952
|
+
redeemer: SerializablePlutusData;
|
|
953
|
+
script_context_version: "V3";
|
|
954
|
+
tx_info: SerializableTxInfo;
|
|
955
|
+
};
|
|
956
|
+
export type SerializableScriptPurpose =
|
|
957
|
+
| {
|
|
958
|
+
policy_id: string;
|
|
959
|
+
purpose_type: "Minting";
|
|
960
|
+
}
|
|
961
|
+
| {
|
|
962
|
+
purpose_type: "Spending";
|
|
963
|
+
utxo_ref: SerializableTransactionInput;
|
|
964
|
+
}
|
|
965
|
+
| {
|
|
966
|
+
purpose_type: "Rewarding";
|
|
967
|
+
stake_credential: SerializableStakeCredential;
|
|
968
|
+
}
|
|
969
|
+
| {
|
|
970
|
+
certificate: SerializableCertificate;
|
|
971
|
+
index: bigint;
|
|
972
|
+
purpose_type: "Certifying";
|
|
973
|
+
}
|
|
974
|
+
| {
|
|
975
|
+
purpose_type: "Voting";
|
|
976
|
+
voter: SerializableVoter;
|
|
977
|
+
}
|
|
978
|
+
| {
|
|
979
|
+
index: bigint;
|
|
980
|
+
proposal: SerializableProposalProcedure;
|
|
981
|
+
purpose_type: "Proposing";
|
|
982
|
+
};
|
|
983
|
+
export type SerializableStakeCredential =
|
|
984
|
+
| {
|
|
985
|
+
credential_type: "KeyHash";
|
|
986
|
+
hash: string;
|
|
987
|
+
}
|
|
988
|
+
| {
|
|
989
|
+
credential_type: "ScriptHash";
|
|
990
|
+
hash: string;
|
|
991
|
+
};
|
|
992
|
+
export type SerializableCertificate =
|
|
993
|
+
| {
|
|
994
|
+
certificate_type: "StakeRegistration";
|
|
995
|
+
stake_credential: SerializableStakeCredential;
|
|
996
|
+
}
|
|
997
|
+
| {
|
|
998
|
+
certificate_type: "StakeDeregistration";
|
|
999
|
+
stake_credential: SerializableStakeCredential;
|
|
1000
|
+
}
|
|
1001
|
+
| {
|
|
1002
|
+
certificate_type: "StakeDelegation";
|
|
1003
|
+
pool_keyhash: string;
|
|
1004
|
+
stake_credential: SerializableStakeCredential;
|
|
1005
|
+
}
|
|
1006
|
+
| {
|
|
1007
|
+
certificate_type: "PoolRegistration";
|
|
1008
|
+
pool_params: SerializablePoolParams;
|
|
1009
|
+
}
|
|
1010
|
+
| {
|
|
1011
|
+
certificate_type: "PoolRetirement";
|
|
1012
|
+
epoch: bigint;
|
|
1013
|
+
pool_keyhash: string;
|
|
1014
|
+
}
|
|
1015
|
+
| {
|
|
1016
|
+
certificate_type: "Reg";
|
|
1017
|
+
deposit: bigint;
|
|
1018
|
+
stake_credential: SerializableStakeCredential;
|
|
1019
|
+
}
|
|
1020
|
+
| {
|
|
1021
|
+
certificate_type: "UnReg";
|
|
1022
|
+
refund: bigint;
|
|
1023
|
+
stake_credential: SerializableStakeCredential;
|
|
1024
|
+
}
|
|
1025
|
+
| {
|
|
1026
|
+
certificate_type: "VoteDeleg";
|
|
1027
|
+
drep: SerializableDRep;
|
|
1028
|
+
stake_credential: SerializableStakeCredential;
|
|
1029
|
+
}
|
|
1030
|
+
| {
|
|
1031
|
+
certificate_type: "StakeVoteDeleg";
|
|
1032
|
+
drep: SerializableDRep;
|
|
1033
|
+
pool_keyhash: string;
|
|
1034
|
+
stake_credential: SerializableStakeCredential;
|
|
1035
|
+
}
|
|
1036
|
+
| {
|
|
1037
|
+
certificate_type: "StakeRegDeleg";
|
|
1038
|
+
deposit: bigint;
|
|
1039
|
+
pool_keyhash: string;
|
|
1040
|
+
stake_credential: SerializableStakeCredential;
|
|
1041
|
+
}
|
|
1042
|
+
| {
|
|
1043
|
+
certificate_type: "VoteRegDeleg";
|
|
1044
|
+
deposit: bigint;
|
|
1045
|
+
drep: SerializableDRep;
|
|
1046
|
+
stake_credential: SerializableStakeCredential;
|
|
1047
|
+
}
|
|
1048
|
+
| {
|
|
1049
|
+
certificate_type: "StakeVoteRegDeleg";
|
|
1050
|
+
deposit: bigint;
|
|
1051
|
+
drep: SerializableDRep;
|
|
1052
|
+
pool_keyhash: string;
|
|
1053
|
+
stake_credential: SerializableStakeCredential;
|
|
1054
|
+
}
|
|
1055
|
+
| {
|
|
1056
|
+
certificate_type: "AuthCommitteeHot";
|
|
1057
|
+
committee_cold_credential: SerializableStakeCredential;
|
|
1058
|
+
committee_hot_credential: SerializableStakeCredential;
|
|
1059
|
+
}
|
|
1060
|
+
| {
|
|
1061
|
+
anchor?: SerializableAnchor | null;
|
|
1062
|
+
certificate_type: "ResignCommitteeCold";
|
|
1063
|
+
committee_cold_credential: SerializableStakeCredential;
|
|
1064
|
+
}
|
|
1065
|
+
| {
|
|
1066
|
+
anchor?: SerializableAnchor | null;
|
|
1067
|
+
certificate_type: "RegDRepCert";
|
|
1068
|
+
deposit: bigint;
|
|
1069
|
+
drep_credential: SerializableStakeCredential;
|
|
1070
|
+
}
|
|
1071
|
+
| {
|
|
1072
|
+
certificate_type: "UnRegDRepCert";
|
|
1073
|
+
drep_credential: SerializableStakeCredential;
|
|
1074
|
+
refund: bigint;
|
|
1075
|
+
}
|
|
1076
|
+
| {
|
|
1077
|
+
anchor?: SerializableAnchor | null;
|
|
1078
|
+
certificate_type: "UpdateDRepCert";
|
|
1079
|
+
drep_credential: SerializableStakeCredential;
|
|
1080
|
+
};
|
|
1081
|
+
export type SerializableRelay =
|
|
1082
|
+
| {
|
|
1083
|
+
ipv4?: string | null;
|
|
1084
|
+
ipv6?: string | null;
|
|
1085
|
+
port?: number | null;
|
|
1086
|
+
relay_type: "SingleHostAddr";
|
|
1087
|
+
}
|
|
1088
|
+
| {
|
|
1089
|
+
hostname: string;
|
|
1090
|
+
port?: number | null;
|
|
1091
|
+
relay_type: "SingleHostName";
|
|
1092
|
+
}
|
|
1093
|
+
| {
|
|
1094
|
+
hostname: string;
|
|
1095
|
+
relay_type: "MultiHostName";
|
|
1096
|
+
};
|
|
1097
|
+
export type SerializableDRep =
|
|
1098
|
+
| {
|
|
1099
|
+
drep_type: "Key";
|
|
1100
|
+
hash: string;
|
|
1101
|
+
}
|
|
1102
|
+
| {
|
|
1103
|
+
drep_type: "Script";
|
|
1104
|
+
hash: string;
|
|
1105
|
+
}
|
|
1106
|
+
| {
|
|
1107
|
+
drep_type: "Abstain";
|
|
1108
|
+
}
|
|
1109
|
+
| {
|
|
1110
|
+
drep_type: "NoConfidence";
|
|
1111
|
+
};
|
|
1112
|
+
export type SerializableVoter =
|
|
1113
|
+
| {
|
|
1114
|
+
hash: string;
|
|
1115
|
+
voter_type: "ConstitutionalCommitteeScript";
|
|
1116
|
+
}
|
|
1117
|
+
| {
|
|
1118
|
+
hash: string;
|
|
1119
|
+
voter_type: "ConstitutionalCommitteeKey";
|
|
1120
|
+
}
|
|
1121
|
+
| {
|
|
1122
|
+
hash: string;
|
|
1123
|
+
voter_type: "DRepScript";
|
|
1124
|
+
}
|
|
1125
|
+
| {
|
|
1126
|
+
hash: string;
|
|
1127
|
+
voter_type: "DRepKey";
|
|
1128
|
+
}
|
|
1129
|
+
| {
|
|
1130
|
+
hash: string;
|
|
1131
|
+
voter_type: "StakePoolKey";
|
|
1132
|
+
};
|
|
1133
|
+
export type SerializableGovAction =
|
|
1134
|
+
| {
|
|
1135
|
+
action_type: "ParameterChange";
|
|
1136
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1137
|
+
policy_hash?: string | null;
|
|
1138
|
+
protocol_params_update: SerializableProtocolParamsUpdate;
|
|
1139
|
+
}
|
|
1140
|
+
| {
|
|
1141
|
+
action_type: "HardForkInitiation";
|
|
1142
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1143
|
+
protocol_version: ProtocolVersion;
|
|
1144
|
+
}
|
|
1145
|
+
| {
|
|
1146
|
+
action_type: "TreasuryWithdrawals";
|
|
1147
|
+
policy_hash?: string | null;
|
|
1148
|
+
withdrawals: [unknown, unknown][];
|
|
1149
|
+
}
|
|
1150
|
+
| {
|
|
1151
|
+
action_type: "NoConfidence";
|
|
1152
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1153
|
+
}
|
|
1154
|
+
| {
|
|
1155
|
+
action_type: "UpdateCommittee";
|
|
1156
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1157
|
+
members_to_add: [unknown, unknown][];
|
|
1158
|
+
members_to_remove: SerializableStakeCredential[];
|
|
1159
|
+
quorum_threshold: SubCoin;
|
|
1160
|
+
}
|
|
1161
|
+
| {
|
|
1162
|
+
action_type: "NewConstitution";
|
|
1163
|
+
constitution: SerializableConstitution;
|
|
1164
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1165
|
+
}
|
|
1166
|
+
| {
|
|
1167
|
+
action_type: "Information";
|
|
1168
|
+
};
|
|
1169
|
+
export type SerializableTxInfo =
|
|
1170
|
+
| {
|
|
1171
|
+
V1: SerializableTxInfoV1;
|
|
1172
|
+
}
|
|
1173
|
+
| {
|
|
1174
|
+
V2: SerializableTxInfoV2;
|
|
1175
|
+
}
|
|
1176
|
+
| {
|
|
1177
|
+
V3: SerializableTxInfoV3;
|
|
1178
|
+
};
|
|
1179
|
+
export type SerializableCardanoValue =
|
|
1180
|
+
| {
|
|
1181
|
+
amount: bigint;
|
|
1182
|
+
value_type: "Coin";
|
|
1183
|
+
}
|
|
1184
|
+
| {
|
|
1185
|
+
assets: SerializableAsset[];
|
|
1186
|
+
coin: bigint;
|
|
1187
|
+
value_type: "Multiasset";
|
|
1188
|
+
};
|
|
1189
|
+
export type SerializableTransactionOutput =
|
|
1190
|
+
| {
|
|
1191
|
+
address: string;
|
|
1192
|
+
datum_hash?: string | null;
|
|
1193
|
+
output_format: "Legacy";
|
|
1194
|
+
value: SerializableCardanoValue;
|
|
1195
|
+
}
|
|
1196
|
+
| {
|
|
1197
|
+
address: string;
|
|
1198
|
+
datum_option?: SerializableDatumOption | null;
|
|
1199
|
+
output_format: "PostAlonzo";
|
|
1200
|
+
script_ref?: SerializableScriptRef | null;
|
|
1201
|
+
value: SerializableCardanoValue;
|
|
1202
|
+
};
|
|
1203
|
+
export type SerializableDatumOption =
|
|
1204
|
+
| {
|
|
1205
|
+
datum_type: "Hash";
|
|
1206
|
+
hash: string;
|
|
1207
|
+
}
|
|
1208
|
+
| {
|
|
1209
|
+
data: SerializablePlutusData;
|
|
1210
|
+
datum_type: "Data";
|
|
1211
|
+
};
|
|
1212
|
+
/**
|
|
1213
|
+
* Serializable version of PlutusData that can be converted to/from JSON
|
|
1214
|
+
*/
|
|
1215
|
+
export type SerializablePlutusData =
|
|
1216
|
+
| {
|
|
1217
|
+
any_constructor?: number | null;
|
|
1218
|
+
fields: SerializablePlutusData[];
|
|
1219
|
+
tag: bigint;
|
|
1220
|
+
type: "Constr";
|
|
1221
|
+
}
|
|
1222
|
+
| {
|
|
1223
|
+
key_value_pairs: SerializableKeyValuePair[];
|
|
1224
|
+
type: "Map";
|
|
1225
|
+
}
|
|
1226
|
+
| (
|
|
1227
|
+
| {
|
|
1228
|
+
Int: string;
|
|
1229
|
+
}
|
|
1230
|
+
| {
|
|
1231
|
+
BigUInt: string;
|
|
1232
|
+
}
|
|
1233
|
+
| {
|
|
1234
|
+
BigNInt: string;
|
|
1235
|
+
}
|
|
1236
|
+
)
|
|
1237
|
+
| {
|
|
1238
|
+
type: "BoundedBytes";
|
|
1239
|
+
value: string;
|
|
1240
|
+
}
|
|
1241
|
+
| {
|
|
1242
|
+
type: "Array";
|
|
1243
|
+
values: SerializablePlutusData[];
|
|
1244
|
+
};
|
|
1245
|
+
export type SerializableScriptRef =
|
|
1246
|
+
| {
|
|
1247
|
+
script: string;
|
|
1248
|
+
script_type: "NativeScript";
|
|
1249
|
+
}
|
|
1250
|
+
| {
|
|
1251
|
+
script: string;
|
|
1252
|
+
script_type: "PlutusV1Script";
|
|
1253
|
+
}
|
|
1254
|
+
| {
|
|
1255
|
+
script: string;
|
|
1256
|
+
script_type: "PlutusV2Script";
|
|
1257
|
+
}
|
|
1258
|
+
| {
|
|
1259
|
+
script: string;
|
|
1260
|
+
script_type: "PlutusV3Script";
|
|
1261
|
+
};
|
|
1262
|
+
export type SerializableScriptInfo =
|
|
1263
|
+
| {
|
|
1264
|
+
policy_id: string;
|
|
1265
|
+
script_info_type: "Minting";
|
|
1266
|
+
}
|
|
1267
|
+
| {
|
|
1268
|
+
datum?: SerializablePlutusData | null;
|
|
1269
|
+
script_info_type: "Spending";
|
|
1270
|
+
utxo_ref: SerializableTransactionInput;
|
|
1271
|
+
}
|
|
1272
|
+
| {
|
|
1273
|
+
script_info_type: "Rewarding";
|
|
1274
|
+
stake_credential: SerializableStakeCredential;
|
|
1275
|
+
}
|
|
1276
|
+
| {
|
|
1277
|
+
certificate: SerializableCertificate;
|
|
1278
|
+
index: bigint;
|
|
1279
|
+
script_info_type: "Certifying";
|
|
1280
|
+
}
|
|
1281
|
+
| {
|
|
1282
|
+
script_info_type: "Voting";
|
|
1283
|
+
voter: SerializableVoter;
|
|
1284
|
+
}
|
|
1285
|
+
| {
|
|
1286
|
+
index: bigint;
|
|
1287
|
+
proposal: SerializableProposalProcedure;
|
|
1288
|
+
script_info_type: "Proposing";
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
export interface SerializableTransactionInput {
|
|
1292
|
+
index: bigint;
|
|
1293
|
+
transaction_id: string;
|
|
1294
|
+
}
|
|
1295
|
+
export interface SerializablePoolParams {
|
|
1296
|
+
cost: bigint;
|
|
1297
|
+
margin: SubCoin;
|
|
1298
|
+
operator: string;
|
|
1299
|
+
pledge: bigint;
|
|
1300
|
+
pool_metadata?: SerializablePoolMetadata | null;
|
|
1301
|
+
pool_owners: string[];
|
|
1302
|
+
relays: SerializableRelay[];
|
|
1303
|
+
reward_account: string;
|
|
1304
|
+
vrf_keyhash: string;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export interface SerializablePoolMetadata {
|
|
1308
|
+
hash: string;
|
|
1309
|
+
url: string;
|
|
1310
|
+
}
|
|
1311
|
+
export interface SerializableAnchor {
|
|
1312
|
+
data_hash: string;
|
|
1313
|
+
url: string;
|
|
1314
|
+
}
|
|
1315
|
+
export interface SerializableProposalProcedure {
|
|
1316
|
+
anchor: SerializableAnchor;
|
|
1317
|
+
deposit: bigint;
|
|
1318
|
+
gov_action: SerializableGovAction;
|
|
1319
|
+
reward_account: string;
|
|
1320
|
+
}
|
|
1321
|
+
export interface SerializableGovActionId {
|
|
1322
|
+
action_index: number;
|
|
1323
|
+
transaction_id: string;
|
|
1324
|
+
}
|
|
1325
|
+
export interface SerializableProtocolParamsUpdate {
|
|
1326
|
+
ada_per_utxo_byte?: number | null;
|
|
1327
|
+
collateral_percentage?: number | null;
|
|
1328
|
+
committee_term_limit?: number | null;
|
|
1329
|
+
cost_models_for_script_languages?: SerializableCostModels | null;
|
|
1330
|
+
desired_number_of_stake_pools?: number | null;
|
|
1331
|
+
drep_deposit?: number | null;
|
|
1332
|
+
drep_inactivity_period?: number | null;
|
|
1333
|
+
drep_voting_thresholds?: SerializableDRepVotingThresholds | null;
|
|
1334
|
+
execution_costs?: SerializableExUnitPrices | null;
|
|
1335
|
+
expansion_rate?: SubCoin | null;
|
|
1336
|
+
governance_action_deposit?: number | null;
|
|
1337
|
+
governance_action_validity_period?: number | null;
|
|
1338
|
+
key_deposit?: number | null;
|
|
1339
|
+
max_block_body_size?: number | null;
|
|
1340
|
+
max_block_ex_units?: ExUnits | null;
|
|
1341
|
+
max_block_header_size?: number | null;
|
|
1342
|
+
max_collateral_inputs?: number | null;
|
|
1343
|
+
max_transaction_size?: number | null;
|
|
1344
|
+
max_tx_ex_units?: ExUnits | null;
|
|
1345
|
+
max_value_size?: number | null;
|
|
1346
|
+
maximum_epoch?: number | null;
|
|
1347
|
+
min_committee_size?: number | null;
|
|
1348
|
+
min_pool_cost?: number | null;
|
|
1349
|
+
minfee_a?: number | null;
|
|
1350
|
+
minfee_b?: number | null;
|
|
1351
|
+
minfee_refscript_cost_per_byte?: SubCoin | null;
|
|
1352
|
+
pool_deposit?: number | null;
|
|
1353
|
+
pool_pledge_influence?: SubCoin | null;
|
|
1354
|
+
pool_voting_thresholds?: SerializablePoolVotingThresholds | null;
|
|
1355
|
+
treasury_growth_rate?: SubCoin | null;
|
|
1356
|
+
}
|
|
1357
|
+
export interface SerializableCostModels {
|
|
1358
|
+
plutus_v1?: number[] | null;
|
|
1359
|
+
plutus_v2?: number[] | null;
|
|
1360
|
+
plutus_v3?: number[] | null;
|
|
1361
|
+
}
|
|
1362
|
+
export interface SerializableDRepVotingThresholds {
|
|
1363
|
+
committee_no_confidence: SubCoin;
|
|
1364
|
+
committee_normal: SubCoin;
|
|
1365
|
+
hard_fork_initiation: SubCoin;
|
|
1366
|
+
motion_no_confidence: SubCoin;
|
|
1367
|
+
pp_economic_group: SubCoin;
|
|
1368
|
+
pp_governance_group: SubCoin;
|
|
1369
|
+
pp_network_group: SubCoin;
|
|
1370
|
+
pp_technical_group: SubCoin;
|
|
1371
|
+
treasury_withdrawal: SubCoin;
|
|
1372
|
+
update_constitution: SubCoin;
|
|
1373
|
+
}
|
|
1374
|
+
export interface SerializableExUnitPrices {
|
|
1375
|
+
mem_price: SubCoin;
|
|
1376
|
+
step_price: SubCoin;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
export interface SerializablePoolVotingThresholds {
|
|
1380
|
+
committee_no_confidence: SubCoin;
|
|
1381
|
+
committee_normal: SubCoin;
|
|
1382
|
+
hard_fork_initiation: SubCoin;
|
|
1383
|
+
motion_no_confidence: SubCoin;
|
|
1384
|
+
security_voting_threshold: SubCoin;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
export interface SerializableConstitution {
|
|
1388
|
+
anchor: SerializableAnchor;
|
|
1389
|
+
guardrail_script?: string | null;
|
|
1390
|
+
}
|
|
1391
|
+
export interface SerializableTxInfoV1 {
|
|
1392
|
+
certificates: SerializableCertificate[];
|
|
1393
|
+
data: [unknown, unknown][];
|
|
1394
|
+
fee: SerializableCardanoValue;
|
|
1395
|
+
id: string;
|
|
1396
|
+
inputs: SerializableTxInInfo[];
|
|
1397
|
+
mint: SerializableMintValue;
|
|
1398
|
+
outputs: SerializableTransactionOutput[];
|
|
1399
|
+
redeemers: [unknown, unknown][];
|
|
1400
|
+
signatories: string[];
|
|
1401
|
+
valid_range: SerializableTimeRange;
|
|
1402
|
+
withdrawals: [unknown, unknown][];
|
|
1403
|
+
}
|
|
1404
|
+
export interface SerializableAsset {
|
|
1405
|
+
policy_id: string;
|
|
1406
|
+
tokens: SerializableToken[];
|
|
1407
|
+
}
|
|
1408
|
+
export interface SerializableToken {
|
|
1409
|
+
asset_name: string;
|
|
1410
|
+
/**
|
|
1411
|
+
* Decimal string. Held as a string because the value range spans both
|
|
1412
|
+
* negative mint/burn amounts and `Value` amounts up to `u64::MAX` —
|
|
1413
|
+
* no fixed-width integer type covers both without loss.
|
|
1414
|
+
*/
|
|
1415
|
+
quantity: string;
|
|
1416
|
+
}
|
|
1417
|
+
export interface SerializableTxInInfo {
|
|
1418
|
+
out_ref: SerializableTransactionInput;
|
|
1419
|
+
resolved: SerializableTransactionOutput;
|
|
1420
|
+
}
|
|
1421
|
+
export interface SerializableKeyValuePair {
|
|
1422
|
+
key: SerializablePlutusData;
|
|
1423
|
+
value: SerializablePlutusData;
|
|
1424
|
+
}
|
|
1425
|
+
export interface SerializableMintValue {
|
|
1426
|
+
mint_value: SerializableAsset[];
|
|
1427
|
+
}
|
|
1428
|
+
export interface SerializableTimeRange {
|
|
1429
|
+
lower_bound?: number | null;
|
|
1430
|
+
upper_bound?: number | null;
|
|
1431
|
+
}
|
|
1432
|
+
export interface SerializableTxInfoV2 {
|
|
1433
|
+
certificates: SerializableCertificate[];
|
|
1434
|
+
data: [unknown, unknown][];
|
|
1435
|
+
fee: SerializableCardanoValue;
|
|
1436
|
+
id: string;
|
|
1437
|
+
inputs: SerializableTxInInfo[];
|
|
1438
|
+
mint: SerializableMintValue;
|
|
1439
|
+
outputs: SerializableTransactionOutput[];
|
|
1440
|
+
redeemers: [unknown, unknown][];
|
|
1441
|
+
reference_inputs: SerializableTxInInfo[];
|
|
1442
|
+
signatories: string[];
|
|
1443
|
+
valid_range: SerializableTimeRange;
|
|
1444
|
+
withdrawals: [unknown, unknown][];
|
|
1445
|
+
}
|
|
1446
|
+
export interface SerializableTxInfoV3 {
|
|
1447
|
+
certificates: SerializableCertificate[];
|
|
1448
|
+
current_treasury_amount?: number | null;
|
|
1449
|
+
data: [unknown, unknown][];
|
|
1450
|
+
fee: bigint;
|
|
1451
|
+
id: string;
|
|
1452
|
+
inputs: SerializableTxInInfo[];
|
|
1453
|
+
mint: SerializableMintValue;
|
|
1454
|
+
outputs: SerializableTransactionOutput[];
|
|
1455
|
+
proposal_procedures: SerializableProposalProcedure[];
|
|
1456
|
+
redeemers: [unknown, unknown][];
|
|
1457
|
+
reference_inputs: SerializableTxInInfo[];
|
|
1458
|
+
signatories: string[];
|
|
1459
|
+
treasury_donation?: number | null;
|
|
1460
|
+
valid_range: SerializableTimeRange;
|
|
1461
|
+
votes: [unknown, unknown][];
|
|
1462
|
+
withdrawals: [unknown, unknown][];
|
|
1463
|
+
}
|
|
1464
|
+
|
|
885
1465
|
export type GovernanceActionType =
|
|
886
1466
|
| "parameterChangeAction"
|
|
887
1467
|
| "hardForkInitiationAction"
|
|
@@ -1878,6 +2458,11 @@ export interface EvalRedeemerResult {
|
|
|
1878
2458
|
index: bigint;
|
|
1879
2459
|
logs: string[];
|
|
1880
2460
|
provided_ex_units: ExUnits;
|
|
2461
|
+
/**
|
|
2462
|
+
* The mapped script context, serialized as a JSON string.
|
|
2463
|
+
*/
|
|
2464
|
+
script_context?: string | null;
|
|
2465
|
+
script_context_bytes?: string | null;
|
|
1881
2466
|
success: boolean;
|
|
1882
2467
|
tag: RedeemerTag;
|
|
1883
2468
|
}
|
|
Binary file
|
|
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export const decode_specific_type: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
5
5
|
export const get_decodable_types: () => [number, number];
|
|
6
6
|
export const get_possible_types_for_input: (a: number, b: number) => [number, number];
|
|
7
|
+
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
7
8
|
export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
|
|
8
9
|
export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
|
|
9
10
|
export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
@@ -19,7 +20,6 @@ export const map_cbor_to_cddl: (a: number, b: number, c: number, d: number, e: n
|
|
|
19
20
|
export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
20
21
|
export const validate_cddl: (a: number, b: number) => [number, number, number];
|
|
21
22
|
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
22
|
-
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
23
23
|
export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
24
24
|
export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
25
25
|
export const validate_cbor_from_slice: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
package/node/cquisitor_lib.d.ts
CHANGED
|
@@ -258,7 +258,57 @@ export function cddl_format(cddl: string): string;
|
|
|
258
258
|
|
|
259
259
|
/** One entry from `map_cbor_to_cddl`: a single position of a CBOR
|
|
260
260
|
* node, the type that matched it, and the path it ends up at in the
|
|
261
|
-
* output of `decode_cbor_against_cddl`.
|
|
261
|
+
* output of `decode_cbor_against_cddl`.
|
|
262
|
+
*
|
|
263
|
+
* ## `decoded_path` conventions
|
|
264
|
+
*
|
|
265
|
+
* Every node addressable in the JSON tree returned by
|
|
266
|
+
* `decode_cbor_against_cddl` has at least one entry here — including
|
|
267
|
+
* the synthetic keys the decoder inserts when the data shape doesn't
|
|
268
|
+
* fit a plain JSON object. UI consumers can right-click any tree row
|
|
269
|
+
* and look up `entries.find(e => e.decoded_path === path)` to find
|
|
270
|
+
* the matching CBOR + CDDL spans.
|
|
271
|
+
*
|
|
272
|
+
* Synthetic-key paths:
|
|
273
|
+
*
|
|
274
|
+
* * `<wrapper>["@tag"]` — the tag-number row of an unspecialised
|
|
275
|
+
* tagged value (decoder represents these as `{@tag, @value}`).
|
|
276
|
+
* `cbor_byte_span` covers just the tag header bytes (`d9 0102`,
|
|
277
|
+
* not the whole `Tag(258, …)` extent); `cddl_byte_span` covers the
|
|
278
|
+
* `#6.NNN(...)` form. Tags 0/2/3 are specialised to scalars and
|
|
279
|
+
* don't get this row.
|
|
280
|
+
* * `<wrapper>["@value"]` — the inner value of an unspecialised tag.
|
|
281
|
+
* Resolves to the inner type's CDDL location.
|
|
282
|
+
* * `<arr>["@positional"]` — wrapper row over the unlabelled slots
|
|
283
|
+
* of a mixed (labelled + unlabelled) tuple. No `cddl_byte_span`.
|
|
284
|
+
* `cbor_byte_span` / `cbor_anchor_span` cover the unlabelled items'
|
|
285
|
+
* combined byte extent.
|
|
286
|
+
* * `<arr>["@positional"][N]` — individual unlabelled slot at array
|
|
287
|
+
* index N (kept under `@positional` because the named slots
|
|
288
|
+
* occupy the object level).
|
|
289
|
+
* * `<arr>["@extra"]` — wrapper row over array items past the schema
|
|
290
|
+
* cursor (overlong arrays). No `cddl_byte_span`. `<arr>["@extra"][N]`
|
|
291
|
+
* addresses each leftover item.
|
|
292
|
+
* * `<map>["@extra"]` — wrapper row over map keys not declared in
|
|
293
|
+
* the schema (object form only). `<map>["@extra"][<key>]`
|
|
294
|
+
* addresses each leftover entry's value.
|
|
295
|
+
* * `<map>["@entries"]` — wrapper row over the wire-order array form
|
|
296
|
+
* used when the map has complex keys or duplicate keys (see
|
|
297
|
+
* `decode_cbor_against_cddl` docs). No `cddl_byte_span`.
|
|
298
|
+
* * `<map>["@entries"][N]` — each pair as a single addressable row
|
|
299
|
+
* (covers key+value bytes, `cbor_type: "map_entry"`, `cddl_byte_span`
|
|
300
|
+
* = matched MemberKey's declaration if any).
|
|
301
|
+
* * `<map>["@entries"][N]["key"]` — key bytes of the Nth pair.
|
|
302
|
+
* `entry_role: "key"`.
|
|
303
|
+
* * `<map>["@entries"][N]["value"]` — value bytes of the Nth pair,
|
|
304
|
+
* plus deeper rows under it walking the matched member's value
|
|
305
|
+
* type.
|
|
306
|
+
*
|
|
307
|
+
* Wrapper rows (`@entries`, `@positional`, `@extra`) carry a
|
|
308
|
+
* `cbor_type` like `"map_entries"` / `"array_positional"` /
|
|
309
|
+
* `"map_extra"` / `"array_extra"` and intentionally omit
|
|
310
|
+
* `cddl_byte_span` — they are JSON-shape artefacts with no CDDL
|
|
311
|
+
* counterpart. */
|
|
262
312
|
export interface CborCddlMapEntry {
|
|
263
313
|
/** Path into the *raw* CBOR tree (numeric map keys are bracketed). */
|
|
264
314
|
cbor_path: string;
|
|
@@ -267,7 +317,10 @@ export interface CborCddlMapEntry {
|
|
|
267
317
|
* because decoded JSON has only string keys; identifier-safe keys
|
|
268
318
|
* use dot notation (`.name`). For unspecialised tags (anything
|
|
269
319
|
* except 0 / 2 / 3) the inner gets an extra `["@value"]` segment
|
|
270
|
-
* to match the `{@tag, @value}` wrapper the decoder emits.
|
|
320
|
+
* to match the `{@tag, @value}` wrapper the decoder emits.
|
|
321
|
+
*
|
|
322
|
+
* See the interface comment for the full list of synthetic-key
|
|
323
|
+
* segments (`@tag`, `@value`, `@positional`, `@extra`, `@entries`). */
|
|
271
324
|
decoded_path: string;
|
|
272
325
|
/** Whether this entry describes the value at `cbor_path`, or the
|
|
273
326
|
* *key* of a map entry at that path. Map entries with named keys
|
|
@@ -280,11 +333,17 @@ export interface CborCddlMapEntry {
|
|
|
280
333
|
cbor_byte_span: { offset: number; length: number };
|
|
281
334
|
/** Whole-structure byte range (= `cbor_byte_span` for scalars). */
|
|
282
335
|
cbor_anchor_span: { offset: number; length: number };
|
|
283
|
-
/** Byte range in the CDDL source describing this position.
|
|
284
|
-
|
|
336
|
+
/** Byte range in the CDDL source describing this position. Omitted
|
|
337
|
+
* on synthetic wrapper rows (`@entries`, `@positional`, `@extra`)
|
|
338
|
+
* which have no CDDL counterpart. */
|
|
339
|
+
cddl_byte_span?: SourceSpan;
|
|
285
340
|
/** Name of the CDDL rule that matched, if a rule boundary was crossed. */
|
|
286
341
|
rule_name?: string;
|
|
287
|
-
/** CBOR node's wire type (`U8`, `Bytes`, `Map`, `Array`, `Tag`, …)
|
|
342
|
+
/** CBOR node's wire type (`U8`, `Bytes`, `Map`, `Array`, `Tag`, …),
|
|
343
|
+
* or — for synthetic wrapper rows — a label describing the
|
|
344
|
+
* wrapper's role: `"map_entries"`, `"map_extra"`,
|
|
345
|
+
* `"array_positional"`, `"array_extra"`, `"map_entry"` (per-pair
|
|
346
|
+
* row in `@entries` form). */
|
|
288
347
|
cbor_type?: string;
|
|
289
348
|
}
|
|
290
349
|
|
|
@@ -882,6 +941,527 @@ export interface NecessaryInputData {
|
|
|
882
941
|
utxos: TxInput[];
|
|
883
942
|
}
|
|
884
943
|
|
|
944
|
+
export type SerializableScriptContext =
|
|
945
|
+
| {
|
|
946
|
+
purpose: SerializableScriptPurpose;
|
|
947
|
+
script_context_version: "V1V2";
|
|
948
|
+
tx_info: SerializableTxInfo;
|
|
949
|
+
}
|
|
950
|
+
| {
|
|
951
|
+
purpose: SerializableScriptInfo;
|
|
952
|
+
redeemer: SerializablePlutusData;
|
|
953
|
+
script_context_version: "V3";
|
|
954
|
+
tx_info: SerializableTxInfo;
|
|
955
|
+
};
|
|
956
|
+
export type SerializableScriptPurpose =
|
|
957
|
+
| {
|
|
958
|
+
policy_id: string;
|
|
959
|
+
purpose_type: "Minting";
|
|
960
|
+
}
|
|
961
|
+
| {
|
|
962
|
+
purpose_type: "Spending";
|
|
963
|
+
utxo_ref: SerializableTransactionInput;
|
|
964
|
+
}
|
|
965
|
+
| {
|
|
966
|
+
purpose_type: "Rewarding";
|
|
967
|
+
stake_credential: SerializableStakeCredential;
|
|
968
|
+
}
|
|
969
|
+
| {
|
|
970
|
+
certificate: SerializableCertificate;
|
|
971
|
+
index: bigint;
|
|
972
|
+
purpose_type: "Certifying";
|
|
973
|
+
}
|
|
974
|
+
| {
|
|
975
|
+
purpose_type: "Voting";
|
|
976
|
+
voter: SerializableVoter;
|
|
977
|
+
}
|
|
978
|
+
| {
|
|
979
|
+
index: bigint;
|
|
980
|
+
proposal: SerializableProposalProcedure;
|
|
981
|
+
purpose_type: "Proposing";
|
|
982
|
+
};
|
|
983
|
+
export type SerializableStakeCredential =
|
|
984
|
+
| {
|
|
985
|
+
credential_type: "KeyHash";
|
|
986
|
+
hash: string;
|
|
987
|
+
}
|
|
988
|
+
| {
|
|
989
|
+
credential_type: "ScriptHash";
|
|
990
|
+
hash: string;
|
|
991
|
+
};
|
|
992
|
+
export type SerializableCertificate =
|
|
993
|
+
| {
|
|
994
|
+
certificate_type: "StakeRegistration";
|
|
995
|
+
stake_credential: SerializableStakeCredential;
|
|
996
|
+
}
|
|
997
|
+
| {
|
|
998
|
+
certificate_type: "StakeDeregistration";
|
|
999
|
+
stake_credential: SerializableStakeCredential;
|
|
1000
|
+
}
|
|
1001
|
+
| {
|
|
1002
|
+
certificate_type: "StakeDelegation";
|
|
1003
|
+
pool_keyhash: string;
|
|
1004
|
+
stake_credential: SerializableStakeCredential;
|
|
1005
|
+
}
|
|
1006
|
+
| {
|
|
1007
|
+
certificate_type: "PoolRegistration";
|
|
1008
|
+
pool_params: SerializablePoolParams;
|
|
1009
|
+
}
|
|
1010
|
+
| {
|
|
1011
|
+
certificate_type: "PoolRetirement";
|
|
1012
|
+
epoch: bigint;
|
|
1013
|
+
pool_keyhash: string;
|
|
1014
|
+
}
|
|
1015
|
+
| {
|
|
1016
|
+
certificate_type: "Reg";
|
|
1017
|
+
deposit: bigint;
|
|
1018
|
+
stake_credential: SerializableStakeCredential;
|
|
1019
|
+
}
|
|
1020
|
+
| {
|
|
1021
|
+
certificate_type: "UnReg";
|
|
1022
|
+
refund: bigint;
|
|
1023
|
+
stake_credential: SerializableStakeCredential;
|
|
1024
|
+
}
|
|
1025
|
+
| {
|
|
1026
|
+
certificate_type: "VoteDeleg";
|
|
1027
|
+
drep: SerializableDRep;
|
|
1028
|
+
stake_credential: SerializableStakeCredential;
|
|
1029
|
+
}
|
|
1030
|
+
| {
|
|
1031
|
+
certificate_type: "StakeVoteDeleg";
|
|
1032
|
+
drep: SerializableDRep;
|
|
1033
|
+
pool_keyhash: string;
|
|
1034
|
+
stake_credential: SerializableStakeCredential;
|
|
1035
|
+
}
|
|
1036
|
+
| {
|
|
1037
|
+
certificate_type: "StakeRegDeleg";
|
|
1038
|
+
deposit: bigint;
|
|
1039
|
+
pool_keyhash: string;
|
|
1040
|
+
stake_credential: SerializableStakeCredential;
|
|
1041
|
+
}
|
|
1042
|
+
| {
|
|
1043
|
+
certificate_type: "VoteRegDeleg";
|
|
1044
|
+
deposit: bigint;
|
|
1045
|
+
drep: SerializableDRep;
|
|
1046
|
+
stake_credential: SerializableStakeCredential;
|
|
1047
|
+
}
|
|
1048
|
+
| {
|
|
1049
|
+
certificate_type: "StakeVoteRegDeleg";
|
|
1050
|
+
deposit: bigint;
|
|
1051
|
+
drep: SerializableDRep;
|
|
1052
|
+
pool_keyhash: string;
|
|
1053
|
+
stake_credential: SerializableStakeCredential;
|
|
1054
|
+
}
|
|
1055
|
+
| {
|
|
1056
|
+
certificate_type: "AuthCommitteeHot";
|
|
1057
|
+
committee_cold_credential: SerializableStakeCredential;
|
|
1058
|
+
committee_hot_credential: SerializableStakeCredential;
|
|
1059
|
+
}
|
|
1060
|
+
| {
|
|
1061
|
+
anchor?: SerializableAnchor | null;
|
|
1062
|
+
certificate_type: "ResignCommitteeCold";
|
|
1063
|
+
committee_cold_credential: SerializableStakeCredential;
|
|
1064
|
+
}
|
|
1065
|
+
| {
|
|
1066
|
+
anchor?: SerializableAnchor | null;
|
|
1067
|
+
certificate_type: "RegDRepCert";
|
|
1068
|
+
deposit: bigint;
|
|
1069
|
+
drep_credential: SerializableStakeCredential;
|
|
1070
|
+
}
|
|
1071
|
+
| {
|
|
1072
|
+
certificate_type: "UnRegDRepCert";
|
|
1073
|
+
drep_credential: SerializableStakeCredential;
|
|
1074
|
+
refund: bigint;
|
|
1075
|
+
}
|
|
1076
|
+
| {
|
|
1077
|
+
anchor?: SerializableAnchor | null;
|
|
1078
|
+
certificate_type: "UpdateDRepCert";
|
|
1079
|
+
drep_credential: SerializableStakeCredential;
|
|
1080
|
+
};
|
|
1081
|
+
export type SerializableRelay =
|
|
1082
|
+
| {
|
|
1083
|
+
ipv4?: string | null;
|
|
1084
|
+
ipv6?: string | null;
|
|
1085
|
+
port?: number | null;
|
|
1086
|
+
relay_type: "SingleHostAddr";
|
|
1087
|
+
}
|
|
1088
|
+
| {
|
|
1089
|
+
hostname: string;
|
|
1090
|
+
port?: number | null;
|
|
1091
|
+
relay_type: "SingleHostName";
|
|
1092
|
+
}
|
|
1093
|
+
| {
|
|
1094
|
+
hostname: string;
|
|
1095
|
+
relay_type: "MultiHostName";
|
|
1096
|
+
};
|
|
1097
|
+
export type SerializableDRep =
|
|
1098
|
+
| {
|
|
1099
|
+
drep_type: "Key";
|
|
1100
|
+
hash: string;
|
|
1101
|
+
}
|
|
1102
|
+
| {
|
|
1103
|
+
drep_type: "Script";
|
|
1104
|
+
hash: string;
|
|
1105
|
+
}
|
|
1106
|
+
| {
|
|
1107
|
+
drep_type: "Abstain";
|
|
1108
|
+
}
|
|
1109
|
+
| {
|
|
1110
|
+
drep_type: "NoConfidence";
|
|
1111
|
+
};
|
|
1112
|
+
export type SerializableVoter =
|
|
1113
|
+
| {
|
|
1114
|
+
hash: string;
|
|
1115
|
+
voter_type: "ConstitutionalCommitteeScript";
|
|
1116
|
+
}
|
|
1117
|
+
| {
|
|
1118
|
+
hash: string;
|
|
1119
|
+
voter_type: "ConstitutionalCommitteeKey";
|
|
1120
|
+
}
|
|
1121
|
+
| {
|
|
1122
|
+
hash: string;
|
|
1123
|
+
voter_type: "DRepScript";
|
|
1124
|
+
}
|
|
1125
|
+
| {
|
|
1126
|
+
hash: string;
|
|
1127
|
+
voter_type: "DRepKey";
|
|
1128
|
+
}
|
|
1129
|
+
| {
|
|
1130
|
+
hash: string;
|
|
1131
|
+
voter_type: "StakePoolKey";
|
|
1132
|
+
};
|
|
1133
|
+
export type SerializableGovAction =
|
|
1134
|
+
| {
|
|
1135
|
+
action_type: "ParameterChange";
|
|
1136
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1137
|
+
policy_hash?: string | null;
|
|
1138
|
+
protocol_params_update: SerializableProtocolParamsUpdate;
|
|
1139
|
+
}
|
|
1140
|
+
| {
|
|
1141
|
+
action_type: "HardForkInitiation";
|
|
1142
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1143
|
+
protocol_version: ProtocolVersion;
|
|
1144
|
+
}
|
|
1145
|
+
| {
|
|
1146
|
+
action_type: "TreasuryWithdrawals";
|
|
1147
|
+
policy_hash?: string | null;
|
|
1148
|
+
withdrawals: [unknown, unknown][];
|
|
1149
|
+
}
|
|
1150
|
+
| {
|
|
1151
|
+
action_type: "NoConfidence";
|
|
1152
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1153
|
+
}
|
|
1154
|
+
| {
|
|
1155
|
+
action_type: "UpdateCommittee";
|
|
1156
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1157
|
+
members_to_add: [unknown, unknown][];
|
|
1158
|
+
members_to_remove: SerializableStakeCredential[];
|
|
1159
|
+
quorum_threshold: SubCoin;
|
|
1160
|
+
}
|
|
1161
|
+
| {
|
|
1162
|
+
action_type: "NewConstitution";
|
|
1163
|
+
constitution: SerializableConstitution;
|
|
1164
|
+
gov_action_id?: SerializableGovActionId | null;
|
|
1165
|
+
}
|
|
1166
|
+
| {
|
|
1167
|
+
action_type: "Information";
|
|
1168
|
+
};
|
|
1169
|
+
export type SerializableTxInfo =
|
|
1170
|
+
| {
|
|
1171
|
+
V1: SerializableTxInfoV1;
|
|
1172
|
+
}
|
|
1173
|
+
| {
|
|
1174
|
+
V2: SerializableTxInfoV2;
|
|
1175
|
+
}
|
|
1176
|
+
| {
|
|
1177
|
+
V3: SerializableTxInfoV3;
|
|
1178
|
+
};
|
|
1179
|
+
export type SerializableCardanoValue =
|
|
1180
|
+
| {
|
|
1181
|
+
amount: bigint;
|
|
1182
|
+
value_type: "Coin";
|
|
1183
|
+
}
|
|
1184
|
+
| {
|
|
1185
|
+
assets: SerializableAsset[];
|
|
1186
|
+
coin: bigint;
|
|
1187
|
+
value_type: "Multiasset";
|
|
1188
|
+
};
|
|
1189
|
+
export type SerializableTransactionOutput =
|
|
1190
|
+
| {
|
|
1191
|
+
address: string;
|
|
1192
|
+
datum_hash?: string | null;
|
|
1193
|
+
output_format: "Legacy";
|
|
1194
|
+
value: SerializableCardanoValue;
|
|
1195
|
+
}
|
|
1196
|
+
| {
|
|
1197
|
+
address: string;
|
|
1198
|
+
datum_option?: SerializableDatumOption | null;
|
|
1199
|
+
output_format: "PostAlonzo";
|
|
1200
|
+
script_ref?: SerializableScriptRef | null;
|
|
1201
|
+
value: SerializableCardanoValue;
|
|
1202
|
+
};
|
|
1203
|
+
export type SerializableDatumOption =
|
|
1204
|
+
| {
|
|
1205
|
+
datum_type: "Hash";
|
|
1206
|
+
hash: string;
|
|
1207
|
+
}
|
|
1208
|
+
| {
|
|
1209
|
+
data: SerializablePlutusData;
|
|
1210
|
+
datum_type: "Data";
|
|
1211
|
+
};
|
|
1212
|
+
/**
|
|
1213
|
+
* Serializable version of PlutusData that can be converted to/from JSON
|
|
1214
|
+
*/
|
|
1215
|
+
export type SerializablePlutusData =
|
|
1216
|
+
| {
|
|
1217
|
+
any_constructor?: number | null;
|
|
1218
|
+
fields: SerializablePlutusData[];
|
|
1219
|
+
tag: bigint;
|
|
1220
|
+
type: "Constr";
|
|
1221
|
+
}
|
|
1222
|
+
| {
|
|
1223
|
+
key_value_pairs: SerializableKeyValuePair[];
|
|
1224
|
+
type: "Map";
|
|
1225
|
+
}
|
|
1226
|
+
| (
|
|
1227
|
+
| {
|
|
1228
|
+
Int: string;
|
|
1229
|
+
}
|
|
1230
|
+
| {
|
|
1231
|
+
BigUInt: string;
|
|
1232
|
+
}
|
|
1233
|
+
| {
|
|
1234
|
+
BigNInt: string;
|
|
1235
|
+
}
|
|
1236
|
+
)
|
|
1237
|
+
| {
|
|
1238
|
+
type: "BoundedBytes";
|
|
1239
|
+
value: string;
|
|
1240
|
+
}
|
|
1241
|
+
| {
|
|
1242
|
+
type: "Array";
|
|
1243
|
+
values: SerializablePlutusData[];
|
|
1244
|
+
};
|
|
1245
|
+
export type SerializableScriptRef =
|
|
1246
|
+
| {
|
|
1247
|
+
script: string;
|
|
1248
|
+
script_type: "NativeScript";
|
|
1249
|
+
}
|
|
1250
|
+
| {
|
|
1251
|
+
script: string;
|
|
1252
|
+
script_type: "PlutusV1Script";
|
|
1253
|
+
}
|
|
1254
|
+
| {
|
|
1255
|
+
script: string;
|
|
1256
|
+
script_type: "PlutusV2Script";
|
|
1257
|
+
}
|
|
1258
|
+
| {
|
|
1259
|
+
script: string;
|
|
1260
|
+
script_type: "PlutusV3Script";
|
|
1261
|
+
};
|
|
1262
|
+
export type SerializableScriptInfo =
|
|
1263
|
+
| {
|
|
1264
|
+
policy_id: string;
|
|
1265
|
+
script_info_type: "Minting";
|
|
1266
|
+
}
|
|
1267
|
+
| {
|
|
1268
|
+
datum?: SerializablePlutusData | null;
|
|
1269
|
+
script_info_type: "Spending";
|
|
1270
|
+
utxo_ref: SerializableTransactionInput;
|
|
1271
|
+
}
|
|
1272
|
+
| {
|
|
1273
|
+
script_info_type: "Rewarding";
|
|
1274
|
+
stake_credential: SerializableStakeCredential;
|
|
1275
|
+
}
|
|
1276
|
+
| {
|
|
1277
|
+
certificate: SerializableCertificate;
|
|
1278
|
+
index: bigint;
|
|
1279
|
+
script_info_type: "Certifying";
|
|
1280
|
+
}
|
|
1281
|
+
| {
|
|
1282
|
+
script_info_type: "Voting";
|
|
1283
|
+
voter: SerializableVoter;
|
|
1284
|
+
}
|
|
1285
|
+
| {
|
|
1286
|
+
index: bigint;
|
|
1287
|
+
proposal: SerializableProposalProcedure;
|
|
1288
|
+
script_info_type: "Proposing";
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
export interface SerializableTransactionInput {
|
|
1292
|
+
index: bigint;
|
|
1293
|
+
transaction_id: string;
|
|
1294
|
+
}
|
|
1295
|
+
export interface SerializablePoolParams {
|
|
1296
|
+
cost: bigint;
|
|
1297
|
+
margin: SubCoin;
|
|
1298
|
+
operator: string;
|
|
1299
|
+
pledge: bigint;
|
|
1300
|
+
pool_metadata?: SerializablePoolMetadata | null;
|
|
1301
|
+
pool_owners: string[];
|
|
1302
|
+
relays: SerializableRelay[];
|
|
1303
|
+
reward_account: string;
|
|
1304
|
+
vrf_keyhash: string;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export interface SerializablePoolMetadata {
|
|
1308
|
+
hash: string;
|
|
1309
|
+
url: string;
|
|
1310
|
+
}
|
|
1311
|
+
export interface SerializableAnchor {
|
|
1312
|
+
data_hash: string;
|
|
1313
|
+
url: string;
|
|
1314
|
+
}
|
|
1315
|
+
export interface SerializableProposalProcedure {
|
|
1316
|
+
anchor: SerializableAnchor;
|
|
1317
|
+
deposit: bigint;
|
|
1318
|
+
gov_action: SerializableGovAction;
|
|
1319
|
+
reward_account: string;
|
|
1320
|
+
}
|
|
1321
|
+
export interface SerializableGovActionId {
|
|
1322
|
+
action_index: number;
|
|
1323
|
+
transaction_id: string;
|
|
1324
|
+
}
|
|
1325
|
+
export interface SerializableProtocolParamsUpdate {
|
|
1326
|
+
ada_per_utxo_byte?: number | null;
|
|
1327
|
+
collateral_percentage?: number | null;
|
|
1328
|
+
committee_term_limit?: number | null;
|
|
1329
|
+
cost_models_for_script_languages?: SerializableCostModels | null;
|
|
1330
|
+
desired_number_of_stake_pools?: number | null;
|
|
1331
|
+
drep_deposit?: number | null;
|
|
1332
|
+
drep_inactivity_period?: number | null;
|
|
1333
|
+
drep_voting_thresholds?: SerializableDRepVotingThresholds | null;
|
|
1334
|
+
execution_costs?: SerializableExUnitPrices | null;
|
|
1335
|
+
expansion_rate?: SubCoin | null;
|
|
1336
|
+
governance_action_deposit?: number | null;
|
|
1337
|
+
governance_action_validity_period?: number | null;
|
|
1338
|
+
key_deposit?: number | null;
|
|
1339
|
+
max_block_body_size?: number | null;
|
|
1340
|
+
max_block_ex_units?: ExUnits | null;
|
|
1341
|
+
max_block_header_size?: number | null;
|
|
1342
|
+
max_collateral_inputs?: number | null;
|
|
1343
|
+
max_transaction_size?: number | null;
|
|
1344
|
+
max_tx_ex_units?: ExUnits | null;
|
|
1345
|
+
max_value_size?: number | null;
|
|
1346
|
+
maximum_epoch?: number | null;
|
|
1347
|
+
min_committee_size?: number | null;
|
|
1348
|
+
min_pool_cost?: number | null;
|
|
1349
|
+
minfee_a?: number | null;
|
|
1350
|
+
minfee_b?: number | null;
|
|
1351
|
+
minfee_refscript_cost_per_byte?: SubCoin | null;
|
|
1352
|
+
pool_deposit?: number | null;
|
|
1353
|
+
pool_pledge_influence?: SubCoin | null;
|
|
1354
|
+
pool_voting_thresholds?: SerializablePoolVotingThresholds | null;
|
|
1355
|
+
treasury_growth_rate?: SubCoin | null;
|
|
1356
|
+
}
|
|
1357
|
+
export interface SerializableCostModels {
|
|
1358
|
+
plutus_v1?: number[] | null;
|
|
1359
|
+
plutus_v2?: number[] | null;
|
|
1360
|
+
plutus_v3?: number[] | null;
|
|
1361
|
+
}
|
|
1362
|
+
export interface SerializableDRepVotingThresholds {
|
|
1363
|
+
committee_no_confidence: SubCoin;
|
|
1364
|
+
committee_normal: SubCoin;
|
|
1365
|
+
hard_fork_initiation: SubCoin;
|
|
1366
|
+
motion_no_confidence: SubCoin;
|
|
1367
|
+
pp_economic_group: SubCoin;
|
|
1368
|
+
pp_governance_group: SubCoin;
|
|
1369
|
+
pp_network_group: SubCoin;
|
|
1370
|
+
pp_technical_group: SubCoin;
|
|
1371
|
+
treasury_withdrawal: SubCoin;
|
|
1372
|
+
update_constitution: SubCoin;
|
|
1373
|
+
}
|
|
1374
|
+
export interface SerializableExUnitPrices {
|
|
1375
|
+
mem_price: SubCoin;
|
|
1376
|
+
step_price: SubCoin;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
export interface SerializablePoolVotingThresholds {
|
|
1380
|
+
committee_no_confidence: SubCoin;
|
|
1381
|
+
committee_normal: SubCoin;
|
|
1382
|
+
hard_fork_initiation: SubCoin;
|
|
1383
|
+
motion_no_confidence: SubCoin;
|
|
1384
|
+
security_voting_threshold: SubCoin;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
export interface SerializableConstitution {
|
|
1388
|
+
anchor: SerializableAnchor;
|
|
1389
|
+
guardrail_script?: string | null;
|
|
1390
|
+
}
|
|
1391
|
+
export interface SerializableTxInfoV1 {
|
|
1392
|
+
certificates: SerializableCertificate[];
|
|
1393
|
+
data: [unknown, unknown][];
|
|
1394
|
+
fee: SerializableCardanoValue;
|
|
1395
|
+
id: string;
|
|
1396
|
+
inputs: SerializableTxInInfo[];
|
|
1397
|
+
mint: SerializableMintValue;
|
|
1398
|
+
outputs: SerializableTransactionOutput[];
|
|
1399
|
+
redeemers: [unknown, unknown][];
|
|
1400
|
+
signatories: string[];
|
|
1401
|
+
valid_range: SerializableTimeRange;
|
|
1402
|
+
withdrawals: [unknown, unknown][];
|
|
1403
|
+
}
|
|
1404
|
+
export interface SerializableAsset {
|
|
1405
|
+
policy_id: string;
|
|
1406
|
+
tokens: SerializableToken[];
|
|
1407
|
+
}
|
|
1408
|
+
export interface SerializableToken {
|
|
1409
|
+
asset_name: string;
|
|
1410
|
+
/**
|
|
1411
|
+
* Decimal string. Held as a string because the value range spans both
|
|
1412
|
+
* negative mint/burn amounts and `Value` amounts up to `u64::MAX` —
|
|
1413
|
+
* no fixed-width integer type covers both without loss.
|
|
1414
|
+
*/
|
|
1415
|
+
quantity: string;
|
|
1416
|
+
}
|
|
1417
|
+
export interface SerializableTxInInfo {
|
|
1418
|
+
out_ref: SerializableTransactionInput;
|
|
1419
|
+
resolved: SerializableTransactionOutput;
|
|
1420
|
+
}
|
|
1421
|
+
export interface SerializableKeyValuePair {
|
|
1422
|
+
key: SerializablePlutusData;
|
|
1423
|
+
value: SerializablePlutusData;
|
|
1424
|
+
}
|
|
1425
|
+
export interface SerializableMintValue {
|
|
1426
|
+
mint_value: SerializableAsset[];
|
|
1427
|
+
}
|
|
1428
|
+
export interface SerializableTimeRange {
|
|
1429
|
+
lower_bound?: number | null;
|
|
1430
|
+
upper_bound?: number | null;
|
|
1431
|
+
}
|
|
1432
|
+
export interface SerializableTxInfoV2 {
|
|
1433
|
+
certificates: SerializableCertificate[];
|
|
1434
|
+
data: [unknown, unknown][];
|
|
1435
|
+
fee: SerializableCardanoValue;
|
|
1436
|
+
id: string;
|
|
1437
|
+
inputs: SerializableTxInInfo[];
|
|
1438
|
+
mint: SerializableMintValue;
|
|
1439
|
+
outputs: SerializableTransactionOutput[];
|
|
1440
|
+
redeemers: [unknown, unknown][];
|
|
1441
|
+
reference_inputs: SerializableTxInInfo[];
|
|
1442
|
+
signatories: string[];
|
|
1443
|
+
valid_range: SerializableTimeRange;
|
|
1444
|
+
withdrawals: [unknown, unknown][];
|
|
1445
|
+
}
|
|
1446
|
+
export interface SerializableTxInfoV3 {
|
|
1447
|
+
certificates: SerializableCertificate[];
|
|
1448
|
+
current_treasury_amount?: number | null;
|
|
1449
|
+
data: [unknown, unknown][];
|
|
1450
|
+
fee: bigint;
|
|
1451
|
+
id: string;
|
|
1452
|
+
inputs: SerializableTxInInfo[];
|
|
1453
|
+
mint: SerializableMintValue;
|
|
1454
|
+
outputs: SerializableTransactionOutput[];
|
|
1455
|
+
proposal_procedures: SerializableProposalProcedure[];
|
|
1456
|
+
redeemers: [unknown, unknown][];
|
|
1457
|
+
reference_inputs: SerializableTxInInfo[];
|
|
1458
|
+
signatories: string[];
|
|
1459
|
+
treasury_donation?: number | null;
|
|
1460
|
+
valid_range: SerializableTimeRange;
|
|
1461
|
+
votes: [unknown, unknown][];
|
|
1462
|
+
withdrawals: [unknown, unknown][];
|
|
1463
|
+
}
|
|
1464
|
+
|
|
885
1465
|
export type GovernanceActionType =
|
|
886
1466
|
| "parameterChangeAction"
|
|
887
1467
|
| "hardForkInitiationAction"
|
|
@@ -1878,6 +2458,11 @@ export interface EvalRedeemerResult {
|
|
|
1878
2458
|
index: bigint;
|
|
1879
2459
|
logs: string[];
|
|
1880
2460
|
provided_ex_units: ExUnits;
|
|
2461
|
+
/**
|
|
2462
|
+
* The mapped script context, serialized as a JSON string.
|
|
2463
|
+
*/
|
|
2464
|
+
script_context?: string | null;
|
|
2465
|
+
script_context_bytes?: string | null;
|
|
1881
2466
|
success: boolean;
|
|
1882
2467
|
tag: RedeemerTag;
|
|
1883
2468
|
}
|
|
Binary file
|
|
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export const decode_specific_type: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
5
5
|
export const get_decodable_types: () => [number, number];
|
|
6
6
|
export const get_possible_types_for_input: (a: number, b: number) => [number, number];
|
|
7
|
+
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
7
8
|
export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
|
|
8
9
|
export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
|
|
9
10
|
export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
@@ -19,7 +20,6 @@ export const map_cbor_to_cddl: (a: number, b: number, c: number, d: number, e: n
|
|
|
19
20
|
export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
20
21
|
export const validate_cddl: (a: number, b: number) => [number, number, number];
|
|
21
22
|
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
22
|
-
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
23
23
|
export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
24
24
|
export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
25
25
|
export const validate_cbor_from_slice: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
package/package.json
CHANGED