ТарифыGitHubКабинет

Public API

SDKs

Official clients sign X-Api-Key, X-Timestamp, and X-Signature for you, cover every route of the Public API with typed requests and responses, and verify webhook signatures. Create a key in the cabinet (UUID + sk_live_… secret shown once). JSON-RPC traffic still goes to each endpoint URL, not through this host.

SDKTypeScriptPythonPHPGoKotlinHMAC

← Public API

Repositories

Each language is its own GitHub repository. Star the repo you use and open issues there.

Install

Libraries are installed from GitHub (not Packagist / PyPI / npm / Maven Central yet).

Install

# TypeScript
npm install github:rpcnode/api-sdk-typescript

# Python
pip install "rpcnode @ git+https://github.com/rpcnode/api-sdk-python.git"

# PHP
composer config repositories.rpcnode-sdk vcs https://github.com/rpcnode/api-sdk-php.git
composer require rpcnode/sdk:dev-master

# Go
go get github.com/rpcnode/api-sdk-go@latest

# Kotlin / JVM (into the local Maven repository, then implementation("dev.rpcnode:rpcnode-sdk:0.2.0"))
git clone https://github.com/rpcnode/api-sdk-kotlin.git
cd api-sdk-kotlin && ./gradlew publishToMavenLocal

What the clients do

One client with a group per area: account, networks, address watches, tx watches, webhooks, realtime, payments, endpoints. Every route is a typed method; ids are the uuid / watch_id / payment_id / slug the API uses, never database ids.

A 429 is retried after Retry-After; network errors and 502/503/504 are retried for idempotent requests only, never for POST, so a payment is not created twice. Two retries by default, configurable, each with a fresh signature.

Errors carry the HTTP status, error_code, the per-field errors of a 400, and Retry-After. Fields the server does not send are absent (not null), and unknown fields or enum values never break decoding.

Each client has a signed low-level request method for routes newer than the library, and a webhook helper that checks X-RpcNode-Signature (t=…,v1=…) on the raw body.

Environment

Examples read PUBLIC_API_KEY (cabinet UUID) and PUBLIC_API_SECRET (sk_live_…). Optional PUBLIC_API_BASE sets the host; the client adds /v1 itself and signs the whole path with the query, so you pass only the host (https://api.rpcnode.dev, or a local http://127.0.0.1:3003).

Rate limits: 30 requests per second per client address and 100 requests per minute per account (all its keys together). Over a limit: HTTP 429 with Retry-After (see Authentication).

Пример запроса

import { RpcNode } from '@rpcnode/sdk'

const rpc = new RpcNode({
  apiKey: process.env.PUBLIC_API_KEY!,    // UUID
  secret: process.env.PUBLIC_API_SECRET!, // sk_live_…
  // baseUrl defaults to https://api.rpcnode.dev
})

const { plan } = await rpc.account.get()
const endpoints = await rpc.endpoints.list()
const watch = await rpc.addressWatches.add('ethereum', '0x0000000000000000000000000000000000000000')
console.log(plan, endpoints, watch)

SDK TypeScript на GitHub

Советы

  • Signing is built in — do not add X-Api-Key / X-Signature by hand unless you are calling curl.
  • Verify webhook deliveries with the helper of your library (verifyWebhookSignature and its equivalents) on the raw body, as described on the Webhooks page.
  • JSON-RPC (eth_blockNumber, etc.) uses the endpoint URL from GET /v1/endpoints (its url field) — not api.rpcnode.dev.
  • Run SDK calls on your server only. The secret signs every request and must not reach a browser or a mobile app.
  • Keep the secret out of git. The cabinet list only shows the secret prefix after create.