Astroport: Common Types
This is a collection of common types and queriers which are commonly used in Astroport contracts.
Data Types
AssetInfo
AssetInfo is a convenience wrapper to represent whether a token is the native one (from a specific chain, like LUNA for Terra) or not and it also returns the contract address of that token.
Asset
It contains asset info and a token amount.
PairInfo
It is used to represent response data coming from a Pair-Info-Querier.
Queriers
Native Token Balance Querier
It uses the CosmWasm standard interface to query an account's balance.
Token Balance Querier
It provides a similar query interface to Native-Token-Balance-Querier for fetching CW20 token balances.
Token Supply Querier
It fetches a CW20 token's total supply.
Pair Info Querier
It returns an Astroport pair contract address if that pair is already available in the factory contract.
Liquidity Token Querier
It returns the address of a LP token if that LP token is already available (has a pair) on Astroport.
Swap Pairs Simulating
Simulate
Simulates a swap and returns the output amount, the spread and commission amounts.
Reverse Simulate
Simulates a reverse swap and returns an input amount, the spread and commission amounts.