SDK Methods
Complete reference for all ATVClient methods.
ENS / Identityโ
getProfile(name)โ
Get complete ENS profile.
const profile = await client.getProfile('vitalik.eth');
// Returns: ENSProfile
| Property | Type | Description |
|---|---|---|
name | string | ENS name |
address | string | Ethereum address |
avatar | string | Avatar URL |
records | object | Text records |
expiration | string | Expiry date |
resolveENS(name)โ
Quick address resolution.
const { address } = await client.resolveENS('vitalik.eth');
// Returns: { name: string, address: string }
reverseResolve(address)โ
Get primary ENS name for address.
const { name } = await client.reverseResolve('0xd8dA...');
// Returns: { address: string, name: string | null }
batchResolve(names)โ
Resolve multiple names at once.
const results = await client.batchResolve(['vitalik.eth', 'nick.eth']);
// Returns: { name: string, address: string }[]
Farcaster / Socialโ
getFarcasterUser(identifier)โ
Get Farcaster profile by FID, username, or address.
const user = await client.getFarcasterUser('dwr.eth');
// Returns: FarcasterUser
| Property | Type | Description |
|---|---|---|
fid | number | Farcaster ID |
username | string | Username |
displayName | string | Display name |
bio | string | Profile bio |
followers | number | Follower count |
following | number | Following count |
getFarcasterCasts(fid, options?)โ
Get user's recent casts.
const casts = await client.getFarcasterCasts(3, { limit: 10 });
// Returns: { casts: Cast[], nextCursor?: string }
Prices / Marketโ
getPrice(symbol)โ
Get current price for a token.
const price = await client.getPrice('ETH');
console.log(price.price); // 3245.67
// Returns: PriceData
batchPrices(symbols)โ
Get multiple prices at once.
const prices = await client.batchPrices(['ETH', 'BTC', 'USDC']);
// Returns: { [symbol: string]: PriceData }
getSmartPrice(symbol)โ
Multi-source aggregated price.
const price = await client.getSmartPrice('ETH');
console.log(price.sources); // Multiple price sources
// Returns: SmartPriceData
getPriceHistory(symbol, options?)โ
Historical price data.
const history = await client.getPriceHistory('ETH', { days: 30 });
// Returns: { history: { date: string, price: number }[] }
Authenticationโ
signIn()โ
Authenticate with SIWE for 2x rate limits.
await client.signIn();
console.log(client.isAuthenticated); // true
signOut()โ
End authenticated session.
await client.signOut();
sessionStatus()โ
Get current session info.
const session = await client.sessionStatus();
// Returns: { address: string, expiresAt: string } | null
Usage & Limitsโ
getUsage()โ
Check remaining free tier calls.
const usage = await client.getUsage();
console.log(usage.remaining); // 73
// Returns: { used: number, limit: number, remaining: number, tier: string }
myUsage()โ
Get authenticated user's usage (requires SIWE).
await client.signIn();
const usage = await client.myUsage();
// Returns: detailed usage by wallet
Wallet / Balancesโ
getBalances(address)โ
Get token balances for an address.
const balances = await client.getBalances('0x...');
// Returns: { tokens: TokenBalance[], totalValueUSD: number }
getTransactions(address, options?)โ
Get recent transactions.
const txs = await client.getTransactions('0x...', { limit: 20 });
// Returns: { transactions: Transaction[] }
DeFiโ
getTVL(protocol)โ
Get protocol TVL.
const tvl = await client.getTVL('aave');
// Returns: { protocol: string, tvl: number, change24h: number }
getYields(options?)โ
Get yield farming opportunities.
const yields = await client.getYields({ minApy: 5 });
// Returns: { pools: YieldPool[] }
Low-Levelโ
fetch(endpoint, options?)โ
Direct API call with automatic auth/payment.
const data = await client.fetch('/api/custom/endpoint');
payAndRetry(error)โ
Manually handle payment for a 402 error.
try {
await client.getProfile('nick.eth');
} catch (error) {
if (error.code === 'PAYMENT_REQUIRED') {
const result = await client.payAndRetry(error);
}
}