@cardano-slips/flow 0.2.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 (73) 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/card.css +492 -0
  7. package/dist/card.d.ts +41 -0
  8. package/dist/card.d.ts.map +1 -0
  9. package/dist/card.js +69 -0
  10. package/dist/card.js.map +1 -0
  11. package/dist/complete-error.d.ts +8 -1
  12. package/dist/complete-error.d.ts.map +1 -1
  13. package/dist/complete-error.js +6 -1
  14. package/dist/complete-error.js.map +1 -1
  15. package/dist/complete.d.ts +29 -10
  16. package/dist/complete.d.ts.map +1 -1
  17. package/dist/complete.js +83 -9
  18. package/dist/complete.js.map +1 -1
  19. package/dist/derived.d.ts +8 -0
  20. package/dist/derived.d.ts.map +1 -0
  21. package/dist/derived.js +2 -0
  22. package/dist/derived.js.map +1 -0
  23. package/dist/effects-panel.d.ts +37 -0
  24. package/dist/effects-panel.d.ts.map +1 -0
  25. package/dist/effects-panel.js +64 -0
  26. package/dist/effects-panel.js.map +1 -0
  27. package/dist/effects.css +629 -0
  28. package/dist/exchange.d.ts +54 -0
  29. package/dist/exchange.d.ts.map +1 -0
  30. package/dist/exchange.js +136 -0
  31. package/dist/exchange.js.map +1 -0
  32. package/dist/explain.d.ts +39 -0
  33. package/dist/explain.d.ts.map +1 -0
  34. package/dist/explain.js +172 -0
  35. package/dist/explain.js.map +1 -0
  36. package/dist/index.d.ts +19 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +9 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/ledger.d.ts +74 -0
  41. package/dist/ledger.d.ts.map +1 -0
  42. package/dist/ledger.js +402 -0
  43. package/dist/ledger.js.map +1 -0
  44. package/dist/outcome-panel.d.ts +63 -0
  45. package/dist/outcome-panel.d.ts.map +1 -0
  46. package/dist/outcome-panel.js +40 -0
  47. package/dist/outcome-panel.js.map +1 -0
  48. package/dist/parameter-form.d.ts +26 -0
  49. package/dist/parameter-form.d.ts.map +1 -0
  50. package/dist/parameter-form.js +42 -0
  51. package/dist/parameter-form.js.map +1 -0
  52. package/dist/slip-card.d.ts +55 -0
  53. package/dist/slip-card.d.ts.map +1 -0
  54. package/dist/slip-card.js +89 -0
  55. package/dist/slip-card.js.map +1 -0
  56. package/dist/tokens.css +57 -32
  57. package/package.json +9 -5
  58. package/src/address.ts +53 -0
  59. package/src/card.css +492 -0
  60. package/src/card.ts +86 -0
  61. package/src/complete-error.ts +14 -2
  62. package/src/complete.ts +128 -19
  63. package/src/derived.ts +8 -0
  64. package/src/effects-panel.tsx +386 -0
  65. package/src/effects.css +629 -0
  66. package/src/exchange.ts +212 -0
  67. package/src/explain.ts +211 -0
  68. package/src/index.ts +39 -3
  69. package/src/ledger.ts +503 -0
  70. package/src/outcome-panel.tsx +263 -0
  71. package/src/parameter-form.tsx +138 -0
  72. package/src/slip-card.tsx +244 -0
  73. package/src/tokens.css +57 -32
