Skip to content

Commit

Permalink
feat: generate schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Jan 8, 2024
1 parent 310e327 commit d96fad3
Show file tree
Hide file tree
Showing 13 changed files with 2,409 additions and 0 deletions.
1,209 changes: 1,209 additions & 0 deletions contracts/alliance-lp-hub/schema/alliance-lp-hub.json

Large diffs are not rendered by default.

333 changes: 333 additions & 0 deletions contracts/alliance-lp-hub/schema/raw/execute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,333 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"oneOf": [
{
"type": "object",
"required": [
"stake"
],
"properties": {
"stake": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"unstake"
],
"properties": {
"unstake": {
"$ref": "#/definitions/AssetBase_for_Addr"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"claim_rewards"
],
"properties": {
"claim_rewards": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"update_rewards"
],
"properties": {
"update_rewards": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"whitelist_assets"
],
"properties": {
"whitelist_assets": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"remove_assets"
],
"properties": {
"remove_assets": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"update_rewards_callback"
],
"properties": {
"update_rewards_callback": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"alliance_delegate"
],
"properties": {
"alliance_delegate": {
"$ref": "#/definitions/AllianceDelegateMsg"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"alliance_undelegate"
],
"properties": {
"alliance_undelegate": {
"$ref": "#/definitions/AllianceUndelegateMsg"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"alliance_redelegate"
],
"properties": {
"alliance_redelegate": {
"$ref": "#/definitions/AllianceRedelegateMsg"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"rebalance_emissions"
],
"properties": {
"rebalance_emissions": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"rebalance_emissions_callback"
],
"properties": {
"rebalance_emissions_callback": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
],
"definitions": {
"Addr": {
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
"type": "string"
},
"AllianceDelegateMsg": {
"type": "object",
"required": [
"delegations"
],
"properties": {
"delegations": {
"type": "array",
"items": {
"$ref": "#/definitions/AllianceDelegation"
}
}
},
"additionalProperties": false
},
"AllianceDelegation": {
"type": "object",
"required": [
"amount",
"validator"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
},
"validator": {
"type": "string"
}
},
"additionalProperties": false
},
"AllianceRedelegateMsg": {
"type": "object",
"required": [
"redelegations"
],
"properties": {
"redelegations": {
"type": "array",
"items": {
"$ref": "#/definitions/AllianceRedelegation"
}
}
},
"additionalProperties": false
},
"AllianceRedelegation": {
"type": "object",
"required": [
"amount",
"dst_validator",
"src_validator"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
},
"dst_validator": {
"type": "string"
},
"src_validator": {
"type": "string"
}
},
"additionalProperties": false
},
"AllianceUndelegateMsg": {
"type": "object",
"required": [
"undelegations"
],
"properties": {
"undelegations": {
"type": "array",
"items": {
"$ref": "#/definitions/AllianceDelegation"
}
}
},
"additionalProperties": false
},
"AssetBase_for_Addr": {
"description": "Represents a fungible asset with a known amount\n\nEach asset instance contains two values: [`info`], which specifies the asset's type (CW20 or native), and its [`amount`], which specifies the asset's amount",
"type": "object",
"required": [
"amount",
"info"
],
"properties": {
"amount": {
"description": "Specifies the asset's amount",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
},
"info": {
"description": "Specifies the asset's type (CW20 or native)",
"allOf": [
{
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
]
}
},
"additionalProperties": false
},
"AssetInfoBase_for_Addr": {
"description": "Represents the type of an fungible asset\n\nEach **asset info** instance can be one of three variants:\n\n- Native SDK coins. To create an **asset info** instance of this type, provide the denomination. - CW20 tokens. To create an **asset info** instance of this type, provide the contract address. - CW1155 tokens. To create an **asset info** instance of this type, provide the contract address and token ID.",
"oneOf": [
{
"type": "object",
"required": [
"native"
],
"properties": {
"native": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"cw20"
],
"properties": {
"cw20": {
"$ref": "#/definitions/Addr"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"cw1155"
],
"properties": {
"cw1155": {
"type": "array",
"items": [
{
"$ref": "#/definitions/Addr"
},
{
"type": "string"
}
],
"maxItems": 2,
"minItems": 2
}
},
"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"
}
}
}
22 changes: 22 additions & 0 deletions contracts/alliance-lp-hub/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "InstantiateMsg",
"type": "object",
"required": [
"controller",
"governance",
"reward_denom"
],
"properties": {
"controller": {
"type": "string"
},
"governance": {
"type": "string"
},
"reward_denom": {
"type": "string"
}
},
"additionalProperties": false
}
Loading

0 comments on commit d96fad3

Please sign in to comment.