Skip to Content
APIDAO API

DAO API

Manage on-chain governance.

Get DAO Information

GET /dao/:realmId

Retrieve DAO details, treasury, and proposals.

Response

{ "realmId": "REALM123...", "name": "MyToken DAO", "symbol": "MTK", "type": "community", "governance": "GOV456...", "treasury": { "address": "TRES789...", "balances": { "MTK": 50000000, "SOL": 10.5 } }, "config": { "quorum": 10, "passThreshold": 60, "votingPeriodHours": 72, "minTokensToCreate": 1000000 }, "proposals": { "total": 5, "active": 1, "passed": 3, "failed": 1 }, "voters": 142 }

List Proposals

GET /dao/:realmId/proposals

List all proposals with optional filters.

Query Parameters

ParameterTypeDescription
statusstringactive, passed, failed, cancelled
limitnumberMax results (default: 20)
offsetnumberPagination offset

Response

{ "proposals": [ { "proposalId": "PROP123...", "title": "Increase Marketing Budget", "description": "...", "status": "active", "createdAt": "2026-02-15T12:00:00Z", "votingEndsAt": "2026-02-18T12:00:00Z", "creator": "8vP2...", "voteResults": { "yes": 500000000, "no": 100000000, "total": 600000000, "quorumMet": true } } ], "pagination": { "total": 5, "limit": 20, "offset": 0 } }

Get Proposal Details

GET /dao/:realmId/proposals/:proposalId

Detailed view of a proposal including votes.

Create Proposal

POST /dao/:realmId/proposal

Submit a new governance proposal.

Request Body

{ "title": "Proposal Title (max 80 chars)", "description": "Detailed description...", "type": "treasury_transfer", "actions": [ { "type": "transfer", "amount": 100000000000, "recipient": "WALLET_ADDRESS...", "mint": "TOKEN_MINT..." } ], "options": { "votingPeriodHours": 48 } }

Proposal Types

TypeActionsDescription
treasury_transfertransferSend tokens from treasury
config_changeset_configModify governance params
generalnoneCommunity signaling

Actions

Transfer:

{ "type": "transfer", "amount": 100000000000, "recipient": "8vP2...", "mint": "TOKEN_MINT..." }

Set Config:

{ "type": "set_config", "config": { "quorum": 15, "passThreshold": 65 } }

Response

{ "proposalId": "PROP789...", "status": "active", "transaction": "5abc...", "votingEndsAt": "2026-02-18T12:00:00Z" }

Cast Vote

POST /dao/:realmId/vote

Vote on an active proposal.

Request Body

{ "proposal": "PROP789...", "vote": "yes", "weight": 1000000000 // Optional: specific token amount }

Vote Options

ValueDescription
yesApprove the proposal
noReject the proposal
abstainCount toward quorum, neutral outcome
vetoCouncil-only rejection

Response

{ "signature": "5ghi...", "vote": "yes", "weight": 1000000000, "proposal": "PROP789...", "votingPower": 1000000000 }

Cancel Proposal

POST /dao/:realmId/proposals/:proposalId/cancel

Cancel a proposal (only by creator before voting starts).

Response

{ "signature": "5jkl...", "status": "cancelled" }

Execute Proposal

POST /dao/:realmId/proposals/:proposalId/execute

Execute a passed proposal (anyone can trigger after pass).

Response

{ "signature": "5mno...", "status": "executed", "results": { "transfers": [ { "amount": 100000000000, "recipient": "8vP2..." } ] } }

Withdraw Governance Tokens

POST /dao/:realmId/withdraw

Withdraw tokens deposited for voting.

Request Body

{ "amount": 1000000000 }

Get Voting Power

GET /dao/:realmId/voting-power/:wallet

Get current voting power for a wallet.

Response

{ "wallet": "8vP2...", "tokenBalance": 1000000000, "votingPower": 1000000000, "isDeposited": true, "canCreateProposal": true }

Webhook Events

EventDescription
dao.proposal_createdNew proposal submitted
dao.vote_castVote recorded
dao.proposal_passedProposal passed quorum
dao.proposal_failedProposal failed/rejected
dao.proposal_executedProposal executed
dao.proposal_cancelledProposal cancelled

Examples

Create and Vote on Proposal

async function createAndVote( authToken: string, realmId: string, wallet: string ) { // Create proposal const proposal = await fetch( `https://etch.film.fun/api/dao/${realmId}/proposal`, { method: "POST", headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json" }, body: JSON.stringify({ title: "Community Grant #1", description: "Send 100K tokens to marketing team", type: "treasury_transfer", actions: [{ type: "transfer", amount: 100000000000, recipient: "MARKETING_WALLET...", mint: "YOUR_TOKEN_MINT..." }] }) } ).then(r => r.json()); console.log(`Created: ${proposal.proposalId}`); // Vote yes const vote = await fetch( `https://etch.film.fun/api/dao/${realmId}/vote`, { method: "POST", headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json" }, body: JSON.stringify({ proposal: proposal.proposalId, vote: "yes" }) } ).then(r => r.json()); console.log(`Voted: ${vote.signature}`); }

Error Codes

CodeDescription
proposal_not_foundProposal doesn’t exist
already_votedWallet already voted
voting_endedProposal period closed
insufficient_tokensNot enough tokens to create proposal
not_authorizedNot proposal creator
not_executableProposal conditions not met
Last updated on