← 返回 Skills 市场
sprintmint

cpbox-batch-balance

作者 springmint · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
173
总下载
2
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cpbox-batch-balance
功能描述
Guide users on how to use the Batch EVM Address Balance Query API (/api/x402/batch-balance). Use when users ask about batch balance queries, multicall balanc...
使用说明 (SKILL.md)

Batch EVM Address Balance Query API

Batch query EVM address balances via Multicall3, with pay-per-use powered by x402 protocol.

Prerequisites: This skill requires x402-payment. Complete the setup steps before first use.

Service URLs

Role Domain
API Provider https://www.cpbox.io
Facilitator https://www.cppay.finance

Endpoint

POST /api/x402/batch-balance
Content-Type: application/json

Payment Flow (x402 Protocol)

This endpoint uses HTTP 402 Payment Required. The three-step flow:

  1. First request (no payment header) -> Server returns 402 with payment requirements JSON
  2. Client signs the payment requirements using EIP-712 -> Produces a PAYMENT-SIGNATURE
  3. Retry with PAYMENT-SIGNATURE header -> Server verifies, settles, returns result JSON

When using @springmint/x402-payment (Node.js) or x402-sdk-go (Go), all 3 steps happen automatically.

Using with x402-payment

CLI (AI Agent)

npx @springmint/x402-payment \
  --url https://www.cpbox.io/api/x402/batch-balance \
  --method POST \
  --input '{"chain":"ethereum","token":"","addresses":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","0xBE0eB53F46cd790Cd13851d5EFf43D12404d33E8"]}'

Library (Node.js)

import { createX402FetchClient } from "@springmint/x402-payment";

const client = await createX402FetchClient();
const response = await client.request(
  "https://www.cpbox.io/api/x402/batch-balance",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      chain: "ethereum",
      token: "",
      addresses: [
        "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        "0xBE0eB53F46cd790Cd13851d5EFf43D12404d33E8",
      ],
    }),
  },
);
const data = await response.json();

Request Parameters

Parameter Type Required Description
chain string Yes Chain name: ethereum, bsc, sepolia, etc.
token string No ERC-20 contract address. Empty = native token (ETH/BNB)
addresses []string Yes Array of EVM addresses to query. Max 10,000. Must be 0x-prefixed, 42 chars.

Request Body Example

{
  "chain": "ethereum",
  "token": "",
  "addresses": [
    "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "0xBE0eB53F46cd790Cd13851d5EFf43D12404d33E8"
  ]
}

Response

JSON with data array:

{
  "data": [
    {"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "balance": "1500000000000000000", "error": ""},
    {"address": "0xBE0eB53F46cd790Cd13851d5EFf43D12404d33E8", "balance": "25000000000000000000", "error": ""}
  ]
}

balance is in smallest unit (wei). Divide by 10^decimals for human-readable value.

Go Example (Automatic Payment)

package main

import (
    "bytes"
    "context"
    "encoding/json"
    "fmt"
    "net/http"

    x402 "github.com/springmint/x402-sdk-go"
    "github.com/springmint/x402-sdk-go/mechanisms"
    "github.com/springmint/x402-sdk-go/signers"
)

func main() {
    signer := signers.NewEvmClientSigner("YOUR_PRIVATE_KEY_HEX")
    xClient := x402.NewX402Client()
    xClient.Register("eip155:*", &mechanisms.Permit402EvmClientMechanism{Signer: signer})
    xHttp := x402.NewX402HTTPClient(http.DefaultClient, xClient)

    reqBody := map[string]interface{}{
        "chain": "ethereum",
        "token": "",
        "addresses": []string{
            "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            "0xBE0eB53F46cd790Cd13851d5EFf43D12404d33E8",
        },
    }
    bodyBytes, _ := json.Marshal(reqBody)

    resp, err := xHttp.RequestWithPayment(context.Background(), "POST",
        "https://www.cpbox.io/api/x402/batch-balance",
        string(bodyBytes),
        map[string]string{"Content-Type": "application/json"},
    )
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    var result struct {
        Data []struct {
            Address string `json:"address"`
            Balance string `json:"balance"`
            Error   string `json:"error"`
        } `json:"data"`
    }
    json.NewDecoder(resp.Body).Decode(&result)
    fmt.Printf("Done! Got %d results\
", len(result.Data))
}

cURL Example (Manual Two-Step)

Step 1 - Get payment requirements:

curl -X POST https://www.cpbox.io/api/x402/batch-balance \
  -H "Content-Type: application/json" \
  -d '{"chain":"ethereum","token":"","addresses":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"]}'
# Returns HTTP 402 with payment requirements JSON

Step 2 - Pay and get result:

curl -X POST https://www.cpbox.io/api/x402/batch-balance \
  -H "Content-Type: application/json" \
  -H "PAYMENT-SIGNATURE: BASE64_ENCODED_SIGNED_PAYLOAD" \
  -d '{"chain":"ethereum","token":"","addresses":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"]}'

ERC-20 Token Example

Query USDT balances on BSC:

curl -X POST https://www.cpbox.io/api/x402/batch-balance \
  -H "Content-Type: application/json" \
  -H "PAYMENT-SIGNATURE: ..." \
  -d '{
    "chain": "bsc",
    "token": "0x55d398326f99059fF775485246999027B3197955",
    "addresses": ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"]
  }'

