diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/src/gateway.rs b/common/cosmwasm-smart-contracts/mixnet-contract/src/gateway.rs index f819bedb50..ed0ee864e8 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/src/gateway.rs +++ b/common/cosmwasm-smart-contracts/mixnet-contract/src/gateway.rs @@ -135,7 +135,10 @@ impl Display for GatewayBond { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/GatewayConfigUpdate.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/GatewayConfigUpdate.ts" + ) )] #[cw_serde] pub struct GatewayConfigUpdate { diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/src/interval.rs b/common/cosmwasm-smart-contracts/mixnet-contract/src/interval.rs index 067a3aa50e..2a1c885f1c 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/src/interval.rs +++ b/common/cosmwasm-smart-contracts/mixnet-contract/src/interval.rs @@ -215,7 +215,7 @@ impl Display for EpochState { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Interval.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Interval.ts") )] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize)] #[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))] diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/src/mixnode.rs b/common/cosmwasm-smart-contracts/mixnet-contract/src/mixnode.rs index 779df2e125..43a33c5d3e 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/src/mixnode.rs +++ b/common/cosmwasm-smart-contracts/mixnet-contract/src/mixnode.rs @@ -541,7 +541,7 @@ impl MixNodeBond { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Mixnode.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Mixnode.ts") )] pub struct MixNode { /// Network address of this mixnode, for example 1.1.1.1 or foo.mixnode.com @@ -642,7 +642,10 @@ impl From for u8 { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PendingMixnodeChanges.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingMixnodeChanges.ts" + ) )] #[cw_serde] #[derive(Default, Copy)] @@ -665,7 +668,10 @@ impl PendingMixNodeChanges { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/UnbondedMixnode.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/UnbondedMixnode.ts" + ) )] #[cw_serde] pub struct UnbondedMixnode { @@ -689,7 +695,10 @@ pub struct UnbondedMixnode { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts" + ) )] #[cw_serde] pub struct MixNodeConfigUpdate { diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/src/nym_node.rs b/common/cosmwasm-smart-contracts/mixnet-contract/src/nym_node.rs index 9453375dd3..6885b8998e 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/src/nym_node.rs +++ b/common/cosmwasm-smart-contracts/mixnet-contract/src/nym_node.rs @@ -15,7 +15,7 @@ use std::fmt::{Display, Formatter}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Role.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Role.ts") )] pub enum Role { #[serde(rename = "eg", alias = "entry", alias = "entry_gateway")] @@ -343,7 +343,7 @@ impl NymNodeBond { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NymNode.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/NymNode.ts") )] pub struct NymNode { /// Network address of this nym-node, for example 1.1.1.1 or foo.mixnode.com @@ -405,7 +405,10 @@ impl From for NymNode { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NodeConfigUpdate.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeConfigUpdate.ts" + ) )] #[cw_serde] #[derive(Default)] @@ -424,7 +427,10 @@ pub struct NodeConfigUpdate { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PendingNodeChanges.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingNodeChanges.ts" + ) )] pub struct PendingNodeChanges { pub pledge_change: Option, diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/src/reward_params.rs b/common/cosmwasm-smart-contracts/mixnet-contract/src/reward_params.rs index 03cd89bd04..40e34b2888 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/src/reward_params.rs +++ b/common/cosmwasm-smart-contracts/mixnet-contract/src/reward_params.rs @@ -14,7 +14,10 @@ pub type WorkFactor = Decimal; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/IntervalRewardParams.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/IntervalRewardParams.ts" + ) )] #[cw_serde] #[derive(Copy)] @@ -80,7 +83,10 @@ impl IntervalRewardParams { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/RewardingParams.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/RewardingParams.ts" + ) )] #[cw_serde] #[derive(Copy)] @@ -241,7 +247,10 @@ impl RewardingParams { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/RewardedSetParams.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/RewardedSetParams.ts" + ) )] #[cw_serde] #[derive(Copy)] @@ -306,7 +315,10 @@ impl RewardedSetParams { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NodeRewardingParameters.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeRewardingParameters.ts" + ) )] #[cw_serde] #[derive(Copy)] @@ -338,7 +350,10 @@ impl NodeRewardingParameters { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts" + ) )] #[cw_serde] #[derive(Copy, Default)] @@ -392,7 +407,10 @@ impl IntervalRewardingParamsUpdate { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/ActiveSetUpdate.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/ActiveSetUpdate.ts" + ) )] #[cw_serde] #[derive(Copy, Default)] diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/src/rewarding/mod.rs b/common/cosmwasm-smart-contracts/mixnet-contract/src/rewarding/mod.rs index 18bdc3e562..e1c320f806 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/src/rewarding/mod.rs +++ b/common/cosmwasm-smart-contracts/mixnet-contract/src/rewarding/mod.rs @@ -10,7 +10,10 @@ pub mod simulator; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/RewardEstimate.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/RewardEstimate.ts" + ) )] #[cw_serde] #[derive(Copy, Default)] diff --git a/common/cosmwasm-smart-contracts/vesting-contract/src/types.rs b/common/cosmwasm-smart-contracts/vesting-contract/src/types.rs index da3adbbada..0b15346804 100644 --- a/common/cosmwasm-smart-contracts/vesting-contract/src/types.rs +++ b/common/cosmwasm-smart-contracts/vesting-contract/src/types.rs @@ -10,7 +10,7 @@ use std::str::FromStr; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Period.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Period.ts") )] #[cw_serde] /// The vesting period. diff --git a/common/types/src/account.rs b/common/types/src/account.rs index 12bc12efd4..6315cccccd 100644 --- a/common/types/src/account.rs +++ b/common/types/src/account.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Account.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Account.ts") )] #[derive(Serialize, Deserialize, JsonSchema)] pub struct Account { @@ -31,7 +31,10 @@ impl Account { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/AccountWithMnemonic.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/AccountWithMnemonic.ts" + ) )] #[derive(Serialize, Deserialize)] pub struct AccountWithMnemonic { @@ -42,7 +45,7 @@ pub struct AccountWithMnemonic { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/AccountEntry.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/AccountEntry.ts") )] #[derive(Clone, Debug, Serialize, Deserialize)] pub struct AccountEntry { @@ -53,7 +56,7 @@ pub struct AccountEntry { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Balance.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Balance.ts") )] #[derive(Serialize, Deserialize)] pub struct Balance { diff --git a/common/types/src/currency.rs b/common/types/src/currency.rs index 5cbe901cc8..9d13bfbc56 100644 --- a/common/types/src/currency.rs +++ b/common/types/src/currency.rs @@ -13,7 +13,10 @@ use strum::{Display, EnumString, VariantNames}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/CurrencyDenom.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/CurrencyDenom.ts" + ) )] #[cfg_attr(feature = "generate-ts", ts(rename_all = "lowercase"))] #[derive( @@ -247,7 +250,7 @@ impl From for CoinMetadata { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DecCoin.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/DecCoin.ts") )] pub struct DecCoin { #[cfg_attr(feature = "generate-ts", ts(as = "CurrencyDenom"))] diff --git a/common/types/src/delegation.rs b/common/types/src/delegation.rs index 51ffa01e4e..f906c04cd1 100644 --- a/common/types/src/delegation.rs +++ b/common/types/src/delegation.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Delegation.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Delegation.ts") )] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] pub struct Delegation { @@ -39,7 +39,10 @@ impl Delegation { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DelegationWithEverything.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/DelegationWithEverything.ts" + ) )] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)] pub struct DelegationWithEverything { @@ -70,7 +73,10 @@ pub struct DelegationWithEverything { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DelegationResult.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/DelegationResult.ts" + ) )] #[derive(Serialize, Deserialize, JsonSchema, Clone, PartialEq, Eq, Debug)] pub struct DelegationResult { @@ -82,7 +88,10 @@ pub struct DelegationResult { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DelegationSummaryResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/DelegationSummaryResponse.ts" + ) )] #[derive(Deserialize, Serialize)] pub struct DelegationsSummaryResponse { diff --git a/common/types/src/deprecated.rs b/common/types/src/deprecated.rs index 8d74026b3a..09b7b210d5 100644 --- a/common/types/src/deprecated.rs +++ b/common/types/src/deprecated.rs @@ -11,7 +11,10 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DelegationEventKind.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/DelegationEventKind.ts" + ) )] #[derive(Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, Debug)] pub enum DelegationEventKind { @@ -22,7 +25,10 @@ pub enum DelegationEventKind { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DelegationEvent.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/DelegationEvent.ts" + ) )] #[derive(Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, Debug)] pub struct DelegationEvent { @@ -36,7 +42,10 @@ pub struct DelegationEvent { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/WrappedDelegationEvent.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/WrappedDelegationEvent.ts" + ) )] #[derive(Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, Debug)] pub struct WrappedDelegationEvent { diff --git a/common/types/src/fees.rs b/common/types/src/fees.rs index c27b19fef5..23c5e322f7 100644 --- a/common/types/src/fees.rs +++ b/common/types/src/fees.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/FeeDetails.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/FeeDetails.ts") )] pub struct FeeDetails { // expected to be used by the wallet in order to display detailed fee information to the user @@ -30,14 +30,14 @@ pub mod ts_type_helpers { use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize, ts_rs::TS)] - #[ts(export_to = "ts-packages/types/src/types/rust/Fee.ts")] + #[ts(export, export_to = "ts-packages/types/src/types/rust/Fee.ts")] pub enum Fee { Manual(CosmosFee), Auto(Option), } #[derive(Debug, Clone, Serialize, Deserialize, ts_rs::TS)] - #[ts(export_to = "ts-packages/types/src/types/rust/CosmosFee.ts")] + #[ts(export, export_to = "ts-packages/types/src/types/rust/CosmosFee.ts")] // this should corresponds to cosmrs::tx::Fee // IMPORTANT NOTE: this should work as of cosmrs 0.7.1 due to their `FromStr` implementations // on the type. The below struct might have to get readjusted if we update cosmrs!! @@ -50,7 +50,7 @@ pub mod ts_type_helpers { // Note: I've got a feeling this one will bite us hard at some point... #[derive(Debug, Clone, Serialize, Deserialize, ts_rs::TS)] - #[ts(export_to = "ts-packages/types/src/types/rust/Coin.ts")] + #[ts(export, export_to = "ts-packages/types/src/types/rust/Coin.ts")] // this should corresponds to cosmrs::Coin // IMPORTANT NOTE: this should work as of cosmrs 0.7.1 due to their `FromStr` implementations // on the type. The below struct might have to get readjusted if we update cosmrs!! diff --git a/common/types/src/gas.rs b/common/types/src/gas.rs index 9c389cc863..5e67d81fda 100644 --- a/common/types/src/gas.rs +++ b/common/types/src/gas.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Gas.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Gas.ts") )] #[derive(Deserialize, Serialize, Copy, Clone, Debug)] pub struct Gas { @@ -36,7 +36,7 @@ impl From for Gas { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/GasInfo.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/GasInfo.ts") )] #[derive(Deserialize, Serialize, Copy, Clone, Debug)] pub struct GasInfo { diff --git a/common/types/src/gateway.rs b/common/types/src/gateway.rs index 6be4e6939b..93127460b0 100644 --- a/common/types/src/gateway.rs +++ b/common/types/src/gateway.rs @@ -10,7 +10,7 @@ use std::fmt; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Gateway.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Gateway.ts") )] #[derive(Clone, Debug, Deserialize, PartialEq, Eq, PartialOrd, Serialize, JsonSchema)] pub struct Gateway { @@ -51,7 +51,7 @@ impl From for Gateway { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/GatewayBond.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/GatewayBond.ts") )] #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] pub struct GatewayBond { diff --git a/common/types/src/mixnode.rs b/common/types/src/mixnode.rs index c06d0f9ece..187cddf5cd 100644 --- a/common/types/src/mixnode.rs +++ b/common/types/src/mixnode.rs @@ -17,7 +17,10 @@ use std::net::IpAddr; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/MixNodeDetails.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/MixNodeDetails.ts" + ) )] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] pub struct MixNodeDetails { @@ -46,7 +49,7 @@ impl MixNodeDetails { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/MixNodeBond.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/MixNodeBond.ts") )] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] pub struct MixNodeBond { @@ -80,7 +83,10 @@ impl MixNodeBond { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NodeRewarding.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeRewarding.ts" + ) )] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] pub struct NodeRewarding { @@ -126,7 +132,10 @@ impl NodeRewarding { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/MixNodeCostParams.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/MixNodeCostParams.ts" + ) )] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] pub struct NodeCostParams { diff --git a/common/types/src/nym_node.rs b/common/types/src/nym_node.rs index 4b4e46212a..a842bbb788 100644 --- a/common/types/src/nym_node.rs +++ b/common/types/src/nym_node.rs @@ -15,7 +15,10 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NymNodeDetails.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/NymNodeDetails.ts" + ) )] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] pub struct NymNodeDetails { @@ -51,7 +54,7 @@ impl NymNodeDetails { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NymNodeBond.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/NymNodeBond.ts") )] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] pub struct NymNodeBond { diff --git a/common/types/src/pending_events.rs b/common/types/src/pending_events.rs index a78ba568da..15866f6cad 100644 --- a/common/types/src/pending_events.rs +++ b/common/types/src/pending_events.rs @@ -17,7 +17,10 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PendingEpochEvent.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingEpochEvent.ts" + ) )] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] pub struct PendingEpochEvent { @@ -42,7 +45,10 @@ impl PendingEpochEvent { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PendingEpochEventData.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingEpochEventData.ts" + ) )] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] pub enum PendingEpochEventData { @@ -125,7 +131,10 @@ impl PendingEpochEventData { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PendingIntervalEvent.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingIntervalEvent.ts" + ) )] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)] pub struct PendingIntervalEvent { @@ -153,7 +162,10 @@ impl PendingIntervalEvent { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PendingIntervalEventData.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingIntervalEventData.ts" + ) )] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)] pub enum PendingIntervalEventData { diff --git a/common/types/src/transaction.rs b/common/types/src/transaction.rs index 9179a0170b..7599e4799d 100644 --- a/common/types/src/transaction.rs +++ b/common/types/src/transaction.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/SendTxResult.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/SendTxResult.ts") )] #[derive(Deserialize, Serialize, Debug)] pub struct SendTxResult { @@ -38,7 +38,10 @@ impl SendTxResult { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/TransactionDetails.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/TransactionDetails.ts" + ) )] #[derive(Deserialize, Serialize, Debug)] pub struct TransactionDetails { @@ -60,7 +63,10 @@ impl TransactionDetails { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/TransactionExecuteResult.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/TransactionExecuteResult.ts" + ) )] #[derive(Deserialize, Serialize, Debug)] pub struct TransactionExecuteResult { @@ -89,7 +95,10 @@ impl TransactionExecuteResult { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/RpcTransactionResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/RpcTransactionResponse.ts" + ) )] #[derive(Deserialize, Serialize)] pub struct RpcTransactionResponse { diff --git a/common/types/src/vesting.rs b/common/types/src/vesting.rs index 1071b21324..6e62081327 100644 --- a/common/types/src/vesting.rs +++ b/common/types/src/vesting.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PledgeData.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/PledgeData.ts") )] #[derive(Serialize, Deserialize, Debug)] pub struct PledgeData { @@ -32,7 +32,10 @@ impl PledgeData { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/OriginalVestingResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/OriginalVestingResponse.ts" + ) )] #[derive(Serialize, Deserialize, Debug)] pub struct OriginalVestingResponse { @@ -57,7 +60,10 @@ impl OriginalVestingResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/VestingAccountInfo.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/VestingAccountInfo.ts" + ) )] #[derive(Serialize, Deserialize, Debug)] pub struct VestingAccountInfo { @@ -86,7 +92,10 @@ impl VestingAccountInfo { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/VestingPeriod.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/VestingPeriod.ts" + ) )] #[derive(Serialize, Deserialize, Debug)] pub struct VestingPeriod { diff --git a/nym-api/nym-api-requests/src/models.rs b/nym-api/nym-api-requests/src/models.rs index 44279666e2..ce84b7a53e 100644 --- a/nym-api/nym-api-requests/src/models.rs +++ b/nym-api/nym-api-requests/src/models.rs @@ -69,7 +69,10 @@ impl Display for RequestError { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/MixnodeStatus.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/MixnodeStatus.ts" + ) )] #[serde(rename_all = "snake_case")] pub enum MixnodeStatus { @@ -88,7 +91,10 @@ impl MixnodeStatus { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.ts" + ) )] pub struct MixnodeCoreStatusResponse { pub mix_id: NodeId, @@ -99,7 +105,10 @@ pub struct MixnodeCoreStatusResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/GatewayCoreStatusResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/GatewayCoreStatusResponse.ts" + ) )] pub struct GatewayCoreStatusResponse { pub identity: String, @@ -110,7 +119,10 @@ pub struct GatewayCoreStatusResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/MixnodeStatusResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/MixnodeStatusResponse.ts" + ) )] pub struct MixnodeStatusResponse { pub status: MixnodeStatus, @@ -133,7 +145,10 @@ pub struct NodePerformance { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NodeAnnotation.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeAnnotation.ts" + ) )] pub struct NodeAnnotation { #[cfg_attr(feature = "generate-ts", ts(type = "string"))] @@ -145,7 +160,10 @@ pub struct NodeAnnotation { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/AnnotationResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/AnnotationResponse.ts" + ) )] pub struct AnnotationResponse { #[schema(value_type = u32)] @@ -157,7 +175,10 @@ pub struct AnnotationResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NodePerformanceResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodePerformanceResponse.ts" + ) )] pub struct NodePerformanceResponse { #[schema(value_type = u32)] @@ -169,7 +190,10 @@ pub struct NodePerformanceResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/NodeDatePerformanceResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeDatePerformanceResponse.ts" + ) )] pub struct NodeDatePerformanceResponse { #[schema(value_type = u32)] @@ -359,7 +383,10 @@ pub struct ComputeRewardEstParam { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/RewardEstimationResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/RewardEstimationResponse.ts" + ) )] #[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, ToSchema)] pub struct RewardEstimationResponse { @@ -391,7 +418,10 @@ pub struct GatewayUptimeResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/StakeSaturationResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/StakeSaturationResponse.ts" + ) )] pub struct StakeSaturationResponse { #[cfg_attr(feature = "generate-ts", ts(type = "string"))] @@ -410,7 +440,10 @@ pub type StakeSaturation = Decimal; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/SelectionChance.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/SelectionChance.ts" + ) )] pub enum SelectionChance { High, @@ -452,7 +485,10 @@ impl fmt::Display for SelectionChance { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/InclusionProbabilityResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/InclusionProbabilityResponse.ts" + ) )] pub struct InclusionProbabilityResponse { pub in_active: SelectionChance, @@ -515,7 +551,10 @@ pub struct GatewayStatusReportResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PerformanceHistoryResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PerformanceHistoryResponse.ts" + ) )] pub struct PerformanceHistoryResponse { #[schema(value_type = u32)] @@ -527,7 +566,10 @@ pub struct PerformanceHistoryResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/UptimeHistoryResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/UptimeHistoryResponse.ts" + ) )] pub struct UptimeHistoryResponse { #[schema(value_type = u32)] @@ -539,7 +581,10 @@ pub struct UptimeHistoryResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/HistoricalUptimeResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/HistoricalUptimeResponse.ts" + ) )] pub struct HistoricalUptimeResponse { #[schema(value_type = String, example = "1970-01-01")] @@ -554,7 +599,10 @@ pub struct HistoricalUptimeResponse { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts" + ) )] pub struct HistoricalPerformanceResponse { #[schema(value_type = String, example = "1970-01-01")] @@ -792,7 +840,10 @@ impl NymNodeDescription { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DescribedNodeType.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/DescribedNodeType.ts" + ) )] pub enum DescribedNodeType { LegacyMixnode, @@ -804,7 +855,10 @@ pub enum DescribedNodeType { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/DeclaredRoles.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/DeclaredRoles.ts" + ) )] pub struct DeclaredRoles { pub mixnode: bool, diff --git a/nym-api/nym-api-requests/src/pagination.rs b/nym-api/nym-api-requests/src/pagination.rs index 9a36caa988..43a3458db7 100644 --- a/nym-api/nym-api-requests/src/pagination.rs +++ b/nym-api/nym-api-requests/src/pagination.rs @@ -9,7 +9,7 @@ use utoipa::ToSchema; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/Pagination.ts") + ts(export, export_to = "ts-packages/types/src/types/rust/Pagination.ts") )] pub struct Pagination { pub total: usize, @@ -21,7 +21,10 @@ pub struct Pagination { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "ts-packages/types/src/types/rust/PaginatedResponse.ts") + ts( + export, + export_to = "ts-packages/types/src/types/rust/PaginatedResponse.ts" + ) )] pub struct PaginatedResponse { pub pagination: Pagination, diff --git a/nym-wallet/nym-wallet-types/src/admin.rs b/nym-wallet/nym-wallet-types/src/admin.rs index 0e76cba619..4808f20b40 100644 --- a/nym-wallet/nym-wallet-types/src/admin.rs +++ b/nym-wallet/nym-wallet-types/src/admin.rs @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "nym-wallet/src/types/rust/StateParams.ts") + ts(export, export_to = "nym-wallet/src/types/rust/StateParams.ts") )] #[derive(Serialize, Deserialize, Debug)] pub struct TauriContractStateParams { @@ -27,7 +27,7 @@ pub struct TauriContractStateParams { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "nym-wallet/src/types/rust/OperatingCostRange.ts") + ts(export, export_to = "nym-wallet/src/types/rust/OperatingCostRange.ts") )] #[derive(Serialize, Deserialize, Debug)] pub struct TauriOperatingCostRange { @@ -38,7 +38,7 @@ pub struct TauriOperatingCostRange { #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "nym-wallet/src/types/rust/ProfitMarginRange.ts") + ts(export, export_to = "nym-wallet/src/types/rust/ProfitMarginRange.ts") )] #[derive(Serialize, Deserialize, Debug)] pub struct TauriProfitMarginRange { diff --git a/nym-wallet/nym-wallet-types/src/interval.rs b/nym-wallet/nym-wallet-types/src/interval.rs index 875f343043..3d17ae4813 100644 --- a/nym-wallet/nym-wallet-types/src/interval.rs +++ b/nym-wallet/nym-wallet-types/src/interval.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "nym-wallet/src/types/rust/Interval.ts") + ts(export, export_to = "nym-wallet/src/types/rust/Interval.ts") )] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, PartialOrd, Serialize)] pub struct Interval { diff --git a/nym-wallet/nym-wallet-types/src/network.rs b/nym-wallet/nym-wallet-types/src/network.rs index 08b3da69b1..97948a4248 100644 --- a/nym-wallet/nym-wallet-types/src/network.rs +++ b/nym-wallet/nym-wallet-types/src/network.rs @@ -14,7 +14,7 @@ mod sandbox; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "nym-wallet/src/types/rust/Network.ts") + ts(export, export_to = "nym-wallet/src/types/rust/Network.ts") )] #[derive(Copy, Clone, Debug, Deserialize, EnumIter, Eq, Hash, PartialEq, Serialize)] pub enum Network { diff --git a/nym-wallet/nym-wallet-types/src/network_config.rs b/nym-wallet/nym-wallet-types/src/network_config.rs index 8d867d1768..06e68d7f28 100644 --- a/nym-wallet/nym-wallet-types/src/network_config.rs +++ b/nym-wallet/nym-wallet-types/src/network_config.rs @@ -5,7 +5,7 @@ use std::fmt; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( feature = "generate-ts", - ts(export_to = "nym-wallet/src/types/rust/ValidatorUrls.ts") + ts(export, export_to = "nym-wallet/src/types/rust/ValidatorUrls.ts") )] #[derive(Debug, Serialize, Deserialize)] pub struct ValidatorUrls { diff --git a/nym-wallet/src/requests/queries.ts b/nym-wallet/src/requests/queries.ts index dbb7bb6e18..ddd163ed48 100644 --- a/nym-wallet/src/requests/queries.ts +++ b/nym-wallet/src/requests/queries.ts @@ -1,20 +1,20 @@ import { - DecCoin, - GatewayBond, - InclusionProbabilityResponse, - MixNodeDetails, - MixnodeStatusResponse, - PendingIntervalEvent, - RewardEstimationResponse, - StakeSaturationResponse, - WrappedDelegationEvent, - NymNodeDetails, + DecCoin, + GatewayBond, + InclusionProbabilityResponse, + MixNodeDetails, + MixnodeStatusResponse, + PendingIntervalEvent, + RewardEstimationResponse, + StakeSaturationResponse, + WrappedDelegationEvent, + NymNodeDetails, } from '@nymproject/types'; -import {Interval, TGatewayReport, TNodeDescription} from 'src/types'; -import {invokeWrapper} from './wrapper'; +import { Interval, TGatewayReport, TNodeDescription } from 'src/types'; +import { invokeWrapper } from './wrapper'; export const getAllPendingDelegations = async () => - invokeWrapper('get_pending_delegation_events'); + invokeWrapper('get_pending_delegation_events'); export const getMixnodeBondDetails = async () => invokeWrapper('mixnode_bond_details'); export const getGatewayBondDetails = async () => invokeWrapper('gateway_bond_details'); @@ -22,44 +22,44 @@ export const getNymNodeBondDetails = async () => invokeWrapper invokeWrapper('get_mixnode_avg_uptime'); export const getPendingOperatorRewards = async (address: string) => - invokeWrapper('get_pending_operator_rewards', {address}); + invokeWrapper('get_pending_operator_rewards', { address }); export const getMixnodeStakeSaturation = async (mixId: number) => - invokeWrapper('mixnode_stake_saturation', {mixId}); + invokeWrapper('mixnode_stake_saturation', { mixId }); export const getMixnodeRewardEstimation = async (mixId: number) => - invokeWrapper('mixnode_reward_estimation', {mixId}); + invokeWrapper('mixnode_reward_estimation', { mixId }); export const getMixnodeStatus = async (mixId: number) => - invokeWrapper('mixnode_status', {mixId}); + invokeWrapper('mixnode_status', { mixId }); export const checkMixnodeOwnership = async () => invokeWrapper('owns_mixnode'); export const checkGatewayOwnership = async () => invokeWrapper('owns_gateway'); export const getInclusionProbability = async (mixId: number) => - invokeWrapper('mixnode_inclusion_probability', {mixId}); + invokeWrapper('mixnode_inclusion_probability', { mixId }); export const getCurrentInterval = async () => invokeWrapper('get_current_interval'); export const getNumberOfMixnodeDelegators = async (mixId: number) => - invokeWrapper('get_number_of_mixnode_delegators', {mixId}); + invokeWrapper('get_number_of_mixnode_delegators', { mixId }); export const getNodeDescription = async (host: string, port: number) => - invokeWrapper('get_mix_node_description', {host, port}); + invokeWrapper('get_mix_node_description', { host, port }); export const getPendingIntervalEvents = async () => - invokeWrapper('get_pending_interval_events'); + invokeWrapper('get_pending_interval_events'); export const getGatewayReport = async (identity: string) => - invokeWrapper('gateway_report', {identity}); + invokeWrapper('gateway_report', { identity }); export const computeMixnodeRewardEstimation = async (args: { - mixId: number; - performance: string; - pledgeAmount: number; - totalDelegation: number; - profitMarginPercent: string; - intervalOperatingCost: { denom: 'unym'; amount: string }; + mixId: number; + performance: string; + pledgeAmount: number; + totalDelegation: number; + profitMarginPercent: string; + intervalOperatingCost: { denom: 'unym'; amount: string }; }) => invokeWrapper('compute_mixnode_reward_estimation', args); -export const getMixnodeUptime = async (mixId: number) => invokeWrapper('get_mixnode_uptime', {mixId}); +export const getMixnodeUptime = async (mixId: number) => invokeWrapper('get_mixnode_uptime', { mixId }); diff --git a/nym-wallet/src/types/rust/AppEnv.ts b/nym-wallet/src/types/rust/AppEnv.ts index 49ebfc27d1..bd276ebace 100644 --- a/nym-wallet/src/types/rust/AppEnv.ts +++ b/nym-wallet/src/types/rust/AppEnv.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface AppEnv { ADMIN_ADDRESS: string | null, SHOW_TERMINAL: string | null, ENABLE_QA_MODE: string | null, } \ No newline at end of file +export type AppEnv = { ADMIN_ADDRESS: string | null; SHOW_TERMINAL: string | null; ENABLE_QA_MODE: string | null }; diff --git a/nym-wallet/src/types/rust/AppVersion.ts b/nym-wallet/src/types/rust/AppVersion.ts index b0624301c1..e7d71f0832 100644 --- a/nym-wallet/src/types/rust/AppVersion.ts +++ b/nym-wallet/src/types/rust/AppVersion.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface AppVersion { current_version: string, latest_version: string, is_update_available: boolean, } \ No newline at end of file +export type AppVersion = { current_version: string; latest_version: string; is_update_available: boolean }; diff --git a/nym-wallet/src/types/rust/Interval.ts b/nym-wallet/src/types/rust/Interval.ts index ab2c4c4bc9..f5e1a13161 100644 --- a/nym-wallet/src/types/rust/Interval.ts +++ b/nym-wallet/src/types/rust/Interval.ts @@ -1,3 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface Interval { id: number, epochs_in_interval: number, current_epoch_start_unix: bigint, current_epoch_id: number, epoch_length_seconds: bigint, total_elapsed_epochs: number, } \ No newline at end of file +export type Interval = { + id: number; + epochs_in_interval: number; + current_epoch_start_unix: bigint; + current_epoch_id: number; + epoch_length_seconds: bigint; + total_elapsed_epochs: number; +}; diff --git a/nym-wallet/src/types/rust/Network.ts b/nym-wallet/src/types/rust/Network.ts index 03c73643d6..d55f0bce67 100644 --- a/nym-wallet/src/types/rust/Network.ts +++ b/nym-wallet/src/types/rust/Network.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Network = "QA" | "SANDBOX" | "MAINNET"; \ No newline at end of file +export type Network = 'QA' | 'SANDBOX' | 'MAINNET'; diff --git a/nym-wallet/src/types/rust/OperatingCostRange.ts b/nym-wallet/src/types/rust/OperatingCostRange.ts index 34ea2f65a4..7c87421672 100644 --- a/nym-wallet/src/types/rust/OperatingCostRange.ts +++ b/nym-wallet/src/types/rust/OperatingCostRange.ts @@ -1,4 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DecCoin } from "../../../../ts-packages/types/src/types/rust/DecCoin"; +import type { DecCoin } from '@nymproject/types/src/types/rust/DecCoin'; -export interface TauriOperatingCostRange { minimum: DecCoin, maximum: DecCoin, } \ No newline at end of file +export type TauriOperatingCostRange = { minimum: DecCoin; maximum: DecCoin }; diff --git a/nym-wallet/src/types/rust/ProfitMarginRange.ts b/nym-wallet/src/types/rust/ProfitMarginRange.ts index 631a4e1097..d177c98d42 100644 --- a/nym-wallet/src/types/rust/ProfitMarginRange.ts +++ b/nym-wallet/src/types/rust/ProfitMarginRange.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface TauriProfitMarginRange { minimum: string, maximum: string, } \ No newline at end of file +export type TauriProfitMarginRange = { minimum: string; maximum: string }; diff --git a/nym-wallet/src/types/rust/StateParams.ts b/nym-wallet/src/types/rust/StateParams.ts index aa6eb0366a..ebf1f33c56 100644 --- a/nym-wallet/src/types/rust/StateParams.ts +++ b/nym-wallet/src/types/rust/StateParams.ts @@ -1,6 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DecCoin } from "../../../../ts-packages/types/src/types/rust/DecCoin"; -import type { TauriOperatingCostRange } from "./OperatingCostRange"; -import type { TauriProfitMarginRange } from "./ProfitMarginRange"; +import type { DecCoin } from '@nymproject/types/src/types/rust/DecCoin'; +import type { TauriOperatingCostRange } from './OperatingCostRange'; +import type { TauriProfitMarginRange } from './ProfitMarginRange'; -export interface TauriContractStateParams { minimum_pledge: DecCoin, minimum_delegation: DecCoin | null, operating_cost: TauriOperatingCostRange, profit_margin: TauriProfitMarginRange, } \ No newline at end of file +export type TauriContractStateParams = { + minimum_pledge: DecCoin; + minimum_delegation: DecCoin | null; + operating_cost: TauriOperatingCostRange; + profit_margin: TauriProfitMarginRange; +}; diff --git a/nym-wallet/src/types/rust/ValidatorUrl.ts b/nym-wallet/src/types/rust/ValidatorUrl.ts index 7e94537f97..300941995e 100644 --- a/nym-wallet/src/types/rust/ValidatorUrl.ts +++ b/nym-wallet/src/types/rust/ValidatorUrl.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface ValidatorUrl { url: string, name: string | null, } \ No newline at end of file +export type ValidatorUrl = { url: string; name: string | null }; diff --git a/nym-wallet/src/types/rust/ValidatorUrls.ts b/nym-wallet/src/types/rust/ValidatorUrls.ts index 9a579b2f41..a0eeac8b94 100644 --- a/nym-wallet/src/types/rust/ValidatorUrls.ts +++ b/nym-wallet/src/types/rust/ValidatorUrls.ts @@ -1,4 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ValidatorUrl } from "./ValidatorUrl"; +import type { ValidatorUrl } from './ValidatorUrl'; -export interface ValidatorUrls { urls: Array, } \ No newline at end of file +export type Validator = { nyxd_url: string; nyxd_name: string | null; api_url: string | null }; + +export type ValidatorUrls = { urls: Array }; diff --git a/tools/ts-rs-cli/Cargo.toml b/tools/ts-rs-cli/Cargo.toml index 66ee5e5543..6c75876550 100644 --- a/tools/ts-rs-cli/Cargo.toml +++ b/tools/ts-rs-cli/Cargo.toml @@ -15,7 +15,7 @@ nym-validator-client = { path = "../../common/client-libs/validator-client", fea "generate-ts" ] } nym-api-requests = { path = "../../nym-api/nym-api-requests", features = ["generate-ts"] } -nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", features = [ "generate-ts" ]} -nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", features = [ "generate-ts" ] } -nym-types = { path = "../../common/types", features = [ "generate-ts" ] } -nym-wallet-types = { path = "../../nym-wallet/nym-wallet-types", features = [ "generate-ts" ] } +nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", features = ["generate-ts"] } +nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", features = ["generate-ts"] } +nym-types = { path = "../../common/types", features = ["generate-ts"] } +nym-wallet-types = { path = "../../nym-wallet/nym-wallet-types", features = ["generate-ts"] } diff --git a/tools/ts-rs-cli/src/main.rs b/tools/ts-rs-cli/src/main.rs index a876faf637..dfd7d0bdf9 100644 --- a/tools/ts-rs-cli/src/main.rs +++ b/tools/ts-rs-cli/src/main.rs @@ -60,7 +60,7 @@ macro_rules! do_export { }}; } -fn main() { +fn main() -> anyhow::Result<()> { println!("Starting export of types using ts-rs..."); println!(); @@ -175,7 +175,10 @@ fn main() { println!(); println!("Moving output files into place..."); - for file in WalkDir::new("./") + let source = Path::new("./bindings"); + + // move from ./bindings/foo/bar/X.ts into ../../foo/bar/X.ts + for file in WalkDir::new(source) .into_iter() .filter_map(|file| file.ok()) .filter(|f| { @@ -191,7 +194,9 @@ fn main() { { // construct the source and destination paths that can be used to replace the output file let src = file.path(); - let dst = dst_base.join(src); + let sourceless_src = src.strip_prefix(source)?; + + let dst = dst_base.join(sourceless_src); let dst_directory = dst.parent().expect("Could not get parent directory"); if !dst_directory.exists() { @@ -208,15 +213,19 @@ fn main() { println!("✅ {} => {}", file.path().display(), res.display()); } Err(e) => { - println!("❌ {}: {}", file.path().display(), e); + println!("❌ {}: {e}", file.path().display()); } }, Err(e) => { - println!("❌ {}: {}", file.path().display(), e); + println!("❌ {}: {e}", file.path().display()); } } } + // finally remove the ephemeral dir + std::fs::remove_dir_all(source)?; + println!(); println!("Done"); + Ok(()) } diff --git a/ts-packages/types/src/types/rust/Account.ts b/ts-packages/types/src/types/rust/Account.ts index da0afb666e..33471c6846 100644 --- a/ts-packages/types/src/types/rust/Account.ts +++ b/ts-packages/types/src/types/rust/Account.ts @@ -1,8 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CurrencyDenom } from './CurrencyDenom'; -export interface Account { - client_address: string; - base_mix_denom: string; - display_mix_denom: CurrencyDenom; -} +export type Account = { client_address: string; base_mix_denom: string; display_mix_denom: CurrencyDenom }; diff --git a/ts-packages/types/src/types/rust/AccountEntry.ts b/ts-packages/types/src/types/rust/AccountEntry.ts index 472a9befcd..f10dc906df 100644 --- a/ts-packages/types/src/types/rust/AccountEntry.ts +++ b/ts-packages/types/src/types/rust/AccountEntry.ts @@ -1,6 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface AccountEntry { - id: string; - address: string; -} +export type AccountEntry = { id: string; address: string }; diff --git a/ts-packages/types/src/types/rust/AccountWithMnemonic.ts b/ts-packages/types/src/types/rust/AccountWithMnemonic.ts index edbf9b9de6..df7450403a 100644 --- a/ts-packages/types/src/types/rust/AccountWithMnemonic.ts +++ b/ts-packages/types/src/types/rust/AccountWithMnemonic.ts @@ -1,7 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Account } from './Account'; -export interface AccountWithMnemonic { - account: Account; - mnemonic: string; -} +export type AccountWithMnemonic = { account: Account; mnemonic: string }; diff --git a/ts-packages/types/src/types/rust/ActiveSetUpdate.ts b/ts-packages/types/src/types/rust/ActiveSetUpdate.ts new file mode 100644 index 0000000000..8bf64f0368 --- /dev/null +++ b/ts-packages/types/src/types/rust/ActiveSetUpdate.ts @@ -0,0 +1,19 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Specification on how the active set should be updated. + */ +export type ActiveSetUpdate = { + /** + * The expected number of nodes assigned entry gateway role (i.e. [`Role::EntryGateway`]) + */ + entry_gateways: number; + /** + * The expected number of nodes assigned exit gateway role (i.e. [`Role::ExitGateway`]) + */ + exit_gateways: number; + /** + * The expected number of nodes assigned the 'mixnode' role, i.e. total of [`Role::Layer1`], [`Role::Layer2`] and [`Role::Layer3`]. + */ + mixnodes: number; +}; diff --git a/ts-packages/types/src/types/rust/AnnotationResponse.ts b/ts-packages/types/src/types/rust/AnnotationResponse.ts new file mode 100644 index 0000000000..a344a73347 --- /dev/null +++ b/ts-packages/types/src/types/rust/AnnotationResponse.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { NodeAnnotation } from './NodeAnnotation'; + +export type AnnotationResponse = { node_id: number; annotation: NodeAnnotation | null }; diff --git a/ts-packages/types/src/types/rust/Balance.ts b/ts-packages/types/src/types/rust/Balance.ts index fe11917327..6d3d51b5a4 100644 --- a/ts-packages/types/src/types/rust/Balance.ts +++ b/ts-packages/types/src/types/rust/Balance.ts @@ -1,7 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; -export interface Balance { - amount: DecCoin; - printable_balance: string; -} +export type Balance = { amount: DecCoin; printable_balance: string }; diff --git a/ts-packages/types/src/types/rust/Coin.ts b/ts-packages/types/src/types/rust/Coin.ts index 493c2e6b41..be2edc24fa 100644 --- a/ts-packages/types/src/types/rust/Coin.ts +++ b/ts-packages/types/src/types/rust/Coin.ts @@ -1,6 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface Coin { - denom: string; - amount: bigint; -} +export type Coin = { denom: string; amount: bigint }; diff --git a/ts-packages/types/src/types/rust/CosmosFee.ts b/ts-packages/types/src/types/rust/CosmosFee.ts index d77c4d3dd8..a741cbce59 100644 --- a/ts-packages/types/src/types/rust/CosmosFee.ts +++ b/ts-packages/types/src/types/rust/CosmosFee.ts @@ -1,9 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Coin } from './Coin'; -export interface CosmosFee { - amount: Array; - gas_limit: bigint; - payer: string | null; - granter: string | null; -} +export type CosmosFee = { amount: Array; gas_limit: bigint; payer: string | null; granter: string | null }; diff --git a/ts-packages/types/src/types/rust/DeclaredRoles.ts b/ts-packages/types/src/types/rust/DeclaredRoles.ts new file mode 100644 index 0000000000..6675391d48 --- /dev/null +++ b/ts-packages/types/src/types/rust/DeclaredRoles.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type DeclaredRoles = { mixnode: boolean; entry: boolean; exit_nr: boolean; exit_ipr: boolean }; diff --git a/ts-packages/types/src/types/rust/Delegation.ts b/ts-packages/types/src/types/rust/Delegation.ts index 58de13e6cc..bef093e881 100644 --- a/ts-packages/types/src/types/rust/Delegation.ts +++ b/ts-packages/types/src/types/rust/Delegation.ts @@ -1,10 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; -export interface Delegation { - owner: string; - mix_id: number; - amount: DecCoin; - height: bigint; - proxy: string | null; -} +export type Delegation = { owner: string; mix_id: number; amount: DecCoin; height: bigint; proxy: string | null }; diff --git a/ts-packages/types/src/types/rust/DelegationEvent.ts b/ts-packages/types/src/types/rust/DelegationEvent.ts index 30ff21943f..4891306e80 100644 --- a/ts-packages/types/src/types/rust/DelegationEvent.ts +++ b/ts-packages/types/src/types/rust/DelegationEvent.ts @@ -2,10 +2,10 @@ import type { DecCoin } from './DecCoin'; import type { DelegationEventKind } from './DelegationEventKind'; -export interface DelegationEvent { +export type DelegationEvent = { kind: DelegationEventKind; mix_id: number; address: string; amount: DecCoin | null; proxy: string | null; -} +}; diff --git a/ts-packages/types/src/types/rust/DelegationResult.ts b/ts-packages/types/src/types/rust/DelegationResult.ts index d8f8a77ce3..765e11e98b 100644 --- a/ts-packages/types/src/types/rust/DelegationResult.ts +++ b/ts-packages/types/src/types/rust/DelegationResult.ts @@ -1,8 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; -export interface DelegationResult { - source_address: string; - target_address: string; - amount: DecCoin | null; -} +export type DelegationResult = { source_address: string; target_address: string; amount: DecCoin | null }; diff --git a/ts-packages/types/src/types/rust/DelegationSummaryResponse.ts b/ts-packages/types/src/types/rust/DelegationSummaryResponse.ts index 21e85d513b..bb86fd9ced 100644 --- a/ts-packages/types/src/types/rust/DelegationSummaryResponse.ts +++ b/ts-packages/types/src/types/rust/DelegationSummaryResponse.ts @@ -2,8 +2,8 @@ import type { DecCoin } from './DecCoin'; import type { DelegationWithEverything } from './DelegationWithEverything'; -export interface DelegationsSummaryResponse { +export type DelegationsSummaryResponse = { delegations: Array; total_delegations: DecCoin; total_rewards: DecCoin; -} +}; diff --git a/ts-packages/types/src/types/rust/DelegationWithEverything.ts b/ts-packages/types/src/types/rust/DelegationWithEverything.ts index 7071f291dd..a37755f1a7 100644 --- a/ts-packages/types/src/types/rust/DelegationWithEverything.ts +++ b/ts-packages/types/src/types/rust/DelegationWithEverything.ts @@ -1,9 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; import type { DelegationEvent } from './DelegationEvent'; -import type { MixNodeCostParams } from './MixNodeCostParams'; +import type { NodeCostParams } from './MixNodeCostParams'; -export interface DelegationWithEverything { +export type DelegationWithEverything = { owner: string; mix_id: number; node_identity: string; @@ -12,12 +12,12 @@ export interface DelegationWithEverything { accumulated_by_operator: DecCoin | null; block_height: bigint; delegated_on_iso_datetime: string | null; - cost_params: MixNodeCostParams | null; + cost_params: NodeCostParams | null; avg_uptime_percent: number | null; stake_saturation: string | null; uses_vesting_contract_tokens: boolean; unclaimed_rewards: DecCoin | null; + errors: string | null; pending_events: Array; mixnode_is_unbonding: boolean | null; - errors: string | null; -} +}; diff --git a/ts-packages/types/src/types/rust/DescribedNodeType.ts b/ts-packages/types/src/types/rust/DescribedNodeType.ts new file mode 100644 index 0000000000..3cfc95f140 --- /dev/null +++ b/ts-packages/types/src/types/rust/DescribedNodeType.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type DescribedNodeType = 'legacy_mixnode' | 'legacy_gateway' | 'nym_node'; diff --git a/ts-packages/types/src/types/rust/Gas.ts b/ts-packages/types/src/types/rust/Gas.ts index 2b93e47509..0329a5df89 100644 --- a/ts-packages/types/src/types/rust/Gas.ts +++ b/ts-packages/types/src/types/rust/Gas.ts @@ -1,5 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface Gas { +export type Gas = { + /** + * units of gas used + */ gas_units: bigint; -} +}; diff --git a/ts-packages/types/src/types/rust/GasInfo.ts b/ts-packages/types/src/types/rust/GasInfo.ts index 3e34323018..4ee0a2431e 100644 --- a/ts-packages/types/src/types/rust/GasInfo.ts +++ b/ts-packages/types/src/types/rust/GasInfo.ts @@ -1,7 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Gas } from './Gas'; -export interface GasInfo { +export type GasInfo = { + /** + * GasWanted is the maximum units of work we allow this tx to perform. + */ gas_wanted: Gas; + /** + * GasUsed is the amount of gas actually consumed. + */ gas_used: Gas; -} +}; diff --git a/ts-packages/types/src/types/rust/Gateway.ts b/ts-packages/types/src/types/rust/Gateway.ts index 4c449b578d..3a9da4f7a7 100644 --- a/ts-packages/types/src/types/rust/Gateway.ts +++ b/ts-packages/types/src/types/rust/Gateway.ts @@ -1,11 +1,14 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface Gateway { +export type Gateway = { host: string; mix_port: number; clients_port: number; location: string; sphinx_key: string; + /** + * Base58 encoded ed25519 EdDSA public key of the gateway used to derive shared keys with clients + */ identity_key: string; version: string; -} +}; diff --git a/ts-packages/types/src/types/rust/GatewayBond.ts b/ts-packages/types/src/types/rust/GatewayBond.ts index 405c1cab92..a8f619b5b4 100644 --- a/ts-packages/types/src/types/rust/GatewayBond.ts +++ b/ts-packages/types/src/types/rust/GatewayBond.ts @@ -2,10 +2,10 @@ import type { DecCoin } from './DecCoin'; import type { Gateway } from './Gateway'; -export interface GatewayBond { +export type GatewayBond = { pledge_amount: DecCoin; owner: string; block_height: bigint; gateway: Gateway; proxy: string | null; -} +}; diff --git a/ts-packages/types/src/types/rust/GatewayConfigUpdate.ts b/ts-packages/types/src/types/rust/GatewayConfigUpdate.ts index acd40d4421..623a7fa638 100644 --- a/ts-packages/types/src/types/rust/GatewayConfigUpdate.ts +++ b/ts-packages/types/src/types/rust/GatewayConfigUpdate.ts @@ -1,9 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface GatewayConfigUpdate { +export type GatewayConfigUpdate = { host: string; mix_port: number; clients_port: number; location: string; version: string; -} +}; diff --git a/ts-packages/types/src/types/rust/GatewayCoreStatusResponse.ts b/ts-packages/types/src/types/rust/GatewayCoreStatusResponse.ts index 0316e2a889..57ff4032f5 100644 --- a/ts-packages/types/src/types/rust/GatewayCoreStatusResponse.ts +++ b/ts-packages/types/src/types/rust/GatewayCoreStatusResponse.ts @@ -1,6 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface GatewayCoreStatusResponse { - identity: string; - count: number; -} +export type GatewayCoreStatusResponse = { identity: string; count: number }; diff --git a/ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts b/ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts new file mode 100644 index 0000000000..9df1733a85 --- /dev/null +++ b/ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type HistoricalPerformanceResponse = { date: string; performance: number }; diff --git a/ts-packages/types/src/types/rust/HistoricalUptimeResponse.ts b/ts-packages/types/src/types/rust/HistoricalUptimeResponse.ts new file mode 100644 index 0000000000..7bd83ffeda --- /dev/null +++ b/ts-packages/types/src/types/rust/HistoricalUptimeResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type HistoricalUptimeResponse = { date: string; uptime: number }; diff --git a/ts-packages/types/src/types/rust/InclusionProbabilityResponse.ts b/ts-packages/types/src/types/rust/InclusionProbabilityResponse.ts index 3f80b794a0..09c97a0f6d 100644 --- a/ts-packages/types/src/types/rust/InclusionProbabilityResponse.ts +++ b/ts-packages/types/src/types/rust/InclusionProbabilityResponse.ts @@ -1,7 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { SelectionChance } from './SelectionChance'; -export interface InclusionProbabilityResponse { - in_active: SelectionChance; - in_reserve: SelectionChance; -} +export type InclusionProbabilityResponse = { in_active: SelectionChance; in_reserve: SelectionChance }; diff --git a/ts-packages/types/src/types/rust/Interval.ts b/ts-packages/types/src/types/rust/Interval.ts index a451f49de1..61863be4ca 100644 --- a/ts-packages/types/src/types/rust/Interval.ts +++ b/ts-packages/types/src/types/rust/Interval.ts @@ -1,10 +1,31 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface Interval { +/** + * Specification of a rewarding interval. + */ +export type Interval = { + /** + * Monotonously increasing id of this interval. + */ id: number; + /** + * Number of epochs in this interval. + */ epochs_in_interval: number; + /** + * The timestamp indicating the start of the current rewarding epoch. + */ current_epoch_start: string; + /** + * Monotonously increasing id of the current epoch in this interval. + */ current_epoch_id: number; + /** + * The duration of all epochs in this interval. + */ epoch_length: { secs: number; nanos: number }; + /** + * The total amount of elapsed epochs since the first epoch of the first interval. + */ total_elapsed_epochs: number; -} +}; diff --git a/ts-packages/types/src/types/rust/IntervalRewardParams.ts b/ts-packages/types/src/types/rust/IntervalRewardParams.ts index a32e967c6a..35984285e5 100644 --- a/ts-packages/types/src/types/rust/IntervalRewardParams.ts +++ b/ts-packages/types/src/types/rust/IntervalRewardParams.ts @@ -1,12 +1,52 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface IntervalRewardParams { +/** + * Parameters required by the mix-mining reward distribution that do not change during an interval. + */ +export type IntervalRewardParams = { + /** + * Current value of the rewarding pool. + * It is expected to be constant throughout the interval. + */ reward_pool: string; + /** + * Current value of the staking supply. + * It is expected to be constant throughout the interval. + */ staking_supply: string; + /** + * Defines the percentage of stake needed to reach saturation for all of the nodes in the rewarded set. + * Also known as `beta`. + */ staking_supply_scale_factor: string; + /** + * Current value of the computed reward budget per epoch, per node. + * It is expected to be constant throughout the interval. + */ epoch_reward_budget: string; + /** + * Current value of the stake saturation point. + * It is expected to be constant throughout the interval. + */ stake_saturation_point: string; + /** + * Current value of the sybil resistance percent (`alpha`). + * It is not really expected to be changing very often. + * As a matter of fact, unless there's a very specific reason, it should remain constant. + */ sybil_resistance: string; + /** + * Current active set work factor. + * It is not really expected to be changing very often. + * As a matter of fact, unless there's a very specific reason, it should remain constant. + */ active_set_work_factor: string; + /** + * Current maximum interval pool emission. + * Assuming all nodes in the rewarded set are fully saturated and have 100% performance, + * this % of the reward pool would get distributed in rewards to all operators and its delegators. + * It is not really expected to be changing very often. + * As a matter of fact, unless there's a very specific reason, it should remain constant. + */ interval_pool_emission: string; -} +}; diff --git a/ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts b/ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts index fffaa608d1..f3cc67df7c 100644 --- a/ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts +++ b/ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts @@ -1,11 +1,36 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { RewardedSetParams } from './RewardedSetParams'; -export interface IntervalRewardingParamsUpdate { +/** + * Specification on how the rewarding params should be updated. + */ +export type IntervalRewardingParamsUpdate = { + /** + * Defines the new value of the reward pool. + */ reward_pool: string | null; + /** + * Defines the new value of the staking supply. + */ staking_supply: string | null; + /** + * Defines the new value of the staking supply scale factor. + */ staking_supply_scale_factor: string | null; + /** + * Defines the new value of the sybil resistance percent. + */ sybil_resistance_percent: string | null; + /** + * Defines the new value of the active set work factor. + */ active_set_work_factor: string | null; + /** + * Defines the new value of the interval pool emission rate. + */ interval_pool_emission: string | null; - rewarded_set_size: number | null; -} + /** + * Defines the parameters of the rewarded set. + */ + rewarded_set_params: RewardedSetParams | null; +}; diff --git a/ts-packages/types/src/types/rust/MixNodeBond.ts b/ts-packages/types/src/types/rust/MixNodeBond.ts index 173ce9599d..3034b30398 100644 --- a/ts-packages/types/src/types/rust/MixNodeBond.ts +++ b/ts-packages/types/src/types/rust/MixNodeBond.ts @@ -2,13 +2,12 @@ import type { DecCoin } from './DecCoin'; import type { MixNode } from './Mixnode'; -export interface MixNodeBond { +export type MixNodeBond = { mix_id: number; owner: string; original_pledge: DecCoin; - layer: string; mix_node: MixNode; proxy: string | null; bonding_height: bigint; is_unbonding: boolean; -} +}; diff --git a/ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts b/ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts index 7a88608543..60cef5816f 100644 --- a/ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts +++ b/ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts @@ -1,9 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface MixNodeConfigUpdate { +export type MixNodeConfigUpdate = { host: string; mix_port: number; verloc_port: number; http_api_port: number; version: string; -} +}; diff --git a/ts-packages/types/src/types/rust/MixNodeCostParams.ts b/ts-packages/types/src/types/rust/MixNodeCostParams.ts index fac1462984..4c65d08efc 100644 --- a/ts-packages/types/src/types/rust/MixNodeCostParams.ts +++ b/ts-packages/types/src/types/rust/MixNodeCostParams.ts @@ -1,7 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; -export interface MixNodeCostParams { - profit_margin_percent: string; - interval_operating_cost: DecCoin; -} +export type NodeCostParams = { profit_margin_percent: string; interval_operating_cost: DecCoin }; diff --git a/ts-packages/types/src/types/rust/MixNodeDetails.ts b/ts-packages/types/src/types/rust/MixNodeDetails.ts index 2e06ebf61f..81d0f1dbe9 100644 --- a/ts-packages/types/src/types/rust/MixNodeDetails.ts +++ b/ts-packages/types/src/types/rust/MixNodeDetails.ts @@ -1,8 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { MixNodeBond } from './MixNodeBond'; -import type { MixNodeRewarding } from './MixNodeRewarding'; +import type { NodeRewarding } from './NodeRewarding'; -export interface MixNodeDetails { - bond_information: MixNodeBond; - rewarding_details: MixNodeRewarding; -} +export type MixNodeDetails = { bond_information: MixNodeBond; rewarding_details: NodeRewarding }; diff --git a/ts-packages/types/src/types/rust/Mixnode.ts b/ts-packages/types/src/types/rust/Mixnode.ts index 8dddce4eb2..2456af17ab 100644 --- a/ts-packages/types/src/types/rust/Mixnode.ts +++ b/ts-packages/types/src/types/rust/Mixnode.ts @@ -1,11 +1,35 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface MixNode { +/** + * Information provided by the node operator during bonding that are used to allow other entities to use the services of this node. + */ +export type MixNode = { + /** + * Network address of this mixnode, for example 1.1.1.1 or foo.mixnode.com + */ host: string; + /** + * Port used by this mixnode for listening for mix packets. + */ mix_port: number; + /** + * Port used by this mixnode for listening for verloc requests. + */ verloc_port: number; + /** + * Port used by this mixnode for its http(s) API + */ http_api_port: number; + /** + * Base58-encoded x25519 public key used for sphinx key derivation. + */ sphinx_key: string; + /** + * Base58-encoded ed25519 EdDSA public key. + */ identity_key: string; + /** + * The self-reported semver version of this mixnode. + */ version: string; -} +}; diff --git a/ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.ts b/ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.ts index d5fb3fbcbb..c49b713e97 100644 --- a/ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.ts +++ b/ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.ts @@ -1,6 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface MixnodeCoreStatusResponse { - mix_id: number; - count: number; -} +export type MixnodeCoreStatusResponse = { mix_id: number; count: number }; diff --git a/ts-packages/types/src/types/rust/MixnodeStatusResponse.ts b/ts-packages/types/src/types/rust/MixnodeStatusResponse.ts index 2dd6bb6f54..7d680a2f32 100644 --- a/ts-packages/types/src/types/rust/MixnodeStatusResponse.ts +++ b/ts-packages/types/src/types/rust/MixnodeStatusResponse.ts @@ -1,6 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { MixnodeStatus } from './MixnodeStatus'; -export interface MixnodeStatusResponse { - status: MixnodeStatus; -} +export type MixnodeStatusResponse = { status: MixnodeStatus }; diff --git a/ts-packages/types/src/types/rust/NodeAnnotation.ts b/ts-packages/types/src/types/rust/NodeAnnotation.ts new file mode 100644 index 0000000000..28d5e5cfca --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeAnnotation.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Role } from './Role'; + +export type NodeAnnotation = { last_24h_performance: string; current_role: Role | null }; diff --git a/ts-packages/types/src/types/rust/NodeConfigUpdate.ts b/ts-packages/types/src/types/rust/NodeConfigUpdate.ts new file mode 100644 index 0000000000..bb512a7fde --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeConfigUpdate.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type NodeConfigUpdate = { + host: string | null; + custom_http_port: number | null; + restore_default_http_port: boolean; +}; diff --git a/ts-packages/types/src/types/rust/NodeDatePerformanceResponse.ts b/ts-packages/types/src/types/rust/NodeDatePerformanceResponse.ts new file mode 100644 index 0000000000..12c85fe364 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeDatePerformanceResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type NodeDatePerformanceResponse = { node_id: number; date: string; performance: number | null }; diff --git a/ts-packages/types/src/types/rust/NodePerformanceResponse.ts b/ts-packages/types/src/types/rust/NodePerformanceResponse.ts new file mode 100644 index 0000000000..37ee3c165d --- /dev/null +++ b/ts-packages/types/src/types/rust/NodePerformanceResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type NodePerformanceResponse = { node_id: number; performance: number | null }; diff --git a/ts-packages/types/src/types/rust/NodeRewarding.ts b/ts-packages/types/src/types/rust/NodeRewarding.ts index 3fa37c30bd..fd3273c8c2 100644 --- a/ts-packages/types/src/types/rust/NodeRewarding.ts +++ b/ts-packages/types/src/types/rust/NodeRewarding.ts @@ -1,4 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { NodeCostParams } from "./MixNodeCostParams"; +import type { NodeCostParams } from './MixNodeCostParams'; -export interface NodeRewarding { cost_params: NodeCostParams, operator: string, delegates: string, total_unit_reward: string, unit_delegation: string, last_rewarded_epoch: number, unique_delegations: number, } \ No newline at end of file +export type NodeRewarding = { + cost_params: NodeCostParams; + operator: string; + delegates: string; + total_unit_reward: string; + unit_delegation: string; + last_rewarded_epoch: number; + unique_delegations: number; +}; diff --git a/ts-packages/types/src/types/rust/NodeRewardingParameters.ts b/ts-packages/types/src/types/rust/NodeRewardingParameters.ts new file mode 100644 index 0000000000..25dff5a2a6 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeRewardingParameters.ts @@ -0,0 +1,16 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Parameters used for rewarding particular node. + */ +export type NodeRewardingParameters = { + /** + * Performance of the particular node in the current epoch. + */ + performance: string; + /** + * Amount of work performed by this node in the current epoch + * also known as 'omega' in the paper + */ + work_factor: string; +}; diff --git a/ts-packages/types/src/types/rust/NymNode.ts b/ts-packages/types/src/types/rust/NymNode.ts index 78bddc8007..4836322136 100644 --- a/ts-packages/types/src/types/rust/NymNode.ts +++ b/ts-packages/types/src/types/rust/NymNode.ts @@ -1,3 +1,21 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface NymNode { host: string, custom_http_port: number | null, identity_key: string, } \ No newline at end of file +/** + * Information provided by the node operator during bonding that are used to allow other entities to use the services of this node. + */ +export type NymNode = { + /** + * Network address of this nym-node, for example 1.1.1.1 or foo.mixnode.com + * that is used to discover other capabilities of this node. + */ + host: string; + /** + * Allow specifying custom port for accessing the http, and thus self-described, api + * of this node for the capabilities discovery. + */ + custom_http_port: number | null; + /** + * Base58-encoded ed25519 EdDSA public key. + */ + identity_key: string; +}; diff --git a/ts-packages/types/src/types/rust/NymNodeBond.ts b/ts-packages/types/src/types/rust/NymNodeBond.ts index b8f608f2c7..545c674c55 100644 --- a/ts-packages/types/src/types/rust/NymNodeBond.ts +++ b/ts-packages/types/src/types/rust/NymNodeBond.ts @@ -1,4 +1,40 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DecCoin } from "./DecCoin"; +import type { DecCoin } from './DecCoin'; -export interface NymNodeBond { node_id: number, owner: string, original_pledge: DecCoin, bonding_height: bigint, is_unbonding: boolean, host: string, custom_http_port: number | null, identity_key: string, } \ No newline at end of file +export type NymNodeBond = { + /** + * Unique id assigned to the bonded node. + */ + node_id: number; + /** + * Address of the owner of this nym-node. + */ + owner: string; + /** + * Original amount pledged by the operator of this node. + */ + original_pledge: DecCoin; + /** + * Block height at which this nym-node has been bonded. + */ + bonding_height: bigint; + /** + * Flag to indicate whether this node is in the process of unbonding, + * that will conclude upon the epoch finishing. + */ + is_unbonding: boolean; + /** + * Network address of this nym-node, for example 1.1.1.1 or foo.mixnode.com + * that is used to discover other capabilities of this node. + */ + host: string; + /** + * Allow specifying custom port for accessing the http, and thus self-described, api + * of this node for the capabilities discovery. + */ + custom_http_port: number | null; + /** + * Base58-encoded ed25519 EdDSA public key. + */ + identity_key: string; +}; diff --git a/ts-packages/types/src/types/rust/NymNodeDetails.ts b/ts-packages/types/src/types/rust/NymNodeDetails.ts index 7b6c0b5f2a..5bebd8492e 100644 --- a/ts-packages/types/src/types/rust/NymNodeDetails.ts +++ b/ts-packages/types/src/types/rust/NymNodeDetails.ts @@ -1,6 +1,22 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { NodeRewarding } from "./NodeRewarding"; -import type { NymNodeBond } from "./NymNodeBond"; -import type { PendingNodeChanges } from "./PendingNodeChanges"; +import type { NodeRewarding } from './NodeRewarding'; +import type { NymNodeBond } from './NymNodeBond'; +import type { PendingNodeChanges } from './PendingNodeChanges'; -export interface NymNodeDetails { bond_information: NymNodeBond, rewarding_details: NodeRewarding, pending_changes: PendingNodeChanges, } \ No newline at end of file +/** + * Full details associated with given node. + */ +export type NymNodeDetails = { + /** + * Basic bond information of this node, such as owner address, original pledge, etc. + */ + bond_information: NymNodeBond; + /** + * Details used for computation of rewarding related data. + */ + rewarding_details: NodeRewarding; + /** + * Adjustments to the node that are scheduled to happen during future epoch/interval transitions. + */ + pending_changes: PendingNodeChanges; +}; diff --git a/ts-packages/types/src/types/rust/OriginalVestingResponse.ts b/ts-packages/types/src/types/rust/OriginalVestingResponse.ts index ea10cd24af..ffd03fe975 100644 --- a/ts-packages/types/src/types/rust/OriginalVestingResponse.ts +++ b/ts-packages/types/src/types/rust/OriginalVestingResponse.ts @@ -1,8 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; -export interface OriginalVestingResponse { - amount: DecCoin; - number_of_periods: number; - period_duration: bigint; -} +export type OriginalVestingResponse = { amount: DecCoin; number_of_periods: number; period_duration: bigint }; diff --git a/ts-packages/types/src/types/rust/PaginatedResponse.ts b/ts-packages/types/src/types/rust/PaginatedResponse.ts new file mode 100644 index 0000000000..7b64cdbb4d --- /dev/null +++ b/ts-packages/types/src/types/rust/PaginatedResponse.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Pagination } from './Pagination'; + +export type PaginatedResponse = { pagination: Pagination; data: Array }; diff --git a/ts-packages/types/src/types/rust/Pagination.ts b/ts-packages/types/src/types/rust/Pagination.ts new file mode 100644 index 0000000000..963ec90ae2 --- /dev/null +++ b/ts-packages/types/src/types/rust/Pagination.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Pagination = { total: number; page: number; size: number }; diff --git a/ts-packages/types/src/types/rust/PendingEpochEvent.ts b/ts-packages/types/src/types/rust/PendingEpochEvent.ts index 814934b75b..8b937f2164 100644 --- a/ts-packages/types/src/types/rust/PendingEpochEvent.ts +++ b/ts-packages/types/src/types/rust/PendingEpochEvent.ts @@ -1,8 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PendingEpochEventData } from './PendingEpochEventData'; -export interface PendingEpochEvent { - id: number; - created_at: bigint; - event: PendingEpochEventData; -} +export type PendingEpochEvent = { id: number; created_at: bigint; event: PendingEpochEventData }; diff --git a/ts-packages/types/src/types/rust/PendingEpochEventData.ts b/ts-packages/types/src/types/rust/PendingEpochEventData.ts index 0b66138efc..9fc3c9da4c 100644 --- a/ts-packages/types/src/types/rust/PendingEpochEventData.ts +++ b/ts-packages/types/src/types/rust/PendingEpochEventData.ts @@ -5,5 +5,6 @@ export type PendingEpochEventData = | { Delegate: { owner: string; mix_id: number; amount: DecCoin; proxy: string | null } } | { Undelegate: { owner: string; mix_id: number; proxy: string | null } } | { PledgeMore: { mix_id: number; amount: DecCoin } } + | { DecreasePledge: { mix_id: number; decrease_by: DecCoin } } | { UnbondMixnode: { mix_id: number } } | { UpdateActiveSetSize: { new_size: number } }; diff --git a/ts-packages/types/src/types/rust/PendingIntervalEvent.ts b/ts-packages/types/src/types/rust/PendingIntervalEvent.ts index e5249be23d..db0abeae02 100644 --- a/ts-packages/types/src/types/rust/PendingIntervalEvent.ts +++ b/ts-packages/types/src/types/rust/PendingIntervalEvent.ts @@ -1,8 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PendingIntervalEventData } from './PendingIntervalEventData'; -export interface PendingIntervalEvent { - id: number; - created_at: bigint; - event: PendingIntervalEventData; -} +export type PendingIntervalEvent = { id: number; created_at: bigint; event: PendingIntervalEventData }; diff --git a/ts-packages/types/src/types/rust/PendingIntervalEventData.ts b/ts-packages/types/src/types/rust/PendingIntervalEventData.ts index 152ae9fda6..ccde6b5c23 100644 --- a/ts-packages/types/src/types/rust/PendingIntervalEventData.ts +++ b/ts-packages/types/src/types/rust/PendingIntervalEventData.ts @@ -1,8 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { IntervalRewardingParamsUpdate } from './IntervalRewardingParamsUpdate'; -import type { MixNodeCostParams } from './MixNodeCostParams'; +import type { NodeCostParams } from './MixNodeCostParams'; export type PendingIntervalEventData = - | { ChangeMixCostParams: { mix_id: number; new_costs: MixNodeCostParams } } + | { ChangeMixCostParams: { mix_id: number; new_costs: NodeCostParams } } | { UpdateRewardingParams: { update: IntervalRewardingParamsUpdate } } | { UpdateIntervalConfig: { epochs_in_interval: number; epoch_duration_secs: bigint } }; diff --git a/ts-packages/types/src/types/rust/PendingNodeChanges.ts b/ts-packages/types/src/types/rust/PendingNodeChanges.ts index 3018f1e041..1dd646ccbd 100644 --- a/ts-packages/types/src/types/rust/PendingNodeChanges.ts +++ b/ts-packages/types/src/types/rust/PendingNodeChanges.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface PendingNodeChanges { pledge_change: number | null, cost_params_change: number | null, } \ No newline at end of file +export type PendingNodeChanges = { pledge_change: number | null; cost_params_change: number | null }; diff --git a/ts-packages/types/src/types/rust/PerformanceHistoryResponse.ts b/ts-packages/types/src/types/rust/PerformanceHistoryResponse.ts new file mode 100644 index 0000000000..63f5a3bbc1 --- /dev/null +++ b/ts-packages/types/src/types/rust/PerformanceHistoryResponse.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { HistoricalPerformanceResponse } from './HistoricalPerformanceResponse'; +import type { PaginatedResponse } from './PaginatedResponse'; + +export type PerformanceHistoryResponse = { node_id: number; history: PaginatedResponse }; diff --git a/ts-packages/types/src/types/rust/Period.ts b/ts-packages/types/src/types/rust/Period.ts index 2e0a752ee7..40ccf4f9cc 100644 --- a/ts-packages/types/src/types/rust/Period.ts +++ b/ts-packages/types/src/types/rust/Period.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Period = 'Before' | { in: number } | 'After'; +/** + * The vesting period. + */ +export type Period = 'Before' | { In: number } | 'After'; diff --git a/ts-packages/types/src/types/rust/PledgeData.ts b/ts-packages/types/src/types/rust/PledgeData.ts index 76adc23018..20fd4fd314 100644 --- a/ts-packages/types/src/types/rust/PledgeData.ts +++ b/ts-packages/types/src/types/rust/PledgeData.ts @@ -1,7 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; -export interface PledgeData { - amount: DecCoin; - block_time: bigint; -} +export type PledgeData = { amount: DecCoin; block_time: bigint }; diff --git a/ts-packages/types/src/types/rust/RewardEstimate.ts b/ts-packages/types/src/types/rust/RewardEstimate.ts index 9649b88981..31723c2e99 100644 --- a/ts-packages/types/src/types/rust/RewardEstimate.ts +++ b/ts-packages/types/src/types/rust/RewardEstimate.ts @@ -1,8 +1,21 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface RewardEstimate { +export type RewardEstimate = { + /** + * The amount of **decimal** coins that are going to get distributed to the node, + * i.e. the operator and all its delegators. + */ total_node_reward: string; + /** + * The share of the reward that is going to get distributed to the node operator. + */ operator: string; + /** + * The share of the reward that is going to get distributed among the node delegators. + */ delegates: string; + /** + * The operating cost of this node. Note: it's already included in the operator reward. + */ operating_cost: string; -} +}; diff --git a/ts-packages/types/src/types/rust/RewardEstimationResponse.ts b/ts-packages/types/src/types/rust/RewardEstimationResponse.ts index e92f0807ab..ec328194ec 100644 --- a/ts-packages/types/src/types/rust/RewardEstimationResponse.ts +++ b/ts-packages/types/src/types/rust/RewardEstimationResponse.ts @@ -3,9 +3,9 @@ import type { Interval } from './Interval'; import type { RewardEstimate } from './RewardEstimate'; import type { RewardingParams } from './RewardingParams'; -export interface RewardEstimationResponse { +export type RewardEstimationResponse = { estimation: RewardEstimate; reward_params: RewardingParams; epoch: Interval; as_at: number; -} +}; diff --git a/ts-packages/types/src/types/rust/RewardedSetParams.ts b/ts-packages/types/src/types/rust/RewardedSetParams.ts new file mode 100644 index 0000000000..61ba4ccfb6 --- /dev/null +++ b/ts-packages/types/src/types/rust/RewardedSetParams.ts @@ -0,0 +1,20 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type RewardedSetParams = { + /** + * The expected number of nodes assigned entry gateway role (i.e. [`Role::EntryGateway`]) + */ + entry_gateways: number; + /** + * The expected number of nodes assigned exit gateway role (i.e. [`Role::ExitGateway`]) + */ + exit_gateways: number; + /** + * The expected number of nodes assigned the 'mixnode' role, i.e. total of [`Role::Layer1`], [`Role::Layer2`] and [`Role::Layer3`]. + */ + mixnodes: number; + /** + * Number of nodes in the 'standby' set. (i.e. [`Role::Standby`]) + */ + standby: number; +}; diff --git a/ts-packages/types/src/types/rust/RewardingParams.ts b/ts-packages/types/src/types/rust/RewardingParams.ts index f00766eec4..25dd44778e 100644 --- a/ts-packages/types/src/types/rust/RewardingParams.ts +++ b/ts-packages/types/src/types/rust/RewardingParams.ts @@ -1,8 +1,14 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { IntervalRewardParams } from './IntervalRewardParams'; +import type { RewardedSetParams } from './RewardedSetParams'; -export interface RewardingParams { +/** + * Parameters used for reward calculation. + */ +export type RewardingParams = { + /** + * Parameters that should remain unchanged throughout an interval. + */ interval: IntervalRewardParams; - rewarded_set_size: number; - active_set_size: number; -} + rewarded_set: RewardedSetParams; +}; diff --git a/ts-packages/types/src/types/rust/Role.ts b/ts-packages/types/src/types/rust/Role.ts new file mode 100644 index 0000000000..9e96a76120 --- /dev/null +++ b/ts-packages/types/src/types/rust/Role.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Role = 'EntryGateway' | 'Layer1' | 'Layer2' | 'Layer3' | 'ExitGateway' | 'Standby'; diff --git a/ts-packages/types/src/types/rust/RpcTransactionResponse.ts b/ts-packages/types/src/types/rust/RpcTransactionResponse.ts index 2f9c3bdc8a..e9711bf47f 100644 --- a/ts-packages/types/src/types/rust/RpcTransactionResponse.ts +++ b/ts-packages/types/src/types/rust/RpcTransactionResponse.ts @@ -2,7 +2,7 @@ import type { DecCoin } from './DecCoin'; import type { Gas } from './Gas'; -export interface RpcTransactionResponse { +export type RpcTransactionResponse = { index: number; tx_result_json: string; block_height: bigint; @@ -10,4 +10,4 @@ export interface RpcTransactionResponse { gas_used: Gas; gas_wanted: Gas; fee: DecCoin | null; -} +}; diff --git a/ts-packages/types/src/types/rust/SendTxResult.ts b/ts-packages/types/src/types/rust/SendTxResult.ts index 02fb0b5b0c..15481d175a 100644 --- a/ts-packages/types/src/types/rust/SendTxResult.ts +++ b/ts-packages/types/src/types/rust/SendTxResult.ts @@ -3,7 +3,7 @@ import type { DecCoin } from './DecCoin'; import type { Gas } from './Gas'; import type { TransactionDetails } from './TransactionDetails'; -export interface SendTxResult { +export type SendTxResult = { block_height: bigint; code: number; details: TransactionDetails; @@ -11,4 +11,4 @@ export interface SendTxResult { gas_wanted: Gas; tx_hash: string; fee: DecCoin | null; -} +}; diff --git a/ts-packages/types/src/types/rust/StakeSaturationResponse.ts b/ts-packages/types/src/types/rust/StakeSaturationResponse.ts index 6be2ae0e0e..c5ef3d705e 100644 --- a/ts-packages/types/src/types/rust/StakeSaturationResponse.ts +++ b/ts-packages/types/src/types/rust/StakeSaturationResponse.ts @@ -1,7 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface StakeSaturationResponse { - saturation: string; - uncapped_saturation: string; - as_at: bigint; -} +export type StakeSaturationResponse = { saturation: string; uncapped_saturation: string; as_at: bigint }; diff --git a/ts-packages/types/src/types/rust/TransactionDetails.ts b/ts-packages/types/src/types/rust/TransactionDetails.ts index 043db71473..3ad842a513 100644 --- a/ts-packages/types/src/types/rust/TransactionDetails.ts +++ b/ts-packages/types/src/types/rust/TransactionDetails.ts @@ -1,8 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DecCoin } from './DecCoin'; -export interface TransactionDetails { - amount: DecCoin; - from_address: string; - to_address: string; -} +export type TransactionDetails = { amount: DecCoin; from_address: string; to_address: string }; diff --git a/ts-packages/types/src/types/rust/TransactionExecuteResult.ts b/ts-packages/types/src/types/rust/TransactionExecuteResult.ts index ce06484dd1..d2595e5848 100644 --- a/ts-packages/types/src/types/rust/TransactionExecuteResult.ts +++ b/ts-packages/types/src/types/rust/TransactionExecuteResult.ts @@ -2,10 +2,10 @@ import type { DecCoin } from './DecCoin'; import type { GasInfo } from './GasInfo'; -export interface TransactionExecuteResult { +export type TransactionExecuteResult = { logs_json: string; - data_json: string; + msg_responses_json: string; transaction_hash: string; gas_info: GasInfo; fee: DecCoin | null; -} +}; diff --git a/ts-packages/types/src/types/rust/UnbondedMixnode.ts b/ts-packages/types/src/types/rust/UnbondedMixnode.ts index 88fe0e3982..c213f6d461 100644 --- a/ts-packages/types/src/types/rust/UnbondedMixnode.ts +++ b/ts-packages/types/src/types/rust/UnbondedMixnode.ts @@ -1,8 +1,24 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface UnbondedMixnode { +/** + * Basic information of a node that used to be part of the mix network but has already unbonded. + */ +export type UnbondedMixnode = { + /** + * Base58-encoded ed25519 EdDSA public key. + */ identity_key: string; + /** + * Address of the owner of this mixnode. + */ owner: string; + /** + * Entity who bonded this mixnode on behalf of the owner. + * If exists, it's most likely the address of the vesting contract. + */ proxy: string | null; + /** + * Block height at which this mixnode has unbonded. + */ unbonding_height: number; -} +}; diff --git a/ts-packages/types/src/types/rust/UptimeHistoryResponse.ts b/ts-packages/types/src/types/rust/UptimeHistoryResponse.ts new file mode 100644 index 0000000000..cdcbc0e14c --- /dev/null +++ b/ts-packages/types/src/types/rust/UptimeHistoryResponse.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { HistoricalUptimeResponse } from './HistoricalUptimeResponse'; +import type { PaginatedResponse } from './PaginatedResponse'; + +export type UptimeHistoryResponse = { node_id: number; history: PaginatedResponse }; diff --git a/ts-packages/types/src/types/rust/VestingAccountInfo.ts b/ts-packages/types/src/types/rust/VestingAccountInfo.ts index 538e941edb..6d09f24caf 100644 --- a/ts-packages/types/src/types/rust/VestingAccountInfo.ts +++ b/ts-packages/types/src/types/rust/VestingAccountInfo.ts @@ -2,10 +2,10 @@ import type { DecCoin } from './DecCoin'; import type { VestingPeriod } from './VestingPeriod'; -export interface VestingAccountInfo { +export type VestingAccountInfo = { owner_address: string; staking_address: string | null; start_time: bigint; periods: Array; amount: DecCoin; -} +}; diff --git a/ts-packages/types/src/types/rust/VestingPeriod.ts b/ts-packages/types/src/types/rust/VestingPeriod.ts index dae6901c10..5125eab75b 100644 --- a/ts-packages/types/src/types/rust/VestingPeriod.ts +++ b/ts-packages/types/src/types/rust/VestingPeriod.ts @@ -1,6 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface VestingPeriod { - start_time: bigint; - period_seconds: bigint; -} +export type VestingPeriod = { start_time: bigint; period_seconds: bigint }; diff --git a/ts-packages/types/src/types/rust/WrappedDelegationEvent.ts b/ts-packages/types/src/types/rust/WrappedDelegationEvent.ts index b0a5e80ab4..4e710530fb 100644 --- a/ts-packages/types/src/types/rust/WrappedDelegationEvent.ts +++ b/ts-packages/types/src/types/rust/WrappedDelegationEvent.ts @@ -1,7 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DelegationEvent } from './DelegationEvent'; -export interface WrappedDelegationEvent { - event: DelegationEvent; - node_identity: string; -} +export type WrappedDelegationEvent = { event: DelegationEvent; node_identity: string };