Skip to content

Commit

Permalink
feat: update asset manager schema
Browse files Browse the repository at this point in the history
Signed-off-by: Night Owl <[email protected]>
  • Loading branch information
nightowl121 committed Sep 8, 2023
1 parent 2320ccc commit cd01736
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 69 deletions.
165 changes: 130 additions & 35 deletions contracts/core-contracts/cw-asset-manager/schema/cw-asset-manager.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"title": "InstantiateMsg",
"type": "object",
"required": [
"cw20_whitelist"
"destination_asset_manager",
"source_xcall"
],
"properties": {
"cw20_whitelist": {
"type": "array",
"items": {
"type": "string"
}
"destination_asset_manager": {
"type": "string"
},
"source_xcall": {
"type": "string"
}
},
"additionalProperties": false
Expand All @@ -39,30 +40,22 @@
"amount": {
"$ref": "#/definitions/Uint128"
},
"token_address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"withdraw_request"
],
"properties": {
"withdraw_request": {
"type": "object",
"required": [
"amount",
"token_address"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
"data": {
"type": [
"array",
"null"
],
"items": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
}
},
"to": {
"type": [
"string",
"null"
]
},
"token_address": {
"type": "string"
Expand All @@ -82,11 +75,11 @@
"configure_xcall": {
"type": "object",
"required": [
"destination_contract",
"destination_asset_manager",
"source_xcall"
],
"properties": {
"destination_contract": {
"destination_asset_manager": {
"type": "string"
},
"source_xcall": {
Expand Down Expand Up @@ -139,10 +132,112 @@
"query": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "QueryMsg",
"type": "string",
"enum": []
"oneOf": [
{
"type": "object",
"required": [
"get_owner"
],
"properties": {
"get_owner": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"get_configuration"
],
"properties": {
"get_configuration": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"get_net_ids"
],
"properties": {
"get_net_ids": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"migrate": null,
"sudo": null,
"responses": {}
"responses": {
"get_configuration": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ConfigureResponse",
"type": "object",
"required": [
"icon_asset_manager",
"source_xcall"
],
"properties": {
"icon_asset_manager": {
"type": "string"
},
"source_xcall": {
"$ref": "#/definitions/Addr"
}
},
"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"
}
}
},
"get_net_ids": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NetIdResponse",
"type": "object",
"required": [
"icon_nid",
"x_call_nid"
],
"properties": {
"icon_nid": {
"type": "string"
},
"x_call_nid": {
"type": "string"
}
},
"additionalProperties": false
},
"get_owner": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OwnerResponse",
"type": "object",
"required": [
"owner"
],
"properties": {
"owner": {
"$ref": "#/definitions/Addr"
}
},
"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"
}
}
}
}
}
44 changes: 18 additions & 26 deletions contracts/core-contracts/cw-asset-manager/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,22 @@
"amount": {
"$ref": "#/definitions/Uint128"
},
"token_address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"withdraw_request"
],
"properties": {
"withdraw_request": {
"type": "object",
"required": [
"amount",
"token_address"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
"data": {
"type": [
"array",
"null"
],
"items": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
}
},
"to": {
"type": [
"string",
"null"
]
},
"token_address": {
"type": "string"
Expand All @@ -61,11 +53,11 @@
"configure_xcall": {
"type": "object",
"required": [
"destination_contract",
"destination_asset_manager",
"source_xcall"
],
"properties": {
"destination_contract": {
"destination_asset_manager": {
"type": "string"
},
"source_xcall": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"title": "InstantiateMsg",
"type": "object",
"required": [
"cw20_whitelist"
"destination_asset_manager",
"source_xcall"
],
"properties": {
"cw20_whitelist": {
"type": "array",
"items": {
"type": "string"
}
"destination_asset_manager": {
"type": "string"
},
"source_xcall": {
"type": "string"
}
},
"additionalProperties": false
Expand Down
43 changes: 41 additions & 2 deletions contracts/core-contracts/cw-asset-manager/schema/raw/query.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "QueryMsg",
"type": "string",
"enum": []
"oneOf": [
{
"type": "object",
"required": [
"get_owner"
],
"properties": {
"get_owner": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"get_configuration"
],
"properties": {
"get_configuration": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"get_net_ids"
],
"properties": {
"get_net_ids": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ConfigureResponse",
"type": "object",
"required": [
"icon_asset_manager",
"source_xcall"
],
"properties": {
"icon_asset_manager": {
"type": "string"
},
"source_xcall": {
"$ref": "#/definitions/Addr"
}
},
"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"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NetIdResponse",
"type": "object",
"required": [
"icon_nid",
"x_call_nid"
],
"properties": {
"icon_nid": {
"type": "string"
},
"x_call_nid": {
"type": "string"
}
},
"additionalProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OwnerResponse",
"type": "object",
"required": [
"owner"
],
"properties": {
"owner": {
"$ref": "#/definitions/Addr"
}
},
"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"
}
}
}

0 comments on commit cd01736

Please sign in to comment.