Common Types
Overview
Types used across Astroport contracts, from the astroport package.
Links
- Github: https://github.com/astroport-fi/astroport-core/tree/main/packages/astroport
- asset.rs: https://github.com/astroport-fi/astroport-core/blob/main/packages/astroport/src/asset.rs
- common.rs: https://github.com/astroport-fi/astroport-core/blob/main/packages/astroport/src/common.rs
Data Types
AssetInfo
Identifies an asset: a native denom (bank, IBC or tokenfactory, such as uluna or factory/<creator>/<subdenom>) or a CW20 token contract.
| Variants | Description |
|---|---|
token | A CW20 token: {"token": {"contract_addr": "terra1..."}} |
native_token | A native denom: {"native_token": {"denom": "uluna"}} |
Asset
An asset and an amount.
| Params | Type | Description |
|---|---|---|
info | AssetInfo | The asset |
amount | Uint128 | The amount, in the asset's smallest unit |
DecimalAsset
An asset with a decimal amount.
| Params | Type | Description |
|---|---|---|
info | AssetInfo | The asset |
amount | Decimal256 | The amount as a decimal |
PairInfo
Describes a pool. Returned by a pool's pair query and the factory's pair and pairs queries.
| Params | Type | Description |
|---|---|---|
asset_infos | Vec<AssetInfo> | The pool's assets |
contract_addr | Addr | The pool contract address |
liquidity_token | String | The LP token: a tokenfactory denom (factory/<pool>/astroport/share) for current pools, or a CW20 address for older ones |
pair_type | PairType | The pool type |
OwnershipProposal
A pending offer to change a contract's owner, created by propose_new_owner.
| Params | Type | Description |
|---|---|---|
owner | Addr | The proposed owner |
ttl | u64 | Time (in seconds since epoch) when the offer expires |