Skip to content

Commit

Permalink
Update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed Feb 4, 2025
1 parent 02880cd commit 4fdae0e
Show file tree
Hide file tree
Showing 16 changed files with 996 additions and 64 deletions.
265 changes: 249 additions & 16 deletions contracts/btc-finality/schema/btc-finality.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"covenant_pks",
"covenant_quorum",
"min_slashing_tx_fee_sat",
"rewards_denom",
"slashing_pk_script",
"slashing_rate"
],
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 the Babylon contract on behalf of the staker, to withdraw rewards from BTC staking via the given FP.\n\n`staker_addr` is the address to claim the rewards.",
"type": "object",
"required": [
"withdraw_rewards"
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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": [
Expand All @@ -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"
}
}
},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1891,7 +2091,6 @@
"covenant_pks",
"covenant_quorum",
"min_slashing_tx_fee_sat",
"rewards_denom",
"slashing_pk_script",
"slashing_rate"
],
Expand Down Expand Up @@ -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"
Expand All @@ -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"
}
}
}
}
}
Loading

0 comments on commit 4fdae0e

Please sign in to comment.