Skip to content

Commit

Permalink
Update schema and types
Browse files Browse the repository at this point in the history
  • Loading branch information
shanev committed Mar 7, 2022
1 parent 789408d commit c55ea7f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
18 changes: 5 additions & 13 deletions contracts/minter/schema/config_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"properties": {
"admin": {
"$ref": "#/definitions/Addr"
"type": "string"
},
"base_token_uri": {
"type": "string"
Expand All @@ -30,7 +30,7 @@
"minimum": 0.0
},
"sg721_address": {
"$ref": "#/definitions/Addr"
"type": "string"
},
"sg721_code_id": {
"type": "integer",
Expand All @@ -44,21 +44,13 @@
"$ref": "#/definitions/Coin"
},
"whitelist": {
"anyOf": [
{
"$ref": "#/definitions/Addr"
},
{
"type": "null"
}
"type": [
"string",
"null"
]
}
},
"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"
},
"Coin": {
"type": "object",
"required": [
Expand Down
13 changes: 12 additions & 1 deletion types/contracts/minter/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import { Addr, Coin, Timestamp } from "./shared-types";
import { Coin, Timestamp } from "./shared-types";

/**
* A human readable address.
*
* In 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.
*
* This 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.
*
* This 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.
*/
export type Addr = string

export interface Config {
admin: Addr
Expand Down
8 changes: 4 additions & 4 deletions types/contracts/minter/config_response.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Addr, Coin, Timestamp } from "./shared-types";
import { Coin, Timestamp } from "./shared-types";

export interface ConfigResponse {
admin: Addr
admin: string
base_token_uri: string
num_tokens: number
per_address_limit: number
sg721_address: Addr
sg721_address: string
sg721_code_id: number
start_time: Timestamp
unit_price: Coin
whitelist?: (Addr | null)
whitelist?: (string | null)
[k: string]: unknown
}
10 changes: 0 additions & 10 deletions types/contracts/minter/shared-types.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/**
* A human readable address.
*
* In 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.
*
* This 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.
*
* This 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.
*/
export type Addr = string;
/**
* A point in time in nanosecond precision.
*
Expand Down

0 comments on commit c55ea7f

Please sign in to comment.