DEV Community

Hypermid
Hypermid

Posted on

Cross-chain swap in 10 lines — without signing up for anything

Most cross-chain SDKs gate "hello world" behind a signup form, an API key, and a dashboard. The reason isn't security — it's billing. You only find out after you've already lost twenty minutes you wanted to spend on your actual app.

I just shipped a swap/bridge/on-ramp SDK that flips that. Anonymous tier works out of the box. No API key required to ship. Custom partner fees are opt-in once you actually need them.

Here's a real cross-chain swap from Ethereum USDC to Base USDC in 10 lines:

import { Hypermid } from "@hypermid/sdk";

const hm = new Hypermid();                          // no signup

const quote = await hm.getQuote({
  fromChain: 1,    fromToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC ETH
  toChain:   8453, toToken:   "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC Base
  fromAmount: "1000000",                            // 1 USDC (6 decimals)
  fromAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  toAddress:   "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
});

const exec   = await hm.execute({ /* same params */ });    // returns the tx to sign
const status = await hm.getStatus({ txHash: "0x...", chainId: 1 });
Enter fullscreen mode Exit fullscreen mode

The same shape works in Python, Go, and Rust — same method names, same params, same anonymous tier. Pick whichever fits your stack:

Stack Install
TypeScript / JS npm install @hypermid/sdk
Python pip install hypermid
Go go get github.com/Hypermid/hypermid-sdk-go@v1.0.1
Rust cargo add hypermid-sdk

Why I built it this way

I run Hypermid, a routing layer that picks the best bridge/swap provider per pair across 90+ chains — EVM, Solana, Bitcoin, NEAR, Sui, Tron, TON, XRP and Doge. The routing is the interesting part. But every time I integrated us into a partner project, the first 20 minutes were:

  1. Sign up.
  2. Get an API key.
  3. Add it to the partner's secret manager.
  4. Wire it through their config.
  5. Realise the key needs a different scope.
  6. Repeat step 2.

That friction kills the demo. So anonymous tier is the default. API keys only matter when you need partner-specific things (custom fee splits, fee discounts, higher rate limits, scoped webhooks). You can ship to production on the anonymous tier — and most indie projects will.

What's in the box

  • Quote → Execute → Status — the swap pipeline. Returns the on-chain tx for EVM, or a deposit address for NEAR Intents / Bitcoin / Tron / TON / XRP / Doge.
  • getChains / getTokens — the registry. 90+ chains, growing.
  • getBalances(address) — multi-ecosystem wallet balances + USD totals in one call. Auto-detects the address ecosystem and queries the right indexers (Alchemy + Blockstream + multicall + Sui/NEAR/Tron RPC). Returns priced holdings + dust classification.
  • Webhook eventsswap.completed, onramp.completed, etc., with HMAC-SHA256 verification helpers shipped in every SDK.
  • Fiat on-ramp — RampNow integration, same SDK.
  • Built-in routing across LI.FI + NEAR Intents + Hypermid SuperSwap (our PulseChain-native route), per pair.

One trick I wish I'd learned earlier

For the TypeScript SDK I shipped a dual ESM + CJS build. Modern Next/Vite/Bun stacks are ESM-native, but a lot of partners are still on CJS — AWS Lambda's Node defaults, older Express backends. ESM-only packages give them ERR_PACKAGE_PATH_NOT_EXPORTED and you spend a day debugging.

The fix is small: two tsconfig.jsons, two dist/ subfolders, and this exports block in package.json:

{
  "exports": {
    ".": {
      "types":   "./dist/esm/index.d.ts",
      "import":  "./dist/esm/index.js",
      "require": "./dist/cjs/index.js"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Plus a dist/cjs/package.json containing {"type":"commonjs"} so Node treats those .js files as CJS even though the root says "type":"module". Both import and require work in the same package. No extra dependencies.

Try it

The packages are live now — no signup required:

Feedback / issues / "I tried it and X broke" — open an issue on any of the SDK repos and I read them all. If you build something with it I'd love to see it.

Top comments (0)