Mars Protocol
Search…
xMARS Token
​
The xMARS Token contract is a Cw20 fork with added snapshot functionality in order to compute voting power for proposals. xMARS are minted by the Staking contract when addresses stake MARS.

Links

QueryMsg

Balance

Returns the current balance of the given address, 0 if unset.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Balance {
address: String
}
}
{
"balance": {
"address": "terra..."
}
}
Key
Type
Description
address
String
Address to return current balance from

BalanceAt

Returns the balance of the given address at a given block.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
BalanceAt {
address: String,
block: u64
}
}
{
"balance_at": {
"address": "terra...",
"block": 999
}
}
Key
Type
Description
address
String
Address to return balance from
block
u64
Current block to return balance from

TokenInfo

Returns metadata on the contract - name, decimals, supply, etc.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
TokenInfo {}
}
{
"token_info": {}
}

TotalSupplyAt

Total Supply at a given block.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
TotalSupplyAt {
block: u64
}
}
{
"total_supply_at": {
"block": 999
}
}
Key
Text
Text
block
u64
Current block to return total supply

Minter

Returns the minter of the contract.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Minter {}
}
{
"minter": {}
}

Allowance

Only with "allowance" extension. Returns how much spender can use from owner account, 0 if unset.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Allowance {
owner: String,
spender: String
}
}
{
"allowance": {
"owner": "terra...",
"spender": "terra..."
}
}
Key
Type
Description
owner
String
Owner contract address
spender
String
Spender contract address

AllAllowances

Only with "enumerable" extension (and "allowances"). Returns all allowances this owner has approved. Supports pagination.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
AllAllowances {
owner: String,
start_after: Option<String>,
limit: Option<u32>
}
}
{
"all_allowances": {
"owner": "terra...",
"start_after": "terra...",
"limit": 10
}
}
Key
Type
Description
owner
String
Owner address to return approved allowances from
start_after*
String
Address to start after
limit*
u32
Limit of query return
* = optional

AllAccounts

Only with "enumerable" extension. Returns all accounts that have balances. Supports pagination.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
AllAccounts {
start_after: Option<String>,
limit: Option<u32>
}
}
{
"all_accounts": {
"start_after": "terra...",
"limit": 10
}
}
Key
Type
Description
start_after*
String
Address to start after
limit*
u32
Limit of query return
* = optional

MarketingInfo

Only with "marketing" extension. Returns more metadata on the contract to display in the client: description, logo, project url, etc.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
MarketingInfo {}
}
{
"marketing_info": {}
}
Only with "marketing" extension. ownloads the mbeded logo data (if stored on chain). Errors if no logo data ftored for this contract.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
DownloadLogo {}
}
{
"download_logo": {}
}
Last modified 3mo ago