@cardananium/cquisitor-lib 0.1.0-beta.46 → 0.1.0-beta.48
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/README.md +70 -17
- package/browser/cquisitor_lib.d.ts +132 -11
- package/browser/cquisitor_lib.js +1 -1
- package/browser/cquisitor_lib_bg.js +171 -0
- package/browser/cquisitor_lib_bg.wasm +0 -0
- package/browser/cquisitor_lib_bg.wasm.d.ts +9 -4
- package/node/cquisitor_lib.d.ts +132 -11
- package/node/cquisitor_lib.js +176 -0
- package/node/cquisitor_lib_bg.wasm +0 -0
- package/node/cquisitor_lib_bg.wasm.d.ts +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,9 +24,10 @@ Functions:
|
|
|
24
24
|
|
|
25
25
|
### CBOR Decoder & CDDL Validation
|
|
26
26
|
|
|
27
|
-
- `cbor_to_json(cbor_hex)` - Converts raw CBOR to JSON with positional information, supporting indefinite arrays/maps and all CBOR types. Each node carries an optional `oddities` array flagging deviations from RFC 8949 deterministic encoding (overlong integers/floats, indefinite length, unsorted/duplicate map keys, non-canonical bignums).
|
|
28
|
-
- `validate_cddl(cddl)` - Parses a CDDL schema and
|
|
29
|
-
- `validate_cbor_against_cddl(cbor_hex, cddl, rule_name)` - Validates CBOR payload against a
|
|
27
|
+
- `cbor_to_json(cbor_hex)` - Converts raw CBOR to JSON with positional information, supporting indefinite arrays/maps and all CBOR types. Each node carries an optional `oddities` array flagging deviations from RFC 8949 deterministic encoding (overlong integers/floats, indefinite length, unsorted/duplicate map keys, non-canonical bignums). Never throws on malformed input — returns a `{ok, value}` / `{ok: false, error, partial?}` union where `error` is a structured `CborDecodeError` (kind / byte offset / byte span / semantic `path`) and `partial` is the sub-tree decoded before the failure, with every unfinished container flagged `incomplete: true`.
|
|
28
|
+
- `validate_cddl(cddl)` - Parses a CDDL schema; reports parse errors and unresolved rule references (e.g. `thing = [unknown_rule, int]` → `kind: "unresolved_references"`).
|
|
29
|
+
- `validate_cbor_against_cddl(cbor_hex, cddl, rule_name)` - Validates a CBOR payload against a named rule. Errors carry `kind`, `expected`, semantic `path`, byte/anchor spans, and an `additional` array when multiple violations fire.
|
|
30
|
+
- `cbor_to_schema_json(cbor_hex, cddl, rule_name)` - Maps decoded CBOR onto a CDDL schema and returns labelled JSON (e.g. Cardano `[body, witness_set, bool, aux]` becomes `{transaction_body, transaction_witness_set, ...}`). Handles generics (`set<a>`), tagged sets, type rules used as field labels, and a few well-known tags (bignum → string number, datetime → ISO string). Sub-structures the schema doesn't cover surface under `@extra` / `@positional` so partial matches don't lose data.
|
|
30
31
|
|
|
31
32
|
### Plutus Script Decoder
|
|
32
33
|
|
|
@@ -308,40 +309,92 @@ const possibleTypes = get_possible_types_for_input("e1a...");
|
|
|
308
309
|
|
|
309
310
|
### CBOR Decoder
|
|
310
311
|
|
|
311
|
-
#### `cbor_to_json(cbor_hex: string):
|
|
312
|
+
#### `cbor_to_json(cbor_hex: string): CborDecodeResult`
|
|
312
313
|
|
|
313
314
|
Converts CBOR to JSON with positional metadata. Each node has `position_info` (byte span of its header) and, for containers/tags, `struct_position_info` (span of the whole subtree). Non-canonical encoding deviations (per RFC 8949 §4.1/§4.2) are flagged locally on the offending node via an optional `oddities: CborOddity[]` field — canonical inputs omit the field entirely.
|
|
314
315
|
|
|
316
|
+
The function **never throws** on malformed input. On success it returns `{ ok: true, value }`; on failure `{ ok: false, error, partial? }` where `error` is a structured `CborDecodeError` and `partial` is the sub-tree decoded up to the failure point:
|
|
317
|
+
|
|
315
318
|
```typescript
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
//
|
|
319
|
-
// { kind: "
|
|
320
|
-
// { kind: "
|
|
321
|
-
// { kind: "
|
|
322
|
-
// { kind: "
|
|
319
|
+
const r = cbor_to_json("a26461646472...");
|
|
320
|
+
if (r.ok) {
|
|
321
|
+
// r.value — the full positional tree; each node may carry oddities like:
|
|
322
|
+
// { kind: "IntNotShortest", detail: "value 15 uses 2-byte header, shortest is 1" }
|
|
323
|
+
// { kind: "IndefiniteLength", detail: "indefinite-length map" }
|
|
324
|
+
// { kind: "MapKeysNotSorted", detail: "key at offset 3 sorts after key at offset 5" }
|
|
325
|
+
// { kind: "DuplicateMapKeys", detail: "duplicate key at offsets 3 and 6" }
|
|
326
|
+
// { kind: "BignumForSmallInt", detail: "unsigned bignum fits in a native CBOR integer" }
|
|
327
|
+
} else {
|
|
328
|
+
// r.error: { kind, offset?, byte_span?, path, message }
|
|
329
|
+
// kind — machine-readable tag ("invalid_syntax", "unexpected_eof", ...).
|
|
330
|
+
// offset — byte where decoding stopped.
|
|
331
|
+
// byte_span — { offset, length } when the failure pins a range.
|
|
332
|
+
// path — structural location, e.g. "$.entries[1].value[0]".
|
|
333
|
+
// r.partial (optional) — same shape as a CborValue, but every unfinished
|
|
334
|
+
// container carries `incomplete: true`, and partial map entries carry
|
|
335
|
+
// `incomplete_at: "key" | "value"` on the half that didn't parse.
|
|
336
|
+
}
|
|
323
337
|
```
|
|
324
338
|
|
|
325
|
-
See `CborOddityKind` in the type definitions for the full
|
|
339
|
+
See `CborOddityKind` and `CborDecodeErrorKind` in the type definitions for the full lists.
|
|
326
340
|
|
|
327
341
|
#### `validate_cddl(cddl: string): { valid: boolean, error?: object }`
|
|
328
342
|
|
|
329
|
-
Parses a CDDL schema and reports whether it is well-formed.
|
|
343
|
+
Parses a CDDL schema and reports whether it is well-formed. Beyond surface parse errors this also catches **dangling rule references** at parse time, surfaced as `kind: "unresolved_references"`.
|
|
330
344
|
|
|
331
345
|
```typescript
|
|
332
|
-
|
|
346
|
+
validate_cddl("thing = {n: uint}");
|
|
333
347
|
// { valid: true }
|
|
348
|
+
|
|
349
|
+
validate_cddl("thing = [unknown_rule, int]");
|
|
350
|
+
// { valid: false, error: { kind: "unresolved_references",
|
|
351
|
+
// message: "missing definition for rule unknown_rule" } }
|
|
334
352
|
```
|
|
335
353
|
|
|
354
|
+
`error.kind` values: `"parse_error"`, `"unresolved_references"`.
|
|
355
|
+
|
|
336
356
|
#### `validate_cbor_against_cddl(cbor_hex: string, cddl: string, rule_name: string): { valid: boolean, error?: object }`
|
|
337
357
|
|
|
338
|
-
Validates a CBOR payload against a specific rule in a CDDL schema.
|
|
358
|
+
Validates a CBOR payload against a specific rule in a CDDL schema. The rule does not have to be the first rule in the document — when it isn't, the validator wraps it in a synthetic root internally.
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
validate_cbor_against_cddl("01", "thing = tstr", "thing");
|
|
362
|
+
// {
|
|
363
|
+
// valid: false,
|
|
364
|
+
// error: {
|
|
365
|
+
// kind: "mismatch",
|
|
366
|
+
// expected: "tstr",
|
|
367
|
+
// path: "$",
|
|
368
|
+
// byte_spans: [{ offset: 0, length: 1 }],
|
|
369
|
+
// message: "expected type tstr, got Integer(Integer(1))"
|
|
370
|
+
// }
|
|
371
|
+
// }
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
`error.kind` values: `"parse_error"`, `"unresolved_references"`, `"missing_rule"`, `"input_parse"`, `"mismatch"`, `"map_cut"`, `"generic"`. When multiple violations fire, the headline goes in the top-level fields and the rest land in `error.additional`.
|
|
375
|
+
|
|
376
|
+
#### `cbor_to_schema_json(cbor_hex: string, cddl: string, rule_name: string): unknown`
|
|
377
|
+
|
|
378
|
+
Walks the CDDL alongside the decoded CBOR and produces a JSON tree where positional/numeric-keyed structures are replaced with the names the schema declares. Useful for turning a Cardano transaction CBOR into something inspectable without hand-mapping every field.
|
|
339
379
|
|
|
340
380
|
```typescript
|
|
341
|
-
|
|
342
|
-
// {
|
|
381
|
+
cbor_to_schema_json(txHex, conwayCddl, "transaction");
|
|
382
|
+
// {
|
|
383
|
+
// transaction_body: {
|
|
384
|
+
// 0: { "@tag": 258, "@value": [{ transaction_id: "16b6...", index: 0 }] },
|
|
385
|
+
// 1: [{ address: "00ae...", amount: 1_000_000 }, ...],
|
|
386
|
+
// 2: 200000,
|
|
387
|
+
// 7: "bdaa..."
|
|
388
|
+
// },
|
|
389
|
+
// transaction_witness_set: {
|
|
390
|
+
// 0: { "@tag": 258, "@value": [{ vkey: "f8f5...", signature: "1e14..." }] }
|
|
391
|
+
// },
|
|
392
|
+
// "@positional": [true, { "@tag": 259, "@value": {} }]
|
|
393
|
+
// }
|
|
343
394
|
```
|
|
344
395
|
|
|
396
|
+
Recognised features: type choices (first match wins), generics (`set<a>`), tagged data (well-known tags 0/2/3 specialised to ISO date / bignum string), rule references, optionals/repetitions, prelude scalars. Sub-structures the schema doesn't cover or that don't match any choice fall back to a raw form under `@extra` (maps) or `@positional` (arrays) so data is never silently dropped.
|
|
397
|
+
|
|
345
398
|
### Plutus Script Decoder
|
|
346
399
|
|
|
347
400
|
#### `decode_plutus_program_uplc_json(hex: string): ProgramJson`
|
|
@@ -102,21 +102,64 @@ export function get_possible_types_for_input(input: string): (string)[];
|
|
|
102
102
|
* @param {string} cbor_hex
|
|
103
103
|
* @returns {any}
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Decodes a CBOR hex string into a positional JSON tree.
|
|
107
|
+
*
|
|
108
|
+
* Never throws on malformed input — on failure returns
|
|
109
|
+
* `{ ok: false, error: CborDecodeError, partial? }`. Structured errors
|
|
110
|
+
* carry `kind`, `offset`, a `byte_span`, a semantic `path` into the
|
|
111
|
+
* failing position, and a human `message`.
|
|
112
|
+
*
|
|
113
|
+
* When anything was successfully decoded before the failure, `partial`
|
|
114
|
+
* contains the prefix tree with every un-finished container flagged
|
|
115
|
+
* `incomplete: true`. Node shape otherwise matches the success value, so
|
|
116
|
+
* renderers can display it the same way.
|
|
117
|
+
*/
|
|
118
|
+
export function cbor_to_json(cbor_hex: string): CborDecodeResult;
|
|
119
|
+
|
|
120
|
+
export type CborDecodeResult =
|
|
121
|
+
| { ok: true; value: CborValue }
|
|
122
|
+
| { ok: false; error: CborDecodeError; partial?: CborPartialValue };
|
|
123
|
+
|
|
124
|
+
export type CborDecodeErrorKind =
|
|
125
|
+
| "invalid_hex"
|
|
126
|
+
| "invalid_syntax"
|
|
127
|
+
| "unexpected_eof"
|
|
128
|
+
| "unexpected_break"
|
|
129
|
+
| "trailing_data"
|
|
130
|
+
| "invalid_utf8"
|
|
131
|
+
| "invalid_chunk"
|
|
132
|
+
| "int_not_representable"
|
|
133
|
+
| "non_finite_float"
|
|
134
|
+
| "io_error";
|
|
135
|
+
|
|
136
|
+
export interface CborDecodeError {
|
|
137
|
+
kind: CborDecodeErrorKind;
|
|
138
|
+
/** Human-readable message. Not stable — use `kind` for branching. */
|
|
139
|
+
message: string;
|
|
140
|
+
/** Semantic path into the decoded tree (e.g. `$.entries[1].value[0]`). */
|
|
141
|
+
path: string;
|
|
142
|
+
/** Byte offset where decoding failed. Absent only for rare IO fallbacks. */
|
|
143
|
+
offset?: number;
|
|
144
|
+
/** Byte range pinned by the failure, when wider than a single byte. */
|
|
145
|
+
byte_span?: CborPosition;
|
|
146
|
+
}
|
|
106
147
|
|
|
107
148
|
/**
|
|
108
|
-
* Validates a CDDL schema
|
|
109
|
-
*
|
|
110
|
-
*
|
|
149
|
+
* Validates a CDDL schema. Returns `{ valid: true }` if the schema parses
|
|
150
|
+
* **and** every rule reference resolves; otherwise `{ valid: false, error }`.
|
|
151
|
+
* Undefined rule references come back with `kind: "unresolved_references"`
|
|
152
|
+
* (e.g. `thing = [unknown_rule, int]`).
|
|
111
153
|
* @param {string} cddl
|
|
112
154
|
* @returns {any}
|
|
113
155
|
*/
|
|
114
156
|
export function validate_cddl(cddl: string): CddlValidationResult;
|
|
115
157
|
|
|
116
158
|
/**
|
|
117
|
-
* Validates CBOR bytes against a rule in the given CDDL schema. On failure
|
|
118
|
-
* `error` describes the mismatch, including a semantic path
|
|
119
|
-
* in the input that produced it
|
|
159
|
+
* Validates CBOR bytes against a rule in the given CDDL schema. On failure
|
|
160
|
+
* `error` describes the mismatch, including a semantic `path`, the byte
|
|
161
|
+
* spans in the input that produced it, and (when several validation
|
|
162
|
+
* errors fire) an `additional` array with the rest.
|
|
120
163
|
* @param {string} cbor_hex
|
|
121
164
|
* @param {string} cddl
|
|
122
165
|
* @param {string} rule_name
|
|
@@ -128,6 +171,28 @@ export function validate_cbor_against_cddl(
|
|
|
128
171
|
rule_name: string
|
|
129
172
|
): CborValidationResult;
|
|
130
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Maps decoded CBOR onto a CDDL schema and returns labelled JSON. Where
|
|
176
|
+
* `cbor_to_json` returns positional CBOR (numeric map keys, raw arrays),
|
|
177
|
+
* this walks the schema in parallel and replaces them with the named
|
|
178
|
+
* fields the CDDL declares — turning Cardano shapes like
|
|
179
|
+
* `[transaction_body, transaction_witness_set, bool, ...]` into
|
|
180
|
+
* `{transaction_body: {...}, transaction_witness_set: {...}, ...}`.
|
|
181
|
+
*
|
|
182
|
+
* Sub-structures the schema doesn't cover fall back to a raw
|
|
183
|
+
* representation (under `@extra` for maps / `@positional` for arrays),
|
|
184
|
+
* so partial matches still yield useful output.
|
|
185
|
+
* @param {string} cbor_hex
|
|
186
|
+
* @param {string} cddl
|
|
187
|
+
* @param {string} rule_name
|
|
188
|
+
* @returns {any}
|
|
189
|
+
*/
|
|
190
|
+
export function cbor_to_schema_json(
|
|
191
|
+
cbor_hex: string,
|
|
192
|
+
cddl: string,
|
|
193
|
+
rule_name: string
|
|
194
|
+
): unknown;
|
|
195
|
+
|
|
131
196
|
export function check_block_or_tx_signatures(hex_str: string): CheckSignaturesResult;
|
|
132
197
|
|
|
133
198
|
/**
|
|
@@ -279,6 +344,63 @@ export type CborValue =
|
|
|
279
344
|
| CborIndefiniteString
|
|
280
345
|
| CborIndefiniteBytes;
|
|
281
346
|
|
|
347
|
+
/**
|
|
348
|
+
* Sub-tree returned alongside a decode error. Structurally identical to
|
|
349
|
+
* `CborValue`, with two additional flags present **only** on nodes that
|
|
350
|
+
* couldn't be finished:
|
|
351
|
+
*
|
|
352
|
+
* - `incomplete: true` — on containers (Array / Map / Tag /
|
|
353
|
+
* IndefiniteLengthBytes / IndefiniteLengthString) whose body was cut
|
|
354
|
+
* short by the failure. For definite-length Array/Map the `items` field
|
|
355
|
+
* retains the wire-declared count; `values.length` shows how many slots
|
|
356
|
+
* actually decoded.
|
|
357
|
+
* - `incomplete_at: "key" | "value"` — on the single map entry where
|
|
358
|
+
* decoding stopped; at most one of `key` / `value` on that entry is
|
|
359
|
+
* populated, indicating which half had been parsed before the failure.
|
|
360
|
+
*/
|
|
361
|
+
export type CborPartialValue =
|
|
362
|
+
| CborSimple
|
|
363
|
+
| CborPartialArray
|
|
364
|
+
| CborPartialMap
|
|
365
|
+
| CborPartialTag
|
|
366
|
+
| CborPartialIndefiniteString
|
|
367
|
+
| CborPartialIndefiniteBytes;
|
|
368
|
+
|
|
369
|
+
export interface CborPartialArray extends Omit<CborArray, "values"> {
|
|
370
|
+
values: CborPartialValue[];
|
|
371
|
+
incomplete?: true;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface CborPartialMap extends Omit<CborMap, "values"> {
|
|
375
|
+
values: Array<CborPartialMapEntry | { key: CborValue; value: CborValue }>;
|
|
376
|
+
incomplete?: true;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface CborPartialMapEntry {
|
|
380
|
+
key?: CborPartialValue;
|
|
381
|
+
value?: CborPartialValue;
|
|
382
|
+
incomplete: true;
|
|
383
|
+
incomplete_at: "key" | "value";
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface CborPartialTag extends Omit<CborTag, "value"> {
|
|
387
|
+
/** Absent when the inner item could not be parsed at all. */
|
|
388
|
+
value?: CborPartialValue;
|
|
389
|
+
incomplete?: true;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface CborPartialIndefiniteString
|
|
393
|
+
extends Omit<CborIndefiniteString, "chunks"> {
|
|
394
|
+
chunks: CborValue[];
|
|
395
|
+
incomplete?: true;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface CborPartialIndefiniteBytes
|
|
399
|
+
extends Omit<CborIndefiniteBytes, "chunks"> {
|
|
400
|
+
chunks: CborValue[];
|
|
401
|
+
incomplete?: true;
|
|
402
|
+
}
|
|
403
|
+
|
|
282
404
|
export type CddlValidationResult =
|
|
283
405
|
| { valid: true }
|
|
284
406
|
| { valid: false; error: CddlErrorInfo };
|
|
@@ -295,13 +417,12 @@ export type CborValidationResult =
|
|
|
295
417
|
/**
|
|
296
418
|
* `kind` categorises the failure:
|
|
297
419
|
* - "parse_error" — the CDDL itself failed to parse
|
|
298
|
-
* - "
|
|
299
|
-
* - "missing_rule" — the
|
|
300
|
-
* - "unsupported" — the CDDL uses a feature cddl-cat doesn't implement
|
|
301
|
-
* - "value_error" — a CBOR value cannot be validated
|
|
420
|
+
* - "unresolved_references" — the CDDL references a rule name that isn't defined
|
|
421
|
+
* - "missing_rule" — the rule name passed to `validate_cbor_against_cddl` is not in the CDDL
|
|
302
422
|
* - "input_parse" — the CBOR bytes themselves are malformed
|
|
303
423
|
* - "mismatch" / "map_cut" — a data mismatch; inspect `expected`, `path`,
|
|
304
424
|
* `byte_spans`, and `anchor_spans` for precise locations
|
|
425
|
+
* - "generic" — anything that didn't fit one of the buckets above
|
|
305
426
|
*/
|
|
306
427
|
export interface CborValidationErrorInfo {
|
|
307
428
|
kind: string;
|
package/browser/cquisitor_lib.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./cquisitor_lib_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
Address, AddressKind, Anchor, AnchorDataHash, AssetName, AssetNames, Assets, AuxiliaryData, AuxiliaryDataHash, AuxiliaryDataSet, BaseAddress, BigInt, BigNum, Bip32PrivateKey, Bip32PublicKey, Block, BlockEra, BlockHash, BootstrapWitness, BootstrapWitnesses, ByronAddress, ByronAddressType, CborContainerType, CborSetType, Certificate, CertificateKind, Certificates, CertificatesBuilder, ChangeConfig, CoinSelectionStrategyCIP2, Committee, CommitteeColdResign, CommitteeHotAuth, Constitution, ConstrPlutusData, CostModel, Costmdls, CredKind, Credential, Credentials, DNSRecordAorAAAA, DNSRecordSRV, DRep, DRepDeregistration, DRepKind, DRepRegistration, DRepUpdate, DRepVotingThresholds, DataCost, DataHash, DatumSource, Ed25519KeyHash, Ed25519KeyHashes, Ed25519Signature, EnterpriseAddress, ExUnitPrices, ExUnits, FixedBlock, FixedTransaction, FixedTransactionBodies, FixedTransactionBody, FixedTxWitnessesSet, FixedVersionedBlock, GeneralTransactionMetadata, GenesisDelegateHash, GenesisHash, GenesisHashes, GenesisKeyDelegation, GovernanceAction, GovernanceActionId, GovernanceActionIds, GovernanceActionKind, HardForkInitiationAction, Header, HeaderBody, InfoAction, Int, Ipv4, Ipv6, KESSignature, KESVKey, Language, LanguageKind, Languages, LegacyDaedalusPrivateKey, LinearFee, MIRKind, MIRPot, MIRToStakeCredentials, MalformedAddress, MetadataJsonSchema, MetadataList, MetadataMap, Mint, MintAssets, MintBuilder, MintWitness, MintsAssets, MoveInstantaneousReward, MoveInstantaneousRewardsCert, MultiAsset, MultiHostName, NativeScript, NativeScriptKind, NativeScriptSource, NativeScripts, NetworkId, NetworkIdKind, NetworkInfo, NewConstitutionAction, NoConfidenceAction, Nonce, OperationalCert, OutputDatum, ParameterChangeAction, PlutusData, PlutusDataKind, PlutusDatumSchema, PlutusList, PlutusMap, PlutusMapValues, PlutusScript, PlutusScriptSource, PlutusScripts, PlutusWitness, PlutusWitnesses, Pointer, PointerAddress, PoolMetadata, PoolMetadataHash, PoolParams, PoolRegistration, PoolRetirement, PoolVotingThresholds, PrivateKey, ProposedProtocolParameterUpdates, ProtocolParamUpdate, ProtocolVersion, PublicKey, PublicKeys, Redeemer, RedeemerTag, RedeemerTagKind, Redeemers, Relay, RelayKind, Relays, RewardAddress, RewardAddresses, ScriptAll, ScriptAny, ScriptDataHash, ScriptHash, ScriptHashNamespace, ScriptHashes, ScriptNOfK, ScriptPubkey, ScriptRef, ScriptSchema, SingleHostAddr, SingleHostName, StakeAndVoteDelegation, StakeDelegation, StakeDeregistration, StakeRegistration, StakeRegistrationAndDelegation, StakeVoteRegistrationAndDelegation, Strings, TimelockExpiry, TimelockStart, Transaction, TransactionBatch, TransactionBatchList, TransactionBodies, TransactionBody, TransactionBuilder, TransactionBuilderConfig, TransactionBuilderConfigBuilder, TransactionHash, TransactionInput, TransactionInputs, TransactionMetadatum, TransactionMetadatumKind, TransactionMetadatumLabels, TransactionOutput, TransactionOutputAmountBuilder, TransactionOutputBuilder, TransactionOutputs, TransactionSetsState, TransactionUnspentOutput, TransactionUnspentOutputs, TransactionWitnessSet, TransactionWitnessSets, TreasuryWithdrawals, TreasuryWithdrawalsAction, TxInputsBuilder, URL, UnitInterval, Update, UpdateCommitteeAction, VRFCert, VRFKeyHash, VRFVKey, Value, VersionedBlock, Vkey, Vkeys, Vkeywitness, Vkeywitnesses, VoteDelegation, VoteKind, VoteRegistrationAndDelegation, Voter, VoterKind, Voters, VotingBuilder, VotingProcedure, VotingProcedures, VotingProposal, VotingProposalBuilder, VotingProposals, Withdrawals, WithdrawalsBuilder, calculate_ex_units_ceil_cost, cbor_to_json, check_block_or_tx_signatures, create_send_all, decode_arbitrary_bytes_from_metadatum, decode_metadatum_to_json_str, decode_plutus_datum_to_json_str, decode_plutus_program_pretty_uplc, decode_plutus_program_uplc_json, decode_specific_type, decrypt_with_password, encode_arbitrary_bytes_as_metadatum, encode_json_str_to_metadatum, encode_json_str_to_native_script, encode_json_str_to_plutus_datum, encrypt_with_password, execute_tx_scripts, extract_hashes_from_transaction_js, get_decodable_types, get_deposit, get_implicit_input, get_necessary_data_list_js, get_possible_types_for_input, get_ref_script_bytes, get_utxo_list_from_tx, has_transaction_set_tag, hash_auxiliary_data, hash_plutus_data, hash_script_data, make_daedalus_bootstrap_witness, make_icarus_bootstrap_witness, make_vkey_witness, min_ada_for_output, min_fee, min_ref_script_fee, min_script_fee, validate_cbor_against_cddl, validate_cddl, validate_transaction_js
|
|
8
|
+
Address, AddressKind, Anchor, AnchorDataHash, AssetName, AssetNames, Assets, AuxiliaryData, AuxiliaryDataHash, AuxiliaryDataSet, BaseAddress, BigInt, BigNum, Bip32PrivateKey, Bip32PublicKey, Block, BlockEra, BlockHash, BootstrapWitness, BootstrapWitnesses, ByronAddress, ByronAddressType, CborContainerType, CborSetType, Certificate, CertificateKind, Certificates, CertificatesBuilder, ChangeConfig, CoinSelectionStrategyCIP2, Committee, CommitteeColdResign, CommitteeHotAuth, Constitution, ConstrPlutusData, CostModel, Costmdls, CredKind, Credential, Credentials, DNSRecordAorAAAA, DNSRecordSRV, DRep, DRepDeregistration, DRepKind, DRepRegistration, DRepUpdate, DRepVotingThresholds, DataCost, DataHash, DatumSource, Ed25519KeyHash, Ed25519KeyHashes, Ed25519Signature, EnterpriseAddress, ExUnitPrices, ExUnits, FixedBlock, FixedTransaction, FixedTransactionBodies, FixedTransactionBody, FixedTxWitnessesSet, FixedVersionedBlock, GeneralTransactionMetadata, GenesisDelegateHash, GenesisHash, GenesisHashes, GenesisKeyDelegation, GovernanceAction, GovernanceActionId, GovernanceActionIds, GovernanceActionKind, HardForkInitiationAction, Header, HeaderBody, InfoAction, Int, Ipv4, Ipv6, KESSignature, KESVKey, Language, LanguageKind, Languages, LegacyDaedalusPrivateKey, LinearFee, MIRKind, MIRPot, MIRToStakeCredentials, MalformedAddress, MetadataJsonSchema, MetadataList, MetadataMap, Mint, MintAssets, MintBuilder, MintWitness, MintsAssets, MoveInstantaneousReward, MoveInstantaneousRewardsCert, MultiAsset, MultiHostName, NativeScript, NativeScriptKind, NativeScriptSource, NativeScripts, NetworkId, NetworkIdKind, NetworkInfo, NewConstitutionAction, NoConfidenceAction, Nonce, OperationalCert, OutputDatum, ParameterChangeAction, PlutusData, PlutusDataKind, PlutusDatumSchema, PlutusList, PlutusMap, PlutusMapValues, PlutusScript, PlutusScriptSource, PlutusScripts, PlutusWitness, PlutusWitnesses, Pointer, PointerAddress, PoolMetadata, PoolMetadataHash, PoolParams, PoolRegistration, PoolRetirement, PoolVotingThresholds, PrivateKey, ProposedProtocolParameterUpdates, ProtocolParamUpdate, ProtocolVersion, PublicKey, PublicKeys, Redeemer, RedeemerTag, RedeemerTagKind, Redeemers, Relay, RelayKind, Relays, RewardAddress, RewardAddresses, ScriptAll, ScriptAny, ScriptDataHash, ScriptHash, ScriptHashNamespace, ScriptHashes, ScriptNOfK, ScriptPubkey, ScriptRef, ScriptSchema, SingleHostAddr, SingleHostName, StakeAndVoteDelegation, StakeDelegation, StakeDeregistration, StakeRegistration, StakeRegistrationAndDelegation, StakeVoteRegistrationAndDelegation, Strings, TimelockExpiry, TimelockStart, Transaction, TransactionBatch, TransactionBatchList, TransactionBodies, TransactionBody, TransactionBuilder, TransactionBuilderConfig, TransactionBuilderConfigBuilder, TransactionHash, TransactionInput, TransactionInputs, TransactionMetadatum, TransactionMetadatumKind, TransactionMetadatumLabels, TransactionOutput, TransactionOutputAmountBuilder, TransactionOutputBuilder, TransactionOutputs, TransactionSetsState, TransactionUnspentOutput, TransactionUnspentOutputs, TransactionWitnessSet, TransactionWitnessSets, TreasuryWithdrawals, TreasuryWithdrawalsAction, TxInputsBuilder, URL, UnitInterval, Update, UpdateCommitteeAction, VRFCert, VRFKeyHash, VRFVKey, Value, VersionedBlock, Vkey, Vkeys, Vkeywitness, Vkeywitnesses, VoteDelegation, VoteKind, VoteRegistrationAndDelegation, Voter, VoterKind, Voters, VotingBuilder, VotingProcedure, VotingProcedures, VotingProposal, VotingProposalBuilder, VotingProposals, Withdrawals, WithdrawalsBuilder, calculate_ex_units_ceil_cost, cbor_to_json, cbor_to_schema_json, cddl_from_str, check_block_or_tx_signatures, create_send_all, decode_arbitrary_bytes_from_metadatum, decode_metadatum_to_json_str, decode_plutus_datum_to_json_str, decode_plutus_program_pretty_uplc, decode_plutus_program_uplc_json, decode_specific_type, decrypt_with_password, encode_arbitrary_bytes_as_metadatum, encode_json_str_to_metadatum, encode_json_str_to_native_script, encode_json_str_to_plutus_datum, encrypt_with_password, execute_tx_scripts, extract_hashes_from_transaction_js, get_decodable_types, get_deposit, get_implicit_input, get_necessary_data_list_js, get_possible_types_for_input, get_ref_script_bytes, get_utxo_list_from_tx, has_transaction_set_tag, hash_auxiliary_data, hash_plutus_data, hash_script_data, make_daedalus_bootstrap_witness, make_icarus_bootstrap_witness, make_vkey_witness, min_ada_for_output, min_fee, min_ref_script_fee, min_script_fee, validate_cbor_against_cddl, validate_cbor_from_slice, validate_cddl, validate_cddl_from_str, validate_json_from_str, validate_transaction_js
|
|
9
9
|
} from "./cquisitor_lib_bg.js";
|
|
@@ -28437,6 +28437,12 @@ export function calculate_ex_units_ceil_cost(ex_units, ex_unit_prices) {
|
|
|
28437
28437
|
}
|
|
28438
28438
|
|
|
28439
28439
|
/**
|
|
28440
|
+
* Decode CBOR hex into a positional JSON tree.
|
|
28441
|
+
*
|
|
28442
|
+
* Never throws on malformed input — returns a `{ok: false, error: {...}}`
|
|
28443
|
+
* object with a structured decode error: `kind`, `offset`, `byte_span`,
|
|
28444
|
+
* structural `path`, and a human `message`. Successful decodes come back
|
|
28445
|
+
* as `{ok: true, value: <tree>}`.
|
|
28440
28446
|
* @param {string} cbor_hex
|
|
28441
28447
|
* @returns {any}
|
|
28442
28448
|
*/
|
|
@@ -28450,6 +28456,65 @@ export function cbor_to_json(cbor_hex) {
|
|
|
28450
28456
|
return takeFromExternrefTable0(ret[0]);
|
|
28451
28457
|
}
|
|
28452
28458
|
|
|
28459
|
+
/**
|
|
28460
|
+
* Map decoded CBOR onto a CDDL schema and return labelled JSON.
|
|
28461
|
+
*
|
|
28462
|
+
* Where `cbor_to_json` returns positional CBOR (numeric map keys, raw
|
|
28463
|
+
* arrays), this walks the schema in parallel and replaces those with
|
|
28464
|
+
* the named fields the CDDL declares. On unknown / unmatched
|
|
28465
|
+
* sub-structures it falls back to the raw representation rather than
|
|
28466
|
+
* erroring, so partial matches still yield useful output.
|
|
28467
|
+
* @param {string} cbor_hex
|
|
28468
|
+
* @param {string} cddl
|
|
28469
|
+
* @param {string} rule_name
|
|
28470
|
+
* @returns {any}
|
|
28471
|
+
*/
|
|
28472
|
+
export function cbor_to_schema_json(cbor_hex, cddl, rule_name) {
|
|
28473
|
+
const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28474
|
+
const len0 = WASM_VECTOR_LEN;
|
|
28475
|
+
const ptr1 = passStringToWasm0(cddl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28476
|
+
const len1 = WASM_VECTOR_LEN;
|
|
28477
|
+
const ptr2 = passStringToWasm0(rule_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28478
|
+
const len2 = WASM_VECTOR_LEN;
|
|
28479
|
+
const ret = wasm.cbor_to_schema_json(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
28480
|
+
if (ret[2]) {
|
|
28481
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
28482
|
+
}
|
|
28483
|
+
return takeFromExternrefTable0(ret[0]);
|
|
28484
|
+
}
|
|
28485
|
+
|
|
28486
|
+
/**
|
|
28487
|
+
* Returns a `ast::CDDL` wrapped in `JsValue` from a `&str`
|
|
28488
|
+
*
|
|
28489
|
+
* # Arguments
|
|
28490
|
+
*
|
|
28491
|
+
* * `input` - A string slice with the CDDL text input
|
|
28492
|
+
*
|
|
28493
|
+
* # Example
|
|
28494
|
+
*
|
|
28495
|
+
* ```typescript
|
|
28496
|
+
* import * as wasm from 'cddl';
|
|
28497
|
+
*
|
|
28498
|
+
* let cddl: any;
|
|
28499
|
+
* try {
|
|
28500
|
+
* cddl = wasm.cddl_from_str(text);
|
|
28501
|
+
* } catch (e) {
|
|
28502
|
+
* console.error(e);
|
|
28503
|
+
* }
|
|
28504
|
+
* ```
|
|
28505
|
+
* @param {string} input
|
|
28506
|
+
* @returns {any}
|
|
28507
|
+
*/
|
|
28508
|
+
export function cddl_from_str(input) {
|
|
28509
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28510
|
+
const len0 = WASM_VECTOR_LEN;
|
|
28511
|
+
const ret = wasm.cddl_from_str(ptr0, len0);
|
|
28512
|
+
if (ret[2]) {
|
|
28513
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
28514
|
+
}
|
|
28515
|
+
return takeFromExternrefTable0(ret[0]);
|
|
28516
|
+
}
|
|
28517
|
+
|
|
28453
28518
|
/**
|
|
28454
28519
|
* @param {string} hex_str
|
|
28455
28520
|
* @returns {any}
|
|
@@ -29081,6 +29146,27 @@ export function validate_cbor_against_cddl(cbor_hex, cddl, rule_name) {
|
|
|
29081
29146
|
return takeFromExternrefTable0(ret[0]);
|
|
29082
29147
|
}
|
|
29083
29148
|
|
|
29149
|
+
/**
|
|
29150
|
+
* Validate CBOR slice from a given CDDL document string
|
|
29151
|
+
* @param {string} cddl
|
|
29152
|
+
* @param {Uint8Array} cbor_slice
|
|
29153
|
+
* @param {any[] | null} [enabled_features]
|
|
29154
|
+
* @returns {any}
|
|
29155
|
+
*/
|
|
29156
|
+
export function validate_cbor_from_slice(cddl, cbor_slice, enabled_features) {
|
|
29157
|
+
const ptr0 = passStringToWasm0(cddl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29158
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29159
|
+
const ptr1 = passArray8ToWasm0(cbor_slice, wasm.__wbindgen_malloc);
|
|
29160
|
+
const len1 = WASM_VECTOR_LEN;
|
|
29161
|
+
var ptr2 = isLikeNone(enabled_features) ? 0 : passArrayJsValueToWasm0(enabled_features, wasm.__wbindgen_malloc);
|
|
29162
|
+
var len2 = WASM_VECTOR_LEN;
|
|
29163
|
+
const ret = wasm.validate_cbor_from_slice(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
29164
|
+
if (ret[2]) {
|
|
29165
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
29166
|
+
}
|
|
29167
|
+
return takeFromExternrefTable0(ret[0]);
|
|
29168
|
+
}
|
|
29169
|
+
|
|
29084
29170
|
/**
|
|
29085
29171
|
* @param {string} cddl
|
|
29086
29172
|
* @returns {any}
|
|
@@ -29095,6 +29181,69 @@ export function validate_cddl(cddl) {
|
|
|
29095
29181
|
return takeFromExternrefTable0(ret[0]);
|
|
29096
29182
|
}
|
|
29097
29183
|
|
|
29184
|
+
/**
|
|
29185
|
+
* Validate CDDL input with partial compilation support.
|
|
29186
|
+
*
|
|
29187
|
+
* Unlike `cddl_from_str` which stops at the first error, this function
|
|
29188
|
+
* performs partial compilation: when the full document parse fails, it splits
|
|
29189
|
+
* the source into individual top-level rule blocks and parses each one
|
|
29190
|
+
* independently, collecting **all** errors across the entire document.
|
|
29191
|
+
*
|
|
29192
|
+
* When `check_refs` is `true`, the function also checks for undefined
|
|
29193
|
+
* references — names used in type expressions or group entries that are not
|
|
29194
|
+
* defined by any rule in the document and are not standard prelude types.
|
|
29195
|
+
* These are reported as warnings rather than errors.
|
|
29196
|
+
*
|
|
29197
|
+
* Returns a `JsValue` (serialised JSON array) containing all diagnostics found.
|
|
29198
|
+
* Each entry has `{ position, msg, severity }` where severity is `"error"` or `"warning"`.
|
|
29199
|
+
* An empty array means the input is valid CDDL with no warnings.
|
|
29200
|
+
*
|
|
29201
|
+
* # Example
|
|
29202
|
+
*
|
|
29203
|
+
* ```typescript
|
|
29204
|
+
* import * as wasm from 'cddl';
|
|
29205
|
+
*
|
|
29206
|
+
* const errors = wasm.validate_cddl_from_str(text, true);
|
|
29207
|
+
* // errors is an Array<{ position, msg, severity }>
|
|
29208
|
+
* if (errors.length === 0) {
|
|
29209
|
+
* console.log('Valid CDDL');
|
|
29210
|
+
* }
|
|
29211
|
+
* ```
|
|
29212
|
+
* @param {string} input
|
|
29213
|
+
* @param {boolean} check_refs
|
|
29214
|
+
* @returns {any}
|
|
29215
|
+
*/
|
|
29216
|
+
export function validate_cddl_from_str(input, check_refs) {
|
|
29217
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29218
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29219
|
+
const ret = wasm.validate_cddl_from_str(ptr0, len0, check_refs);
|
|
29220
|
+
if (ret[2]) {
|
|
29221
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
29222
|
+
}
|
|
29223
|
+
return takeFromExternrefTable0(ret[0]);
|
|
29224
|
+
}
|
|
29225
|
+
|
|
29226
|
+
/**
|
|
29227
|
+
* Validate JSON string from a given CDDL document string
|
|
29228
|
+
* @param {string} cddl
|
|
29229
|
+
* @param {string} json
|
|
29230
|
+
* @param {any[] | null} [enabled_features]
|
|
29231
|
+
* @returns {any}
|
|
29232
|
+
*/
|
|
29233
|
+
export function validate_json_from_str(cddl, json, enabled_features) {
|
|
29234
|
+
const ptr0 = passStringToWasm0(cddl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29235
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29236
|
+
const ptr1 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29237
|
+
const len1 = WASM_VECTOR_LEN;
|
|
29238
|
+
var ptr2 = isLikeNone(enabled_features) ? 0 : passArrayJsValueToWasm0(enabled_features, wasm.__wbindgen_malloc);
|
|
29239
|
+
var len2 = WASM_VECTOR_LEN;
|
|
29240
|
+
const ret = wasm.validate_json_from_str(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
29241
|
+
if (ret[2]) {
|
|
29242
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
29243
|
+
}
|
|
29244
|
+
return takeFromExternrefTable0(ret[0]);
|
|
29245
|
+
}
|
|
29246
|
+
|
|
29098
29247
|
/**
|
|
29099
29248
|
* @param {string} tx_hex
|
|
29100
29249
|
* @param {string} validation_context
|
|
@@ -29137,6 +29286,13 @@ export function __wbg_String_11905339415cf58e(arg0, arg1) {
|
|
|
29137
29286
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
29138
29287
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
29139
29288
|
}
|
|
29289
|
+
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
29290
|
+
const ret = String(arg1);
|
|
29291
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29292
|
+
const len1 = WASM_VECTOR_LEN;
|
|
29293
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
29294
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
29295
|
+
}
|
|
29140
29296
|
export function __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51(arg0, arg1) {
|
|
29141
29297
|
const v = arg1;
|
|
29142
29298
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
@@ -29425,6 +29581,11 @@ export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
|
29425
29581
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
29426
29582
|
return ret;
|
|
29427
29583
|
}
|
|
29584
|
+
export function __wbindgen_cast_0000000000000005(arg0) {
|
|
29585
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
29586
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
29587
|
+
return ret;
|
|
29588
|
+
}
|
|
29428
29589
|
export function __wbindgen_init_externref_table() {
|
|
29429
29590
|
const table = wasm.__wbindgen_externrefs;
|
|
29430
29591
|
const offset = table.grow(4);
|
|
@@ -30180,6 +30341,16 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
30180
30341
|
return ptr;
|
|
30181
30342
|
}
|
|
30182
30343
|
|
|
30344
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
30345
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
30346
|
+
for (let i = 0; i < array.length; i++) {
|
|
30347
|
+
const add = addToExternrefTable0(array[i]);
|
|
30348
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
30349
|
+
}
|
|
30350
|
+
WASM_VECTOR_LEN = array.length;
|
|
30351
|
+
return ptr;
|
|
30352
|
+
}
|
|
30353
|
+
|
|
30183
30354
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
30184
30355
|
if (realloc === undefined) {
|
|
30185
30356
|
const buf = cachedTextEncoder.encode(arg);
|
|
Binary file
|
|
@@ -4,18 +4,23 @@ 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 cbor_to_json: (a: number, b: number) => [number, number, number];
|
|
8
|
+
export const cbor_to_schema_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
9
|
+
export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
10
|
+
export const validate_cddl: (a: number, b: number) => [number, number, number];
|
|
7
11
|
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
8
|
-
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
9
12
|
export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
10
13
|
export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
11
|
-
export const cbor_to_json: (a: number, b: number) => [number, number, number];
|
|
12
14
|
export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
|
|
13
15
|
export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
|
|
14
16
|
export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
15
17
|
export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
|
|
16
18
|
export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
+
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
20
|
+
export const validate_cbor_from_slice: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
21
|
+
export const validate_json_from_str: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
22
|
+
export const cddl_from_str: (a: number, b: number) => [number, number, number];
|
|
23
|
+
export const validate_cddl_from_str: (a: number, b: number, c: number) => [number, number, number];
|
|
19
24
|
export const __wbg_bigint_free: (a: number, b: number) => void;
|
|
20
25
|
export const __wbg_certificatesbuilder_free: (a: number, b: number) => void;
|
|
21
26
|
export const __wbg_changeconfig_free: (a: number, b: number) => void;
|
package/node/cquisitor_lib.d.ts
CHANGED
|
@@ -102,21 +102,64 @@ export function get_possible_types_for_input(input: string): (string)[];
|
|
|
102
102
|
* @param {string} cbor_hex
|
|
103
103
|
* @returns {any}
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Decodes a CBOR hex string into a positional JSON tree.
|
|
107
|
+
*
|
|
108
|
+
* Never throws on malformed input — on failure returns
|
|
109
|
+
* `{ ok: false, error: CborDecodeError, partial? }`. Structured errors
|
|
110
|
+
* carry `kind`, `offset`, a `byte_span`, a semantic `path` into the
|
|
111
|
+
* failing position, and a human `message`.
|
|
112
|
+
*
|
|
113
|
+
* When anything was successfully decoded before the failure, `partial`
|
|
114
|
+
* contains the prefix tree with every un-finished container flagged
|
|
115
|
+
* `incomplete: true`. Node shape otherwise matches the success value, so
|
|
116
|
+
* renderers can display it the same way.
|
|
117
|
+
*/
|
|
118
|
+
export function cbor_to_json(cbor_hex: string): CborDecodeResult;
|
|
119
|
+
|
|
120
|
+
export type CborDecodeResult =
|
|
121
|
+
| { ok: true; value: CborValue }
|
|
122
|
+
| { ok: false; error: CborDecodeError; partial?: CborPartialValue };
|
|
123
|
+
|
|
124
|
+
export type CborDecodeErrorKind =
|
|
125
|
+
| "invalid_hex"
|
|
126
|
+
| "invalid_syntax"
|
|
127
|
+
| "unexpected_eof"
|
|
128
|
+
| "unexpected_break"
|
|
129
|
+
| "trailing_data"
|
|
130
|
+
| "invalid_utf8"
|
|
131
|
+
| "invalid_chunk"
|
|
132
|
+
| "int_not_representable"
|
|
133
|
+
| "non_finite_float"
|
|
134
|
+
| "io_error";
|
|
135
|
+
|
|
136
|
+
export interface CborDecodeError {
|
|
137
|
+
kind: CborDecodeErrorKind;
|
|
138
|
+
/** Human-readable message. Not stable — use `kind` for branching. */
|
|
139
|
+
message: string;
|
|
140
|
+
/** Semantic path into the decoded tree (e.g. `$.entries[1].value[0]`). */
|
|
141
|
+
path: string;
|
|
142
|
+
/** Byte offset where decoding failed. Absent only for rare IO fallbacks. */
|
|
143
|
+
offset?: number;
|
|
144
|
+
/** Byte range pinned by the failure, when wider than a single byte. */
|
|
145
|
+
byte_span?: CborPosition;
|
|
146
|
+
}
|
|
106
147
|
|
|
107
148
|
/**
|
|
108
|
-
* Validates a CDDL schema
|
|
109
|
-
*
|
|
110
|
-
*
|
|
149
|
+
* Validates a CDDL schema. Returns `{ valid: true }` if the schema parses
|
|
150
|
+
* **and** every rule reference resolves; otherwise `{ valid: false, error }`.
|
|
151
|
+
* Undefined rule references come back with `kind: "unresolved_references"`
|
|
152
|
+
* (e.g. `thing = [unknown_rule, int]`).
|
|
111
153
|
* @param {string} cddl
|
|
112
154
|
* @returns {any}
|
|
113
155
|
*/
|
|
114
156
|
export function validate_cddl(cddl: string): CddlValidationResult;
|
|
115
157
|
|
|
116
158
|
/**
|
|
117
|
-
* Validates CBOR bytes against a rule in the given CDDL schema. On failure
|
|
118
|
-
* `error` describes the mismatch, including a semantic path
|
|
119
|
-
* in the input that produced it
|
|
159
|
+
* Validates CBOR bytes against a rule in the given CDDL schema. On failure
|
|
160
|
+
* `error` describes the mismatch, including a semantic `path`, the byte
|
|
161
|
+
* spans in the input that produced it, and (when several validation
|
|
162
|
+
* errors fire) an `additional` array with the rest.
|
|
120
163
|
* @param {string} cbor_hex
|
|
121
164
|
* @param {string} cddl
|
|
122
165
|
* @param {string} rule_name
|
|
@@ -128,6 +171,28 @@ export function validate_cbor_against_cddl(
|
|
|
128
171
|
rule_name: string
|
|
129
172
|
): CborValidationResult;
|
|
130
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Maps decoded CBOR onto a CDDL schema and returns labelled JSON. Where
|
|
176
|
+
* `cbor_to_json` returns positional CBOR (numeric map keys, raw arrays),
|
|
177
|
+
* this walks the schema in parallel and replaces them with the named
|
|
178
|
+
* fields the CDDL declares — turning Cardano shapes like
|
|
179
|
+
* `[transaction_body, transaction_witness_set, bool, ...]` into
|
|
180
|
+
* `{transaction_body: {...}, transaction_witness_set: {...}, ...}`.
|
|
181
|
+
*
|
|
182
|
+
* Sub-structures the schema doesn't cover fall back to a raw
|
|
183
|
+
* representation (under `@extra` for maps / `@positional` for arrays),
|
|
184
|
+
* so partial matches still yield useful output.
|
|
185
|
+
* @param {string} cbor_hex
|
|
186
|
+
* @param {string} cddl
|
|
187
|
+
* @param {string} rule_name
|
|
188
|
+
* @returns {any}
|
|
189
|
+
*/
|
|
190
|
+
export function cbor_to_schema_json(
|
|
191
|
+
cbor_hex: string,
|
|
192
|
+
cddl: string,
|
|
193
|
+
rule_name: string
|
|
194
|
+
): unknown;
|
|
195
|
+
|
|
131
196
|
export function check_block_or_tx_signatures(hex_str: string): CheckSignaturesResult;
|
|
132
197
|
|
|
133
198
|
/**
|
|
@@ -279,6 +344,63 @@ export type CborValue =
|
|
|
279
344
|
| CborIndefiniteString
|
|
280
345
|
| CborIndefiniteBytes;
|
|
281
346
|
|
|
347
|
+
/**
|
|
348
|
+
* Sub-tree returned alongside a decode error. Structurally identical to
|
|
349
|
+
* `CborValue`, with two additional flags present **only** on nodes that
|
|
350
|
+
* couldn't be finished:
|
|
351
|
+
*
|
|
352
|
+
* - `incomplete: true` — on containers (Array / Map / Tag /
|
|
353
|
+
* IndefiniteLengthBytes / IndefiniteLengthString) whose body was cut
|
|
354
|
+
* short by the failure. For definite-length Array/Map the `items` field
|
|
355
|
+
* retains the wire-declared count; `values.length` shows how many slots
|
|
356
|
+
* actually decoded.
|
|
357
|
+
* - `incomplete_at: "key" | "value"` — on the single map entry where
|
|
358
|
+
* decoding stopped; at most one of `key` / `value` on that entry is
|
|
359
|
+
* populated, indicating which half had been parsed before the failure.
|
|
360
|
+
*/
|
|
361
|
+
export type CborPartialValue =
|
|
362
|
+
| CborSimple
|
|
363
|
+
| CborPartialArray
|
|
364
|
+
| CborPartialMap
|
|
365
|
+
| CborPartialTag
|
|
366
|
+
| CborPartialIndefiniteString
|
|
367
|
+
| CborPartialIndefiniteBytes;
|
|
368
|
+
|
|
369
|
+
export interface CborPartialArray extends Omit<CborArray, "values"> {
|
|
370
|
+
values: CborPartialValue[];
|
|
371
|
+
incomplete?: true;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface CborPartialMap extends Omit<CborMap, "values"> {
|
|
375
|
+
values: Array<CborPartialMapEntry | { key: CborValue; value: CborValue }>;
|
|
376
|
+
incomplete?: true;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface CborPartialMapEntry {
|
|
380
|
+
key?: CborPartialValue;
|
|
381
|
+
value?: CborPartialValue;
|
|
382
|
+
incomplete: true;
|
|
383
|
+
incomplete_at: "key" | "value";
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface CborPartialTag extends Omit<CborTag, "value"> {
|
|
387
|
+
/** Absent when the inner item could not be parsed at all. */
|
|
388
|
+
value?: CborPartialValue;
|
|
389
|
+
incomplete?: true;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface CborPartialIndefiniteString
|
|
393
|
+
extends Omit<CborIndefiniteString, "chunks"> {
|
|
394
|
+
chunks: CborValue[];
|
|
395
|
+
incomplete?: true;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface CborPartialIndefiniteBytes
|
|
399
|
+
extends Omit<CborIndefiniteBytes, "chunks"> {
|
|
400
|
+
chunks: CborValue[];
|
|
401
|
+
incomplete?: true;
|
|
402
|
+
}
|
|
403
|
+
|
|
282
404
|
export type CddlValidationResult =
|
|
283
405
|
| { valid: true }
|
|
284
406
|
| { valid: false; error: CddlErrorInfo };
|
|
@@ -295,13 +417,12 @@ export type CborValidationResult =
|
|
|
295
417
|
/**
|
|
296
418
|
* `kind` categorises the failure:
|
|
297
419
|
* - "parse_error" — the CDDL itself failed to parse
|
|
298
|
-
* - "
|
|
299
|
-
* - "missing_rule" — the
|
|
300
|
-
* - "unsupported" — the CDDL uses a feature cddl-cat doesn't implement
|
|
301
|
-
* - "value_error" — a CBOR value cannot be validated
|
|
420
|
+
* - "unresolved_references" — the CDDL references a rule name that isn't defined
|
|
421
|
+
* - "missing_rule" — the rule name passed to `validate_cbor_against_cddl` is not in the CDDL
|
|
302
422
|
* - "input_parse" — the CBOR bytes themselves are malformed
|
|
303
423
|
* - "mismatch" / "map_cut" — a data mismatch; inspect `expected`, `path`,
|
|
304
424
|
* `byte_spans`, and `anchor_spans` for precise locations
|
|
425
|
+
* - "generic" — anything that didn't fit one of the buckets above
|
|
305
426
|
*/
|
|
306
427
|
export interface CborValidationErrorInfo {
|
|
307
428
|
kind: string;
|
package/node/cquisitor_lib.js
CHANGED
|
@@ -28663,6 +28663,12 @@ function calculate_ex_units_ceil_cost(ex_units, ex_unit_prices) {
|
|
|
28663
28663
|
exports.calculate_ex_units_ceil_cost = calculate_ex_units_ceil_cost;
|
|
28664
28664
|
|
|
28665
28665
|
/**
|
|
28666
|
+
* Decode CBOR hex into a positional JSON tree.
|
|
28667
|
+
*
|
|
28668
|
+
* Never throws on malformed input — returns a `{ok: false, error: {...}}`
|
|
28669
|
+
* object with a structured decode error: `kind`, `offset`, `byte_span`,
|
|
28670
|
+
* structural `path`, and a human `message`. Successful decodes come back
|
|
28671
|
+
* as `{ok: true, value: <tree>}`.
|
|
28666
28672
|
* @param {string} cbor_hex
|
|
28667
28673
|
* @returns {any}
|
|
28668
28674
|
*/
|
|
@@ -28677,6 +28683,67 @@ function cbor_to_json(cbor_hex) {
|
|
|
28677
28683
|
}
|
|
28678
28684
|
exports.cbor_to_json = cbor_to_json;
|
|
28679
28685
|
|
|
28686
|
+
/**
|
|
28687
|
+
* Map decoded CBOR onto a CDDL schema and return labelled JSON.
|
|
28688
|
+
*
|
|
28689
|
+
* Where `cbor_to_json` returns positional CBOR (numeric map keys, raw
|
|
28690
|
+
* arrays), this walks the schema in parallel and replaces those with
|
|
28691
|
+
* the named fields the CDDL declares. On unknown / unmatched
|
|
28692
|
+
* sub-structures it falls back to the raw representation rather than
|
|
28693
|
+
* erroring, so partial matches still yield useful output.
|
|
28694
|
+
* @param {string} cbor_hex
|
|
28695
|
+
* @param {string} cddl
|
|
28696
|
+
* @param {string} rule_name
|
|
28697
|
+
* @returns {any}
|
|
28698
|
+
*/
|
|
28699
|
+
function cbor_to_schema_json(cbor_hex, cddl, rule_name) {
|
|
28700
|
+
const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28701
|
+
const len0 = WASM_VECTOR_LEN;
|
|
28702
|
+
const ptr1 = passStringToWasm0(cddl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28703
|
+
const len1 = WASM_VECTOR_LEN;
|
|
28704
|
+
const ptr2 = passStringToWasm0(rule_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28705
|
+
const len2 = WASM_VECTOR_LEN;
|
|
28706
|
+
const ret = wasm.cbor_to_schema_json(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
28707
|
+
if (ret[2]) {
|
|
28708
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
28709
|
+
}
|
|
28710
|
+
return takeFromExternrefTable0(ret[0]);
|
|
28711
|
+
}
|
|
28712
|
+
exports.cbor_to_schema_json = cbor_to_schema_json;
|
|
28713
|
+
|
|
28714
|
+
/**
|
|
28715
|
+
* Returns a `ast::CDDL` wrapped in `JsValue` from a `&str`
|
|
28716
|
+
*
|
|
28717
|
+
* # Arguments
|
|
28718
|
+
*
|
|
28719
|
+
* * `input` - A string slice with the CDDL text input
|
|
28720
|
+
*
|
|
28721
|
+
* # Example
|
|
28722
|
+
*
|
|
28723
|
+
* ```typescript
|
|
28724
|
+
* import * as wasm from 'cddl';
|
|
28725
|
+
*
|
|
28726
|
+
* let cddl: any;
|
|
28727
|
+
* try {
|
|
28728
|
+
* cddl = wasm.cddl_from_str(text);
|
|
28729
|
+
* } catch (e) {
|
|
28730
|
+
* console.error(e);
|
|
28731
|
+
* }
|
|
28732
|
+
* ```
|
|
28733
|
+
* @param {string} input
|
|
28734
|
+
* @returns {any}
|
|
28735
|
+
*/
|
|
28736
|
+
function cddl_from_str(input) {
|
|
28737
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28738
|
+
const len0 = WASM_VECTOR_LEN;
|
|
28739
|
+
const ret = wasm.cddl_from_str(ptr0, len0);
|
|
28740
|
+
if (ret[2]) {
|
|
28741
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
28742
|
+
}
|
|
28743
|
+
return takeFromExternrefTable0(ret[0]);
|
|
28744
|
+
}
|
|
28745
|
+
exports.cddl_from_str = cddl_from_str;
|
|
28746
|
+
|
|
28680
28747
|
/**
|
|
28681
28748
|
* @param {string} hex_str
|
|
28682
28749
|
* @returns {any}
|
|
@@ -29343,6 +29410,28 @@ function validate_cbor_against_cddl(cbor_hex, cddl, rule_name) {
|
|
|
29343
29410
|
}
|
|
29344
29411
|
exports.validate_cbor_against_cddl = validate_cbor_against_cddl;
|
|
29345
29412
|
|
|
29413
|
+
/**
|
|
29414
|
+
* Validate CBOR slice from a given CDDL document string
|
|
29415
|
+
* @param {string} cddl
|
|
29416
|
+
* @param {Uint8Array} cbor_slice
|
|
29417
|
+
* @param {any[] | null} [enabled_features]
|
|
29418
|
+
* @returns {any}
|
|
29419
|
+
*/
|
|
29420
|
+
function validate_cbor_from_slice(cddl, cbor_slice, enabled_features) {
|
|
29421
|
+
const ptr0 = passStringToWasm0(cddl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29422
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29423
|
+
const ptr1 = passArray8ToWasm0(cbor_slice, wasm.__wbindgen_malloc);
|
|
29424
|
+
const len1 = WASM_VECTOR_LEN;
|
|
29425
|
+
var ptr2 = isLikeNone(enabled_features) ? 0 : passArrayJsValueToWasm0(enabled_features, wasm.__wbindgen_malloc);
|
|
29426
|
+
var len2 = WASM_VECTOR_LEN;
|
|
29427
|
+
const ret = wasm.validate_cbor_from_slice(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
29428
|
+
if (ret[2]) {
|
|
29429
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
29430
|
+
}
|
|
29431
|
+
return takeFromExternrefTable0(ret[0]);
|
|
29432
|
+
}
|
|
29433
|
+
exports.validate_cbor_from_slice = validate_cbor_from_slice;
|
|
29434
|
+
|
|
29346
29435
|
/**
|
|
29347
29436
|
* @param {string} cddl
|
|
29348
29437
|
* @returns {any}
|
|
@@ -29358,6 +29447,71 @@ function validate_cddl(cddl) {
|
|
|
29358
29447
|
}
|
|
29359
29448
|
exports.validate_cddl = validate_cddl;
|
|
29360
29449
|
|
|
29450
|
+
/**
|
|
29451
|
+
* Validate CDDL input with partial compilation support.
|
|
29452
|
+
*
|
|
29453
|
+
* Unlike `cddl_from_str` which stops at the first error, this function
|
|
29454
|
+
* performs partial compilation: when the full document parse fails, it splits
|
|
29455
|
+
* the source into individual top-level rule blocks and parses each one
|
|
29456
|
+
* independently, collecting **all** errors across the entire document.
|
|
29457
|
+
*
|
|
29458
|
+
* When `check_refs` is `true`, the function also checks for undefined
|
|
29459
|
+
* references — names used in type expressions or group entries that are not
|
|
29460
|
+
* defined by any rule in the document and are not standard prelude types.
|
|
29461
|
+
* These are reported as warnings rather than errors.
|
|
29462
|
+
*
|
|
29463
|
+
* Returns a `JsValue` (serialised JSON array) containing all diagnostics found.
|
|
29464
|
+
* Each entry has `{ position, msg, severity }` where severity is `"error"` or `"warning"`.
|
|
29465
|
+
* An empty array means the input is valid CDDL with no warnings.
|
|
29466
|
+
*
|
|
29467
|
+
* # Example
|
|
29468
|
+
*
|
|
29469
|
+
* ```typescript
|
|
29470
|
+
* import * as wasm from 'cddl';
|
|
29471
|
+
*
|
|
29472
|
+
* const errors = wasm.validate_cddl_from_str(text, true);
|
|
29473
|
+
* // errors is an Array<{ position, msg, severity }>
|
|
29474
|
+
* if (errors.length === 0) {
|
|
29475
|
+
* console.log('Valid CDDL');
|
|
29476
|
+
* }
|
|
29477
|
+
* ```
|
|
29478
|
+
* @param {string} input
|
|
29479
|
+
* @param {boolean} check_refs
|
|
29480
|
+
* @returns {any}
|
|
29481
|
+
*/
|
|
29482
|
+
function validate_cddl_from_str(input, check_refs) {
|
|
29483
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29484
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29485
|
+
const ret = wasm.validate_cddl_from_str(ptr0, len0, check_refs);
|
|
29486
|
+
if (ret[2]) {
|
|
29487
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
29488
|
+
}
|
|
29489
|
+
return takeFromExternrefTable0(ret[0]);
|
|
29490
|
+
}
|
|
29491
|
+
exports.validate_cddl_from_str = validate_cddl_from_str;
|
|
29492
|
+
|
|
29493
|
+
/**
|
|
29494
|
+
* Validate JSON string from a given CDDL document string
|
|
29495
|
+
* @param {string} cddl
|
|
29496
|
+
* @param {string} json
|
|
29497
|
+
* @param {any[] | null} [enabled_features]
|
|
29498
|
+
* @returns {any}
|
|
29499
|
+
*/
|
|
29500
|
+
function validate_json_from_str(cddl, json, enabled_features) {
|
|
29501
|
+
const ptr0 = passStringToWasm0(cddl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29502
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29503
|
+
const ptr1 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29504
|
+
const len1 = WASM_VECTOR_LEN;
|
|
29505
|
+
var ptr2 = isLikeNone(enabled_features) ? 0 : passArrayJsValueToWasm0(enabled_features, wasm.__wbindgen_malloc);
|
|
29506
|
+
var len2 = WASM_VECTOR_LEN;
|
|
29507
|
+
const ret = wasm.validate_json_from_str(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
29508
|
+
if (ret[2]) {
|
|
29509
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
29510
|
+
}
|
|
29511
|
+
return takeFromExternrefTable0(ret[0]);
|
|
29512
|
+
}
|
|
29513
|
+
exports.validate_json_from_str = validate_json_from_str;
|
|
29514
|
+
|
|
29361
29515
|
/**
|
|
29362
29516
|
* @param {string} tx_hex
|
|
29363
29517
|
* @param {string} validation_context
|
|
@@ -29404,6 +29558,13 @@ function __wbg_get_imports() {
|
|
|
29404
29558
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
29405
29559
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
29406
29560
|
},
|
|
29561
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
29562
|
+
const ret = String(arg1);
|
|
29563
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29564
|
+
const len1 = WASM_VECTOR_LEN;
|
|
29565
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
29566
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
29567
|
+
},
|
|
29407
29568
|
__wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
|
|
29408
29569
|
const v = arg1;
|
|
29409
29570
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
@@ -29692,6 +29853,11 @@ function __wbg_get_imports() {
|
|
|
29692
29853
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
29693
29854
|
return ret;
|
|
29694
29855
|
},
|
|
29856
|
+
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
29857
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
29858
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
29859
|
+
return ret;
|
|
29860
|
+
},
|
|
29695
29861
|
__wbindgen_init_externref_table: function() {
|
|
29696
29862
|
const table = wasm.__wbindgen_externrefs;
|
|
29697
29863
|
const offset = table.grow(4);
|
|
@@ -30454,6 +30620,16 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
30454
30620
|
return ptr;
|
|
30455
30621
|
}
|
|
30456
30622
|
|
|
30623
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
30624
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
30625
|
+
for (let i = 0; i < array.length; i++) {
|
|
30626
|
+
const add = addToExternrefTable0(array[i]);
|
|
30627
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
30628
|
+
}
|
|
30629
|
+
WASM_VECTOR_LEN = array.length;
|
|
30630
|
+
return ptr;
|
|
30631
|
+
}
|
|
30632
|
+
|
|
30457
30633
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
30458
30634
|
if (realloc === undefined) {
|
|
30459
30635
|
const buf = cachedTextEncoder.encode(arg);
|
|
Binary file
|
|
@@ -4,18 +4,23 @@ 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 cbor_to_json: (a: number, b: number) => [number, number, number];
|
|
8
|
+
export const cbor_to_schema_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
9
|
+
export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
10
|
+
export const validate_cddl: (a: number, b: number) => [number, number, number];
|
|
7
11
|
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
8
|
-
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
9
12
|
export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
10
13
|
export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
11
|
-
export const cbor_to_json: (a: number, b: number) => [number, number, number];
|
|
12
14
|
export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
|
|
13
15
|
export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
|
|
14
16
|
export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
15
17
|
export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
|
|
16
18
|
export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
+
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
20
|
+
export const validate_cbor_from_slice: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
21
|
+
export const validate_json_from_str: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
22
|
+
export const cddl_from_str: (a: number, b: number) => [number, number, number];
|
|
23
|
+
export const validate_cddl_from_str: (a: number, b: number, c: number) => [number, number, number];
|
|
19
24
|
export const __wbg_bigint_free: (a: number, b: number) => void;
|
|
20
25
|
export const __wbg_certificatesbuilder_free: (a: number, b: number) => void;
|
|
21
26
|
export const __wbg_changeconfig_free: (a: number, b: number) => void;
|
package/package.json
CHANGED