{"_id":"@agentsbankai/sdk","_rev":"5-7a1838c774838c8b49c3b6dfca19933a","name":"@agentsbankai/sdk","dist-tags":{"latest":"1.0.32"},"versions":{"1.0.0":{"name":"@agentsbankai/sdk","version":"1.0.0","keywords":["agentsbank","ai-agents","crypto","wallet","ethereum","solana","bitcoin","bsc","sdk","api","fintech","web3"],"author":{"name":"AgentsBank","email":"info@agentsbank.online"},"license":"MIT","_id":"@agentsbankai/sdk@1.0.0","maintainers":[{"name":"agentsbank","email":"info@agentsbank.online"}],"homepage":"https://agentsbank.online","bugs":{"url":"https://github.com/agentsbank/sdk/issues"},"dist":{"shasum":"91cefcaa5fb62ab46b4dada22fc1d02e762c023d","tarball":"https://registry.npmjs.org/@agentsbankai/sdk/-/sdk-1.0.0.tgz","fileCount":7,"integrity":"sha512-FtvLuqtAojOtYI/pHYyUR4GrfPajG32tYvoxbm6DninXUTAaK1VvWwDVw3jMx7/u5k4yM5hj0Piu+WcfOAGrjA==","signatures":[{"sig":"MEYCIQCQ/p8WOn2SdLSqAx4jTG6eXPjIB3EIhQPPNKRvZzbSZwIhAPT19+HbNfVz7xhM6xW/9DC85LbI7ZjD7d5XVl/9iJJa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43243},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"agentsbank","email":"info@agentsbank.online"},"repository":{"url":"git+https://github.com/agentsbank/sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"Official SDK for AgentsBank.ai - Crypto banking infrastructure for AI agents","directories":{},"_nodeVersion":"25.1.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.1","vitest":"^1.0.0","typescript":"^5.3.0","@types/node":"^20.10.0"},"peerDependencies":{"typescript":">=4.7.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1770407751016_0.947298582342758","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@agentsbankai/sdk","version":"1.0.1","keywords":["agentsbank","ai-agents","crypto","wallet","ethereum","solana","bitcoin","bsc","sdk","api","fintech","web3"],"author":{"name":"AgentsBank","email":"info@agentsbank.online"},"license":"MIT","_id":"@agentsbankai/sdk@1.0.1","maintainers":[{"name":"agentsbank","email":"info@agentsbank.online"}],"homepage":"https://agentsbank.online","bugs":{"url":"https://github.com/agentsbank/sdk/issues"},"dist":{"shasum":"144796f3ffb57d59e036f15087feedb645a15436","tarball":"https://registry.npmjs.org/@agentsbankai/sdk/-/sdk-1.0.1.tgz","fileCount":7,"integrity":"sha512-XH9KjR+Ay8in1TALbXQamSPqhXQzZG79oc3/t7hz028iWHUdoWfH/wL8yZU+w8uj9vfkdizy1Zr/ESgQtmABSA==","signatures":[{"sig":"MEUCIE3FT1yh8TlvkgxLSL5lRovMfF49Q06+6U2G9MuehhqfAiEArSqYgJC/nbUkDxYw1713tbocSSnwX8nNz6aL0tkh8Ww=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42925},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"agentsbank","email":"info@agentsbank.online"},"repository":{"url":"git+https://github.com/agentsbank/sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"Official SDK for AgentsBank.ai - Crypto banking infrastructure for AI agents","directories":{},"_nodeVersion":"25.1.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.1","vitest":"^1.0.0","typescript":"^5.3.0","@types/node":"^20.10.0"},"peerDependencies":{"typescript":">=4.7.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.1_1770409822157_0.8240602161922166","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@agentsbankai/sdk","version":"1.0.3","keywords":["agentsbank","ai-agents","crypto","wallet","ethereum","solana","bitcoin","bsc","sdk","api","fintech","web3"],"author":{"name":"AgentsBank","email":"info@agentsbank.online"},"license":"MIT","_id":"@agentsbankai/sdk@1.0.3","maintainers":[{"name":"agentsbank","email":"info@agentsbank.online"}],"homepage":"https://agentsbank.online","bugs":{"url":"https://github.com/agentsbank/sdk/issues"},"dist":{"shasum":"a2c67d66b0d19c93c147f5a2e6a56036ed381718","tarball":"https://registry.npmjs.org/@agentsbankai/sdk/-/sdk-1.0.3.tgz","fileCount":7,"integrity":"sha512-sBvvCTHQUReZE265huZXEssKYyecIsXsKlQ5k/kudAv2t6MJtXX7hEzNjkbfQ051WDizXSwZhDaR0x5RqvqL8Q==","signatures":[{"sig":"MEUCIQDmJ7lFOkaEyFRBLK4/8mRwYQPRNX/1DtCKfYXVCO3hhwIgR9GNRYpeB9gag/kNpCBl5qUUyF60+4IoZAqcImjszFY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42925},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"c1cce68824f7ece78c1b8022fde320c1fe9e117c","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"agentsbank","email":"info@agentsbank.online"},"repository":{"url":"git+https://github.com/agentsbank/sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"Official SDK for AgentsBank.ai - Crypto banking infrastructure for AI agents","directories":{},"_nodeVersion":"25.1.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.1","vitest":"^1.0.0","typescript":"^5.3.0","@types/node":"^20.10.0"},"peerDependencies":{"typescript":">=4.7.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.3_1770414482229_0.006484771778685117","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@agentsbankai/sdk","version":"1.0.6","keywords":["agentsbank","ai-agents","crypto","wallet","ethereum","solana","bitcoin","bsc","sdk","api","fintech","web3"],"author":{"name":"AgentsBank","email":"info@agentsbank.online"},"license":"MIT","_id":"@agentsbankai/sdk@1.0.6","maintainers":[{"name":"agentsbank","email":"info@agentsbank.online"}],"homepage":"https://agentsbank.online","bugs":{"url":"https://github.com/agentsbank/sdk/issues"},"dist":{"shasum":"7c2a7a1de099ebd8f248cc802c5744c957c3d82f","tarball":"https://registry.npmjs.org/@agentsbankai/sdk/-/sdk-1.0.6.tgz","fileCount":6,"integrity":"sha512-p79+S+tkfHk8bts9Ntx6NmeNrBYWDmNYkcBh2soL7TfWN+EfDfCrFtvD5Ry3MfjzJp5N2elVucDOD0MRnUalyA==","signatures":[{"sig":"MEQCIGqb7TrxeqQkkFtJTZsj+oeRH3P2MD3cPlISj21vKYp5AiBbBSjLXpEr1YBh7dZfRhI+KqgSeQRGW26W5C7lN6RVuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76574},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"38db63d4c532900afab5a55901321bf0515e45da","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"agentsbank","email":"info@agentsbank.online"},"repository":{"url":"git+https://github.com/agentsbank/sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"Official SDK for AgentsBank.ai - Crypto banking infrastructure for AI agents","directories":{},"_nodeVersion":"25.1.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.1","vitest":"^1.0.0","typescript":"^5.3.0","@types/node":"^20.10.0"},"peerDependencies":{"typescript":">=4.7.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.6_1770763843884_0.5111851340808904","host":"s3://npm-registry-packages-npm-production"}},"1.0.32":{"name":"@agentsbankai/sdk","version":"1.0.32","description":"Official SDK for AgentsBank.ai - Crypto banking infrastructure for AI agents","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/","test":"vitest","prepublishOnly":"npm run build"},"keywords":["agentsbank","ai-agents","crypto","wallet","ethereum","solana","bitcoin","bsc","sdk","api","fintech","web3"],"author":{"name":"AgentsBank","email":"info@agentsbank.online"},"license":"MIT","homepage":"https://agentsbank.online","repository":{"type":"git","url":"git+https://github.com/agentsbank/sdk.git"},"bugs":{"url":"https://github.com/agentsbank/sdk/issues"},"engines":{"node":">=18.0.0"},"devDependencies":{"@types/node":"^20.10.0","tsup":"^8.0.1","typescript":"^5.3.0","vitest":"^1.0.0"},"peerDependencies":{"typescript":">=4.7.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"gitHead":"9a2380f54242687274e765e3b1a3d9c4584d6028","_id":"@agentsbankai/sdk@1.0.32","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-PSYjVyv664SnSlqHN3OpU+b1xPgzjMgfrIMOB+06eMOqWUUGFaJ3xEgHl6aurzRfQq/SGd6cnJqE+HufbwJKYw==","shasum":"97d3c3bbdec60a3fb69e1fc7bd47a1b94eb976a4","tarball":"https://registry.npmjs.org/@agentsbankai/sdk/-/sdk-1.0.32.tgz","fileCount":6,"unpackedSize":95030,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID3BkWPUokaz7fQNr55n60s55F48z/PahO14GbemUaj7AiEA8XQgdhr1WLYOx01CMliLwMtmH1hrG5c4Iv+2sOPfcNA="}]},"_npmUser":{"name":"agentsbank","email":"info@agentsbank.online"},"directories":{},"maintainers":[{"name":"agentsbank","email":"info@agentsbank.online"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.32_1771090224968_0.8178746838882152"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-06T19:55:50.889Z","modified":"2026-02-14T17:30:25.252Z","1.0.0":"2026-02-06T19:55:51.177Z","1.0.1":"2026-02-06T20:30:22.284Z","1.0.3":"2026-02-06T21:48:02.365Z","1.0.6":"2026-02-10T22:50:44.096Z","1.0.32":"2026-02-14T17:30:25.117Z"},"bugs":{"url":"https://github.com/agentsbank/sdk/issues"},"author":{"name":"AgentsBank","email":"info@agentsbank.online"},"license":"MIT","homepage":"https://agentsbank.online","keywords":["agentsbank","ai-agents","crypto","wallet","ethereum","solana","bitcoin","bsc","sdk","api","fintech","web3"],"repository":{"type":"git","url":"git+https://github.com/agentsbank/sdk.git"},"description":"Official SDK for AgentsBank.ai - Crypto banking infrastructure for AI agents","maintainers":[{"name":"agentsbank","email":"info@agentsbank.online"}],"readme":"# @agentsbank/sdk\n\nOfficial TypeScript/JavaScript SDK for [AgentsBank](https://agentsbank.online) - Crypto banking infrastructure for AI agents.\n\n**Version: 1.0.32** - Wallet creation fixed! All 4 chains working. JWT auto-refresh production-ready.\n\n## What's Fixed in v1.0.6\n\n- ✅ **Wallet Creation Working** - Ethereum, BSC, Solana, Bitcoin all working perfectly\n- ✅ **JWT Auto-Refresh** - Tokens automatically renew before 7-day expiration (no more 401s!)\n- ✅ **Better Error Messages** - Clearer error responses from wallet operations\n- ✅ **Unique Wallet Constraint** - One wallet per agent per chain enforced\n- 🚀 **Ready for Production** - All critical features tested and working\n\n## Features\n\n- 🔐 **Full Authentication** - Register, login, API keys, JWT tokens with auto-refresh\n- 💰 **Multi-Chain Wallets** - ✅ Ethereum, ✅ BSC, ✅ Solana, ✅ Bitcoin (all working!)\n- 📤 **Send Transactions** - Native tokens + USDC/USDT on all chains\n- ✍️ **Message Signing** - Prove wallet ownership\n- 📊 **Balance & History** - Real-time blockchain data\n- 🔒 **TypeScript First** - Full type safety\n- 🔄 **Token Auto-Refresh** - Automatic JWT renewal every 6 days (NEW!)\n- ⚡ **Enterprise Features**\n  - Automatic retry with exponential backoff (3 attempts by default)\n  - Response caching (50-70x faster reads)\n  - Typed error handling (19 error codes)\n  - Webhook notifications (7 event types)\n  - Guardrails (spending limits, whitelisting)\n  - SDK helpers (sendSafe, sendMultiple, hasEnoughFunds)\n- 💰 **Always Free** - 0% platform fees, pay only network gas\n- 📈 **Monitoring** - Health checks, metrics, real-time dashboard\n\n## Installation\n\n```bash\nnpm install @agentsbank/sdk\n# or\nyarn add @agentsbank/sdk\n# or\npnpm add @agentsbank/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { createClient } from '@agentsbank/sdk';\n\n// Create client\nconst client = createClient({\n  baseUrl: 'https://api.agentsbank.online'\n});\n\n// Register a new agent\nconst agent = await client.register({\n  human_username: 'myuser',\n  human_email: 'user@example.com',\n  first_name: 'John',\n  last_name: 'Doe',\n  agent_password: 'SecurePass123!'\n});\n\n// Token is auto-set after registration\nconsole.log('Agent ID:', agent.agent_id);\nconsole.log('Wallets:', agent.wallets);\n\n// ⚠️ SAVE RECOVERY WORDS SECURELY!\nconsole.log('Recovery:', agent.recovery_words);\n```\n\n## Authentication\n\n### Using API Key\n\n```typescript\nconst client = createClient({\n  apiKey: 'your-api-key'\n});\n```\n\n### Using JWT Token\n\n```typescript\nconst client = createClient({\n  token: 'your-jwt-token'\n});\n\n// Or set later\nclient.setToken(token);\n```\n\n### Login\n\n```typescript\nawait client.login({\n  agent_username: 'agent_123456_abc',\n  agent_password: 'SecurePass123!'\n});\n// Token is auto-set\n```\n\n## Wallets\n\n### Create Wallet\n\n```typescript\n// Supported chains: 'ethereum', 'bsc', 'solana', 'bitcoin'\nconst wallet = await client.createWallet('solana');\n\nconsole.log(wallet.address);  // Solana address\nconsole.log(wallet.wallet_id); // Use for transactions\n```\n\n### Get Balance\n\n```typescript\nconst { balance } = await client.getBalance(walletId);\n\nconsole.log(`SOL: ${balance.SOL}`);\nconsole.log(`USDC: ${balance.USDC}`);\n```\n\n## Transactions\n\n### Send Native Token\n\n```typescript\nconst tx = await client.send(walletId, {\n  to_address: 'recipient_address',\n  amount: '0.1'  // 0.1 SOL/ETH/BNB/BTC\n});\n\nconsole.log(`TX Hash: ${tx.tx_hash}`);\nconsole.log(`Status: ${tx.status}`);\n```\n\n### Send Token (USDC/USDT)\n\n```typescript\nconst tx = await client.send(walletId, {\n  to_address: 'recipient_address',\n  amount: '100',\n  currency: 'USDC'\n});\n```\n\n### Estimate Fees\n\n```typescript\nconst estimate = await client.estimateGas(\n  walletId,\n  'recipient_address',\n  '1.0'\n);\n\nconsole.log(`Estimated gas: ${estimate.estimated_gas}`);\n```\n\n## Message Signing\n\nSign messages for authentication with external services:\n\n```typescript\nconst { signature } = await client.signMessage(\n  walletId,\n  'Sign in to MyApp: nonce=abc123'\n);\n\n// signature can be verified on-chain\n```\n\n## Transaction History\n\n```typescript\nconst { transactions } = await client.getTransactionHistory(walletId, 50);\n\nfor (const tx of transactions) {\n  console.log(`${tx.type}: ${tx.amount} ${tx.currency} -> ${tx.to_address}`);\n}\n```\n\n## Supported Chains\n\n| Chain | Native Token | Tokens | Address Format |\n|-------|--------------|--------|----------------|\n| Ethereum | ETH | USDT, USDC | 0x... |\n| BSC | BNB | USDT, USDC | 0x... |\n| Solana | SOL | USDT, USDC | Base58 |\n| Bitcoin | BTC | - | bc1... (SegWit) |\n\n## Error Handling\n\nAgentsBank SDK includes 19 typed error codes for precise error handling:\n\n```typescript\nimport { AgentsBankError, ErrorCode } from '@agentsbank/sdk';\n\ntry {\n  await client.send(walletId, { to_address, amount: '1000' });\n} catch (error) {\n  if (error instanceof AgentsBankError) {\n    switch (error.code) {\n      case ErrorCode.INSUFFICIENT_FUNDS:\n        console.error('Not enough balance');\n        break;\n      case ErrorCode.INVALID_ADDRESS:\n        console.error('Invalid recipient address');\n        break;\n      case ErrorCode.TIMEOUT:\n        console.error('Request timeout (SDK already retried)');\n        break;\n      case ErrorCode.RATE_LIMITED:\n        console.error('Rate limited (SDK already retried)');\n        break;\n      default:\n        console.error(`Error ${error.code}: ${error.message}`);\n    }\n  }\n}\n```\n\n### Automatic Retry\n\nTransient errors (network timeouts, temporary 5xx errors, rate limits) are automatically retried with exponential backoff:\n\n```typescript\n// Configure retry behavior\nconst client = createClient({\n  baseUrl: 'https://api.agentsbank.online',\n  retryConfig: {\n    maxAttempts: 3,           // Default\n    initialDelayMs: 100,      // Default\n    maxDelayMs: 5000          // Default\n  }\n});\n```\n\nAutomatic retry applies to:\n- ✅ Network timeouts\n- ✅ Temporary 5xx server errors\n- ✅ Rate limit (429) responses\n- ✅ RPC failures\n\nNot retried (fail immediately):\n- ❌ Invalid address format\n- ❌ Insufficient funds\n- ❌ Authentication errors\n- ❌ Permission denied\n- ❌ Resource not found\n\n## Configuration Options\n\n```typescript\nconst client = createClient({\n  // API endpoint (default: https://api.agentsbank.online)\n  baseUrl: 'https://api.agentsbank.online',\n  \n  // Authentication (pick one)\n  apiKey: 'your-api-key',\n  token: 'your-jwt-token',\n  \n  // Request timeout in ms (default: 30000)\n  timeout: 60000,\n  \n  // Retry configuration (default shown)\n  retryConfig: {\n    maxAttempts: 3,\n    initialDelayMs: 100,\n    maxDelayMs: 5000\n  },\n  \n  // Guardrails for spending limits\n  guardrails: {\n    dailyLimitUSD: 5000,\n    maxPerTxUSD: 1000,\n    whitelistedAddresses: ['0x...']\n  },\n  \n  // Custom fetch implementation (for Node.js < 18)\n  fetch: customFetch,\n\n  // Automatic token refresh (NEW!)\n  autoRefresh: {\n    enabled: true,              // Default: true\n    refreshBeforeDays: 6,       // Refresh at 6 days (default)\n    storeCredentials: true,     // Store for auto re-login (default: false)\n    credentials: {              // Auto re-login if token expires\n      agent_username: 'agent_xxx',\n      agent_password: 'your_password'\n    }\n  }\n});\n```\n\n## Automatic Token Refresh (NEW!)\n\nJWT tokens expire after 7 days. The SDK automatically refreshes them on the same device to prevent wallet access loss.\n\n### How It Works\n\n1. **Automatic Background Refresh**: SDK checks token age every 6 hours\n2. **Proactive Refresh**: Refreshes at 6 days (before 7-day expiration)\n3. **Device-Local**: No credential exposure; everything on same device\n4. **Auto Re-login**: If token expires, SDK can automatically re-authenticate\n\n### Enable Auto-Refresh with Credentials\n\n```typescript\nconst client = createClient({\n  autoRefresh: {\n    enabled: true,\n    storeCredentials: true,\n    credentials: {\n      agent_username: 'agent_xxx_abc123',\n      agent_password: 'YourPassword123!'  // Stored securely on device\n    }\n  }\n});\n\n// Now use SDK normally for 7+ days without manual token refresh!\nconst balance = await client.getBalance(walletId);\n// ↑ If token would expire, SDK refreshes it automatically\n```\n\n### Manual Token Status Check\n\n```typescript\n// Check token age\nconst ageInDays = client.getTokenAgeInDays();\nconsole.log(`Token age: ${ageInDays?.toFixed(1)} days`);\n\n// Check time until expiration\nconst expiresInDays = client.getTokenExpiresInDays();\nconsole.log(`Expires in: ${expiresInDays?.toFixed(1)} days`);\n```\n\n### Recovery Flows\n\nIf auto-refresh is disabled or re-login fails:\n\n```typescript\n// Path A: Manual refresh (before expiry)\nawait client.refreshToken();\n\n// Path B: Re-login with credentials\nawait client.login({\n  agent_username: 'agent_xxx',\n  agent_password: 'your_password'\n});\n\n// Path C: Use API key (no expiration)\nconst client = createClient({\n  apiKey: 'your-api-key-uuid'\n});\n```\n\n### Production Recommendations\n\n```typescript\nimport fs from 'fs';\nimport crypto from 'crypto';\n\n// 1. Encrypt credentials before storing\nfunction storeCredentialsSecurely(username, password) {\n  const encrypted = encrypt(\n    JSON.stringify({ username, password }),\n    process.env.ENCRYPTION_KEY\n  );\n  fs.writeFileSync('./credentials.enc', encrypted);\n  fs.chmodSync('./credentials.enc', 0o600);\n}\n\n// 2. Load and use\nconst credentials = JSON.parse(decrypt(\n  fs.readFileSync('./credentials.enc'),\n  process.env.ENCRYPTION_KEY\n));\n\nconst client = createClient({\n  autoRefresh: {\n    enabled: true,\n    storeCredentials: true,\n    credentials\n  }\n});\n\n// 3. Monitor expiration\nsetInterval(() => {\n  const expiresIn = client.getTokenExpiresInDays();\n  if (expiresIn && expiresIn < 1) {\n    logger.warn('⚠️ Token expiring soon');\n  }\n}, 60000);\n```\n\n## Configuration Options\n\nAvailable since v1.0.5: Convenient helper methods that combine best practices:\n\n### sendSafe - Pre-flight Validation\n\n```typescript\n// Includes balance check, gas estimation, and auto-retry\nconst tx = await client.sendSafe(walletId, {\n  to_address: recipient,\n  amount: '1.0'\n});\n```\n\n### sendMultiple - Batch Operations\n\n```typescript\n// Send to multiple recipients efficiently\nconst results = await client.sendMultiple(walletId, [\n  { to_address: '0x111...', amount: '1.0' },\n  { to_address: '0x222...', amount: '2.0' },\n  { to_address: '0x333...', amount: '1.5' }\n]);\n\nresults.forEach((tx, i) => {\n  console.log(`Recipient ${i+1}: ${tx.tx_hash}`);\n});\n```\n\n### hasEnoughFunds - Balance Check\n\n```typescript\nconst hasEnough = await client.hasEnoughFunds(walletId, '100');\nif (!hasEnough) {\n  console.log('Insufficient balance');\n}\n```\n\n## Webhooks\n\nSubscribe to transaction events:\n\n```typescript\n// Register webhook\nconst webhook = await client.registerWebhook({\n  url: 'https://your-server.com/webhook',\n  events: ['transaction.sent', 'transaction.received']\n});\n\n// Verify webhook signature (HMAC-SHA256)\nimport crypto from 'crypto';\n\nconst signature = req.headers['x-agentsbank-signature'];\nconst payload = req.body;\n\nconst verified = crypto\n  .createHmac('sha256', webhook.secret)\n  .update(JSON.stringify(payload))\n  .digest('hex') === signature;\n```\n\nSupported events:\n- `transaction.sent` - Outgoing transaction\n- `transaction.received` - Incoming transaction\n- `transaction.confirmed` - Transaction confirmed\n- `wallet.created` - New wallet\n- `balance.changed` - Balance update\n- `error.occurred` - Error event\n- `agent.login` - Agent login\n\n## Guardrails\n\nEnforce spending limits and whitelisting:\n\n```typescript\n// Set on client\nconst client = createClient({\n  guardrails: {\n    dailyLimitUSD: 10000,\n    maxPerTxUSD: 5000,\n    whitelistedAddresses: [\n      '0x1234567890123456789012345678901234567890'\n    ]\n  }\n});\n\n// Automatic enforcement\ntry {\n  await client.send(walletId, {\n    to_address: '0xunknown...', // Not whitelisted\n    amount: '6000'               // Over max per tx\n  });\n} catch (e) {\n  // \"Rejected: transaction exceeds max per tx limit\"\n}\n```\n\n## Caching\n\nResponses are automatically cached for performance:\n\n```\nBalance lookup:     30 seconds  (50-70x faster)\nTransaction list:   2 minutes\nGas estimate:       5 minutes\nWallet info:        24 hours\n```\n\nCaching is transparent and automatic. Failed cache lookups gracefully fall back to direct RPC calls.\n\n## Monitoring\n\nCheck system health and metrics:\n\n```typescript\n// Health check\nconst health = await fetch('https://api.agentsbank.online/health');\n// { status: 'ok', timestamp: '...', version: '1.0.6' }\n\n// Metrics\nconst metrics = await fetch('https://api.agentsbank.online/api/metrics');\n// { requests_per_second: 45, cache_hit_rate: 0.68, ... }\n\n// Live dashboard\n// https://api.agentsbank.online/api/monitoring/dashboard\n```\n\n## TypeScript\n\nFull type definitions included:\n\n```typescript\nimport type {\n  Chain,\n  Currency,\n  WalletInfo,\n  Transaction,\n  SendTransactionRequest\n} from '@agentsbank/sdk';\n\nconst chain: Chain = 'solana';\nconst currency: Currency = 'USDC';\n```\n\n## Support\n\n- 📧 Email: info@agentsbank.online\n- 🌐 Website: https://agentsbank.online\n- 📚 Docs: https://docs.agentsbank.online\n- 📊 API Docs: https://api.agentsbank.online/docs\n- 📈 Dashboard: https://api.agentsbank.online/api/monitoring/dashboard\n\n## Pricing\n\n**Always Free** 🎉\n\n- 0% platform fees (completely free)\n- Only blockchain network/gas fees apply\n- Unlimited wallets and transactions\n- No credit card required\n\n## Deployment\n\n### Auto-Updates\n\nThe SDK automatically checks for updates from the server:\n\n```typescript\n// Automatic version checking (24-hour intervals)\nconst client = createClient({\n  baseUrl: 'https://api.agentsbank.online'\n  // Auto-update checking enabled by default\n});\n```\n\nCheck version status manually:\n\n```typescript\nconst response = await fetch('https://api.agentsbank.online/api/sdk/version');\nconst { version, required, releaseDate } = await response.json();\n```\n\n### Node.js Version\n\nRequires Node.js 18+ (for native fetch support). For older versions, provide custom fetch:\n\n```typescript\nimport fetch from 'node-fetch';\n\nconst client = createClient({\n  baseUrl: 'https://api.agentsbank.online',\n  fetch\n});\n```\n\n## License\n\nMIT © AgentsBank\n","readmeFilename":"README.md"}