Skip to main content Link Search Menu Expand Document (external link)

WIP

Vote Contract Queries

Table of contents
  1. Vote Contract Queries
    1. Token Info
    2. All Accounts
    3. Initial Accounts
    4. Balance
    5. Votes

Token Info

Gets the on-chain information about the vote token.


        
  
{
  token_info: {}
}


      

        
  
{
  "token_info": {}
}


      

        
  
{
  "data": {
    "name": "Foo_name",
    "symbol": "TEST",
    "decimals": 6,
    "total_supply": "2499995"
  }
}


      

All Accounts

Gets all wallet addressess that hold vote tokens.


        
  
{
  all_accounts: {}
}


      

        
  
{
  "all_accounts": {}
}


      

        
  
{
  "data": {
    "accounts": [
      "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp"
    ]
  }
}


      

Initial Accounts

Gets all wallet addresses that held vote tokens for a vote that has been finalized.


        
  
{
  initial_accounts: {}
}


      

        
  
{
  "initial_accounts": {}
}


      

        
  
{
  "data": {
    "accounts": [
      "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp"
    ]
  }
}


      

Balance

Returns the number of votes the specified address has.


        
  
{
  balance: { 
    address: "[account_address]"
  }
}


      

        
  
{
  "balance": { 
    "address": "[account_address]"
  }
}


      

        
  
{
  "data": {
    "balance": "2499995"
  }
}


      

Votes

Returns the total number of votes available, the voting expiration block, the block quorum was reached if it has, the block voting ends on, and the current state of the proposal. It will also return the total counts of each vote option in the case of emergency votes and after the end of the standard vote.


        
  
{
  votes: {}
}


      

        
  
{
  "votes": {}
}


      

        
  
{
  "data": {
    "affirm": "0",
    "deny": "0",
    "deny_with_penalty": "0",
    "abstain": "0",
    "total_supply": "2499995",
    "expiration": 203048,
    "quorum_block": null,
    "vote_state": {
      "InProgress": {}
    }
  }
}