From 37fca3d1c959d57926d08b6a69b2a20224af2a5f Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Fri, 31 Jan 2025 11:10:51 +0100 Subject: [PATCH] Update schemas --- .../babylon/schema/babylon-contract.json | 134 ++------- contracts/babylon/schema/raw/execute.json | 33 +-- contracts/babylon/schema/raw/instantiate.json | 62 +--- contracts/babylon/schema/raw/query.json | 2 +- .../schema/raw/response_to_transfer_info.json | 37 +-- .../btc-finality/schema/btc-finality.json | 265 ++++++++++++++++-- .../btc-finality/schema/raw/execute.json | 34 ++- .../btc-finality/schema/raw/instantiate.json | 4 - contracts/btc-finality/schema/raw/query.json | 111 ++++++++ .../raw/response_to_all_pending_rewards.json | 65 +++++ .../schema/raw/response_to_config.json | 10 +- .../schema/raw/response_to_params.json | 4 - .../raw/response_to_pending_rewards.json | 37 +++ contracts/btc-staking/schema/btc-staking.json | 265 ++++++++++++++++-- contracts/btc-staking/schema/raw/execute.json | 34 ++- .../btc-staking/schema/raw/instantiate.json | 4 - contracts/btc-staking/schema/raw/query.json | 111 ++++++++ .../raw/response_to_all_pending_rewards.json | 65 +++++ .../schema/raw/response_to_config.json | 10 +- .../schema/raw/response_to_params.json | 4 - .../raw/response_to_pending_rewards.json | 37 +++ 21 files changed, 1032 insertions(+), 296 deletions(-) create mode 100644 contracts/btc-finality/schema/raw/response_to_all_pending_rewards.json create mode 100644 contracts/btc-finality/schema/raw/response_to_pending_rewards.json create mode 100644 contracts/btc-staking/schema/raw/response_to_all_pending_rewards.json create mode 100644 contracts/btc-staking/schema/raw/response_to_pending_rewards.json diff --git a/contracts/babylon/schema/babylon-contract.json b/contracts/babylon/schema/babylon-contract.json index 9c878ae2..ceb41210 100644 --- a/contracts/babylon/schema/babylon-contract.json +++ b/contracts/babylon/schema/babylon-contract.json @@ -89,23 +89,19 @@ "null" ] }, + "ics20_channel_id": { + "description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer", + "type": [ + "string", + "null" + ] + }, "network": { "$ref": "#/definitions/Network" }, "notify_cosmos_zone": { "description": "notify_cosmos_zone indicates whether to send Cosmos zone messages notifying BTC-finalised headers. NOTE: If set to true, then the Cosmos zone needs to integrate the corresponding message handler as well", "type": "boolean" - }, - "transfer_info": { - "description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer", - "anyOf": [ - { - "$ref": "#/definitions/IbcTransferInfo" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false, @@ -114,22 +110,6 @@ "description": "Binary is a wrapper around Vec 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. See also .", "type": "string" }, - "IbcTransferInfo": { - "type": "object", - "required": [ - "channel_id", - "recipient" - ], - "properties": { - "channel_id": { - "type": "string" - }, - "recipient": { - "$ref": "#/definitions/Recipient" - } - }, - "additionalProperties": false - }, "Network": { "type": "string", "enum": [ @@ -138,34 +118,6 @@ "signet", "regtest" ] - }, - "Recipient": { - "oneOf": [ - { - "type": "object", - "required": [ - "contract_addr" - ], - "properties": { - "contract_addr": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "module_addr" - ], - "properties": { - "module_addr": { - "type": "string" - } - }, - "additionalProperties": false - } - ] } } }, @@ -221,7 +173,7 @@ "additionalProperties": false }, { - "description": "`SendRewards` is a message sent by the finality contract, to send rewards to Babylon", + "description": "`SendRewards` is a message sent by the staking contract, to send rewards to the Babylon chain", "type": "object", "required": [ "send_rewards" @@ -230,15 +182,12 @@ "send_rewards": { "type": "object", "required": [ - "fp_distribution" + "to_address" ], "properties": { - "fp_distribution": { - "description": "`fp_distribution` is the list of finality providers and their rewards", - "type": "array", - "items": { - "$ref": "#/definitions/RewardInfo" - } + "to_address": { + "description": "`to_address` is the address on the Babylon chain to send the rewards to", + "type": "string" } }, "additionalProperties": false @@ -368,26 +317,6 @@ } }, "additionalProperties": false - }, - "RewardInfo": { - "type": "object", - "required": [ - "fp_pubkey_hex", - "reward" - ], - "properties": { - "fp_pubkey_hex": { - "type": "string" - }, - "reward": { - "$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" } } }, @@ -636,7 +565,7 @@ "additionalProperties": false }, { - "description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer. If not set, distributed rewards are native to the Consumer", + "description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer.", "type": "object", "required": [ "transfer_info" @@ -1644,38 +1573,11 @@ }, "transfer_info": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Nullable_TransferInfo", - "anyOf": [ - { - "$ref": "#/definitions/TransferInfo" - }, - { - "type": "null" - } - ], - "definitions": { - "TransferInfo": { - "description": "IBC transfer (ICS-020) channel settings", - "type": "object", - "required": [ - "address_type", - "channel_id", - "to_address" - ], - "properties": { - "address_type": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "to_address": { - "type": "string" - } - }, - "additionalProperties": false - } - } + "title": "Nullable_String", + "type": [ + "string", + "null" + ] } } } diff --git a/contracts/babylon/schema/raw/execute.json b/contracts/babylon/schema/raw/execute.json index 92d8ee9f..ad797e9f 100644 --- a/contracts/babylon/schema/raw/execute.json +++ b/contracts/babylon/schema/raw/execute.json @@ -50,7 +50,7 @@ "additionalProperties": false }, { - "description": "`SendRewards` is a message sent by the finality contract, to send rewards to Babylon", + "description": "`SendRewards` is a message sent by the staking contract, to send rewards to the Babylon chain", "type": "object", "required": [ "send_rewards" @@ -59,15 +59,12 @@ "send_rewards": { "type": "object", "required": [ - "fp_distribution" + "to_address" ], "properties": { - "fp_distribution": { - "description": "`fp_distribution` is the list of finality providers and their rewards", - "type": "array", - "items": { - "$ref": "#/definitions/RewardInfo" - } + "to_address": { + "description": "`to_address` is the address on the Babylon chain to send the rewards to", + "type": "string" } }, "additionalProperties": false @@ -197,26 +194,6 @@ } }, "additionalProperties": false - }, - "RewardInfo": { - "type": "object", - "required": [ - "fp_pubkey_hex", - "reward" - ], - "properties": { - "fp_pubkey_hex": { - "type": "string" - }, - "reward": { - "$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/babylon/schema/raw/instantiate.json b/contracts/babylon/schema/raw/instantiate.json index 01cc5cdc..3717325d 100644 --- a/contracts/babylon/schema/raw/instantiate.json +++ b/contracts/babylon/schema/raw/instantiate.json @@ -85,23 +85,19 @@ "null" ] }, + "ics20_channel_id": { + "description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer", + "type": [ + "string", + "null" + ] + }, "network": { "$ref": "#/definitions/Network" }, "notify_cosmos_zone": { "description": "notify_cosmos_zone indicates whether to send Cosmos zone messages notifying BTC-finalised headers. NOTE: If set to true, then the Cosmos zone needs to integrate the corresponding message handler as well", "type": "boolean" - }, - "transfer_info": { - "description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer", - "anyOf": [ - { - "$ref": "#/definitions/IbcTransferInfo" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false, @@ -110,22 +106,6 @@ "description": "Binary is a wrapper around Vec 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. See also .", "type": "string" }, - "IbcTransferInfo": { - "type": "object", - "required": [ - "channel_id", - "recipient" - ], - "properties": { - "channel_id": { - "type": "string" - }, - "recipient": { - "$ref": "#/definitions/Recipient" - } - }, - "additionalProperties": false - }, "Network": { "type": "string", "enum": [ @@ -134,34 +114,6 @@ "signet", "regtest" ] - }, - "Recipient": { - "oneOf": [ - { - "type": "object", - "required": [ - "contract_addr" - ], - "properties": { - "contract_addr": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "module_addr" - ], - "properties": { - "module_addr": { - "type": "string" - } - }, - "additionalProperties": false - } - ] } } } diff --git a/contracts/babylon/schema/raw/query.json b/contracts/babylon/schema/raw/query.json index d58afe03..1cd30969 100644 --- a/contracts/babylon/schema/raw/query.json +++ b/contracts/babylon/schema/raw/query.json @@ -243,7 +243,7 @@ "additionalProperties": false }, { - "description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer. If not set, distributed rewards are native to the Consumer", + "description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer.", "type": "object", "required": [ "transfer_info" diff --git a/contracts/babylon/schema/raw/response_to_transfer_info.json b/contracts/babylon/schema/raw/response_to_transfer_info.json index 99ce240c..f4c601d9 100644 --- a/contracts/babylon/schema/raw/response_to_transfer_info.json +++ b/contracts/babylon/schema/raw/response_to_transfer_info.json @@ -1,35 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Nullable_TransferInfo", - "anyOf": [ - { - "$ref": "#/definitions/TransferInfo" - }, - { - "type": "null" - } - ], - "definitions": { - "TransferInfo": { - "description": "IBC transfer (ICS-020) channel settings", - "type": "object", - "required": [ - "address_type", - "channel_id", - "to_address" - ], - "properties": { - "address_type": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "to_address": { - "type": "string" - } - }, - "additionalProperties": false - } - } + "title": "Nullable_String", + "type": [ + "string", + "null" + ] } diff --git a/contracts/btc-finality/schema/btc-finality.json b/contracts/btc-finality/schema/btc-finality.json index 329695aa..13ad0a63 100644 --- a/contracts/btc-finality/schema/btc-finality.json +++ b/contracts/btc-finality/schema/btc-finality.json @@ -43,7 +43,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -75,9 +74,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" @@ -118,6 +114,28 @@ }, "additionalProperties": false }, + { + "description": "Set the BTC finality addr. Only admin or the babylon contract can set this", + "type": "object", + "required": [ + "update_finality" + ], + "properties": { + "update_finality": { + "type": "object", + "required": [ + "finality" + ], + "properties": { + "finality": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "BTC Staking operations", "type": "object", @@ -213,7 +231,7 @@ "additionalProperties": false }, { - "description": "`WithdrawRewards` is a message sent by the staker, or the Babylon contract on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\nThe optional `recipient` is the address on the Consumer side to receive the rewards. If not provided, the rewards will be sent to the sender of this message. Only the Babylon contract can set the recipient to a different address than the sender's.", + "description": "`WithdrawRewards` is a message sent by anyone on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\n`staker_addr` is both the address to claim and receive the rewards", "type": "object", "required": [ "withdraw_rewards" @@ -222,17 +240,15 @@ "withdraw_rewards": { "type": "object", "required": [ - "fp_pubkey_hex" + "fp_pubkey_hex", + "staker_addr" ], "properties": { "fp_pubkey_hex": { "type": "string" }, - "recipient": { - "type": [ - "string", - "null" - ] + "staker_addr": { + "type": "string" } }, "additionalProperties": false @@ -898,6 +914,72 @@ }, "additionalProperties": false }, + { + "description": "`PendingRewards` returns the pending rewards for a user on a finality provider. The rewards are returned in the form of a Coin", + "type": "object", + "required": [ + "pending_rewards" + ], + "properties": { + "pending_rewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "user" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "`AllPendingRewards` returns the pending rewards for a user on all finality providers.", + "type": "object", + "required": [ + "all_pending_rewards" + ], + "properties": { + "all_pending_rewards": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "anyOf": [ + { + "$ref": "#/definitions/PendingRewards" + }, + { + "type": "null" + } + ] + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "`ActivatedHeight` returns the height at which the contract gets its first delegation, if any", "type": "object", @@ -914,6 +996,22 @@ } ], "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, "FinalityProviderInfo": { "type": "object", "required": [ @@ -933,6 +1031,35 @@ } }, "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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" } } }, @@ -976,17 +1103,90 @@ }, "additionalProperties": false }, + "all_pending_rewards": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllPendingRewardsResponse", + "description": "Pending rewards on all FPs", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "type": "array", + "items": { + "$ref": "#/definitions/PendingRewards" + } + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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" + } + } + }, "config": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", "description": "Config are Babylon-selectable BTC staking configuration", "type": "object", "required": [ - "babylon" + "babylon", + "denom", + "finality" ], "properties": { "babylon": { "$ref": "#/definitions/Addr" + }, + "denom": { + "type": "string" + }, + "finality": { + "$ref": "#/definitions/Addr" } }, "additionalProperties": false, @@ -1891,7 +2091,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -1923,9 +2122,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" @@ -1947,6 +2143,43 @@ ] } } + }, + "pending_rewards": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PendingRewardsResponse", + "description": "Pending rewards on one FP", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "$ref": "#/definitions/Coin" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "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/btc-finality/schema/raw/execute.json b/contracts/btc-finality/schema/raw/execute.json index 483917f4..bf2ddb63 100644 --- a/contracts/btc-finality/schema/raw/execute.json +++ b/contracts/btc-finality/schema/raw/execute.json @@ -25,6 +25,28 @@ }, "additionalProperties": false }, + { + "description": "Set the BTC finality addr. Only admin or the babylon contract can set this", + "type": "object", + "required": [ + "update_finality" + ], + "properties": { + "update_finality": { + "type": "object", + "required": [ + "finality" + ], + "properties": { + "finality": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "BTC Staking operations", "type": "object", @@ -120,7 +142,7 @@ "additionalProperties": false }, { - "description": "`WithdrawRewards` is a message sent by the staker, or the Babylon contract on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\nThe optional `recipient` is the address on the Consumer side to receive the rewards. If not provided, the rewards will be sent to the sender of this message. Only the Babylon contract can set the recipient to a different address than the sender's.", + "description": "`WithdrawRewards` is a message sent by anyone on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\n`staker_addr` is both the address to claim and receive the rewards", "type": "object", "required": [ "withdraw_rewards" @@ -129,17 +151,15 @@ "withdraw_rewards": { "type": "object", "required": [ - "fp_pubkey_hex" + "fp_pubkey_hex", + "staker_addr" ], "properties": { "fp_pubkey_hex": { "type": "string" }, - "recipient": { - "type": [ - "string", - "null" - ] + "staker_addr": { + "type": "string" } }, "additionalProperties": false diff --git a/contracts/btc-finality/schema/raw/instantiate.json b/contracts/btc-finality/schema/raw/instantiate.json index a122c745..9cc57850 100644 --- a/contracts/btc-finality/schema/raw/instantiate.json +++ b/contracts/btc-finality/schema/raw/instantiate.json @@ -39,7 +39,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -71,9 +70,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" diff --git a/contracts/btc-finality/schema/raw/query.json b/contracts/btc-finality/schema/raw/query.json index 891e0773..edca62b6 100644 --- a/contracts/btc-finality/schema/raw/query.json +++ b/contracts/btc-finality/schema/raw/query.json @@ -240,6 +240,72 @@ }, "additionalProperties": false }, + { + "description": "`PendingRewards` returns the pending rewards for a user on a finality provider. The rewards are returned in the form of a Coin", + "type": "object", + "required": [ + "pending_rewards" + ], + "properties": { + "pending_rewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "user" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "`AllPendingRewards` returns the pending rewards for a user on all finality providers.", + "type": "object", + "required": [ + "all_pending_rewards" + ], + "properties": { + "all_pending_rewards": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "anyOf": [ + { + "$ref": "#/definitions/PendingRewards" + }, + { + "type": "null" + } + ] + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "`ActivatedHeight` returns the height at which the contract gets its first delegation, if any", "type": "object", @@ -256,6 +322,22 @@ } ], "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, "FinalityProviderInfo": { "type": "object", "required": [ @@ -275,6 +357,35 @@ } }, "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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/btc-finality/schema/raw/response_to_all_pending_rewards.json b/contracts/btc-finality/schema/raw/response_to_all_pending_rewards.json new file mode 100644 index 00000000..9ee85e4c --- /dev/null +++ b/contracts/btc-finality/schema/raw/response_to_all_pending_rewards.json @@ -0,0 +1,65 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllPendingRewardsResponse", + "description": "Pending rewards on all FPs", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "type": "array", + "items": { + "$ref": "#/definitions/PendingRewards" + } + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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/btc-finality/schema/raw/response_to_config.json b/contracts/btc-finality/schema/raw/response_to_config.json index 6b405689..4e753bbf 100644 --- a/contracts/btc-finality/schema/raw/response_to_config.json +++ b/contracts/btc-finality/schema/raw/response_to_config.json @@ -4,11 +4,19 @@ "description": "Config are Babylon-selectable BTC staking configuration", "type": "object", "required": [ - "babylon" + "babylon", + "denom", + "finality" ], "properties": { "babylon": { "$ref": "#/definitions/Addr" + }, + "denom": { + "type": "string" + }, + "finality": { + "$ref": "#/definitions/Addr" } }, "additionalProperties": false, diff --git a/contracts/btc-finality/schema/raw/response_to_params.json b/contracts/btc-finality/schema/raw/response_to_params.json index d8a07f62..7819400c 100644 --- a/contracts/btc-finality/schema/raw/response_to_params.json +++ b/contracts/btc-finality/schema/raw/response_to_params.json @@ -8,7 +8,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -40,9 +39,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" diff --git a/contracts/btc-finality/schema/raw/response_to_pending_rewards.json b/contracts/btc-finality/schema/raw/response_to_pending_rewards.json new file mode 100644 index 00000000..631e810f --- /dev/null +++ b/contracts/btc-finality/schema/raw/response_to_pending_rewards.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PendingRewardsResponse", + "description": "Pending rewards on one FP", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "$ref": "#/definitions/Coin" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "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/btc-staking/schema/btc-staking.json b/contracts/btc-staking/schema/btc-staking.json index 683a27b7..297f8bc0 100644 --- a/contracts/btc-staking/schema/btc-staking.json +++ b/contracts/btc-staking/schema/btc-staking.json @@ -43,7 +43,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -75,9 +74,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" @@ -118,6 +114,28 @@ }, "additionalProperties": false }, + { + "description": "Set the BTC finality addr. Only admin or the babylon contract can set this", + "type": "object", + "required": [ + "update_finality" + ], + "properties": { + "update_finality": { + "type": "object", + "required": [ + "finality" + ], + "properties": { + "finality": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "BTC Staking operations", "type": "object", @@ -213,7 +231,7 @@ "additionalProperties": false }, { - "description": "`WithdrawRewards` is a message sent by the staker, or the Babylon contract on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\nThe optional `recipient` is the address on the Consumer side to receive the rewards. If not provided, the rewards will be sent to the sender of this message. Only the Babylon contract can set the recipient to a different address than the sender's.", + "description": "`WithdrawRewards` is a message sent by anyone on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\n`staker_addr` is both the address to claim and receive the rewards", "type": "object", "required": [ "withdraw_rewards" @@ -222,17 +240,15 @@ "withdraw_rewards": { "type": "object", "required": [ - "fp_pubkey_hex" + "fp_pubkey_hex", + "staker_addr" ], "properties": { "fp_pubkey_hex": { "type": "string" }, - "recipient": { - "type": [ - "string", - "null" - ] + "staker_addr": { + "type": "string" } }, "additionalProperties": false @@ -898,6 +914,72 @@ }, "additionalProperties": false }, + { + "description": "`PendingRewards` returns the pending rewards for a user on a finality provider. The rewards are returned in the form of a Coin", + "type": "object", + "required": [ + "pending_rewards" + ], + "properties": { + "pending_rewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "user" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "`AllPendingRewards` returns the pending rewards for a user on all finality providers.", + "type": "object", + "required": [ + "all_pending_rewards" + ], + "properties": { + "all_pending_rewards": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "anyOf": [ + { + "$ref": "#/definitions/PendingRewards" + }, + { + "type": "null" + } + ] + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "`ActivatedHeight` returns the height at which the contract gets its first delegation, if any", "type": "object", @@ -914,6 +996,22 @@ } ], "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, "FinalityProviderInfo": { "type": "object", "required": [ @@ -933,6 +1031,35 @@ } }, "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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" } } }, @@ -976,17 +1103,90 @@ }, "additionalProperties": false }, + "all_pending_rewards": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllPendingRewardsResponse", + "description": "Pending rewards on all FPs", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "type": "array", + "items": { + "$ref": "#/definitions/PendingRewards" + } + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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" + } + } + }, "config": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", "description": "Config are Babylon-selectable BTC staking configuration", "type": "object", "required": [ - "babylon" + "babylon", + "denom", + "finality" ], "properties": { "babylon": { "$ref": "#/definitions/Addr" + }, + "denom": { + "type": "string" + }, + "finality": { + "$ref": "#/definitions/Addr" } }, "additionalProperties": false, @@ -1891,7 +2091,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -1923,9 +2122,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" @@ -1947,6 +2143,43 @@ ] } } + }, + "pending_rewards": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PendingRewardsResponse", + "description": "Pending rewards on one FP", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "$ref": "#/definitions/Coin" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "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/btc-staking/schema/raw/execute.json b/contracts/btc-staking/schema/raw/execute.json index 483917f4..bf2ddb63 100644 --- a/contracts/btc-staking/schema/raw/execute.json +++ b/contracts/btc-staking/schema/raw/execute.json @@ -25,6 +25,28 @@ }, "additionalProperties": false }, + { + "description": "Set the BTC finality addr. Only admin or the babylon contract can set this", + "type": "object", + "required": [ + "update_finality" + ], + "properties": { + "update_finality": { + "type": "object", + "required": [ + "finality" + ], + "properties": { + "finality": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "BTC Staking operations", "type": "object", @@ -120,7 +142,7 @@ "additionalProperties": false }, { - "description": "`WithdrawRewards` is a message sent by the staker, or the Babylon contract on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\nThe optional `recipient` is the address on the Consumer side to receive the rewards. If not provided, the rewards will be sent to the sender of this message. Only the Babylon contract can set the recipient to a different address than the sender's.", + "description": "`WithdrawRewards` is a message sent by anyone on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\n`staker_addr` is both the address to claim and receive the rewards", "type": "object", "required": [ "withdraw_rewards" @@ -129,17 +151,15 @@ "withdraw_rewards": { "type": "object", "required": [ - "fp_pubkey_hex" + "fp_pubkey_hex", + "staker_addr" ], "properties": { "fp_pubkey_hex": { "type": "string" }, - "recipient": { - "type": [ - "string", - "null" - ] + "staker_addr": { + "type": "string" } }, "additionalProperties": false diff --git a/contracts/btc-staking/schema/raw/instantiate.json b/contracts/btc-staking/schema/raw/instantiate.json index a122c745..9cc57850 100644 --- a/contracts/btc-staking/schema/raw/instantiate.json +++ b/contracts/btc-staking/schema/raw/instantiate.json @@ -39,7 +39,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -71,9 +70,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" diff --git a/contracts/btc-staking/schema/raw/query.json b/contracts/btc-staking/schema/raw/query.json index 891e0773..edca62b6 100644 --- a/contracts/btc-staking/schema/raw/query.json +++ b/contracts/btc-staking/schema/raw/query.json @@ -240,6 +240,72 @@ }, "additionalProperties": false }, + { + "description": "`PendingRewards` returns the pending rewards for a user on a finality provider. The rewards are returned in the form of a Coin", + "type": "object", + "required": [ + "pending_rewards" + ], + "properties": { + "pending_rewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "user" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "`AllPendingRewards` returns the pending rewards for a user on all finality providers.", + "type": "object", + "required": [ + "all_pending_rewards" + ], + "properties": { + "all_pending_rewards": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "anyOf": [ + { + "$ref": "#/definitions/PendingRewards" + }, + { + "type": "null" + } + ] + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "`ActivatedHeight` returns the height at which the contract gets its first delegation, if any", "type": "object", @@ -256,6 +322,22 @@ } ], "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, "FinalityProviderInfo": { "type": "object", "required": [ @@ -275,6 +357,35 @@ } }, "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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/btc-staking/schema/raw/response_to_all_pending_rewards.json b/contracts/btc-staking/schema/raw/response_to_all_pending_rewards.json new file mode 100644 index 00000000..9ee85e4c --- /dev/null +++ b/contracts/btc-staking/schema/raw/response_to_all_pending_rewards.json @@ -0,0 +1,65 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllPendingRewardsResponse", + "description": "Pending rewards on all FPs", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "type": "array", + "items": { + "$ref": "#/definitions/PendingRewards" + } + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PendingRewards": { + "type": "object", + "required": [ + "fp_pubkey_hex", + "rewards", + "staking_tx_hash" + ], + "properties": { + "fp_pubkey_hex": { + "type": "string" + }, + "rewards": { + "$ref": "#/definitions/Coin" + }, + "staking_tx_hash": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + }, + "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/btc-staking/schema/raw/response_to_config.json b/contracts/btc-staking/schema/raw/response_to_config.json index 6b405689..4e753bbf 100644 --- a/contracts/btc-staking/schema/raw/response_to_config.json +++ b/contracts/btc-staking/schema/raw/response_to_config.json @@ -4,11 +4,19 @@ "description": "Config are Babylon-selectable BTC staking configuration", "type": "object", "required": [ - "babylon" + "babylon", + "denom", + "finality" ], "properties": { "babylon": { "$ref": "#/definitions/Addr" + }, + "denom": { + "type": "string" + }, + "finality": { + "$ref": "#/definitions/Addr" } }, "additionalProperties": false, diff --git a/contracts/btc-staking/schema/raw/response_to_params.json b/contracts/btc-staking/schema/raw/response_to_params.json index d8a07f62..7819400c 100644 --- a/contracts/btc-staking/schema/raw/response_to_params.json +++ b/contracts/btc-staking/schema/raw/response_to_params.json @@ -8,7 +8,6 @@ "covenant_pks", "covenant_quorum", "min_slashing_tx_fee_sat", - "rewards_denom", "slashing_pk_script", "slashing_rate" ], @@ -40,9 +39,6 @@ "format": "uint64", "minimum": 0.0 }, - "rewards_denom": { - "type": "string" - }, "slashing_pk_script": { "description": "`slashing_pk_script` is the pk script that the slashed BTC goes to. The pk script is in string format on Bitcoin.", "type": "string" diff --git a/contracts/btc-staking/schema/raw/response_to_pending_rewards.json b/contracts/btc-staking/schema/raw/response_to_pending_rewards.json new file mode 100644 index 00000000..631e810f --- /dev/null +++ b/contracts/btc-staking/schema/raw/response_to_pending_rewards.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PendingRewardsResponse", + "description": "Pending rewards on one FP", + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "$ref": "#/definitions/Coin" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + }, + "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" + } + } +}