Examples
Use the wallet API from cURL, JavaScript, or TypeScript; validate inputs and handle configuration and RPC errors without exposing the provider URL.
JavaScript
Call the same-origin API from the browser or a trusted application server. Handle non-2xx responses and empty transfer sets as distinct states.
TypeScript
The response distinguishes returned signatures from recognized transfer evidence. Always use each transfer signature as provenance and label the coverage window.
cURL
For production deployments, replace localhost with the configured application origin. Do not call the provider URL from browser code or include it in examples shared publicly.
Troubleshooting
503 usually means the app server has no SOLANA_RPC_URL. 502 means the RPC request failed or the provider does not support the requested parsed transaction features. Some older transactions may lack block timestamps or supported transfer parsing.
JavaScript
const response = await fetch(`/api/wallets/${encodeURIComponent(address)}`)
if (!response.ok) {
const { error } = await response.json()
throw new Error(`${error.code}: ${error.message}`)
}
const activity = await response.json()
console.log(activity.transfers)
TypeScript
type WalletActivity = { address: string; source: "live"; signaturesScanned: number; transfers: Array<{ signature: string; kind: "SOL" | "SPL"; amount: string }> }
const typedActivity = await response.json() as WalletActivity
cURL
curl "http://localhost:3000/api/wallets/<PUBLIC_SOLANA_ADDRESS>"