Skip to content

Commit

Permalink
run ts-codegen; save ts types
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Jul 29, 2024
1 parent 752545f commit 9c84712
Show file tree
Hide file tree
Showing 11 changed files with 1,706 additions and 0 deletions.
226 changes: 226 additions & 0 deletions contracts/hydro/schema/execute_msg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"oneOf": [
{
"type": "object",
"required": [
"lock_tokens"
],
"properties": {
"lock_tokens": {
"type": "object",
"required": [
"lock_duration"
],
"properties": {
"lock_duration": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"refresh_lock_duration"
],
"properties": {
"refresh_lock_duration": {
"type": "object",
"required": [
"lock_duration",
"lock_id"
],
"properties": {
"lock_duration": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"lock_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"unlock_tokens"
],
"properties": {
"unlock_tokens": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"create_proposal"
],
"properties": {
"create_proposal": {
"type": "object",
"required": [
"covenant_params",
"description",
"title",
"tranche_id"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"tranche_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"vote"
],
"properties": {
"vote": {
"type": "object",
"required": [
"proposal_id",
"tranche_id"
],
"properties": {
"proposal_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"tranche_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"add_to_whitelist"
],
"properties": {
"add_to_whitelist": {
"type": "object",
"required": [
"covenant_params"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"remove_from_whitelist"
],
"properties": {
"remove_from_whitelist": {
"type": "object",
"required": [
"covenant_params"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"update_max_locked_tokens"
],
"properties": {
"update_max_locked_tokens": {
"type": "object",
"required": [
"max_locked_tokens"
],
"properties": {
"max_locked_tokens": {
"type": "integer",
"format": "uint128",
"minimum": 0.0
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"pause"
],
"properties": {
"pause": {
"type": "object"
}
},
"additionalProperties": false
}
],
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"additionalProperties": false
}
}
}
108 changes: 108 additions & 0 deletions contracts/hydro/schema/instantiate_msg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "InstantiateMsg",
"type": "object",
"required": [
"denom",
"first_round_start",
"initial_whitelist",
"lock_epoch_length",
"max_locked_tokens",
"round_length",
"tranches",
"whitelist_admins"
],
"properties": {
"denom": {
"type": "string"
},
"first_round_start": {
"$ref": "#/definitions/Timestamp"
},
"initial_whitelist": {
"type": "array",
"items": {
"$ref": "#/definitions/CovenantParams"
}
},
"lock_epoch_length": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"max_locked_tokens": {
"type": "integer",
"format": "uint128",
"minimum": 0.0
},
"round_length": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"tranches": {
"type": "array",
"items": {
"$ref": "#/definitions/Tranche"
}
},
"whitelist_admins": {
"type": "array",
"items": {
"type": "string"
}
}
},
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"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": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"Tranche": {
"type": "object",
"required": [
"metadata",
"tranche_id"
],
"properties": {
"metadata": {
"type": "string"
},
"tranche_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"additionalProperties": false
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
}
}
}
Loading

0 comments on commit 9c84712

Please sign in to comment.