@paylobster/mcp-server 1.5.0 → 1.7.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 (167) hide show
  1. package/README.md +147 -228
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +86 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -19
  9. package/dist/index.js.map +1 -1
  10. package/dist/resources/index.d.ts +9 -0
  11. package/dist/resources/index.d.ts.map +1 -0
  12. package/dist/resources/index.js +159 -0
  13. package/dist/resources/index.js.map +1 -0
  14. package/dist/server.d.ts +3 -6
  15. package/dist/server.d.ts.map +1 -1
  16. package/dist/server.js +1455 -114
  17. package/dist/server.js.map +1 -1
  18. package/dist/tools/balance.d.ts +5 -16
  19. package/dist/tools/balance.d.ts.map +1 -1
  20. package/dist/tools/balance.js +26 -44
  21. package/dist/tools/balance.js.map +1 -1
  22. package/dist/tools/bridge.d.ts +142 -0
  23. package/dist/tools/bridge.d.ts.map +1 -0
  24. package/dist/tools/bridge.js +121 -0
  25. package/dist/tools/bridge.js.map +1 -0
  26. package/dist/tools/cascade.d.ts +59 -0
  27. package/dist/tools/cascade.d.ts.map +1 -0
  28. package/dist/tools/cascade.js +119 -0
  29. package/dist/tools/cascade.js.map +1 -0
  30. package/dist/tools/compliance.d.ts +36 -0
  31. package/dist/tools/compliance.d.ts.map +1 -0
  32. package/dist/tools/compliance.js +57 -0
  33. package/dist/tools/compliance.js.map +1 -0
  34. package/dist/tools/convenience.d.ts +121 -0
  35. package/dist/tools/convenience.d.ts.map +1 -0
  36. package/dist/tools/convenience.js +331 -0
  37. package/dist/tools/convenience.js.map +1 -0
  38. package/dist/tools/credit.d.ts +46 -0
  39. package/dist/tools/credit.d.ts.map +1 -0
  40. package/dist/tools/credit.js +102 -0
  41. package/dist/tools/credit.js.map +1 -0
  42. package/dist/tools/disputes.d.ts +71 -0
  43. package/dist/tools/disputes.d.ts.map +1 -0
  44. package/dist/tools/disputes.js +121 -0
  45. package/dist/tools/disputes.js.map +1 -0
  46. package/dist/tools/escrow.d.ts +90 -31
  47. package/dist/tools/escrow.d.ts.map +1 -1
  48. package/dist/tools/escrow.js +215 -98
  49. package/dist/tools/escrow.js.map +1 -1
  50. package/dist/tools/intent.d.ts +78 -0
  51. package/dist/tools/intent.d.ts.map +1 -0
  52. package/dist/tools/intent.js +192 -0
  53. package/dist/tools/intent.js.map +1 -0
  54. package/dist/tools/investment.d.ts +196 -0
  55. package/dist/tools/investment.d.ts.map +1 -0
  56. package/dist/tools/investment.js +415 -0
  57. package/dist/tools/investment.js.map +1 -0
  58. package/dist/tools/links.d.ts +41 -0
  59. package/dist/tools/links.d.ts.map +1 -0
  60. package/dist/tools/links.js +78 -0
  61. package/dist/tools/links.js.map +1 -0
  62. package/dist/tools/portfolio.d.ts +44 -0
  63. package/dist/tools/portfolio.d.ts.map +1 -0
  64. package/dist/tools/portfolio.js +166 -0
  65. package/dist/tools/portfolio.js.map +1 -0
  66. package/dist/tools/price-alerts.d.ts +52 -0
  67. package/dist/tools/price-alerts.d.ts.map +1 -0
  68. package/dist/tools/price-alerts.js +78 -0
  69. package/dist/tools/price-alerts.js.map +1 -0
  70. package/dist/tools/refunds.d.ts +32 -0
  71. package/dist/tools/refunds.d.ts.map +1 -0
  72. package/dist/tools/refunds.js +75 -0
  73. package/dist/tools/refunds.js.map +1 -0
  74. package/dist/tools/reputation.d.ts +49 -15
  75. package/dist/tools/reputation.d.ts.map +1 -1
  76. package/dist/tools/reputation.js +107 -45
  77. package/dist/tools/reputation.js.map +1 -1
  78. package/dist/tools/revenue.d.ts +42 -0
  79. package/dist/tools/revenue.d.ts.map +1 -0
  80. package/dist/tools/revenue.js +67 -0
  81. package/dist/tools/revenue.js.map +1 -0
  82. package/dist/tools/search.d.ts +54 -30
  83. package/dist/tools/search.d.ts.map +1 -1
  84. package/dist/tools/search.js +85 -122
  85. package/dist/tools/search.js.map +1 -1
  86. package/dist/tools/streaming.d.ts +60 -0
  87. package/dist/tools/streaming.d.ts.map +1 -0
  88. package/dist/tools/streaming.js +163 -0
  89. package/dist/tools/streaming.js.map +1 -0
  90. package/dist/tools/swap-smart.d.ts +30 -0
  91. package/dist/tools/swap-smart.d.ts.map +1 -0
  92. package/dist/tools/swap-smart.js +135 -0
  93. package/dist/tools/swap-smart.js.map +1 -0
  94. package/dist/tools/swap.d.ts +93 -0
  95. package/dist/tools/swap.d.ts.map +1 -0
  96. package/dist/tools/swap.js +150 -0
  97. package/dist/tools/swap.js.map +1 -0
  98. package/dist/tools/treasury.d.ts +267 -0
  99. package/dist/tools/treasury.d.ts.map +1 -0
  100. package/dist/tools/treasury.js +722 -0
  101. package/dist/tools/treasury.js.map +1 -0
  102. package/dist/tools/trust-graph.d.ts +105 -0
  103. package/dist/tools/trust-graph.d.ts.map +1 -0
  104. package/dist/tools/trust-graph.js +232 -0
  105. package/dist/tools/trust-graph.js.map +1 -0
  106. package/dist/tools/webhooks.d.ts +60 -0
  107. package/dist/tools/webhooks.d.ts.map +1 -0
  108. package/dist/tools/webhooks.js +133 -0
  109. package/dist/tools/webhooks.js.map +1 -0
  110. package/dist/types/index.d.ts +84 -0
  111. package/dist/types/index.d.ts.map +1 -0
  112. package/dist/{lib/types.js → types/index.js} +1 -1
  113. package/dist/types/index.js.map +1 -0
  114. package/dist/utils/contracts.d.ts +553 -0
  115. package/dist/utils/contracts.d.ts.map +1 -0
  116. package/dist/utils/contracts.js +403 -0
  117. package/dist/utils/contracts.js.map +1 -0
  118. package/package.json +11 -20
  119. package/BUILD_SUMMARY.md +0 -294
  120. package/CHANGELOG.md +0 -77
  121. package/COMPLETION_REPORT.md +0 -284
  122. package/INTEGRATION.md +0 -286
  123. package/QUICKSTART.md +0 -226
  124. package/dist/lib/config.d.ts +0 -7
  125. package/dist/lib/config.d.ts.map +0 -1
  126. package/dist/lib/config.js +0 -16
  127. package/dist/lib/config.js.map +0 -1
  128. package/dist/lib/contracts.d.ts +0 -15
  129. package/dist/lib/contracts.d.ts.map +0 -1
  130. package/dist/lib/contracts.js +0 -148
  131. package/dist/lib/contracts.js.map +0 -1
  132. package/dist/lib/types.d.ts +0 -39
  133. package/dist/lib/types.d.ts.map +0 -1
  134. package/dist/lib/types.js.map +0 -1
  135. package/dist/resources/agent.d.ts +0 -3
  136. package/dist/resources/agent.d.ts.map +0 -1
  137. package/dist/resources/agent.js +0 -36
  138. package/dist/resources/agent.js.map +0 -1
  139. package/dist/resources/escrow.d.ts +0 -3
  140. package/dist/resources/escrow.d.ts.map +0 -1
  141. package/dist/resources/escrow.js +0 -33
  142. package/dist/resources/escrow.js.map +0 -1
  143. package/dist/resources/services.d.ts +0 -2
  144. package/dist/resources/services.d.ts.map +0 -1
  145. package/dist/resources/services.js +0 -55
  146. package/dist/resources/services.js.map +0 -1
  147. package/dist/tools/agent.d.ts +0 -17
  148. package/dist/tools/agent.d.ts.map +0 -1
  149. package/dist/tools/agent.js +0 -51
  150. package/dist/tools/agent.js.map +0 -1
  151. package/examples/test-server.ts +0 -36
  152. package/examples/test-tools.ts +0 -64
  153. package/src/__tests__/server.test.ts +0 -24
  154. package/src/index.ts +0 -24
  155. package/src/lib/config.ts +0 -22
  156. package/src/lib/contracts.ts +0 -164
  157. package/src/lib/types.ts +0 -44
  158. package/src/resources/agent.ts +0 -40
  159. package/src/resources/escrow.ts +0 -35
  160. package/src/resources/services.ts +0 -53
  161. package/src/server.ts +0 -190
  162. package/src/tools/agent.ts +0 -56
  163. package/src/tools/balance.ts +0 -61
  164. package/src/tools/escrow.ts +0 -142
  165. package/src/tools/reputation.ts +0 -69
  166. package/src/tools/search.ts +0 -148
  167. package/tsconfig.json +0 -20