@@ -0,0 +1,629 @@
1
+ /*
2
+ * The effects panel and the mismatch block, drawn from `4 · Anatomy` to
3
+ * `6 · Preview states` on the design sheet. This is chrome, not the card:
4
+ * `13 · Chrome rules` fixes it wherever the page is hosted, because a
5
+ * publisher who can restyle the surface that judges them undermines the
6
+ * verdict. Every value is a token from `tokens.css`.
7
+ */
8
+
9
+ .slip-panel {
10
+ box-sizing: border-box;
11
+ container-type: inline-size;
12
+
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: var(--space-20);
16
+
17
+ width: 100%;
18
+ max-width: 520px;
19
+ margin: 0;
20
+ padding: var(--space-24);
21
+
22
+ background: var(--vault);
23
+ border: 1px solid var(--vault-border);
24
+ border-radius: var(--radius-card);
25
+ color: var(--vault-ink);
26
+
27
+ /* `5 · Entering the preview`: the surface rises from the button edge, and the title never moves. */
28
+ animation: slip-panel-wipe 220ms ease-out;
29
+ }
30
+
31
+ .slip-panel[data-blocked] {
32
+ border-color: var(--vault-bad-line);
33
+ }
34
+
35
+ .slip-panel *,
36
+ .slip-panel *::before,
37
+ .slip-panel *::after {
38
+ box-sizing: border-box;
39
+ }
40
+
41
+ .slip-panel__claim {
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: var(--space-8);
45
+ }
46
+
47
+ .slip-panel__kicker {
48
+ margin: 0;
49
+ color: var(--vault-muted);
50
+ font: var(--type-kicker);
51
+ letter-spacing: var(--type-kicker-tracking);
52
+ text-transform: uppercase;
53
+ }
54
+
55
+ .slip-panel__kicker[data-tone="bad"] {
56
+ color: var(--vault-bad);
57
+ }
58
+
59
+ .slip-panel__kicker[data-tone="warn"] {
60
+ color: var(--vault-warn);
61
+ }
62
+
63
+ .slip-panel__title {
64
+ margin: 0;
65
+ color: var(--vault-ink);
66
+ font: var(--type-preview-title);
67
+ text-wrap: pretty;
68
+ }
69
+
70
+ .slip-panel__lead {
71
+ margin: 0;
72
+ color: var(--vault-muted);
73
+ font: var(--type-row);
74
+ }
75
+
76
+ /* A host, unmarked. The verified tick belongs to the identity chip, which is not drawn here. */
77
+ .slip-panel__origin {
78
+ align-self: flex-start;
79
+ display: inline-flex;
80
+ align-items: center;
81
+ height: 24px;
82
+ padding: 0 var(--space-8);
83
+ border: 1px solid var(--vault-border);
84
+ border-radius: var(--radius-chip);
85
+ background: var(--vault-surface);
86
+ color: var(--vault-ink);
87
+ font: var(--type-technical);
88
+ }
89
+
90
+ .slip-panel__headline {
91
+ display: flex;
92
+ gap: 28px;
93
+ align-items: flex-start;
94
+ }
95
+
96
+ .slip-panel__figure {
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: var(--space-4);
100
+ min-width: 0;
101
+ }
102
+
103
+ .slip-panel__figure-amount {
104
+ color: var(--vault-ink);
105
+ font: var(--type-headline);
106
+ overflow-wrap: anywhere;
107
+ }
108
+
109
+ .slip-panel__figure-amount[data-tone="gained"] {
110
+ color: var(--vault-pos);
111
+ }
112
+
113
+ .slip-panel__figure-amount[data-tone="held"] {
114
+ color: var(--vault-warn);
115
+ }
116
+
117
+ .slip-panel__figure-amount[data-tone="stated"] {
118
+ color: var(--vault-muted);
119
+ }
120
+
121
+ .slip-panel__rule {
122
+ width: 1px;
123
+ align-self: stretch;
124
+ background: var(--vault-border);
125
+ }
126
+
127
+ .slip-panel__note {
128
+ margin: 0;
129
+ color: var(--vault-muted);
130
+ font: var(--type-note);
131
+ }
132
+
133
+ /* The ledger: one row per effect, amounts in a single right-hand column. */
134
+ .slip-panel__ledger {
135
+ display: flex;
136
+ flex-direction: column;
137
+ padding: 0 var(--space-16);
138
+ border: 1px solid var(--vault-border);
139
+ border-radius: var(--radius-control);
140
+ }
141
+
142
+ .slip-panel__row {
143
+ display: grid;
144
+ grid-template-columns: minmax(0, 1fr) auto;
145
+ gap: var(--space-8) var(--space-16);
146
+ align-items: baseline;
147
+ padding: 14px 0;
148
+ }
149
+
150
+ .slip-panel__row + .slip-panel__row {
151
+ border-top: 1px solid var(--vault-border);
152
+ }
153
+
154
+ .slip-panel__row-name {
155
+ display: flex;
156
+ flex-direction: column;
157
+ gap: 2px;
158
+ min-width: 0;
159
+ }
160
+
161
+ .slip-panel__row-label {
162
+ display: flex;
163
+ flex-wrap: wrap;
164
+ align-items: center;
165
+ gap: var(--space-8);
166
+ }
167
+
168
+ .slip-panel__label {
169
+ color: var(--vault-muted);
170
+ font: var(--type-row);
171
+ }
172
+
173
+ .slip-panel__row[data-mark] .slip-panel__label {
174
+ color: var(--vault-ink);
175
+ }
176
+
177
+ .slip-panel__detail {
178
+ margin: 0;
179
+ color: var(--vault-muted);
180
+ font: var(--type-technical);
181
+ overflow-wrap: anywhere;
182
+ }
183
+
184
+ .slip-panel__amounts {
185
+ display: flex;
186
+ flex-direction: column;
187
+ align-items: flex-end;
188
+ gap: var(--space-4);
189
+ }
190
+
191
+ .slip-panel__amount {
192
+ color: var(--vault-ink);
193
+ font: var(--type-amount);
194
+ white-space: nowrap;
195
+ }
196
+
197
+ .slip-panel__amount[data-tone="gained"] {
198
+ color: var(--vault-pos);
199
+ }
200
+
201
+ .slip-panel__amount[data-tone="fee"],
202
+ .slip-panel__amount[data-tone="held"] {
203
+ color: var(--vault-warn);
204
+ }
205
+
206
+ .slip-panel__amount[data-tone="stated"] {
207
+ color: var(--vault-muted);
208
+ }
209
+
210
+ /* The one row that is not in the claim is the only thing the block colours. */
211
+ .slip-panel__row[data-mark] .slip-panel__amount {
212
+ color: var(--vault-bad);
213
+ }
214
+
215
+ .slip-panel__identifier {
216
+ color: var(--vault-ink);
217
+ font: var(--type-technical);
218
+ white-space: nowrap;
219
+ }
220
+
221
+ .slip-panel__row > .slip-panel__note {
222
+ grid-column: 1 / -1;
223
+ padding-left: 10px;
224
+ border-left: 2px solid var(--vault-warn-line);
225
+ }
226
+
227
+ .slip-panel__chip {
228
+ display: inline-flex;
229
+ align-items: center;
230
+ height: 20px;
231
+ padding: 0 var(--space-8);
232
+ border-radius: var(--radius-chip);
233
+ font: var(--type-chip);
234
+ letter-spacing: 0.02em;
235
+ text-transform: uppercase;
236
+ }
237
+
238
+ .slip-panel__chip[data-chip="refundable"] {
239
+ border: 1px solid var(--vault-warn-line);
240
+ background: var(--vault-warn-tint);
241
+ color: var(--vault-warn);
242
+ }
243
+
244
+ .slip-panel__chip[data-chip="as-stated"] {
245
+ background: var(--vault-surface);
246
+ color: var(--vault-muted);
247
+ }
248
+
249
+ .slip-panel__chip[data-chip="mark"] {
250
+ background: var(--vault-bad-chip);
251
+ color: var(--vault-bad);
252
+ }
253
+
254
+ /* `h · Long ledger`: groups, each with its own header. */
255
+ .slip-panel__groups {
256
+ display: flex;
257
+ flex-direction: column;
258
+ gap: var(--space-12);
259
+ }
260
+
261
+ .slip-panel__group {
262
+ display: flex;
263
+ flex-direction: column;
264
+ gap: 6px;
265
+ }
266
+
267
+ .slip-panel__group-name {
268
+ margin: 0;
269
+ color: var(--vault-muted);
270
+ font: var(--type-kicker);
271
+ letter-spacing: 0.1em;
272
+ text-transform: uppercase;
273
+ }
274
+
275
+ .slip-panel__group > .slip-panel__group-name {
276
+ cursor: default;
277
+ }
278
+
279
+ .slip-panel__group > summary.slip-panel__group-name {
280
+ cursor: pointer;
281
+ }
282
+
283
+ .slip-panel__expiry {
284
+ display: flex;
285
+ justify-content: space-between;
286
+ align-items: center;
287
+ gap: var(--space-16);
288
+ }
289
+
290
+ .slip-panel__clock {
291
+ color: var(--vault-muted);
292
+ font: var(--type-countdown);
293
+ }
294
+
295
+ /* `f · Expiring`: the countdown takes the headline's place and the warning colour. */
296
+ .slip-panel__expiring {
297
+ display: flex;
298
+ flex-direction: column;
299
+ gap: 10px;
300
+ padding: 14px var(--space-16);
301
+ border: 1px solid var(--vault-warn-line);
302
+ border-radius: var(--radius-control);
303
+ background: var(--vault-warn-tint);
304
+ }
305
+
306
+ .slip-panel__expiring-head {
307
+ display: flex;
308
+ justify-content: space-between;
309
+ align-items: baseline;
310
+ gap: var(--space-16);
311
+ color: var(--vault-warn);
312
+ font: var(--type-note);
313
+ }
314
+
315
+ .slip-panel__expiring-clock {
316
+ color: var(--vault-warn);
317
+ font: var(--type-numeral);
318
+ }
319
+
320
+ .slip-panel__bar {
321
+ height: 4px;
322
+ overflow: hidden;
323
+ border-radius: 2px;
324
+ background: var(--vault-border);
325
+ }
326
+
327
+ .slip-panel__bar-fill {
328
+ display: block;
329
+ height: 4px;
330
+ border-radius: 2px;
331
+ background: var(--vault-warn);
332
+ transition: width 1s linear;
333
+ }
334
+
335
+ /* `g · Expired`: the same action at half strength, so the rebuild is the only live thing. */
336
+ .slip-panel__stale {
337
+ opacity: 0.45;
338
+ }
339
+
340
+ .slip-panel__verdict {
341
+ display: flex;
342
+ gap: var(--space-8);
343
+ align-items: flex-start;
344
+ margin: 0;
345
+ padding-top: var(--space-16);
346
+ border-top: 1px solid var(--vault-border);
347
+ color: var(--vault-muted);
348
+ font: var(--type-note);
349
+ }
350
+
351
+ .slip-panel__tick {
352
+ color: var(--vault-pos);
353
+ }
354
+
355
+ .slip-panel__buttons {
356
+ display: flex;
357
+ gap: 10px;
358
+ align-items: center;
359
+ }
360
+
361
+ .slip-panel__button {
362
+ height: 48px;
363
+ padding: 0 var(--space-24);
364
+ border: 1px solid var(--vault-border);
365
+ border-radius: var(--radius-control);
366
+ background: transparent;
367
+ color: var(--vault-ink);
368
+ font: var(--type-button);
369
+ letter-spacing: var(--type-button-tracking);
370
+ white-space: nowrap;
371
+ cursor: pointer;
372
+ transition:
373
+ background-color 180ms ease-out,
374
+ border-color 180ms ease-out,
375
+ color 180ms ease-out;
376
+ }
377
+
378
+ .slip-panel__button:focus-visible,
379
+ .slip-panel__raw-toggle:focus-visible,
380
+ .slip-panel__group > summary:focus-visible {
381
+ outline: 2px solid var(--accent-on-slate);
382
+ outline-offset: 2px;
383
+ }
384
+
385
+ .slip-panel__button[data-kind="cancel"] {
386
+ flex: 0 0 auto;
387
+ border-color: var(--vault-bad);
388
+ color: var(--vault-bad);
389
+ }
390
+
391
+ .slip-panel__button[data-kind="primary"] {
392
+ flex: 1;
393
+ min-width: 0;
394
+ border-color: var(--accent-on-slate);
395
+ color: var(--accent-on-slate);
396
+ }
397
+
398
+ .slip-panel__button[data-kind="close"] {
399
+ width: 100%;
400
+ }
401
+
402
+ .slip-panel__button[data-kind="close"]:hover,
403
+ .slip-panel__button[data-kind="quiet"]:hover {
404
+ background: var(--vault-surface);
405
+ }
406
+
407
+ .slip-panel__button[data-kind="quiet"] {
408
+ height: 36px;
409
+ padding: 0 var(--space-12);
410
+ border: none;
411
+ color: var(--vault-muted);
412
+ font: var(--type-label);
413
+ }
414
+
415
+ /* `e · Mismatch`: the claim and the transaction side by side, and the way out below. */
416
+ .slip-panel__compare {
417
+ display: grid;
418
+ grid-template-columns: 1fr 1fr;
419
+ gap: var(--space-12);
420
+ }
421
+
422
+ .slip-panel__side {
423
+ display: flex;
424
+ flex-direction: column;
425
+ gap: var(--space-8);
426
+ min-width: 0;
427
+ padding: var(--space-16);
428
+ border: 1px solid var(--vault-border);
429
+ border-radius: var(--radius-control);
430
+ }
431
+
432
+ .slip-panel__side[data-tone="bad"] {
433
+ border-color: var(--vault-bad-line);
434
+ background: var(--vault-bad-tint);
435
+ }
436
+
437
+ .slip-panel__claimed {
438
+ margin: 0;
439
+ color: var(--vault-ink);
440
+ font: var(--type-row);
441
+ }
442
+
443
+ .slip-panel__evidence {
444
+ display: flex;
445
+ flex-direction: column;
446
+ gap: var(--space-4);
447
+ }
448
+
449
+ .slip-panel__evidence-figure {
450
+ margin: 0;
451
+ color: var(--vault-ink);
452
+ font: var(--type-preview-title);
453
+ overflow-wrap: anywhere;
454
+ }
455
+
456
+ .slip-panel__exits {
457
+ display: flex;
458
+ flex-direction: column;
459
+ gap: 10px;
460
+ padding-top: var(--space-16);
461
+ border-top: 1px solid var(--vault-border);
462
+ }
463
+
464
+ .slip-panel__quiet {
465
+ display: flex;
466
+ justify-content: space-between;
467
+ align-items: center;
468
+ gap: var(--space-12);
469
+ }
470
+
471
+ /* `6 · Raw detail`: collapsed, below the decision. */
472
+ .slip-panel__raw {
473
+ display: flex;
474
+ flex-direction: column;
475
+ gap: var(--space-12);
476
+ padding-top: 14px;
477
+ border-top: 1px solid var(--vault-border);
478
+ }
479
+
480
+ .slip-panel__raw-toggle {
481
+ display: flex;
482
+ align-items: center;
483
+ gap: var(--space-8);
484
+ align-self: flex-start;
485
+ padding: 0;
486
+ border: none;
487
+ background: transparent;
488
+ color: var(--vault-muted);
489
+ font: var(--type-label);
490
+ cursor: pointer;
491
+ }
492
+
493
+ .slip-panel__raw-lines {
494
+ margin: 0;
495
+ padding: var(--space-16);
496
+ border-radius: var(--radius-control);
497
+ background: var(--vault-surface);
498
+ color: var(--vault-muted);
499
+ font: var(--type-technical);
500
+ white-space: pre-wrap;
501
+ overflow-wrap: anywhere;
502
+ }
503
+
504
+ /* `10 · Signing and outcomes`: the controls give way to the wallet, the steps, or the node's reason. */
505
+ .slip-panel__wallet {
506
+ display: flex;
507
+ gap: var(--space-12);
508
+ align-items: center;
509
+ padding: 14px 16px;
510
+ border: 1px solid var(--vault-border);
511
+ border-radius: var(--radius-control);
512
+ }
513
+
514
+ .slip-panel__wallet-words {
515
+ display: flex;
516
+ flex-direction: column;
517
+ gap: 2px;
518
+ font: var(--type-row);
519
+ color: var(--vault-ink);
520
+ }
521
+
522
+ .slip-panel__spin {
523
+ width: 16px;
524
+ height: 16px;
525
+ flex: none;
526
+ border-radius: 50%;
527
+ border: 2px solid var(--vault-border);
528
+ border-top-color: var(--vault-muted);
529
+ animation: slip-panel-spin 900ms linear infinite;
530
+ }
531
+
532
+ .slip-panel__steps {
533
+ display: flex;
534
+ flex-direction: column;
535
+ gap: var(--space-8);
536
+ margin: 0;
537
+ padding: 0;
538
+ list-style: none;
539
+ }
540
+
541
+ .slip-panel__step {
542
+ display: flex;
543
+ gap: var(--space-12);
544
+ align-items: center;
545
+ font: var(--type-row);
546
+ color: var(--vault-ink);
547
+ }
548
+
549
+ .slip-panel__reason {
550
+ margin: 0;
551
+ padding: 16px;
552
+ border: 1px solid var(--vault-border);
553
+ border-radius: var(--radius-control);
554
+ font: var(--type-technical);
555
+ color: var(--vault-muted);
556
+ white-space: pre-wrap;
557
+ overflow-wrap: anywhere;
558
+ }
559
+
560
+ .slip-panel__transaction {
561
+ display: flex;
562
+ flex-direction: column;
563
+ gap: var(--space-4);
564
+ padding: 12px 16px;
565
+ border: 1px solid var(--vault-border);
566
+ border-radius: var(--radius-control);
567
+ }
568
+
569
+ .slip-panel__transaction-id {
570
+ font: var(--type-technical);
571
+ color: var(--vault-ink);
572
+ overflow-wrap: anywhere;
573
+ }
574
+
575
+ @keyframes slip-panel-spin {
576
+ to {
577
+ transform: rotate(360deg);
578
+ }
579
+ }
580
+
581
+ @keyframes slip-panel-wipe {
582
+ from {
583
+ clip-path: inset(100% 0 0 0 round var(--radius-card));
584
+ }
585
+ to {
586
+ clip-path: inset(0 0 0 0 round var(--radius-card));
587
+ }
588
+ }
589
+
590
+ @keyframes slip-panel-fade {
591
+ from {
592
+ opacity: 0;
593
+ }
594
+ to {
595
+ opacity: 1;
596
+ }
597
+ }
598
+
599
+ /* The sheet swaps the wipe for a short cross-fade rather than dropping motion altogether. */
600
+ @media (prefers-reduced-motion: reduce) {
601
+ .slip-panel {
602
+ animation: slip-panel-fade 120ms ease-out;
603
+ }
604
+
605
+ .slip-panel__bar-fill {
606
+ transition: none;
607
+ }
608
+
609
+ /* Still, but not hidden: the words beside it already say something is happening. */
610
+ .slip-panel__spin {
611
+ animation: none;
612
+ border-top-color: var(--vault-border);
613
+ }
614
+ }
615
+
616
+ @container (max-width: 440px) {
617
+ .slip-panel__compare {
618
+ grid-template-columns: 1fr;
619
+ }
620
+
621
+ .slip-panel__headline {
622
+ flex-direction: column;
623
+ gap: var(--space-12);
624
+ }
625
+
626
+ .slip-panel__rule {
627
+ display: none;
628
+ }
629
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The two HTTP exchanges a client makes: `GET` for the Slip and `POST` for the
3
+ * partial intent. Every way either can fail arrives as one error in the spec's
4
+ * vocabulary, classified by the rules in "Failure responses".
5
+ */
6
+ import { type BoundedRequestOptions, type InsecureSlipUrl, type Network, type PartialIntent, type Slip, type SlipErrorClass } from "@cardano-slips/core";
7
+ import { Effect } from "effect";
8
+ export type ExchangeOptions = BoundedRequestOptions;
9
+ declare const ExchangeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
10
+ readonly _tag: "ExchangeError";
11
+ } & Readonly<A>;
12
+ /**
13
+ * `code` is a spec code, or one an endpoint sent that the spec does not define.
14
+ * It is absent only where the body could not be read, and then `status` is all
15
+ * there is to go on.
16
+ */
17
+ export declare class ExchangeError extends ExchangeError_base<{
18
+ readonly code?: string;
19
+ readonly errorClass: SlipErrorClass;
20
+ /** The endpoint's own words, present only when its failure body was readable. */
21
+ readonly endpointMessage?: string;
22
+ readonly field?: string;
23
+ readonly status?: number;
24
+ /** Seconds, from `Retry-After`. */
25
+ readonly retryAfter?: number;
26
+ /** For whoever integrates this; never put in front of a person. */
27
+ readonly detail: string;
28
+ }> {
29
+ get message(): string;
30
+ }
31
+ export type FetchedSlip = {
32
+ readonly slip: Slip;
33
+ /** The endpoint the link resolved to. Every `href` resolves against it. */
34
+ readonly discoveryUrl: string;
35
+ };
36
+ /**
37
+ * The link to a Slip a person can be shown, or why not. `slips.json` is read
38
+ * first, because the link a person shares is not always the endpoint. A link
39
+ * that is not `https:` fails as `InsecureSlipUrl`, before anything is fetched.
40
+ */
41
+ export declare const fetchSlip: (link: string, options?: ExchangeOptions) => Effect.Effect<FetchedSlip, ExchangeError | InsecureSlipUrl>;
42
+ export type IntentRequest = {
43
+ /** Absolute, as `SlipCard` hands it over. */
44
+ readonly href: string;
45
+ readonly changeAddress: string;
46
+ readonly network: Network;
47
+ };
48
+ /**
49
+ * The partial intent for one action. The body is the change address and the
50
+ * network and nothing else: Mode A never tells an endpoint what a wallet holds.
51
+ */
52
+ export declare const requestIntent: ({ changeAddress, href, network }: IntentRequest, options?: ExchangeOptions) => Effect.Effect<PartialIntent, ExchangeError>;
53
+ export {};
54
+ //# sourceMappingURL=exchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../src/exchange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGL,KAAK,qBAAqB,EAQ1B,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGlB,KAAK,IAAI,EACT,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAQ,MAAM,EAAU,MAAM,QAAQ,CAAA;AAE7C,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAA;;;;AAEnD;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,mBAAkC;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAA;IACnC,iFAAiF;IACjF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,mCAAmC;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AA4FD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,UAAS,eAAoB,KAC5B,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,GAAG,eAAe,CAuBzD,CAAA;AAEJ,MAAM,MAAM,aAAa,GAAG;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,kCAAkC,aAAa,EAC/C,UAAS,eAAoB,KAC5B,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,CAkBzC,CAAA"}