Installation
The official Urblock TypeScript SDK for Node.js and modern runtimes.
Requirements
- Node.js ≥ 18.0.0 (uses native
fetch) - TypeScript ≥ 5.0 (recommended)
Install
# npm
npm install @urblock/sdk
# pnpm
pnpm add @urblock/sdk
# yarn
yarn add @urblock/sdk
Quick Setup
import { Urblock } from "@urblock/sdk";
const urblock = new Urblock("sk_test_...");
// Deploy an ERC-20 token
const token = await urblock.tokens.create({
name: "My Token",
symbol: "MTK",
standard: "ERC20",
network: "polygon_amoy",
initial_supply: "1000000000000000000000000",
idempotency_key: "deploy-mtk-001",
});
console.log(token.id); // tok_...
console.log(token.status); // "deploying"
Environments
| Key prefix | Environment | Networks |
|---|---|---|
sk_test_ | Test | Polygon Amoy (testnet) |
sk_live_ | Live | Polygon PoS (mainnet) |
pk_test_ | Test (read-only) | Polygon Amoy |
pk_live_ | Live (read-only) | Polygon PoS |
Use sk_test_ keys during development. Switch to sk_live_ for production.
Module Formats
The SDK ships with dual builds:
| Format | Entry point |
|---|---|
| ESM | @urblock/sdk (import) |
| CommonJS | @urblock/sdk (require) |
TypeScript type declarations are included in both formats.
Zero Dependencies
The SDK has zero runtime dependencies. It uses the native fetch API available in Node.js 18+ and all modern browsers/runtimes (Deno, Bun, Cloudflare Workers).
Next Steps
- Client Configuration — customize base URL, timeout, and headers
- Error Handling — handle API errors gracefully
- API Reference — explore all available endpoints