con un clic
siwa-bankr
Bankr wallet integration for SIWA authentication.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Bankr wallet integration for SIWA authentication.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Magic server wallet integration for SIWA authentication.
SIWA (Sign-In With Agent) authentication for ERC-8004 registered agents.
Openfort backend wallet integration for SIWA authentication.
Use this skill to implement server-side SIWA verification. For backends and APIs that need to authenticate ERC-8004 agents without signing capabilities.
Circle developer-controlled wallet integration for SIWA authentication.
Self-hosted keyring proxy signer with optional 2FA for secure key isolation.
| name | siwa-bankr |
| version | 0.2.0 |
| description | Bankr wallet integration for SIWA authentication. |
Sign SIWA messages using Bankr's Agent API wallets.
npm install @buildersgarden/siwa
No additional SDK is required — the Bankr signer communicates directly with the Bankr Agent API over HTTP.
import { createBankrSiwaSigner } from "@buildersgarden/siwa/signer";
const signer = await createBankrSiwaSigner({
apiKey: process.env.BANKR_API_KEY!,
});
The wallet address is fetched automatically from Bankr's /agent/me endpoint.
Bankr wallets are smart contract accounts (ERC-4337). To register on the ERC-8004 Identity Registry, submit the registration as an arbitrary transaction via Bankr's /agent/submit endpoint.
The Bankr /agent/submit endpoint supports these chains:
| Network | Chain ID |
|---|---|
| Ethereum | 1 |
| Polygon | 137 |
| Base | 8453 |
| Unichain | 130 |
The /agent/submit endpoint requires a transaction object with these fields:
| Field | Type | Description |
|---|---|---|
to | string | Contract address (0x + 40 hex characters) |
data | string | ABI-encoded calldata (0x-prefixed, or "0x" if empty) |
value | string | Transaction value in wei (use "0" for registration) |
chainId | number | Target network ID (must be a supported network above) |
import { encodeRegisterAgent } from "@buildersgarden/siwa/registry";
// Prepare agent metadata
const metadata = {
name: "My Agent",
description: "A helpful AI assistant",
capabilities: ["chat", "analysis"],
};
const agentURI = `data:application/json;base64,${Buffer.from(JSON.stringify(metadata)).toString("base64")}`;
// Encode the registration calldata (resolves the registry address automatically)
const { to, data } = encodeRegisterAgent({ agentURI, chainId: 8453 });
// Submit as arbitrary transaction via Bankr API
const submitRes = await fetch("https://api.bankr.bot/agent/submit", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.BANKR_API_KEY!,
},
body: JSON.stringify({
transaction: { to, data, value: "0", chainId: 8453 },
waitForConfirmation: true,
}),
});
const result = await submitRes.json();
console.log("Transaction hash:", result.txHash);
Important: Transactions submitted via
/agent/submitare irreversible. Always verify calldata encoding and confirm the target contract address before submitting. Ensure the wallet has sufficient ETH/MATIC for gas. The endpoint handles UserOperation bundling internally for ERC-4337 smart accounts, and SIWA verification uses ERC-1271 automatically.
The authentication flow consists of two steps:
Note: The URLs below (
api.example.com) are placeholders. Replace them with your own server that implements the SIWA verification endpoints. See the Server-Side Verification skill for implementation details.
/siwa/mainnet/nonce endpoint/siwa/mainnet/verifyconst nonceRes = await fetch("https://api.example.com/siwa/mainnet/nonce", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
address: await signer.getAddress(),
agentId: 42,
agentRegistry: "eip155:8453:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
}),
});
const { nonce, nonceToken, issuedAt, expirationTime } = await nonceRes.json();
import { signSIWAMessage } from "@buildersgarden/siwa";
const { message, signature, address } = await signSIWAMessage({
domain: "api.example.com",
uri: "https://api.example.com/siwa",
agentId: 42,
agentRegistry: "eip155:8453:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432", //According to the chain
chainId: 8453,
nonce,
issuedAt,
expirationTime,
}, signer);
// Send to server for verification
const verifyRes = await fetch("https://api.example.com/siwa/mainnet/verify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ message, signature, nonceToken }),
});
const { receipt, agentId } = await verifyRes.json();
// Store the receipt for authenticated API calls
import { signAuthenticatedRequest } from "@buildersgarden/siwa/erc8128";
const request = new Request("https://api.example.com/action", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "execute" }),
});
const signedRequest = await signAuthenticatedRequest(
request,
receipt, // from SIWA sign-in
signer,
8453,
);
const response = await fetch(signedRequest);
BANKR_API_KEY=your-bankr-api-key
If your agent already uses Bankr's OpenClaw trading skill for swaps, bridges, or DeFi, this signer lets you add SIWA authentication on top — same API key, same wallet, no extra setup. Bankr's trading skill handles what your agent does; the SIWA signer handles how your agent proves who it is.