Core client
Framework-agnostic TypeScript client for Node.js and browsers. Pass an RPC URL per chain; Ethereum mainnet and Sepolia deployments are built in.
Installation
$ npm install @zenland/sdk
Quick example
import { createZenlandClient } from '@zenland/sdk';
const zenland = createZenlandClient({
rpc: {
chains: [{ chainId: 1, rpcUrl: 'https://your-rpc' }],
},
});
// Active escrows
const { items } = await zenland.escrows.list({
limit: 10,
states: ['ACTIVE'],
});
// Agents and protocol stats
const agents = await zenland.agents.list({ onlyActive: true });
const stats = await zenland.protocolStats.get();
React hooks
Hooks with caching through TanStack Query. Requires
react and @tanstack/react-query as peer dependencies.
Data available
Escrows
Agents
Protocol stats
Transaction logs
Example
import { ZenlandProvider, useEscrows } from '@zenland/sdk/react';
const config = {
rpc: { chains: [{ chainId: 1, rpcUrl: 'https://your-rpc' }] },
};
function App() {
return <ZenlandProvider config={config}><MyEscrows /></ZenlandProvider>;
}
function MyEscrows() {
const { data } = useEscrows({ address: '0x...', role: 'buyer' });
// ...
}