diff --git a/contracts/strategy-osmosis/schema/raw/execute.json b/contracts/strategy-osmosis/schema/raw/execute.json new file mode 100644 index 0000000..7639e6c --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/execute.json @@ -0,0 +1,316 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "update_config" + ], + "properties": { + "update_config": { + "$ref": "#/definitions/UpdateConfigMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "stake" + ], + "properties": { + "stake": { + "$ref": "#/definitions/StakeMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "unstake" + ], + "properties": { + "unstake": { + "$ref": "#/definitions/UnstakeMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "superfluid_delegate" + ], + "properties": { + "superfluid_delegate": { + "$ref": "#/definitions/ExecuteSuperfluidDelegateMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "execute_epoch" + ], + "properties": { + "execute_epoch": { + "$ref": "#/definitions/ExecuteEpochMsg" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "DepositToken": { + "type": "string", + "enum": [ + "base", + "quote" + ] + }, + "ExecuteEpochMsg": { + "type": "object", + "additionalProperties": false + }, + "ExecuteSuperfluidDelegateMsg": { + "type": "object", + "additionalProperties": false + }, + "ExternToken": { + "type": "object", + "required": [ + "extern_token", + "swap_in_route" + ], + "properties": { + "extern_token": { + "type": "string" + }, + "swap_in_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + } + }, + "additionalProperties": false + }, + "Phase": { + "type": "string", + "enum": [ + "deposit", + "withdraw" + ] + }, + "PhaseStep": { + "type": "string", + "enum": [ + "ibc_transfer_to_host", + "ibc_transfer_to_host_callback", + "request_icq_after_ibc_transfer_to_host", + "response_icq_after_ibc_transfer_to_host", + "sell_extern_tokens", + "sell_extern_tokens_callback", + "request_icq_after_sell_extern_tokens", + "response_icq_after_sell_extern_tokens", + "add_liquidity", + "add_liquidity_callback", + "bond_liquidity", + "bond_liquidity_callback", + "request_icq_after_bond_liquidity", + "response_icq_after_bond_liquidity", + "begin_unbonding_for_pending_requests", + "begin_unbonding_for_pending_requests_callback", + "check_matured_unbondings", + "remove_liquidity", + "remove_liquidity_callback", + "request_icq_after_remove_liquidity", + "response_icq_after_remove_liquidity", + "swap_two_tokens_to_deposit_token", + "swap_two_tokens_to_deposit_token_callback", + "request_icq_after_swap_two_tokens_to_deposit_token", + "response_icq_after_swap_two_tokens_to_deposit_token", + "ibc_transfer_to_controller", + "ibc_transfer_to_controller_callback", + "request_icq_after_ibc_transfer_to_controller", + "response_icq_after_ibc_transfer_to_controller", + "distribute_to_unbonded_users" + ] + }, + "StakeMsg": { + "type": "object", + "additionalProperties": false + }, + "SwapAmountInRoute": { + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "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" + }, + "UnstakeMsg": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false + }, + "UpdateConfigMsg": { + "type": "object", + "properties": { + "automate_superfluid": { + "type": [ + "boolean", + "null" + ] + }, + "base_denom": { + "type": [ + "string", + "null" + ] + }, + "chain_id": { + "type": [ + "string", + "null" + ] + }, + "controller_deposit_denom": { + "type": [ + "string", + "null" + ] + }, + "controller_transfer_channel_id": { + "type": [ + "string", + "null" + ] + }, + "deposit_token": { + "anyOf": [ + { + "$ref": "#/definitions/DepositToken" + }, + { + "type": "null" + } + ] + }, + "extern_tokens": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ExternToken" + } + }, + "ica_channel_id": { + "type": [ + "string", + "null" + ] + }, + "lp_denom": { + "type": [ + "string", + "null" + ] + }, + "owner": { + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/Phase" + }, + { + "type": "null" + } + ] + }, + "phase_step": { + "anyOf": [ + { + "$ref": "#/definitions/PhaseStep" + }, + { + "type": "null" + } + ] + }, + "pool_id": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "quote_denom": { + "type": [ + "string", + "null" + ] + }, + "superfluid_validator": { + "type": [ + "string", + "null" + ] + }, + "transfer_channel_id": { + "type": [ + "string", + "null" + ] + }, + "transfer_timeout": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "unbond_period": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/strategy-osmosis/schema/raw/instantiate.json b/contracts/strategy-osmosis/schema/raw/instantiate.json new file mode 100644 index 0000000..1f3ba2b --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/instantiate.json @@ -0,0 +1,109 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "automate_superfluid", + "base_denom", + "chain_id", + "controller_deposit_denom", + "controller_transfer_channel_id", + "extern_tokens", + "lp_denom", + "pool_id", + "quote_denom", + "superfluid_validator", + "transfer_channel_id", + "transfer_timeout", + "unbond_period" + ], + "properties": { + "automate_superfluid": { + "type": "boolean" + }, + "base_denom": { + "type": "string" + }, + "chain_id": { + "type": "string" + }, + "controller_deposit_denom": { + "type": "string" + }, + "controller_transfer_channel_id": { + "type": "string" + }, + "extern_tokens": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternToken" + } + }, + "lp_denom": { + "type": "string" + }, + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "quote_denom": { + "type": "string" + }, + "superfluid_validator": { + "type": "string" + }, + "transfer_channel_id": { + "type": "string" + }, + "transfer_timeout": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "unbond_period": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false, + "definitions": { + "ExternToken": { + "type": "object", + "required": [ + "extern_token", + "swap_in_route" + ], + "properties": { + "extern_token": { + "type": "string" + }, + "swap_in_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + } + }, + "additionalProperties": false + }, + "SwapAmountInRoute": { + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "type": "string" + } + } + } + } +} diff --git a/contracts/strategy-osmosis/schema/raw/query.json b/contracts/strategy-osmosis/schema/raw/query.json new file mode 100644 index 0000000..5172f7b --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/query.json @@ -0,0 +1,136 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "state" + ], + "properties": { + "state": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "bonded" + ], + "properties": { + "bonded": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "unbonding" + ], + "properties": { + "unbonding": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "fee" + ], + "properties": { + "fee": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Show all channels connected to.", + "type": "object", + "required": [ + "list_channels" + ], + "properties": { + "list_channels": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns the details of the name channel, error if not created.", + "type": "object", + "required": [ + "channel" + ], + "properties": { + "channel": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "unbondings" + ], + "properties": { + "unbondings": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/strategy-osmosis/schema/raw/response_to_bonded.json b/contracts/strategy-osmosis/schema/raw/response_to_bonded.json new file mode 100644 index 0000000..25b73e8 --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_bonded.json @@ -0,0 +1,6 @@ +{ + "$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" +} diff --git a/contracts/strategy-osmosis/schema/raw/response_to_channel.json b/contracts/strategy-osmosis/schema/raw/response_to_channel.json new file mode 100644 index 0000000..d92814a --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_channel.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ChannelResponse", + "type": "object", + "required": [ + "info" + ], + "properties": { + "info": { + "description": "Information on the channel's connection", + "allOf": [ + { + "$ref": "#/definitions/ChannelInfo" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "ChannelInfo": { + "type": "object", + "required": [ + "address", + "connection_id", + "counterparty_endpoint", + "id" + ], + "properties": { + "address": { + "description": "interchain account address", + "type": "string" + }, + "connection_id": { + "description": "the connection this exists on (you can use to query client/consensus info)", + "type": "string" + }, + "counterparty_endpoint": { + "description": "the remote channel/port we connect to", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "id": { + "description": "id of this channel", + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcEndpoint": { + "type": "object", + "required": [ + "channel_id", + "port_id" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "port_id": { + "type": "string" + } + } + } + } +} diff --git a/contracts/strategy-osmosis/schema/raw/response_to_config.json b/contracts/strategy-osmosis/schema/raw/response_to_config.json new file mode 100644 index 0000000..5a0e264 --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_config.json @@ -0,0 +1,190 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Config", + "type": "object", + "required": [ + "automate_superfluid", + "base_denom", + "chain_id", + "controller_deposit_denom", + "controller_transfer_channel_id", + "deposit_token", + "extern_tokens", + "ica_account", + "ica_channel_id", + "ica_connection_id", + "lp_denom", + "owner", + "phase", + "phase_step", + "pool_id", + "quote_denom", + "superfluid_validator", + "transfer_channel_id", + "transfer_timeout", + "unbond_period" + ], + "properties": { + "automate_superfluid": { + "type": "boolean" + }, + "base_denom": { + "type": "string" + }, + "chain_id": { + "type": "string" + }, + "controller_deposit_denom": { + "type": "string" + }, + "controller_transfer_channel_id": { + "type": "string" + }, + "deposit_token": { + "$ref": "#/definitions/DepositToken" + }, + "extern_tokens": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternToken" + } + }, + "ica_account": { + "type": "string" + }, + "ica_channel_id": { + "type": "string" + }, + "ica_connection_id": { + "type": "string" + }, + "lp_denom": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/Addr" + }, + "phase": { + "$ref": "#/definitions/Phase" + }, + "phase_step": { + "$ref": "#/definitions/PhaseStep" + }, + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "quote_denom": { + "type": "string" + }, + "superfluid_validator": { + "type": "string" + }, + "transfer_channel_id": { + "type": "string" + }, + "transfer_timeout": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "unbond_period": { + "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" + }, + "DepositToken": { + "type": "string", + "enum": [ + "base", + "quote" + ] + }, + "ExternToken": { + "type": "object", + "required": [ + "extern_token", + "swap_in_route" + ], + "properties": { + "extern_token": { + "type": "string" + }, + "swap_in_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + } + }, + "additionalProperties": false + }, + "Phase": { + "type": "string", + "enum": [ + "deposit", + "withdraw" + ] + }, + "PhaseStep": { + "type": "string", + "enum": [ + "ibc_transfer_to_host", + "ibc_transfer_to_host_callback", + "request_icq_after_ibc_transfer_to_host", + "response_icq_after_ibc_transfer_to_host", + "sell_extern_tokens", + "sell_extern_tokens_callback", + "request_icq_after_sell_extern_tokens", + "response_icq_after_sell_extern_tokens", + "add_liquidity", + "add_liquidity_callback", + "bond_liquidity", + "bond_liquidity_callback", + "request_icq_after_bond_liquidity", + "response_icq_after_bond_liquidity", + "begin_unbonding_for_pending_requests", + "begin_unbonding_for_pending_requests_callback", + "check_matured_unbondings", + "remove_liquidity", + "remove_liquidity_callback", + "request_icq_after_remove_liquidity", + "response_icq_after_remove_liquidity", + "swap_two_tokens_to_deposit_token", + "swap_two_tokens_to_deposit_token_callback", + "request_icq_after_swap_two_tokens_to_deposit_token", + "response_icq_after_swap_two_tokens_to_deposit_token", + "ibc_transfer_to_controller", + "ibc_transfer_to_controller_callback", + "request_icq_after_ibc_transfer_to_controller", + "response_icq_after_ibc_transfer_to_controller", + "distribute_to_unbonded_users" + ] + }, + "SwapAmountInRoute": { + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "type": "string" + } + } + } + } +} diff --git a/contracts/strategy-osmosis/schema/raw/response_to_fee.json b/contracts/strategy-osmosis/schema/raw/response_to_fee.json new file mode 100644 index 0000000..2d18cfd --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_fee.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeeInfo", + "type": "object", + "required": [ + "deposit_fee_rate", + "interest_fee_rate", + "withdraw_fee_rate" + ], + "properties": { + "deposit_fee_rate": { + "$ref": "#/definitions/Decimal" + }, + "interest_fee_rate": { + "$ref": "#/definitions/Decimal" + }, + "withdraw_fee_rate": { + "$ref": "#/definitions/Decimal" + } + }, + "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" + } + } +} diff --git a/contracts/strategy-osmosis/schema/raw/response_to_list_channels.json b/contracts/strategy-osmosis/schema/raw/response_to_list_channels.json new file mode 100644 index 0000000..cd329da --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_list_channels.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListChannelsResponse", + "type": "object", + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/ChannelInfo" + } + } + }, + "additionalProperties": false, + "definitions": { + "ChannelInfo": { + "type": "object", + "required": [ + "address", + "connection_id", + "counterparty_endpoint", + "id" + ], + "properties": { + "address": { + "description": "interchain account address", + "type": "string" + }, + "connection_id": { + "description": "the connection this exists on (you can use to query client/consensus info)", + "type": "string" + }, + "counterparty_endpoint": { + "description": "the remote channel/port we connect to", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "id": { + "description": "id of this channel", + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcEndpoint": { + "type": "object", + "required": [ + "channel_id", + "port_id" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "port_id": { + "type": "string" + } + } + } + } +} diff --git a/contracts/strategy-osmosis/schema/raw/response_to_state.json b/contracts/strategy-osmosis/schema/raw/response_to_state.json new file mode 100644 index 0000000..d671fa6 --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_state.json @@ -0,0 +1,101 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "State", + "type": "object", + "required": [ + "bonded_lp_amount", + "controller_free_amount", + "controller_pending_transfer_amount", + "controller_stacked_amount_to_deposit", + "extern_token_amounts", + "free_base_amount", + "free_lp_amount", + "free_quote_amount", + "last_unbonding_id", + "lock_id", + "lp_redemption_rate", + "pending_bond_lp_amount", + "pending_icq", + "pending_lp_removal_amount", + "redemption_rate", + "total_deposit", + "total_shares", + "total_withdrawn", + "unbonding_lp_amount" + ], + "properties": { + "bonded_lp_amount": { + "$ref": "#/definitions/Uint128" + }, + "controller_free_amount": { + "$ref": "#/definitions/Uint128" + }, + "controller_pending_transfer_amount": { + "$ref": "#/definitions/Uint128" + }, + "controller_stacked_amount_to_deposit": { + "$ref": "#/definitions/Uint128" + }, + "extern_token_amounts": { + "type": "array", + "items": { + "$ref": "#/definitions/Uint128" + } + }, + "free_base_amount": { + "$ref": "#/definitions/Uint128" + }, + "free_lp_amount": { + "$ref": "#/definitions/Uint128" + }, + "free_quote_amount": { + "$ref": "#/definitions/Uint128" + }, + "last_unbonding_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "lock_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "lp_redemption_rate": { + "$ref": "#/definitions/Uint128" + }, + "pending_bond_lp_amount": { + "$ref": "#/definitions/Uint128" + }, + "pending_icq": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "pending_lp_removal_amount": { + "$ref": "#/definitions/Uint128" + }, + "redemption_rate": { + "$ref": "#/definitions/Uint128" + }, + "total_deposit": { + "$ref": "#/definitions/Uint128" + }, + "total_shares": { + "$ref": "#/definitions/Uint128" + }, + "total_withdrawn": { + "$ref": "#/definitions/Uint128" + }, + "unbonding_lp_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/strategy-osmosis/schema/raw/response_to_unbonding.json b/contracts/strategy-osmosis/schema/raw/response_to_unbonding.json new file mode 100644 index 0000000..25b73e8 --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_unbonding.json @@ -0,0 +1,6 @@ +{ + "$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" +} diff --git a/contracts/strategy-osmosis/schema/raw/response_to_unbondings.json b/contracts/strategy-osmosis/schema/raw/response_to_unbondings.json new file mode 100644 index 0000000..bf446b4 --- /dev/null +++ b/contracts/strategy-osmosis/schema/raw/response_to_unbondings.json @@ -0,0 +1,54 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_Unbonding", + "type": "array", + "items": { + "$ref": "#/definitions/Unbonding" + }, + "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" + }, + "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" + }, + "Unbonding": { + "type": "object", + "required": [ + "amount", + "id", + "marked", + "pending_start", + "sender", + "start_time" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "marked": { + "type": "boolean" + }, + "pending_start": { + "type": "boolean" + }, + "sender": { + "$ref": "#/definitions/Addr" + }, + "start_time": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/strategy-osmosis/schema/strategy-osmosis.json b/contracts/strategy-osmosis/schema/strategy-osmosis.json new file mode 100644 index 0000000..9c41a5e --- /dev/null +++ b/contracts/strategy-osmosis/schema/strategy-osmosis.json @@ -0,0 +1,1089 @@ +{ + "contract_name": "strategy-osmosis", + "contract_version": "1.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "automate_superfluid", + "base_denom", + "chain_id", + "controller_deposit_denom", + "controller_transfer_channel_id", + "extern_tokens", + "lp_denom", + "pool_id", + "quote_denom", + "superfluid_validator", + "transfer_channel_id", + "transfer_timeout", + "unbond_period" + ], + "properties": { + "automate_superfluid": { + "type": "boolean" + }, + "base_denom": { + "type": "string" + }, + "chain_id": { + "type": "string" + }, + "controller_deposit_denom": { + "type": "string" + }, + "controller_transfer_channel_id": { + "type": "string" + }, + "extern_tokens": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternToken" + } + }, + "lp_denom": { + "type": "string" + }, + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "quote_denom": { + "type": "string" + }, + "superfluid_validator": { + "type": "string" + }, + "transfer_channel_id": { + "type": "string" + }, + "transfer_timeout": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "unbond_period": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false, + "definitions": { + "ExternToken": { + "type": "object", + "required": [ + "extern_token", + "swap_in_route" + ], + "properties": { + "extern_token": { + "type": "string" + }, + "swap_in_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + } + }, + "additionalProperties": false + }, + "SwapAmountInRoute": { + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "type": "string" + } + } + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "update_config" + ], + "properties": { + "update_config": { + "$ref": "#/definitions/UpdateConfigMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "stake" + ], + "properties": { + "stake": { + "$ref": "#/definitions/StakeMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "unstake" + ], + "properties": { + "unstake": { + "$ref": "#/definitions/UnstakeMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "superfluid_delegate" + ], + "properties": { + "superfluid_delegate": { + "$ref": "#/definitions/ExecuteSuperfluidDelegateMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "execute_epoch" + ], + "properties": { + "execute_epoch": { + "$ref": "#/definitions/ExecuteEpochMsg" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "DepositToken": { + "type": "string", + "enum": [ + "base", + "quote" + ] + }, + "ExecuteEpochMsg": { + "type": "object", + "additionalProperties": false + }, + "ExecuteSuperfluidDelegateMsg": { + "type": "object", + "additionalProperties": false + }, + "ExternToken": { + "type": "object", + "required": [ + "extern_token", + "swap_in_route" + ], + "properties": { + "extern_token": { + "type": "string" + }, + "swap_in_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + } + }, + "additionalProperties": false + }, + "Phase": { + "type": "string", + "enum": [ + "deposit", + "withdraw" + ] + }, + "PhaseStep": { + "type": "string", + "enum": [ + "ibc_transfer_to_host", + "ibc_transfer_to_host_callback", + "request_icq_after_ibc_transfer_to_host", + "response_icq_after_ibc_transfer_to_host", + "sell_extern_tokens", + "sell_extern_tokens_callback", + "request_icq_after_sell_extern_tokens", + "response_icq_after_sell_extern_tokens", + "add_liquidity", + "add_liquidity_callback", + "bond_liquidity", + "bond_liquidity_callback", + "request_icq_after_bond_liquidity", + "response_icq_after_bond_liquidity", + "begin_unbonding_for_pending_requests", + "begin_unbonding_for_pending_requests_callback", + "check_matured_unbondings", + "remove_liquidity", + "remove_liquidity_callback", + "request_icq_after_remove_liquidity", + "response_icq_after_remove_liquidity", + "swap_two_tokens_to_deposit_token", + "swap_two_tokens_to_deposit_token_callback", + "request_icq_after_swap_two_tokens_to_deposit_token", + "response_icq_after_swap_two_tokens_to_deposit_token", + "ibc_transfer_to_controller", + "ibc_transfer_to_controller_callback", + "request_icq_after_ibc_transfer_to_controller", + "response_icq_after_ibc_transfer_to_controller", + "distribute_to_unbonded_users" + ] + }, + "StakeMsg": { + "type": "object", + "additionalProperties": false + }, + "SwapAmountInRoute": { + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "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" + }, + "UnstakeMsg": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false + }, + "UpdateConfigMsg": { + "type": "object", + "properties": { + "automate_superfluid": { + "type": [ + "boolean", + "null" + ] + }, + "base_denom": { + "type": [ + "string", + "null" + ] + }, + "chain_id": { + "type": [ + "string", + "null" + ] + }, + "controller_deposit_denom": { + "type": [ + "string", + "null" + ] + }, + "controller_transfer_channel_id": { + "type": [ + "string", + "null" + ] + }, + "deposit_token": { + "anyOf": [ + { + "$ref": "#/definitions/DepositToken" + }, + { + "type": "null" + } + ] + }, + "extern_tokens": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ExternToken" + } + }, + "ica_channel_id": { + "type": [ + "string", + "null" + ] + }, + "lp_denom": { + "type": [ + "string", + "null" + ] + }, + "owner": { + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/Phase" + }, + { + "type": "null" + } + ] + }, + "phase_step": { + "anyOf": [ + { + "$ref": "#/definitions/PhaseStep" + }, + { + "type": "null" + } + ] + }, + "pool_id": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "quote_denom": { + "type": [ + "string", + "null" + ] + }, + "superfluid_validator": { + "type": [ + "string", + "null" + ] + }, + "transfer_channel_id": { + "type": [ + "string", + "null" + ] + }, + "transfer_timeout": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "unbond_period": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "state" + ], + "properties": { + "state": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "bonded" + ], + "properties": { + "bonded": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "unbonding" + ], + "properties": { + "unbonding": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "fee" + ], + "properties": { + "fee": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Show all channels connected to.", + "type": "object", + "required": [ + "list_channels" + ], + "properties": { + "list_channels": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns the details of the name channel, error if not created.", + "type": "object", + "required": [ + "channel" + ], + "properties": { + "channel": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "unbondings" + ], + "properties": { + "unbondings": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "bonded": { + "$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" + }, + "channel": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ChannelResponse", + "type": "object", + "required": [ + "info" + ], + "properties": { + "info": { + "description": "Information on the channel's connection", + "allOf": [ + { + "$ref": "#/definitions/ChannelInfo" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "ChannelInfo": { + "type": "object", + "required": [ + "address", + "connection_id", + "counterparty_endpoint", + "id" + ], + "properties": { + "address": { + "description": "interchain account address", + "type": "string" + }, + "connection_id": { + "description": "the connection this exists on (you can use to query client/consensus info)", + "type": "string" + }, + "counterparty_endpoint": { + "description": "the remote channel/port we connect to", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "id": { + "description": "id of this channel", + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcEndpoint": { + "type": "object", + "required": [ + "channel_id", + "port_id" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "port_id": { + "type": "string" + } + } + } + } + }, + "config": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Config", + "type": "object", + "required": [ + "automate_superfluid", + "base_denom", + "chain_id", + "controller_deposit_denom", + "controller_transfer_channel_id", + "deposit_token", + "extern_tokens", + "ica_account", + "ica_channel_id", + "ica_connection_id", + "lp_denom", + "owner", + "phase", + "phase_step", + "pool_id", + "quote_denom", + "superfluid_validator", + "transfer_channel_id", + "transfer_timeout", + "unbond_period" + ], + "properties": { + "automate_superfluid": { + "type": "boolean" + }, + "base_denom": { + "type": "string" + }, + "chain_id": { + "type": "string" + }, + "controller_deposit_denom": { + "type": "string" + }, + "controller_transfer_channel_id": { + "type": "string" + }, + "deposit_token": { + "$ref": "#/definitions/DepositToken" + }, + "extern_tokens": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternToken" + } + }, + "ica_account": { + "type": "string" + }, + "ica_channel_id": { + "type": "string" + }, + "ica_connection_id": { + "type": "string" + }, + "lp_denom": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/Addr" + }, + "phase": { + "$ref": "#/definitions/Phase" + }, + "phase_step": { + "$ref": "#/definitions/PhaseStep" + }, + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "quote_denom": { + "type": "string" + }, + "superfluid_validator": { + "type": "string" + }, + "transfer_channel_id": { + "type": "string" + }, + "transfer_timeout": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "unbond_period": { + "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" + }, + "DepositToken": { + "type": "string", + "enum": [ + "base", + "quote" + ] + }, + "ExternToken": { + "type": "object", + "required": [ + "extern_token", + "swap_in_route" + ], + "properties": { + "extern_token": { + "type": "string" + }, + "swap_in_route": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + } + }, + "additionalProperties": false + }, + "Phase": { + "type": "string", + "enum": [ + "deposit", + "withdraw" + ] + }, + "PhaseStep": { + "type": "string", + "enum": [ + "ibc_transfer_to_host", + "ibc_transfer_to_host_callback", + "request_icq_after_ibc_transfer_to_host", + "response_icq_after_ibc_transfer_to_host", + "sell_extern_tokens", + "sell_extern_tokens_callback", + "request_icq_after_sell_extern_tokens", + "response_icq_after_sell_extern_tokens", + "add_liquidity", + "add_liquidity_callback", + "bond_liquidity", + "bond_liquidity_callback", + "request_icq_after_bond_liquidity", + "response_icq_after_bond_liquidity", + "begin_unbonding_for_pending_requests", + "begin_unbonding_for_pending_requests_callback", + "check_matured_unbondings", + "remove_liquidity", + "remove_liquidity_callback", + "request_icq_after_remove_liquidity", + "response_icq_after_remove_liquidity", + "swap_two_tokens_to_deposit_token", + "swap_two_tokens_to_deposit_token_callback", + "request_icq_after_swap_two_tokens_to_deposit_token", + "response_icq_after_swap_two_tokens_to_deposit_token", + "ibc_transfer_to_controller", + "ibc_transfer_to_controller_callback", + "request_icq_after_ibc_transfer_to_controller", + "response_icq_after_ibc_transfer_to_controller", + "distribute_to_unbonded_users" + ] + }, + "SwapAmountInRoute": { + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "type": "string" + } + } + } + } + }, + "fee": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeeInfo", + "type": "object", + "required": [ + "deposit_fee_rate", + "interest_fee_rate", + "withdraw_fee_rate" + ], + "properties": { + "deposit_fee_rate": { + "$ref": "#/definitions/Decimal" + }, + "interest_fee_rate": { + "$ref": "#/definitions/Decimal" + }, + "withdraw_fee_rate": { + "$ref": "#/definitions/Decimal" + } + }, + "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" + } + } + }, + "list_channels": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListChannelsResponse", + "type": "object", + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/ChannelInfo" + } + } + }, + "additionalProperties": false, + "definitions": { + "ChannelInfo": { + "type": "object", + "required": [ + "address", + "connection_id", + "counterparty_endpoint", + "id" + ], + "properties": { + "address": { + "description": "interchain account address", + "type": "string" + }, + "connection_id": { + "description": "the connection this exists on (you can use to query client/consensus info)", + "type": "string" + }, + "counterparty_endpoint": { + "description": "the remote channel/port we connect to", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "id": { + "description": "id of this channel", + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcEndpoint": { + "type": "object", + "required": [ + "channel_id", + "port_id" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "port_id": { + "type": "string" + } + } + } + } + }, + "state": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "State", + "type": "object", + "required": [ + "bonded_lp_amount", + "controller_free_amount", + "controller_pending_transfer_amount", + "controller_stacked_amount_to_deposit", + "extern_token_amounts", + "free_base_amount", + "free_lp_amount", + "free_quote_amount", + "last_unbonding_id", + "lock_id", + "lp_redemption_rate", + "pending_bond_lp_amount", + "pending_icq", + "pending_lp_removal_amount", + "redemption_rate", + "total_deposit", + "total_shares", + "total_withdrawn", + "unbonding_lp_amount" + ], + "properties": { + "bonded_lp_amount": { + "$ref": "#/definitions/Uint128" + }, + "controller_free_amount": { + "$ref": "#/definitions/Uint128" + }, + "controller_pending_transfer_amount": { + "$ref": "#/definitions/Uint128" + }, + "controller_stacked_amount_to_deposit": { + "$ref": "#/definitions/Uint128" + }, + "extern_token_amounts": { + "type": "array", + "items": { + "$ref": "#/definitions/Uint128" + } + }, + "free_base_amount": { + "$ref": "#/definitions/Uint128" + }, + "free_lp_amount": { + "$ref": "#/definitions/Uint128" + }, + "free_quote_amount": { + "$ref": "#/definitions/Uint128" + }, + "last_unbonding_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "lock_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "lp_redemption_rate": { + "$ref": "#/definitions/Uint128" + }, + "pending_bond_lp_amount": { + "$ref": "#/definitions/Uint128" + }, + "pending_icq": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "pending_lp_removal_amount": { + "$ref": "#/definitions/Uint128" + }, + "redemption_rate": { + "$ref": "#/definitions/Uint128" + }, + "total_deposit": { + "$ref": "#/definitions/Uint128" + }, + "total_shares": { + "$ref": "#/definitions/Uint128" + }, + "total_withdrawn": { + "$ref": "#/definitions/Uint128" + }, + "unbonding_lp_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" + } + } + }, + "unbonding": { + "$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" + }, + "unbondings": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_Unbonding", + "type": "array", + "items": { + "$ref": "#/definitions/Unbonding" + }, + "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" + }, + "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" + }, + "Unbonding": { + "type": "object", + "required": [ + "amount", + "id", + "marked", + "pending_start", + "sender", + "start_time" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "marked": { + "type": "boolean" + }, + "pending_start": { + "type": "boolean" + }, + "sender": { + "$ref": "#/definitions/Addr" + }, + "start_time": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + } + } +} diff --git a/contracts/strategy-osmosis/src/bin/schema.rs b/contracts/strategy-osmosis/src/bin/schema.rs new file mode 100644 index 0000000..fb9d4b1 --- /dev/null +++ b/contracts/strategy-osmosis/src/bin/schema.rs @@ -0,0 +1,10 @@ +use cosmwasm_schema::write_api; +use strategy_osmosis::msgs::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg + } +} diff --git a/contracts/strategy-osmosis/src/msgs.rs b/contracts/strategy-osmosis/src/msgs.rs index 38e944f..a43daed 100644 --- a/contracts/strategy-osmosis/src/msgs.rs +++ b/contracts/strategy-osmosis/src/msgs.rs @@ -1,5 +1,5 @@ -use crate::state::{DepositToken, ExternToken}; -use cosmwasm_schema::cw_serde; +use crate::state::{DepositToken, ExternToken, Config,State, Unbonding}; +use cosmwasm_schema::{cw_serde, QueryResponses}; use cosmwasm_std::IbcEndpoint; use cosmwasm_std::{Coin, Decimal, Uint128}; @@ -103,22 +103,31 @@ pub struct IcaBeginUnbondLpTokensMsg { } #[cw_serde] +#[derive(QueryResponses)] pub enum QueryMsg { + #[returns(Config)] Config {}, + #[returns(State)] State {}, + #[returns(Uint128)] Bonded { addr: String, }, + #[returns(Uint128)] Unbonding { addr: String, }, + #[returns(FeeInfo)] Fee {}, /// Show all channels connected to. + #[returns(ListChannelsResponse)] ListChannels {}, /// Returns the details of the name channel, error if not created. + #[returns(ChannelResponse)] Channel { id: String, }, + #[returns(Vec)] Unbondings {}, } diff --git a/contracts/strategy-osmosis/ts/StrategyOsmosis.client.ts b/contracts/strategy-osmosis/ts/StrategyOsmosis.client.ts new file mode 100644 index 0000000..0102a25 --- /dev/null +++ b/contracts/strategy-osmosis/ts/StrategyOsmosis.client.ts @@ -0,0 +1,265 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExternToken, SwapAmountInRoute, ExecuteMsg, DepositToken, Phase, PhaseStep, Uint128, UpdateConfigMsg, StakeMsg, UnstakeMsg, ExecuteSuperfluidDelegateMsg, ExecuteEpochMsg, QueryMsg, ChannelResponse, ChannelInfo, IbcEndpoint, Addr, Config, Decimal, FeeInfo, ListChannelsResponse, State, ArrayOfUnbonding, Unbonding } from "./StrategyOsmosis.types"; +export interface StrategyOsmosisReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + bonded: ({ + addr + }: { + addr: string; + }) => Promise; + unbonding: ({ + addr + }: { + addr: string; + }) => Promise; + fee: () => Promise; + listChannels: () => Promise; + channel: ({ + id + }: { + id: string; + }) => Promise; + unbondings: () => Promise; +} +export class StrategyOsmosisQueryClient implements StrategyOsmosisReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.bonded = this.bonded.bind(this); + this.unbonding = this.unbonding.bind(this); + this.fee = this.fee.bind(this); + this.listChannels = this.listChannels.bind(this); + this.channel = this.channel.bind(this); + this.unbondings = this.unbondings.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + bonded = async ({ + addr + }: { + addr: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + bonded: { + addr + } + }); + }; + unbonding = async ({ + addr + }: { + addr: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + unbonding: { + addr + } + }); + }; + fee = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + fee: {} + }); + }; + listChannels = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_channels: {} + }); + }; + channel = async ({ + id + }: { + id: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + channel: { + id + } + }); + }; + unbondings = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + unbondings: {} + }); + }; +} +export interface StrategyOsmosisInterface extends StrategyOsmosisReadOnlyInterface { + contractAddress: string; + sender: string; + updateConfig: ({ + automateSuperfluid, + baseDenom, + chainId, + controllerDepositDenom, + controllerTransferChannelId, + depositToken, + externTokens, + icaChannelId, + lpDenom, + owner, + phase, + phaseStep, + poolId, + quoteDenom, + superfluidValidator, + transferChannelId, + transferTimeout, + unbondPeriod + }: { + automateSuperfluid?: boolean; + baseDenom?: string; + chainId?: string; + controllerDepositDenom?: string; + controllerTransferChannelId?: string; + depositToken?: DepositToken; + externTokens?: ExternToken[]; + icaChannelId?: string; + lpDenom?: string; + owner?: string; + phase?: Phase; + phaseStep?: PhaseStep; + poolId?: number; + quoteDenom?: string; + superfluidValidator?: string; + transferChannelId?: string; + transferTimeout?: number; + unbondPeriod?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + stake: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstake: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + superfluidDelegate: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + executeEpoch: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class StrategyOsmosisClient extends StrategyOsmosisQueryClient implements StrategyOsmosisInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateConfig = this.updateConfig.bind(this); + this.stake = this.stake.bind(this); + this.unstake = this.unstake.bind(this); + this.superfluidDelegate = this.superfluidDelegate.bind(this); + this.executeEpoch = this.executeEpoch.bind(this); + } + + updateConfig = async ({ + automateSuperfluid, + baseDenom, + chainId, + controllerDepositDenom, + controllerTransferChannelId, + depositToken, + externTokens, + icaChannelId, + lpDenom, + owner, + phase, + phaseStep, + poolId, + quoteDenom, + superfluidValidator, + transferChannelId, + transferTimeout, + unbondPeriod + }: { + automateSuperfluid?: boolean; + baseDenom?: string; + chainId?: string; + controllerDepositDenom?: string; + controllerTransferChannelId?: string; + depositToken?: DepositToken; + externTokens?: ExternToken[]; + icaChannelId?: string; + lpDenom?: string; + owner?: string; + phase?: Phase; + phaseStep?: PhaseStep; + poolId?: number; + quoteDenom?: string; + superfluidValidator?: string; + transferChannelId?: string; + transferTimeout?: number; + unbondPeriod?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_config: { + automate_superfluid: automateSuperfluid, + base_denom: baseDenom, + chain_id: chainId, + controller_deposit_denom: controllerDepositDenom, + controller_transfer_channel_id: controllerTransferChannelId, + deposit_token: depositToken, + extern_tokens: externTokens, + ica_channel_id: icaChannelId, + lp_denom: lpDenom, + owner, + phase, + phase_step: phaseStep, + pool_id: poolId, + quote_denom: quoteDenom, + superfluid_validator: superfluidValidator, + transfer_channel_id: transferChannelId, + transfer_timeout: transferTimeout, + unbond_period: unbondPeriod + } + }, fee, memo, _funds); + }; + stake = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + stake: {} + }, fee, memo, _funds); + }; + unstake = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake: { + amount + } + }, fee, memo, _funds); + }; + superfluidDelegate = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + superfluid_delegate: {} + }, fee, memo, _funds); + }; + executeEpoch = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + execute_epoch: {} + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/contracts/strategy-osmosis/ts/StrategyOsmosis.types.ts b/contracts/strategy-osmosis/ts/StrategyOsmosis.types.ts new file mode 100644 index 0000000..7177fe8 --- /dev/null +++ b/contracts/strategy-osmosis/ts/StrategyOsmosis.types.ts @@ -0,0 +1,170 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + automate_superfluid: boolean; + base_denom: string; + chain_id: string; + controller_deposit_denom: string; + controller_transfer_channel_id: string; + extern_tokens: ExternToken[]; + lp_denom: string; + pool_id: number; + quote_denom: string; + superfluid_validator: string; + transfer_channel_id: string; + transfer_timeout: number; + unbond_period: number; +} +export interface ExternToken { + extern_token: string; + swap_in_route: SwapAmountInRoute[]; +} +export interface SwapAmountInRoute { + pool_id: number; + token_out_denom: string; + [k: string]: unknown; +} +export type ExecuteMsg = { + update_config: UpdateConfigMsg; +} | { + stake: StakeMsg; +} | { + unstake: UnstakeMsg; +} | { + superfluid_delegate: ExecuteSuperfluidDelegateMsg; +} | { + execute_epoch: ExecuteEpochMsg; +}; +export type DepositToken = "base" | "quote"; +export type Phase = "deposit" | "withdraw"; +export type PhaseStep = "ibc_transfer_to_host" | "ibc_transfer_to_host_callback" | "request_icq_after_ibc_transfer_to_host" | "response_icq_after_ibc_transfer_to_host" | "sell_extern_tokens" | "sell_extern_tokens_callback" | "request_icq_after_sell_extern_tokens" | "response_icq_after_sell_extern_tokens" | "add_liquidity" | "add_liquidity_callback" | "bond_liquidity" | "bond_liquidity_callback" | "request_icq_after_bond_liquidity" | "response_icq_after_bond_liquidity" | "begin_unbonding_for_pending_requests" | "begin_unbonding_for_pending_requests_callback" | "check_matured_unbondings" | "remove_liquidity" | "remove_liquidity_callback" | "request_icq_after_remove_liquidity" | "response_icq_after_remove_liquidity" | "swap_two_tokens_to_deposit_token" | "swap_two_tokens_to_deposit_token_callback" | "request_icq_after_swap_two_tokens_to_deposit_token" | "response_icq_after_swap_two_tokens_to_deposit_token" | "ibc_transfer_to_controller" | "ibc_transfer_to_controller_callback" | "request_icq_after_ibc_transfer_to_controller" | "response_icq_after_ibc_transfer_to_controller" | "distribute_to_unbonded_users"; +export type Uint128 = string; +export interface UpdateConfigMsg { + automate_superfluid?: boolean | null; + base_denom?: string | null; + chain_id?: string | null; + controller_deposit_denom?: string | null; + controller_transfer_channel_id?: string | null; + deposit_token?: DepositToken | null; + extern_tokens?: ExternToken[] | null; + ica_channel_id?: string | null; + lp_denom?: string | null; + owner?: string | null; + phase?: Phase | null; + phase_step?: PhaseStep | null; + pool_id?: number | null; + quote_denom?: string | null; + superfluid_validator?: string | null; + transfer_channel_id?: string | null; + transfer_timeout?: number | null; + unbond_period?: number | null; +} +export interface StakeMsg {} +export interface UnstakeMsg { + amount: Uint128; +} +export interface ExecuteSuperfluidDelegateMsg {} +export interface ExecuteEpochMsg {} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + bonded: { + addr: string; + }; +} | { + unbonding: { + addr: string; + }; +} | { + fee: {}; +} | { + list_channels: {}; +} | { + channel: { + id: string; + }; +} | { + unbondings: {}; +}; +export interface ChannelResponse { + info: ChannelInfo; +} +export interface ChannelInfo { + address: string; + connection_id: string; + counterparty_endpoint: IbcEndpoint; + id: string; +} +export interface IbcEndpoint { + channel_id: string; + port_id: string; + [k: string]: unknown; +} +export type Addr = string; +export interface Config { + automate_superfluid: boolean; + base_denom: string; + chain_id: string; + controller_deposit_denom: string; + controller_transfer_channel_id: string; + deposit_token: DepositToken; + extern_tokens: ExternToken[]; + ica_account: string; + ica_channel_id: string; + ica_connection_id: string; + lp_denom: string; + owner: Addr; + phase: Phase; + phase_step: PhaseStep; + pool_id: number; + quote_denom: string; + superfluid_validator: string; + transfer_channel_id: string; + transfer_timeout: number; + unbond_period: number; +} +export type Decimal = string; +export interface FeeInfo { + deposit_fee_rate: Decimal; + interest_fee_rate: Decimal; + withdraw_fee_rate: Decimal; +} +export interface ListChannelsResponse { + channels: ChannelInfo[]; +} +export interface State { + bonded_lp_amount: Uint128; + controller_free_amount: Uint128; + controller_pending_transfer_amount: Uint128; + controller_stacked_amount_to_deposit: Uint128; + extern_token_amounts: Uint128[]; + free_base_amount: Uint128; + free_lp_amount: Uint128; + free_quote_amount: Uint128; + last_unbonding_id: number; + lock_id: number; + lp_redemption_rate: Uint128; + pending_bond_lp_amount: Uint128; + pending_icq: number; + pending_lp_removal_amount: Uint128; + redemption_rate: Uint128; + total_deposit: Uint128; + total_shares: Uint128; + total_withdrawn: Uint128; + unbonding_lp_amount: Uint128; +} +export type ArrayOfUnbonding = Unbonding[]; +export interface Unbonding { + amount: Uint128; + id: number; + marked: boolean; + pending_start: boolean; + sender: Addr; + start_time: number; +} \ No newline at end of file diff --git a/contracts/yieldaggregator-adapter/schema/raw/execute.json b/contracts/yieldaggregator-adapter/schema/raw/execute.json index c0cc200..851af15 100644 --- a/contracts/yieldaggregator-adapter/schema/raw/execute.json +++ b/contracts/yieldaggregator-adapter/schema/raw/execute.json @@ -38,12 +38,6 @@ "depositor": { "type": "string" }, - "swap_output_denom": { - "type": [ - "string", - "null" - ] - }, "vault_id": { "type": "integer", "format": "uint64", @@ -60,15 +54,6 @@ "string", "null" ] - }, - "denom_swap_contract_map": { - "type": [ - "object", - "null" - ], - "additionalProperties": { - "type": "string" - } } }, "additionalProperties": false diff --git a/contracts/yieldaggregator-adapter/schema/raw/instantiate.json b/contracts/yieldaggregator-adapter/schema/raw/instantiate.json index f5e5b74..b093e2e 100644 --- a/contracts/yieldaggregator-adapter/schema/raw/instantiate.json +++ b/contracts/yieldaggregator-adapter/schema/raw/instantiate.json @@ -3,18 +3,11 @@ "title": "InstantiateMsg", "type": "object", "required": [ - "authority", - "denom_swap_contract_map" + "authority" ], "properties": { "authority": { "type": "string" - }, - "denom_swap_contract_map": { - "type": "object", - "additionalProperties": { - "type": "string" - } } }, "additionalProperties": false diff --git a/contracts/yieldaggregator-adapter/schema/raw/response_to_params.json b/contracts/yieldaggregator-adapter/schema/raw/response_to_params.json index 6c868b1..b05e407 100644 --- a/contracts/yieldaggregator-adapter/schema/raw/response_to_params.json +++ b/contracts/yieldaggregator-adapter/schema/raw/response_to_params.json @@ -3,18 +3,11 @@ "title": "Params", "type": "object", "required": [ - "authority", - "symbol_swap_contract_map" + "authority" ], "properties": { "authority": { "$ref": "#/definitions/Addr" - }, - "symbol_swap_contract_map": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Addr" - } } }, "additionalProperties": false, diff --git a/contracts/yieldaggregator-adapter/schema/yieldaggregator-adapter.json b/contracts/yieldaggregator-adapter/schema/yieldaggregator-adapter.json index 8ef15e5..6efc9cf 100644 --- a/contracts/yieldaggregator-adapter/schema/yieldaggregator-adapter.json +++ b/contracts/yieldaggregator-adapter/schema/yieldaggregator-adapter.json @@ -7,18 +7,11 @@ "title": "InstantiateMsg", "type": "object", "required": [ - "authority", - "denom_swap_contract_map" + "authority" ], "properties": { "authority": { "type": "string" - }, - "denom_swap_contract_map": { - "type": "object", - "additionalProperties": { - "type": "string" - } } }, "additionalProperties": false @@ -63,12 +56,6 @@ "depositor": { "type": "string" }, - "swap_output_denom": { - "type": [ - "string", - "null" - ] - }, "vault_id": { "type": "integer", "format": "uint64", @@ -85,15 +72,6 @@ "string", "null" ] - }, - "denom_swap_contract_map": { - "type": [ - "object", - "null" - ], - "additionalProperties": { - "type": "string" - } } }, "additionalProperties": false @@ -127,18 +105,11 @@ "title": "Params", "type": "object", "required": [ - "authority", - "symbol_swap_contract_map" + "authority" ], "properties": { "authority": { "$ref": "#/definitions/Addr" - }, - "symbol_swap_contract_map": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Addr" - } } }, "additionalProperties": false,