Files
nym/contracts/multisig/cw3-flex-multisig/schema/raw/instantiate.json
Jędrzej Stuczyński 9285aaf487 Generate json schema for all used contracts (#3693)
* removed sealed impl of serde for tx::Fee

* further upgraded cosmwasm to 1.3.0

* wip

* created schema for mixnet contract

* updated return type of 'GetBondedMixnodeDetailsByIdentity' query

* fixed imported version of serde_json_wasm

* updated return type of 'GetFamilyByHead' query

* updated return type of 'GetFamilyByLabel' query

* updated return type of 'GetFamilyMembersByHead' and 'GetFamilyMembersByLabel' queries

* fixed broken tests due to type changes

* added support for GetFamilyMembersByLabel and GetFamilyMembersByHead queries in 'mixnet_query_client'

* moved 'Account' and 'VestingContractError' to common crate

* created schema for vesting contract

* Added documentation for all query messages in the vesting contract

* improved mixnet contract schema by adding documentation to all query types

* feature-locking cw2 import

* created schema for the name service contract

* created schema for the service provider directory contract

* created schema for the coconut bandwidth contract

* created schema for the coconut dkg contract

* created schema for the coconut cw4 group contract

* created schema for the coconut cw3 multisig contract

* fixed missing import and adjusted makefile

* cargo fmt

* clippy

* adjusted contract CI to build with --lib flag

* missing --lib flag in the makefile

* updated lock files

* makefile for generating the schemas

* added github action to check for schema difference

* adding missing step to checkout the repo
2023-08-03 15:09:07 +01:00

262 lines
8.6 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "InstantiateMsg",
"type": "object",
"required": [
"coconut_bandwidth_contract_address",
"coconut_dkg_contract_address",
"group_addr",
"max_voting_period",
"threshold"
],
"properties": {
"coconut_bandwidth_contract_address": {
"type": "string"
},
"coconut_dkg_contract_address": {
"type": "string"
},
"executor": {
"anyOf": [
{
"$ref": "#/definitions/Executor"
},
{
"type": "null"
}
]
},
"group_addr": {
"type": "string"
},
"max_voting_period": {
"$ref": "#/definitions/Duration"
},
"proposal_deposit": {
"description": "The cost of creating a proposal (if any).",
"anyOf": [
{
"$ref": "#/definitions/UncheckedDepositInfo"
},
{
"type": "null"
}
]
},
"threshold": {
"$ref": "#/definitions/Threshold"
}
},
"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"
},
"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"
},
"Duration": {
"description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined",
"oneOf": [
{
"type": "object",
"required": [
"height"
],
"properties": {
"height": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"additionalProperties": false
},
{
"description": "Time in seconds",
"type": "object",
"required": [
"time"
],
"properties": {
"time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"additionalProperties": false
}
]
},
"Executor": {
"description": "Defines who is able to execute proposals once passed",
"oneOf": [
{
"description": "Any member of the voting group, even with 0 points",
"type": "string",
"enum": [
"member"
]
},
{
"description": "Only the given address",
"type": "object",
"required": [
"only"
],
"properties": {
"only": {
"$ref": "#/definitions/Addr"
}
},
"additionalProperties": false
}
]
},
"Threshold": {
"description": "This defines the different ways tallies can happen.\n\nThe total_weight used for calculating success as well as the weights of each individual voter used in tallying should be snapshotted at the beginning of the block at which the proposal starts (this is likely the responsibility of a correct cw4 implementation). See also `ThresholdResponse` in the cw3 spec.",
"oneOf": [
{
"description": "Declares that a fixed weight of Yes votes is needed to pass. See `ThresholdResponse.AbsoluteCount` in the cw3 spec for details.",
"type": "object",
"required": [
"absolute_count"
],
"properties": {
"absolute_count": {
"type": "object",
"required": [
"weight"
],
"properties": {
"weight": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Declares a percentage of the total weight that must cast Yes votes in order for a proposal to pass. See `ThresholdResponse.AbsolutePercentage` in the cw3 spec for details.",
"type": "object",
"required": [
"absolute_percentage"
],
"properties": {
"absolute_percentage": {
"type": "object",
"required": [
"percentage"
],
"properties": {
"percentage": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. See `ThresholdResponse.ThresholdQuorum` in the cw3 spec for details.",
"type": "object",
"required": [
"threshold_quorum"
],
"properties": {
"threshold_quorum": {
"type": "object",
"required": [
"quorum",
"threshold"
],
"properties": {
"quorum": {
"$ref": "#/definitions/Decimal"
},
"threshold": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
}
},
"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"
},
"UncheckedDenom": {
"oneOf": [
{
"type": "object",
"required": [
"native"
],
"properties": {
"native": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"cw20"
],
"properties": {
"cw20": {
"type": "string"
}
},
"additionalProperties": false
}
]
},
"UncheckedDepositInfo": {
"description": "Information about the deposit required to create a proposal. For use in messages. To validate, transform into `DepositInfo` via `into_checked()`.",
"type": "object",
"required": [
"amount",
"denom",
"refund_failed_proposals"
],
"properties": {
"amount": {
"description": "The number tokens required for payment.",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
},
"denom": {
"description": "The denom of the deposit payment.",
"allOf": [
{
"$ref": "#/definitions/UncheckedDenom"
}
]
},
"refund_failed_proposals": {
"description": "Should failed proposals have their deposits refunded?",
"type": "boolean"
}
},
"additionalProperties": false
}
}
}