SDK integration guide
This page is for developers using the published Black Market SDKs. They provide static launch metadata and deterministic V1 Atomic-launch calculations; they are not a client for the current Black Market Launcher. For current product behavior and public addresses, see the Black Market Launcher overview and contract address reference.
| Language | Package | Repository |
|---|---|---|
| TypeScript | @black-market/sdk | GitHub |
| Python | black-market-sdk | GitHub |
Current launcher support is not yet published
The current Unified Launcher is on Robinhood Chain mainnet (chain ID 4663). The published SDKs predate it. Their static launch catalog, Atomic Factory ABI, and buildAtomicLaunchCalldata / build_atomic_launch_calldata target the retired V1 Atomic Launch Factory and its deployAndLaunch call.
Neither package currently exposes a Unified Launcher ABI, a LaunchRequestV3 encoder, or a transaction builder for a current launch. Do not construct a live Black Market Launcher launch from a V1 request or V1 builder output.
Select Robinhood Chain mainnet explicitly
Pass 4663 to every SDK client or chain-related helper used for mainnet. The address catalog defaults to workbench (46631), while the client factories default to local Anvil (31337). A correct chain ID does not make a retired V1 API suitable for the current launcher.
Network clients
Both packages can create generic public RPC clients. Selecting Robinhood Chain mainnet does not add current Unified Launcher support or a current launcher ABI.
import { createProtocolPublicClient } from "@black-market/sdk";
const client = createProtocolPublicClient({
chainId: 4663,
rpcUrl: "https://rpc.mainnet.chain.robinhood.com/",
});from black_market_sdk import ROBINHOOD_MAINNET_CHAIN_ID, create_protocol_web3
w3 = create_protocol_web3(
chain_id=ROBINHOOD_MAINNET_CHAIN_ID,
rpc_url="https://rpc.mainnet.chain.robinhood.com/",
)Use the client only with an ABI appropriate to the public contract being read. The packages do not provide the current Unified Launcher ABI.
What the SDKs support today
| SDK area | TypeScript | Python | Current boundary |
|---|---|---|---|
| Template metadata | getLaunchTemplate, LAUNCH_TEMPLATES | get_launch_template, LAUNCH_TEMPLATES | Static V1 metadata, not proof of current template registration. |
| Paired-asset catalog | AUCTION_QUOTE_OPTIONS | AUCTION_QUOTE_OPTIONS | A V1 catalog, not a live availability list or price source. |
| Atomic math | deriveAtomicLaunchPoolRecipe, deriveAtomicLaunchBuySqrtPriceLimitX96, estimateAtomicLaunchInitialBuy | derive_atomic_launch_pool_recipe, derive_atomic_launch_buy_sqrt_price_limit_x96, estimate_atomic_launch_initial_buy | Deterministic V1 one-sided-pool calculations only. |
| Exact unit conversion | parseAmountToUnits | parse_amount_to_units | Converts a decimal string to raw token units without floating point. |
| V1 calldata | buildAtomicLaunchCalldata | build_atomic_launch_calldata | Encodes retired deployAndLaunch requests for historical examples only. |
TypeScript: V1 integer calculations
npm install @black-market/sdk viemThis example exercises the package's deterministic V1 calculations without building or sending a transaction:
import {
AUCTION_QUOTE_OPTIONS,
deriveAtomicLaunchBuySqrtPriceLimitX96,
deriveAtomicLaunchPoolRecipe,
estimateAtomicLaunchInitialBuy,
getLaunchTemplate,
parseAmountToUnits,
} from "@black-market/sdk";
const template = getLaunchTemplate("dual-dividends");
const quote = AUCTION_QUOTE_OPTIONS.find(({ id }) => id === "USDG");
if (!quote) throw new Error("USDG is missing from the installed V1 catalog");
const pairedTokenAmountIn = parseAmountToUnits("250", quote.decimals);
const pairedTokenUsdPriceX18 = 10n ** 18n; // illustrative $1.00 X18 input, not a price feed
const recipe = deriveAtomicLaunchPoolRecipe({
pairedTokenDecimals: quote.decimals,
pairedTokenUsdPriceX18,
targetMarketCapUsdX18: 5_000n * 10n ** 18n,
launchedTokenIsQuote: template.launchedTokenIsQuote,
fee: 3_000,
});
const sqrtPriceLimitX96 = deriveAtomicLaunchBuySqrtPriceLimitX96({
launchSqrtPriceX96: recipe.launchSqrtPriceX96,
launchedTokenIsQuote: template.launchedTokenIsQuote,
slippageBps: 50,
});
const estimate = estimateAtomicLaunchInitialBuy({
launchSqrtPriceX96: recipe.launchSqrtPriceX96,
liquidity: recipe.liquidity,
pairedTokenAmountIn,
launchedTokenIsQuote: template.launchedTokenIsQuote,
fee: 3_000,
sqrtPriceLimitX96,
});Python: V1 integer calculations
pip install black-market-sdkfrom black_market_sdk import (
AUCTION_QUOTE_OPTIONS,
AtomicLaunchBuySqrtPriceLimitInput,
AtomicLaunchInitialBuyEstimateInput,
AtomicLaunchPoolRecipeInput,
derive_atomic_launch_buy_sqrt_price_limit_x96,
derive_atomic_launch_pool_recipe,
estimate_atomic_launch_initial_buy,
get_launch_template,
parse_amount_to_units,
)
template = get_launch_template("dual-dividends")
quote = next(option for option in AUCTION_QUOTE_OPTIONS if option.id == "USDG")
paired_token_amount_in = parse_amount_to_units("250", quote.decimals)
paired_token_usd_price_x18 = 10**18 # illustrative $1.00 X18 input, not a price feed
recipe = derive_atomic_launch_pool_recipe(
AtomicLaunchPoolRecipeInput(
paired_token_decimals=quote.decimals,
paired_token_usd_price_x18=paired_token_usd_price_x18,
target_market_cap_usd_x18=5_000 * 10**18,
launched_token_is_quote=template.launched_token_is_quote,
fee=3_000,
)
)
sqrt_price_limit_x96 = derive_atomic_launch_buy_sqrt_price_limit_x96(
AtomicLaunchBuySqrtPriceLimitInput(
launch_sqrt_price_x96=recipe.launch_sqrt_price_x96,
launched_token_is_quote=template.launched_token_is_quote,
slippage_bps=50,
)
)
estimate = estimate_atomic_launch_initial_buy(
AtomicLaunchInitialBuyEstimateInput(
launch_sqrt_price_x96=recipe.launch_sqrt_price_x96,
liquidity=recipe.liquidity,
paired_token_amount_in=paired_token_amount_in,
launched_token_is_quote=template.launched_token_is_quote,
fee=3_000,
sqrt_price_limit_x96=sqrt_price_limit_x96,
)
)Exact-value and safety rules
- Keep protocol quantities as TypeScript
bigintor Pythonint. Never convert raw token amounts, liquidity, ticks, or fixed-point prices through JavaScriptnumberor Pythonfloat. - Values ending in
X18are integer fixed-point values scaled by10^18. Preserve the price source, timestamp, decimals, and quote convention alongside the value; the SDK does not supply or validate a market price. - The V1 paired-asset catalog is metadata, not evidence that an asset is currently supported, liquid, redeemable, or safe.
- These helpers calculate an old model; they do not check current contract state, token provenance, liquidity, price impact, oracle conditions, approvals, or smart-contract risk. Treat an estimate as a calculation, not a quote or a safety check.
Retired V1 encoder
The V1 encoder remains useful for reading historical fixtures such as the Abby reconstruction. buildAtomicLaunchCalldata and build_atomic_launch_calldata encode only the retired deployAndLaunch request. Their output is not a Unified Launcher request and must not be submitted as a current launch transaction.