Skip to main content

Escrow

Query Messages

note

We will only go through the queries for this contract, as users are not allowed to execute any messages on the Escrow contract directly. You can read about the Escrow architecture here

List of queries that can be performed on the Escrow contract.

TokenId

Queries the token Id of the token being held in the escrow.

pub enum QueryMsg {
    #[returns(TokenIdResponse)]
    TokenId {},
}
{"token_id":{}}

The query returns the following response:

pub struct TokenIdResponse {
pub token_id: String,
}
NameTypeDescription
token_idStringThe unique Id for the token type held in the escrow.

TokenAllowed

Checks if the specified token is allowed to be stored in this escrow.

pub enum QueryMsg {
    #[returns(AllowedTokenResponse)]
    TokenAllowed { denom: TokenType },
}
JSON Example: 
{
  "token_allowed": {
    "denom": {
      "native": {
        "denom": "native-denom"
      }
    }
  }
}

 

NameTypeDescription
denomTokenTypeThe type of token. Returns the denom for native and CW20 contract address for CW20 token.

The query returns the following response:


pub struct AllowedTokenResponse {
pub allowed: bool,
}
NameDescription
allowedSet to true if the specified token is allowed in this escrow and false otherwise.

AllowedDenoms

Queries all the tokens allowed to be stored in the escrow.

pub enum QueryMsg {
     #[returns(AllowedDenomsResponse)]
    AllowedDenoms {},
}
JSON Example: 
{
  "allowed_denoms": {}
}

The query returns the following response:

pub struct AllowedDenomsResponse {
pub denoms: Vec<TokenType>,
}
NameTypeDescription
denomsVec<TokenType>A list of allowed token types .