@token-layer/sdk-typescript package wraps POST /token-layer and POST /info with typed request builders, auth helpers, and generated OpenAPI types.
Install
Quick start
Authentication modes
jwt: server-side automation with a bearer tokenapiKey: direct API key authenticationwallet: EIP-712 signing flows for wallet-authenticated actions such asregisterand signedcreateToken
Wallet auth example
Common methods
Actions
action.register(params?)action.createToken(params)action.tradeToken(params)action.sendTransaction(params)action.transferToken(params)action.claimRewards(params)action.createReferralCode(params)action.enterReferralCode(params)action.mintUsd(params)for testnet flows
Info
info.getTokensV2(params)info.quoteToken(params)info.me(params?)info.getPoolData(params)info.getUserBalance(params)info.searchToken(params)info.checkTokenOwnership(params)info.getUserFees(params?)info.getUserFeeHistory(params?)info.getLeaderboard(params?)info.getUserPortfolio(params?)
Builder defaults
Set builder attribution once and let the SDK inject it when the per-call payload does not provide one:action.createTokeninfo.getTokensV2
Auth switching
If you need the same client configuration with different auth contexts:Error handling
Requests throwTokenLayerApiError with:
statuscodemessagedetails
Local development in this repo
Examples
Example scripts live inpackages/sdk-typescript/examples for:
- token creation
- trading
- transfers
- referral actions
- token search and pool reads
- fee, leaderboard, and portfolio reads
