Skip to content

realmint-io/realmint-sdk-example

Repository files navigation

Realmint SDK example

A minimal reference wallet integration built on @realmint/sdk: list tokenized RWAs, quote, buy, and sell — non-custodial, the user's injected wallet signs. React + Vite + viem.

Run locally

npm install
VITE_BASE=/ npm run dev

Open the app, paste a Realmint API key, click Load assets, Connect wallet, then Quote / Buy / Sell. (Get a key from the Realmint team.)

Smoke test (no wallet)

Exercises the SDK against the live API — list + score + a quote:

REALMINT_API_KEY=rk_live_... npm run smoke

What it shows

import { RealmintClient, signerFromEip1193 } from "@realmint/sdk";

const client = new RealmintClient({ apiKey });

// list
const assets = await client.listAssets({ roots: true });

// buy — create → prepare → sign UserOp → submit → execute → poll
const sign = signerFromEip1193(window.ethereum, userAddress);
const bought = await client.buy(
  { asset_id: "paxg", source_token: "USDC", amount_in: 25, agent_wallet: userAddress },
  sign,
);

// sell an EVM asset — zero signatures
await client.sellEvm({ asset_id: "paxg", source_token: "USDC", amount_in: 0.01, agent_wallet: userAddress });

Fund a user over x402 with fundWithX402, and sell Solana assets with sellSolana — see the SDK README and the API docs.

Deploy

Pushing to main builds and deploys to GitHub Pages (.github/workflows/pages.yml). The API key is entered in the UI, so no secret is baked into the bundle.

About

Reference wallet integration for @realmint/sdk — list, buy & sell tokenized RWAs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors