Getting Started

Getting Started

Install Zedkr, create a client with your provider, and send a gasless transaction in under a minute.

  • Node.js 18+ or a modern browser with MetaMask
  • A wallet with tokens (USDT, FXRP, or WC2FLR)
  • One-time token approval, after that, zero FLR forever

Step 1 - Install

bash
npm install zedkr ethers

Step 2 - Create a client

Pass your provider. The relayer URL and router address are baked in, no extra config.

typescript
import { Zedkr } from "zedkr";
import { ethers } from "ethers";

// Browser (MetaMask / any EIP-1193 wallet)
const provider = new ethers.BrowserProvider(window.ethereum);

// Node.js / scripts
const provider = new ethers.JsonRpcProvider("https://coston2-api.flare.network/ext/bc/C/rpc");

const client = await Zedkr.create({ provider });

Step 3 - One-time token approval

Approve once per token. This is the only transaction that requires FLR gas. Every transaction after this is completely gasless.

typescript
import { ethers } from "ethers";

const USDT   = "0xC1A5B41512496B80903D1f32d6dEa3a73212E71F";
const ROUTER = (await client.getConfig()).routerAddress;

const usdt = new ethers.Contract(USDT, ["function approve(address,uint256)"], signer);
await usdt.approve(ROUTER, ethers.MaxUint256);
Note
Tokens with EIP-2612 permit support skip this step entirely, the SDK handles it automatically.

Step 4 - Send your first transaction

typescript
import { Zedkr } from "zedkr";
const client = await Zedkr.create({ provider });
const result = await client.transfer(signer, "0xRecipient", "0xToken", "10", 6);
console.log("txHash:", result.txHash);
console.log("status:", result.status); // "success" | "failed"
Tip
That's it. Same 5-line pattern works for every transaction type, transfers, swaps, and contract calls.