562 lines
20 KiB
JSON
562 lines
20 KiB
JSON
{
|
|
"contract_name": "astroport-router",
|
|
"contract_version": "1.3.1",
|
|
"idl_version": "1.0.0",
|
|
"instantiate": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "InstantiateMsg",
|
|
"description": "This structure holds the parameters used for creating a contract.",
|
|
"type": "object",
|
|
"required": [
|
|
"astroport_factory"
|
|
],
|
|
"properties": {
|
|
"astroport_factory": {
|
|
"description": "The astroport factory contract address",
|
|
"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": "Receive receives a message of type [`Cw20ReceiveMsg`] and processes it depending on the received template",
|
|
"type": "object",
|
|
"required": [
|
|
"receive"
|
|
],
|
|
"properties": {
|
|
"receive": {
|
|
"$ref": "#/definitions/Cw20ReceiveMsg"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "ExecuteSwapOperations processes multiple swaps while mentioning the minimum amount of tokens to receive for the last swap operation",
|
|
"type": "object",
|
|
"required": [
|
|
"execute_swap_operations"
|
|
],
|
|
"properties": {
|
|
"execute_swap_operations": {
|
|
"type": "object",
|
|
"required": [
|
|
"operations"
|
|
],
|
|
"properties": {
|
|
"max_spread": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"minimum_receive": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"operations": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/SwapOperation"
|
|
}
|
|
},
|
|
"to": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "Internal use ExecuteSwapOperation executes a single swap operation",
|
|
"type": "object",
|
|
"required": [
|
|
"execute_swap_operation"
|
|
],
|
|
"properties": {
|
|
"execute_swap_operation": {
|
|
"type": "object",
|
|
"required": [
|
|
"operation",
|
|
"single"
|
|
],
|
|
"properties": {
|
|
"max_spread": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"operation": {
|
|
"$ref": "#/definitions/SwapOperation"
|
|
},
|
|
"single": {
|
|
"type": "boolean"
|
|
},
|
|
"to": {
|
|
"type": [
|
|
"string",
|
|
"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"
|
|
},
|
|
"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"
|
|
},
|
|
"SwapOperation": {
|
|
"description": "This enum describes a swap operation.",
|
|
"oneOf": [
|
|
{
|
|
"description": "Native swap",
|
|
"type": "object",
|
|
"required": [
|
|
"native_swap"
|
|
],
|
|
"properties": {
|
|
"native_swap": {
|
|
"type": "object",
|
|
"required": [
|
|
"ask_denom",
|
|
"offer_denom"
|
|
],
|
|
"properties": {
|
|
"ask_denom": {
|
|
"description": "The name (denomination) of the native asset to swap to",
|
|
"type": "string"
|
|
},
|
|
"offer_denom": {
|
|
"description": "The name (denomination) of the native asset to swap from",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "ASTRO swap",
|
|
"type": "object",
|
|
"required": [
|
|
"astro_swap"
|
|
],
|
|
"properties": {
|
|
"astro_swap": {
|
|
"type": "object",
|
|
"required": [
|
|
"ask_asset_info",
|
|
"offer_asset_info"
|
|
],
|
|
"properties": {
|
|
"ask_asset_info": {
|
|
"description": "Information about the asset we swap to",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
},
|
|
"offer_asset_info": {
|
|
"description": "Information about the asset being swapped",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"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": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "QueryMsg",
|
|
"description": "This structure describes the query messages available in the contract.",
|
|
"oneOf": [
|
|
{
|
|
"description": "Config returns configuration parameters for the contract using a custom [`ConfigResponse`] structure",
|
|
"type": "object",
|
|
"required": [
|
|
"config"
|
|
],
|
|
"properties": {
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "SimulateSwapOperations simulates multi-hop swap operations",
|
|
"type": "object",
|
|
"required": [
|
|
"simulate_swap_operations"
|
|
],
|
|
"properties": {
|
|
"simulate_swap_operations": {
|
|
"type": "object",
|
|
"required": [
|
|
"offer_amount",
|
|
"operations"
|
|
],
|
|
"properties": {
|
|
"offer_amount": {
|
|
"description": "The amount of tokens to swap",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"operations": {
|
|
"description": "The swap operations to perform, each swap involving a specific pool",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/SwapOperation"
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": [
|
|
"reverse_simulate_swap_operations"
|
|
],
|
|
"properties": {
|
|
"reverse_simulate_swap_operations": {
|
|
"type": "object",
|
|
"required": [
|
|
"ask_amount",
|
|
"operations"
|
|
],
|
|
"properties": {
|
|
"ask_amount": {
|
|
"description": "The amount of tokens one is willing to receive",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Uint128"
|
|
}
|
|
]
|
|
},
|
|
"operations": {
|
|
"description": "The swap operations to perform, each swap involving a specific pool",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/SwapOperation"
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
},
|
|
"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
|
|
}
|
|
]
|
|
},
|
|
"SwapOperation": {
|
|
"description": "This enum describes a swap operation.",
|
|
"oneOf": [
|
|
{
|
|
"description": "Native swap",
|
|
"type": "object",
|
|
"required": [
|
|
"native_swap"
|
|
],
|
|
"properties": {
|
|
"native_swap": {
|
|
"type": "object",
|
|
"required": [
|
|
"ask_denom",
|
|
"offer_denom"
|
|
],
|
|
"properties": {
|
|
"ask_denom": {
|
|
"description": "The name (denomination) of the native asset to swap to",
|
|
"type": "string"
|
|
},
|
|
"offer_denom": {
|
|
"description": "The name (denomination) of the native asset to swap from",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"description": "ASTRO swap",
|
|
"type": "object",
|
|
"required": [
|
|
"astro_swap"
|
|
],
|
|
"properties": {
|
|
"astro_swap": {
|
|
"type": "object",
|
|
"required": [
|
|
"ask_asset_info",
|
|
"offer_asset_info"
|
|
],
|
|
"properties": {
|
|
"ask_asset_info": {
|
|
"description": "Information about the asset we swap to",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
},
|
|
"offer_asset_info": {
|
|
"description": "Information about the asset being swapped",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AssetInfo"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
},
|
|
"migrate": null,
|
|
"sudo": null,
|
|
"responses": {
|
|
"config": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "ConfigResponse",
|
|
"description": "This structure describes a custom struct to return a query response containing the base contract configuration.",
|
|
"type": "object",
|
|
"required": [
|
|
"astroport_factory"
|
|
],
|
|
"properties": {
|
|
"astroport_factory": {
|
|
"description": "The Astroport factory contract address",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"reverse_simulate_swap_operations": {
|
|
"$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_swap_operations": {
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "SimulateSwapOperationsResponse",
|
|
"description": "This structure describes a custom struct to return a query response containing the end amount of a swap simulation",
|
|
"type": "object",
|
|
"required": [
|
|
"amount"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"description": "The amount of tokens received in a swap simulation",
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|