justi.fun
§02 · Start

Quickstart

Launch a coin in about ten lines with the SDK or with curl.

Install

npm install @justifun/sdk

No key is needed. Node 18+, browsers, Bun, Deno and edge runtimes all work. If @justifun/sdk is not on npm yet in your region, use justi-sdk: same code.

Launch with the SDK

launch.ts
import { Justi, keypairSigner } from "@justifun/sdk";
import { readFileSync } from "node:fs";

const justi = new Justi();
const wallet = keypairSigner(JSON.parse(readFileSync("wallet.json", "utf8")));

const coin = await justi.launch({
  signer: wallet,
  name: "Kurumi",
  ticker: "KURUMI",
  image: "https://example.com/kurumi.png", // https URL, data URL or bytes
  mode: "holders", // creator | holders | split
  devBuySol: 0.1, // optional
});
console.log(coin.status, coin.url);

launch() builds the transaction on the server with the site's rules, signs it in your process, sends it privately through Jito and waits until the coin is live. The wallet pays rent, the network fee, a small Jito tip and any dev buy. In the browser, pass the connected wallet as signer and VersionedTransaction to the client (see Signers).

Launch with curl

Three steps: build, sign, submit. Any language works; the signing step below uses Python and solders.

1. Build
curl -s -X POST "https://api.justi.fun/v1/launches" \
  -H "Content-Type: application/json" \
  -d '{"wallet":"<your wallet>","name":"Kurumi","ticker":"KURUMI","image":"https://example.com/kurumi.png","mode":"holders","devBuyLamports":"100000000"}' \
  > launch.json
# launch.json: launchId, mint (...JUST), signers, fees, transaction (base64)
2. Sign (sign.py)
# sign.py: signs a base64 transaction from the API with a solana-keygen wallet file.
# Keeps signatures already in it (the server's ...JUST mint key). pip install solders
import base64, sys
from solders.keypair import Keypair
from solders.message import to_bytes_versioned
from solders.transaction import VersionedTransaction

kp = Keypair.from_json(open(sys.argv[1]).read())
tx = VersionedTransaction.from_bytes(base64.b64decode(sys.stdin.read().strip()))
sigs = list(tx.signatures)
sigs[list(tx.message.account_keys).index(kp.pubkey())] = kp.sign_message(to_bytes_versioned(tx.message))
print(base64.b64encode(bytes(VersionedTransaction.populate(tx.message, sigs))).decode())
3. Submit and check
ID=$(jq -r .launchId launch.json)
SIGNED=$(jq -r .transaction launch.json | python sign.py wallet.json)
curl -s -X POST "https://api.justi.fun/v1/launches/$ID/submit" \
  -H "Content-Type: application/json" \
  -d "{\"transaction\":\"$SIGNED\"}"
# {"status":"live","mint":"...JUST","signature":"..."}
curl -s "https://api.justi.fun/v1/launches/$ID"
Note
Submit within about 60 seconds of building: the transaction carries a recent blockhash. If it expires, build again.

Buy and sell

ts
const quote = await justi.quote({ mint, side: "buy", sol: 0.5 });
console.log(quote.expectedOut, quote.fee.pct, quote.route);

const buy = await justi.buy({ mint, sol: 0.5, signer: wallet });        // status: confirmed
const sell = await justi.sell({ mint, tokens: "250000", signer: wallet });

Read coins

const { tokens } = await justi.listCoins({ sort: "volume24h", limit: 10 });
const coin = await justi.getCoin(tokens[0].mint);
const { trades } = await justi.listTrades(coin.mint, { limit: 50 });

Listen for new coins

ts
justi.subscribe(["launches"], (e) => {
  if (e.event === "launch.created") console.log("new coin", e.data.ticker, e.data.mint);
});

For a server that should hear about launches even while it is down for a minute, use webhooks: they retry for about 9 hours.