@cmdoss/suipay-mcp 0.2.2-dev.3 → 0.2.2-dev.4
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 +8 -48
- package/dist/bin/suipay.js +2 -2
- package/dist/{chunk-SRMAH6MK.js → chunk-KDOGSB5I.js} +305 -1849
- package/dist/chunk-XAM2YQC6.js +39 -0
- package/dist/{http-B4YTVw0k.d.ts → http-C8xW9F1c.d.ts} +4 -29
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/index.d.ts +9 -34
- package/dist/index.js +2 -10
- package/package.json +1 -1
- package/dist/chunk-C2IYSV43.js +0 -46
package/README.md
CHANGED
|
@@ -15,9 +15,7 @@ claude mcp add --scope user suipay -- npx -y @cmdoss/suipay-mcp@0.2.2
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
No wallet secret belongs in this command or MCP config. There is no
|
|
18
|
-
Sign-In With Sui (SIWS) step.
|
|
19
|
-
set `SUIPAY_MCP_KEY` (64-hex or `suiprivkey1…`) in the MCP env — never in
|
|
20
|
-
the browser.
|
|
18
|
+
Sign-In With Sui (SIWS) step.
|
|
21
19
|
|
|
22
20
|
## First connection
|
|
23
21
|
|
|
@@ -28,11 +26,8 @@ First connection is a spend-account grant plus an agent-held delegate key.
|
|
|
28
26
|
2. Persist that delegate key locally at `~/.suipay/credentials.json`
|
|
29
27
|
(mode `0600`). The process that holds this key is the only process
|
|
30
28
|
that can settle.
|
|
31
|
-
3. Point MCP at
|
|
32
|
-
|
|
33
|
-
for the laptop stack. Env/CLI fill the process default until a
|
|
34
|
-
credential is bound; after login, stored `gatewayUrl` wins. Rebind
|
|
35
|
-
with `suipay_login({ target })`.
|
|
29
|
+
3. Point MCP at the gateway (`SUIPAY_GATEWAY_URL`) and the same network
|
|
30
|
+
the grant was created on.
|
|
36
31
|
4. Call `pay`. The tool prepares unsigned `spend_account` settlement
|
|
37
32
|
bytes. If this process holds the grant's key it verifies and settles;
|
|
38
33
|
otherwise it returns the signing request.
|
|
@@ -41,20 +36,17 @@ The agent generates or is handed the delegate key. The key never enters
|
|
|
41
36
|
a browser URL, a SuiPay backend, logs, or a callback payload. Only the
|
|
42
37
|
public address leaves the local process. `suipay_login` mints or reuses
|
|
43
38
|
the local version-2 key at `~/.suipay/credentials.json` (mode `0600`) and
|
|
44
|
-
|
|
45
|
-
immediately. The owner signs in the browser; the loopback callback persists
|
|
46
|
-
key + gateway URL. Subsequent sessions reuse the file unless the grant is
|
|
47
|
-
missing, expired, or revoked.
|
|
39
|
+
opens `{SUIPAY_CONSOLE_URL}/connect/agent?delegateAddress=0x…`.
|
|
48
40
|
|
|
49
41
|
## Tools
|
|
50
42
|
|
|
51
43
|
| Tool | Purpose |
|
|
52
44
|
| --- | --- |
|
|
53
|
-
| `discover` | Search live gateway resources
|
|
45
|
+
| `discover` | Search live managed-gateway resources |
|
|
54
46
|
| `pay` | Fetch resource, prepare `spend_account` settlement, settle when this process holds the grant key |
|
|
55
47
|
| `receipts` | List settlement receipts, optionally by challenge ID |
|
|
56
48
|
| `access_context` | Report current session / delegate / policy state (no secret material) |
|
|
57
|
-
| `suipay_login` | Mint or reuse the local delegate key and
|
|
49
|
+
| `suipay_login` | Mint or reuse the local delegate key and open the console with the public address only |
|
|
58
50
|
| `suipay_logout` | Remove local credentials |
|
|
59
51
|
|
|
60
52
|
All tools remain visible before a grant is bound. `pay` and `receipts`
|
|
@@ -76,48 +68,16 @@ json: {"prompt":"a cat"}
|
|
|
76
68
|
maxAmount: 50000
|
|
77
69
|
```
|
|
78
70
|
|
|
79
|
-
`pay` uses SDK
|
|
80
|
-
|
|
81
|
-
path) and `savedToUrl` (`file://`). Any MIME — image, audio, pdf,
|
|
82
|
-
octet-stream. JSON stays compact (no base64 wall). An MCP `image` block is an
|
|
83
|
-
extra display hint when the type is `image/*`; hosts such as Claude Code's
|
|
84
|
-
TUI may not render it. Always quote `savedTo` to the user. Do not call `pay`
|
|
85
|
-
again to "save" a delivery that already settled.
|
|
86
|
-
|
|
87
|
-
## Targets
|
|
88
|
-
|
|
89
|
-
Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
|
|
90
|
-
|
|
91
|
-
| Target | Console | Gateway | How |
|
|
92
|
-
| --- | --- | --- | --- |
|
|
93
|
-
| `dev` (default) | `https://suipay-dev.up.railway.app` | `https://gateway-dev-ba84.up.railway.app` | no flag, or `--dev` |
|
|
94
|
-
| `local` | `http://localhost:3000` | `http://127.0.0.1:4340` | `--local` / `-local`, or `suipay_login({ target: "local" })` |
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Railway suipay-dev (default)
|
|
98
|
-
npx @cmdoss/suipay-mcp@0.2.2
|
|
99
|
-
|
|
100
|
-
# Laptop stack
|
|
101
|
-
npx @cmdoss/suipay-mcp@0.2.2 --local
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
`SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
|
|
105
|
-
`SUIPAY_GATEWAY_URL` / `SUIPAY_CONSOLE_URL` fill the process default when no
|
|
106
|
-
credential is bound yet. After a successful login, `credentials.json`
|
|
107
|
-
`gatewayUrl` is the bound gateway: `pay` / `discover` / `suipay_login` without
|
|
108
|
-
`target` stay on that binding so a leftover env cannot silently retarget spend.
|
|
109
|
-
Rebind with `suipay_login({ target: "dev" | "local" })` (same key, new consent
|
|
110
|
-
if that stack has no live grant).
|
|
71
|
+
`pay` uses the buyer SDK internally. A delivered image is returned as an MCP
|
|
72
|
+
image block, not as a base64 wall in the JSON summary.
|
|
111
73
|
|
|
112
74
|
## Client environment
|
|
113
75
|
|
|
114
76
|
```bash
|
|
115
|
-
# Optional. Unset = Railway suipay-dev. --local uses localhost:3000 / 127.0.0.1:4340.
|
|
116
77
|
SUIPAY_GATEWAY_URL=https://gateway.example
|
|
117
78
|
SUIPAY_CONSOLE_URL=https://console.example
|
|
118
79
|
SUIPAY_RPC_URL=https://your-testnet-rpc.example
|
|
119
80
|
SUIPAY_NETWORK=testnet
|
|
120
|
-
SUIPAY_MCP_TARGET=dev
|
|
121
81
|
```
|
|
122
82
|
|
|
123
83
|
Optional:
|