@bankofai/sun-cli v1.2.0
HighLight
sun sunpump — read-only data (no wallet required)
token list— paginated token list with filters and sorttoken get <addr>— token detail (price, market cap, holders, social links,
listed CEXes); human mode prints a labelled key/value view,--jsonreturns
the raw objecttoken search <q>/token search-v2 <q>— fuzzy searchtoken by-owner <addr>— tokens created by a wallettoken holders <addr>/token holders-v2 <addr>— top holders with a
Typecolumn distinguishing pools from userstoken favors— signed-message favourites lookuptoken ranking --type MARKET_CAP|VOLUME_24H|PRICE_CHANGE_24Htoken king-of-hilltoken pump-list— raw SunSwap-compatible token listtx token <addr>/tx user <addr>— swap history with filtersportfolio <wallet>— wallet's SunPump positions with TRX value
sun sunpump — on-chain trading (wallet required)
state <addr>— on-chain state with named label:0 NOT_EXIST/
1 TRADING/2 READY_TO_LAUNCH/3 LAUNCHEDquote-buy <addr> --trx <decimal>— read-only buy previewquote-sell <addr> --amount <decimal> [--decimals 18]— read-only sell
previewbuy <addr> --trx <decimal> [--slippage 0.05] [--min-out <raw>]— spend TRX,
receive tokenssell <addr> --amount <decimal> [--decimals 18] [--slippage 0.05] [--min-out <raw>]
— sell tokens for TRX (auto-handles first-time TRC20 approval)
All write commands go through writeAction: wallet check → signed summary →
confirmation prompt → broadcast → Tronscan link. --dry-run and --yes work
as expected. Decimal inputs (--trx 10, --amount 1000) are scaled
internally by 1e6 (TRX → Sun) and 10^decimals (tokens → raw uint256).
Buy/sell summaries pre-fetch a quote so the user sees expected output and fee
before confirming.
Output & formatting improvements
- New table configs:
tokenTablewith atokenPriceUsdfallback (no more
$0rows when the API omits the TRX/USD rate — falls back to
marketCap / totalSupply);holderTablereading the correctpercentage
field with auto-detected fraction/percent units;portfolioTable;
key/value detail view fortoken get. extractListrecognisestokens(alongside the existingswaps/holders);
readPaginationdescends intopageData/metadataand treatssizeas
apageSizealias.- HTTP errors from SunPump now surface the API's
msgfield, e.g.
SunPump request failed: 400 Bad Request (/token/getRanking) — Validation error: No enum constant ....
Notes & gotchas
- State enum off-by-one.
sun-kit's exportedSunPumpTokenStatelists
LAUNCHED = 2, but the on-chain contract returns3for tokens that have
migrated to SunSwap. The CLI re-labels: state3prints asLAUNCHED (3).
Trust the printed label, not the raw int. - Quotes ignore on-chain state.
quote-buyreturns a price even for
LAUNCHEDtokens (andquote-sellmay revert with
REVERT opcode executed). The actualbuy/sellpre-checks state and
throwsSUNPUMP_LAUNCHEDcleanly — callsunpump statefirst if you're
routing logic. - First sell ≠ one transaction. When the wallet has zero allowance, the
SDK auto-sendsapprove(SunPump, 2^256-1)before the sell tx. Only the
final sell tx hash is returned intronscanUrl. - Default slippage for bonding-curve trading is
0.05(5%) — meme tokens
are volatile. Tighten with--slippage 0.005or pass--min-out <raw>for
an exact floor.
Companion release
sunpump-agent-skill
v1.2.0 ships in parallel — pins this CLI version, documents the new
buy/sell/quote-*/state commands as the pre-launch trade path with sun swap
as the post-launch path, and updates pre-validation checklists to enforce
--network mainnet.
Install
npm install -g @bankofai/sun-cli@^1.2.0
npx skills add BofAI/skills