Skip to main content
You’re viewing the 2.0 (LTS) docs. View the current 3.0 version of this page.
@getpara/rest-sdk is Para’s typed SDK for REST API wallets. Use it from trusted backend code when your server owns API-key-backed wallet creation, lookup, signing, transfers, and transaction history.
This SDK sends your partner API key as X-API-Key. Never import it from browser, React, mobile, wagmi, RainbowKit, or any user-controlled runtime.

Install

The core client works in Node.js 18+ or any server runtime where you inject fetch. Install adapter peers only when you use those subpaths:

Choose the Right SDK

Core Client

env accepts PROD, BETA, or { baseUrl }. Each request sends X-API-Key and X-Request-Id. Idempotency-Key is caller-supplied; the SDK does not retry requests or generate idempotency keys internally. Pass AbortSignal per call when your server needs a request deadline:

Wallet type boundaries

The core client uses the same lifecycle methods for every supported wallet type. Pass EVM, COSMOS, SOLANA, STELLAR, or SUI to createWallet(); later methods infer the chain from the wallet ID. See Wallet Lifecycle by Wallet Type for creation examples, Sign Messages by Wallet Type for message payloads, and Transaction Signing by Wallet Type for transaction and raw-byte payloads.
The Sui transaction-signing route returns signature and transaction, but the SDK’s generic signTransaction() TypeScript response currently declares signedTransaction, txHash, and transactionId. Use the REST route directly when TypeScript code needs the Sui response fields.

Adapters

Adapters are convenience layers, not separate wallet APIs. REST and session-backed signing use different packages: The session-backed packages use an authenticated Para session. They are not REST adapters. For EVM, string messages use signMessage() and typed data uses signTypedData(), so Para performs the EIP-191 or EIP-712 hash. Byte-like messages are EIP-191 hashed locally by both adapters and sent through signRaw(). In viem, a 0x... string is text; pass { raw: bytes } when it represents bytes. Both EVM adapters support ordinary legacy and EIP-1559 transaction sends. They reject contract deployments, access lists, blob transactions, and authorization-list transactions before calling REST. The Viem adapter also rejects custom transaction serializers. Only the Viem REST account exposes signAuthorization() for EIP-7702. Ethers callers use para.signAuthorization() directly. The Solana adapter implements Solana v2 signer traits by signing message bytes through sign-raw. For broadcasted transactions, call para.signTransaction(walletId, { transaction, broadcast: true }) or para.transfer(...).

Errors

ParaRestValidationError is thrown before fetch for missing local required fields or unsupported adapter inputs. ParaRestSerializationError means the request body cannot be JSON serialized. HTTP errors become ParaRestError with status, code, requestId, and parsed body.

Example

The typed SDK example creates REST wallets and demonstrates core client, ethers, viem, and Solana adapters:
Use examples-hub/server/rest-with-node when you want to inspect the raw HTTP baseline.

Trust Boundary

REST signing uses the wallet ID and your partner API key. Your backend is responsible for deciding which end user or job is allowed to request a wallet operation before calling Para. The SDK validates local required fields and normalizes adapter inputs, but it does not independently reconstruct or audit every signed transaction returned by REST.

Non-goals

The REST SDK does not include browser connectors, React hooks, wagmi or RainbowKit integration, mobile auth, hosted UI, client-side sessions, automatic retries, or user-share encryption helpers. Use @getpara/server-sdk for migrateWalletShare() and share-backed server flows.