agentwallet-mcp 1.12.0 → 1.12.2
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/build/index.js +6 -3
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -461,7 +461,7 @@ function resolveChainId(network) {
|
|
|
461
461
|
const AddressSchema = z.string().regex(/^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/, 'Must be a 0x-prefixed 40-hex EVM address or a base58 Solana address');
|
|
462
462
|
const server = new McpServer({
|
|
463
463
|
name: 'agentwallet',
|
|
464
|
-
version: '1.12.
|
|
464
|
+
version: '1.12.2',
|
|
465
465
|
}, {
|
|
466
466
|
instructions: `AgentWallet gives AI agents their own blockchain wallets. Private keys are encrypted server-side and never exposed — agents sign and broadcast transactions without ever touching raw keys.
|
|
467
467
|
|
|
@@ -1180,7 +1180,7 @@ server.tool('pay_x402', 'Handle an x402 payment flow. Fetches a URL, and if the
|
|
|
1180
1180
|
const wantApproval = request_approval ?? (process.env.AGENTWALLET_APPROVALS !== '0');
|
|
1181
1181
|
if (approval_id) {
|
|
1182
1182
|
const a = (await api(`/approvals/${encodeURIComponent(approval_id)}`, 'GET', undefined, skip));
|
|
1183
|
-
if (a?.status !== 'approved') {
|
|
1183
|
+
if (a?.status !== 'approved' || Number(a.used) === 1) {
|
|
1184
1184
|
return jsonResponse({ ...overCap, approval_id, approval_status: a?.status ?? null, error: `Approval ${approval_id} is ${a?.status ?? 'unknown'}, not approved.${a?.error ? ' ' + a.error : ''}` });
|
|
1185
1185
|
}
|
|
1186
1186
|
if (String(a.pay_to || '').toLowerCase() !== option.payTo.toLowerCase() || Number(a.chain_id) !== chainId || BigInt(String(a.value || '0')) < BigInt(rawAmount)) {
|
|
@@ -1310,7 +1310,10 @@ server.tool('pay_x402', 'Handle an x402 payment flow. Fetches a URL, and if the
|
|
|
1310
1310
|
return jsonResponse({
|
|
1311
1311
|
status: retryRes.status,
|
|
1312
1312
|
payment_required: true,
|
|
1313
|
-
|
|
1313
|
+
// Paid means the endpoint accepted the payment: a settlement receipt, or a success status after the payment header.
|
|
1314
|
+
// A 4xx other than 402 (bad body, auth) means the request failed for another reason; the authorization was
|
|
1315
|
+
// sent but the facilitator normally does not settle a failed request, so it is not reported as paid.
|
|
1316
|
+
payment_made: Boolean(settlement?.success) || (retryRes.status >= 200 && retryRes.status < 300),
|
|
1314
1317
|
retry_error: retryError,
|
|
1315
1318
|
payment_method: isUpto ? 'permit2-upto-authorization' : (standardExact ? 'eip3009-authorization' : 'onchain-transfer'),
|
|
1316
1319
|
approval_id: approvalUsed,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentwallet-mcp",
|
|
3
3
|
"mcpName": "io.github.hifriendbot/agentwallet",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.2",
|
|
5
5
|
"description": "MCP server for AgentWallet: self-custody local signing on EVM and Solana, or hosted wallets. Sign, broadcast, pay x402 invoices, and accept x402 payments.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|