@cardano-slips/flow 0.1.0 → 0.3.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.
Files changed (113) hide show
  1. package/README.md +53 -9
  2. package/dist/address.d.ts +12 -0
  3. package/dist/address.d.ts.map +1 -1
  4. package/dist/address.js +43 -0
  5. package/dist/address.js.map +1 -1
  6. package/dist/balance-error.d.ts +48 -0
  7. package/dist/balance-error.d.ts.map +1 -0
  8. package/dist/balance-error.js +45 -0
  9. package/dist/balance-error.js.map +1 -0
  10. package/dist/balance.d.ts +54 -0
  11. package/dist/balance.d.ts.map +1 -0
  12. package/dist/balance.js +175 -0
  13. package/dist/balance.js.map +1 -0
  14. package/dist/card.css +492 -0
  15. package/dist/card.d.ts +41 -0
  16. package/dist/card.d.ts.map +1 -0
  17. package/dist/card.js +69 -0
  18. package/dist/card.js.map +1 -0
  19. package/dist/cip30.d.ts +10 -0
  20. package/dist/cip30.d.ts.map +1 -1
  21. package/dist/cip30.js +16 -0
  22. package/dist/cip30.js.map +1 -1
  23. package/dist/complete-error.d.ts +57 -0
  24. package/dist/complete-error.d.ts.map +1 -0
  25. package/dist/complete-error.js +52 -0
  26. package/dist/complete-error.js.map +1 -0
  27. package/dist/complete.d.ts +77 -0
  28. package/dist/complete.d.ts.map +1 -0
  29. package/dist/complete.js +182 -0
  30. package/dist/complete.js.map +1 -0
  31. package/dist/derived.d.ts +8 -0
  32. package/dist/derived.d.ts.map +1 -0
  33. package/dist/derived.js +2 -0
  34. package/dist/derived.js.map +1 -0
  35. package/dist/effects-panel.d.ts +37 -0
  36. package/dist/effects-panel.d.ts.map +1 -0
  37. package/dist/effects-panel.js +64 -0
  38. package/dist/effects-panel.js.map +1 -0
  39. package/dist/effects.css +629 -0
  40. package/dist/exchange.d.ts +54 -0
  41. package/dist/exchange.d.ts.map +1 -0
  42. package/dist/exchange.js +136 -0
  43. package/dist/exchange.js.map +1 -0
  44. package/dist/explain.d.ts +39 -0
  45. package/dist/explain.d.ts.map +1 -0
  46. package/dist/explain.js +172 -0
  47. package/dist/explain.js.map +1 -0
  48. package/dist/index.d.ts +34 -3
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +19 -2
  51. package/dist/index.js.map +1 -1
  52. package/dist/ledger.d.ts +74 -0
  53. package/dist/ledger.d.ts.map +1 -0
  54. package/dist/ledger.js +402 -0
  55. package/dist/ledger.js.map +1 -0
  56. package/dist/outcome-panel.d.ts +63 -0
  57. package/dist/outcome-panel.d.ts.map +1 -0
  58. package/dist/outcome-panel.js +40 -0
  59. package/dist/outcome-panel.js.map +1 -0
  60. package/dist/parameter-form.d.ts +26 -0
  61. package/dist/parameter-form.d.ts.map +1 -0
  62. package/dist/parameter-form.js +42 -0
  63. package/dist/parameter-form.js.map +1 -0
  64. package/dist/resolve.d.ts +11 -0
  65. package/dist/resolve.d.ts.map +1 -0
  66. package/dist/resolve.js +21 -0
  67. package/dist/resolve.js.map +1 -0
  68. package/dist/sign-error.d.ts +62 -0
  69. package/dist/sign-error.d.ts.map +1 -0
  70. package/dist/sign-error.js +42 -0
  71. package/dist/sign-error.js.map +1 -0
  72. package/dist/sign.d.ts +38 -0
  73. package/dist/sign.d.ts.map +1 -0
  74. package/dist/sign.js +79 -0
  75. package/dist/sign.js.map +1 -0
  76. package/dist/slip-card.d.ts +55 -0
  77. package/dist/slip-card.d.ts.map +1 -0
  78. package/dist/slip-card.js +89 -0
  79. package/dist/slip-card.js.map +1 -0
  80. package/dist/tokens.css +97 -123
  81. package/dist/utxo.d.ts +16 -0
  82. package/dist/utxo.d.ts.map +1 -0
  83. package/dist/utxo.js +51 -0
  84. package/dist/utxo.js.map +1 -0
  85. package/dist/witness.d.ts +23 -0
  86. package/dist/witness.d.ts.map +1 -0
  87. package/dist/witness.js +101 -0
  88. package/dist/witness.js.map +1 -0
  89. package/package.json +13 -6
  90. package/src/address.ts +53 -0
  91. package/src/balance-error.ts +77 -0
  92. package/src/balance.ts +285 -0
  93. package/src/card.css +492 -0
  94. package/src/card.ts +86 -0
  95. package/src/cip30.ts +19 -0
  96. package/src/complete-error.ts +95 -0
  97. package/src/complete.ts +307 -0
  98. package/src/derived.ts +8 -0
  99. package/src/effects-panel.tsx +386 -0
  100. package/src/effects.css +629 -0
  101. package/src/exchange.ts +212 -0
  102. package/src/explain.ts +211 -0
  103. package/src/index.ts +64 -3
  104. package/src/ledger.ts +503 -0
  105. package/src/outcome-panel.tsx +263 -0
  106. package/src/parameter-form.tsx +138 -0
  107. package/src/resolve.ts +40 -0
  108. package/src/sign-error.ts +89 -0
  109. package/src/sign.ts +118 -0
  110. package/src/slip-card.tsx +244 -0
  111. package/src/tokens.css +97 -123
  112. package/src/utxo.ts +70 -0
  113. package/src/witness.ts +132 -0
