Skip to main content

Installation

Current published release: @grantex/sdk@0.4.1 (verified August 30, 2026).
The unpinned npm install @grantex/sdk command follows npm’s current latest tag. Keep the exact version above in reproducible builds. See Release Status before upgrading.
SDK 0.4.1 includes PrepaidWalletAgentClient and PrincipalPrepaidWalletClient. External custody remains fail-closed until a self-hosting operator supplies and verifies a provider adapter. See x402 Prepaid Wallets.

Requirements

  • Node.js 18+ (uses native fetch and crypto)
  • ESM only — the package ships as "type": "module" with TypeScript NodeNext resolution

Configuration

Options

string
required
Your Grantex API key. Falls back to the GRANTEX_API_KEY environment variable if omitted.
string
default:"https://api.grantex.dev"
Base URL for the Grantex API. Override for self-hosted or local development.
number
default:"30000"
Request timeout in milliseconds. The SDK uses AbortController to enforce the deadline.

Quick start

The complete authorization flow in one script:

Available resources

The Grantex client exposes the following sub-clients:

Standalone exports

These functions can be used without instantiating a Grantex client:

Error handling

All errors extend GrantexError. See the Error Handling reference for the full hierarchy and usage patterns.

Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.
Last modified on August 30, 2026