@paysponge/sdk 0.1.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 +21 -0
- package/README.md +138 -0
- package/dist/admin.d.ts +81 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +108 -0
- package/dist/admin.js.map +1 -0
- package/dist/api/agents.d.ts +37 -0
- package/dist/api/agents.d.ts.map +1 -0
- package/dist/api/agents.js +63 -0
- package/dist/api/agents.js.map +1 -0
- package/dist/api/http.d.ts +29 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +101 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/public-tools.d.ts +52 -0
- package/dist/api/public-tools.d.ts.map +1 -0
- package/dist/api/public-tools.js +68 -0
- package/dist/api/public-tools.js.map +1 -0
- package/dist/api/transactions.d.ts +30 -0
- package/dist/api/transactions.d.ts.map +1 -0
- package/dist/api/transactions.js +176 -0
- package/dist/api/transactions.js.map +1 -0
- package/dist/api/wallets.d.ts +33 -0
- package/dist/api/wallets.d.ts.map +1 -0
- package/dist/api/wallets.js +121 -0
- package/dist/api/wallets.js.map +1 -0
- package/dist/auth/credentials.d.ts +37 -0
- package/dist/auth/credentials.d.ts.map +1 -0
- package/dist/auth/credentials.js +100 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/auth/device-flow.d.ts +25 -0
- package/dist/auth/device-flow.d.ts.map +1 -0
- package/dist/auth/device-flow.js +161 -0
- package/dist/auth/device-flow.js.map +1 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +3 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +116 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/client.d.ts +383 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +384 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/config.d.ts +27 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/config.js +34 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/tools/definitions.d.ts +16 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +330 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/executor.d.ts +56 -0
- package/dist/tools/executor.d.ts.map +1 -0
- package/dist/tools/executor.js +182 -0
- package/dist/tools/executor.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +3 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/schemas.d.ts +924 -0
- package/dist/types/schemas.d.ts.map +1 -0
- package/dist/types/schemas.js +360 -0
- package/dist/types/schemas.js.map +1 -0
- package/package.json +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sponge
|
|
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,138 @@
|
|
|
1
|
+
# SpongeWallet SDK
|
|
2
|
+
|
|
3
|
+
SDK for creating and managing wallets for AI agents with Claude Agent SDK integration.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @paysponge/sdk
|
|
9
|
+
# or
|
|
10
|
+
bun add @paysponge/sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { SpongeWallet } from "@paysponge/sdk";
|
|
17
|
+
|
|
18
|
+
// Connect (handles auth automatically via browser)
|
|
19
|
+
const wallet = await SpongeWallet.connect();
|
|
20
|
+
|
|
21
|
+
// Get addresses
|
|
22
|
+
const addresses = await wallet.getAddresses();
|
|
23
|
+
console.log(addresses.base); // 0x...
|
|
24
|
+
console.log(addresses.solana); // 5x...
|
|
25
|
+
|
|
26
|
+
// Check balances
|
|
27
|
+
const balances = await wallet.getBalances();
|
|
28
|
+
|
|
29
|
+
// Transfer tokens
|
|
30
|
+
await wallet.transfer({
|
|
31
|
+
chain: "base",
|
|
32
|
+
to: "0x...",
|
|
33
|
+
amount: "10",
|
|
34
|
+
currency: "USDC",
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Authentication
|
|
39
|
+
|
|
40
|
+
### Device Flow (Browser)
|
|
41
|
+
|
|
42
|
+
On first run, `connect()` opens your browser for login. After approval, credentials are cached at `~/.spongewallet/credentials.json`.
|
|
43
|
+
|
|
44
|
+
### API Key
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const wallet = await SpongeWallet.connect({
|
|
48
|
+
apiKey: "sponge_test_...",
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or via environment variable:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
SPONGE_API_KEY=sponge_test_xxx node my-bot.js
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Master Keys (Programmatic Agent Creation)
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { SpongeAdmin } from "@paysponge/sdk";
|
|
62
|
+
|
|
63
|
+
const admin = new SpongeAdmin({ apiKey: "sponge_master_..." });
|
|
64
|
+
|
|
65
|
+
// Create agents programmatically
|
|
66
|
+
const { agent, apiKey } = await admin.createAgent({ name: "bot-1" });
|
|
67
|
+
|
|
68
|
+
// Connect to the agent's wallet
|
|
69
|
+
const wallet = await SpongeWallet.connect({ apiKey });
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Claude Agent SDK Integration
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
76
|
+
import { SpongeWallet } from "@paysponge/sdk";
|
|
77
|
+
|
|
78
|
+
const wallet = await SpongeWallet.connect();
|
|
79
|
+
|
|
80
|
+
for await (const msg of query({
|
|
81
|
+
prompt: "Check my wallet balance and transfer 5 USDC to 0x...",
|
|
82
|
+
options: {
|
|
83
|
+
mcpServers: {
|
|
84
|
+
wallet: wallet.mcp(),
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
})) {
|
|
88
|
+
console.log(msg);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Supported Chains
|
|
93
|
+
|
|
94
|
+
- **EVM**: Ethereum, Base, Sepolia, Base Sepolia, Tempo
|
|
95
|
+
- **Solana**: Mainnet, Devnet
|
|
96
|
+
|
|
97
|
+
## Features
|
|
98
|
+
|
|
99
|
+
- Multi-chain wallet management (EVM + Solana)
|
|
100
|
+
- Token transfers and swaps (Jupiter on Solana)
|
|
101
|
+
- MCP server for Claude Agent SDK
|
|
102
|
+
- Anthropic SDK tool definitions
|
|
103
|
+
- Spending limits and allowlists
|
|
104
|
+
- x402 payment protocol support
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
- [Getting Started](./docs/getting-started.md)
|
|
109
|
+
- [Authentication](./docs/authentication.md)
|
|
110
|
+
- [Wallets & Transfers](./docs/wallets-and-transfers.md)
|
|
111
|
+
- [Claude Integration](./docs/claude-integration.md)
|
|
112
|
+
- [Master Keys](./docs/master-keys.md)
|
|
113
|
+
- [API Reference](./docs/api-reference.md)
|
|
114
|
+
|
|
115
|
+
## CLI
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Login via browser
|
|
119
|
+
npx spongewallet login
|
|
120
|
+
|
|
121
|
+
# Check current session
|
|
122
|
+
npx spongewallet whoami
|
|
123
|
+
|
|
124
|
+
# Logout
|
|
125
|
+
npx spongewallet logout
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Environment Variables
|
|
129
|
+
|
|
130
|
+
| Variable | Description |
|
|
131
|
+
|----------|-------------|
|
|
132
|
+
| `SPONGE_API_KEY` | Agent API key (skips device flow) |
|
|
133
|
+
| `SPONGE_MASTER_KEY` | Master key for programmatic agent creation |
|
|
134
|
+
| `SPONGE_API_URL` | Custom API URL |
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT
|
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type Agent, type CreateAgentOptions } from "./types/schemas.js";
|
|
2
|
+
import { SpongeWallet } from "./client.js";
|
|
3
|
+
/**
|
|
4
|
+
* SpongeAdmin - Management client for programmatic agent creation
|
|
5
|
+
*
|
|
6
|
+
* Use a master API key to create and manage agents without browser-based auth.
|
|
7
|
+
* Generate one via `SpongeAdmin.connect()` (device flow) or the dashboard.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { SpongeAdmin } from '@spongewallet/sdk';
|
|
12
|
+
*
|
|
13
|
+
* // First time: authenticate via browser to get a master key
|
|
14
|
+
* const admin = await SpongeAdmin.connect();
|
|
15
|
+
*
|
|
16
|
+
* // Or use an existing master key
|
|
17
|
+
* const admin = new SpongeAdmin({ apiKey: 'sponge_master_...' });
|
|
18
|
+
*
|
|
19
|
+
* // Create a new agent with wallets
|
|
20
|
+
* const { agent, apiKey } = await admin.createAgent({ name: 'trading-bot-1' });
|
|
21
|
+
*
|
|
22
|
+
* // Connect to the agent's wallet
|
|
23
|
+
* const wallet = await SpongeWallet.connect({ apiKey });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class SpongeAdmin {
|
|
27
|
+
private readonly http;
|
|
28
|
+
private readonly agents;
|
|
29
|
+
private readonly baseUrl;
|
|
30
|
+
/**
|
|
31
|
+
* Authenticate via device flow and get a master API key
|
|
32
|
+
*
|
|
33
|
+
* Opens a browser for login, then returns a SpongeAdmin instance
|
|
34
|
+
* with a master key that can create agents programmatically.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const admin = await SpongeAdmin.connect();
|
|
39
|
+
* const { agent, apiKey } = await admin.createAgent({ name: 'my-bot' });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
static connect(options?: {
|
|
43
|
+
baseUrl?: string;
|
|
44
|
+
noBrowser?: boolean;
|
|
45
|
+
}): Promise<SpongeAdmin>;
|
|
46
|
+
constructor(options: {
|
|
47
|
+
apiKey: string;
|
|
48
|
+
baseUrl?: string;
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Create a new agent with wallets
|
|
52
|
+
*
|
|
53
|
+
* Returns the agent and its API key. The API key can be used
|
|
54
|
+
* with `SpongeWallet.connect()` to interact with the agent's wallets.
|
|
55
|
+
*/
|
|
56
|
+
createAgent(options: CreateAgentOptions): Promise<{
|
|
57
|
+
agent: Agent;
|
|
58
|
+
apiKey: string;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* List all agents for this user
|
|
62
|
+
*/
|
|
63
|
+
listAgents(): Promise<Agent[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Delete an agent
|
|
66
|
+
*/
|
|
67
|
+
deleteAgent(agentId: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Create a new agent and return a connected SpongeWallet instance
|
|
70
|
+
*
|
|
71
|
+
* Convenience method that combines `createAgent` + `SpongeWallet.connect`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const wallet = await admin.createWallet({ name: 'my-agent' });
|
|
76
|
+
* const balances = await wallet.getBalances();
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
createWallet(options: CreateAgentOptions): Promise<SpongeWallet>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;;;;;;;OAWG;WACU,OAAO,CAAC,OAAO,GAAE;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,CAAC;gBAejB,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IASzD;;;;;OAKG;IACG,WAAW,CACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAK5C;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAIpC;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD;;;;;;;;;;OAUG;IACG,YAAY,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;CAQvE"}
|
package/dist/admin.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { CreateAgentOptionsSchema, } from "./types/schemas.js";
|
|
2
|
+
import { HttpClient } from "./api/http.js";
|
|
3
|
+
import { AgentsApi } from "./api/agents.js";
|
|
4
|
+
import { SpongeWallet } from "./client.js";
|
|
5
|
+
import { deviceFlowAuth } from "./auth/device-flow.js";
|
|
6
|
+
const DEFAULT_BASE_URL = "https://api.wallet.paysponge.com";
|
|
7
|
+
/**
|
|
8
|
+
* SpongeAdmin - Management client for programmatic agent creation
|
|
9
|
+
*
|
|
10
|
+
* Use a master API key to create and manage agents without browser-based auth.
|
|
11
|
+
* Generate one via `SpongeAdmin.connect()` (device flow) or the dashboard.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { SpongeAdmin } from '@spongewallet/sdk';
|
|
16
|
+
*
|
|
17
|
+
* // First time: authenticate via browser to get a master key
|
|
18
|
+
* const admin = await SpongeAdmin.connect();
|
|
19
|
+
*
|
|
20
|
+
* // Or use an existing master key
|
|
21
|
+
* const admin = new SpongeAdmin({ apiKey: 'sponge_master_...' });
|
|
22
|
+
*
|
|
23
|
+
* // Create a new agent with wallets
|
|
24
|
+
* const { agent, apiKey } = await admin.createAgent({ name: 'trading-bot-1' });
|
|
25
|
+
*
|
|
26
|
+
* // Connect to the agent's wallet
|
|
27
|
+
* const wallet = await SpongeWallet.connect({ apiKey });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export class SpongeAdmin {
|
|
31
|
+
http;
|
|
32
|
+
agents;
|
|
33
|
+
baseUrl;
|
|
34
|
+
/**
|
|
35
|
+
* Authenticate via device flow and get a master API key
|
|
36
|
+
*
|
|
37
|
+
* Opens a browser for login, then returns a SpongeAdmin instance
|
|
38
|
+
* with a master key that can create agents programmatically.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const admin = await SpongeAdmin.connect();
|
|
43
|
+
* const { agent, apiKey } = await admin.createAgent({ name: 'my-bot' });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
static async connect(options = {}) {
|
|
47
|
+
const baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
48
|
+
const tokenResponse = await deviceFlowAuth({
|
|
49
|
+
baseUrl,
|
|
50
|
+
noBrowser: options.noBrowser,
|
|
51
|
+
keyType: "master",
|
|
52
|
+
});
|
|
53
|
+
return new SpongeAdmin({
|
|
54
|
+
apiKey: tokenResponse.apiKey,
|
|
55
|
+
baseUrl,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
constructor(options) {
|
|
59
|
+
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
60
|
+
this.http = new HttpClient({
|
|
61
|
+
baseUrl: this.baseUrl,
|
|
62
|
+
apiKey: options.apiKey,
|
|
63
|
+
});
|
|
64
|
+
this.agents = new AgentsApi(this.http);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create a new agent with wallets
|
|
68
|
+
*
|
|
69
|
+
* Returns the agent and its API key. The API key can be used
|
|
70
|
+
* with `SpongeWallet.connect()` to interact with the agent's wallets.
|
|
71
|
+
*/
|
|
72
|
+
async createAgent(options) {
|
|
73
|
+
const validated = CreateAgentOptionsSchema.parse(options);
|
|
74
|
+
return this.agents.create(validated);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* List all agents for this user
|
|
78
|
+
*/
|
|
79
|
+
async listAgents() {
|
|
80
|
+
return this.agents.list();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Delete an agent
|
|
84
|
+
*/
|
|
85
|
+
async deleteAgent(agentId) {
|
|
86
|
+
return this.agents.delete(agentId);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Create a new agent and return a connected SpongeWallet instance
|
|
90
|
+
*
|
|
91
|
+
* Convenience method that combines `createAgent` + `SpongeWallet.connect`.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const wallet = await admin.createWallet({ name: 'my-agent' });
|
|
96
|
+
* const balances = await wallet.getBalances();
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
async createWallet(options) {
|
|
100
|
+
const { apiKey, agent } = await this.createAgent(options);
|
|
101
|
+
return SpongeWallet.connect({
|
|
102
|
+
apiKey,
|
|
103
|
+
agentId: agent.id,
|
|
104
|
+
baseUrl: this.baseUrl !== DEFAULT_BASE_URL ? this.baseUrl : undefined,
|
|
105
|
+
});
|
|
106
|
+
}
|
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,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CACf,OAA2B;QAE3B,MAAM,SAAS,GAAG,wBAAwB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,OAAe;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,YAAY,CAAC,OAA2B;QAC5C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC1D,OAAO,YAAY,CAAC,OAAO,CAAC;YAC1B,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SACtE,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Agent, type CreateAgentOptions } from "../types/schemas.js";
|
|
2
|
+
import type { HttpClient } from "./http.js";
|
|
3
|
+
export declare class AgentsApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Create a new agent
|
|
8
|
+
*/
|
|
9
|
+
create(options: CreateAgentOptions): Promise<{
|
|
10
|
+
agent: Agent;
|
|
11
|
+
apiKey: string;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* List all agents for the current user
|
|
15
|
+
* Note: This endpoint requires Privy auth, not API key auth
|
|
16
|
+
*/
|
|
17
|
+
list(): Promise<Agent[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Get a specific agent by ID
|
|
20
|
+
* Note: This endpoint requires Privy auth, not API key auth
|
|
21
|
+
*/
|
|
22
|
+
get(agentId: string): Promise<Agent>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current agent (authenticated via API key)
|
|
25
|
+
* This endpoint returns the agent associated with the current API key
|
|
26
|
+
*/
|
|
27
|
+
getCurrent(): Promise<Agent>;
|
|
28
|
+
/**
|
|
29
|
+
* Update an agent
|
|
30
|
+
*/
|
|
31
|
+
update(agentId: string, updates: Partial<CreateAgentOptions>): Promise<Agent>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete an agent
|
|
34
|
+
*/
|
|
35
|
+
delete(agentId: string): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/api/agents.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQ5C,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAY5C;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAK9B;;;OAGG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAK1C;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC;IAKlC;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACnC,OAAO,CAAC,KAAK,CAAC;IAQjB;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentSchema, CreateAgentOptionsSchema, } from "../types/schemas.js";
|
|
3
|
+
// Response from creating an agent (includes API key)
|
|
4
|
+
const CreateAgentResponseSchema = z.object({
|
|
5
|
+
agent: AgentSchema,
|
|
6
|
+
mcpApiKey: z.string(),
|
|
7
|
+
});
|
|
8
|
+
export class AgentsApi {
|
|
9
|
+
http;
|
|
10
|
+
constructor(http) {
|
|
11
|
+
this.http = http;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a new agent
|
|
15
|
+
*/
|
|
16
|
+
async create(options) {
|
|
17
|
+
const validated = CreateAgentOptionsSchema.parse(options);
|
|
18
|
+
const response = await this.http.post("/api/agents", validated);
|
|
19
|
+
const parsed = CreateAgentResponseSchema.parse(response);
|
|
20
|
+
return {
|
|
21
|
+
agent: parsed.agent,
|
|
22
|
+
apiKey: parsed.mcpApiKey,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* List all agents for the current user
|
|
27
|
+
* Note: This endpoint requires Privy auth, not API key auth
|
|
28
|
+
*/
|
|
29
|
+
async list() {
|
|
30
|
+
const response = await this.http.get("/api/agents");
|
|
31
|
+
return z.array(AgentSchema).parse(response);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get a specific agent by ID
|
|
35
|
+
* Note: This endpoint requires Privy auth, not API key auth
|
|
36
|
+
*/
|
|
37
|
+
async get(agentId) {
|
|
38
|
+
const response = await this.http.get(`/api/agents/${agentId}`);
|
|
39
|
+
return AgentSchema.parse(response);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the current agent (authenticated via API key)
|
|
43
|
+
* This endpoint returns the agent associated with the current API key
|
|
44
|
+
*/
|
|
45
|
+
async getCurrent() {
|
|
46
|
+
const response = await this.http.get("/api/agents/me");
|
|
47
|
+
return AgentSchema.parse(response);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Update an agent
|
|
51
|
+
*/
|
|
52
|
+
async update(agentId, updates) {
|
|
53
|
+
const response = await this.http.put(`/api/agents/${agentId}`, updates);
|
|
54
|
+
return AgentSchema.parse(response);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Delete an agent
|
|
58
|
+
*/
|
|
59
|
+
async delete(agentId) {
|
|
60
|
+
await this.http.delete(`/api/agents/${agentId}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/api/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,wBAAwB,GAGzB,MAAM,qBAAqB,CAAC;AAG7B,qDAAqD;AACrD,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,OAAO,SAAS;IACS;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAA2B;QAE3B,MAAM,SAAS,GAAG,wBAAwB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE1D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAU,aAAa,EAAE,SAAS,CAAC,CAAC;QACzE,MAAM,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+
baseUrl?: string;
|
|
3
|
+
apiKey: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class SpongeApiError extends Error {
|
|
6
|
+
readonly statusCode: number;
|
|
7
|
+
readonly errorCode: string;
|
|
8
|
+
constructor(statusCode: number, errorCode: string, message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class HttpClient {
|
|
11
|
+
private readonly baseUrl;
|
|
12
|
+
private readonly apiKey;
|
|
13
|
+
constructor(options: HttpClientOptions);
|
|
14
|
+
private get headers();
|
|
15
|
+
get<T>(path: string, params?: Record<string, string>): Promise<T>;
|
|
16
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
17
|
+
put<T>(path: string, body?: unknown): Promise<T>;
|
|
18
|
+
delete<T>(path: string): Promise<T>;
|
|
19
|
+
private handleResponse;
|
|
20
|
+
/**
|
|
21
|
+
* Get the base URL (for MCP config)
|
|
22
|
+
*/
|
|
23
|
+
getBaseUrl(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the API key (for MCP config)
|
|
26
|
+
*/
|
|
27
|
+
getApiKey(): string;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/api/http.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,cAAe,SAAQ,KAAK;aAErB,UAAU,EAAE,MAAM;aAClB,SAAS,EAAE,MAAM;gBADjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjC,OAAO,EAAE,MAAM;CAKlB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,OAAO,EAAE,iBAAiB;IAKtC,OAAO,KAAK,OAAO,GAKlB;IAEK,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAkBjE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAYjD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAYhD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;YAW3B,cAAc;IA6B5B;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,SAAS,IAAI,MAAM;CAGpB"}
|
package/dist/api/http.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ApiErrorSchema } from "../types/schemas.js";
|
|
2
|
+
const DEFAULT_BASE_URL = "https://api.wallet.paysponge.com";
|
|
3
|
+
export class SpongeApiError extends Error {
|
|
4
|
+
statusCode;
|
|
5
|
+
errorCode;
|
|
6
|
+
constructor(statusCode, errorCode, message) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.statusCode = statusCode;
|
|
9
|
+
this.errorCode = errorCode;
|
|
10
|
+
this.name = "SpongeApiError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class HttpClient {
|
|
14
|
+
baseUrl;
|
|
15
|
+
apiKey;
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
18
|
+
this.apiKey = options.apiKey;
|
|
19
|
+
}
|
|
20
|
+
get headers() {
|
|
21
|
+
return {
|
|
22
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async get(path, params) {
|
|
27
|
+
const url = new URL(path, this.baseUrl);
|
|
28
|
+
if (params) {
|
|
29
|
+
for (const [key, value] of Object.entries(params)) {
|
|
30
|
+
if (value !== undefined) {
|
|
31
|
+
url.searchParams.set(key, value);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const response = await fetch(url.toString(), {
|
|
36
|
+
method: "GET",
|
|
37
|
+
headers: this.headers,
|
|
38
|
+
});
|
|
39
|
+
return this.handleResponse(response);
|
|
40
|
+
}
|
|
41
|
+
async post(path, body) {
|
|
42
|
+
const url = new URL(path, this.baseUrl);
|
|
43
|
+
const response = await fetch(url.toString(), {
|
|
44
|
+
method: "POST",
|
|
45
|
+
headers: this.headers,
|
|
46
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
47
|
+
});
|
|
48
|
+
return this.handleResponse(response);
|
|
49
|
+
}
|
|
50
|
+
async put(path, body) {
|
|
51
|
+
const url = new URL(path, this.baseUrl);
|
|
52
|
+
const response = await fetch(url.toString(), {
|
|
53
|
+
method: "PUT",
|
|
54
|
+
headers: this.headers,
|
|
55
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
56
|
+
});
|
|
57
|
+
return this.handleResponse(response);
|
|
58
|
+
}
|
|
59
|
+
async delete(path) {
|
|
60
|
+
const url = new URL(path, this.baseUrl);
|
|
61
|
+
const response = await fetch(url.toString(), {
|
|
62
|
+
method: "DELETE",
|
|
63
|
+
headers: this.headers,
|
|
64
|
+
});
|
|
65
|
+
return this.handleResponse(response);
|
|
66
|
+
}
|
|
67
|
+
async handleResponse(response) {
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
let errorData = null;
|
|
70
|
+
try {
|
|
71
|
+
const json = await response.json();
|
|
72
|
+
const parsed = ApiErrorSchema.safeParse(json);
|
|
73
|
+
if (parsed.success) {
|
|
74
|
+
errorData = parsed.data;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Ignore JSON parse errors
|
|
79
|
+
}
|
|
80
|
+
throw new SpongeApiError(response.status, errorData?.error ?? "unknown_error", errorData?.message ?? `HTTP ${response.status}: ${response.statusText}`);
|
|
81
|
+
}
|
|
82
|
+
// Handle 204 No Content
|
|
83
|
+
if (response.status === 204) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
return response.json();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get the base URL (for MCP config)
|
|
90
|
+
*/
|
|
91
|
+
getBaseUrl() {
|
|
92
|
+
return this.baseUrl;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get the API key (for MCP config)
|
|
96
|
+
*/
|
|
97
|
+
getApiKey() {
|
|
98
|
+
return this.apiKey;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/api/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAEpE,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAO5D,MAAM,OAAO,cAAe,SAAQ,KAAK;IAErB;IACA;IAFlB,YACkB,UAAkB,EAClB,SAAiB,EACjC,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,eAAU,GAAV,UAAU,CAAQ;QAClB,cAAS,GAAT,SAAS,CAAQ;QAIjC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,UAAU;IACJ,OAAO,CAAS;IAChB,MAAM,CAAS;IAEhC,YAAY,OAA0B;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED,IAAY,OAAO;QACjB,OAAO;YACL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EACf,SAAS,EAAE,KAAK,IAAI,eAAe,EACnC,SAAS,EAAE,OAAO,IAAI,QAAQ,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,EAAE,CACxE,CAAC;QACJ,CAAC;QAED,wBAAwB;QACxB,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,OAAO,SAAc,CAAC;QACxB,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|