QubicKit Docs
CoreGovernance & Proposals

Proposal Tooling

Draft, simulate, and evaluate shareholder proposals without leaving TypeScript.

The proposals module bundles schema validation, template registries, and CCF helpers so developers can build ops dashboards or governance tools.

Template registry

import { createDefaultProposalRegistry } from "@qubiq/core";

const registry = createDefaultProposalRegistry();
const transferDraft = registry.build("transfer", {
  epoch: 184,
  destination: "SUZFF...",
  amount: BigInt(25_000_000_000),
  description: "Fund @qubiq/sdk",
});

const preview = registry.simulate("transfer", {
  epoch: transferDraft.epoch,
  destination: transferDraft.transferOptions!.destination,
  amount: transferDraft.transferOptions!.amount,
});
console.log(preview?.summary);

Templates enforce sizes, identity formats, and amount bounds via Zod schemas so you catch errors before on-chain submission.

Workflow helpers

import { parseProposalDraft, buildProposalFromDraft } from "@qubiq/core";

const draft = parseProposalDraft(await fs.readFile("./drafts/sdk.json", "utf8"));
const result = buildProposalFromDraft(registry, draft, { simulate: true });
console.log(result.data, result.simulation);

Use JSON drafts to collaborate with non-technical stakeholders, then convert them to typed payloads.

CCF contract fetcher

import { LiveServiceClient } from "@qubiq/core";
import { fetchCcfProposalsFromContract } from "@qubiq/core/proposals/ccf";

const client = new LiveServiceClient();
const { proposals, activeIndices } = await fetchCcfProposalsFromContract(client);
console.log(activeIndices, proposals.length);

This hits the CCF contract directly via the public HTTP RPC and decodes payloads into typed proposals. We follow the official layout documented in ccf.h so the same helper can power future transports when available.

Finalization utilities

import { finalizeProposalsWithSummary } from "@qubiq/core";

await finalizeProposalsWithSummary(coordinator, async (proposal, ctx) => {
  console.log(ctx.summary);
});

ProposalCoordinator + finalizers make it easy to trigger downstream actions whenever an option is accepted.

Sample drafts

See docs/samples/proposals.sample.json and docs/proposals/ccf-proposal.md for real-world funding requests, including breakdown tables and milestones.