Quickstart
Get started with Sponge in under 5 minutes.
Installation
Install the Sponge SDK using your preferred package manager:
bun add @spongewallet/sdkOr with npm:
npm install @spongewallet/sdkOr with yarn:
yarn add @spongewallet/sdkBasic Usage
Import and Connect
The connect() method handles authentication automatically using the device flow. On first run, it will prompt you to authorize in your browser.
import { SpongeWallet } from "@spongewallet/sdk";
const wallet = await SpongeWallet.connect();Check Balances
Retrieve balances across all supported chains:
const balances = await wallet.getBalances();
console.log(balances);
// [
// { chain: "ethereum", balance: "0.5", symbol: "ETH", usdValue: "1250.00" },
// { chain: "base", balance: "100.0", symbol: "USDC", usdValue: "100.00" },
// { chain: "solana", balance: "10.0", symbol: "SOL", usdValue: "450.00" }
// ]Get Wallet Addresses
Each agent gets one EVM wallet (works across Ethereum, Base, and other EVM chains) and one Solana wallet:
const addresses = await wallet.getAddresses();
console.log(addresses);
// {
// evm: "0x1234...abcd",
// solana: "7nYB...xyz"
// }Transfer Crypto
Send crypto to any address:
const tx = await wallet.transfer({
chain: "base",
to: "0xRecipientAddress",
amount: "10.0",
currency: "USDC"
});
console.log(`Transaction: ${tx.hash}`);
console.log(`Explorer: ${tx.explorerUrl}`);Test Mode vs Live Mode
API Key Types
Sponge uses different API keys for test and live environments. Test keys (prefixed with sponge_test_) can only access testnets, while live keys (sponge_live_) can only access mainnets.
Using Test Mode
By default, connect() uses test mode during the device flow. You can explicitly request a test or live key:
// Explicitly request test mode
const testWallet = await SpongeWallet.connect({ testnet: true });
// Request live mode (requires approval)
const liveWallet = await SpongeWallet.connect({ testnet: false });Test Chains Available
| Chain | Description |
|---|---|
sepolia | Ethereum Sepolia testnet |
base-sepolia | Base Sepolia testnet |
solana-devnet | Solana Devnet |
tempo | Tempo testnet (instant finality) |
Get Free Testnet Tokens
Use the faucet to get free testnet tokens:
// Request testnet tokens (test keys only)
const faucet = await wallet.requestFaucet({ chain: "tempo" });
console.log(`Received ${faucet.amount} ${faucet.symbol}`);Connect to Claude
Sponge integrates natively with Claude via MCP or direct tools.
MCP Integration (Recommended)
import Anthropic from "@anthropic-ai/sdk";
import { SpongeWallet } from "@spongewallet/sdk";
const wallet = await SpongeWallet.connect();
const anthropic = new Anthropic();
const response = await anthropic.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: "What's my wallet balance?" }],
mcp_servers: {
wallet: wallet.mcp()
}
});Direct Tools
const tools = wallet.tools();
const response = await anthropic.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: "Send 1 USDC to 0x..." }],
tools: tools.definitions
});
// Execute any tool calls
for (const block of response.content) {
if (block.type === "tool_use") {
const result = await tools.execute(block.name, block.input);
// ... continue conversation with result
}
}