Skip to main content

Quick Start

Deploy an ERC-20 token on Polygon Amoy testnet in 5 minutes.

Prerequisites

1. Register

curl -X POST https://api.urblock.io/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "dev@example.com",
"password": "SecurePass1",
"company_name": "My Company",
"full_name": "Jane Developer"
}'

Response:

{
"object": "auth",
"access_token": "eyJ...",
"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2...",
"token_type": "bearer",
"expires_in": 3600,
"tenant": {
"object": "tenant",
"id": "ten_xyz456",
"company_name": "My Company",
"created": 1709740800
},
"user": {
"object": "user",
"id": "usr_abc123",
"email": "dev@example.com",
"full_name": "Jane Developer",
"role": "owner"
}
}

2. Create an API Key

curl -X POST https://api.urblock.io/v1/api_keys \
-H "Authorization: Bearer eyJ..." \
-H "Content-Type: application/json" \
-d '{
"name": "My Test Key",
"environment": "test"
}'

Response (save the secret — it is shown only once):

{
"object": "api_key",
"id": "key_abc123",
"name": "My Test Key",
"secret": "sk_test_abc123...",
"publishable": "pk_test_abc123...",
"environment": "test",
"created": 1709740800,
"last_used": null
}

3. Use the Primary Connect Account

New tenants operate with Connect smart accounts rather than custodial HD wallets.

  • Dashboard users can finish setup from the Connect page.
  • API integrations should manage smart accounts through /v1/connect/accounts.

4. Deploy a Token

curl -X POST https://api.urblock.io/v1/tokens \
-H "Authorization: Bearer sk_test_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "My Token",
"symbol": "MTK",
"standard": "ERC20",
"network": "polygon_amoy",
"initial_supply": "1000000000000000000000",
"decimals": 18,
"features": {
"mintable": true,
"burnable": true,
"pausable": false
}
}'

Response:

{
"object": "token",
"id": "tok_abc123",
"name": "My Token",
"symbol": "MTK",
"standard": "ERC20",
"network": "polygon_amoy",
"status": "deploying",
"created": 1709740800
}

The token deploys asynchronously. Poll GET /v1/tokens/tok_abc123 or use webhooks to know when status changes to "deployed".

5. Mint Tokens

Once deployed, mint tokens to an address:

curl -X POST https://api.urblock.io/v1/tokens/tok_abc123/mint \
-H "Authorization: Bearer sk_test_abc123..." \
-H "Content-Type: application/json" \
-d '{
"to": "0x1234567890abcdef1234567890abcdef12345678",
"amount": "500000000000000000000",
"idempotency_key": "mint-001"
}'

6. Check Balance

curl https://api.urblock.io/v1/tokens/tok_abc123/balance?address=0x1234...&nft_token_id=0 \
-H "Authorization: Bearer sk_test_abc123..."

Note: The nft_token_id parameter is required for all token types. Use "0" for ERC-20 tokens.

Using the SDK

import { Urblock } from "@urblock/sdk";

const urblock = new Urblock("sk_test_abc123...");

// Deploy token
const token = await urblock.tokens.create({
name: "My Token",
symbol: "MTK",
standard: "ERC20",
network: "polygon_amoy",
initial_supply: "1000000000000000000000",
decimals: 18,
features: { mintable: true, burnable: true },
});

// Mint
const tx = await urblock.transactions.mint(token.id, {
to: "0x1234567890abcdef1234567890abcdef12345678",
amount: "500000000000000000000",
});

// Check balance
const balance = await urblock.tokens.getBalance(token.id, {
address: "0x1234567890abcdef1234567890abcdef12345678",
nft_token_id: "0",
});

Next Steps