SDK
@printr/sdk — the core TypeScript library.
The TypeScript SDK for printing tokens across EVM chains and Solana — the pure core, with no agent or transport concerns. Everything else in the monorepo builds on it.
- Multi-chain — create and manage tokens on Base, Ethereum, Solana, and more.
- Framework-agnostic — runs on Node, Bun, and the browser; Workers-ready.
- Type-safe — full TypeScript types, all I/O validated with Zod.
- Result-based — failable calls return
neverthrowResult/ResultAsync, never throw. - Secure wallets — AES-256-GCM encrypted keystore for self-custody signing.
For the product overview, see Printr SDK in the Printr docs.
Install
bun add @printr/sdkAll failable functions return neverthrow Result/ResultAsync, and all I/O is validated with
Zod. Match on results rather than using try/catch.
Surface
Client
createPrintrClient(config)— build the API client. Defaults target the keyless public preview API.env— parsed, validated environment (base URLs, optional keys).PrintrApiError— typed API error.- Tool-response helpers:
toToolResponse,toToolResponseAsync,toolOk,toolError,unwrapResult,unwrapResultAsync.
Chains
CHAIN_META,getChainMeta(caip2)— chain metadata lookup.isSupportedCaip2,getRpcUrl,getRpcUrls,getEvmConfig,createViemChain.- CAIP utilities:
parseCaip2,parseCaip10,chainTypeFromCaip2,caip10ToChainId,toCaip2FromParts.
Tokens
buildToken(input, client)— resolve the image and build an unsigned deployment payload.FeeSink— where creator fees go (dev|stake_pool|buyback|liquidity_pool).
Signing
signAndSubmitEvm(payload, …)— sign and broadcast an EVM payload.signAndSubmitSvm(payload, …)/sendAndConfirmSvmTransaction(…)— Solana equivalents.
Balances & transfers
fetchNativeBalance,fetchTokenBalance— balance queries.executeTransfer,executeTokenTransfer— generic transfers, with chain-specific helpers (transferEvm,transferErc20,transferSvm,transferSplToken).- Namespaced facade:
balance.checkNativeBalance,balance.checkTokenBalance,tx.sendNative,tx.sendToken.
Keystore
addWallet,getWallet,listWallets,removeWallet,removeWallets— encrypted wallet storage for self-custody signing.encryptKey,decryptKey,keystorePath.
Staking & fees
createStakePosition,claimStakingRewards,listStakePositionsWithRewards,parseLockPeriod.getProtocolFees— protocol fee structure.
Image processing
generateTokenImage,generateImageFromPrompt,processImagePath,compressImageBuffer.
This is the high-level map. Public exports carry TSDoc — your editor's hover and autocomplete are the authoritative per-function reference.