@runup.trade/client
v0.6.1
Published
Launch and read RUNUP coins from code: memecoins on Solana with a basket of real assets underneath, or paired with any listed asset.
Readme
@runup.trade/client
Launch and read RUNUP coins from code: memecoins on Solana with a basket of real assets underneath (Basket mode) or paired with SOL or any listed asset, the creator earning a share of every trading fee (Classic mode). A thin, non-custodial wrapper over the RUNUP public API: the API returns transactions and your wallet signs them.
npm install @runup.trade/client @solana/web3.jsimport { createRunupClient, DEVNET } from '@runup.trade/client'
// Devnet first: test SOL, mock assets. createRunupClient() with no options is mainnet, real SOL.
const runup = createRunupClient({ baseUrl: DEVNET, headers: { 'x-runup-access': '<code>' } })
const presets = await runup.presets() // modes and their rules, pair assets, basket presets, assets, fee presets and the defaults
const coins = await runup.tokens({ sort: 'marketCap' }) // { mode: 'classic', pair: 'SOL' } narrows the list
// signer: a Keypair, or any wallet with publicKey and signAllTransactions.
// Basket: the basket and fee preset come from presets(); left out, the defaults apply.
const { mint, token } = await runup.launch(signer, { name: 'moon cat', symbol: 'MCAT', basketPreset: presets.basketPresets[0].id, firstBuySol: 0.05 })
console.log(token?.url ?? `submitted, not live yet: ${mint}`)
// Classic: paired with an asset from presets().pairs, the first buy in that asset under the pair's cap.
const classic = await runup.launch(signer, { mode: 'classic', name: 'moon dog', symbol: 'MDOG', pair: presets.pairs[0].symbol, firstBuy: 0.05 })
await runup.trade(signer, mint, 'buy', 0.01) // buy with 0.01 of the pair asset (SOL here), or 'sell' with an amount of coins
// Basket: redeem once the coin trades in a pool and its basket holds assets (at least $1 per burn):
// await runup.redeem(signer, mint, amount)
// Classic: the creator claims the fee share earned so far:
// await runup.claim(signer, classic.mint)Sign with a dedicated wallet that holds only what your code may spend, never your main wallet.
Reads: token, trades, candles, quote, holders, fees, assets, stats, claimStatus. Lower level: prepareLaunch, submitLaunch, launchStatus, prepareTrade, prepareRedeem, prepareClaim, submit. Errors throw RunupError { code, status }.
createRunupClient({ referrer: '<your code>' }) puts your referral code on every launch the client prepares (a launch's own referrer wins); its referrer earns a share of RUNUP's revenue on the coin, paid by RUNUP. The prepared launch answers the code it was recorded under, or null.
Changes: 0.6.1 adds rail (launchlab or dbc, the venue a coin launched on) to Token and to a prepared Basket launch, and basket.rail to presets(): where a Basket launch built now lands. 0.6.0 adds the referral code: createRunupClient({ referrer }) and referrer on a launch input, and referrer on the prepared launch (the code it was recorded under, or null); surplus joins unclaimed in claimStatus. 0.5.1 adds reason to each pair of presets() and closes a pair (enabled: false) while it has no first-buy cap: no price, or a price at which its curve does not fit the chain. 0.5.0 adds launch modes (modes, pairs and defaults.mode in presets(), mode and pair filters on tokens(), mode: 'classic' launches with pair and firstBuy), the Classic fields on Token (mode, phase, quoteMint, quoteSymbol, quoteDecimals, feeBps, creatorShareOfFee; the vault fields are null there), quoteMint and quoteAmount on Trade, and the creator claim (claimStatus, prepareClaim, claim). A buy amount is in the coin's pair asset, SOL as before on a Basket coin.
Devnet (https://undr-seven.vercel.app, exported as DEVNET) runs the same program, preset ids and fees with mock
assets and test SOL. It is behind an access code: ask
[email protected] for one. Call it from a server: browsers cannot send that header to another origin. Without the
code every call throws RunupError with status 401.
API reference for agents: https://runup.trade/llms.txt
