Democracy pallet
Derived from live runtime metadata on TRN root (pallet index 59, captured 2026-05-02). For prose-style documentation see Democracy on the curated reference side.
- Pallet index
59- Calls
- 19
- Events
- 17
- Errors
- 24
- Storage items
- 12
- Constants
- 12
Calls (extrinsics)
Democracy.propose
See [
Pallet::propose].
api.tx.democracy.propose(proposal: {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}}, value: Compact<u128>)| Argument | Type | Doc |
|---|---|---|
proposal | {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}} | BoundedCallOf<T> |
value | Compact<u128> | BalanceOf<T> |
Call index: 0
Democracy.second
See [
Pallet::second].
api.tx.democracy.second(proposal: Compact<u32>)| Argument | Type | Doc |
|---|---|---|
proposal | Compact<u32> | PropIndex |
Call index: 1
Democracy.vote
See [
Pallet::vote].
api.tx.democracy.vote(ref_index: Compact<u32>, vote: {"_enum":{"Standard":"{\"vote\":\"Vote\",\"balance\":\"u128\"}","Split":"{\"aye\":\"u128\",\"nay\":\"u128\"}"}})| Argument | Type | Doc |
|---|---|---|
ref_index | Compact<u32> | ReferendumIndex |
vote | {"_enum":{"Standard":"{\"vote\":\"Vote\",\"balance\":\"u128\"}","Split":"{\"aye\":\"u128\",\"nay\":\"u128\"}"}} | AccountVote<BalanceOf<T>> |
Call index: 2
Democracy.emergency_cancel
See [
Pallet::emergency_cancel].
api.tx.democracy.emergency_cancel(ref_index: u32)| Argument | Type | Doc |
|---|---|---|
ref_index | u32 | ReferendumIndex |
Call index: 3
Democracy.external_propose
See [
Pallet::external_propose].
api.tx.democracy.external_propose(proposal: {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}})| Argument | Type | Doc |
|---|---|---|
proposal | {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}} | BoundedCallOf<T> |
Call index: 4
Democracy.external_propose_majority
See [
Pallet::external_propose_majority].
api.tx.democracy.external_propose_majority(proposal: {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}})| Argument | Type | Doc |
|---|---|---|
proposal | {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}} | BoundedCallOf<T> |
Call index: 5
Democracy.external_propose_default
See [
Pallet::external_propose_default].
api.tx.democracy.external_propose_default(proposal: {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}})| Argument | Type | Doc |
|---|---|---|
proposal | {"_enum":{"Legacy":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\"}","Inline":"Bytes","Lookup":"{\"_alias\":{\"hash_\":\"hash\"},\"hash_\":\"H256\",\"len\":\"u32\"}"}} | BoundedCallOf<T> |
Call index: 6
Democracy.fast_track
See [
Pallet::fast_track].
api.tx.democracy.fast_track(proposal_hash: H256, voting_period: u32, delay: u32)| Argument | Type | Doc |
|---|---|---|
proposal_hash | H256 | H256 |
voting_period | u32 | BlockNumberFor<T> |
delay | u32 | BlockNumberFor<T> |
Call index: 7
Democracy.veto_external
See [
Pallet::veto_external].
api.tx.democracy.veto_external(proposal_hash: H256)| Argument | Type | Doc |
|---|---|---|
proposal_hash | H256 | H256 |
Call index: 8
Democracy.cancel_referendum
See [
Pallet::cancel_referendum].
api.tx.democracy.cancel_referendum(ref_index: Compact<u32>)| Argument | Type | Doc |
|---|---|---|
ref_index | Compact<u32> | ReferendumIndex |
Call index: 9
Democracy.delegate
See [
Pallet::delegate].
api.tx.democracy.delegate(to: [u8;20], balance: u128)| Argument | Type | Doc |
|---|---|---|
to | [u8;20] | AccountIdLookupOf<T> |
balance | u128 | BalanceOf<T> |
Call index: 10
Democracy.undelegate
See [
Pallet::undelegate].
api.tx.democracy.undelegate()Call index: 11
Democracy.clear_public_proposals
See [
Pallet::clear_public_proposals].
api.tx.democracy.clear_public_proposals()Call index: 12
Democracy.unlock
See [
Pallet::unlock].
api.tx.democracy.unlock(target: [u8;20])| Argument | Type | Doc |
|---|---|---|
target | [u8;20] | AccountIdLookupOf<T> |
Call index: 13
Democracy.remove_vote
See [
Pallet::remove_vote].
api.tx.democracy.remove_vote(index: u32)| Argument | Type | Doc |
|---|---|---|
index | u32 | ReferendumIndex |
Call index: 14
Democracy.remove_other_vote
See [
Pallet::remove_other_vote].
api.tx.democracy.remove_other_vote(target: [u8;20], index: u32)| Argument | Type | Doc |
|---|---|---|
target | [u8;20] | AccountIdLookupOf<T> |
index | u32 | ReferendumIndex |
Call index: 15
Democracy.blacklist
See [
Pallet::blacklist].
api.tx.democracy.blacklist(proposal_hash: H256, maybe_ref_index: Option<u32>)| Argument | Type | Doc |
|---|---|---|
proposal_hash | H256 | H256 |
maybe_ref_index | Option<u32> | Option<ReferendumIndex> |
Call index: 16
Democracy.cancel_proposal
See [
Pallet::cancel_proposal].
api.tx.democracy.cancel_proposal(prop_index: Compact<u32>)| Argument | Type | Doc |
|---|---|---|
prop_index | Compact<u32> | PropIndex |
Call index: 17
Democracy.set_metadata
See [
Pallet::set_metadata].
api.tx.democracy.set_metadata(owner: {"_enum":{"External":"Null","Proposal":"u32","Referendum":"u32"}}, maybe_hash: Option<H256>)| Argument | Type | Doc |
|---|---|---|
owner | {"_enum":{"External":"Null","Proposal":"u32","Referendum":"u32"}} | MetadataOwner |
maybe_hash | Option<H256> | Option<PreimageHash> |
Call index: 18
Events
Democracy.Proposed
A motion has been proposed by a public account.
| Field | Type | Doc |
|---|---|---|
proposal_index | u32 | |
deposit | u128 |
Democracy.Tabled
A public proposal has been tabled for referendum vote.
| Field | Type | Doc |
|---|---|---|
proposal_index | u32 | |
deposit | u128 |
Democracy.ExternalTabled
An external proposal has been tabled.
No payload.
Democracy.Started
A referendum has begun.
| Field | Type | Doc |
|---|---|---|
ref_index | u32 | |
threshold | {"_enum":["SuperMajorityApprove","SuperMajorityAgainst","SimpleMajority"]} |
Democracy.Passed
A proposal has been approved by referendum.
| Field | Type | Doc |
|---|---|---|
ref_index | u32 |
Democracy.NotPassed
A proposal has been rejected by referendum.
| Field | Type | Doc |
|---|---|---|
ref_index | u32 |
Democracy.Cancelled
A referendum has been cancelled.
| Field | Type | Doc |
|---|---|---|
ref_index | u32 |
Democracy.Delegated
An account has delegated their vote to another account.
| Field | Type | Doc |
|---|---|---|
who | [u8;20] | |
target | [u8;20] |
Democracy.Undelegated
An account has cancelled a previous delegation operation.
| Field | Type | Doc |
|---|---|---|
account | [u8;20] |
Democracy.Vetoed
An external proposal has been vetoed.
| Field | Type | Doc |
|---|---|---|
who | [u8;20] | |
proposal_hash | H256 | |
until | u32 |
Democracy.Blacklisted
A proposal_hash has been blacklisted permanently.
| Field | Type | Doc |
|---|---|---|
proposal_hash | H256 |
Democracy.Voted
An account has voted in a referendum
| Field | Type | Doc |
|---|---|---|
voter | [u8;20] | |
ref_index | u32 | |
vote | {"_enum":{"Standard":"{\"vote\":\"Vote\",\"balance\":\"u128\"}","Split":"{\"aye\":\"u128\",\"nay\":\"u128\"}"}} |
Democracy.Seconded
An account has secconded a proposal
| Field | Type | Doc |
|---|---|---|
seconder | [u8;20] | |
prop_index | u32 |
Democracy.ProposalCanceled
A proposal got canceled.
| Field | Type | Doc |
|---|---|---|
prop_index | u32 |
Democracy.MetadataSet
Metadata for a proposal or a referendum has been set.
| Field | Type | Doc |
|---|---|---|
owner | {"_enum":{"External":"Null","Proposal":"u32","Referendum":"u32"}} | Metadata owner. |
hash | H256 | Preimage hash. |
Democracy.MetadataCleared
Metadata for a proposal or a referendum has been cleared.
| Field | Type | Doc |
|---|---|---|
owner | {"_enum":{"External":"Null","Proposal":"u32","Referendum":"u32"}} | Metadata owner. |
hash | H256 | Preimage hash. |
Democracy.MetadataTransferred
Metadata has been transferred to new owner.
| Field | Type | Doc |
|---|---|---|
prev_owner | {"_enum":{"External":"Null","Proposal":"u32","Referendum":"u32"}} | Previous metadata owner. |
owner | {"_enum":{"External":"Null","Proposal":"u32","Referendum":"u32"}} | New metadata owner. |
hash | H256 | Preimage hash. |
Errors
Democracy.ValueLow
Value too low
Democracy.ProposalMissing
Proposal does not exist
Democracy.AlreadyCanceled
Cannot cancel the same proposal twice
Democracy.DuplicateProposal
Proposal already made
Democracy.ProposalBlacklisted
Proposal still blacklisted
Democracy.NotSimpleMajority
Next external proposal not simple majority
Democracy.InvalidHash
Invalid hash
Democracy.NoProposal
No external proposal
Democracy.AlreadyVetoed
Identity may not veto a proposal twice
Democracy.ReferendumInvalid
Vote given for invalid referendum
Democracy.NoneWaiting
No proposals waiting
Democracy.NotVoter
The given account did not vote on the referendum.
Democracy.NoPermission
The actor has no permission to conduct the action.
Democracy.AlreadyDelegating
The account is already delegating.
Democracy.InsufficientFunds
Too high a balance was provided that the account cannot afford.
Democracy.NotDelegating
The account is not currently delegating.
Democracy.VotesExist
The account currently has votes attached to it and the operation cannot succeed until these are removed, either through
unvoteorreap_vote.
Democracy.InstantNotAllowed
The instant referendum origin is currently disallowed.
Democracy.Nonsense
Delegation to oneself makes no sense.
Democracy.WrongUpperBound
Invalid upper bound.
Democracy.MaxVotesReached
Maximum number of votes reached.
Democracy.TooMany
Maximum number of items reached.
Democracy.VotingPeriodLow
Voting period too low
Democracy.PreimageNotExist
The preimage does not exist.
Storage
Democracy.PublicPropCount
The number of (public) proposals that have been made so far.
await api.query.democracy.publicPropCount()Returns: u32
Modifier: Default
Democracy.PublicProps
The public proposals. Unsorted. The second item is the proposal.
await api.query.democracy.publicProps()Returns: Vec<(u32,FrameSupportPreimagesBounded,SeedPrimitivesSignatureAccountId20)>
Modifier: Default
Democracy.DepositOf
Those who have locked a deposit. TWOX-NOTE: Safe, as increasing integer keys are safe.
await api.query.democracy.depositOf(key1)- Key:
u32(hasher: Twox64Concat) - Returns:
(Vec<SeedPrimitivesSignatureAccountId20>,u128)
Modifier: Optional
Democracy.ReferendumCount
The next free referendum index, aka the number of referenda started so far.
await api.query.democracy.referendumCount()Returns: u32
Modifier: Default
Democracy.LowestUnbaked
The lowest referendum index representing an unbaked referendum. Equal to
ReferendumCountif there isn't a unbaked referendum.
await api.query.democracy.lowestUnbaked()Returns: u32
Modifier: Default
Democracy.ReferendumInfoOf
Information concerning any given referendum. TWOX-NOTE: SAFE as indexes are not under an attacker’s control.
await api.query.democracy.referendumInfoOf(key1)- Key:
u32(hasher: Twox64Concat) - Returns:
{"_enum":{"Ongoing":"PalletDemocracyReferendumStatus","Finished":"{\"approved\":\"bool\",\"end\":\"u32\"}"}}
Modifier: Optional
Democracy.VotingOf
All votes for a particular voter. We store the balance for the number of votes that we have recorded. The second item is the total amount of delegations, that will be added. TWOX-NOTE: SAFE as
AccountIds are crypto hashes anyway.
await api.query.democracy.votingOf(key1)- Key:
[u8;20](hasher: Twox64Concat) - Returns:
{"_enum":{"Direct":"{\"votes\":\"Vec<(u32,PalletDemocracyVoteAccountVote)>\",\"delegations\":\"PalletDemocracyDelegations\",\"locks\":\"Vec<(u32,PalletDemocracyVoteProposalLock)>\"}","Delegating":"{\"balance\":\"u128\",\"target\":\"SeedPrimitivesSignatureAccountId20\",\"conviction\":\"PalletDemocracyConviction\",\"delegations\":\"PalletDemocracyDelegations\",\"locks\":\"Vec<(u32,PalletDemocracyVoteProposalLock)>\"}"}}
Modifier: Default
Democracy.LastTabledWasExternal
True if the last referendum tabled was submitted externally. False if it was a public proposal.
await api.query.democracy.lastTabledWasExternal()Returns: bool
Modifier: Default
Democracy.NextExternal
The referendum to be tabled whenever it would be valid to table an external proposal. This happens when a referendum needs to be tabled and one of two conditions are met: -
LastTabledWasExternalisfalse; or -PublicPropsis empty.
await api.query.democracy.nextExternal()Returns: (FrameSupportPreimagesBounded,PalletDemocracyVoteThreshold)
Modifier: Optional
Democracy.Blacklist
A record of who vetoed what. Maps proposal hash to a possible existent block number (until when it may not be resubmitted) and who vetoed it.
await api.query.democracy.blacklist(key1)- Key:
H256(hasher: Identity) - Returns:
(u32,Vec<SeedPrimitivesSignatureAccountId20>)
Modifier: Optional
Democracy.Cancellations
Record of all proposals that have been subject to emergency cancellation.
await api.query.democracy.cancellations(key1)- Key:
H256(hasher: Identity) - Returns:
bool
Modifier: Default
Democracy.MetadataOf
General information concerning any proposal or referendum. The
PreimageHashrefers to the preimage of thePreimagesprovider which can be a JSON dump or IPFS hash of a JSON file. Consider a garbage collection for a metadata of finished referendums tounrequest(remove) large preimages.
await api.query.democracy.metadataOf(key1)- Key:
{"_enum":{"External":"Null","Proposal":"u32","Referendum":"u32"}}(hasher: Blake2_128Concat) - Returns:
H256
Modifier: Optional
Constants
Democracy.EnactmentPeriod
The period between a proposal being approved and enacted. It should generally be a little more than the unstake period to ensure that voting stakers have an opportunity to remove themselves from the system in the case where they are on the losing side of a vote.
Type: u32
SCALE-encoded value: 0x40e30900
Democracy.LaunchPeriod
How often (in blocks) new public referenda are launched.
Type: u32
SCALE-encoded value: 0x803a0900
Democracy.VotingPeriod
How often (in blocks) to check for new votes.
Type: u32
SCALE-encoded value: 0x803a0900
Democracy.VoteLockingPeriod
The minimum period of vote locking. It should be no shorter than enactment period to ensure that in the case of an approval, those successful voters are locked into the consequences that their votes entail.
Type: u32
SCALE-encoded value: 0xa04e0200
Democracy.MinimumDeposit
The minimum amount to be used as a deposit for a public referendum proposal.
Type: u128
SCALE-encoded value: 0x002f6859000000000000000000000000
Democracy.InstantAllowed
Indicator for whether an emergency origin is even allowed to happen. Some chains may want to set this permanently to
false, others may want to condition it on things such as an upgrade having happened recently.
Type: bool
SCALE-encoded value: 0x01
Democracy.FastTrackVotingPeriod
Minimum voting period allowed for a fast-track referendum.
Type: u32
SCALE-encoded value: 0x4b000000
Democracy.CooloffPeriod
Period in blocks where an external proposal may not be re-submitted after being vetoed.
Type: u32
SCALE-encoded value: 0x803a0900
Democracy.MaxVotes
The maximum number of votes for an account. Also used to compute weight, an overly big value can lead to extrinsic with very big weight: see
delegatefor instance.
Type: u32
SCALE-encoded value: 0xc8000000
Democracy.MaxProposals
The maximum number of public proposals that can exist at any time.
Type: u32
SCALE-encoded value: 0x64000000
Democracy.MaxDeposits
The maximum number of deposits a public proposal may have at any time.
Type: u32
SCALE-encoded value: 0x64000000
Democracy.MaxBlacklisted
The maximum number of items which can be blacklisted.
Type: u32
SCALE-encoded value: 0x64000000
wss://root.rootnet.live/archive/ws · captured 2026-05-02