ThetanutsClient
Overview
Initialization
Read-Only Mode (No Signer)
import { ethers } from 'ethers';
import { ThetanutsClient } from '@thetanuts-finance/thetanuts-client';
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
const client = new ThetanutsClient({
chainId: 8453,
provider,
});
// Read-only operations work
const orders = await client.api.fetchOrders();
const balance = await client.erc20.getBalance(tokenAddress, userAddress);With Signer (For Transactions)
Browser with MetaMask
Configuration Options
Client Properties
chainId
chainConfig
provider
apiBaseUrl, indexerApiUrl, pricingApiUrl, stateApiUrl
Modules
Module
Property
Purpose
Helper Methods
getSignerAddress()
requireSigner()
Custom Logger
URL Overrides
Example: Complete Setup
Error Handling
Last updated

