Official Node.js / TypeScript client for the RpcNode Public API: dedicated fullnode RPC (Ethereum, Solana, Bitcoin, Tron, BNB Chain, Polygon, Arbitrum, Optimism, Base, and more), HMAC-signed merchant HTTP, address watch webhooks, and crypto payments.
API: https://api.rpcnode.dev
Repo: github.com/rpcnode/api-sdk-typescript
npm install github:rpcnode/api-sdk-typescript
# or:
git clone git@github.com:rpcnode/api-sdk-typescript.git
cd api-sdk-typescript && npm install && npm run buildEvery request is HMAC-signed. Query string is not part of the signature.
| Header | Value |
|---|---|
X-Api-Key |
Key prefix (pk_live_…) |
X-Timestamp |
Unix seconds (±300s) |
X-Signature |
hex(hmac_sha256(secret, canonical)) |
{timestamp}\n{METHOD}\n{path}\n{sha256_hex(body)}
Empty body → SHA-256 of "". Headers are added by the client.
import { RpcNodeClient } from '@rpcnode/sdk'
const client = new RpcNodeClient({
baseUrl: process.env.PUBLIC_API_BASE ?? 'https://api.rpcnode.dev',
apiKey: process.env.PUBLIC_API_KEY!, // pk_live_…
secret: process.env.PUBLIC_API_SECRET!, // sk_live_…
})
const account = await client.getAccount()
const tokens = await client.listNetworkTokens({
network_slug: 'tron-nile',
include_native: true,
})| Client | HTTP |
|---|---|
getAccount() |
GET /v1/account |
getAccountUsage(days?) |
GET /v1/account/usage |
listEndpoints() |
GET /v1/endpoints |
listAvailableNetworks() |
GET /v1/endpoints/available-networks |
getWorkspaceUsage(days?) |
GET /v1/endpoints/usage |
createEndpoint(body) |
POST /v1/endpoints |
getEndpointUsage(id, days?) |
GET /v1/endpoints/{id}/usage |
updateEndpointStatus(id, status) |
PATCH /v1/endpoints/{id}/status |
updateEndpointAllowedIps(id, ips) |
PATCH /v1/endpoints/{id}/allowed-ips |
getAddressWatchAccount() |
GET /v1/address-watch/account |
listAddresses(params?) |
GET /v1/address-watch/addresses |
addAddress(body) |
POST /v1/address-watch/addresses |
deleteAddress(watchId) |
DELETE /v1/address-watch/addresses |
listEvents(params?) |
GET /v1/address-watch/events |
getWebhook() |
GET /v1/address-watch/webhook |
setWebhook(body) |
PUT /v1/address-watch/webhook |
listPayments(params?) |
GET /v1/payments |
createPayment(body) |
POST /v1/payments |
getPayment(paymentId) |
GET /v1/payments/{id} |
getPaymentByOrderId(orderId) |
GET /v1/payments/orders/{orderId} |
listNetworkTokens({ network_slug, include_native? }) |
GET /v1/network-tokens |
cp .env.example .env # PUBLIC_API_KEY + PUBLIC_API_SECRET for live smokes
npm testHMAC unit tests run without credentials. Live reads use .env or the environment. Writes: PUBLIC_API_SMOKE_MUTATE=1, PUBLIC_API_SMOKE_CREATE_PAYMENT=1.
MIT