bindings

package
v13.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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 ArithmeticTwapToNow 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"`
}

type BurnTokens

type BurnTokens struct {
	Denom  string  `json:"denom"`
	Amount sdk.Int `json:"amount"`
	// BurnFromAddress must be set to "" for now.
	BurnFromAddress string `json:"burn_from_address"`
}

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 ExactIn

type ExactIn struct {
	Input     sdk.Int `json:"input"`
	MinOutput sdk.Int `json:"min_output"`
}

type ExactOut

type ExactOut struct {
	MaxInput sdk.Int `json:"max_input"`
	Output   sdk.Int `json:"output"`
}

type FullDenom

type FullDenom struct {
	CreatorAddr string `json:"creator_addr"`
	Subdenom    string `json:"subdenom"`
}

type FullDenomResponse

type FullDenomResponse struct {
	Denom string `json:"denom"`
}

type MintTokens

type MintTokens struct {
	Denom         string  `json:"denom"`
	Amount        sdk.Int `json:"amount"`
	MintToAddress string  `json:"mint_to_address"`
}

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 PoolAssets struct {
	Assets []sdk.Coin
	Shares sdk.Coin
}

type PoolState

type PoolState struct {
	PoolId uint64 `json:"id"`
}

type PoolStateResponse

type PoolStateResponse struct {
	/// The various assets that be swapped. Including current liquidity.
	Assets []wasmvmtypes.Coin `json:"assets"`
	/// The number of LP shares and their amount
	Shares wasmvmtypes.Coin `json:"shares"`
}

type SpotPrice

type SpotPrice struct {
	Swap        Swap `json:"swap"`
	WithSwapFee bool `json:"with_swap_fee"`
}

type SpotPriceResponse

type SpotPriceResponse struct {
	/// How many output we would get for 1 input
	Price string `json:"price"`
}

type Step

type Step struct {
	PoolId   uint64 `json:"pool_id"`
	DenomOut string `json:"denom_out"`
}

type Swap

type Swap struct {
	PoolId   uint64 `json:"pool_id"`
	DenomIn  string `json:"denom_in"`
	DenomOut string `json:"denom_out"`
}

type SwapAmount

type SwapAmount struct {
	In  *sdk.Int `json:"in,omitempty"`
	Out *sdk.Int `json:"out,omitempty"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL