Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bf9ae009ee | |||
| 8bf3efcef7 |
@@ -21,9 +21,10 @@ time = { version = "0.3.6", features = ["parsing", "formatting"] }
|
|||||||
|
|
||||||
contracts-common = { path = "../contracts-common" }
|
contracts-common = { path = "../contracts-common" }
|
||||||
|
|
||||||
|
ts-rs = { version = "6.1.2", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
time = { version = "0.3.5", features = ["serde", "macros"] }
|
time = { version = "0.3.5", features = ["serde", "macros"] }
|
||||||
ts-rs = "6.1.2"
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ use serde::{Deserialize, Serialize};
|
|||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
||||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
test,
|
all(feature = "ts-rs", test),
|
||||||
ts(export, export_to = "../../../nym-wallet/src/types/rust/gateway.ts")
|
ts(export, export_to = "../../../nym-wallet/src/types/rust/gateway.ts")
|
||||||
)]
|
)]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd, Serialize, JsonSchema)]
|
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd, Serialize, JsonSchema)]
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ use serde_repr::{Deserialize_repr, Serialize_repr};
|
|||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
||||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
test,
|
all(feature = "ts-rs", test),
|
||||||
ts(
|
ts(
|
||||||
export,
|
export,
|
||||||
export_to = "../../../nym-wallet/src/types/rust/rewardedsetnodestatus.ts"
|
export_to = "../../../nym-wallet/src/types/rust/rewardedsetnodestatus.ts"
|
||||||
@@ -109,9 +109,9 @@ impl PendingUndelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
test,
|
all(feature = "ts-rs", test),
|
||||||
ts(export, export_to = "../../../nym-wallet/src/types/rust/mixnode.ts")
|
ts(export, export_to = "../../../nym-wallet/src/types/rust/mixnode.ts")
|
||||||
)]
|
)]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd, Serialize, JsonSchema)]
|
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd, Serialize, JsonSchema)]
|
||||||
|
|||||||
@@ -96,10 +96,25 @@ impl NodeEpochRewards {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, JsonSchema, PartialEq, Serialize, Deserialize, Copy)]
|
#[derive(Debug, Clone, JsonSchema, PartialEq, Serialize, Deserialize, Copy)]
|
||||||
|
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
|
||||||
|
#[cfg_attr(
|
||||||
|
all(feature = "ts-rs", test),
|
||||||
|
ts(
|
||||||
|
export,
|
||||||
|
export_to = "../../../nym-wallet/src/types/rust/epochrewardparams.ts"
|
||||||
|
)
|
||||||
|
)]
|
||||||
pub struct EpochRewardParams {
|
pub struct EpochRewardParams {
|
||||||
|
#[cfg_attr(feature = "ts-rs", ts(type = "string"))]
|
||||||
epoch_reward_pool: Uint128,
|
epoch_reward_pool: Uint128,
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "ts-rs", ts(type = "string"))]
|
||||||
rewarded_set_size: Uint128,
|
rewarded_set_size: Uint128,
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "ts-rs", ts(type = "string"))]
|
||||||
active_set_size: Uint128,
|
active_set_size: Uint128,
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "ts-rs", ts(type = "string"))]
|
||||||
circulating_supply: Uint128,
|
circulating_supply: Uint128,
|
||||||
sybil_resistance_percent: u8,
|
sybil_resistance_percent: u8,
|
||||||
active_set_work_factor: u8,
|
active_set_work_factor: u8,
|
||||||
@@ -157,8 +172,17 @@ impl EpochRewardParams {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, JsonSchema, PartialEq, Serialize, Deserialize, Copy)]
|
#[derive(Debug, Clone, JsonSchema, PartialEq, Serialize, Deserialize, Copy)]
|
||||||
|
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
|
||||||
|
#[cfg_attr(
|
||||||
|
all(feature = "ts-rs", test),
|
||||||
|
ts(
|
||||||
|
export,
|
||||||
|
export_to = "../../../nym-wallet/src/types/rust/noderewardparams.ts"
|
||||||
|
)
|
||||||
|
)]
|
||||||
pub struct NodeRewardParams {
|
pub struct NodeRewardParams {
|
||||||
reward_blockstamp: u64,
|
reward_blockstamp: u64,
|
||||||
|
#[cfg_attr(feature = "ts-rs", ts(type = "string"))]
|
||||||
uptime: Uint128,
|
uptime: Uint128,
|
||||||
in_active_set: bool,
|
in_active_set: bool,
|
||||||
}
|
}
|
||||||
@@ -186,6 +210,14 @@ impl NodeRewardParams {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, JsonSchema, PartialEq, Serialize, Deserialize, Copy)]
|
#[derive(Debug, Clone, JsonSchema, PartialEq, Serialize, Deserialize, Copy)]
|
||||||
|
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
|
||||||
|
#[cfg_attr(
|
||||||
|
all(feature = "ts-rs", test),
|
||||||
|
ts(
|
||||||
|
export,
|
||||||
|
export_to = "../../../nym-wallet/src/types/rust/rewardparams.ts"
|
||||||
|
)
|
||||||
|
)]
|
||||||
pub struct RewardParams {
|
pub struct RewardParams {
|
||||||
pub epoch: EpochRewardParams,
|
pub epoch: EpochRewardParams,
|
||||||
pub node: NodeRewardParams,
|
pub node: NodeRewardParams,
|
||||||
|
|||||||
Generated
+1
@@ -5387,6 +5387,7 @@ dependencies = [
|
|||||||
name = "validator-api-requests"
|
name = "validator-api-requests"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"mixnet-contract-common",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
export interface CoreNodeStatusResponse {
|
|
||||||
identity: string;
|
export interface CoreNodeStatusResponse { identity: string, count: number, }
|
||||||
count: number;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
export interface EpochRewardParams { epoch_reward_pool: string, rewarded_set_size: string, active_set_size: string, circulating_supply: string, sybil_resistance_percent: number, active_set_work_factor: number, }
|
||||||
@@ -1,9 +1,2 @@
|
|||||||
export interface Gateway {
|
|
||||||
host: string;
|
export interface Gateway { host: string, mix_port: number, clients_port: number, location: string, sphinx_key: string, identity_key: string, version: string, }
|
||||||
mix_port: number;
|
|
||||||
clients_port: number;
|
|
||||||
location: string;
|
|
||||||
sphinx_key: string;
|
|
||||||
identity_key: string;
|
|
||||||
version: string;
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,2 @@
|
|||||||
export interface InclusionProbabilityResponse {
|
|
||||||
in_active: number;
|
export interface InclusionProbabilityResponse { in_active: number, in_reserve: number, }
|
||||||
in_reserve: number;
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,2 @@
|
|||||||
export interface MixNode {
|
|
||||||
host: string;
|
export interface MixNode { host: string, mix_port: number, verloc_port: number, http_api_port: number, sphinx_key: string, identity_key: string, version: string, profit_margin_percent: number, }
|
||||||
mix_port: number;
|
|
||||||
verloc_port: number;
|
|
||||||
http_api_port: number;
|
|
||||||
sphinx_key: string;
|
|
||||||
identity_key: string;
|
|
||||||
version: string;
|
|
||||||
profit_margin_percent: number;
|
|
||||||
}
|
|
||||||
@@ -1 +1,2 @@
|
|||||||
export type MixnodeStatus = 'active' | 'standby' | 'inactive' | 'not_found';
|
|
||||||
|
export type MixnodeStatus = "active" | "standby" | "inactive" | "not_found";
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { MixnodeStatus } from './mixnodestatus';
|
import type { MixnodeStatus } from "./mixnodestatus";
|
||||||
|
|
||||||
export interface MixnodeStatusResponse {
|
export interface MixnodeStatusResponse { status: MixnodeStatus, }
|
||||||
status: MixnodeStatus;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
export interface NodeRewardParams { reward_blockstamp: bigint, uptime: string, in_active_set: boolean, }
|
||||||
@@ -1 +1,2 @@
|
|||||||
export type RewardedSetNodeStatus = 'Active' | 'Standby';
|
|
||||||
|
export type RewardedSetNodeStatus = "Active" | "Standby";
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
export interface RewardEstimationResponse { estimated_total_node_reward: bigint, estimated_operator_reward: bigint, estimated_delegators_reward: bigint, as_at: bigint, }
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import type { EpochRewardParams } from "./epochrewardparams";
|
||||||
|
import type { NodeRewardParams } from "./noderewardparams";
|
||||||
|
|
||||||
|
export interface RewardParams { epoch: EpochRewardParams, node: NodeRewardParams, }
|
||||||
@@ -1,4 +1,2 @@
|
|||||||
export interface StakeSaturationResponse {
|
|
||||||
saturation: number;
|
export interface StakeSaturationResponse { saturation: number, as_at: bigint, }
|
||||||
as_at: bigint;
|
|
||||||
}
|
|
||||||
@@ -11,3 +11,4 @@ mixnet-contract-common = { path= ".../../../../common/cosmwasm-smart-contracts/m
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ts-rs = "6.1.2"
|
ts-rs = "6.1.2"
|
||||||
|
mixnet-contract-common = { path= ".../../../../common/cosmwasm-smart-contracts/mixnet-contract", features = ["ts-rs"] }
|
||||||
@@ -53,6 +53,14 @@ pub struct MixnodeStatusResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||||
|
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||||
|
#[cfg_attr(
|
||||||
|
test,
|
||||||
|
ts(
|
||||||
|
export,
|
||||||
|
export_to = "../../nym-wallet/src/types/rust/rewardestimationresponse.ts"
|
||||||
|
)
|
||||||
|
)]
|
||||||
pub struct RewardEstimationResponse {
|
pub struct RewardEstimationResponse {
|
||||||
pub estimated_total_node_reward: u64,
|
pub estimated_total_node_reward: u64,
|
||||||
pub estimated_operator_reward: u64,
|
pub estimated_operator_reward: u64,
|
||||||
|
|||||||
Reference in New Issue
Block a user