@valeo-mcp/server 1.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 +21 -0
- package/README.md +145 -0
- package/bin/valeo-mcp.js +2 -0
- package/dist/index.d.mts +143 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.js +1254 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1216 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Valeo Technology LLC
|
|
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,145 @@
|
|
|
1
|
+
# @valeo/mcp
|
|
2
|
+
|
|
3
|
+
> Give any AI agent the ability to pay for APIs, manage wallets, get credit, and track spending.
|
|
4
|
+
|
|
5
|
+
One MCP server. Every payment tool an agent needs.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
1. **Install / run** — MCP clients typically spawn the server via `npx` (no global install required):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx -y @valeo/mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. **Configure** — Add to Claude Desktop `claude_desktop_config.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"valeo": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["-y", "@valeo/mcp"],
|
|
23
|
+
"env": {
|
|
24
|
+
"VALEO_PRIVATE_KEY": "0x...",
|
|
25
|
+
"VALEO_CHAIN": "base",
|
|
26
|
+
"VALEO_ACE_API_KEY": "sk_...",
|
|
27
|
+
"VALEO_SENTINEL_API_KEY": "sk_..."
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
3. **Use** — Ask the agent to discover paid APIs (`discover_apis`), check price (`estimate_cost`), then call them (`pay`). The server negotiates HTTP 402, signs, and settles via x402.
|
|
35
|
+
|
|
36
|
+
## Tools reference
|
|
37
|
+
|
|
38
|
+
| Tool | Description |
|
|
39
|
+
|------|-------------|
|
|
40
|
+
| `pay` | Call an x402-enabled URL; handles 402, payment, retry, receipts, and budget checks. |
|
|
41
|
+
| `wallet_balance` | USDC + gas (ETH or SOL) for Base or Solana (same chain family as `VALEO_CHAIN`). |
|
|
42
|
+
| `get_credit` | Request ACE credit when the wallet is short (requires `VALEO_ACE_API_KEY`). |
|
|
43
|
+
| `repay_credit` | Repay an ACE loan by `loan_id` (requires ACE key). |
|
|
44
|
+
| `spending_history` | Sentinel audit trail if configured; otherwise session receipts. |
|
|
45
|
+
| `discover_apis` | Search the 402.md registry by query, category, chain, and max price. |
|
|
46
|
+
| `set_budget` | Per-call, daily, and session limits; optional allow/block URL patterns. |
|
|
47
|
+
| `estimate_cost` | GET probe for pricing without paying; compares budget and wallet. |
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
| Variable | Required | Default | Description |
|
|
52
|
+
|----------|----------|---------|-------------|
|
|
53
|
+
| `VALEO_PRIVATE_KEY` | **Yes** | — | EVM: `0x` + 64 hex (66 chars). Solana: base58 secret (64 bytes). |
|
|
54
|
+
| `VALEO_CHAIN` | No | `base` | `base`, `base-sepolia`, `solana`, `solana-devnet` |
|
|
55
|
+
| `VALEO_ACE_API_KEY` | No | — | Enables `get_credit` / `repay_credit` |
|
|
56
|
+
| `VALEO_SENTINEL_API_KEY` | No | — | Full `spending_history` via Sentinel |
|
|
57
|
+
| `VALEO_SOLANA_RPC_URL` | No | public RPC | Custom Solana RPC |
|
|
58
|
+
| `VALEO_ACE_BASE_URL` | No | `https://api.agentcreditengine.com` | ACE API base |
|
|
59
|
+
| `VALEO_SENTINEL_BASE_URL` | No | `https://sentinel.valeocash.com` | Sentinel API base |
|
|
60
|
+
| `VALEO_402MD_BASE_URL` | No | `https://402md.valeoprotocol.io` | 402.md registry |
|
|
61
|
+
| `VALEO_FACILITATOR_URL` | No | `https://x402.org/facilitator` | Documented default facilitator |
|
|
62
|
+
| `VALEO_MAX_PER_CALL` | No | `1.00` | Default max USDC per call |
|
|
63
|
+
| `VALEO_DAILY_LIMIT` | No | `50.00` | Default daily USDC cap |
|
|
64
|
+
| `VALEO_SESSION_LIMIT` | No | `10.00` | Default session USDC cap |
|
|
65
|
+
|
|
66
|
+
Copy [`.env.example`](.env.example) as a template.
|
|
67
|
+
|
|
68
|
+
## Supported chains
|
|
69
|
+
|
|
70
|
+
- **Base** (mainnet) and **Base Sepolia** (testnet) — USDC via viem + `x402-fetch`.
|
|
71
|
+
- **Solana** (mainnet) and **Solana devnet** — USDC SPL + `x402-solana`.
|
|
72
|
+
|
|
73
|
+
You cannot mix EVM and Solana keys on one server: `wallet_balance` only allows overrides within the same family as `VALEO_CHAIN`.
|
|
74
|
+
|
|
75
|
+
## How it works
|
|
76
|
+
|
|
77
|
+
1. Client calls a URL. If the resource is free, you get `200` and `payment: null`.
|
|
78
|
+
2. If the server responds **402** with x402 `accepts` metadata, the server checks **budget** rules, then uses a chain-specific x402 client to sign and attach payment, retrying the request.
|
|
79
|
+
3. Successful spends are recorded in-memory (**receipts**) and reflected in **budget** totals. Optional **Sentinel** key adds remote audit history.
|
|
80
|
+
|
|
81
|
+
## Valeo ecosystem
|
|
82
|
+
|
|
83
|
+
- **ACE** — Agent Credit Engine for short-term USDC credit.
|
|
84
|
+
- **Sentinel** — Payment audit trail and transaction history.
|
|
85
|
+
- **402.md** — Discovery registry for x402 manifests.
|
|
86
|
+
- **Stratum** — Settlement layer in the broader Valeo stack (see [valeocash.com](https://valeocash.com) / product docs).
|
|
87
|
+
|
|
88
|
+
## Example conversations
|
|
89
|
+
|
|
90
|
+
**1. Simple paid call**
|
|
91
|
+
|
|
92
|
+
- User: “Get premium data from `https://api.example.com/v1/data`.”
|
|
93
|
+
- Agent: Calls `pay` → “Here is the JSON payload. Paid **$0.01 USDC** on Base. Session budget remaining: **$9.99**.”
|
|
94
|
+
|
|
95
|
+
**2. Credit flow**
|
|
96
|
+
|
|
97
|
+
- User: “I need market data but I’m low on USDC.”
|
|
98
|
+
- Agent: `wallet_balance` → `get_credit` → `pay` → “Borrowed USDC via ACE, fetched data, auto-repay rules apply per ACE.”
|
|
99
|
+
|
|
100
|
+
**3. Discovery + budget**
|
|
101
|
+
|
|
102
|
+
- User: “Find cheap weather APIs and cap me at **$2** today.”
|
|
103
|
+
- Agent: `set_budget` → `discover_apis` → `estimate_cost` → “Three APIs under **$0.01**/call; roughly **200** calls within your daily cap.”
|
|
104
|
+
|
|
105
|
+
## Verification
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
cd valeo-mcp
|
|
109
|
+
npm install
|
|
110
|
+
npm run build
|
|
111
|
+
npm run lint
|
|
112
|
+
node bin/valeo-mcp.js
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
With MCP Inspector:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
VALEO_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
|
|
119
|
+
VALEO_CHAIN=base-sepolia \
|
|
120
|
+
npx @modelcontextprotocol/inspector node bin/valeo-mcp.js
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Publish
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm login
|
|
127
|
+
npm publish --access public
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Smoke test after publish:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx -y @valeo/mcp
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Important notes
|
|
137
|
+
|
|
138
|
+
- **stdout is reserved** for MCP JSON-RPC. All diagnostics use **stderr** (`console.error`).
|
|
139
|
+
- **Daily budget** resets at **midnight UTC**; **session** totals reset when the process restarts.
|
|
140
|
+
- If both **allowlist** and **blocklist** could apply, a non-empty **allowlist** wins; blocklist is ignored until allowlist is cleared.
|
|
141
|
+
- **ACE / Sentinel / 402.md** responses are parsed defensively; tools return JSON errors with `suggestion` instead of crashing the server.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT — see [LICENSE](LICENSE) (Valeo Technology LLC).
|
package/bin/valeo-mcp.js
ADDED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
declare class Four02mdClient {
|
|
2
|
+
private baseUrl;
|
|
3
|
+
constructor(baseUrl: string);
|
|
4
|
+
search(options?: {
|
|
5
|
+
query?: string;
|
|
6
|
+
category?: string;
|
|
7
|
+
chain?: string;
|
|
8
|
+
maxPrice?: number;
|
|
9
|
+
}): Promise<unknown>;
|
|
10
|
+
getManifest(domain: string): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare class SentinelClient {
|
|
14
|
+
private baseUrl;
|
|
15
|
+
private apiKey;
|
|
16
|
+
constructor(baseUrl: string, apiKey: string);
|
|
17
|
+
getTransactions(options?: {
|
|
18
|
+
limit?: number;
|
|
19
|
+
since?: string;
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
}): Promise<unknown>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class ACEClient {
|
|
25
|
+
private baseUrl;
|
|
26
|
+
private apiKey;
|
|
27
|
+
constructor(baseUrl: string, apiKey: string);
|
|
28
|
+
private request;
|
|
29
|
+
requestCredit(amount: number, walletAddress: string, purpose?: string): Promise<unknown>;
|
|
30
|
+
repayLoan(loanId: string, amount?: number): Promise<unknown>;
|
|
31
|
+
getLoans(): Promise<unknown>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class X402SolanaClient {
|
|
35
|
+
private keypair;
|
|
36
|
+
private connection;
|
|
37
|
+
private network;
|
|
38
|
+
constructor(privateKeyBase58: string, chain: "solana" | "solana-devnet", rpcUrl?: string);
|
|
39
|
+
createPaidFetch(maxUsd?: number): typeof globalThis.fetch;
|
|
40
|
+
getUsdcBalance(): Promise<string>;
|
|
41
|
+
getSolBalance(): Promise<string>;
|
|
42
|
+
getAddress(): string;
|
|
43
|
+
getChain(): string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class X402BaseClient {
|
|
47
|
+
private walletClient;
|
|
48
|
+
private publicClient;
|
|
49
|
+
private walletAddress;
|
|
50
|
+
private chainName;
|
|
51
|
+
constructor(privateKey: string, chain: "base" | "base-sepolia");
|
|
52
|
+
createPaidFetch(maxUsd?: number): typeof globalThis.fetch;
|
|
53
|
+
getUsdcBalance(): Promise<string>;
|
|
54
|
+
getEthBalance(): Promise<string>;
|
|
55
|
+
getAddress(): string;
|
|
56
|
+
getChain(): string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare class ReceiptStore {
|
|
60
|
+
private receipts;
|
|
61
|
+
add(data: Omit<Receipt, "id" | "timestamp">): Receipt;
|
|
62
|
+
getAll(options?: {
|
|
63
|
+
limit?: number;
|
|
64
|
+
since?: string;
|
|
65
|
+
endpoint?: string;
|
|
66
|
+
}): Receipt[];
|
|
67
|
+
getTotalSpent(): number;
|
|
68
|
+
getTotalSpentToday(): number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class BudgetManager {
|
|
72
|
+
private config;
|
|
73
|
+
private sessionSpent;
|
|
74
|
+
private dailySpent;
|
|
75
|
+
private dailyResetAt;
|
|
76
|
+
constructor(valeoConfig: ValeoConfig);
|
|
77
|
+
private getNextMidnightUTC;
|
|
78
|
+
private checkDailyReset;
|
|
79
|
+
canSpend(amount: number, endpoint: string): SpendCheck;
|
|
80
|
+
recordSpend(amount: number): void;
|
|
81
|
+
getStatus(): BudgetStatus;
|
|
82
|
+
updateConfig(updates: Partial<BudgetConfig>): void;
|
|
83
|
+
private matchWildcard;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface ValeoConfig {
|
|
87
|
+
privateKey: string;
|
|
88
|
+
chain: "base" | "base-sepolia" | "solana" | "solana-devnet";
|
|
89
|
+
aceApiKey?: string;
|
|
90
|
+
aceBaseUrl: string;
|
|
91
|
+
sentinelApiKey?: string;
|
|
92
|
+
sentinelBaseUrl: string;
|
|
93
|
+
four02mdBaseUrl: string;
|
|
94
|
+
facilitatorUrl: string;
|
|
95
|
+
defaultMaxPerCall: number;
|
|
96
|
+
defaultDailyLimit: number;
|
|
97
|
+
defaultSessionLimit: number;
|
|
98
|
+
}
|
|
99
|
+
interface BudgetConfig {
|
|
100
|
+
maxPerCall: number;
|
|
101
|
+
dailyLimit: number;
|
|
102
|
+
sessionLimit: number;
|
|
103
|
+
blockedEndpoints: string[];
|
|
104
|
+
allowedEndpoints: string[];
|
|
105
|
+
}
|
|
106
|
+
interface BudgetStatus {
|
|
107
|
+
config: BudgetConfig;
|
|
108
|
+
spending: {
|
|
109
|
+
session: number;
|
|
110
|
+
today: number;
|
|
111
|
+
remainingSession: number;
|
|
112
|
+
remainingDaily: number;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
interface SpendCheck {
|
|
116
|
+
allowed: boolean;
|
|
117
|
+
reason?: string;
|
|
118
|
+
}
|
|
119
|
+
interface Receipt {
|
|
120
|
+
id: string;
|
|
121
|
+
timestamp: string;
|
|
122
|
+
endpoint: string;
|
|
123
|
+
method: string;
|
|
124
|
+
amount: number;
|
|
125
|
+
currency: string;
|
|
126
|
+
chain: string;
|
|
127
|
+
txHash?: string;
|
|
128
|
+
status: "settled" | "failed" | "pending";
|
|
129
|
+
responseStatus: number;
|
|
130
|
+
}
|
|
131
|
+
interface ValeoContext {
|
|
132
|
+
config: ValeoConfig;
|
|
133
|
+
budget: BudgetManager;
|
|
134
|
+
receipts: ReceiptStore;
|
|
135
|
+
x402Client: X402BaseClient | X402SolanaClient;
|
|
136
|
+
aceClient: ACEClient | null;
|
|
137
|
+
sentinelClient: SentinelClient | null;
|
|
138
|
+
four02mdClient: Four02mdClient;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare function loadConfig(): ValeoConfig;
|
|
142
|
+
|
|
143
|
+
export { type ValeoConfig, type ValeoContext, loadConfig };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
declare class Four02mdClient {
|
|
2
|
+
private baseUrl;
|
|
3
|
+
constructor(baseUrl: string);
|
|
4
|
+
search(options?: {
|
|
5
|
+
query?: string;
|
|
6
|
+
category?: string;
|
|
7
|
+
chain?: string;
|
|
8
|
+
maxPrice?: number;
|
|
9
|
+
}): Promise<unknown>;
|
|
10
|
+
getManifest(domain: string): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare class SentinelClient {
|
|
14
|
+
private baseUrl;
|
|
15
|
+
private apiKey;
|
|
16
|
+
constructor(baseUrl: string, apiKey: string);
|
|
17
|
+
getTransactions(options?: {
|
|
18
|
+
limit?: number;
|
|
19
|
+
since?: string;
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
}): Promise<unknown>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class ACEClient {
|
|
25
|
+
private baseUrl;
|
|
26
|
+
private apiKey;
|
|
27
|
+
constructor(baseUrl: string, apiKey: string);
|
|
28
|
+
private request;
|
|
29
|
+
requestCredit(amount: number, walletAddress: string, purpose?: string): Promise<unknown>;
|
|
30
|
+
repayLoan(loanId: string, amount?: number): Promise<unknown>;
|
|
31
|
+
getLoans(): Promise<unknown>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class X402SolanaClient {
|
|
35
|
+
private keypair;
|
|
36
|
+
private connection;
|
|
37
|
+
private network;
|
|
38
|
+
constructor(privateKeyBase58: string, chain: "solana" | "solana-devnet", rpcUrl?: string);
|
|
39
|
+
createPaidFetch(maxUsd?: number): typeof globalThis.fetch;
|
|
40
|
+
getUsdcBalance(): Promise<string>;
|
|
41
|
+
getSolBalance(): Promise<string>;
|
|
42
|
+
getAddress(): string;
|
|
43
|
+
getChain(): string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class X402BaseClient {
|
|
47
|
+
private walletClient;
|
|
48
|
+
private publicClient;
|
|
49
|
+
private walletAddress;
|
|
50
|
+
private chainName;
|
|
51
|
+
constructor(privateKey: string, chain: "base" | "base-sepolia");
|
|
52
|
+
createPaidFetch(maxUsd?: number): typeof globalThis.fetch;
|
|
53
|
+
getUsdcBalance(): Promise<string>;
|
|
54
|
+
getEthBalance(): Promise<string>;
|
|
55
|
+
getAddress(): string;
|
|
56
|
+
getChain(): string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare class ReceiptStore {
|
|
60
|
+
private receipts;
|
|
61
|
+
add(data: Omit<Receipt, "id" | "timestamp">): Receipt;
|
|
62
|
+
getAll(options?: {
|
|
63
|
+
limit?: number;
|
|
64
|
+
since?: string;
|
|
65
|
+
endpoint?: string;
|
|
66
|
+
}): Receipt[];
|
|
67
|
+
getTotalSpent(): number;
|
|
68
|
+
getTotalSpentToday(): number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class BudgetManager {
|
|
72
|
+
private config;
|
|
73
|
+
private sessionSpent;
|
|
74
|
+
private dailySpent;
|
|
75
|
+
private dailyResetAt;
|
|
76
|
+
constructor(valeoConfig: ValeoConfig);
|
|
77
|
+
private getNextMidnightUTC;
|
|
78
|
+
private checkDailyReset;
|
|
79
|
+
canSpend(amount: number, endpoint: string): SpendCheck;
|
|
80
|
+
recordSpend(amount: number): void;
|
|
81
|
+
getStatus(): BudgetStatus;
|
|
82
|
+
updateConfig(updates: Partial<BudgetConfig>): void;
|
|
83
|
+
private matchWildcard;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface ValeoConfig {
|
|
87
|
+
privateKey: string;
|
|
88
|
+
chain: "base" | "base-sepolia" | "solana" | "solana-devnet";
|
|
89
|
+
aceApiKey?: string;
|
|
90
|
+
aceBaseUrl: string;
|
|
91
|
+
sentinelApiKey?: string;
|
|
92
|
+
sentinelBaseUrl: string;
|
|
93
|
+
four02mdBaseUrl: string;
|
|
94
|
+
facilitatorUrl: string;
|
|
95
|
+
defaultMaxPerCall: number;
|
|
96
|
+
defaultDailyLimit: number;
|
|
97
|
+
defaultSessionLimit: number;
|
|
98
|
+
}
|
|
99
|
+
interface BudgetConfig {
|
|
100
|
+
maxPerCall: number;
|
|
101
|
+
dailyLimit: number;
|
|
102
|
+
sessionLimit: number;
|
|
103
|
+
blockedEndpoints: string[];
|
|
104
|
+
allowedEndpoints: string[];
|
|
105
|
+
}
|
|
106
|
+
interface BudgetStatus {
|
|
107
|
+
config: BudgetConfig;
|
|
108
|
+
spending: {
|
|
109
|
+
session: number;
|
|
110
|
+
today: number;
|
|
111
|
+
remainingSession: number;
|
|
112
|
+
remainingDaily: number;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
interface SpendCheck {
|
|
116
|
+
allowed: boolean;
|
|
117
|
+
reason?: string;
|
|
118
|
+
}
|
|
119
|
+
interface Receipt {
|
|
120
|
+
id: string;
|
|
121
|
+
timestamp: string;
|
|
122
|
+
endpoint: string;
|
|
123
|
+
method: string;
|
|
124
|
+
amount: number;
|
|
125
|
+
currency: string;
|
|
126
|
+
chain: string;
|
|
127
|
+
txHash?: string;
|
|
128
|
+
status: "settled" | "failed" | "pending";
|
|
129
|
+
responseStatus: number;
|
|
130
|
+
}
|
|
131
|
+
interface ValeoContext {
|
|
132
|
+
config: ValeoConfig;
|
|
133
|
+
budget: BudgetManager;
|
|
134
|
+
receipts: ReceiptStore;
|
|
135
|
+
x402Client: X402BaseClient | X402SolanaClient;
|
|
136
|
+
aceClient: ACEClient | null;
|
|
137
|
+
sentinelClient: SentinelClient | null;
|
|
138
|
+
four02mdClient: Four02mdClient;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare function loadConfig(): ValeoConfig;
|
|
142
|
+
|
|
143
|
+
export { type ValeoConfig, type ValeoContext, loadConfig };
|