@lynq/crypto 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +63 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # @lynq/crypto
2
+
3
+ Crypto payment provider for [lynq](https://www.npmjs.com/package/@lynq/lynq) MCP framework. Supports USDC, USDT, DAI, ETH on Base, Ethereum, Polygon, and Solana.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install @lynq/crypto @lynq/lynq
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { createMCPServer } from "@lynq/lynq";
15
+ import { crypto } from "@lynq/crypto";
16
+
17
+ const server = createMCPServer({ name: "my-server", version: "1.0.0" });
18
+
19
+ server.tool("premium-feature", crypto({
20
+ recipient: "0x...",
21
+ amount: 5, // 5 USDC
22
+ baseUrl: "http://localhost:3000",
23
+ }), {
24
+ description: "A paid feature",
25
+ }, async (args, c) => {
26
+ return c.text("Premium content here");
27
+ });
28
+ ```
29
+
30
+ ### With Hono adapter
31
+
32
+ ```ts
33
+ import { mountLynq } from "@lynq/hono";
34
+
35
+ mountLynq(app, server, {
36
+ pages: { crypto: true },
37
+ });
38
+ ```
39
+
40
+ ## Options
41
+
42
+ | Option | Type | Default | Description |
43
+ |---|---|---|---|
44
+ | `recipient` | `string` | required | Wallet address |
45
+ | `amount` | `number` | required | Amount in token units |
46
+ | `baseUrl` | `string` | required | Base URL for callback |
47
+ | `token` | `string` | `"USDC"` | Token: USDC, USDT, DAI, ETH, or custom |
48
+ | `network` | `string` | `"base"` | Network: base, base-sepolia, ethereum, polygon, solana, or custom |
49
+ | `callbackPath` | `string` | `"/payment/crypto/callback"` | Callback route path |
50
+ | `sessionKey` | `string` | `"payment"` | Session key for payment state |
51
+ | `once` | `boolean` | `false` | Only charge once per session |
52
+ | `message` | `string` | — | Elicitation message |
53
+ | `timeout` | `number` | `300000` | Elicitation timeout (ms) |
54
+ | `skipIf` | `(c) => boolean` | — | Skip middleware conditionally |
55
+ | `onComplete` | `(c) => void` | — | Run after successful payment |
56
+
57
+ ## Documentation
58
+
59
+ [https://hogekai.github.io/lynq/](https://hogekai.github.io/lynq/)
60
+
61
+ ## License
62
+
63
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynq/crypto",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Crypto payment provider for lynq MCP framework.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -14,7 +14,7 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "@lynq/lynq": "^0.8.0"
17
+ "@lynq/lynq": "^0.8.4"
18
18
  },
19
19
  "devDependencies": {
20
20
  "tsup": "^8.0.0",