package/INTEGRATION.md DELETED
@@ -1,286 +0,0 @@
1
- # Integration Guide
2
-
3
- This guide shows how to integrate the PayLobster MCP Server with various AI agent frameworks.
4
-
5
- ## Table of Contents
6
-
7
- - [Claude Desktop](#claude-desktop)
8
- - [Cline (VS Code Extension)](#cline-vs-code-extension)
9
- - [OpenAI Agents SDK](#openai-agents-sdk)
10
- - [LangChain](#langchain)
11
- - [Direct MCP Protocol](#direct-mcp-protocol)
12
-
13
- ## Claude Desktop
14
-
15
- Add to your Claude Desktop configuration file:
16
-
17
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
18
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
19
-
20
- ```json
21
- {
22
- "mcpServers": {
23
- "paylobster": {
24
- "command": "npx",
25
- "args": ["-y", "@paylobster/mcp-server"],
26
- "env": {
27
- "PAYLOBSTER_NETWORK": "mainnet"
28
- }
29
- }
30
- }
31
- }
32
- ```
33
-
34
- For local development:
35
-
36
- ```json
37
- {
38
- "mcpServers": {
39
- "paylobster": {
40
- "command": "node",
41
- "args": ["/Users/gustav/Projects/paylobster/packages/mcp-server/dist/index.js"],
42
- "env": {
43
- "PAYLOBSTER_NETWORK": "sepolia"
44
- }
45
- }
46
- }
47
- }
48
- ```
49
-
50
- Then restart Claude Desktop. The PayLobster tools will be available automatically.
51
-
52
- ### Example Prompts
53
-
54
- ```
55
- "Check the reputation of agent 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
56
-
57
- "Search for TypeScript code review services under $20"
58
-
59
- "Get my USDC balance for 0x..."
60
-
61
- "List all escrows for address 0x..."
62
- ```
63
-
64
- ## Cline (VS Code Extension)
65
-
66
- Cline supports MCP servers through its settings:
67
-
68
- 1. Open VS Code settings (`Cmd+,` or `Ctrl+,`)
69
- 2. Search for "Cline MCP"
70
- 3. Add server configuration:
71
-
72
- ```json
73
- {
74
- "cline.mcpServers": {
75
- "paylobster": {
76
- "command": "npx",
77
- "args": ["-y", "@paylobster/mcp-server"],
78
- "env": {
79
- "PAYLOBSTER_NETWORK": "mainnet"
80
- }
81
- }
82
- }
83
- }
84
- ```
85
-
86
- Or edit `.vscode/settings.json` in your project:
87
-
88
- ```json
89
- {
90
- "cline.mcpServers": {
91
- "paylobster": {
92
- "command": "node",
93
- "args": ["./packages/mcp-server/dist/index.js"],
94
- "env": {
95
- "PAYLOBSTER_NETWORK": "sepolia"
96
- }
97
- }
98
- }
99
- }
100
- ```
101
-
102
- ## OpenAI Agents SDK
103
-
104
- ```typescript
105
- import { Agent } from '@openai/agents-sdk';
106
- import { spawn } from 'child_process';
107
-
108
- // Spawn MCP server process
109
- const mcpProcess = spawn('npx', ['@paylobster/mcp-server'], {
110
- env: { ...process.env, PAYLOBSTER_NETWORK: 'mainnet' },
111
- stdio: ['pipe', 'pipe', 'inherit'],
112
- });
113
-
114
- // Create OpenAI agent
115
- const agent = new Agent({
116
- model: 'gpt-4',
117
- mcpServers: [
118
- {
119
- name: 'paylobster',
120
- process: mcpProcess,
121
- },
122
- ],
123
- });
124
-
125
- // Use the agent
126
- const response = await agent.run(
127
- 'Find me a TypeScript code reviewer with good reputation'
128
- );
129
- console.log(response);
130
- ```
131
-
132
- ## LangChain
133
-
134
- ```typescript
135
- import { MCPToolkit } from '@langchain/community/agent_toolkits/mcp';
136
- import { initializeAgentExecutorWithOptions } from 'langchain/agents';
137
- import { ChatOpenAI } from 'langchain/chat_models/openai';
138
-
139
- // Initialize MCP toolkit
140
- const toolkit = new MCPToolkit({
141
- serverCommand: 'npx',
142
- serverArgs: ['@paylobster/mcp-server'],
143
- env: { PAYLOBSTER_NETWORK: 'mainnet' },
144
- });
145
-
146
- // Get tools from the toolkit
147
- const tools = await toolkit.getTools();
148
-
149
- // Create LLM
150
- const model = new ChatOpenAI({
151
- modelName: 'gpt-4',
152
- temperature: 0,
153
- });
154
-
155
- // Create agent executor
156
- const executor = await initializeAgentExecutorWithOptions(tools, model, {
157
- agentType: 'openai-functions',
158
- verbose: true,
159
- });
160
-
161
- // Run a query
162
- const result = await executor.run(
163
- 'Check the reputation of agent 0x123...'
164
- );
165
- console.log(result);
166
- ```
167
-
168
- ## Direct MCP Protocol
169
-
170
- If you're building your own MCP client:
171
-
172
- ```typescript
173
- import { Client } from '@modelcontextprotocol/sdk/client/index.js';
174
- import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
175
- import { spawn } from 'child_process';
176
-
177
- // Spawn the MCP server
178
- const serverProcess = spawn('npx', ['@paylobster/mcp-server'], {
179
- env: { ...process.env, PAYLOBSTER_NETWORK: 'mainnet' },
180
- });
181
-
182
- // Create transport
183
- const transport = new StdioClientTransport({
184
- command: serverProcess,
185
- });
186
-
187
- // Create MCP client
188
- const client = new Client({
189
- name: 'my-paylobster-client',
190
- version: '1.0.0',
191
- });
192
-
193
- // Connect
194
- await client.connect(transport);
195
-
196
- // List available tools
197
- const { tools } = await client.listTools();
198
- console.log('Available tools:', tools);
199
-
200
- // Call a tool
201
- const result = await client.callTool({
202
- name: 'paylobster_get_reputation',
203
- arguments: {
204
- address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
205
- },
206
- });
207
-
208
- console.log('Result:', result);
209
-
210
- // Read a resource
211
- const resource = await client.readResource({
212
- uri: 'paylobster://services',
213
- });
214
-
215
- console.log('Services:', resource);
216
- ```
217
-
218
- ## Environment Variables
219
-
220
- All integration methods support these environment variables:
221
-
222
- ```bash
223
- # Network selection
224
- PAYLOBSTER_NETWORK=mainnet # or 'sepolia'
225
-
226
- # Custom RPC endpoint
227
- PAYLOBSTER_RPC_URL=https://mainnet.base.org
228
-
229
- # API base URL
230
- PAYLOBSTER_API_URL=https://paylobster.com
231
- ```
232
-
233
- ## Testing Your Integration
234
-
235
- Use the provided test scripts:
236
-
237
- ```bash
238
- # Test server initialization
239
- npx tsx examples/test-server.ts
240
-
241
- # Test individual tools
242
- npx tsx examples/test-tools.ts
243
- ```
244
-
245
- ## Troubleshooting
246
-
247
- ### Server won't start
248
-
249
- 1. Check that Node.js >= 18 is installed: `node --version`
250
- 2. Verify the package is installed: `npm list @paylobster/mcp-server`
251
- 3. Check environment variables are set correctly
252
- 4. Look for errors in stderr output
253
-
254
- ### Tools not appearing
255
-
256
- 1. Restart your client application (Claude Desktop, VS Code, etc.)
257
- 2. Verify the MCP server is listed in client settings
258
- 3. Check the server process is running: `ps aux | grep paylobster`
259
-
260
- ### Network errors
261
-
262
- 1. Verify RPC URL is accessible: `curl https://mainnet.base.org`
263
- 2. Try with Sepolia testnet: `PAYLOBSTER_NETWORK=sepolia`
264
- 3. Check firewall/proxy settings
265
-
266
- ### Rate limiting
267
-
268
- If you see rate limit errors, the RPC endpoint may be throttling requests. Use a custom RPC URL:
269
-
270
- ```bash
271
- PAYLOBSTER_RPC_URL=https://your-private-rpc.com
272
- ```
273
-
274
- ## Examples
275
-
276
- See the `/examples` directory for more:
277
-
278
- - `test-server.ts` - Server initialization test
279
- - `test-tools.ts` - Individual tool testing
280
- - Integration examples for popular frameworks
281
-
282
- ## Support
283
-
284
- - GitHub Issues: https://github.com/paylobster/paylobster/issues
285
- - Discord: https://discord.gg/paylobster
286
- - Documentation: https://docs.paylobster.com
package/QUICKSTART.md DELETED
@@ -1,226 +0,0 @@
1
- # Quick Start Guide
2
-
3
- Get the PayLobster MCP Server running in 5 minutes.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @paylobster/mcp-server
9
- ```
10
-
11
- Or install locally for development:
12
-
13
- ```bash
14
- cd /Users/gustav/Projects/paylobster/packages/mcp-server
15
- npm install
16
- npm run build
17
- ```
18
-
19
- ## Usage
20
-
21
- ### Option 1: Claude Desktop (Easiest)
22
-
23
- 1. Open Claude Desktop config:
24
- - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
25
- - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
26
-
27
- 2. Add PayLobster server:
28
- ```json
29
- {
30
- "mcpServers": {
31
- "paylobster": {
32
- "command": "npx",
33
- "args": ["-y", "@paylobster/mcp-server"],
34
- "env": {
35
- "PAYLOBSTER_NETWORK": "mainnet"
36
- }
37
- }
38
- }
39
- }
40
- ```
41
-
42
- 3. Restart Claude Desktop
43
-
44
- 4. Test with prompts like:
45
- - "Check the reputation of 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
46
- - "Search for code review services under $20"
47
- - "Get my USDC balance"
48
-
49
- ### Option 2: Command Line
50
-
51
- ```bash
52
- # Start server (mainnet)
53
- npx @paylobster/mcp-server
54
-
55
- # Or with environment variables
56
- PAYLOBSTER_NETWORK=sepolia npx @paylobster/mcp-server
57
-
58
- # Local development
59
- npm start
60
- ```
61
-
62
- The server communicates via stdio (standard MCP protocol).
63
-
64
- ### Option 3: Programmatic
65
-
66
- ```typescript
67
- import { PayLobsterMCPServer } from '@paylobster/mcp-server';
68
-
69
- const server = new PayLobsterMCPServer({
70
- network: 'mainnet', // or 'sepolia'
71
- rpcUrl: 'https://mainnet.base.org', // optional
72
- });
73
-
74
- await server.start();
75
- ```
76
-
77
- ## Configuration
78
-
79
- ### Environment Variables
80
-
81
- ```bash
82
- # Network (required)
83
- PAYLOBSTER_NETWORK=mainnet # or 'sepolia'
84
-
85
- # Custom RPC URL (optional)
86
- PAYLOBSTER_RPC_URL=https://your-rpc.url
87
-
88
- # API URL (optional, defaults to paylobster.com)
89
- PAYLOBSTER_API_URL=https://paylobster.com
90
- ```
91
-
92
- ## Available Commands
93
-
94
- ### MCP Tools
95
-
96
- ```typescript
97
- // Get agent reputation
98
- paylobster_get_reputation({ address: "0x..." })
99
-
100
- // Check USDC balance
101
- paylobster_get_balance({ address: "0x..." })
102
-
103
- // Get agent info
104
- paylobster_get_agent({ address: "0x..." })
105
-
106
- // Get escrow details
107
- paylobster_get_escrow({ escrowId: "123" })
108
-
109
- // List escrows for address
110
- paylobster_list_escrows({ address: "0x..." })
111
-
112
- // Search services (mock data for now)
113
- paylobster_search_services({
114
- query: "code review",
115
- category: "code-review",
116
- maxPrice: "50.00",
117
- limit: 10
118
- })
119
- ```
120
-
121
- ### MCP Resources
122
-
123
- ```
124
- paylobster://services
125
- paylobster://agent/{address}
126
- paylobster://escrow/{id}
127
- ```
128
-
129
- ## Example Queries (Claude Desktop)
130
-
131
- Try these in Claude after setup:
132
-
133
- ```
134
- "What's the reputation of agent 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb?"
135
-
136
- "Search for TypeScript code reviewers under $15"
137
-
138
- "Check the USDC balance for 0x..."
139
-
140
- "Show me all escrows for address 0x..."
141
-
142
- "Find AI model training services"
143
- ```
144
-
145
- ## Testing
146
-
147
- Run the included test scripts:
148
-
149
- ```bash
150
- # Test server initialization
151
- npx tsx examples/test-server.ts
152
-
153
- # Test individual tools
154
- npx tsx examples/test-tools.ts
155
-
156
- # Run test suite
157
- npm test
158
- ```
159
-
160
- ## Network Information
161
-
162
- ### Base Mainnet (Default)
163
- - Chain ID: 8453
164
- - RPC: https://mainnet.base.org
165
- - Block Explorer: https://basescan.org
166
-
167
- ### Base Sepolia (Testnet)
168
- - Chain ID: 84532
169
- - RPC: https://sepolia.base.org
170
- - Block Explorer: https://sepolia.basescan.org
171
-
172
- ## Troubleshooting
173
-
174
- ### Server won't start
175
- ```bash
176
- # Check Node.js version (must be >= 18)
177
- node --version
178
-
179
- # Reinstall dependencies
180
- rm -rf node_modules package-lock.json
181
- npm install
182
-
183
- # Try with Sepolia testnet
184
- PAYLOBSTER_NETWORK=sepolia npm start
185
- ```
186
-
187
- ### Tools not appearing in Claude
188
- 1. Verify config file location and syntax
189
- 2. Restart Claude Desktop completely
190
- 3. Check server logs in Claude's logs directory
191
-
192
- ### RPC errors
193
- ```bash
194
- # Use a custom RPC endpoint
195
- PAYLOBSTER_RPC_URL=https://your-rpc.url npm start
196
-
197
- # Or try public endpoints
198
- PAYLOBSTER_RPC_URL=https://base.publicnode.com npm start
199
- ```
200
-
201
- ## What's Next?
202
-
203
- - Read [INTEGRATION.md](./INTEGRATION.md) for framework-specific guides
204
- - Check [README.md](./README.md) for full documentation
205
- - See [BUILD_SUMMARY.md](./BUILD_SUMMARY.md) for implementation details
206
- - Review [CHANGELOG.md](./CHANGELOG.md) for version history
207
-
208
- ## Need Help?
209
-
210
- - GitHub: https://github.com/paylobster/paylobster/issues
211
- - Discord: https://discord.gg/paylobster
212
- - Docs: https://docs.paylobster.com
213
-
214
- ## Pro Tips
215
-
216
- 1. **Start with Sepolia** - Test on the testnet before mainnet
217
- 2. **Custom RPC** - Use your own RPC for better reliability
218
- 3. **Check addresses** - Always verify Ethereum addresses are valid
219
- 4. **Mock data** - Services search returns mock data until registry deploys
220
- 5. **Read-only** - MVP only supports read operations (no payments yet)
221
-
222
- ---
223
-
224
- **You're ready to go!** 🎉
225
-
226
- Start querying agent reputations, balances, and escrows through any MCP-compatible AI framework.
@@ -1,7 +0,0 @@
1
- export interface MCPServerConfig {
2
- network: 'mainnet' | 'sepolia';
3
- rpcUrl?: string;
4
- apiUrl?: string;
5
- }
6
- export declare function getConfig(): MCPServerConfig;
7
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,SAAS,IAAI,eAAe,CAa3C"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfig = getConfig;
4
- function getConfig() {
5
- const network = (process.env.PAYLOBSTER_NETWORK || 'mainnet');
6
- const defaultRpcUrls = {
7
- mainnet: 'https://mainnet.base.org',
8
- sepolia: 'https://sepolia.base.org',
9
- };
10
- return {
11
- network,
12
- rpcUrl: process.env.PAYLOBSTER_RPC_URL || defaultRpcUrls[network],
13
- apiUrl: process.env.PAYLOBSTER_API_URL || 'https://paylobster.com',
14
- };
15
- }
16
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":";;AAQA,8BAaC;AAbD,SAAgB,SAAS;IACvB,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,CAA0B,CAAC;IAEvF,MAAM,cAAc,GAAG;QACrB,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE,0BAA0B;KACpC,CAAC;IAEF,OAAO;QACL,OAAO;QACP,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,cAAc,CAAC,OAAO,CAAC;QACjE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,wBAAwB;KACnE,CAAC;AACJ,CAAC"}
@@ -1,15 +0,0 @@
1
- import { type Address } from 'viem';
2
- import type { MCPServerConfig } from './config.js';
3
- import type { AgentInfo, ReputationData, EscrowData } from './types.js';
4
- export declare class ContractsClient {
5
- private publicClient;
6
- private contracts;
7
- constructor(config: MCPServerConfig);
8
- getAgentInfo(address: Address): Promise<AgentInfo>;
9
- getReputation(address: Address): Promise<ReputationData>;
10
- getBalance(address: Address): Promise<bigint>;
11
- getEscrow(escrowId: bigint): Promise<EscrowData>;
12
- getUserTransactionCount(address: Address): Promise<bigint>;
13
- getContractAddress(name: 'IDENTITY' | 'REPUTATION' | 'CREDIT' | 'ESCROW' | 'USDC'): Address;
14
- }
15
- //# sourceMappingURL=contracts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/lib/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAiFxE,qBAAa,eAAe;IAC1B,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,SAAS,CAAC;gBAEN,MAAM,EAAE,eAAe;IAU7B,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;IAelD,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IAcxD,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAW7C,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAiBhD,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAKhE,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO;CAG5F"}
@@ -1,148 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContractsClient = void 0;
4
- const viem_1 = require("viem");
5
- const chains_1 = require("viem/chains");
6
- // Contract addresses from existing web/src/lib/contracts.ts
7
- const CONTRACTS_MAINNET = {
8
- IDENTITY: '0xA174f250380c4B5C37F6709bBa719E662b77E662',
9
- REPUTATION: '0x02bb4c4cd10EeaCD04DF7631c81d6E7c1d0c4b29',
10
- CREDIT: '0xD924B81F2d8EFF3E0A3Bf0a4b9D77d37CC0980E1',
11
- ESCROW: '0x49Ed7003C6941a033E7dD8b44552e4E18cf28806',
12
- USDC: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
13
- };
14
- // NOTE: These contracts are not yet deployed to Base Sepolia
15
- const CONTRACTS_SEPOLIA = {
16
- IDENTITY: '0x3dfA02Ed4F0e4F10E8031d7a4cB8Ea0bBbFbCB8c',
17
- REPUTATION: '0x0000000000000000000000000000000000000000', // TODO: Deploy and update
18
- CREDIT: '0xBA64e2b2F2a80D03A4B13b3396942C1e78205C7d',
19
- ESCROW: '0x78D1f50a1965dE34f6b5a3D3546C94FE1809Cd82',
20
- USDC: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
21
- };
22
- // ABIs from existing contracts.ts
23
- const IDENTITY_ABI = [
24
- {
25
- inputs: [{ name: 'user', type: 'address' }],
26
- name: 'getAgentInfo',
27
- outputs: [
28
- { name: 'name', type: 'string' },
29
- { name: 'tokenId', type: 'uint256' },
30
- { name: 'registered', type: 'bool' },
31
- ],
32
- stateMutability: 'view',
33
- type: 'function',
34
- },
35
- {
36
- inputs: [{ name: '', type: 'address' }],
37
- name: 'addressToAgentId',
38
- outputs: [{ name: '', type: 'uint256' }],
39
- stateMutability: 'view',
40
- type: 'function',
41
- },
42
- ];
43
- const REPUTATION_ABI = [
44
- {
45
- inputs: [{ name: 'user', type: 'address' }],
46
- name: 'getReputation',
47
- outputs: [
48
- { name: 'score', type: 'uint256' },
49
- { name: 'trustVector', type: 'uint256' },
50
- ],
51
- stateMutability: 'view',
52
- type: 'function',
53
- },
54
- ];
55
- const ESCROW_ABI = [
56
- {
57
- inputs: [{ name: 'escrowId', type: 'uint256' }],
58
- name: 'getEscrow',
59
- outputs: [
60
- { name: 'sender', type: 'address' },
61
- { name: 'recipient', type: 'address' },
62
- { name: 'amount', type: 'uint256' },
63
- { name: 'token', type: 'address' },
64
- { name: 'status', type: 'uint8' },
65
- ],
66
- stateMutability: 'view',
67
- type: 'function',
68
- },
69
- ];
70
- const USDC_ABI = [
71
- {
72
- inputs: [{ name: 'account', type: 'address' }],
73
- name: 'balanceOf',
74
- outputs: [{ name: '', type: 'uint256' }],
75
- stateMutability: 'view',
76
- type: 'function',
77
- },
78
- ];
79
- class ContractsClient {
80
- publicClient;
81
- contracts;
82
- constructor(config) {
83
- const chain = config.network === 'sepolia' ? chains_1.baseSepolia : chains_1.base;
84
- this.contracts = config.network === 'sepolia' ? CONTRACTS_SEPOLIA : CONTRACTS_MAINNET;
85
- this.publicClient = (0, viem_1.createPublicClient)({
86
- chain,
87
- transport: (0, viem_1.http)(config.rpcUrl),
88
- });
89
- }
90
- async getAgentInfo(address) {
91
- const result = await this.publicClient.readContract({
92
- address: this.contracts.IDENTITY,
93
- abi: IDENTITY_ABI,
94
- functionName: 'getAgentInfo',
95
- args: [address],
96
- });
97
- return {
98
- name: result[0],
99
- tokenId: result[1],
100
- registered: result[2],
101
- };
102
- }
103
- async getReputation(address) {
104
- const result = await this.publicClient.readContract({
105
- address: this.contracts.REPUTATION,
106
- abi: REPUTATION_ABI,
107
- functionName: 'getReputation',
108
- args: [address],
109
- });
110
- return {
111
- score: result[0],
112
- trustVector: result[1],
113
- };
114
- }
115
- async getBalance(address) {
116
- const balance = await this.publicClient.readContract({
117
- address: this.contracts.USDC,
118
- abi: USDC_ABI,
119
- functionName: 'balanceOf',
120
- args: [address],
121
- });
122
- return balance;
123
- }
124
- async getEscrow(escrowId) {
125
- const result = await this.publicClient.readContract({
126
- address: this.contracts.ESCROW,
127
- abi: ESCROW_ABI,
128
- functionName: 'getEscrow',
129
- args: [escrowId],
130
- });
131
- return {
132
- sender: result[0],
133
- recipient: result[1],
134
- amount: result[2],
135
- token: result[3],
136
- status: result[4],
137
- };
138
- }
139
- async getUserTransactionCount(address) {
140
- // TODO: Implement when Escrow V3 is deployed with getUserTransactionCount
141
- return 0n;
142
- }
143
- getContractAddress(name) {
144
- return this.contracts[name];
145
- }
146
- }
147
- exports.ContractsClient = ContractsClient;
148
- //# sourceMappingURL=contracts.js.map