SDK API Reference
InterestSwapClient
new InterestSwapClient(config?: Partial<ClientConfig>)ClientConfig
| Field | Type | Default |
|---|---|---|
orderbookUrl | string | http://localhost:3005 |
chainId | number | 8453 |
factoryAddress | Address | InterestRatePool (compatibility alias) |
quoteMarketAddress | Address | generated Base QuoteMarket |
interestRatePoolAddress | Address | generated Base InterestRatePool |
Signing and WebSocket
| Method | Result |
|---|---|
setPrivateKey(key) | Configure the internal server-side signer |
getAddress() | Configured maker address or null |
getSigner() | BackerSigner instance |
signQuoteMarketQuote(quote) | Serialized quote plus EIP-712 signature |
connectWebSocket(events) | Connect and authenticate RFQWebSocketClient |
getWebSocketClient() | Current client or null |
disconnectWebSocket() | Close and disable reconnect |
HTTP
| Method | Endpoint |
|---|---|
submitQuoteMarketQuote(signed) | POST /api/v1/quotes |
requestQuotes(request) | POST /api/v1/rfq/quote |
getQuoteMarketQuotes(filters) | GET /api/v1/quotes |
getPoolRates() | GET /api/v1/pools/rates |
getMarkets() | GET /api/v1/rates/current |
getHealth() | GET /api/v1/health |
getConfig() | Copy of the resolved local client configuration |
Quote Models
interface QuoteMarketQuote {
maker: Address
taker: Address
poolId: Hex
seriesKey: Hex
notional: bigint
vrtAmount: bigint
nonce: bigint
deadline: bigint
salt: Hex
}serializeQuoteMarketQuote converts integer fields to JSON strings; deserializeQuoteMarketQuote restores bigint values. RFQRequest accepts a seriesKey or expiry, exact raw-unit notional, and optional maxVrtAmount.
BackerSigner
new BackerSigner({
chainId,
factoryAddress,
quoteMarketAddress,
interestRatePoolAddress,
})setPrivateKey(key)creates an internal viem wallet client.setAccount(account, walletClient)uses an existing wallet client.signQuoteMarketQuote(quote)signs the QuoteMarket EIP-712 domain and checks thatquote.makerequals the signer.signAuthChallenge(challenge, timestamp)signs WebSocket authentication.
RFQWebSocketClient
Important methods are connect, disconnect, isConnected, isAuth, submitQuote, submitSerializedQuote, and ping. Event callbacks include onOpen, onClose, onError, onAuthenticated, onAuthFailed, onRFQ, onQuoteAck, and onAuctionResult.
Address Constants
The root package exports generated production constants including:
INTEREST_RATE_POOL_ADDRESS
BUNDLER3_ADDRESS
QUOTE_MARKET_ADDRESS
KEEPER_BUNDLER_ADDRESS
INTEREST_RATE_POOL_DEPLOY_BLOCK
PRODUCTION_DEPLOYMENTAdapter address constants remain available from @interestswap/sdk/addresses. The generated module is sourced from deployments/8453-interest-swap.json and must not be edited manually.
Utilities
Rate helpers convert APY/APR percentages to WAD-scaled per-second rates and back: apyToRatePerSec, ratePerSecToApy, aprToRatePerSec, ratePerSecToApr, apyToApr, and aprToApy.
Formatting helpers include formatPrincipal, parsePrincipal, formatTvl, formatRate, formatAddress, formatPoolId, formatDuration, formatTimestamp, and getChainName.
RfqDaemonClient is a Node-only JSON-RPC client for the local Unix socket (/tmp/interestswap.sock by default). It is intended for daemon integration, not browser use.
