agentwallet-mcp 1.13.13 → 1.13.14

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/build/index.js +7 -3
  2. package/package.json +5 -2
package/build/index.js CHANGED
@@ -25,7 +25,7 @@ import { assertPublicUrl, safeFetch, finalUrlOf } from './ssrf-guard.js';
25
25
  import { deriveX402Payment, isWithinCap, lookupTrustedDecimals, assertDeclaredDecimals, nativeDecimals, SOLANA_CHAIN_IDS, assetLabel, autopayAssetAllowed, autopayEnvCap, effectiveAutopayCap, maxAuthWindowSeconds, parseDecimalPins, approvalRefusal, authorizationResource, resolveNetworkChainId, normalizeRawAmount, parseAutopayAssets, assetSupportsExact, approvalResourceUrl, } from './x402-payment.js';
26
26
  import { createHash } from 'node:crypto';
27
27
  import { isLocalMode, getLocalAddress, localWalletRecord, localSend, localNativeBalance, localTokenBalance, localSignMessage, resolveRpcUrl, } from './local-wallet.js';
28
- import { localSignAuthorization, localEthCall, localGetCode, localSignPermit2Upto, probeTokenDecimals } from './local-wallet.js';
28
+ import { localSignAuthorization, localEthCall, localGetCode, localSignPermit2Upto, probeTokenDecimals, assertRpcServesChain } from './local-wallet.js';
29
29
  import { WRAPPED_NATIVE } from './wrapped-native.js';
30
30
  import { buildUptoAuthorization, uptoPayload, permit2AllowanceCalldata, permit2ApproveCalldata, decodeUint, permit2Address, } from './x402-permit2.js';
31
31
  import { assessTokenRisk } from './token-risk.js';
@@ -827,7 +827,7 @@ function resolveChainId(network) {
827
827
  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');
828
828
  const server = new McpServer({
829
829
  name: 'agentwallet',
830
- version: '1.13.13',
830
+ version: '1.13.14',
831
831
  }, {
832
832
  instructions: `AgentWallet gives AI agents their own blockchain wallets. ${anyLocalMode()
833
833
  ? 'This server runs in LOCAL (self-custody) mode: the operator supplied the key, signing happens in this process, and the only spend guards are the environment caps (AGENTWALLET_MAX_TX_NATIVE / _TOKEN / _SOL per transaction, AGENTWALLET_MAX_AUTOPAY and AGENTWALLET_AUTOPAY_ASSETS for x402, AGENTWALLET_X402_MAX_TIMEOUT for authorization windows). There is no server-side pause, daily limit or approval email; pause_wallet, unpause_wallet and delete_wallet are refused.'
@@ -1347,6 +1347,9 @@ tool('get_token_info', 'Get the name, symbol, and decimals of any ERC-20 token b
1347
1347
  token: z.string().regex(/^0x[a-fA-F0-9]{40}$/).describe('ERC-20 token contract address'),
1348
1348
  chain_id: z.number().int().describe('Chain ID'),
1349
1349
  }, async ({ token, chain_id }) => {
1350
+ // A node serving another chain used to be swallowed by the three catch() calls below into name "Unknown" (round 6); it is an error.
1351
+ if (isLocalMode() && !isSolanaChain(chain_id))
1352
+ await assertRpcServesChain(chain_id);
1350
1353
  if (isSolanaChain(chain_id)) {
1351
1354
  throw new Error('get_token_info is not supported on Solana. Use Solana token metadata programs to query SPL token details.');
1352
1355
  }
@@ -1914,7 +1917,8 @@ tool('pay_x402', 'Handle an x402 payment flow. Fetches a URL, and if the server
1914
1917
  let claimedAboveMax = false;
1915
1918
  if (claimedStr && /^\d+(\.\d+)?$/.test(claimedStr)) {
1916
1919
  try {
1917
- claimedAboveMax = (/^\d+$/.test(claimedStr) && BigInt(claimedStr) > BigInt(rawAmount)) || BigInt(parseUnits(claimedStr, trustedDecimals)) > BigInt(rawAmount);
1920
+ // An integer claim is read as base units, a decimal one as human units; reading an integer both ways flagged every honest base-unit claim (round 6).
1921
+ claimedAboveMax = /^\d+$/.test(claimedStr) ? BigInt(claimedStr) > BigInt(rawAmount) : BigInt(parseUnits(claimedStr, trustedDecimals)) > BigInt(rawAmount);
1918
1922
  }
1919
1923
  catch {
1920
1924
  claimedAboveMax = false;
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "agentwallet-mcp",
3
3
  "mcpName": "io.github.hifriendbot/agentwallet",
4
- "repository": { "type": "git", "url": "https://github.com/hifriendbot/agentwallet-mcp" },
5
- "version": "1.13.13",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/hifriendbot/agentwallet-mcp.git"
7
+ },
8
+ "version": "1.13.14",
6
9
  "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.",
7
10
  "type": "module",
8
11
  "main": "build/index.js",