@ouronet/talos-registry 2.1.0 → 2.2.0
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 +2 -2
- package/TOOLTIP-CANON.md +75 -0
- package/dist/data/registry.json +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/tooltip.d.ts +35 -0
- package/dist/tooltip.js +80 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ buildCall("TS01-C1.DPTF|C_Transfer", {
|
|
|
17
17
|
Note `1` became `1.0`. Pact's decimal lexer rejects a bare integer in a decimal slot, and that
|
|
18
18
|
is the least interesting thing this package stops you getting wrong.
|
|
19
19
|
|
|
20
|
-
**This build:** 423 entrypoints, 428 previews, surface `
|
|
20
|
+
**This build:** 423 entrypoints, 428 previews, surface `8107265a0be6edc3`, generated against mainnet.
|
|
21
21
|
Every figure in this file is asserted by `tests/readme.test.ts` against the bundled snapshot, so
|
|
22
22
|
a stale number fails the suite rather than misleading a reader.
|
|
23
23
|
|
|
@@ -183,7 +183,7 @@ const m = tooltipModel("TS01-C1.DPTF|C_Transfer", { id: '"OURO-8Nh-JO8JO4F5"' })
|
|
|
183
183
|
// m.consumer -> who is rendering, for the caller zone
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
Ten rules, each there because it was got wrong first — most recently a six-parameter transfer
|
|
187
187
|
whose tooltip showed five arguments, because it was rendering the preview's list under the
|
|
188
188
|
execution's heading. Read the canon before building one.
|
|
189
189
|
|
package/TOOLTIP-CANON.md
CHANGED
|
@@ -237,6 +237,81 @@ which is why there are two. `tooltipModel` applies both for you.
|
|
|
237
237
|
|
|
238
238
|
---
|
|
239
239
|
|
|
240
|
+
## Rule 7 — fill every parameter you can, and prove it
|
|
241
|
+
|
|
242
|
+
A tooltip that leaves a fillable slot showing the registry's example is not "partially
|
|
243
|
+
implemented". It is **wrong**, and it is wrong in the way that does not announce itself: the
|
|
244
|
+
examples are real ids read from mainnet, so the panel looks like data and the preview succeeds
|
|
245
|
+
against somebody else's entity.
|
|
246
|
+
|
|
247
|
+
Four separate bugs came from this, all on buttons that looked fine:
|
|
248
|
+
|
|
249
|
+
| what showed | what it meant |
|
|
250
|
+
|---|---|
|
|
251
|
+
| `ats = "Auryndex-O136CBn22ncY"` on a **SilverStoa** button | a genuine fee, for the wrong pool |
|
|
252
|
+
| `patron` = the example account | `INFO_ATS\|ColdRecovery` read an empty ledger and reported a table error |
|
|
253
|
+
| `rt = <no live example>` | the page knew the token and never passed it |
|
|
254
|
+
| `ats1`/`ats2` = `<no live example>` | on a button whose whole question is "from where, to where" |
|
|
255
|
+
|
|
256
|
+
### Fill BY ROLE, not by name
|
|
257
|
+
|
|
258
|
+
Pact types cannot help: `patron`, `id`, `ats` and `swpair` are all `string`, and a value of the
|
|
259
|
+
wrong kind in any of them type-checks, renders plausibly and prices the wrong thing.
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
paramRole("ats") // "ats-pool"
|
|
263
|
+
paramRole("rt") // "token-id"
|
|
264
|
+
paramRole("patron") // "ouronet-account"
|
|
265
|
+
paramsByRole() // the whole vocabulary, grouped
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Roles are **derived from the shape of each ghost**, which was read from mainnet — an Ouronet
|
|
269
|
+
account is a glyph string, a pool is `Name-O136CBn22ncY`, a swap pair starts `W|`, a hibernated
|
|
270
|
+
DPOF starts `H|`. Not a hand-written list of 332 names: hand-classifying the vocabulary is the
|
|
271
|
+
same act that caused the bugs, a human deciding `ats` looks like a token because both are strings.
|
|
272
|
+
|
|
273
|
+
**A name whose ghost is the generic `"example"` gets no role**, and nothing should be inferred
|
|
274
|
+
about it. Those stay visible placeholders. As of this writing 35 names classify and the rest do
|
|
275
|
+
not, which is an honest answer rather than a gap to be filled with plausible-looking values.
|
|
276
|
+
|
|
277
|
+
### The check
|
|
278
|
+
|
|
279
|
+
```ts
|
|
280
|
+
unfilledFillable(model) // slots with a known role and no supplied value
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
**A conformant consumer asserts this is empty for every button it renders.** That is the
|
|
284
|
+
difference between "we fixed the tooltip someone complained about" and "this class cannot recur".
|
|
285
|
+
|
|
286
|
+
Note what it deliberately does *not* report: placeholders (honestly unresolved) and preflight-fed
|
|
287
|
+
slots (must not be invented). It answers *what did you leave on the table*, not *what is missing*.
|
|
288
|
+
|
|
289
|
+
### One fill map, not one per page
|
|
290
|
+
|
|
291
|
+
If two value-builders exist, they will diverge, and the divergence will be a whole category. In
|
|
292
|
+
OuronetUI the dashboard's builder had an account list from day one and the token pages' had none
|
|
293
|
+
at all — which is exactly why Cold Recovery errored on three pages and nowhere else. It surfaced
|
|
294
|
+
only because one preview out of two happened to read a table.
|
|
295
|
+
|
|
296
|
+
Derive the fill map from `paramsByRole()` once, and give every page the same one.
|
|
297
|
+
|
|
298
|
+
## Rule 8 — a refusal is an answer; render it as one
|
|
299
|
+
|
|
300
|
+
`No value found in table ouronet-ns.ATS_ATS|Ledger for key: SilverStoa…` is not a crash. It is the
|
|
301
|
+
chain saying *this subject has no row here* — often the most useful thing the tooltip could tell
|
|
302
|
+
you, and it looks like a bug.
|
|
303
|
+
|
|
304
|
+
Classify before rendering:
|
|
305
|
+
|
|
306
|
+
- **missing row** (`No value found in table … for key …`) → say what it means: *"no position in
|
|
307
|
+
this pool yet"*. The operation is real; the subject simply has nothing to act on.
|
|
308
|
+
- **placeholder argument** → name the argument, do not show the refusal. The read was never going
|
|
309
|
+
to succeed and that is not the contract's fault.
|
|
310
|
+
- **anything else** → show it. An unclassified failure is worth seeing raw.
|
|
311
|
+
|
|
312
|
+
And do not fire a read that cannot succeed: `m.shouldRead` is already false when an argument is a
|
|
313
|
+
placeholder.
|
|
314
|
+
|
|
240
315
|
## Placement and behaviour
|
|
241
316
|
|
|
242
317
|
Not expressible in the model, so they are stated here and they are not optional.
|