Skip to content

Commit

Permalink
Schema updated
Browse files Browse the repository at this point in the history
  • Loading branch information
hashedone committed Aug 4, 2021
1 parent aabaa7f commit 2831cf6
Show file tree
Hide file tree
Showing 3 changed files with 246 additions and 0 deletions.
111 changes: 111 additions & 0 deletions contracts/cw20-base/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,93 @@
}
},
"additionalProperties": false
},
{
"description": "Only with the \"marketing\" extension. If authorised, updates marketing metadata. Setting None/null for any of these will leave it unchanged, Setting Some(\"\") will clear this field on the contract stroage.",
"type": "object",
"required": [
"update_marketing"
],
"properties": {
"update_marketing": {
"type": "object",
"properties": {
"description": {
"description": "A longer description of the token and it's utility. Designed for tooltips or such",
"type": [
"string",
"null"
]
},
"marketing": {
"description": "The address (if any) who can update this data structure",
"type": [
"string",
"null"
]
},
"project": {
"description": "A URL pointing to the project behind this token",
"type": [
"string",
"null"
]
}
}
}
},
"additionalProperties": false
},
{
"description": "If set as the \"marketing\" role on the contract, upload a new URL, SVG or PNG for the token",
"type": "object",
"required": [
"upload_logo"
],
"properties": {
"upload_logo": {
"$ref": "#/definitions/Logo"
}
},
"additionalProperties": false
}
],
"definitions": {
"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>",
"type": "string"
},
"EmbeddedLogo": {
"description": "This is used to store the logo on the blockchain in an accepted format. Enforce maximum size of 5KB on all variants.",
"anyOf": [
{
"description": "Store the Logo as an SVG file. The content must conform to the spec at https://en.wikipedia.org/wiki/Scalable_Vector_Graphics (The contract should do some light-weight sanity-check validation)",
"type": "object",
"required": [
"svg"
],
"properties": {
"svg": {
"$ref": "#/definitions/Binary"
}
},
"additionalProperties": false
},
{
"description": "Store the Logo as a PNG file. This will likely only support up to 64x64 or so within the 5KB limit.",
"type": "object",
"required": [
"png"
],
"properties": {
"png": {
"$ref": "#/definitions/Binary"
}
},
"additionalProperties": false
}
]
},
"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)",
"anyOf": [
Expand Down Expand Up @@ -311,6 +391,37 @@
}
]
},
"Logo": {
"description": "This is used for uploading logo data, or setting it in InstantiateData",
"anyOf": [
{
"description": "A reference to an externally hosted logo. Must be a valid HTTP or HTTPS URL.",
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string"
}
},
"additionalProperties": false
},
{
"description": "Logo content stored on the blockchain. Enforce maximum size of 5KB on all variants",
"type": "object",
"required": [
"embedded"
],
"properties": {
"embedded": {
"$ref": "#/definitions/EmbeddedLogo"
}
},
"additionalProperties": false
}
]
},
"Timestamp": {
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```",
"allOf": [
Expand Down
109 changes: 109 additions & 0 deletions contracts/cw20-base/schema/instantiate_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
"$ref": "#/definitions/Cw20Coin"
}
},
"marketing": {
"anyOf": [
{
"$ref": "#/definitions/InstantiateMarketingInfo"
},
{
"type": "null"
}
]
},
"mint": {
"anyOf": [
{
Expand All @@ -38,6 +48,10 @@
}
},
"definitions": {
"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>",
"type": "string"
},
"Cw20Coin": {
"type": "object",
"required": [
Expand All @@ -53,6 +67,101 @@
}
}
},
"EmbeddedLogo": {
"description": "This is used to store the logo on the blockchain in an accepted format. Enforce maximum size of 5KB on all variants.",
"anyOf": [
{
"description": "Store the Logo as an SVG file. The content must conform to the spec at https://en.wikipedia.org/wiki/Scalable_Vector_Graphics (The contract should do some light-weight sanity-check validation)",
"type": "object",
"required": [
"svg"
],
"properties": {
"svg": {
"$ref": "#/definitions/Binary"
}
},
"additionalProperties": false
},
{
"description": "Store the Logo as a PNG file. This will likely only support up to 64x64 or so within the 5KB limit.",
"type": "object",
"required": [
"png"
],
"properties": {
"png": {
"$ref": "#/definitions/Binary"
}
},
"additionalProperties": false
}
]
},
"InstantiateMarketingInfo": {
"type": "object",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"logo": {
"anyOf": [
{
"$ref": "#/definitions/Logo"
},
{
"type": "null"
}
]
},
"marketing": {
"type": [
"string",
"null"
]
},
"project": {
"type": [
"string",
"null"
]
}
}
},
"Logo": {
"description": "This is used for uploading logo data, or setting it in InstantiateData",
"anyOf": [
{
"description": "A reference to an externally hosted logo. Must be a valid HTTP or HTTPS URL.",
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string"
}
},
"additionalProperties": false
},
{
"description": "Logo content stored on the blockchain. Enforce maximum size of 5KB on all variants",
"type": "object",
"required": [
"embedded"
],
"properties": {
"embedded": {
"$ref": "#/definitions/EmbeddedLogo"
}
},
"additionalProperties": false
}
]
},
"MinterResponse": {
"type": "object",
"required": [
Expand Down
26 changes: 26 additions & 0 deletions contracts/cw20-base/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,32 @@
}
},
"additionalProperties": false
},
{
"description": "Only with \"marketing\" extension Returns more metadata on the contract to display in the client: - description, logo, project url, etc. Return type: MarketingInfoResponse",
"type": "object",
"required": [
"marketing_info"
],
"properties": {
"marketing_info": {
"type": "object"
}
},
"additionalProperties": false
},
{
"description": "Only with \"marketing\" extension Downloads the mbeded logo data (if stored on chain). Errors if no logo data ftored for this contract. Return type: DownloadLogoResponse.",
"type": "object",
"required": [
"download_logo"
],
"properties": {
"download_logo": {
"type": "object"
}
},
"additionalProperties": false
}
]
}

0 comments on commit 2831cf6

Please sign in to comment.