Voter UI for SPL Governance using Space Operator
Using Next.js 14 with App Router, Tailwind CSS, and shadcn/ui
npm install
npm run dev
Bundle Analyzer
ANALYZE=true npm run build
You can use your APIKEY and the spaceoperator.com instance or set your own dedicated instance.
Use the below documentation to setup your Space Operator instance
https://docs.spaceoperator.com/self-hosting/docker-compose\
or
https://docs.spaceoperator.com/self-hosting/lightsail-instance
NEXT_PUBLIC_HELIUS_MAINNET
NEXT_PUBLIC_HELIUS_DEVNET\
NEXT_PUBLIC_FLOW_INSTANCE_URL
NEXT_PUBLIC_FLOW_INSTANCE_WS
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY\
NEXT_PUBLIC_FLOW_ID_MESSAGE
NEXT_PUBLIC_FLOW_ID_VOTE
NEXT_PUBLIC_FLOW_ID_RELINQUISH\
Defaults to Mainnet
http://localhost:3000/realm/ExJuzuE1wZbjFzQD1SMo47YrRtwA7NRHZzRLQF9EJ4b6
For Devnet add /devnet/ before the realm id http://localhost:3000/realm/devnet/ExJuzuE1wZbjFzQD1SMo47YrRtwA7NRHZzRLQF9EJ4b6
const { logs, startFlow, errors, flowRunningState } = useFlowEvents();
try {
const flowId = parseInt(process.env.NEXT_PUBLIC_FLOW_ID_VOTE);
// input structure should match your flow input nodes
const inputBody = new Value({
private_key: 'WALLET_ADAPTER', // will be replaced and signed by wallet
realm: realm.pubkey,
governance: proposal.account.governance,
// ...add rest of the inputs
}).M;
console.log('inputBody', inputBody);
await startFlow(flowId, prepFlowInputs(inputBody, wallet.publicKey));
} catch (e) {
console.error(e);
}