API
The Realms API provides HTTP endpoints for querying DAO data, proposals, members, and more
Last updated
GET /api/v1/daos/:realmPkPOST /api/v1/daos/createGET /api/v1/user/:walletPkGET /api/v1/leaderboardimport { Connection, PublicKey } from '@solana/web3.js';
import { getRealm, getAllGovernances, getAllProposals } from '@realms-today/spl-governance';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const programId = new PublicKey('GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw');
// Fetch a realm
const realm = await getRealm(connection, realmAddress);
// Fetch all governances for a realm
const governances = await getAllGovernances(connection, programId, realmAddress);
// Fetch all proposals for a governance
const proposals = await getAllProposals(connection, programId, governanceAddress);