Skip to content

Commit

Permalink
generate schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Feb 15, 2024
1 parent 0241c63 commit e792c62
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 67 deletions.
30 changes: 25 additions & 5 deletions contracts/arena-core/schema/arena-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,18 +798,18 @@
}
]
},
"MemberShare_for_String": {
"MemberPercentage_for_String": {
"type": "object",
"required": [
"addr",
"shares"
"percentage"
],
"properties": {
"addr": {
"type": "string"
},
"shares": {
"$ref": "#/definitions/Uint128"
"percentage": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -899,13 +899,33 @@
"title"
],
"properties": {
"cw20_msg": {
"anyOf": [
{
"$ref": "#/definitions/Binary"
},
{
"type": "null"
}
]
},
"cw721_msg": {
"anyOf": [
{
"$ref": "#/definitions/Binary"
},
{
"type": "null"
}
]
},
"description": {
"type": "string"
},
"distribution": {
"type": "array",
"items": {
"$ref": "#/definitions/MemberShare_for_String"
"$ref": "#/definitions/MemberPercentage_for_String"
}
},
"id": {
Expand Down
82 changes: 66 additions & 16 deletions contracts/arena-escrow/schema/arena-escrow.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"distribution": {
"type": "array",
"items": {
"$ref": "#/definitions/MemberShare_for_String"
"$ref": "#/definitions/MemberPercentage_for_String"
}
}
},
Expand Down Expand Up @@ -333,11 +333,21 @@
"distribution": {
"type": "array",
"items": {
"$ref": "#/definitions/MemberShare_for_String"
"$ref": "#/definitions/MemberPercentage_for_String"
}
},
"remainder_addr": {
"type": "string"
},
"tax_info": {
"anyOf": [
{
"$ref": "#/definitions/TaxInformation_for_String"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
Expand Down Expand Up @@ -384,6 +394,10 @@
},
"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"
},
"Expiration": {
"description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)",
"oneOf": [
Expand Down Expand Up @@ -431,18 +445,54 @@
}
]
},
"MemberShare_for_String": {
"MemberPercentage_for_String": {
"type": "object",
"required": [
"addr",
"shares"
"percentage"
],
"properties": {
"addr": {
"type": "string"
},
"shares": {
"$ref": "#/definitions/Uint128"
"percentage": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
},
"TaxInformation_for_String": {
"type": "object",
"required": [
"receiver",
"tax"
],
"properties": {
"cw20_msg": {
"anyOf": [
{
"$ref": "#/definitions/Binary"
},
{
"type": "null"
}
]
},
"cw721_msg": {
"anyOf": [
{
"$ref": "#/definitions/Binary"
},
{
"type": "null"
}
]
},
"receiver": {
"type": "string"
},
"tax": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -953,34 +1003,34 @@
},
"distribution": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Nullable_Array_of_MemberShare_for_String",
"title": "Nullable_Array_of_MemberPercentage_for_String",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/MemberShare_for_String"
"$ref": "#/definitions/MemberPercentage_for_String"
},
"definitions": {
"MemberShare_for_String": {
"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"
},
"MemberPercentage_for_String": {
"type": "object",
"required": [
"addr",
"shares"
"percentage"
],
"properties": {
"addr": {
"type": "string"
},
"shares": {
"$ref": "#/definitions/Uint128"
"percentage": {
"$ref": "#/definitions/Decimal"
}
},
"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"
}
}
},
Expand Down
Loading

0 comments on commit e792c62

Please sign in to comment.