Documentation ¶
Index ¶
- type ArithmeticTwap
- type ArithmeticTwapToNow
- type BurnTokens
- type ChangeAdmin
- type CreateDenom
- type DenomAdmin
- type DenomAdminResponse
- type EstimatePriceResponse
- type EstimateSwap
- type ExactIn
- type ExactOut
- type FullDenom
- type FullDenomResponse
- type MintTokens
- type OsmosisMsg
- type OsmosisQuery
- type PoolAssets
- type PoolState
- type PoolStateResponse
- type SpotPrice
- type SpotPriceResponse
- type Step
- type Swap
- type SwapAmount
- type SwapAmountWithLimit
- type SwapMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArithmeticTwap ¶
type ArithmeticTwap struct { PoolId uint64 `json:"id"` QuoteAssetDenom string `json:"quote_asset_denom"` BaseAssetDenom string `json:"base_asset_denom"` // NOTE: StartTime is expected to be in Unix time milliseconds. StartTime int64 `json:"start_time"` // NOTE: EndTime is expected to be in Unix time milliseconds. EndTime int64 `json:"end_time"` }
type ArithmeticTwapToNow ¶
type BurnTokens ¶
type ChangeAdmin ¶
type ChangeAdmin struct { Denom string `json:"denom"` NewAdminAddress string `json:"new_admin_address"` }
ChangeAdmin changes the admin for a factory denom. If the NewAdminAddress is empty, the denom has no admin.
type CreateDenom ¶
type CreateDenom struct {
Subdenom string `json:"subdenom"`
}
CreateDenom creates a new factory denom, of denomination: factory/{creating contract address}/{Subdenom} Subdenom can be of length at most 44 characters, in [0-9a-zA-Z./] The (creating contract address, subdenom) pair must be unique. The created denom's admin is the creating contract address, but this admin can be changed using the ChangeAdmin binding.
type DenomAdmin ¶
type DenomAdmin struct {
Subdenom string `json:"subdenom"`
}
type DenomAdminResponse ¶
type DenomAdminResponse struct {
Admin string `json:"admin"`
}
type EstimatePriceResponse ¶
type EstimatePriceResponse struct { // If you query with SwapAmount::Input, this is SwapAmount::Output. // If you query with SwapAmount::Output, this is SwapAmount::Input. Amount SwapAmount `json:"swap_amount"` }
type EstimateSwap ¶
type EstimateSwap struct { Sender string `json:"sender"` First Swap `json:"first"` Route []Step `json:"route"` Amount SwapAmount `json:"amount"` }
func (*EstimateSwap) ToSwapMsg ¶
func (e *EstimateSwap) ToSwapMsg() *SwapMsg
type FullDenomResponse ¶
type FullDenomResponse struct {
Denom string `json:"denom"`
}
type MintTokens ¶
type OsmosisMsg ¶
type OsmosisMsg struct { /// Contracts can create denoms, namespaced under the contract's address. /// A contract may create any number of independent sub-denoms. CreateDenom *CreateDenom `json:"create_denom,omitempty"` /// Contracts can change the admin of a denom that they are the admin of. ChangeAdmin *ChangeAdmin `json:"change_admin,omitempty"` /// Contracts can mint native tokens for an existing factory denom /// that they are the admin of. MintTokens *MintTokens `json:"mint_tokens,omitempty"` /// Contracts can burn native tokens for an existing factory denom /// that they are the admin of. /// Currently, the burn from address must be the admin contract. BurnTokens *BurnTokens `json:"burn_tokens,omitempty"` /// Swap over one or more pools Swap *SwapMsg `json:"swap,omitempty"` }
type OsmosisQuery ¶
type OsmosisQuery struct { /// Given a subdenom minted by a contract via `OsmosisMsg::MintTokens`, /// returns the full denom as used by `BankMsg::Send`. FullDenom *FullDenom `json:"full_denom,omitempty"` /// For a given pool ID, list all tokens traded on it with current liquidity (spot). /// As well as the total number of LP shares and their denom. PoolState *PoolState `json:"pool_state,omitempty"` /// Return current spot price swapping In for Out on given pool ID. /// Warning: this can easily be manipulated via sandwich attacks, do not use as price oracle. /// We will add TWAP for more robust price feed. SpotPrice *SpotPrice `json:"spot_price,omitempty"` /// Return current spot price swapping In for Out on given pool ID. EstimateSwap *EstimateSwap `json:"estimate_swap,omitempty"` /// Returns the admin of a denom, if the denom is a Token Factory denom. DenomAdmin *DenomAdmin `json:"denom_admin,omitempty"` }
OsmosisQuery contains osmosis custom queries. See https://github.com/osmosis-labs/osmosis-bindings/blob/main/packages/bindings/src/query.rs
type PoolAssets ¶
type PoolStateResponse ¶
type PoolStateResponse struct { /// The various assets that be swapped. Including current liquidity. Assets []wasmvmtypes.Coin `json:"assets"` Shares wasmvmtypes.Coin `json:"shares"` }
type SpotPriceResponse ¶
type SpotPriceResponse struct { /// How many output we would get for 1 input Price string `json:"price"` }
type SwapAmount ¶
func (SwapAmount) Unlimited ¶
func (s SwapAmount) Unlimited() SwapAmountWithLimit
This returns SwapAmountWithLimit with the largest possible limits (that will never be hit)
type SwapAmountWithLimit ¶
type SwapAmountWithLimit struct { ExactIn *ExactIn `json:"exact_in,omitempty"` ExactOut *ExactOut `json:"exact_out,omitempty"` }
func (SwapAmountWithLimit) RemoveLimit ¶
func (s SwapAmountWithLimit) RemoveLimit() SwapAmount
This returns the amount without min/max to use as simpler argument
type SwapMsg ¶
type SwapMsg struct { First Swap `json:"first"` Route []Step `json:"route"` Amount SwapAmountWithLimit `json:"amount"` }