1711 lines
62 KiB
JSON
1711 lines
62 KiB
JSON
{
|
|
"contract_name": "astroport-pair",
|
|
"contract_version": "2.2.0",
|
|
"idl_version": "1.0.0",
|
|
"instantiate": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "InstantiateMsg",
|
|
"description": "This structure describes the parameters used for creating a contract.",
|
|
"type": "object",
|
|
"required": [
|
|
"asset_infos",
|
|
"factory_addr",
|
|
"pair_type",
|
|
"token_code_id"
|
|
],
|
|
"properties": {
|
|
"asset_infos": {
|
|
"description": "Information about assets in the pool",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
},
|
|
"factory_addr": {
|
|
"description": "The factory contract address",
|
|
"type": "string"
|
|
},
|
|
"init_params": {
|
|
"description": "Optional binary serialised parameters for custom pool types",
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Binary"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"pair_type": {
|
|
"description": "The pair type",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/PairType"
|
|
}
|
|
]
|
|
},
|
|
"token_code_id": {
|
|
"description": "The token contract code ID used for the tokens in the pool",
|
|
"type": "integer",
|
|
"format": "uint64",
|
|
"minimum": 0.0
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"Binary": {
|
|
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
|
|
"type": "string"
|
|
},
|
|
"PairType": {
|
|
"description": "This enum describes available pair types. ## Available pool types ``` # use astroport::factory::PairType::{Custom, Stable, Xyk}; Xyk {}; Stable {}; Custom(String::from(\"Custom\")); ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "XYK pair type",
|
|
"type": "object",
|
|
"required": [
|
|
"xyk"
|
|
],
|
|
"properties": {
|
|
"xyk": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Stable pair type",
|
|
"type": "object",
|
|
"required": [
|
|
"stable"
|
|
],
|
|
"properties": {
|
|
"stable": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Custom pair type",
|
|
"type": "object",
|
|
"required": [
|
|
"custom"
|
|
],
|
|
"properties": {
|
|
"custom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"execute": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "ExecuteMsg",
|
|
"description": "This structure describes the execute messages available in the contract.",
|
|
"oneOf": [
|
|
{
|
|
"description": "Receives a message of type [`Cw20ReceiveMsg`]",
|
|
"type": "object",
|
|
"required": [
|
|
"receive"
|
|
],
|
|
"properties": {
|
|
"receive": {
|
|
"$ref": "#/definitions/Cw20ReceiveMsg"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "ProvideLiquidity allows someone to provide liquidity in the pool",
|
|
"type": "object",
|
|
"required": [
|
|
"provide_liquidity"
|
|
],
|
|
"properties": {
|
|
"provide_liquidity": {
|
|
"type": "object",
|
|
"required": [
|
|
"assets"
|
|
],
|
|
"properties": {
|
|
"assets": {
|
|
"description": "The assets available in the pool",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
}
|
|
},
|
|
"auto_stake": {
|
|
"description": "Determines whether the LP tokens minted for the user is auto_staked in the Incentives contract",
|
|
"type": [
|
|
"boolean",
|
|
"null"
|
|
]
|
|
},
|
|
"min_lp_to_receive": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"receiver": {
|
|
"description": "The receiver of LP tokens",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"slippage_tolerance": {
|
|
"description": "The slippage tolerance that allows liquidity provision only if the price in the pool doesn't move too much",
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "WithdrawLiquidity allows someone to withdraw liquidity from the pool",
|
|
"type": "object",
|
|
"required": [
|
|
"withdraw_liquidity"
|
|
],
|
|
"properties": {
|
|
"withdraw_liquidity": {
|
|
"type": "object",
|
|
"properties": {
|
|
"assets": {
|
|
"default": [],
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
}
|
|
},
|
|
"min_assets_to_receive": {
|
|
"type": [
|
|
"array",
|
|
"null"
|
|
],
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Swap performs a swap in the pool",
|
|
"type": "object",
|
|
"required": [
|
|
"swap"
|
|
],
|
|
"properties": {
|
|
"swap": {
|
|
"type": "object",
|
|
"required": [
|
|
"offer_asset"
|
|
],
|
|
"properties": {
|
|
"ask_asset_info": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"belief_price": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"max_spread": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"offer_asset": {
|
|
"$ref": "#/definitions/Asset"
|
|
},
|
|
"to": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Update the pair configuration",
|
|
"type": "object",
|
|
"required": [
|
|
"update_config"
|
|
],
|
|
"properties": {
|
|
"update_config": {
|
|
"type": "object",
|
|
"required": [
|
|
"params"
|
|
],
|
|
"properties": {
|
|
"params": {
|
|
"$ref": "#/definitions/Binary"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "ProposeNewOwner creates a proposal to change contract ownership. The validity period for the proposal is set in the `expires_in` variable.",
|
|
"type": "object",
|
|
"required": [
|
|
"propose_new_owner"
|
|
],
|
|
"properties": {
|
|
"propose_new_owner": {
|
|
"type": "object",
|
|
"required": [
|
|
"expires_in",
|
|
"owner"
|
|
],
|
|
"properties": {
|
|
"expires_in": {
|
|
"description": "The date after which this proposal expires",
|
|
"type": "integer",
|
|
"format": "uint64",
|
|
"minimum": 0.0
|
|
},
|
|
"owner": {
|
|
"description": "Newly proposed contract owner",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "DropOwnershipProposal removes the existing offer to change contract ownership.",
|
|
"type": "object",
|
|
"required": [
|
|
"drop_ownership_proposal"
|
|
],
|
|
"properties": {
|
|
"drop_ownership_proposal": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Used to claim contract ownership.",
|
|
"type": "object",
|
|
"required": [
|
|
"claim_ownership"
|
|
],
|
|
"properties": {
|
|
"claim_ownership": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Custom execute endpoints for extended pool implementations",
|
|
"type": "object",
|
|
"required": [
|
|
"custom"
|
|
],
|
|
"properties": {
|
|
"custom": {
|
|
"$ref": "#/definitions/Empty"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
],
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"Asset": {
|
|
"description": "This enum describes a Terra asset (native or CW20).",
|
|
"type": "object",
|
|
"required": [
|
|
"amount",
|
|
"info"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"description": "A token amount",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"info": {
|
|
"description": "Information about an asset stored in a [`AssetInfo`] struct",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"Binary": {
|
|
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
|
|
"type": "string"
|
|
},
|
|
"Cw20ReceiveMsg": {
|
|
"description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg",
|
|
"type": "object",
|
|
"required": [
|
|
"amount",
|
|
"msg",
|
|
"sender"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"$ref": "#/definitions/Uint128"
|
|
},
|
|
"msg": {
|
|
"$ref": "#/definitions/Binary"
|
|
},
|
|
"sender": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"Decimal": {
|
|
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
|
|
"type": "string"
|
|
},
|
|
"Empty": {
|
|
"description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)",
|
|
"type": "object"
|
|
},
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"query": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "QueryMsg",
|
|
"description": "This structure describes the query messages available in the contract.",
|
|
"oneOf": [
|
|
{
|
|
"description": "Returns information about a pair in an object of type [`super::asset::PairInfo`].",
|
|
"type": "object",
|
|
"required": [
|
|
"pair"
|
|
],
|
|
"properties": {
|
|
"pair": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns information about a pool in an object of type [`PoolResponse`].",
|
|
"type": "object",
|
|
"required": [
|
|
"pool"
|
|
],
|
|
"properties": {
|
|
"pool": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns contract configuration settings in a custom [`ConfigResponse`] structure.",
|
|
"type": "object",
|
|
"required": [
|
|
"config"
|
|
],
|
|
"properties": {
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns information about the share of the pool in a vector that contains objects of type [`Asset`].",
|
|
"type": "object",
|
|
"required": [
|
|
"share"
|
|
],
|
|
"properties": {
|
|
"share": {
|
|
"type": "object",
|
|
"required": [
|
|
"amount"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns information about a swap simulation in a [`SimulationResponse`] object.",
|
|
"type": "object",
|
|
"required": [
|
|
"simulation"
|
|
],
|
|
"properties": {
|
|
"simulation": {
|
|
"type": "object",
|
|
"required": [
|
|
"offer_asset"
|
|
],
|
|
"properties": {
|
|
"ask_asset_info": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"offer_asset": {
|
|
"$ref": "#/definitions/Asset"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns information about cumulative prices in a [`ReverseSimulationResponse`] object.",
|
|
"type": "object",
|
|
"required": [
|
|
"reverse_simulation"
|
|
],
|
|
"properties": {
|
|
"reverse_simulation": {
|
|
"type": "object",
|
|
"required": [
|
|
"ask_asset"
|
|
],
|
|
"properties": {
|
|
"ask_asset": {
|
|
"$ref": "#/definitions/Asset"
|
|
},
|
|
"offer_asset_info": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns information about the cumulative prices in a [`CumulativePricesResponse`] object",
|
|
"type": "object",
|
|
"required": [
|
|
"cumulative_prices"
|
|
],
|
|
"properties": {
|
|
"cumulative_prices": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns current D invariant in as a [`u128`] value",
|
|
"type": "object",
|
|
"required": [
|
|
"query_compute_d"
|
|
],
|
|
"properties": {
|
|
"query_compute_d": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns the balance of the specified asset that was in the pool just preceeding the moment of the specified block height creation.",
|
|
"type": "object",
|
|
"required": [
|
|
"asset_balance_at"
|
|
],
|
|
"properties": {
|
|
"asset_balance_at": {
|
|
"type": "object",
|
|
"required": [
|
|
"asset_info",
|
|
"block_height"
|
|
],
|
|
"properties": {
|
|
"asset_info": {
|
|
"$ref": "#/definitions/AssetInfo"
|
|
},
|
|
"block_height": {
|
|
"$ref": "#/definitions/Uint64"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Query price from observations",
|
|
"type": "object",
|
|
"required": [
|
|
"observe"
|
|
],
|
|
"properties": {
|
|
"observe": {
|
|
"type": "object",
|
|
"required": [
|
|
"seconds_ago"
|
|
],
|
|
"properties": {
|
|
"seconds_ago": {
|
|
"type": "integer",
|
|
"format": "uint64",
|
|
"minimum": 0.0
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns an estimation of assets received for the given amount of LP tokens",
|
|
"type": "object",
|
|
"required": [
|
|
"simulate_withdraw"
|
|
],
|
|
"properties": {
|
|
"simulate_withdraw": {
|
|
"type": "object",
|
|
"required": [
|
|
"lp_amount"
|
|
],
|
|
"properties": {
|
|
"lp_amount": {
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Returns an estimation of shares received for the given amount of assets",
|
|
"type": "object",
|
|
"required": [
|
|
"simulate_provide"
|
|
],
|
|
"properties": {
|
|
"simulate_provide": {
|
|
"type": "object",
|
|
"required": [
|
|
"assets"
|
|
],
|
|
"properties": {
|
|
"assets": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
}
|
|
},
|
|
"slippage_tolerance": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
],
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"Asset": {
|
|
"description": "This enum describes a Terra asset (native or CW20).",
|
|
"type": "object",
|
|
"required": [
|
|
"amount",
|
|
"info"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"description": "A token amount",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"info": {
|
|
"description": "Information about an asset stored in a [`AssetInfo`] struct",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"Decimal": {
|
|
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
|
|
"type": "string"
|
|
},
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
},
|
|
"Uint64": {
|
|
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"migrate": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "MigrateMsg",
|
|
"description": "This structure describes a migration message. We currently take no arguments for migrations.",
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"sudo": null,
|
|
"responses": {
|
|
"asset_balance_at": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Nullable_Uint128",
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"definitions": {
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"config": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "ConfigResponse",
|
|
"description": "This struct is used to return a query result with the general contract configuration.",
|
|
"type": "object",
|
|
"required": [
|
|
"block_time_last",
|
|
"factory_addr",
|
|
"owner"
|
|
],
|
|
"properties": {
|
|
"block_time_last": {
|
|
"description": "Last timestamp when the cumulative prices in the pool were updated",
|
|
"type": "integer",
|
|
"format": "uint64",
|
|
"minimum": 0.0
|
|
},
|
|
"factory_addr": {
|
|
"description": "The factory contract address",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
]
|
|
},
|
|
"owner": {
|
|
"description": "The contract owner",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
]
|
|
},
|
|
"params": {
|
|
"description": "The pool's parameters",
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Binary"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"tracker_addr": {
|
|
"description": "Tracker contract address",
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Addr"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"Binary": {
|
|
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"cumulative_prices": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "CumulativePricesResponse",
|
|
"description": "This structure is used to return a cumulative prices query response.",
|
|
"type": "object",
|
|
"required": [
|
|
"assets",
|
|
"cumulative_prices",
|
|
"total_share"
|
|
],
|
|
"properties": {
|
|
"assets": {
|
|
"description": "The assets in the pool to query",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
}
|
|
},
|
|
"cumulative_prices": {
|
|
"description": "The vector contains cumulative prices for each pair of assets in the pool",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
],
|
|
"maxItems": 3,
|
|
"minItems": 3
|
|
}
|
|
},
|
|
"total_share": {
|
|
"description": "The total amount of LP tokens currently issued",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"Asset": {
|
|
"description": "This enum describes a Terra asset (native or CW20).",
|
|
"type": "object",
|
|
"required": [
|
|
"amount",
|
|
"info"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"description": "A token amount",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"info": {
|
|
"description": "Information about an asset stored in a [`AssetInfo`] struct",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"observe": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "OracleObservation",
|
|
"type": "object",
|
|
"required": [
|
|
"price",
|
|
"timestamp"
|
|
],
|
|
"properties": {
|
|
"price": {
|
|
"$ref": "#/definitions/Decimal"
|
|
},
|
|
"timestamp": {
|
|
"type": "integer",
|
|
"format": "uint64",
|
|
"minimum": 0.0
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Decimal": {
|
|
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"pair": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "PairInfo",
|
|
"description": "This structure stores the main parameters for an Astroport pair",
|
|
"type": "object",
|
|
"required": [
|
|
"asset_infos",
|
|
"contract_addr",
|
|
"liquidity_token",
|
|
"pair_type"
|
|
],
|
|
"properties": {
|
|
"asset_infos": {
|
|
"description": "Asset information for the assets in the pool",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
},
|
|
"contract_addr": {
|
|
"description": "Pair contract address",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
]
|
|
},
|
|
"liquidity_token": {
|
|
"description": "Pair LP token denom",
|
|
"type": "string"
|
|
},
|
|
"pair_type": {
|
|
"description": "The pool type (xyk, stableswap etc) available in [`PairType`]",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/PairType"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"PairType": {
|
|
"description": "This enum describes available pair types. ## Available pool types ``` # use astroport::factory::PairType::{Custom, Stable, Xyk}; Xyk {}; Stable {}; Custom(String::from(\"Custom\")); ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "XYK pair type",
|
|
"type": "object",
|
|
"required": [
|
|
"xyk"
|
|
],
|
|
"properties": {
|
|
"xyk": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Stable pair type",
|
|
"type": "object",
|
|
"required": [
|
|
"stable"
|
|
],
|
|
"properties": {
|
|
"stable": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Custom pair type",
|
|
"type": "object",
|
|
"required": [
|
|
"custom"
|
|
],
|
|
"properties": {
|
|
"custom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"pool": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "PoolResponse",
|
|
"description": "This struct is used to return a query result with the total amount of LP tokens and assets in a specific pool.",
|
|
"type": "object",
|
|
"required": [
|
|
"assets",
|
|
"total_share"
|
|
],
|
|
"properties": {
|
|
"assets": {
|
|
"description": "The assets in the pool together with asset amounts",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
}
|
|
},
|
|
"total_share": {
|
|
"description": "The total amount of LP tokens currently issued",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"Asset": {
|
|
"description": "This enum describes a Terra asset (native or CW20).",
|
|
"type": "object",
|
|
"required": [
|
|
"amount",
|
|
"info"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"description": "A token amount",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"info": {
|
|
"description": "Information about an asset stored in a [`AssetInfo`] struct",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"query_compute_d": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Uint128",
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
},
|
|
"reverse_simulation": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "ReverseSimulationResponse",
|
|
"description": "This structure holds the parameters that are returned from a reverse swap simulation response.",
|
|
"type": "object",
|
|
"required": [
|
|
"commission_amount",
|
|
"offer_amount",
|
|
"spread_amount"
|
|
],
|
|
"properties": {
|
|
"commission_amount": {
|
|
"description": "The amount of fees charged by the transaction",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"offer_amount": {
|
|
"description": "The amount of offer assets returned by the reverse swap",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"spread_amount": {
|
|
"description": "The spread used in the swap operation",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"share": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Array_of_Asset",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
},
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"Asset": {
|
|
"description": "This enum describes a Terra asset (native or CW20).",
|
|
"type": "object",
|
|
"required": [
|
|
"amount",
|
|
"info"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"description": "A token amount",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"info": {
|
|
"description": "Information about an asset stored in a [`AssetInfo`] struct",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"simulate_provide": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Uint128",
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
},
|
|
"simulate_withdraw": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Array_of_Asset",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Asset"
|
|
},
|
|
"definitions": {
|
|
"Addr": {
|
|
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
|
|
"type": "string"
|
|
},
|
|
"Asset": {
|
|
"description": "This enum describes a Terra asset (native or CW20).",
|
|
"type": "object",
|
|
"required": [
|
|
"amount",
|
|
"info"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"description": "A token amount",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"info": {
|
|
"description": "Information about an asset stored in a [`AssetInfo`] struct",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"AssetInfo": {
|
|
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
|
|
"oneOf": [
|
|
{
|
|
"description": "Non-native Token",
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "object",
|
|
"required": [
|
|
"contract_addr"
|
|
],
|
|
"properties": {
|
|
"contract_addr": {
|
|
"$ref": "#/definitions/Addr"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Native token",
|
|
"type": "object",
|
|
"required": [
|
|
"native_token"
|
|
],
|
|
"properties": {
|
|
"native_token": {
|
|
"type": "object",
|
|
"required": [
|
|
"denom"
|
|
],
|
|
"properties": {
|
|
"denom": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"simulation": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "SimulationResponse",
|
|
"description": "This structure holds the parameters that are returned from a swap simulation response",
|
|
"type": "object",
|
|
"required": [
|
|
"commission_amount",
|
|
"return_amount",
|
|
"spread_amount"
|
|
],
|
|
"properties": {
|
|
"commission_amount": {
|
|
"description": "The amount of fees charged by the transaction",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"return_amount": {
|
|
"description": "The amount of ask assets returned by the swap",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"spread_amount": {
|
|
"description": "The spread used in the swap operation",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Uint128": {
|
|
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|