Error Codes

HTTP Code Meaning
400 Bad request: missing addresses, no valid addresses, or >10,000 addresses
402 Payment required (first-time request, includes payment requirements)
500 Server error (RPC call failure)

Pricing

Each API call costs 0.0001 USDT (paid automatically via x402 protocol, supports BSC and TRON).

Supported Chains

Any EVM chain configured in the platform.

安全使用建议
This skill appears to document a legitimate paid batch-balance API, but be cautious before using it. Key points to consider: - Do not paste or store your main private keys directly into examples or into an agent; prefer a hardware wallet, ephemeral signing key, or a signing service with minimal funds/permissions. - The SKILL.md expects you to run third‑party packages (npx @springmint/x402-payment or go SDK). Verify the package authors, check the package version, and review the code or use a pinned release before running npx or installing dependencies. - Confirm the API domains (https://www.cpbox.io and https://www.cppay.finance) are the real services you expect and review their docs/privacy/payout behavior. - The skill does not declare required secrets or a safe method for signing; ask the skill author to explicitly list required credentials, recommended secure signing options, and an install spec (pinned package versions) before using in production. If you only need read-only balances and want to avoid payment/signing complexity, ask the provider if a free tier or alternative endpoint exists that doesn’t require on‑chain payment signatures.
功能分析
Type: OpenClaw Skill Name: cpbox-batch-balance Version: 1.0.0 The skill bundle (SKILL.md, _meta.json) serves as a documentation and integration guide for the CPBox Batch EVM Address Balance Query API. It provides instructions on using the x402 payment protocol for pay-per-use API access, including code examples for Node.js, Go, and CLI. No evidence of malicious intent, data exfiltration, or harmful prompt injection was found; the inclusion of private key placeholders in code examples is standard practice for blockchain-related development documentation.
能力评估
Purpose & Capability
The name/description describe a batch EVM balance API and the SKILL.md provides endpoints, request/response formats, and examples that align with that purpose. The declared dependency (@springmint/x402-payment) is relevant to the x402 payment flow described.
Instruction Scope
Runtime instructions include examples that require signing payments (EIP-712) and show embedding a private key string (YOUR_PRIVATE_KEY_HEX) in code. The skill also references a relative README path (../README.md#prerequisites) which may not exist in the runtime environment. The instructions tell the agent/user to contact external endpoints (https://www.cpbox.io and https://www.cppay.finance) — expected for this API but worth noting because signing will interact with external pay endpoints.
Install Mechanism
There is no install spec in the registry (instruction-only), but the SKILL.md uses npx @springmint/x402-payment and links to GitHub for SDKs. That implies the agent or user will fetch and execute third‑party packages at runtime (npm or go modules). Fetching packages on demand is a moderate risk if the package or its dependencies are untrusted; the absence of an explicit install spec or pinned release reduces traceability.
Credentials
The skill does not declare required environment variables, yet examples require a private key (signer.NewEvmClientSigner("YOUR_PRIVATE_KEY_HEX")). Asking users/agents to provide raw private keys or to sign payments is high sensitivity. The skill should explicitly declare what credentials are needed and how to supply them safely (e.g., hardware wallet or signing server).
Persistence & Privilege
The skill is not always-enabled and does not request system-level persistence or modify other skills. Autonomous invocation is allowed by default but not combined with other elevated privileges here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cpbox-batch-balance
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cpbox-batch-balance 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial publish
元数据
Slug cpbox-batch-balance
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

cpbox-batch-balance 是什么?

Guide users on how to use the Batch EVM Address Balance Query API (/api/x402/batch-balance). Use when users ask about batch balance queries, multicall balanc... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 173 次。

如何安装 cpbox-batch-balance?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cpbox-batch-balance」即可一键安装,无需额外配置。

cpbox-batch-balance 是免费的吗?

是的,cpbox-batch-balance 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

cpbox-batch-balance 支持哪些平台?

cpbox-batch-balance 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 cpbox-batch-balance?

由 springmint(@sprintmint)开发并维护,当前版本 v1.0.0。

💬 留言讨论