From 66979df10c421f28c7b74da0b299e1fcaee3cc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Thu, 18 Jul 2024 14:39:55 +0100 Subject: [PATCH] update contract schema --- .../mixnet/schema/nym-mixnet-contract.json | 250 ++++++++++++++++++ contracts/mixnet/schema/raw/execute.json | 56 ++++ contracts/mixnet/schema/raw/instantiate.json | 58 ++++ .../schema/raw/response_to_get_state.json | 68 +++++ .../raw/response_to_get_state_params.json | 68 +++++ 5 files changed, 500 insertions(+) diff --git a/contracts/mixnet/schema/nym-mixnet-contract.json b/contracts/mixnet/schema/nym-mixnet-contract.json index 7ab9829107..dc3e521bd2 100644 --- a/contracts/mixnet/schema/nym-mixnet-contract.json +++ b/contracts/mixnet/schema/nym-mixnet-contract.json @@ -26,6 +26,28 @@ "initial_rewarding_params": { "$ref": "#/definitions/InitialRewardingParams" }, + "interval_operating_cost": { + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, + "profit_margin": { + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] + }, "rewarding_denom": { "type": "string" }, @@ -112,6 +134,42 @@ "$ref": "#/definitions/Decimal" } ] + }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" + } + }, + "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" } } }, @@ -1208,6 +1266,18 @@ "minimum_mixnode_pledge" ], "properties": { + "interval_operating_cost": { + "description": "Defines the allowed interval operating cost range of operators. default: 0 - 1'000'000'000'000'000 (1 Billion native tokens - the total supply)", + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, "minimum_gateway_pledge": { "description": "Minimum amount a gateway must pledge to get into the system.", "allOf": [ @@ -1234,6 +1304,18 @@ "$ref": "#/definitions/Coin" } ] + }, + "profit_margin": { + "description": "Defines the allowed profit margin range of operators. default: 0% - 100%", + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] } }, "additionalProperties": false @@ -1568,6 +1650,38 @@ } ] }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" + } + }, + "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" @@ -8099,6 +8213,18 @@ "minimum_mixnode_pledge" ], "properties": { + "interval_operating_cost": { + "description": "Defines the allowed interval operating cost range of operators. default: 0 - 1'000'000'000'000'000 (1 Billion native tokens - the total supply)", + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, "minimum_gateway_pledge": { "description": "Minimum amount a gateway must pledge to get into the system.", "allOf": [ @@ -8125,6 +8251,62 @@ "$ref": "#/definitions/Coin" } ] + }, + "profit_margin": { + "description": "Defines the allowed profit margin range of operators. default: 0% - 100%", + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] + } + }, + "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" + }, + "Percent": { + "description": "Percent represents a value between 0 and 100% (i.e. between 0.0 and 1.0)", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" } }, "additionalProperties": false @@ -8145,6 +8327,18 @@ "minimum_mixnode_pledge" ], "properties": { + "interval_operating_cost": { + "description": "Defines the allowed interval operating cost range of operators. default: 0 - 1'000'000'000'000'000 (1 Billion native tokens - the total supply)", + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, "minimum_gateway_pledge": { "description": "Minimum amount a gateway must pledge to get into the system.", "allOf": [ @@ -8171,6 +8365,18 @@ "$ref": "#/definitions/Coin" } ] + }, + "profit_margin": { + "description": "Defines the allowed profit margin range of operators. default: 0% - 100%", + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] } }, "additionalProperties": false, @@ -8190,6 +8396,50 @@ } } }, + "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" + }, + "Percent": { + "description": "Percent represents a value between 0 and 100% (i.e. between 0.0 and 1.0)", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" + } + }, + "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" diff --git a/contracts/mixnet/schema/raw/execute.json b/contracts/mixnet/schema/raw/execute.json index 8174fd3d1d..688b57db0b 100644 --- a/contracts/mixnet/schema/raw/execute.json +++ b/contracts/mixnet/schema/raw/execute.json @@ -1091,6 +1091,18 @@ "minimum_mixnode_pledge" ], "properties": { + "interval_operating_cost": { + "description": "Defines the allowed interval operating cost range of operators. default: 0 - 1'000'000'000'000'000 (1 Billion native tokens - the total supply)", + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, "minimum_gateway_pledge": { "description": "Minimum amount a gateway must pledge to get into the system.", "allOf": [ @@ -1117,6 +1129,18 @@ "$ref": "#/definitions/Coin" } ] + }, + "profit_margin": { + "description": "Defines the allowed profit margin range of operators. default: 0% - 100%", + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] } }, "additionalProperties": false @@ -1451,6 +1475,38 @@ } ] }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" + } + }, + "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" diff --git a/contracts/mixnet/schema/raw/instantiate.json b/contracts/mixnet/schema/raw/instantiate.json index 60cf202f08..e025d9f11f 100644 --- a/contracts/mixnet/schema/raw/instantiate.json +++ b/contracts/mixnet/schema/raw/instantiate.json @@ -22,6 +22,28 @@ "initial_rewarding_params": { "$ref": "#/definitions/InitialRewardingParams" }, + "interval_operating_cost": { + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, + "profit_margin": { + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] + }, "rewarding_denom": { "type": "string" }, @@ -108,6 +130,42 @@ "$ref": "#/definitions/Decimal" } ] + }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" + } + }, + "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" } } } diff --git a/contracts/mixnet/schema/raw/response_to_get_state.json b/contracts/mixnet/schema/raw/response_to_get_state.json index 0888e30787..d8c9dc5383 100644 --- a/contracts/mixnet/schema/raw/response_to_get_state.json +++ b/contracts/mixnet/schema/raw/response_to_get_state.json @@ -77,6 +77,18 @@ "minimum_mixnode_pledge" ], "properties": { + "interval_operating_cost": { + "description": "Defines the allowed interval operating cost range of operators. default: 0 - 1'000'000'000'000'000 (1 Billion native tokens - the total supply)", + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, "minimum_gateway_pledge": { "description": "Minimum amount a gateway must pledge to get into the system.", "allOf": [ @@ -103,6 +115,62 @@ "$ref": "#/definitions/Coin" } ] + }, + "profit_margin": { + "description": "Defines the allowed profit margin range of operators. default: 0% - 100%", + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] + } + }, + "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" + }, + "Percent": { + "description": "Percent represents a value between 0 and 100% (i.e. between 0.0 and 1.0)", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" } }, "additionalProperties": false diff --git a/contracts/mixnet/schema/raw/response_to_get_state_params.json b/contracts/mixnet/schema/raw/response_to_get_state_params.json index 6e05de3035..52d0191167 100644 --- a/contracts/mixnet/schema/raw/response_to_get_state_params.json +++ b/contracts/mixnet/schema/raw/response_to_get_state_params.json @@ -8,6 +8,18 @@ "minimum_mixnode_pledge" ], "properties": { + "interval_operating_cost": { + "description": "Defines the allowed interval operating cost range of operators. default: 0 - 1'000'000'000'000'000 (1 Billion native tokens - the total supply)", + "default": { + "maximum": "1000000000000000", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Uint128" + } + ] + }, "minimum_gateway_pledge": { "description": "Minimum amount a gateway must pledge to get into the system.", "allOf": [ @@ -34,6 +46,18 @@ "$ref": "#/definitions/Coin" } ] + }, + "profit_margin": { + "description": "Defines the allowed profit margin range of operators. default: 0% - 100%", + "default": { + "maximum": "1", + "minimum": "0" + }, + "allOf": [ + { + "$ref": "#/definitions/RangedValue_for_Percent" + } + ] } }, "additionalProperties": false, @@ -53,6 +77,50 @@ } } }, + "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" + }, + "Percent": { + "description": "Percent represents a value between 0 and 100% (i.e. between 0.0 and 1.0)", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "RangedValue_for_Percent": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Percent" + }, + "minimum": { + "$ref": "#/definitions/Percent" + } + }, + "additionalProperties": false + }, + "RangedValue_for_Uint128": { + "type": "object", + "required": [ + "maximum", + "minimum" + ], + "properties": { + "maximum": { + "$ref": "#/definitions/Uint128" + }, + "minimum": { + "$ref": "#/definitions/Uint128" + } + }, + "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"