Sei Bindings for Cosmwasm Contracts
This crate provides Sei specific bindings for cosmwasm contract to be able to interact with the Sei blockchain by exposing custom messages, queries, and structs that correspond to custom module functionality in the Sei chain.
Installation
Add the sei-cosmwasm dependency to your smart contract's Cargo.toml file:
[]
= { = "0.3.0" }
Functionality
Currently, Sei Bindings support query and message support for the sei custom modules Oracle, Dex, Epoch and TokenFactory. The supported functionality includes the following:
- Oracle
- Query
- ExchangeRates
- Gets the exchange rates for supported assets
- OracleTwaps
- Gets the time weighted average price for supported assets
- ExchangeRates
- Query
- Dex
- Query
- DexTwaps
- Gets time weighted average prices for assets on the specific order book
- GetOrders
- Get orders by a specific account on the dex order book
- GetOrderById
- Get individual order by order ID
- DexTwaps
- Message
- PlaceOrders
- Bulk place orders with the dex order book
- CancelOrders
- Bulk cancel orders with the dex order book
- PlaceOrders
- Query
- Epoch
- Query
- Epoch
- Get current epoch information
- Epoch
- Query
- TokenFactory
- Message
- CreateDenom
- Creates a denom of type
factory/{creator address}/{subdenom}given asubdenom.
- Creates a denom of type
- MintTokens
- Mint an amount of a factory denom. Only the creator of the denom (admin) can mint.
- BurnTokens
- Burns an amount of a factory denom. Only the creater of the denom (admin) can mint.
- ChangeAdmin
- Change the Admin of the Denom. Only the current admin can change the admin.
- CreateDenom
- Message
Usage
Querying
To use these custom queries with the sei chain, you can create an instance of SeiQuerier and call the query helper functions with the appropriate parameters.
let querier = new;
let res: ExchangeRatesResponse = querier.query_exchange_rates?;
Messages
To use the custom messages, the messages need to be returned in the contract response to be executed by the sei chain.
let test_order = PlaceOrders ;
Ok