@cardananium/cquisitor-lib 0.1.0-beta.54 → 0.1.0-beta.55
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
|
|
|
Binary file
|
|
@@ -4,11 +4,9 @@ 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
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
|
|
11
|
-
export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
|
|
7
|
+
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
8
|
+
export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
9
|
+
export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
12
10
|
export const cbor_to_json: (a: number, b: number) => [number, number, number];
|
|
13
11
|
export const cddl_format: (a: number, b: number) => [number, number, number, number];
|
|
14
12
|
export const cddl_outline: (a: number, b: number) => [number, number, number];
|
|
@@ -19,9 +17,11 @@ export const map_cbor_to_cddl: (a: number, b: number, c: number, d: number, e: n
|
|
|
19
17
|
export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
20
18
|
export const validate_cddl: (a: number, b: number) => [number, number, number];
|
|
21
19
|
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
20
|
+
export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
|
|
21
|
+
export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
|
|
22
|
+
export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
23
|
+
export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
|
|
24
|
+
export const get_utxo_list_from_tx: (a: number, b: 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];
|
|
26
26
|
export const validate_json_from_str: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
27
27
|
export const cddl_from_str: (a: number, b: 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
|
|
|
Binary file
|
|
@@ -4,11 +4,9 @@ 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
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
|
|
11
|
-
export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
|
|
7
|
+
export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
|
|
8
|
+
export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
9
|
+
export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
12
10
|
export const cbor_to_json: (a: number, b: number) => [number, number, number];
|
|
13
11
|
export const cddl_format: (a: number, b: number) => [number, number, number, number];
|
|
14
12
|
export const cddl_outline: (a: number, b: number) => [number, number, number];
|
|
@@ -19,9 +17,11 @@ export const map_cbor_to_cddl: (a: number, b: number, c: number, d: number, e: n
|
|
|
19
17
|
export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
20
18
|
export const validate_cddl: (a: number, b: number) => [number, number, number];
|
|
21
19
|
export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
20
|
+
export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
|
|
21
|
+
export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
|
|
22
|
+
export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
23
|
+
export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
|
|
24
|
+
export const get_utxo_list_from_tx: (a: number, b: 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];
|
|
26
26
|
export const validate_json_from_str: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
27
27
|
export const cddl_from_str: (a: number, b: number) => [number, number, number];
|
package/package.json
CHANGED