Guardian SDK · @maranilabs/guardian

Won't
credit?
Won't
send.

Stop your users from sending tokens that a centralized exchange won't credit. The guardian checks the exact token before the money leaves. When the exchange won't credit it, the verdict is a block. Some blocks name the token to swap into and send instead. Where an exchange lists tokens only by name, a missing one is usually a warning.

A hosted API and a dependency-free client. Call it from your backend.

  • Exchanges covered
  • Binance
  • Coinbase
  • KuCoin
  • Bitget
  • HTX
  • Gate
  • Kraken
  • OKX
  • Bybit
  • MEXC
  • Bitstamp
  • Bitvavo
  • Bithumb
  • WhiteBIT
  • HashKey
  • Paribu
  • Bit2Me
  • Foxbit
  • VALR
  • Swyftx
  • Independent Reserve
  • Young Platform
  • ZebPay
  • Binance TH
  • Orbix
  • Busha
  • AltCoinTrader
  • Digital X
  • MAX
  • Bitfinex

What it does

What it tells your wallet.

Send check

Will the exchange credit this token?

Before a send to an exchange, find out whether it accepts this exact Solana token. Covers Token-2022 tokens and deposits that are currently suspended. The answer is block, warn, ok or ask, with a sentence ready to show.

Block

Binance doesn't accept USDG on Solana. If you send it, it won't be credited.

swapTo: USDC

Exchange badges

"This is Binance" the moment an address is pasted.

A known exchange wallet answers in under about 150 ms. Any other address means reading its on-chain history, up to about 2 s. A used deposit address is recognised when its recent transactions show a sweep we can tie to an exchange; otherwise your user names the exchange.

{ "exchange": "binance", "addressType": "deposit" }

Delisting notices

Delistings, matched on the device.

Exchanges' announced delistings of Solana tokens, each pinned to an exact mint. Fetch the list hourly and match it against your user's holdings locally. Holdings never reach us.

{ exchange, symbol, mint, kind, effectiveAt, announcedAt, sourceUrl }

kind: delist, deposit-suspend or withdraw-deadline. Sources today: Binance, OKX, Bybit, KuCoin, HTX, VALR and Bitvavo, polled hourly, and Bitget and Digital X, daily.

Hosted API, tiny client
The guardian runs as a hosted API. The client is dependency-free and needs only fetch: Node 18+, browsers, React Native. ES modules.
Called from your backend
Any key shipped inside an extension or app can be extracted. Your wallet calls your backend, and your backend calls the guardian.
Fails open
A timeout, a 429 or a 5xx comes back as unavailable. Say "couldn't check", and never block on it. The default timeout is 4 s.
Minimal data
Each check sends the recipient address and the mint. Optionally a symbol, and the user's answer after an ask. Never the sender, the amount or the user's IP. No request logs with addresses.

Quickstart

Three calls.

Create the client in your backend. Then a badge when the address is pasted, a verdict when the token is chosen, and the delisting list on a timer.

import { createGuardian, isUnavailable, matchDelistings } from '@maranilabs/guardian';

const guardian = createGuardian({ apiKey: process.env.GUARDIAN_KEY! });
// calls https://api.maranilabs.com

// 1. The address is pasted: show a badge.
const badge = await guardian.address(to);

// 2. The token is chosen: get the verdict.
const verdict = await guardian.check({ to, mint, symbol });
if (isUnavailable(verdict)) {
  // We couldn't check in time. Say so, and never block on it.
} else {
  show(verdict.level, verdict.message);
  // e.g. "block", "Binance doesn't accept USDG on Solana. …"
  if (verdict.level === 'block') {
    // Disable Send. If verdict.swapTo is set, offer
    // "Swap to {swapTo.symbol} and send" instead.
  }
}

// 3. Delistings, e.g. hourly: fetch the whole list and match it locally.
const list = await guardian.delistings();
if (!isUnavailable(list)) {
  const affected = matchDelistings(list.notices, heldMints);
}
The address is pasted
address(to)
A badge for the recipient. Under about 150 ms for a known exchange wallet, up to about 2 s for any other address.
The token is chosen
check({ to, mint, symbol })
The verdict. Pass the token's mint, or "SOL" for native SOL.
Before signing
check(…) again
Only if the recipient or the token changed.
Hourly, or on wallet open
delistings(), then matchDelistings(…)
The list is small. Matching runs on the device.
// the answer
{
  "level": "block",
  "code": "CEX_TOKEN_NOT_LISTED",
  "message": "Binance doesn't accept USDG on Solana. If you send it, it won't be credited.",
  "exchange": "binance",
  "swapTo": { "symbol": "USDC", "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" },
  "notes": [
    { "level": "warn", "code": "TOKEN2022_EXCHANGE_CREDIT", "message": "…" },
    { "level": "info", "code": "TOKEN2022_PERMANENT_DELEGATE", "message": "…" }
  ]
}

Skip the call for sends to the user's own address. Solana mainnet only. New codes and exchanges may be added: if you get one that isn't documented, show the message and act on the level.

Read the docs

First use case

The SDK, in a real wallet.

The Marani wallet is a Solana Chrome extension built on these checks. Paste a Binance deposit address, choose USDG, and the send is blocked before the money leaves. One tap swaps to USDC and sends that instead.

Try it: switch between USDG and SOL, change the amount, then send.

Send Solana

A simulation. Nothing is signed or sent.

Request access

Not public yet.

The same checks run in the Marani wallet today. There is no signup. If you build a Solana wallet, exchange or app and want the check behind your send button, ask for a key.

Request access hello@maranilabs.com

Warn, never guarantee. The guardian reduces lost deposits; it cannot promise an exchange's crediting.