From b6984578324a03ed8689d10435028f6517b5f8be Mon Sep 17 00:00:00 2001 From: nahem <nahemseguias@gmail.com> Date: Mon, 5 Feb 2024 16:49:57 +0100 Subject: [PATCH] chore(smart-contracts): regenerate all schemas --- .../terraswap_router/schema/raw/execute.json | 25 + .../schema/schema/raw/execute.json | 325 +++++++ .../schema/schema/raw/instantiate.json | 14 + .../schema/schema/raw/migrate.json | 7 + .../schema/schema/raw/query.json | 200 +++++ .../schema/schema/raw/response_to_config.json | 14 + ...e_to_reverse_simulate_swap_operations.json | 20 + .../response_to_simulate_swap_operations.json | 20 + .../schema/raw/response_to_swap_route.json | 86 ++ .../schema/raw/response_to_swap_routes.json | 109 +++ .../schema/schema/terraswap-router.json | 803 ++++++++++++++++++ .../schema/terraswap-router.json | 25 + 12 files changed, 1648 insertions(+) create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/execute.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/instantiate.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/migrate.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/query.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_config.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_reverse_simulate_swap_operations.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_simulate_swap_operations.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_route.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_routes.json create mode 100644 contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/terraswap-router.json diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/raw/execute.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/raw/execute.json index 12765ff3..d592d201 100644 --- a/contracts/liquidity_hub/pool-network/terraswap_router/schema/raw/execute.json +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/raw/execute.json @@ -161,6 +161,31 @@ } }, "additionalProperties": false + }, + { + "description": "Removes swap routes from the router.", + "type": "object", + "required": [ + "remove_swap_routes" + ], + "properties": { + "remove_swap_routes": { + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapRoute" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false } ], "definitions": { diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/execute.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/execute.json new file mode 100644 index 00000000..d592d201 --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/execute.json @@ -0,0 +1,325 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "receive" + ], + "properties": { + "receive": { + "$ref": "#/definitions/Cw20ReceiveMsg" + } + }, + "additionalProperties": false + }, + { + "description": "Execute multiple [SwapOperation]s, i.e. multi-hop swaps.", + "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": "Swap the offer to ask token. This message can only be called internally by the router contract.", + "type": "object", + "required": [ + "execute_swap_operation" + ], + "properties": { + "execute_swap_operation": { + "type": "object", + "required": [ + "operation" + ], + "properties": { + "max_spread": { + "anyOf": [ + { + "$ref": "#/definitions/Decimal" + }, + { + "type": "null" + } + ] + }, + "operation": { + "$ref": "#/definitions/SwapOperation" + }, + "to": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Checks if the swap amount exceeds the minimum_receive. This message can only be called internally by the router contract.", + "type": "object", + "required": [ + "assert_minimum_receive" + ], + "properties": { + "assert_minimum_receive": { + "type": "object", + "required": [ + "asset_info", + "minimum_receive", + "prev_balance", + "receiver" + ], + "properties": { + "asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "minimum_receive": { + "$ref": "#/definitions/Uint128" + }, + "prev_balance": { + "$ref": "#/definitions/Uint128" + }, + "receiver": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Adds swap routes to the router.", + "type": "object", + "required": [ + "add_swap_routes" + ], + "properties": { + "add_swap_routes": { + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapRoute" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Removes swap routes from the router.", + "type": "object", + "required": [ + "remove_swap_routes" + ], + "properties": { + "remove_swap_routes": { + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapRoute" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "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": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapRoute": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info", + "swap_operations" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "swap_operations": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "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" + } + } +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/instantiate.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/instantiate.json new file mode 100644 index 00000000..9d79cdad --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/instantiate.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "terraswap_factory" + ], + "properties": { + "terraswap_factory": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/migrate.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/migrate.json new file mode 100644 index 00000000..70065dad --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/migrate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "description": "We currently take no arguments for migrations", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/query.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/query.json new file mode 100644 index 00000000..42060dcc --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/query.json @@ -0,0 +1,200 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Retrieves the configuration of the router.", + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Simulates swap operations.", + "type": "object", + "required": [ + "simulate_swap_operations" + ], + "properties": { + "simulate_swap_operations": { + "type": "object", + "required": [ + "offer_amount", + "operations" + ], + "properties": { + "offer_amount": { + "$ref": "#/definitions/Uint128" + }, + "operations": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Simulates a reverse swap operations, i.e. given the ask asset, how much of the offer asset is needed to perform the swap.", + "type": "object", + "required": [ + "reverse_simulate_swap_operations" + ], + "properties": { + "reverse_simulate_swap_operations": { + "type": "object", + "required": [ + "ask_amount", + "operations" + ], + "properties": { + "ask_amount": { + "$ref": "#/definitions/Uint128" + }, + "operations": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Gets the swap route for the given offer and ask assets.", + "type": "object", + "required": [ + "swap_route" + ], + "properties": { + "swap_route": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Gets all swap routes registered", + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_token" + ], + "properties": { + "native_token": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapOperation": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$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" + } + } +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_config.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_config.json new file mode 100644 index 00000000..51deeda2 --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_config.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigResponse", + "type": "object", + "required": [ + "terraswap_factory" + ], + "properties": { + "terraswap_factory": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_reverse_simulate_swap_operations.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_reverse_simulate_swap_operations.json new file mode 100644 index 00000000..b15e18ee --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_reverse_simulate_swap_operations.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SimulateSwapOperationsResponse", + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$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" + } + } +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_simulate_swap_operations.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_simulate_swap_operations.json new file mode 100644 index 00000000..b15e18ee --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_simulate_swap_operations.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SimulateSwapOperationsResponse", + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$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" + } + } +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_route.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_route.json new file mode 100644 index 00000000..16fbdf71 --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_route.json @@ -0,0 +1,86 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_SwapOperation", + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + }, + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_token" + ], + "properties": { + "native_token": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapOperation": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + } + } +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_routes.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_routes.json new file mode 100644 index 00000000..92a2810e --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/raw/response_to_swap_routes.json @@ -0,0 +1,109 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_SwapRouteResponse", + "type": "array", + "items": { + "$ref": "#/definitions/SwapRouteResponse" + }, + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_token" + ], + "properties": { + "native_token": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapOperation": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapRouteResponse": { + "type": "object", + "required": [ + "ask_asset", + "offer_asset", + "swap_route" + ], + "properties": { + "ask_asset": { + "type": "string" + }, + "offer_asset": { + "type": "string" + }, + "swap_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/terraswap-router.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/terraswap-router.json new file mode 100644 index 00000000..e4833685 --- /dev/null +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/schema/terraswap-router.json @@ -0,0 +1,803 @@ +{ + "contract_name": "terraswap-router", + "contract_version": "1.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "terraswap_factory" + ], + "properties": { + "terraswap_factory": { + "type": "string" + } + }, + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "receive" + ], + "properties": { + "receive": { + "$ref": "#/definitions/Cw20ReceiveMsg" + } + }, + "additionalProperties": false + }, + { + "description": "Execute multiple [SwapOperation]s, i.e. multi-hop swaps.", + "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": "Swap the offer to ask token. This message can only be called internally by the router contract.", + "type": "object", + "required": [ + "execute_swap_operation" + ], + "properties": { + "execute_swap_operation": { + "type": "object", + "required": [ + "operation" + ], + "properties": { + "max_spread": { + "anyOf": [ + { + "$ref": "#/definitions/Decimal" + }, + { + "type": "null" + } + ] + }, + "operation": { + "$ref": "#/definitions/SwapOperation" + }, + "to": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Checks if the swap amount exceeds the minimum_receive. This message can only be called internally by the router contract.", + "type": "object", + "required": [ + "assert_minimum_receive" + ], + "properties": { + "assert_minimum_receive": { + "type": "object", + "required": [ + "asset_info", + "minimum_receive", + "prev_balance", + "receiver" + ], + "properties": { + "asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "minimum_receive": { + "$ref": "#/definitions/Uint128" + }, + "prev_balance": { + "$ref": "#/definitions/Uint128" + }, + "receiver": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Adds swap routes to the router.", + "type": "object", + "required": [ + "add_swap_routes" + ], + "properties": { + "add_swap_routes": { + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapRoute" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Removes swap routes from the router.", + "type": "object", + "required": [ + "remove_swap_routes" + ], + "properties": { + "remove_swap_routes": { + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapRoute" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "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": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapRoute": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info", + "swap_operations" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "swap_operations": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "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", + "oneOf": [ + { + "description": "Retrieves the configuration of the router.", + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Simulates swap operations.", + "type": "object", + "required": [ + "simulate_swap_operations" + ], + "properties": { + "simulate_swap_operations": { + "type": "object", + "required": [ + "offer_amount", + "operations" + ], + "properties": { + "offer_amount": { + "$ref": "#/definitions/Uint128" + }, + "operations": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Simulates a reverse swap operations, i.e. given the ask asset, how much of the offer asset is needed to perform the swap.", + "type": "object", + "required": [ + "reverse_simulate_swap_operations" + ], + "properties": { + "reverse_simulate_swap_operations": { + "type": "object", + "required": [ + "ask_amount", + "operations" + ], + "properties": { + "ask_amount": { + "$ref": "#/definitions/Uint128" + }, + "operations": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Gets the swap route for the given offer and ask assets.", + "type": "object", + "required": [ + "swap_route" + ], + "properties": { + "swap_route": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Gets all swap routes registered", + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_token" + ], + "properties": { + "native_token": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapOperation": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$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": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "description": "We currently take no arguments for migrations", + "type": "object", + "additionalProperties": false + }, + "sudo": null, + "responses": { + "config": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigResponse", + "type": "object", + "required": [ + "terraswap_factory" + ], + "properties": { + "terraswap_factory": { + "type": "string" + } + }, + "additionalProperties": false + }, + "reverse_simulate_swap_operations": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SimulateSwapOperationsResponse", + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$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" + } + } + }, + "simulate_swap_operations": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SimulateSwapOperationsResponse", + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$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" + } + } + }, + "swap_route": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_SwapOperation", + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + }, + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_token" + ], + "properties": { + "native_token": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapOperation": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + } + } + }, + "swap_routes": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_SwapRouteResponse", + "type": "array", + "items": { + "$ref": "#/definitions/SwapRouteResponse" + }, + "definitions": { + "AssetInfo": { + "description": "AssetInfo contract_addr is usually passed from the cw20 hook so we can trust the contract_addr is properly validated.", + "oneOf": [ + { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_token" + ], + "properties": { + "native_token": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapOperation": { + "oneOf": [ + { + "type": "object", + "required": [ + "terra_swap" + ], + "properties": { + "terra_swap": { + "type": "object", + "required": [ + "ask_asset_info", + "offer_asset_info" + ], + "properties": { + "ask_asset_info": { + "$ref": "#/definitions/AssetInfo" + }, + "offer_asset_info": { + "$ref": "#/definitions/AssetInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SwapRouteResponse": { + "type": "object", + "required": [ + "ask_asset", + "offer_asset", + "swap_route" + ], + "properties": { + "ask_asset": { + "type": "string" + }, + "offer_asset": { + "type": "string" + }, + "swap_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapOperation" + } + } + }, + "additionalProperties": false + } + } + } + } +} diff --git a/contracts/liquidity_hub/pool-network/terraswap_router/schema/terraswap-router.json b/contracts/liquidity_hub/pool-network/terraswap_router/schema/terraswap-router.json index 6e948653..e4833685 100644 --- a/contracts/liquidity_hub/pool-network/terraswap_router/schema/terraswap-router.json +++ b/contracts/liquidity_hub/pool-network/terraswap_router/schema/terraswap-router.json @@ -179,6 +179,31 @@ } }, "additionalProperties": false + }, + { + "description": "Removes swap routes from the router.", + "type": "object", + "required": [ + "remove_swap_routes" + ], + "properties": { + "remove_swap_routes": { + "type": "object", + "required": [ + "swap_routes" + ], + "properties": { + "swap_routes": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapRoute" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false } ], "definitions": {