Skip to main content

Governance — SDK API

This page is the SDK reference. For the on-chain mechanism (snapshot weights, tally rules, atomic activation, what’s governable, safety bounds), see the protocol page:

Backend / Network Governance

Stackable Genesis — full protocol mechanics
For an end-to-end walkthrough — stake, propose, vote, observe activation — see the Quickstart.

Connect

Builders

proposeNetworkUpgrade(params, demos)

The SDK fail-fast validates input:
  • proposalId — required and trimmed before signing
  • rationale — must be a string (use "" if none)
  • effectiveAtBlock — non-negative integer ≥ currentBlock + votingWindow + gracePeriod
  • proposedParameters — non-empty plain object; keys with undefined values are dropped before signing

voteOnUpgrade(proposalId, approve, demos)

Constraints (enforced by the node):
  • Voter must be in the validator-set snapshot at the proposal’s confirmation block
  • One vote per validator per proposal — final, non-revocable
  • Proposal must still be in pending status; votes after tallyBlock are dropped

Read-side queries

Fees on the signed transaction

Every transaction the SDK signs carries the live governance-driven networkFee and rpcFee baked into tx.content.transaction_fee. The SDK fetches getNetworkParameters() from the connected RPC at sign-time (with a 30-second per-RPC-URL TTL cache) so the value matches what the node will deduct. If the RPC is unreachable, the SDK falls back to deriving fees from the GCR edits — the older heuristic. This keeps offline signing functional but may diverge from the node’s view; a fresh online sign is the canonical path.