@cardano-slips/flow 0.2.0 → 0.3.1
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 +53 -9
- package/dist/address.d.ts +12 -0
- package/dist/address.d.ts.map +1 -1
- package/dist/address.js +43 -0
- package/dist/address.js.map +1 -1
- package/dist/card.css +492 -0
- package/dist/card.d.ts +41 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +69 -0
- package/dist/card.js.map +1 -0
- package/dist/complete-error.d.ts +8 -1
- package/dist/complete-error.d.ts.map +1 -1
- package/dist/complete-error.js +6 -1
- package/dist/complete-error.js.map +1 -1
- package/dist/complete.d.ts +29 -10
- package/dist/complete.d.ts.map +1 -1
- package/dist/complete.js +83 -9
- package/dist/complete.js.map +1 -1
- package/dist/derived.d.ts +8 -0
- package/dist/derived.d.ts.map +1 -0
- package/dist/derived.js +2 -0
- package/dist/derived.js.map +1 -0
- package/dist/effects-panel.d.ts +37 -0
- package/dist/effects-panel.d.ts.map +1 -0
- package/dist/effects-panel.js +64 -0
- package/dist/effects-panel.js.map +1 -0
- package/dist/effects.css +629 -0
- package/dist/exchange.d.ts +54 -0
- package/dist/exchange.d.ts.map +1 -0
- package/dist/exchange.js +136 -0
- package/dist/exchange.js.map +1 -0
- package/dist/explain.d.ts +39 -0
- package/dist/explain.d.ts.map +1 -0
- package/dist/explain.js +172 -0
- package/dist/explain.js.map +1 -0
- package/dist/index.d.ts +19 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +74 -0
- package/dist/ledger.d.ts.map +1 -0
- package/dist/ledger.js +402 -0
- package/dist/ledger.js.map +1 -0
- package/dist/outcome-panel.d.ts +63 -0
- package/dist/outcome-panel.d.ts.map +1 -0
- package/dist/outcome-panel.js +40 -0
- package/dist/outcome-panel.js.map +1 -0
- package/dist/parameter-form.d.ts +26 -0
- package/dist/parameter-form.d.ts.map +1 -0
- package/dist/parameter-form.js +42 -0
- package/dist/parameter-form.js.map +1 -0
- package/dist/slip-card.d.ts +55 -0
- package/dist/slip-card.d.ts.map +1 -0
- package/dist/slip-card.js +89 -0
- package/dist/slip-card.js.map +1 -0
- package/dist/tokens.css +57 -32
- package/package.json +11 -7
- package/src/address.ts +53 -0
- package/src/card.css +492 -0
- package/src/card.ts +86 -0
- package/src/complete-error.ts +14 -2
- package/src/complete.ts +128 -19
- package/src/derived.ts +8 -0
- package/src/effects-panel.tsx +386 -0
- package/src/effects.css +629 -0
- package/src/exchange.ts +212 -0
- package/src/explain.ts +211 -0
- package/src/index.ts +39 -3
- package/src/ledger.ts +503 -0
- package/src/outcome-panel.tsx +263 -0
- package/src/parameter-form.tsx +138 -0
- package/src/slip-card.tsx +244 -0
- package/src/tokens.css +57 -32
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of a Slip card that need no React: which buttons a Slip asks for,
|
|
3
|
+
* whether each one may be pressed, and what a button says once the person's
|
|
4
|
+
* values are in it.
|
|
5
|
+
*/
|
|
6
|
+
import { type LinkedAction, type ParameterValues, type Reason, type Slip, type ValueIssue } from "@cardano-slips/core";
|
|
7
|
+
/**
|
|
8
|
+
* The buttons the Slip asks for. `links` absent is one button labelled `label`
|
|
9
|
+
* whose target is the discovery URL itself — the spec's rule, not a default of
|
|
10
|
+
* ours, which is why it is written once here rather than in each component.
|
|
11
|
+
*/
|
|
12
|
+
export declare const actionsOf: (slip: Slip, discoveryUrl: string) => ReadonlyArray<LinkedAction>;
|
|
13
|
+
/**
|
|
14
|
+
* Why this action cannot be used, or undefined while it can. The top level
|
|
15
|
+
* wins: an action carrying `disabled: false` under a disabled Slip stays
|
|
16
|
+
* closed, and is never reopened by its own field.
|
|
17
|
+
*/
|
|
18
|
+
export declare const closureOf: (slip: Slip, action: LinkedAction) => Reason | undefined;
|
|
19
|
+
/** The host that served the link. Undefined where the URL is not one we can read. */
|
|
20
|
+
export declare const originOf: (discoveryUrl: string) => string | undefined;
|
|
21
|
+
/** The publisher's initial, for an icon that did not load. Never a generic glyph. */
|
|
22
|
+
export declare const monogramOf: (discoveryUrl: string) => string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Own properties only. `ParameterName` admits `constructor`, `toString` and the
|
|
25
|
+
* rest of `Object.prototype`, and a plain object answers for every one of them —
|
|
26
|
+
* so a field nobody filled would be handed a function where a string belongs.
|
|
27
|
+
*/
|
|
28
|
+
export declare const valueOf: (values: ParameterValues, name: string) => string;
|
|
29
|
+
/** Just the values this action asked for, so a caller is handed no answer it did not request. */
|
|
30
|
+
export declare const valuesFor: (action: LinkedAction, values: ParameterValues) => ParameterValues;
|
|
31
|
+
/**
|
|
32
|
+
* What the button says. A label made only of placeholders empties out, and the
|
|
33
|
+
* Slip's own call to action stands in rather than a blank button.
|
|
34
|
+
*/
|
|
35
|
+
export declare const actionLabel: (slip: Slip, action: LinkedAction, values: ParameterValues) => string;
|
|
36
|
+
/**
|
|
37
|
+
* The label of a button that was pressed and cannot send. It counts fields
|
|
38
|
+
* rather than issues: one field can fail two ways and is still one thing to fix.
|
|
39
|
+
*/
|
|
40
|
+
export declare const blockedLabel: (issues: ReadonlyArray<ValueIssue>) => string;
|
|
41
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAA;AAE5B;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,EAAE,cAAc,MAAM,KAAG,aAAa,CAAC,YAAY,CACnB,CAAA;AAEpE;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,EAAE,QAAQ,YAAY,KAAG,MAAM,GAAG,SAGrE,CAAA;AAED,qFAAqF;AACrF,eAAO,MAAM,QAAQ,GAAI,cAAc,MAAM,KAAG,MAAM,GAAG,SAMxD,CAAA;AAED,qFAAqF;AACrF,eAAO,MAAM,UAAU,GAAI,cAAc,MAAM,KAAG,MAAM,GAAG,SACY,CAAA;AAEvE;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,eAAe,EAAE,MAAM,MAAM,KAAG,MACf,CAAA;AAEjD,iGAAiG;AACjG,eAAO,MAAM,SAAS,GAAI,QAAQ,YAAY,EAAE,QAAQ,eAAe,KAAG,eAIzE,CAAA;AAWD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,EAAE,QAAQ,YAAY,EAAE,QAAQ,eAAe,KAAG,MAGvF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,CAAC,UAAU,CAAC,KAAG,MAGhE,CAAA"}
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of a Slip card that need no React: which buttons a Slip asks for,
|
|
3
|
+
* whether each one may be pressed, and what a button says once the person's
|
|
4
|
+
* values are in it.
|
|
5
|
+
*/
|
|
6
|
+
import { fillLabel } from "@cardano-slips/core";
|
|
7
|
+
/**
|
|
8
|
+
* The buttons the Slip asks for. `links` absent is one button labelled `label`
|
|
9
|
+
* whose target is the discovery URL itself — the spec's rule, not a default of
|
|
10
|
+
* ours, which is why it is written once here rather than in each component.
|
|
11
|
+
*/
|
|
12
|
+
export const actionsOf = (slip, discoveryUrl) => slip.links?.actions ?? [{ label: slip.label, href: discoveryUrl }];
|
|
13
|
+
/**
|
|
14
|
+
* Why this action cannot be used, or undefined while it can. The top level
|
|
15
|
+
* wins: an action carrying `disabled: false` under a disabled Slip stays
|
|
16
|
+
* closed, and is never reopened by its own field.
|
|
17
|
+
*/
|
|
18
|
+
export const closureOf = (slip, action) => {
|
|
19
|
+
if (slip.disabled === true)
|
|
20
|
+
return slip.reason;
|
|
21
|
+
return action.disabled === true ? action.reason : undefined;
|
|
22
|
+
};
|
|
23
|
+
/** The host that served the link. Undefined where the URL is not one we can read. */
|
|
24
|
+
export const originOf = (discoveryUrl) => {
|
|
25
|
+
try {
|
|
26
|
+
return new URL(discoveryUrl).host;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/** The publisher's initial, for an icon that did not load. Never a generic glyph. */
|
|
33
|
+
export const monogramOf = (discoveryUrl) => /\p{L}|\p{N}/u.exec(originOf(discoveryUrl) ?? "")?.[0]?.toUpperCase();
|
|
34
|
+
/**
|
|
35
|
+
* Own properties only. `ParameterName` admits `constructor`, `toString` and the
|
|
36
|
+
* rest of `Object.prototype`, and a plain object answers for every one of them —
|
|
37
|
+
* so a field nobody filled would be handed a function where a string belongs.
|
|
38
|
+
*/
|
|
39
|
+
export const valueOf = (values, name) => Object.hasOwn(values, name) ? values[name] : "";
|
|
40
|
+
/** Just the values this action asked for, so a caller is handed no answer it did not request. */
|
|
41
|
+
export const valuesFor = (action, values) => {
|
|
42
|
+
const picked = {};
|
|
43
|
+
for (const parameter of action.parameters ?? [])
|
|
44
|
+
picked[parameter.name] = valueOf(values, parameter.name);
|
|
45
|
+
return picked;
|
|
46
|
+
};
|
|
47
|
+
const spelled = ["", "one", "two", "three", "four", "five", "six", "seven", "eight"];
|
|
48
|
+
/**
|
|
49
|
+
* Runs of whitespace collapse because a label is a template: `Contribute
|
|
50
|
+
* {amount} {token}` with nothing typed is `Contribute`, not `Contribute `.
|
|
51
|
+
*/
|
|
52
|
+
const filled = (action, values) => fillLabel(action, values).replace(/\s+/g, " ").trim();
|
|
53
|
+
/**
|
|
54
|
+
* What the button says. A label made only of placeholders empties out, and the
|
|
55
|
+
* Slip's own call to action stands in rather than a blank button.
|
|
56
|
+
*/
|
|
57
|
+
export const actionLabel = (slip, action, values) => {
|
|
58
|
+
const label = filled(action, values);
|
|
59
|
+
return label === "" ? slip.label : label;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The label of a button that was pressed and cannot send. It counts fields
|
|
63
|
+
* rather than issues: one field can fail two ways and is still one thing to fix.
|
|
64
|
+
*/
|
|
65
|
+
export const blockedLabel = (issues) => {
|
|
66
|
+
const fields = new Set(issues.map((issue) => issue.name)).size;
|
|
67
|
+
return `Fix ${spelled[fields] ?? String(fields)} ${fields === 1 ? "field" : "fields"} to continue`;
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=card.js.map
|
package/dist/card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,SAAS,EAMV,MAAM,qBAAqB,CAAA;AAE5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAU,EAAE,YAAoB,EAA+B,EAAE,CACzF,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;AAEpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAU,EAAE,MAAoB,EAAsB,EAAE;IAChF,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC,MAAM,CAAA;IAC9C,OAAO,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AAC7D,CAAC,CAAA;AAED,qFAAqF;AACrF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,YAAoB,EAAsB,EAAE;IACnE,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,YAAY,CAAC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IAAU,EAAE,MAAoB,EAAE,MAAuB,EAAU,EAAE;IAC/F,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AAC1C,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAiC,EAAU,EAAE;IACxE,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9D,OAAO,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,cAAc,CAAA;AACpG,CAAC,CAAA"}
|
package/dist/complete-error.d.ts
CHANGED
|
@@ -6,17 +6,22 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type ClientErrorCode } from "@cardano-slips/core";
|
|
8
8
|
import type { Reason } from "@cardano-slips/verifier";
|
|
9
|
+
import type { Derived } from "./derived.js";
|
|
9
10
|
export type CompletionRefusal =
|
|
10
11
|
/** The wallet reported no unspent outputs, so there is nothing to build from. */
|
|
11
12
|
"NoUtxos"
|
|
12
13
|
/** What `getUtxos` answered is not something these bytes can be read as. */
|
|
13
14
|
| "UnreadableUtxos"
|
|
15
|
+
/** The wallet would not say which addresses are its own, or named one that cannot be read. */
|
|
16
|
+
| "UnreadableAddresses"
|
|
14
17
|
/** The effects could not be derived from the transaction, or compared with the declaration. */
|
|
15
18
|
| "CannotJudge"
|
|
16
19
|
/** The derived effects disagree with what the endpoint declared. Nothing signs after this. */
|
|
17
20
|
| "Blocked"
|
|
18
21
|
/** The caller could not put the effects in front of a person, so nothing may be signed. */
|
|
19
22
|
| "NotShown"
|
|
23
|
+
/** The person closed the transaction without signing it. Not a fault. */
|
|
24
|
+
| "Cancelled"
|
|
20
25
|
/** The funds kept moving, and the transaction has been rebuilt as often as it will be. */
|
|
21
26
|
| "OutOfAttempts";
|
|
22
27
|
/**
|
|
@@ -30,13 +35,14 @@ declare const CompletionError_base: new <A extends Record<string, any> = {}>(arg
|
|
|
30
35
|
} & Readonly<A>;
|
|
31
36
|
/**
|
|
32
37
|
* `reasons` is what the transaction actually does against what was declared,
|
|
33
|
-
* for the block to render. There is no way to carry on from one — a mismatch
|
|
38
|
+
* and `derived` is the whole of what it does, for the block to render. There is no way to carry on from one — a mismatch
|
|
34
39
|
* hard-blocks, with no override, no allowlist and no confirmation.
|
|
35
40
|
*/
|
|
36
41
|
export declare class CompletionError extends CompletionError_base<{
|
|
37
42
|
readonly refusal: CompletionRefusal;
|
|
38
43
|
readonly detail: string;
|
|
39
44
|
readonly reasons?: ReadonlyArray<Reason>;
|
|
45
|
+
readonly derived?: Derived;
|
|
40
46
|
readonly cause?: unknown;
|
|
41
47
|
}> {
|
|
42
48
|
get message(): string;
|
|
@@ -44,6 +50,7 @@ export declare class CompletionError extends CompletionError_base<{
|
|
|
44
50
|
}
|
|
45
51
|
export declare const refuse: (refusal: CompletionRefusal, detail: string, extra?: {
|
|
46
52
|
readonly reasons?: ReadonlyArray<Reason>;
|
|
53
|
+
readonly derived?: Derived;
|
|
47
54
|
readonly cause?: unknown;
|
|
48
55
|
}) => CompletionError;
|
|
49
56
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete-error.d.ts","sourceRoot":"","sources":["../src/complete-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAGrD,MAAM,MAAM,iBAAiB;AAC3B,iFAAiF;AAC/E,SAA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,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;IAED,IAAI,IAAI,IAAI,eAAe,GAAG,SAAS,CAEtC;CACF;AAED,eAAO,MAAM,MAAM,GACjB,SAAS,iBAAiB,EAC1B,QAAQ,MAAM,EACd,QAAO;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,KAC7G,eAOC,CAAA"}
|
package/dist/complete-error.js
CHANGED
|
@@ -6,9 +6,11 @@ import { Data } from "effect";
|
|
|
6
6
|
export const completionRefusals = {
|
|
7
7
|
NoUtxos: true,
|
|
8
8
|
UnreadableUtxos: true,
|
|
9
|
+
UnreadableAddresses: true,
|
|
9
10
|
CannotJudge: true,
|
|
10
11
|
Blocked: true,
|
|
11
12
|
NotShown: true,
|
|
13
|
+
Cancelled: true,
|
|
12
14
|
OutOfAttempts: true
|
|
13
15
|
};
|
|
14
16
|
export const slipErrorCodeFor = (refusal) => {
|
|
@@ -20,14 +22,16 @@ export const slipErrorCodeFor = (refusal) => {
|
|
|
20
22
|
case "CannotJudge":
|
|
21
23
|
return "CANNOT_BALANCE";
|
|
22
24
|
case "UnreadableUtxos":
|
|
25
|
+
case "UnreadableAddresses":
|
|
23
26
|
case "NotShown":
|
|
27
|
+
case "Cancelled":
|
|
24
28
|
case "OutOfAttempts":
|
|
25
29
|
return undefined;
|
|
26
30
|
}
|
|
27
31
|
};
|
|
28
32
|
/**
|
|
29
33
|
* `reasons` is what the transaction actually does against what was declared,
|
|
30
|
-
* for the block to render. There is no way to carry on from one — a mismatch
|
|
34
|
+
* and `derived` is the whole of what it does, for the block to render. There is no way to carry on from one — a mismatch
|
|
31
35
|
* hard-blocks, with no override, no allowlist and no confirmation.
|
|
32
36
|
*/
|
|
33
37
|
export class CompletionError extends Data.TaggedError("CompletionError") {
|
|
@@ -42,6 +46,7 @@ export const refuse = (refusal, detail, extra = {}) => new CompletionError({
|
|
|
42
46
|
refusal,
|
|
43
47
|
detail,
|
|
44
48
|
...(extra.reasons === undefined ? {} : { reasons: extra.reasons }),
|
|
49
|
+
...(extra.derived === undefined ? {} : { derived: extra.derived }),
|
|
45
50
|
...(extra.cause === undefined ? {} : { cause: extra.cause })
|
|
46
51
|
});
|
|
47
52
|
//# sourceMappingURL=complete-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete-error.js","sourceRoot":"","sources":["../src/complete-error.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"complete-error.js","sourceRoot":"","sources":["../src/complete-error.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAsB7B;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA8C;IAC3E,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,IAAI;CACpB,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAA0B,EAA+B,EAAE;IAC1F,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS;YACZ,OAAO,kBAAkB,CAAA;QAC3B,KAAK,SAAS;YACZ,OAAO,oBAAoB,CAAA;QAC7B,KAAK,aAAa;YAChB,OAAO,gBAAgB,CAAA;QACzB,KAAK,iBAAiB,CAAC;QACvB,KAAK,qBAAqB,CAAC;QAC3B,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW,CAAC;QACjB,KAAK,eAAe;YAClB,OAAO,SAAS,CAAA;IACpB,CAAC;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAMrE;IACA,IAAa,OAAO;QAClB,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,OAA0B,EAC1B,MAAc,EACd,QAA4G,EAAE,EAC7F,EAAE,CACnB,IAAI,eAAe,CAAC;IAClB,OAAO;IACP,MAAM;IACN,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAClE,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAClE,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;CAC7D,CAAC,CAAA"}
|
package/dist/complete.d.ts
CHANGED
|
@@ -10,15 +10,32 @@ import { type Effects } from "@cardano-slips/verifier";
|
|
|
10
10
|
import { Effect } from "effect";
|
|
11
11
|
import { type BalancingParameters } from "./balance.js";
|
|
12
12
|
import type { BalanceError } from "./balance-error.js";
|
|
13
|
-
import type
|
|
13
|
+
import { type Cip30Api } from "./cip30.js";
|
|
14
14
|
import { type CompletionError } from "./complete-error.js";
|
|
15
|
+
import type { Derived } from "./derived.js";
|
|
15
16
|
import type { SigningError } from "./sign-error.js";
|
|
16
|
-
export type Attempt = {
|
|
17
|
+
export type Attempt = Derived & {
|
|
17
18
|
/** Counting from one, so a rendered "attempt 2 of 3" reads as a person would say it. */
|
|
18
19
|
readonly number: number;
|
|
19
20
|
readonly transactionId: string;
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
};
|
|
22
|
+
/** Where the path has got to after the person agreed, for a screen that says so. */
|
|
23
|
+
export type Progress =
|
|
24
|
+
/** The wallet has been asked for a signature on this transaction. */
|
|
25
|
+
{
|
|
26
|
+
readonly _tag: "Signing";
|
|
27
|
+
readonly transactionId: string;
|
|
28
|
+
}
|
|
29
|
+
/** The witnesses are in the body and the wallet has been asked to submit it. */
|
|
30
|
+
| {
|
|
31
|
+
readonly _tag: "Submitting";
|
|
32
|
+
readonly transactionId: string;
|
|
33
|
+
}
|
|
34
|
+
/** The funds moved under the last transaction; attempt `number` of `of` is being built. */
|
|
35
|
+
| {
|
|
36
|
+
readonly _tag: "Rebuilding";
|
|
37
|
+
readonly number: number;
|
|
38
|
+
readonly of: number;
|
|
22
39
|
};
|
|
23
40
|
export type CompletionRequest = {
|
|
24
41
|
readonly api: Cip30Api;
|
|
@@ -26,12 +43,6 @@ export type CompletionRequest = {
|
|
|
26
43
|
readonly intent: Intent;
|
|
27
44
|
readonly network: Network;
|
|
28
45
|
readonly changeAddress: string;
|
|
29
|
-
/**
|
|
30
|
-
* Every address the wallet calls its own, its reward account included. An
|
|
31
|
-
* address missing from here is read as a stranger's, which turns the wallet's
|
|
32
|
-
* own change into an undeclared payment and blocks the Slip.
|
|
33
|
-
*/
|
|
34
|
-
readonly userAddresses: ReadonlyArray<Uint8Array>;
|
|
35
46
|
readonly parameters: BalancingParameters;
|
|
36
47
|
readonly rewardBalance?: bigint;
|
|
37
48
|
/** Read once per attempt: a rebuilt transaction gets its own validity window. */
|
|
@@ -40,6 +51,14 @@ export type CompletionRequest = {
|
|
|
40
51
|
readonly attempts?: number;
|
|
41
52
|
/** Called once per attempt, after the effects are derived and before the wallet is asked to sign. */
|
|
42
53
|
readonly onAttempt?: (attempt: Attempt) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Resolves `true` once the person has pressed sign on this attempt, `false`
|
|
56
|
+
* if they turned it down. Asked again for every rebuilt transaction, because
|
|
57
|
+
* agreeing to one body is not agreeing to the next. Without it, showing the
|
|
58
|
+
* effects is taken as agreement.
|
|
59
|
+
*/
|
|
60
|
+
readonly confirm?: (attempt: Attempt) => Promise<boolean>;
|
|
61
|
+
readonly onProgress?: (progress: Progress) => void;
|
|
43
62
|
};
|
|
44
63
|
export type Receipt = {
|
|
45
64
|
readonly transactionId: string;
|
package/dist/complete.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete.d.ts","sourceRoot":"","sources":["../src/complete.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"complete.d.ts","sourceRoot":"","sources":["../src/complete.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAOL,KAAK,OAAO,EAEb,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAGvC,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,KAAK,QAAQ,EAAkC,MAAM,YAAY,CAAA;AAC1E,OAAO,EAAE,KAAK,eAAe,EAAU,MAAM,qBAAqB,CAAA;AAElE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAOnD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG;IAC9B,wFAAwF;IACxF,QAAQ,CAAC,MAA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QAAQ,KAAK,IAAI,CAAA;CACnD,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,KAAK,OAAO,GAAG,YAAY,GAAG,eAAe,GAAG,YAAY,CAAA;AAgL5D;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,iBAAiB,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CA2CtF,CAAA"}
|
package/dist/complete.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { compare, decodeTransaction, deriveEffects } from "@cardano-slips/verifier";
|
|
1
|
+
import { compare, decodeBech32, decodeTransaction, deriveAssets, deriveEffects, deriveLovelace } from "@cardano-slips/verifier";
|
|
2
2
|
import { Effect, Either } from "effect";
|
|
3
|
+
import { readOwnAddress } from "./address.js";
|
|
3
4
|
import { balanceIntent } from "./balance.js";
|
|
5
|
+
import { describeApiError, readApiError } from "./cip30.js";
|
|
4
6
|
import { refuse } from "./complete-error.js";
|
|
7
|
+
import { networkIdFor } from "./connect.js";
|
|
5
8
|
import { asResolvedInputs } from "./resolve.js";
|
|
6
9
|
import { signTransaction, submitTransaction } from "./sign.js";
|
|
7
10
|
import { readWalletUtxos } from "./utxo.js";
|
|
@@ -25,6 +28,46 @@ const walletUtxos = (api) => Effect.gen(function* () {
|
|
|
25
28
|
}
|
|
26
29
|
return read.right;
|
|
27
30
|
});
|
|
31
|
+
const addressesFrom = (api, method) => Effect.tryPromise({
|
|
32
|
+
try: () => api[method](),
|
|
33
|
+
catch: (cause) => {
|
|
34
|
+
const cip30 = readApiError(cause);
|
|
35
|
+
const said = cip30 === undefined ? String(cause) : describeApiError(cip30);
|
|
36
|
+
return refuse("UnreadableAddresses", `The wallet could not say which addresses are its own: ${said}`, { cause });
|
|
37
|
+
}
|
|
38
|
+
}).pipe(Effect.filterOrFail((answered) => Array.isArray(answered), () => refuse("UnreadableAddresses", `The wallet answered ${method} with something that is not a list.`)));
|
|
39
|
+
/**
|
|
40
|
+
* Every address the wallet vouches for: those CIP-30 lists, the change address,
|
|
41
|
+
* and the address of every output it said it holds. Read with the outputs on
|
|
42
|
+
* each attempt, since both can change when the funds move. One missing is read
|
|
43
|
+
* as a stranger's, and its value would be shown as someone else's. The outputs'
|
|
44
|
+
* addresses are ahead of the spec's list, until
|
|
45
|
+
* https://github.com/emmanuel-musau/cardano-slips/issues/186 brings it into line.
|
|
46
|
+
*/
|
|
47
|
+
const ownAddresses = (request, inputs) => Effect.gen(function* () {
|
|
48
|
+
const listed = [
|
|
49
|
+
...(yield* addressesFrom(request.api, "getUsedAddresses")),
|
|
50
|
+
...(yield* addressesFrom(request.api, "getUnusedAddresses")),
|
|
51
|
+
...(yield* addressesFrom(request.api, "getRewardAddresses"))
|
|
52
|
+
];
|
|
53
|
+
const network = networkIdFor(request.network);
|
|
54
|
+
const read = [];
|
|
55
|
+
for (const hex of listed) {
|
|
56
|
+
const address = readOwnAddress(hex);
|
|
57
|
+
if (Either.isLeft(address)) {
|
|
58
|
+
return yield* Effect.fail(refuse("UnreadableAddresses", `The wallet named an address of its own that cannot be read: ${address.left}`));
|
|
59
|
+
}
|
|
60
|
+
if (address.right.networkId !== undefined && address.right.networkId !== network) {
|
|
61
|
+
return yield* Effect.fail(refuse("UnreadableAddresses", "The wallet named an address on another network as its own."));
|
|
62
|
+
}
|
|
63
|
+
read.push(address.right.bytes);
|
|
64
|
+
}
|
|
65
|
+
const change = decodeBech32(request.changeAddress);
|
|
66
|
+
if (Either.isLeft(change)) {
|
|
67
|
+
return yield* Effect.fail(refuse("UnreadableAddresses", "The change address is not an address."));
|
|
68
|
+
}
|
|
69
|
+
return [...read, change.right.bytes, ...inputs.map((input) => input.address)];
|
|
70
|
+
});
|
|
28
71
|
/**
|
|
29
72
|
* One transaction, from the wallet's outputs to a verdict. The judging happens
|
|
30
73
|
* here rather than at the caller so that no path reaches `signTransaction`
|
|
@@ -46,17 +89,24 @@ const buildAndJudge = (request, number) => Effect.gen(function* () {
|
|
|
46
89
|
if (Either.isLeft(transaction)) {
|
|
47
90
|
return yield* Effect.fail(refuse("CannotJudge", `This transaction could not be read back: ${transaction.left.message}`));
|
|
48
91
|
}
|
|
49
|
-
const
|
|
92
|
+
const resolvedInputs = asResolvedInputs(utxos);
|
|
93
|
+
const derivation = {
|
|
50
94
|
transaction: transaction.right,
|
|
51
|
-
userAddresses: request
|
|
52
|
-
resolvedInputs
|
|
95
|
+
userAddresses: yield* ownAddresses(request, resolvedInputs),
|
|
96
|
+
resolvedInputs,
|
|
53
97
|
protocolParameters: request.parameters
|
|
98
|
+
};
|
|
99
|
+
const read = Either.all({
|
|
100
|
+
effects: deriveEffects(derivation),
|
|
101
|
+
lovelace: deriveLovelace(derivation),
|
|
102
|
+
assets: deriveAssets(derivation)
|
|
54
103
|
});
|
|
55
|
-
if (Either.isLeft(
|
|
56
|
-
return yield* Effect.fail(refuse("CannotJudge", `What this transaction does could not be worked out: ${
|
|
104
|
+
if (Either.isLeft(read)) {
|
|
105
|
+
return yield* Effect.fail(refuse("CannotJudge", `What this transaction does could not be worked out: ${read.left.message}`));
|
|
57
106
|
}
|
|
107
|
+
const derived = read.right;
|
|
58
108
|
const verdict = compare({
|
|
59
|
-
effects: effects
|
|
109
|
+
effects: derived.effects,
|
|
60
110
|
declared: request.intent,
|
|
61
111
|
changeAddress: request.changeAddress,
|
|
62
112
|
now: BigInt(now),
|
|
@@ -67,11 +117,12 @@ const buildAndJudge = (request, number) => Effect.gen(function* () {
|
|
|
67
117
|
}
|
|
68
118
|
if (verdict.right._tag === "mismatch") {
|
|
69
119
|
return yield* Effect.fail(refuse("Blocked", "This transaction does not do what the Slip said it would, so it will not be signed.", {
|
|
70
|
-
reasons: verdict.right.reasons
|
|
120
|
+
reasons: verdict.right.reasons,
|
|
121
|
+
derived
|
|
71
122
|
}));
|
|
72
123
|
}
|
|
73
124
|
const transactionId = yield* transactionIdOf(built.cbor);
|
|
74
|
-
const attempt = { number, transactionId
|
|
125
|
+
const attempt = { ...derived, number, transactionId };
|
|
75
126
|
// The caller is what puts these effects in front of a person. If that
|
|
76
127
|
// throws, the person has not seen them, so this fails closed rather than
|
|
77
128
|
// carrying on to a signature — and as a refusal rather than a stack trace.
|
|
@@ -81,6 +132,15 @@ const buildAndJudge = (request, number) => Effect.gen(function* () {
|
|
|
81
132
|
});
|
|
82
133
|
return { cbor: built.cbor, attempt };
|
|
83
134
|
});
|
|
135
|
+
/** A progress report is a courtesy to the screen; one that throws must not stop a submission already under way. */
|
|
136
|
+
const report = (request, progress) => {
|
|
137
|
+
try {
|
|
138
|
+
request.onProgress?.(progress);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// Nothing to do: the flow carries on, and the next state the screen is given corrects it.
|
|
142
|
+
}
|
|
143
|
+
};
|
|
84
144
|
/**
|
|
85
145
|
* Completes the Slip, or says why not. A submission that failed because an
|
|
86
146
|
* input was spent is the one failure worth repeating: everything else either
|
|
@@ -90,11 +150,23 @@ export const completeIntent = (request) => Effect.gen(function* () {
|
|
|
90
150
|
const allowed = Math.max(1, request.attempts ?? defaultAttempts);
|
|
91
151
|
for (let number = 1; number <= allowed; number += 1) {
|
|
92
152
|
const { attempt, cbor } = yield* buildAndJudge(request, number);
|
|
153
|
+
const { confirm } = request;
|
|
154
|
+
if (confirm !== undefined) {
|
|
155
|
+
const agreed = yield* Effect.tryPromise({
|
|
156
|
+
try: () => confirm(attempt),
|
|
157
|
+
catch: (cause) => refuse("NotShown", "This transaction could not be put to you, so it will not be signed.", { cause })
|
|
158
|
+
});
|
|
159
|
+
if (!agreed) {
|
|
160
|
+
return yield* Effect.fail(refuse("Cancelled", "The transaction was closed without signing."));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
report(request, { _tag: "Signing", transactionId: attempt.transactionId });
|
|
93
164
|
const signed = yield* signTransaction({
|
|
94
165
|
api: request.api,
|
|
95
166
|
transaction: cbor,
|
|
96
167
|
transactionId: attempt.transactionId
|
|
97
168
|
});
|
|
169
|
+
report(request, { _tag: "Submitting", transactionId: attempt.transactionId });
|
|
98
170
|
const submitted = yield* Effect.either(submitTransaction(request.api, signed));
|
|
99
171
|
if (Either.isRight(submitted)) {
|
|
100
172
|
return { transactionId: submitted.right, effects: attempt.effects, attempts: number };
|
|
@@ -102,6 +174,8 @@ export const completeIntent = (request) => Effect.gen(function* () {
|
|
|
102
174
|
if (submitted.left.refusal !== "InputsSpent") {
|
|
103
175
|
return yield* Effect.fail(submitted.left);
|
|
104
176
|
}
|
|
177
|
+
if (number < allowed)
|
|
178
|
+
report(request, { _tag: "Rebuilding", number: number + 1, of: allowed });
|
|
105
179
|
}
|
|
106
180
|
return yield* Effect.fail(refuse("OutOfAttempts", `The wallet's funds moved every time this was built, ${allowed} times over. Try again in a moment.`));
|
|
107
181
|
});
|
package/dist/complete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete.js","sourceRoot":"","sources":["../src/complete.ts"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"complete.js","sourceRoot":"","sources":["../src/complete.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EAGf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,aAAa,EAA4B,MAAM,cAAc,CAAA;AAEtE,OAAO,EAAiB,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,EAAwB,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAA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OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;QACvF,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;YAC7C,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC3C,CAAC;QACD,IAAI,MAAM,GAAG,OAAO;YAAE,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IAChG,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,MAAM,CACJ,eAAe,EACf,uDAAuD,OAAO,qCAAqC,CACpG,CACF,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** What a transaction does, read from its own bytes: the part the comparison judges, and the figures a person is shown. */
|
|
2
|
+
import type { AssetEffects, Effects, LovelaceEffects } from "@cardano-slips/verifier";
|
|
3
|
+
export type Derived = {
|
|
4
|
+
readonly effects: Effects;
|
|
5
|
+
readonly lovelace: LovelaceEffects;
|
|
6
|
+
readonly assets: AssetEffects;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=derived.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derived.d.ts","sourceRoot":"","sources":["../src/derived.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAC3H,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAErF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAA;IAClC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;CAC9B,CAAA"}
|
package/dist/derived.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derived.js","sourceRoot":"","sources":["../src/derived.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transaction preview, drawn from `4 · Anatomy` and `6 · Preview states` on
|
|
3
|
+
* the design sheet. Every figure is derived from the transaction; the claim is
|
|
4
|
+
* only the title it is held against. A mismatch removes the sign button rather
|
|
5
|
+
* than disabling it, and no prop brings it back.
|
|
6
|
+
*/
|
|
7
|
+
import type { Verdict } from "@cardano-slips/verifier";
|
|
8
|
+
import type { Derived } from "./derived.js";
|
|
9
|
+
import { type Row } from "./ledger.js";
|
|
10
|
+
export type EffectsPanelProps = {
|
|
11
|
+
/** What the card promised, restated so it can be compared with what follows. */
|
|
12
|
+
readonly claim: string;
|
|
13
|
+
/** The card's description, set beside the transaction when the two disagree. */
|
|
14
|
+
readonly description?: string;
|
|
15
|
+
/** The host that served the link, as a host only. Whether it is verified is the identity chip's to say. */
|
|
16
|
+
readonly origin?: string;
|
|
17
|
+
readonly derived: Derived;
|
|
18
|
+
/** The verifier's own verdict. Required, so no caller renders a match by leaving the reasons out. */
|
|
19
|
+
readonly verdict: Verdict;
|
|
20
|
+
/** Read once a second for the countdown. */
|
|
21
|
+
readonly clock?: () => number;
|
|
22
|
+
readonly onSign?: () => void;
|
|
23
|
+
readonly onCancel?: () => void;
|
|
24
|
+
readonly onRebuild?: () => void;
|
|
25
|
+
/** "Report this link" is offered only where there is somewhere to send the report. */
|
|
26
|
+
readonly onReport?: () => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Past eight rows each group folds to its header and a count. A group holding
|
|
30
|
+
* a marked row never starts folded: the one thing the block points at is not
|
|
31
|
+
* something a person should have to open.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Ledger: ({ rows }: {
|
|
34
|
+
readonly rows: ReadonlyArray<Row>;
|
|
35
|
+
}) => React.JSX.Element;
|
|
36
|
+
export declare const EffectsPanel: ({ claim, description, origin, derived, verdict, clock, onSign, onCancel, onRebuild, onReport }: EffectsPanelProps) => React.JSX.Element;
|
|
37
|
+
//# sourceMappingURL=effects-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effects-panel.d.ts","sourceRoot":"","sources":["../src/effects-panel.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAWL,KAAK,GAAG,EACT,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,gFAAgF;IAChF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,2GAA2G;IAC3G,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,qGAAqG;IACrG,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAA;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AA8DD;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,UAAU;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;CAAE,KAAG,KAAK,CAAC,GAAG,CAAC,OA0Bl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