Bankr Dev - Sign & Submit API

v2026.09.24

This skill should be used when building apps that need to sign messages, sign typed data (EIP-712), sign transactions, or submit raw transactions via the Bankr API. Covers the synchronous /agent/sign and /agent/submit endpoints with TypeScript patterns.

GitHub
安装命令
npx skhub add bankrbot/bankr-dev-sign-submit-api
Markdown
SKILL.md

Sign & Submit API

Synchronous endpoints for signing and submitting transactions directly — no job polling required.

Endpoints

EndpointPurposeReturns
POST /agent/signSign messages, typed data, or transactionsSignature
POST /agent/submitSubmit raw transactions to chainTransaction hash

POST /agent/sign

Signature Types

TypeUse Case
personal_signPlain text messages (auth, verification)
eth_signTypedData_v4EIP-712 typed data (permits, orders)
eth_signTransactionSign transactions for later broadcast

Usage

// personal_sign
const signMessage = await fetch(`${API_URL}/agent/sign`, {
  method: "POST",
  headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    signatureType: "personal_sign",
    message: "Sign in to MyApp\nNonce: abc123",
  }),
});
// → { success: true, signature: "0x...", signer: "0x...", signatureType: "personal_sign" }

// eth_signTypedData_v4 (EIP-2612 permit)
const signPermit = await fetch(`${API_URL}/agent/sign`, {
  method: "POST",
  headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    signatureType: "eth_signTypedData_v4",
    typedData: {
      domain: { name: "USD Coin", version: "2", chainId: 8453, verifyingContract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" },
      types: {
        Permit: [
          { name: "owner", type: "address" },
          { name: "spender", type: "address" },
          { name: "value", type: "uint256" },
          { name: "nonce", type: "uint256" },
          { name: "deadline", type: "uint256" },
        ],
      },
      primaryType: "Permit",
      message: { owner: "0x...", spender: "0x...", value: "1000000", nonce: "0", deadline: "1735689600" },
    },
  }),
});

// eth_signTransaction
const signTx = await fetch(`${API_URL}/agent/sign`, {
  method: "POST",
  headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    signatureType: "eth_signTransaction",
    transaction: { to: "0x...", chainId: 8453, value: "0", data: "0xa9059cbb..." },
  }),
});

Error Responses

StatusErrorCause
400Missing required fieldMissing message, typedData, or transaction
401Authentication requiredMissing or invalid API key
403Read-only API keyKey lacks write permissions

POST /agent/submit

Transaction Fields

FieldTypeRequiredDescription
tostringYesDestination address
chainIdnumberYesChain ID (8453=Base, 1=Ethereum, 137=Polygon)
valuestringNoValue in wei
datastringNoCalldata (hex)
gasstringNoGas limit
maxFeePerGasstringNoEIP-1559 max fee
maxPriorityFeePerGasstringNoEIP-1559 priority fee

Options

FieldTypeDefaultDescription
descriptionstring—Human-readable description for logging
waitForConfirmationbooleantrueWait for on-chain confirmation

Usage

// Submit a transaction and wait for confirmation
const result = await fetch(`${API_URL}/agent/submit`, {
  method: "POST",
  headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    transaction: { to: "0x...", chainId: 8453, value: "1000000000000000000" },
    description: "Send 1 ETH",
    waitForConfirmation: true,
  }),
});
// → { success: true, transactionHash: "0x...", status: "success", blockNumber: "123", gasUsed: "21000" }

// Fire-and-forget (don't wait for confirmation)
const pending = await fetch(`${API_URL}/agent/submit`, {
  method: "POST",
  headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    transaction: { to: "0x...", chainId: 8453, value: "100000000000000000" },
    waitForConfirmation: false,
  }),
});
// → { success: true, transactionHash: "0x...", status: "pending" }

Multi-Step Workflow

// Approve + Swap sequence
async function approveAndSwap(approveTx: object, swapTx: object) {
  // 1. Approve token spending
  const approval = await submitTransaction(approveTx);
  if (approval.status !== "success") throw new Error("Approval failed");

  // 2. Execute swap
  const swap = await submitTransaction(swapTx);
  if (swap.status !== "success") throw new Error("Swap failed");

  return swap;
}

Transaction Status Values

StatusDescription
successConfirmed and succeeded
revertedConfirmed but reverted
pendingSubmitted, not yet confirmed

Comparison with /agent/prompt

Feature/agent/prompt/agent/sign/agent/submit
InputNatural languageStructured dataTransaction object
ResponseAsync (job ID)Sync (signature)Sync (tx hash)
Executes on-chainVia AI agentNoYes
Best forGeneral queriesAuth, permitsRaw transactions

Security Notes

  • /agent/submit executes immediately — no confirmation prompt
  • Read-only API keys get 403 on both endpoints
  • Always validate transaction parameters before submission
  • Use waitForConfirmation: true for critical transactions

Related Skills

  • bankr-api-basics - API fundamentals
  • bankr-client-patterns - Client setup
  • bankr-safety - Security best practices
  • bankr-arbitrary-transaction - Constructing raw transaction JSON
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

MIT

源路径

bankr-agent-dev/skills/bankr-sign-submit-api

默认分支

main

最新提交

67d33d4

Tree SHA

76943a8