Skip to content

Commit

Permalink
chore: change whitelist api
Browse files Browse the repository at this point in the history
  • Loading branch information
kerber0x committed Jun 14, 2024
1 parent e185d63 commit 0b7a416
Show file tree
Hide file tree
Showing 11 changed files with 790 additions and 221 deletions.
424 changes: 333 additions & 91 deletions contracts/alliance-hub/schema/alliance-hub.json

Large diffs are not rendered by default.

94 changes: 6 additions & 88 deletions contracts/alliance-hub/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
"$ref": "#/definitions/AssetInfoWithConfig"
}
}
}
Expand Down Expand Up @@ -398,22 +398,6 @@
},
"additionalProperties": false
},
"AssetConfig": {
"type": "object",
"required": [
"stake_config",
"yearly_take_rate"
],
"properties": {
"stake_config": {
"$ref": "#/definitions/StakeConfig"
},
"yearly_take_rate": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
},
"AssetDistribution": {
"type": "object",
"required": [
Expand Down Expand Up @@ -465,18 +449,18 @@
"info"
],
"properties": {
"config": {
"info": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
},
"yearly_take_rate": {
"anyOf": [
{
"$ref": "#/definitions/AssetConfig"
"$ref": "#/definitions/Decimal"
},
{
"type": "null"
}
]
},
"info": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -510,72 +494,6 @@
"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"
},
"StakeConfig": {
"oneOf": [
{
"type": "string",
"enum": [
"default"
]
},
{
"type": "object",
"required": [
"astroport"
],
"properties": {
"astroport": {
"type": "object",
"required": [
"contract",
"reward_infos"
],
"properties": {
"contract": {
"$ref": "#/definitions/Addr"
},
"reward_infos": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"ve3"
],
"properties": {
"ve3": {
"type": "object",
"required": [
"contract",
"reward_infos"
],
"properties": {
"contract": {
"$ref": "#/definitions/Addr"
},
"reward_infos": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
}
},
"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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@
"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"
},
"AssetConfigRuntime": {
"type": "object",
"required": [
"harvested",
"last_taken_s",
"stake_config",
"taken",
"yearly_take_rate"
],
"properties": {
"harvested": {
"$ref": "#/definitions/Uint128"
},
"last_taken_s": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"stake_config": {
"$ref": "#/definitions/StakeConfig"
},
"taken": {
"$ref": "#/definitions/Uint128"
},
"yearly_take_rate": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
},
"AssetInfoBase_for_Addr": {
"description": "Represents the type of an fungible asset.\n\nEach **asset info** instance can be one of three variants:\n\n- Native SDK coins. To create an **asset info** instance of this type, provide the denomination. - CW20 tokens. To create an **asset info** instance of this type, provide the contract address.",
"oneOf": [
Expand Down Expand Up @@ -39,18 +69,96 @@
}
]
},
"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"
},
"StakeConfig": {
"oneOf": [
{
"type": "string",
"enum": [
"default"
]
},
{
"type": "object",
"required": [
"astroport"
],
"properties": {
"astroport": {
"type": "object",
"required": [
"contract",
"reward_infos"
],
"properties": {
"contract": {
"$ref": "#/definitions/Addr"
},
"reward_infos": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"ve3"
],
"properties": {
"ve3": {
"type": "object",
"required": [
"contract",
"reward_infos"
],
"properties": {
"contract": {
"$ref": "#/definitions/Addr"
},
"reward_infos": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"StakedBalanceRes": {
"type": "object",
"required": [
"asset",
"balance"
"balance",
"config",
"shares"
],
"properties": {
"asset": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
},
"balance": {
"$ref": "#/definitions/Uint128"
},
"config": {
"$ref": "#/definitions/AssetConfigRuntime"
},
"shares": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false
Expand Down
Loading

0 comments on commit 0b7a416

Please sign in to comment.