{ "contract_name": "dexter-router", "contract_version": "1.1.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", "type": "object", "required": [ "dexter_vault" ], "properties": { "dexter_vault": { "description": "The dexter Vault 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": "ExecuteMultihopSwap processes multiple swaps via dexter pools", "type": "object", "required": [ "execute_multihop_swap" ], "properties": { "execute_multihop_swap": { "type": "object", "required": [ "offer_amount", "requests" ], "properties": { "minimum_receive": { "anyOf": [ { "$ref": "#/definitions/Uint128" }, { "type": "null" } ] }, "offer_amount": { "$ref": "#/definitions/Uint128" }, "recipient": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] }, "requests": { "type": "array", "items": { "$ref": "#/definitions/HopSwapRequest" } } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Callbacks; only callable by the contract itself.", "type": "object", "required": [ "callback" ], "properties": { "callback": { "$ref": "#/definitions/CallbackMsg" } }, "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.", "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 } ] }, "CallbackMsg": { "oneOf": [ { "type": "object", "required": [ "continue_hop_swap" ], "properties": { "continue_hop_swap": { "type": "object", "required": [ "minimum_receive", "offer_asset", "prev_ask_amount", "recipient", "requests" ], "properties": { "minimum_receive": { "$ref": "#/definitions/Uint128" }, "offer_asset": { "$ref": "#/definitions/AssetInfo" }, "prev_ask_amount": { "$ref": "#/definitions/Uint128" }, "recipient": { "$ref": "#/definitions/Addr" }, "requests": { "type": "array", "items": { "$ref": "#/definitions/HopSwapRequest" } } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "HopSwapRequest": { "description": "This enum describes a swap operation.", "type": "object", "required": [ "asset_in", "asset_out", "pool_id" ], "properties": { "asset_in": { "description": "The offer asset", "allOf": [ { "$ref": "#/definitions/AssetInfo" } ] }, "asset_out": { "description": "The ask asset", "allOf": [ { "$ref": "#/definitions/AssetInfo" } ] }, "pool_id": { "description": "Pool Id via which the swap is to be routed", "allOf": [ { "$ref": "#/definitions/Uint128" } ] } }, "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": [ { "type": "object", "required": [ "config" ], "properties": { "config": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "SimulateMultihopSwap simulates multi-hop swap operations", "type": "object", "required": [ "simulate_multihop_swap" ], "properties": { "simulate_multihop_swap": { "type": "object", "required": [ "amount", "multiswap_request", "swap_type" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "multiswap_request": { "type": "array", "items": { "$ref": "#/definitions/HopSwapRequest" } }, "swap_type": { "$ref": "#/definitions/SwapType" } }, "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.", "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 } ] }, "HopSwapRequest": { "description": "This enum describes a swap operation.", "type": "object", "required": [ "asset_in", "asset_out", "pool_id" ], "properties": { "asset_in": { "description": "The offer asset", "allOf": [ { "$ref": "#/definitions/AssetInfo" } ] }, "asset_out": { "description": "The ask asset", "allOf": [ { "$ref": "#/definitions/AssetInfo" } ] }, "pool_id": { "description": "Pool Id via which the swap is to be routed", "allOf": [ { "$ref": "#/definitions/Uint128" } ] } }, "additionalProperties": false }, "SwapType": { "description": "This enum describes available Swap types.", "oneOf": [ { "type": "object", "required": [ "give_in" ], "properties": { "give_in": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "give_out" ], "properties": { "give_out": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "Custom swap type", "type": "object", "required": [ "custom" ], "properties": { "custom": { "type": "string" } }, "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": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", "description": "This structure describes a migration message. We currently take no arguments for migrations.", "oneOf": [ { "type": "object", "required": [ "v1_1" ], "properties": { "v1_1": { "type": "object", "additionalProperties": false } }, "additionalProperties": false } ] }, "sudo": null, "responses": { "config": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ConfigResponse", "type": "object", "required": [ "dexter_vault" ], "properties": { "dexter_vault": { "description": "The dexter vault contract address", "type": "string" } }, "additionalProperties": false }, "simulate_multihop_swap": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SimulateMultiHopResponse", "type": "object", "required": [ "fee", "response", "swap_operations" ], "properties": { "fee": { "type": "array", "items": { "$ref": "#/definitions/Asset" } }, "response": { "$ref": "#/definitions/ResponseType" }, "swap_operations": { "type": "array", "items": { "$ref": "#/definitions/SimulatedTrade" } } }, "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": { "title": "Description - This enum describes a 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.", "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 } ] }, "ResponseType": { "title": "Description", "description": "This enum is used to describe if the math computations (joins/exits/swaps) will be successful or not", "oneOf": [ { "type": "object", "required": [ "success" ], "properties": { "success": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "failure" ], "properties": { "failure": { "type": "string" } }, "additionalProperties": false } ] }, "SimulatedTrade": { "type": "object", "required": [ "asset_in", "asset_out", "offered_amount", "pool_id", "received_amount" ], "properties": { "asset_in": { "$ref": "#/definitions/AssetInfo" }, "asset_out": { "$ref": "#/definitions/AssetInfo" }, "offered_amount": { "$ref": "#/definitions/Uint128" }, "pool_id": { "$ref": "#/definitions/Uint128" }, "received_amount": { "$ref": "#/definitions/Uint128" } }, "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" } } } } }