Developers

Build on Velia rails — Send and Escrow on Base, with $SYNC-powered fees & tiers.

Quick start

# viem + wagmi + RainbowKit
npm i viem wagmi @rainbow-me/rainbowkit

# Velia app SDK (planned)
// npm i @velia/protocol

Use our example hooks for now: usePaymentRouter, useEscrowWrite, useEscrowRead.

Networks

  • Base — chainId 8453
  • Base Sepolia — chainId 84532 (test)

Escrow ABI (minimal)

import { EscrowABI } from "@/lib/abi/Escrow";

read:  viewEscrow(bytes32 escrowId) -> (maker, taker, token, amount, deadline, status)
write: createEscrow(address counterparty, address token, uint256 amount, uint256 deadline)
write: release(bytes32 escrowId)
write: refund(bytes32 escrowId)

Router ABI (minimal)

import { RouterABI } from "@/lib/abi/Router";

write: send(address token, address to, uint256 amount, string memo) -> bytes32 txId

viem read

import { createPublicClient, http } from "viem";
import { base } from "viem/chains";
import { EscrowABI } from "@/lib/abi/Escrow";

const client = createPublicClient({ chain: base, transport: http() });
const escrow = await client.readContract({
  address: "0xEscrow…",
  abi: EscrowABI,
  functionName: "viewEscrow",
  args: ["0x…escrowId"],
});

viem write (wagmi)

import { useWriteContract } from "wagmi";
import { RouterABI } from "@/lib/abi/Router";

const { writeContractAsync } = useWriteContract();
const hash = await writeContractAsync({
  address: "0xRouter…",
  abi: RouterABI,
  functionName: "send",
  args: ["0xUSDC…", "0xTO…", 20n * 10n**6n, "memo"],
});

REST helpers (app endpoints)

GET /api/tx           # recent activity (mock)
GET /api/escrow        # list escrows (mock)
POST /api/escrow       # create escrow (mock)
GET /api/resolve?q=... # resolve @handle / ENS / 0x to address

Replace with onchain-indexed data or your own service when contracts go live.