{"slug": "openclaw-plugin-connect-waiaas-to-langchain-crewai-and-any-ai-framework", "title": "OpenClaw Plugin: Connect WAIaaS to LangChain, CrewAI, and Any AI Framework", "summary": "WAIaaS released OpenClaw, a plugin that connects AI agent frameworks such as LangChain, CrewAI, and AutoGPT to self-hosted blockchain wallets through five tool categories: wallet, transfer, defi, nft, and utility. The plugin wraps the WAIaaS daemon's wallet infrastructure — key storage, transaction signing, policy enforcement, and multi-chain support — into structured tools agents can call directly, avoiding the need to rewrite agents or build financial plumbing from scratch.", "body_md": "Your AI agent can browse the web, write code, and manage files — but can it swap tokens? The OpenClaw plugin is WAIaaS's answer to that question: a drop-in wallet toolkit that connects your existing AI agent framework to real blockchain wallets, without rewriting your agent from scratch.\n\nYou've built an agent. Maybe it's a LangChain chain, a CrewAI crew, or something you rolled yourself on top of an LLM API. It can reason, plan, and call tools. But the moment you need it to do anything with money — pay for an API, swap tokens, send funds to a counterparty — you hit a wall.\n\nBlockchains don't have a \"tool call\" interface. Signing a transaction requires private keys, RPC connections, nonce management, gas estimation, and a dozen other things that have nothing to do with your agent's actual job. Most developers either give up, hardcode a single wallet with no security controls, or spend weeks building financial plumbing that isn't their core product.\n\nThe result is agents that are powerful reasoners but financially stranded. They can think about money, but they can't touch it.\n\nWAIaaS is a self-hosted Wallet-as-a-Service daemon — you run it alongside your agent, and it handles all the wallet infrastructure: key storage, transaction signing, policy enforcement, DeFi integrations, multi-chain support. Your agent talks to it over HTTP or through a tool interface.\n\nThe OpenClaw plugin is specifically designed for agent frameworks. Instead of exposing a raw REST API, it wraps WAIaaS capabilities into structured tools that LangChain, CrewAI, AutoGPT, or any framework that supports tool use can call directly.\n\nThe plugin exposes **5 tool categories**: `wallet`, `transfer`, `defi`, `nft`, and `utility`. Each category maps to a natural set of things an agent might need to do in the course of completing a task.\n\nBefore your agent can use OpenClaw, you need the WAIaaS daemon running. The fastest path is Docker:\n\n```\ndocker run -d \\\n  --name waiaas \\\n  -p 127.0.0.1:3100:3100 \\\n  -v waiaas-data:/data \\\n  -e WAIAAS_AUTO_PROVISION=true \\\n  ghcr.io/waiaas/waiaas:latest\n\n# Grab the auto-generated master password\ndocker exec waiaas cat /data/recovery.key\n```\n\nOr if you prefer the CLI:\n\n```\nnpm install -g @waiaas/cli\nwaiaas init --auto-provision\nwaiaas start\nwaiaas quickset   # Creates wallets + sessions automatically\n```\n\nEither way, you end up with a daemon listening on `http://127.0.0.1:3100` and a session token that looks like `wai_sess_eyJhbGciOiJIUzI1NiJ9...`. That token is what your agent will use to authenticate.\n\nThe daemon itself has 39 REST API route modules under the hood, but you won't need to interact with most of them directly — OpenClaw handles that abstraction for you.\n\nOpenClaw's 5 tools (`wallet`, `transfer`, `defi`, `nft`, `utility`) each act as a gateway to a category of operations. Your agent calls a tool, passes parameters, and gets back structured results. The daemon handles everything else: signing, broadcasting, confirming.\n\n**wallet** — Query wallet state: address, balances, transaction history, open sessions.\n\n**transfer** — Move assets: native tokens, ERC-20/SPL tokens, NFTs. The daemon's 7-stage pipeline (validate → auth → policy → wait → execute → confirm) runs in the background, so your agent just submits a transfer and polls for completion.\n\n**defi** — Execute DeFi actions against any of the 15 integrated protocol providers, including Aave v3, Jupiter swap, Lido staking, Jito staking, Hyperliquid, Kamino, Pendle, Polymarket, and others. Your agent doesn't need to know how Jupiter's routing API works — it calls the DeFi tool with intent, and OpenClaw + WAIaaS handles the execution.\n\n**nft** — Read NFT metadata, list holdings (EVM ERC-721/ERC-1155 and Solana Metaplex), and transfer NFTs.\n\n**utility** — Supporting operations: encode calldata, resolve assets, check provider status, interact with x402 payment endpoints.\n\nHere's what wiring OpenClaw into a LangChain-style agent looks like. First, your agent gets the OpenClaw tools registered as part of its tool set. Then it can call them like any other tool.\n\nBefore the agent does anything financial, you'll want to verify the wallet is funded and know what it's working with. Using the TypeScript SDK directly (which OpenClaw wraps), the pattern looks like this:\n\n``` js\nimport { WAIaaSClient } from '@waiaas/sdk';\n\nconst client = new WAIaaSClient({\n  baseUrl: 'http://127.0.0.1:3100',\n  sessionToken: process.env.WAIAAS_SESSION_TOKEN,\n});\n\n// Agent checks its own balance before deciding whether to proceed\nconst balance = await client.getBalance();\nconsole.log(`Balance: ${balance.balance} ${balance.symbol} (${balance.chain}/${balance.network})`);\n```\n\nWhen the agent decides to execute a transfer, it submits the transaction and polls for confirmation:\n\n``` js\nconst sendResult = await client.sendToken({\n  type: 'TRANSFER',\n  to: 'recipient-address',\n  amount: '0.001',\n});\nconsole.log(`Transaction submitted: ${sendResult.id} (status: ${sendResult.status})`);\n\n// Poll for confirmation\nconst POLL_TIMEOUT_MS = 60_000;\nconst startTime = Date.now();\nwhile (Date.now() - startTime < POLL_TIMEOUT_MS) {\n  const tx = await client.getTransaction(sendResult.id);\n  if (tx.status === 'COMPLETED') {\n    console.log(`Transaction confirmed! Hash: ${tx.txHash}`);\n    break;\n  }\n  if (tx.status === 'FAILED') {\n    console.error(`Transaction failed: ${tx.error}`);\n    break;\n  }\n  await new Promise(resolve => setTimeout(resolve, 1000));\n}\n```\n\nThe agent doesn't know or care about private keys, RPC nodes, or gas pricing. It submits intent, waits for result.\n\nThis is worth stopping on, because it's the part most developers skip and later regret. When you give an agent a wallet, you're giving it the ability to move real money. WAIaaS's policy engine is what keeps that from being terrifying.\n\nThe policy engine has 21 policy types with 4 security tiers: INSTANT (execute immediately), NOTIFY (execute and alert you), DELAY (queue for N seconds, cancellable), and APPROVAL (require human sign-off). Policies follow default-deny: if you haven't explicitly allowed something, it's blocked.\n\nA sensible starting policy for an agent wallet:\n\n```\ncurl -X POST http://127.0.0.1:3100/v1/policies \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-Master-Password: my-secret-password\" \\\n  -d '{\n    \"walletId\": \"<wallet-uuid>\",\n    \"type\": \"SPENDING_LIMIT\",\n    \"rules\": {\n      \"instant_max_usd\": 100,\n      \"notify_max_usd\": 500,\n      \"delay_max_usd\": 2000,\n      \"delay_seconds\": 900,\n      \"daily_limit_usd\": 5000\n    }\n  }'\n```\n\nThis single policy means: under $100 goes through immediately, $100–$500 notifies you but proceeds, $500–$2000 waits 15 minutes (during which you can cancel), and anything over $2000 requires your explicit approval. Your agent can still operate autonomously for routine tasks, but large moves get human review.\n\nYou'll also want to add an `ALLOWED_TOKENS` policy so the agent can only move tokens you've explicitly approved, and a `CONTRACT_WHITELIST` if it's going to call DeFi protocols. Without these, those operations are blocked by default — which is the right default.\n\nWith the `defi` OpenClaw tool and the 15 protocol providers integrated into WAIaaS, an agent can:\n\n`PERP_MAX_LEVERAGE` policy)\nThe DeFi action call via the REST API looks like this — and OpenClaw wraps this pattern so your agent can invoke it through tool calling:\n\n```\ncurl -X POST http://127.0.0.1:3100/v1/actions/jupiter-swap/swap \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer wai_sess_<token>\" \\\n  -d '{\n    \"inputMint\": \"So11111111111111111111111111111111111111112\",\n    \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n    \"amount\": \"1000000000\"\n  }'\n```\n\nBefore any of this executes, the transaction runs through the 7-stage pipeline. Stage 3 is the policy check — if the action violates any configured policy (wrong token, too large, wrong network, wrong venue), it gets blocked before any signing happens. Stage 4 handles the delay/approval wait if required. Stage 5 is execution. Your agent waits for the pipeline to complete.\n\nIf your agent is being cautious or you want to validate a transaction before committing, the dry-run API lets you simulate without executing:\n\n```\ncurl -X POST http://127.0.0.1:3100/v1/transactions/send \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer wai_sess_<token>\" \\\n  -d '{\n    \"type\": \"TRANSFER\",\n    \"to\": \"recipient-address\",\n    \"amount\": \"0.1\",\n    \"dryRun\": true\n  }'\n```\n\nThis runs all validation stages and returns what would happen — including policy decisions and estimated outcomes — without touching the chain. Useful for agents that need to reason about feasibility before committing.\n\nWAIaaS returns structured errors, which means your agent can make intelligent decisions when something goes wrong rather than just logging an unhandled exception:\n\n``` js\nimport { WAIaaSClient, WAIaaSError } from '@waiaas/sdk';\n\ntry {\n  const tx = await client.sendToken({ to: '...', amount: '1.0' });\n} catch (error) {\n  if (error instanceof WAIaaSError) {\n    console.error(`API Error: [${error.code}] ${error.message}`);\n    // error.code examples: INSUFFICIENT_BALANCE, POLICY_DENIED, TOKEN_EXPIRED\n  }\n}\n```\n\n`POLICY_DENIED` means the agent tried something the policy engine blocked — the agent should not retry, and probably should surface this to the user. `INSUFFICIENT_BALANCE` means the agent needs to either acquire funds or reduce the amount. `TOKEN_EXPIRED` means the session needs to be refreshed by whoever manages sessions (typically your orchestration layer, not the agent itself).\n\nStructured errors make your agent a better reasoner about financial operations, not just a blind executor.\n\nHere's the minimal path to an agent with a wallet:\n\n**Step 1: Start the daemon**\n\n```\nnpm install -g @waiaas/cli\nwaiaas init --auto-provision && waiaas start\n```\n\n**Step 2: Create a wallet and session**\n\n```\nwaiaas quickset\n```\n\n**Step 3: Set a spending policy** (use the curl example above with your wallet ID and master password)\n\n**Step 4: Install the SDK and connect**\n\n```\nnpm install @waiaas/sdk\n```\n\nThen use the `WAIaaSClient` with your session token as shown in the examples above. Wire the OpenClaw tools into your framework's tool registry, and your agent is financially operational.\n\n**Step 5: Test with dry run** before letting the agent execute live transactions.\n\nThe OpenClaw plugin is the fastest path to financial capability for an existing agent, but WAIaaS has deeper integrations worth exploring. If you're building for Claude specifically, the MCP integration with 45 tools gives Claude native wallet awareness through the Model Context Protocol. If you need your agent to pay for API calls automatically as part of its workflow, the x402 HTTP payment protocol support handles that transparently.\n\nExplore the full codebase at **[https://github.com/waiaas/WAIaaS](https://github.com/waiaas/WAIaaS)** — the monorepo includes the OpenClaw plugin source, all 15 DeFi provider implementations, and the full test suite (684+ test files) so you can see exactly what each integration does before trusting it with funds. For documentation and the hosted reference, visit **[https://waiaas.ai](https://waiaas.ai)**.\n\nYour agent already knows how to think. Now give it a wallet.", "url": "https://wpnews.pro/news/openclaw-plugin-connect-waiaas-to-langchain-crewai-and-any-ai-framework", "canonical_source": "https://dev.to/walletguy/openclaw-plugin-connect-waiaas-to-langchain-crewai-and-any-ai-framework-1klh", "published_at": "2026-09-14 18:34:24+00:00", "updated_at": "2026-09-14 21:36:37.013519+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-infrastructure", "developer-tools"], "entities": ["WAIaaS", "OpenClaw", "LangChain", "CrewAI", "AutoGPT", "Aave v3", "Jupiter", "Lido"], "alternates": {"html": "https://wpnews.pro/news/openclaw-plugin-connect-waiaas-to-langchain-crewai-and-any-ai-framework", "markdown": "https://wpnews.pro/news/openclaw-plugin-connect-waiaas-to-langchain-crewai-and-any-ai-framework.md", "text": "https://wpnews.pro/news/openclaw-plugin-connect-waiaas-to-langchain-crewai-and-any-ai-framework.txt", "jsonld": "https://wpnews.pro/news/openclaw-plugin-connect-waiaas-to-langchain-crewai-and-any-ai-framework.jsonld"}}