Loading...
Loading...
End-to-end Radius Network development playbook. Stablecoin-native EVM with sub-second finality and 2.8M+ TPS. Uses plain viem (defineChain, createPublicClient, createWalletClient) for all TypeScript integration. wagmi for React wallet integration. Foundry for smart contract development and testing. Covers micropayment patterns (pay-per-visit content, real-time API metering, streaming payments), x402 protocol integration, stablecoin-native fees via Turnstile, ERC-20 operations, event watching, production gotchas, and EVM compatibility differences from Ethereum.
npx skill4agent add radiustechsystems/radius-dev-skill radius-devdefineChainfees.estimateFeesPerGas()createPublicClientcreateWalletClientwatchContractEventgetLogswatchBlockNumber@radiustechsystems/sdkdefineChaincreateConfiginjected()useAccountuseConnectuseSendTransactionuseWaitForTransactionReceiptforge createforge scriptcast callcast send| Setting | Testnet | Mainnet |
|---|---|---|
| Chain ID | | |
| RPC | | |
| Native currency | RUSD (18 decimals) | RUSD (18 decimals) |
| SBC token (ERC-20) | — | |
| Explorer | | |
| Faucet | | Not available |
| Transaction cost API | | |
9.85998816e-10eth_gasPriceeth_maxPriorityFeePerGas0x0fees.estimateFeesPerGas()import { defineChain } from 'viem';
export const radiusTestnet = defineChain({
id: 72344,
name: 'Radius Testnet',
nativeCurrency: { decimals: 18, name: 'RUSD', symbol: 'RUSD' },
rpcUrls: { default: { http: ['https://rpc.testnet.radiustech.xyz'] } },
blockExplorers: {
default: { name: 'Radius Explorer', url: 'https://testnet.radiustech.xyz' },
},
fees: {
async estimateFeesPerGas() {
const res = await fetch(
'https://testnet.radiustech.xyz/api/v1/network/transaction-cost'
);
const { gas_price_wei } = await res.json();
return { gasPrice: BigInt(gas_price_wei) };
},
},
});
export const radiusMainnet = defineChain({
id: 723,
name: 'Radius Network',
nativeCurrency: { decimals: 18, name: 'RUSD', symbol: 'RUSD' },
rpcUrls: { default: { http: ['https://rpc.radiustech.xyz'] } },
blockExplorers: {
default: { name: 'Radius Explorer', url: 'https://network.radiustech.xyz' },
},
fees: {
async estimateFeesPerGas() {
const res = await fetch(
'https://network.radiustech.xyz/api/v1/network/transaction-cost'
);
const { gas_price_wei } = await res.json();
return { gasPrice: BigInt(gas_price_wei) };
},
},
});| Feature | Ethereum | Radius |
|---|---|---|
| Fee model | Market-based ETH gas bids | Fixed ~0.0001 USD via Turnstile |
| Settlement | ~12 minutes (12+ confirmations) | Sub-second (~500ms finality) |
| Failed txs | Charge gas even if reverted | Charge only on success |
| Required token | Must hold ETH for gas | Stablecoins only (USD) |
| Reorgs | Possible | Impossible |
| Market rate | Fixed gas price (~986M wei) |
| Suggested priority fee | Always |
| Native ETH balance | Native + convertible USD balance |
| Monotonic block height | Current timestamp in milliseconds |
| Block hash | Hash of block header | Equals block number (timestamp-based) |
| Position in block | Can be |
| SBC decimals | — | 6 decimals (NOT 18) |
// DON'T — native balance behaves differently on Radius
require(address(this).balance > 0);
// DO — use ERC-20 balance instead
require(IERC20(feeToken).balanceOf(address(this)) > 0);import { parseUnits, formatUnits } from 'viem';
// CORRECT
const amount = parseUnits('1.0', 6); // 1_000_000n
const display = formatUnits(balance, 6); // "1.0"
// WRONG — this is the most common mistake
const wrong = parseUnits('1.0', 18); // 1_000_000_000_000_000_000n (1e12x too large!)defineChaincreatePublicClientcreateWalletClientdefineChainforgecastdefineChainfees.estimateFeesPerGas()createPublicClientcreateWalletClientparseUnits(amount, 6)parseEtherparseEther{ name: "SBC", version: "1" }forge testhttps://testnet.radiustech.xyz/testnet/faucetcast code <address> --rpc-url https://rpc.testnet.radiustech.xyz