package/dist/ledger.js ADDED
@@ -0,0 +1,402 @@
1
+ /**
2
+ * What the effects panel draws, worked out without React: the headline figure,
3
+ * one row per effect, which rows a mismatch marks, and the line that states
4
+ * the verdict. Every figure comes from the derived effects, never the claim.
5
+ */
6
+ import { addressText, encodeBech32 } from "@cardano-slips/verifier";
7
+ import { assetLabel, explainReason, formatAda, formatQuantity, shortened } from "./explain.js";
8
+ /** Rows past this group into what arrives, what leaves and what moves nothing (sheet state h). */
9
+ const groupedFrom = 5;
10
+ /** Rows past this collapse each group to its header and a count. */
11
+ const collapsedFrom = 9;
12
+ const minus = "−";
13
+ const hexOf = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
14
+ const spent = (text) => ({ text: `${minus}${text}`, tone: "spent" });
15
+ const gained = (text) => ({ text: `+${text}`, tone: "gained" });
16
+ /** A token by its name where the name is text, and by its bytes where it is not. The quantity stays in base units. */
17
+ const tokenText = (quantity, name) => {
18
+ const label = assetLabel(hexOf(name));
19
+ if (label !== null)
20
+ return `${formatQuantity(quantity)} ${label}`;
21
+ return name.length === 0
22
+ ? `${formatQuantity(quantity)} of an unnamed token`
23
+ : `${formatQuantity(quantity)} of token ${hexOf(name)}`;
24
+ };
25
+ const policyLine = (policyId) => `policy ${shortenedHex(hexOf(policyId))}`;
26
+ const shortenedHex = (hex) => (hex.length <= 12 ? hex : `${hex.slice(0, 4)}…${hex.slice(-4)}`);
27
+ /** A DRep id per CIP-129: a header byte naming key or script, then the hash. */
28
+ const drepText = (drep) => {
29
+ switch (drep._tag) {
30
+ case "Abstain":
31
+ return "abstain";
32
+ case "NoConfidence":
33
+ return "no confidence";
34
+ case "KeyHash":
35
+ return shortened(encodeBech32("drep", Uint8Array.of(0x22, ...drep.hash)));
36
+ case "ScriptHash":
37
+ return shortened(encodeBech32("drep", Uint8Array.of(0x23, ...drep.hash)));
38
+ }
39
+ };
40
+ const identifierOf = (certificate) => {
41
+ if (certificate.pool !== null)
42
+ return shortened(encodeBech32("pool", certificate.pool));
43
+ if (certificate.drep !== null)
44
+ return drepText(certificate.drep);
45
+ return undefined;
46
+ };
47
+ const voteWords = (drep, whose) => {
48
+ if (drep?._tag === "Abstain")
49
+ return `set ${whose} vote to always abstain`;
50
+ if (drep?._tag === "NoConfidence")
51
+ return `set ${whose} vote to always no confidence`;
52
+ return `delegate ${whose} vote to a DRep`;
53
+ };
54
+ /** What a certificate does, in words. "Your" only where the wallet holds the key it acts on. */
55
+ export const describeCertificate = (certificate) => {
56
+ const whose = certificate.ours || certificate.credential === null ? "your" : "another wallet's";
57
+ const capital = (text) => `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
58
+ switch (certificate.kind) {
59
+ case "StakeRegistration":
60
+ case "Registration":
61
+ return capital(`register ${whose} stake key`);
62
+ case "StakeDeregistration":
63
+ case "Deregistration":
64
+ return capital(`close ${whose} stake key and stop delegating`);
65
+ case "StakeDelegation":
66
+ return capital(`delegate ${whose} stake to a stake pool`);
67
+ case "VoteDelegation":
68
+ return capital(voteWords(certificate.drep, whose));
69
+ case "StakeVoteDelegation":
70
+ return capital(`delegate ${whose} stake to a stake pool and ${voteWords(certificate.drep, whose)}`);
71
+ case "StakeRegistrationDelegation":
72
+ return capital(`register ${whose} stake key and delegate it to a stake pool`);
73
+ case "VoteRegistrationDelegation":
74
+ return capital(`register ${whose} stake key and ${voteWords(certificate.drep, whose)}`);
75
+ case "StakeVoteRegistrationDelegation":
76
+ return capital(`register ${whose} stake key, delegate it to a stake pool and ${voteWords(certificate.drep, whose)}`);
77
+ case "PoolRegistration":
78
+ return "Register a stake pool";
79
+ case "PoolRetirement":
80
+ return "Retire a stake pool";
81
+ case "AuthorizeCommitteeHot":
82
+ return "Authorise a hot key for the constitutional committee";
83
+ case "ResignCommitteeCold":
84
+ return "Resign from the constitutional committee";
85
+ case "RegisterDrep":
86
+ return `Register ${whose === "your" ? "yourself" : "another wallet"} as a DRep`;
87
+ case "UnregisterDrep":
88
+ return `Retire ${whose === "your" ? "yourself" : "another wallet"} as a DRep`;
89
+ case "UpdateDrep":
90
+ return capital(`update ${whose} DRep details`);
91
+ }
92
+ };
93
+ /** The parameter and a stated deposit are both what the ledger takes and gives back. Only an assumed one is a claim. */
94
+ const depositChip = (deposit) => deposit.basis === "assumed" ? "as-stated" : "refundable";
95
+ const depositNote = (deposit) => {
96
+ const all = formatAda(deposit.amount);
97
+ if (depositChip(deposit) === "as-stated") {
98
+ return deposit.kind === "pool"
99
+ ? "Today's pool deposit. A pool that is already registered pays nothing to register again."
100
+ : "Today's deposit, standing in for a figure the transaction does not settle.";
101
+ }
102
+ switch (deposit.kind) {
103
+ case "stake":
104
+ return `Held by the network while you delegate. You get all ${all} back when you stop.`;
105
+ case "drep":
106
+ return `Held by the network while you are a DRep. You get all ${all} back when you retire.`;
107
+ case "pool":
108
+ return `Held by the network while the pool is registered. It comes back when the pool retires.`;
109
+ case "governance-action":
110
+ return "Held with the proposal. It comes back once the proposal is decided.";
111
+ }
112
+ };
113
+ const refundNote = (refund) => {
114
+ const what = refund.kind === "drep" ? "the DRep" : "this key";
115
+ return refund.basis === "assumed"
116
+ ? `The network returns what ${what} was registered under. The transaction doesn't say what that was, so this is today's deposit standing in for it.`
117
+ : `The transaction states this figure. The network returns what ${what} was registered under, so this is the transaction's claim.`;
118
+ };
119
+ const depositKey = (side, deposit) => `${side}-${deposit.source}-${deposit.index}`;
120
+ /** Every effect as a row, in the sheet's order: what is paid, what arrives, what moves nothing, what the network takes. */
121
+ const rowsOf = (derived) => {
122
+ const { assets, effects, lovelace } = derived;
123
+ const minted = new Set(effects.mint.map((asset) => `${hexOf(asset.policyId)}.${hexOf(asset.name)}`));
124
+ const payments = effects.outputs
125
+ .filter((output) => !output.mine)
126
+ .map((output) => ({
127
+ key: `output-${output.index}`,
128
+ label: "You pay",
129
+ detail: shortened(addressText(output.address)),
130
+ amounts: [
131
+ ...output.value.assets.flatMap((policy) => policy.assets.map((asset) => spent(tokenText(asset.quantity, asset.name)))),
132
+ ...(output.value.coin > 0n ? [spent(formatAda(output.value.coin))] : [])
133
+ ],
134
+ group: "leaving"
135
+ }));
136
+ const arrivals = assets.user
137
+ .filter((asset) => asset.delta < 0n && !minted.has(`${hexOf(asset.policyId)}.${hexOf(asset.name)}`))
138
+ .map((asset) => ({
139
+ key: `receive-${hexOf(asset.policyId)}.${hexOf(asset.name)}`,
140
+ label: "You receive",
141
+ detail: policyLine(asset.policyId),
142
+ amounts: [gained(tokenText(asset.delta, asset.name))],
143
+ group: "arriving"
144
+ }));
145
+ const mint = effects.mint.map((asset, index) => asset.quantity > 0n
146
+ ? {
147
+ key: `mint-${index}`,
148
+ label: "Tokens created",
149
+ detail: policyLine(asset.policyId),
150
+ amounts: [gained(tokenText(asset.quantity, asset.name))],
151
+ group: "arriving"
152
+ }
153
+ : {
154
+ key: `mint-${index}`,
155
+ label: "Tokens destroyed",
156
+ detail: policyLine(asset.policyId),
157
+ amounts: [spent(tokenText(asset.quantity, asset.name))],
158
+ group: "leaving"
159
+ });
160
+ const withdrawals = effects.withdrawals.map((withdrawal, index) => ({
161
+ key: `withdrawal-${index}`,
162
+ label: "Withdrawal",
163
+ detail: withdrawal.ours ? "Staking rewards to date" : shortened(addressText(withdrawal.rewardAccount)),
164
+ amounts: [gained(formatAda(withdrawal.amount))],
165
+ group: "arriving"
166
+ }));
167
+ const certificates = effects.certificates.map((certificate) => {
168
+ const identifier = identifierOf(certificate);
169
+ return {
170
+ key: `certificate-${certificate.index}`,
171
+ label: "Certificate",
172
+ detail: describeCertificate(certificate),
173
+ amounts: [],
174
+ ...(identifier === undefined ? {} : { identifier }),
175
+ group: "unmoved"
176
+ };
177
+ });
178
+ const fee = {
179
+ key: "fee",
180
+ label: "Network fee",
181
+ amounts: [{ text: `${minus}${formatAda(lovelace.fee)}`, tone: "fee" }],
182
+ group: "leaving"
183
+ };
184
+ const deposits = lovelace.deposits.map((deposit) => ({
185
+ key: depositKey("deposit", deposit),
186
+ label: "Deposit",
187
+ amounts: [
188
+ { text: `${minus}${formatAda(deposit.amount)}`, tone: depositChip(deposit) === "refundable" ? "held" : "stated" }
189
+ ],
190
+ chip: depositChip(deposit),
191
+ note: depositNote(deposit),
192
+ group: "leaving"
193
+ }));
194
+ const refunds = lovelace.refunds.map((refund) => ({
195
+ key: depositKey("refund", refund),
196
+ label: "Refund",
197
+ amounts: [{ text: `+${formatAda(refund.amount)}`, tone: "stated" }],
198
+ chip: "as-stated",
199
+ note: refundNote(refund),
200
+ group: "arriving"
201
+ }));
202
+ return [...payments, ...arrivals, ...mint, ...withdrawals, ...certificates, fee, ...deposits, ...refunds];
203
+ };
204
+ /**
205
+ * The rows each reason is about. A reason with nothing in the transaction to
206
+ * point at — a payment left out, certificates out of order — marks no row and
207
+ * is carried by the sentence alone.
208
+ */
209
+ const marksOf = (derived, reasons) => {
210
+ const marks = new Map();
211
+ const mark = (key, how) => {
212
+ if (!marks.has(key))
213
+ marks.set(key, how);
214
+ };
215
+ const { effects } = derived;
216
+ const paidTo = (address) => effects.outputs.filter((output) => !output.mine && addressText(output.address) === address);
217
+ for (const reason of reasons) {
218
+ switch (reason.code) {
219
+ case "output.undeclared":
220
+ // Those past the count the link asked for are the extra ones.
221
+ for (const output of paidTo(reason.address).slice(reason.declared))
222
+ mark(`output-${output.index}`, "not-in-the-link");
223
+ break;
224
+ case "output.lovelace":
225
+ case "output.assets":
226
+ for (const output of paidTo(reason.address))
227
+ mark(`output-${output.index}`, "not-as-the-link-says");
228
+ break;
229
+ case "certificate.undeclared":
230
+ for (const certificate of effects.certificates.slice(reason.declared)) {
231
+ mark(`certificate-${certificate.index}`, "not-in-the-link");
232
+ }
233
+ break;
234
+ case "certificate.target":
235
+ case "certificate.credential":
236
+ mark(`certificate-${reason.index}`, "not-as-the-link-says");
237
+ break;
238
+ case "certificate.deposit":
239
+ mark(`certificate-${reason.index}`, "not-as-the-link-says");
240
+ mark(`deposit-certificate-${reason.index}`, "not-as-the-link-says");
241
+ break;
242
+ case "withdrawal.undeclared":
243
+ effects.withdrawals.forEach((_, index) => mark(`withdrawal-${index}`, "not-in-the-link"));
244
+ break;
245
+ case "withdrawal.account":
246
+ effects.withdrawals.forEach((withdrawal, index) => {
247
+ if (addressText(withdrawal.rewardAccount) === reason.account)
248
+ mark(`withdrawal-${index}`, "not-in-the-link");
249
+ });
250
+ break;
251
+ case "mint.undeclared":
252
+ effects.mint.forEach((_, index) => mark(`mint-${index}`, "not-in-the-link"));
253
+ break;
254
+ case "fee.excessive":
255
+ mark("fee", "not-as-the-link-says");
256
+ break;
257
+ case "output.missing":
258
+ case "certificate.missing":
259
+ case "certificate.order":
260
+ case "withdrawal.missing":
261
+ case "body.unsupported":
262
+ case "interval.beyond-declared":
263
+ case "interval.not-yet-valid":
264
+ break;
265
+ }
266
+ }
267
+ return marks;
268
+ };
269
+ /** The rows, with each mismatch marked on the row it is about. */
270
+ export const ledgerOf = (derived, reasons = []) => {
271
+ const marks = marksOf(derived, reasons);
272
+ return rowsOf(derived).map((row) => {
273
+ const mark = marks.get(row.key);
274
+ return mark === undefined ? row : { ...row, mark };
275
+ });
276
+ };
277
+ export const isGrouped = (rows) => rows.length >= groupedFrom;
278
+ export const isCollapsed = (rows) => rows.length >= collapsedFrom;
279
+ /** The sheet's grouped order: what arrives, what leaves, what moves nothing. Empty groups are left out. */
280
+ export const groupsOf = (rows) => ["arriving", "leaving", "unmoved"]
281
+ .map((group) => ({ group, rows: rows.filter((row) => row.group === group) }))
282
+ .filter(({ rows: inGroup }) => inGroup.length > 0);
283
+ const sum = (values) => values.reduce((total, value) => total + value, 0n);
284
+ /**
285
+ * The one large figure. What goes to someone else, where anything does;
286
+ * otherwise what the person ends up with or spends. A deposit and a refund are
287
+ * never counted in it — one comes back and the other is only claimed.
288
+ */
289
+ export const headlineOf = (derived) => {
290
+ const { effects, lovelace } = derived;
291
+ const paid = effects.outputs.filter((output) => !output.mine);
292
+ const tokens = new Map();
293
+ for (const output of paid) {
294
+ for (const policy of output.value.assets) {
295
+ for (const asset of policy.assets) {
296
+ const key = `${hexOf(policy.policyId)}.${hexOf(asset.name)}`;
297
+ const held = tokens.get(key);
298
+ if (held === undefined)
299
+ tokens.set(key, { name: asset.name, quantity: asset.quantity });
300
+ else
301
+ held.quantity += asset.quantity;
302
+ }
303
+ }
304
+ }
305
+ const coin = sum(paid.map((output) => output.value.coin));
306
+ const deposited = sum(lovelace.deposits.map((deposit) => deposit.amount));
307
+ const refunded = sum(lovelace.refunds.map((refund) => refund.amount));
308
+ const withdrawn = sum(effects.withdrawals.filter((withdrawal) => withdrawal.ours).map((w) => w.amount));
309
+ const gain = withdrawn - lovelace.fee;
310
+ const base = tokens.size > 0 || coin > 0n
311
+ ? {
312
+ label: "Leaves your wallet",
313
+ amount: [
314
+ ...[...tokens.values()].map((token) => tokenText(token.quantity, token.name)),
315
+ ...(coin > 0n ? [formatAda(coin)] : [])
316
+ ].join(" and "),
317
+ tone: "spent",
318
+ fee: `plus ${formatAda(lovelace.fee)} in network fees`
319
+ }
320
+ : gain > 0n
321
+ ? { label: "You end up with", amount: `+${formatAda(gain)}`, tone: "gained" }
322
+ : { label: "You spend", amount: formatAda(-gain), tone: "spent" };
323
+ if (deposited > 0n) {
324
+ const promised = lovelace.deposits.every((deposit) => depositChip(deposit) === "refundable");
325
+ const verb = base.tone === "gained" ? "Locked" : "You lock";
326
+ return {
327
+ ...base,
328
+ held: {
329
+ label: promised ? `${verb}, refundable` : `${verb}, as stated`,
330
+ amount: formatAda(deposited),
331
+ tone: promised ? "held" : "stated"
332
+ }
333
+ };
334
+ }
335
+ if (refunded > 0n) {
336
+ return { ...base, held: { label: "Returned, as stated", amount: formatAda(refunded), tone: "stated" } };
337
+ }
338
+ return base;
339
+ };
340
+ const spelled = [
341
+ "zero",
342
+ "one",
343
+ "two",
344
+ "three",
345
+ "four",
346
+ "five",
347
+ "six",
348
+ "seven",
349
+ "eight",
350
+ "nine",
351
+ "ten",
352
+ "eleven",
353
+ "twelve"
354
+ ];
355
+ const moves = (kind) => kind.includes("Delegation");
356
+ /** The one sentence a match gets, above the buttons. */
357
+ export const matchLine = (derived, rows) => {
358
+ const { effects } = derived;
359
+ if (isGrouped(rows)) {
360
+ return `Checked against the link. All ${spelled[rows.length] ?? String(rows.length)} effects are described by it, and the transaction does nothing else.`;
361
+ }
362
+ const paysNobody = effects.outputs.every((output) => output.mine) && effects.withdrawals.length === 0;
363
+ if (paysNobody && effects.certificates.some((certificate) => moves(certificate.kind))) {
364
+ return "Checked against the link. Your ADA stays in your wallet — delegation moves no funds.";
365
+ }
366
+ return "Checked against the link. Every effect above is in the transaction, and the transaction does nothing else.";
367
+ };
368
+ /** The opening of the block: what differs, then the reassurance, before any detail. */
369
+ export const blockedLine = (reasons) => {
370
+ const said = reasons.map((reason) => explainReason(reason).summary);
371
+ const what = said.length === 0 ? "The transaction could not be matched to the link." : said.join(" ");
372
+ return `${what} Nothing has been signed.`;
373
+ };
374
+ /** For one reason: the figure the transaction carries, and where it goes or what the link asked instead. */
375
+ export const evidenceOf = (reason, derived) => {
376
+ const { actual, declared, summary, where } = explainReason(reason);
377
+ const marked = ledgerOf(derived, [reason])
378
+ .filter((row) => row.mark !== undefined)
379
+ .flatMap((row) => row.amounts.map((amount) => amount.text));
380
+ const figure = marked.length > 0 ? marked.join(", ") : actual;
381
+ const lines = [
382
+ ...(where === undefined ? [] : [reason.code === "withdrawal.account" ? `from ${where}` : `to ${where}`]),
383
+ ...(declared === undefined ? [] : [`The link asks for ${declared}`])
384
+ ];
385
+ return figure === undefined && lines.length === 0
386
+ ? { lines: [summary] }
387
+ : { ...(figure === undefined ? {} : { figure }), lines };
388
+ };
389
+ /** The transaction as its outputs, fee and expiry, for the collapsed raw detail. Addresses in full. */
390
+ export const rawLines = (derived) => {
391
+ const { effects } = derived;
392
+ const valueText = (coin, assets) => [
393
+ formatAda(coin),
394
+ ...assets.flatMap((policy) => policy.assets.map((asset) => `${tokenText(asset.quantity, asset.name)} (${policyLine(policy.policyId)})`))
395
+ ].join(" + ");
396
+ const until = effects.validity.validUntil;
397
+ return [
398
+ ...effects.outputs.map((output) => `#${output.index} → ${addressText(output.address)} : ${valueText(output.value.coin, output.value.assets)}${output.mine ? " (change)" : ""}`),
399
+ `fee ${formatAda(effects.fee)}${until === null ? "" : ` · invalid from slot ${until.slot}`}`
400
+ ];
401
+ };
402
+ //# sourceMappingURL=ledger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledger.js","sourceRoot":"","sources":["../src/ledger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,WAAW,EAIX,YAAY,EAEb,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAwC9F,kGAAkG;AAClG,MAAM,WAAW,GAAG,CAAC,CAAA;AAErB,oEAAoE;AACpE,MAAM,aAAa,GAAG,CAAC,CAAA;AAEvB,MAAM,KAAK,GAAG,GAAG,CAAA;AAEjB,MAAM,KAAK,GAAG,CAAC,KAAiB,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,E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C,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAC9I;QACD,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAwB,KAAK,CAAC,IAAI,EAAE,EAAE;KAC7F,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * What happens after the person presses sign — `10 · Signing and outcomes`.
3
+ * Every state but the receipt keeps the effects on screen, because waiting is
4
+ * not a modal: a spinner over a hidden ledger asks for trust the panel exists
5
+ * to avoid needing.
6
+ */
7
+ import type { Network } from "@cardano-slips/core";
8
+ import type { Derived } from "./derived.js";
9
+ export type Outcome =
10
+ /** The wallet is open over the page, asked for a signature. */
11
+ {
12
+ readonly _tag: "Waiting";
13
+ readonly wallet: string;
14
+ }
15
+ /** The person said no in the wallet. Not a failure: the offer stands. */
16
+ | {
17
+ readonly _tag: "Declined";
18
+ }
19
+ /** Signed, and on its way to the network. */
20
+ | {
21
+ readonly _tag: "Submitting";
22
+ readonly transactionId: string;
23
+ }
24
+ /** The funds moved; a fresh transaction is being built and will be shown before it is signed. */
25
+ | {
26
+ readonly _tag: "Rebuilding";
27
+ readonly number: number;
28
+ readonly of: number;
29
+ }
30
+ /** The network refused it. `reason` is the node's own words, shown as they came. */
31
+ | {
32
+ readonly _tag: "Refused";
33
+ readonly reason: string;
34
+ };
35
+ export type OutcomePanelProps = {
36
+ readonly claim: string;
37
+ readonly derived: Derived;
38
+ readonly outcome: Outcome;
39
+ /** Cancel while waiting or rebuilding; Close once declined or refused. */
40
+ readonly onClose?: () => void;
41
+ /** Review and sign again after a decline; start again after a refusal. */
42
+ readonly onAgain?: () => void;
43
+ };
44
+ export declare const OutcomePanel: ({ claim, derived, onAgain, onClose, outcome }: OutcomePanelProps) => React.JSX.Element;
45
+ export type SlipReceiptProps = {
46
+ readonly claim: string;
47
+ readonly derived: Derived;
48
+ readonly transactionId: string;
49
+ readonly network: Network;
50
+ /** Where this transaction can be looked up: the only durable copy anyone keeps. */
51
+ readonly explorer: {
52
+ readonly name: string;
53
+ readonly url: string;
54
+ };
55
+ };
56
+ /** One spelling for every surface that names a network, so the receipt and the top bar never disagree. */
57
+ export declare const networkNames: Readonly<Record<Network, string>>;
58
+ /**
59
+ * `10 · d`, back on the card surface. It says sent rather than confirmed: the
60
+ * node accepted the transaction, and nothing here watches the chain for it.
61
+ */
62
+ export declare const SlipReceipt: ({ claim, derived, explorer, network, transactionId }: SlipReceiptProps) => React.JSX.Element;
63
+ //# sourceMappingURL=outcome-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome-panel.d.ts","sourceRoot":"","sources":["../src/outcome-panel.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C,MAAM,MAAM,OAAO;AACjB,+DAA+D;AAC7D;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACvD,yEAAyE;GACvE;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE;AAC/B,6CAA6C;GAC3C;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE;AACjE,iGAAiG;GAC/F;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE;AAC/E,oFAAoF;GAClF;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B,CAAA;AA4BD,eAAO,MAAM,YAAY,GAAI,+CAA+C,iBAAiB,KAAG,KAAK,CAAC,GAAG,CAAC,OA4HzG,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACnE,CAAA;AAKD,0GAA0G;AAC1G,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAI1D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,sDAMzB,gBAAgB,KAAG,KAAK,CAAC,GAAG,CAAC,OA4C/B,CAAA"}
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useId } from "react";
4
+ import { Ledger } from "./effects-panel.js";
5
+ import { ledgerOf } from "./ledger.js";
6
+ const Spinner = () => _jsx("span", { className: "slip-panel__spin", "aria-hidden": "true" });
7
+ const Head = ({ kicker, lead, title, titleId, tone }) => (_jsxs("div", { className: "slip-panel__claim", children: [_jsx("p", { className: "slip-panel__kicker", "data-tone": tone, children: kicker }), _jsx("h2", { className: "slip-panel__title", id: titleId, children: title }), lead === undefined ? undefined : _jsx("p", { className: "slip-panel__lead", children: lead })] }));
8
+ export const OutcomePanel = ({ claim, derived, onAgain, onClose, outcome }) => {
9
+ const title = useId();
10
+ const rows = ledgerOf(derived);
11
+ switch (outcome._tag) {
12
+ case "Waiting":
13
+ return (_jsxs("section", { className: "slip-root slip-panel", "data-outcome": "waiting", "aria-labelledby": title, "aria-busy": "true", children: [_jsx(Head, { kicker: "What you're signing", title: claim, titleId: title }), _jsx(Ledger, { rows: rows }), _jsxs("div", { className: "slip-panel__wallet", role: "status", children: [_jsx(Spinner, {}), _jsxs("div", { className: "slip-panel__wallet-words", children: [_jsx("span", { children: "Approve in your wallet" }), _jsxs("span", { className: "slip-panel__note", children: [outcome.wallet, " is open. Nothing is sent until you do."] })] })] }), _jsx("button", { type: "button", className: "slip-panel__button", "data-kind": "cancel", onClick: onClose, children: "Cancel" })] }));
14
+ case "Declined":
15
+ return (_jsxs("section", { className: "slip-root slip-panel", "data-outcome": "declined", "aria-labelledby": title, children: [_jsx(Head, { kicker: "Not signed", title: "You declined in your wallet", titleId: title, lead: "Nothing was sent and nothing left your wallet. The link still works if you want to look again." }), _jsx("div", { className: "slip-panel__stale", children: _jsx(Ledger, { rows: rows }) }), _jsxs("div", { className: "slip-panel__buttons", children: [_jsx("button", { type: "button", className: "slip-panel__button", "data-kind": "close", onClick: onClose, children: "Close" }), _jsx("button", { type: "button", className: "slip-panel__button", "data-kind": "primary", onClick: onAgain, children: "Review and sign again" })] })] }));
16
+ case "Submitting":
17
+ return (_jsxs("section", { className: "slip-root slip-panel", "data-outcome": "submitting", "aria-labelledby": title, "aria-busy": "true", children: [_jsx(Head, { kicker: "Submitting", title: "Sending your signed transaction", titleId: title }), _jsxs("ol", { className: "slip-panel__steps", children: [_jsxs("li", { className: "slip-panel__step", children: [_jsx("span", { className: "slip-panel__tick", "aria-hidden": "true", children: "\u2713" }), _jsx("span", { children: "Signature checked against the transaction you read" })] }), _jsxs("li", { className: "slip-panel__step", role: "status", children: [_jsx(Spinner, {}), _jsx("span", { children: "Handing it to the network" })] })] }), _jsxs("div", { className: "slip-panel__transaction", children: [_jsx("span", { className: "slip-panel__note", children: "Transaction" }), _jsx("span", { className: "slip-panel__transaction-id", children: outcome.transactionId })] })] }));
18
+ case "Rebuilding":
19
+ return (_jsxs("section", { className: "slip-root slip-panel", "data-outcome": "rebuilding", "aria-labelledby": title, "aria-busy": "true", children: [_jsx(Head, { kicker: "Rebuilding", tone: "warn", title: "Your funds moved while you were signing", titleId: title, lead: "Something else spent the outputs this transaction used. Nothing was signed twice and nothing left your wallet." }), _jsxs("div", { className: "slip-panel__wallet", role: "status", children: [_jsx(Spinner, {}), _jsxs("div", { className: "slip-panel__wallet-words", children: [_jsx("span", { children: "Building a fresh transaction" }), _jsxs("span", { className: "slip-panel__note", children: ["Attempt ", outcome.number, " of ", outcome.of] })] })] }), _jsx("p", { className: "slip-panel__note", children: "It will have different amounts and a different id, so you'll see its effects checked before your wallet is asked again." }), _jsx("div", { className: "slip-panel__stale", children: _jsx(Ledger, { rows: rows }) }), _jsx("button", { type: "button", className: "slip-panel__button", "data-kind": "cancel", onClick: onClose, children: "Cancel" })] }));
20
+ case "Refused":
21
+ return (_jsxs("section", { className: "slip-root slip-panel", "data-outcome": "refused", "aria-labelledby": title, children: [_jsx(Head, { kicker: "Not submitted", tone: "bad", title: "The network wouldn't accept this transaction", titleId: title, lead: "You signed it, but it never took effect and nothing left your wallet. Your signature cannot be reused." }), _jsx("pre", { className: "slip-panel__reason", children: outcome.reason }), _jsxs("div", { className: "slip-panel__buttons", children: [_jsx("button", { type: "button", className: "slip-panel__button", "data-kind": "close", onClick: onClose, children: "Close" }), _jsx("button", { type: "button", className: "slip-panel__button", "data-kind": "primary", onClick: onAgain, children: "Start again" })] })] }));
22
+ }
23
+ };
24
+ /** A transaction id is hex with no separator, so it is shortened from both ends. */
25
+ const shortId = (id) => (id.length <= 12 ? id : `${id.slice(0, 4)}…${id.slice(-4)}`);
26
+ /** One spelling for every surface that names a network, so the receipt and the top bar never disagree. */
27
+ export const networkNames = {
28
+ mainnet: "Mainnet",
29
+ preprod: "Preprod",
30
+ preview: "Preview"
31
+ };
32
+ /**
33
+ * `10 · d`, back on the card surface. It says sent rather than confirmed: the
34
+ * node accepted the transaction, and nothing here watches the chain for it.
35
+ */
36
+ export const SlipReceipt = ({ claim, derived, explorer, network, transactionId }) => {
37
+ const title = useId();
38
+ return (_jsxs("section", { className: "slip-root slip-receipt", "aria-labelledby": title, children: [_jsxs("div", { className: "slip-receipt__head", children: [_jsx("span", { className: "slip-receipt__tick", "aria-hidden": "true", children: "\u2713" }), _jsxs("div", { className: "slip-receipt__identity", children: [_jsx("h2", { className: "slip-receipt__title", id: title, children: claim }), _jsxs("span", { className: "slip-receipt__note", children: ["Sent to ", networkNames[network]] })] })] }), _jsx("div", { className: "slip-receipt__ledger", children: ledgerOf(derived).map((row) => (_jsxs("div", { className: "slip-receipt__row", children: [_jsx("span", { className: "slip-receipt__label", children: row.label }), _jsxs("span", { className: "slip-receipt__amounts", children: [row.identifier ?? undefined, row.amounts.map((amount, index) => (_jsx("span", { className: "slip-receipt__amount", "data-tone": amount.tone, children: amount.text }, index)))] })] }, row.key))) }), _jsxs("div", { className: "slip-receipt__transaction", children: [_jsx("span", { className: "slip-receipt__kicker", children: "Transaction" }), _jsx("span", { className: "slip-receipt__id", title: transactionId, children: shortId(transactionId) }), _jsxs("a", { className: "slip-receipt__link", href: explorer.url, target: "_blank", rel: "noreferrer", children: ["View on ", explorer.name] })] }), _jsx("p", { className: "slip-receipt__note slip-receipt__foot", children: "No account was created and nothing was stored. This page keeps none of it." })] }));
39
+ };
40
+ //# sourceMappingURL=outcome-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome-panel.js","sourceRoot":"","sources":["../src/outcome-panel.tsx"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,SAAS,EAAC,sBAAsB,YAClC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC9B,eAAmB,SAAS,EAAC,mBAAmB,aAC9C,eAAM,SAAS,EAAC,qBAAqB,YAAE,GAAG,CAAC,KAAK,GAAQ,EACxD,gBAAM,SAAS,EAAC,uBAAuB,aACpC,GAAG,CAAC,UAAU,IAAI,SAAS,EAC3B,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAClC,eAAkB,SAAS,EAAC,sBAAsB,eAAY,MAAM,CAAC,IAAI,YACtE,MAAM,CAAC,IAAI,IADH,KAAK,CAET,CACR,CAAC,IACG,KATC,GAAG,CAAC,GAAG,CAUX,CACP,CAAC,GACE,EACN,eAAK,SAAS,EAAC,2BAA2B,aACxC,eAAM,SAAS,EAAC,sBAAsB,4BAAmB,EACzD,eAAM,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,aAAa,YACpD,OAAO,CAAC,aAAa,CAAC,GAClB,EACP,aAAG,SAAS,EAAC,oBAAoB,EAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,yBAC3E,QAAQ,CAAC,IAAI,IACpB,IACA,EACN,YAAG,SAAS,EAAC,uCAAuC,2FAEhD,IACI,CACX,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The form a linked action's `parameters` describe. It holds no state: what a
3
+ * person typed, and which errors are ripe to show, belong to the card.
4
+ */
5
+ import type { Parameter, ParameterValues } from "@cardano-slips/core";
6
+ /** A sentence about one field. `code` is the endpoint's, and is for us rather than for the person. */
7
+ export type FieldError = {
8
+ readonly message: string;
9
+ readonly code?: string;
10
+ };
11
+ export type ParameterFormProps = {
12
+ readonly parameters: ReadonlyArray<Parameter>;
13
+ readonly values: ParameterValues;
14
+ /** By parameter name. What is here is shown; deciding when is the card's job. */
15
+ readonly errors?: Readonly<Record<string, FieldError>>;
16
+ readonly onChange: (name: string, value: string) => void;
17
+ /** Prefixes every generated id, so two cards on one page do not collide. */
18
+ readonly idPrefix?: string;
19
+ };
20
+ /**
21
+ * The bounds line. The spec requires it beside the field rather than only on
22
+ * failure, so a person can tell what will be accepted before they type.
23
+ */
24
+ export declare const boundsOf: (parameter: Parameter) => string | undefined;
25
+ export declare const ParameterForm: ({ parameters, values, errors, onChange, idPrefix }: ParameterFormProps) => React.JSX.Element;
26
+ //# sourceMappingURL=parameter-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-form.d.ts","sourceRoot":"","sources":["../src/parameter-form.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAIrE,sGAAsG;AACtG,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,CAAA;IAC7C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;IACtD,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxD,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,WAAW,SAAS,KAAG,MAAM,GAAG,SAkBxD,CAAA;AAsED,eAAO,MAAM,aAAa,GAAI,oDAM3B,kBAAkB,KAAG,KAAK,CAAC,GAAG,CAAC,OAajC,CAAA"}