@cardano-slips/flow 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Emmanuel Mutisya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @cardano-slips/flow
2
+
3
+ The client side. It resolves a Slip link, renders it, connects a wallet, balances the transaction against the person's own UTxOs, derives what that transaction actually does, and refuses to ask for a signature when the answer disagrees with what the endpoint declared.
4
+
5
+ ```
6
+ pnpm add @cardano-slips/flow react
7
+ ```
8
+
9
+ ## What it does
10
+
11
+ | Step | What happens |
12
+ | --- | --- |
13
+ | resolve | the shared link through `slips.json`, then `GET` for the Slip's metadata |
14
+ | render | the card, the parameter form generated from what the endpoint declared, and the wallet selector |
15
+ | build | `POST` for the publisher's side of the transaction |
16
+ | balance | locally, against the wallet's own UTxOs — the endpoint never sees them |
17
+ | derive | what the built transaction does, from its bytes |
18
+ | compare | against the intent, and block on any disagreement |
19
+ | sign | `signTx` → assemble the witness set into the body → `submitTx` |
20
+
21
+ `useSlip`, `useWallet` and `useEffects` are the composable surface for anyone who wants the machinery without our components.
22
+
23
+ ## It refuses; it does not decide
24
+
25
+ The comparison is `verifier`'s, and it is a pure function so the attack examples run the same code path a real signature does. This package is the consequence of a verdict: a mismatch renders as a block with no control to press. There is no override to configure — not a setting, not an allowlist, not a confirmation. See [Blocking](../../spec/CIP-XXXX/README.md#blocking).
26
+
27
+ ## It does not own the page
28
+
29
+ These components are meant to be dropped into someone else's page. No fixed positioning, no assumption about the document, and styles that survive an inherited font stack. `tokens.css` holds the design tokens as CSS custom properties and is the only place a colour is defined.
30
+
31
+ React is a **peer** dependency: your copy is the one that renders, and a second copy in the tree is the oldest breakage in the ecosystem.
32
+
33
+ ## Entry point
34
+
35
+ One export, the package root. Deep imports into `dist/` are not a supported surface, so moving a file is never a breaking change:
36
+
37
+ ```ts
38
+ import { ... } from "@cardano-slips/flow"
39
+ ```
40
+
41
+ MIT licensed. Issues and contribution guide: [cardano-slips](https://github.com/emmanuel-musau/cardano-slips).
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The public entry point of `@cardano-slips/flow`.
3
+ *
4
+ * Everything a consumer may import is re-exported from here, and the package
5
+ * `exports` map exposes this module and nothing else — a deep import into
6
+ * `dist/` is not a supported surface, so moving a file is never a breaking
7
+ * change. The package lands one issue at a time: wallet discovery and enable,
8
+ * local balancing, the effects panel and the mismatch block, the parameter
9
+ * form, and rebuild-and-retry (docs/ARCHITECTURE.md).
10
+ *
11
+ * This is the half that runs in a browser next to a wallet, and two things
12
+ * about it do not change as the rest arrives.
13
+ *
14
+ * **It refuses; it does not decide.** The comparison between what a
15
+ * transaction does and what the endpoint declared is `verifier`'s, and it is a
16
+ * pure function so that the attack examples exercise the same code a real
17
+ * signature runs through. What lives here is the consequence: a mismatch
18
+ * renders as a block with no control to press, and there is no override path
19
+ * to write — not a setting, not an allowlist, not a confirmation.
20
+ *
21
+ * **It does not own the page it is dropped into.** These components go into
22
+ * third-party pages: no fixed positioning, no assumption about the document,
23
+ * and styles that survive an inherited font stack. Design tokens live in
24
+ * `tokens.css` as custom properties and are the only source of a colour.
25
+ */
26
+ export {};
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@cardano-slips/flow",
3
+ "version": "0.0.0",
4
+ "description": "The client side of Cardano Slips: CIP-30 orchestration, local balancing, and the React components that render a Slip and block a signature when its effects disagree",
5
+ "keywords": [
6
+ "cardano",
7
+ "cardano-slips",
8
+ "cip-30",
9
+ "react",
10
+ "wallet"
11
+ ],
12
+ "homepage": "https://github.com/emmanuel-musau/cardano-slips/tree/main/packages/flow#readme",
13
+ "bugs": "https://github.com/emmanuel-musau/cardano-slips/issues",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/emmanuel-musau/cardano-slips.git",
17
+ "directory": "packages/flow"
18
+ },
19
+ "license": "MIT",
20
+ "type": "module",
21
+ "sideEffects": false,
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ },
27
+ "./package.json": "./package.json"
28
+ },
29
+ "types": "./dist/index.d.ts",
30
+ "files": [
31
+ "dist",
32
+ "src"
33
+ ],
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "engines": {
38
+ "node": ">=22"
39
+ },
40
+ "peerDependencies": {
41
+ "react": "^19.0.0"
42
+ },
43
+ "dependencies": {
44
+ "@cardano-slips/core": "^0.0.2",
45
+ "@cardano-slips/verifier": "^0.0.1"
46
+ },
47
+ "devDependencies": {
48
+ "@testing-library/react": "^16.3.2",
49
+ "@types/react": "^19.2.18",
50
+ "happy-dom": "^20.11.6",
51
+ "react": "^19.2.8",
52
+ "react-dom": "^19.2.8",
53
+ "typescript": "^6.0.3"
54
+ },
55
+ "scripts": {
56
+ "build": "tsc -b tsconfig.build.json",
57
+ "typecheck": "tsc -b tsconfig.src.json && tsc -p tsconfig.test.json",
58
+ "test": "vitest run",
59
+ "lint": "eslint .",
60
+ "clean": "rm -rf dist build coverage .tsbuildinfo .turbo"
61
+ }
62
+ }
package/src/index.ts ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The public entry point of `@cardano-slips/flow`.
3
+ *
4
+ * Everything a consumer may import is re-exported from here, and the package
5
+ * `exports` map exposes this module and nothing else — a deep import into
6
+ * `dist/` is not a supported surface, so moving a file is never a breaking
7
+ * change. The package lands one issue at a time: wallet discovery and enable,
8
+ * local balancing, the effects panel and the mismatch block, the parameter
9
+ * form, and rebuild-and-retry (docs/ARCHITECTURE.md).
10
+ *
11
+ * This is the half that runs in a browser next to a wallet, and two things
12
+ * about it do not change as the rest arrives.
13
+ *
14
+ * **It refuses; it does not decide.** The comparison between what a
15
+ * transaction does and what the endpoint declared is `verifier`'s, and it is a
16
+ * pure function so that the attack examples exercise the same code a real
17
+ * signature runs through. What lives here is the consequence: a mismatch
18
+ * renders as a block with no control to press, and there is no override path
19
+ * to write — not a setting, not an allowlist, not a confirmation.
20
+ *
21
+ * **It does not own the page it is dropped into.** These components go into
22
+ * third-party pages: no fixed positioning, no assumption about the document,
23
+ * and styles that survive an inherited font stack. Design tokens live in
24
+ * `tokens.css` as custom properties and are the only source of a colour.
25
+ */
26
+ export {}