diff --git a/Cargo.lock b/Cargo.lock index a47cde13f2..0c08e2b43b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7709,6 +7709,7 @@ dependencies = [ "schemars 0.8.22", "serde", "thiserror 2.0.18", + "ts-rs", ] [[package]] @@ -13090,6 +13091,7 @@ dependencies = [ "anyhow", "nym-api-requests", "nym-mixnet-contract-common", + "nym-node-families-contract-common", "nym-types", "nym-validator-client", "nym-vesting-contract-common", diff --git a/common/cosmwasm-smart-contracts/node-families-contract/Cargo.toml b/common/cosmwasm-smart-contracts/node-families-contract/Cargo.toml index 6a1fc4c1dc..56eb25e705 100644 --- a/common/cosmwasm-smart-contracts/node-families-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/node-families-contract/Cargo.toml @@ -24,9 +24,11 @@ cw-utils = { workspace = true } nym-contracts-common = { workspace = true } nym-mixnet-contract-common = { workspace = true } +ts-rs = { workspace = true, optional = true } [features] schema = [] +generate-ts = ['ts-rs'] [lints] workspace = true diff --git a/common/cosmwasm-smart-contracts/node-families-contract/src/types.rs b/common/cosmwasm-smart-contracts/node-families-contract/src/types.rs index 439e237703..c4e1fa197e 100644 --- a/common/cosmwasm-smart-contracts/node-families-contract/src/types.rs +++ b/common/cosmwasm-smart-contracts/node-families-contract/src/types.rs @@ -13,8 +13,21 @@ pub type NodeFamilyId = u32; /// Runtime configuration of the node families contract. #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/FamilyConfig.ts", + rename = "FamilyConfig" + ) +)] pub struct Config { /// Fee charged on each successful `create_family` execution. + #[cfg_attr( + feature = "generate-ts", + ts(type = "{ denom: string, amount: string }") + )] pub create_family_fee: Coin, /// Maximum allowed length, in characters, of a family name. @@ -26,11 +39,17 @@ pub struct Config { /// Default lifetime, in seconds, used by `invite_to_family` when the /// sender doesn't supply an explicit value. Senders may override this /// per-invitation via the optional `validity_secs` argument. + #[cfg_attr(feature = "generate-ts", ts(type = "number"))] pub default_invitation_validity_secs: u64, } /// On-chain representation of a node family. #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts(export, export_to = "ts-packages/types/src/types/rust/NodeFamily.ts") +)] pub struct NodeFamily { /// The id of the node family pub id: NodeFamilyId, @@ -45,17 +64,24 @@ pub struct NodeFamily { pub description: String, /// The owner of the node family + #[cfg_attr(feature = "generate-ts", ts(type = "string"))] pub owner: Addr, /// Records the fee paid when the family was created, /// so that the appropriate amount could be returned upon it getting disbanded. + #[cfg_attr( + feature = "generate-ts", + ts(type = "{ denom: string, amount: string }") + )] pub paid_fee: Coin, /// Memoized value of the current number of members in the node family /// Used to detect if the family is empty + #[cfg_attr(feature = "generate-ts", ts(type = "number"))] pub members: u64, /// Timestamp of the creation of the node family + #[cfg_attr(feature = "generate-ts", ts(type = "number"))] pub created_at: u64, } @@ -68,6 +94,14 @@ pub struct NodeFamily { /// issues a fresh invitation for the same node, which archives the stale one as /// `Expired` and supersedes it. #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/FamilyInvitation.ts" + ) +)] pub struct FamilyInvitation { /// The family that issued the invitation. pub family_id: NodeFamilyId, @@ -76,6 +110,7 @@ pub struct FamilyInvitation { pub node_id: NodeId, /// Block timestamp (unix seconds) after which the invitation is no longer valid. + #[cfg_attr(feature = "generate-ts", ts(type = "number"))] pub expires_at: u64, } @@ -85,18 +120,35 @@ pub struct FamilyInvitation { /// `NodeId` alone — `family_id` is carried in the value to support reverse /// lookups (all nodes in a given family) via a secondary index. #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/FamilyMembership.ts" + ) +)] pub struct FamilyMembership { /// The family the node is currently a member of. pub family_id: NodeFamilyId, /// Block timestamp (unix seconds) at which the node accepted its /// invitation and joined the family. + #[cfg_attr(feature = "generate-ts", ts(type = "number"))] pub joined_at: u64, } /// Historical record of a node that used to be part of a family but has since been /// removed (kicked, left voluntarily, or because the family was disbanded). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PastFamilyMember.ts" + ) +)] pub struct PastFamilyMember { /// The family the node used to belong to. pub family_id: NodeFamilyId, @@ -105,6 +157,7 @@ pub struct PastFamilyMember { pub node_id: NodeId, /// Block timestamp (unix seconds) at which the membership was terminated. + #[cfg_attr(feature = "generate-ts", ts(type = "number"))] pub removed_at: u64, } @@ -115,6 +168,14 @@ pub struct PastFamilyMember { /// reaches `Expired` if the family issues a fresh invitation for the same node, which /// supersedes and archives the stale one. #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/FamilyInvitationStatus.ts" + ) +)] pub enum FamilyInvitationStatus { /// Still awaiting a response. Recorded with a timestamp for completeness even /// though pending invitations live in a separate map. @@ -137,6 +198,14 @@ pub enum FamilyInvitationStatus { /// archived here only when a fresh invitation for the same node supersedes it /// (status `Expired`); otherwise it stays in the pending map until explicitly cleared. #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PastFamilyInvitation.ts" + ) +)] pub struct PastFamilyInvitation { /// The original invitation as it was issued. pub invitation: FamilyInvitation, @@ -147,6 +216,14 @@ pub struct PastFamilyInvitation { /// Response to [`QueryMsg::GetFamilyById`](crate::QueryMsg::GetFamilyById). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeFamilyResponse.ts" + ) +)] pub struct NodeFamilyResponse { /// The id that was queried, echoed back so paginated callers can correlate. pub family_id: NodeFamilyId, @@ -157,9 +234,18 @@ pub struct NodeFamilyResponse { /// Response to [`QueryMsg::GetFamilyByOwner`](crate::QueryMsg::GetFamilyByOwner). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeFamilyByOwnerResponse.ts" + ) +)] pub struct NodeFamilyByOwnerResponse { /// The (validated) owner address that was queried, echoed back so callers /// can correlate. + #[cfg_attr(feature = "generate-ts", ts(type = "string"))] pub owner: Addr, /// The matching family, or `None` if `owner` does not currently own one. @@ -178,6 +264,14 @@ pub struct NodeFamilyByNameResponse { /// Response to [`QueryMsg::GetFamilyMembership`](crate::QueryMsg::GetFamilyMembership). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/NodeFamilyMembershipResponse.ts" + ) +)] pub struct NodeFamilyMembershipResponse { /// The node that was queried. pub node_id: NodeId, @@ -190,6 +284,14 @@ pub struct NodeFamilyMembershipResponse { /// A pending [`FamilyInvitation`] paired with whether it has already timed /// out at the time the query was served. #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingFamilyInvitationDetails.ts" + ) +)] pub struct PendingFamilyInvitationDetails { /// The stored invitation as it was issued. pub invitation: FamilyInvitation, @@ -201,6 +303,14 @@ pub struct PendingFamilyInvitationDetails { /// Response to [`QueryMsg::GetPendingInvitation`](crate::QueryMsg::GetPendingInvitation). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingFamilyInvitationResponse.ts" + ) +)] pub struct PendingFamilyInvitationResponse { /// The family component of the queried `(family_id, node_id)` key. pub family_id: NodeFamilyId, @@ -216,6 +326,14 @@ pub struct PendingFamilyInvitationResponse { /// One entry in a [`FamilyMembersPagedResponse`] page — pairs a node id with /// its [`FamilyMembership`] record (notably its `joined_at` timestamp). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/FamilyMemberRecord.ts" + ) +)] pub struct FamilyMemberRecord { /// The node currently in the family. pub node_id: NodeId, @@ -226,6 +344,14 @@ pub struct FamilyMemberRecord { /// Response to [`QueryMsg::GetFamilyMembersPaged`](crate::QueryMsg::GetFamilyMembersPaged). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/FamilyMembersPagedResponse.ts" + ) +)] pub struct FamilyMembersPagedResponse { /// The family whose members were queried, echoed back so paginated /// callers can correlate. @@ -253,6 +379,14 @@ pub struct AllFamilyMembersPagedResponse { /// Response to [`QueryMsg::GetPendingInvitationsForFamilyPaged`](crate::QueryMsg::GetPendingInvitationsForFamilyPaged). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingFamilyInvitationsPagedResponse.ts" + ) +)] pub struct PendingFamilyInvitationsPagedResponse { /// The family whose pending invitations were queried, echoed back so /// paginated callers can correlate. @@ -270,6 +404,14 @@ pub struct PendingFamilyInvitationsPagedResponse { /// Response to [`QueryMsg::GetPendingInvitationsForNodePaged`](crate::QueryMsg::GetPendingInvitationsForNodePaged). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PendingInvitationsForNodePagedResponse.ts" + ) +)] pub struct PendingInvitationsForNodePagedResponse { /// The node whose pending invitations were queried, echoed back so /// paginated callers can correlate. @@ -316,6 +458,14 @@ pub type GlobalPastFamilyInvitationCursor = ((NodeFamilyId, NodeId), u64); /// Response to [`QueryMsg::GetPastInvitationsForFamilyPaged`](crate::QueryMsg::GetPastInvitationsForFamilyPaged). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PastFamilyInvitationsPagedResponse.ts" + ) +)] pub struct PastFamilyInvitationsPagedResponse { /// The family whose archived invitations were queried, echoed back so /// paginated callers can correlate. @@ -327,6 +477,7 @@ pub struct PastFamilyInvitationsPagedResponse { /// Cursor to pass as `start_after` on the next call, or `None` if this /// page is empty (treat as end-of-list). + #[cfg_attr(feature = "generate-ts", ts(type = "[number, number] | null"))] pub start_next_after: Option, } @@ -371,6 +522,14 @@ pub type PastFamilyMemberForNodeCursor = (NodeFamilyId, u64); /// Response to [`QueryMsg::GetPastMembersForFamilyPaged`](crate::QueryMsg::GetPastMembersForFamilyPaged). #[cw_serde] +#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] +#[cfg_attr( + feature = "generate-ts", + ts( + export, + export_to = "ts-packages/types/src/types/rust/PastFamilyMembersPagedResponse.ts" + ) +)] pub struct PastFamilyMembersPagedResponse { /// The family whose archived memberships were queried, echoed back so /// paginated callers can correlate. @@ -382,6 +541,7 @@ pub struct PastFamilyMembersPagedResponse { /// Cursor to pass as `start_after` on the next call, or `None` if this /// page is empty (treat as end-of-list). + #[cfg_attr(feature = "generate-ts", ts(type = "[number, number] | null"))] pub start_next_after: Option, } diff --git a/nym-wallet/openspec/changes/node-families-real-ipc/tasks.md b/nym-wallet/openspec/changes/node-families-real-ipc/tasks.md index 5f348f7a97..34d20eeca0 100644 --- a/nym-wallet/openspec/changes/node-families-real-ipc/tasks.md +++ b/nym-wallet/openspec/changes/node-families-real-ipc/tasks.md @@ -9,7 +9,7 @@ ## 2. Types reconciliation -- [ ] 2.1 Generate ts-rs exports for the node-families contract types into `nym-wallet-types` (as other wallet types) and diff against `src/types/families.ts` (cursors, paged envelope, membership, `FamilyTxResult`). +- [x] 2.1 **Generated ts-rs exports** for the node-families contract types. Added a `generate-ts` feature + optional `ts-rs` dep to `nym-node-families-contract-common`, annotated 18 types in `types.rs` (`derive(ts_rs::TS)` + `export_to` under `ts-packages/types/src/types/rust/`, with overrides: `Coin → { denom, amount }`, `Addr → string`, `u64 → number`, tuple cursors `→ [number, number] | null`, `Config` renamed to `FamilyConfig`), wired them into `tools/ts-rs-cli` (dep + `use` + `do_export!`), and ran it → 18 `*.ts` files emitted (FamilyConfig, NodeFamily, NodeFamilyResponse, paged/membership/pending/past responses, etc.). Verified shapes (e.g. `NodeFamily.members: number`, `paid_fee: { denom, amount }`). - [ ] 2.2 Reconcile divergences toward the contract-truth shape; update `src/types/families.ts` (and the mock fixtures/engine if a field changes) so mock and real stay at parity. - [ ] 2.3 Add/confirm a contract-shape guard (test or ts-rs check) so future contract drift is caught. diff --git a/nym-wallet/src/types/rust/AppEnv.ts b/nym-wallet/src/types/rust/AppEnv.ts index bd276ebace..44e9a87a25 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 type AppEnv = { ADMIN_ADDRESS: string | null; SHOW_TERMINAL: string | null; ENABLE_QA_MODE: string | null }; +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 e7d71f0832..a7c50b0ec9 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 type AppVersion = { current_version: string; latest_version: string; is_update_available: boolean }; +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 f5e1a13161..75514ac5e0 100644 --- a/nym-wallet/src/types/rust/Interval.ts +++ b/nym-wallet/src/types/rust/Interval.ts @@ -1,10 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -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; -}; +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 d55f0bce67..fdc91639c0 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'; +export type Network = "SANDBOX" | "MAINNET"; diff --git a/nym-wallet/src/types/rust/OperatingCostRange.ts b/nym-wallet/src/types/rust/OperatingCostRange.ts index 7c87421672..63c24fe139 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 '@nymproject/types/src/types/rust/DecCoin'; +import type { DecCoin } from "../../../../ts-packages/types/src/types/rust/DecCoin"; -export type TauriOperatingCostRange = { minimum: DecCoin; maximum: DecCoin }; +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 d177c98d42..513776e3df 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 type TauriProfitMarginRange = { minimum: string; maximum: string }; +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 ebf1f33c56..000c41e589 100644 --- a/nym-wallet/src/types/rust/StateParams.ts +++ b/nym-wallet/src/types/rust/StateParams.ts @@ -1,11 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DecCoin } from '@nymproject/types/src/types/rust/DecCoin'; -import type { TauriOperatingCostRange } from './OperatingCostRange'; -import type { TauriProfitMarginRange } from './ProfitMarginRange'; +import type { DecCoin } from "../../../../ts-packages/types/src/types/rust/DecCoin"; +import type { TauriOperatingCostRange } from "./OperatingCostRange"; +import type { TauriProfitMarginRange } from "./ProfitMarginRange"; -export type TauriContractStateParams = { - minimum_pledge: DecCoin; - minimum_delegation: DecCoin | null; - operating_cost: TauriOperatingCostRange; - profit_margin: TauriProfitMarginRange; -}; +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 300941995e..64ea8607a5 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 type ValidatorUrl = { url: string; name: string | null }; +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 a0eeac8b94..8500bfa6ae 100644 --- a/nym-wallet/src/types/rust/ValidatorUrls.ts +++ b/nym-wallet/src/types/rust/ValidatorUrls.ts @@ -1,6 +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 type Validator = { nyxd_url: string; nyxd_name: string | null; api_url: string | null }; +export type Validator = { nyxd_url: string, nyxd_name: string | null, api_url: string | null, }; -export type ValidatorUrls = { urls: Array }; +export type ValidatorUrls = { urls: Array, }; diff --git a/tools/ts-rs-cli/Cargo.toml b/tools/ts-rs-cli/Cargo.toml index e2230dae3f..a7286cedde 100644 --- a/tools/ts-rs-cli/Cargo.toml +++ b/tools/ts-rs-cli/Cargo.toml @@ -17,6 +17,7 @@ nym-validator-client = { workspace = true, features = [ ] } nym-api-requests = { workspace = true, features = ["generate-ts"] } nym-mixnet-contract-common = { workspace = true, features = ["generate-ts"] } +nym-node-families-contract-common = { workspace = true, features = ["generate-ts"] } nym-vesting-contract-common = { workspace = true, features = ["generate-ts"] } nym-types = { workspace = true, 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 79ba3ef7ee..9389a49584 100644 --- a/tools/ts-rs-cli/src/main.rs +++ b/tools/ts-rs-cli/src/main.rs @@ -18,6 +18,14 @@ use nym_mixnet_contract_common::{ IntervalRewardingParamsUpdate, MixNode, MixNodeConfigUpdate, NymNode, PendingNodeChanges, RewardingParams, UnbondedMixnode, }; +use nym_node_families_contract_common::{ + Config as NodeFamiliesConfig, FamilyInvitation, FamilyInvitationStatus, FamilyMemberRecord, + FamilyMembersPagedResponse, FamilyMembership, NodeFamily, NodeFamilyByOwnerResponse, + NodeFamilyMembershipResponse, NodeFamilyResponse, PastFamilyInvitation, + PastFamilyInvitationsPagedResponse, PastFamilyMember, PastFamilyMembersPagedResponse, + PendingFamilyInvitationDetails, PendingFamilyInvitationResponse, + PendingFamilyInvitationsPagedResponse, PendingInvitationsForNodePagedResponse, +}; use nym_types::account::{Account, AccountEntry, AccountWithMnemonic, Balance}; use nym_types::currency::{CurrencyDenom, DecCoin}; use nym_types::delegation::{ @@ -96,6 +104,26 @@ fn main() -> anyhow::Result<()> { do_export!(NodeConfigUpdate); do_export!(Role); + // common/cosmwasm-smart-contracts/node-families-contract/src + do_export!(NodeFamiliesConfig); + do_export!(NodeFamily); + do_export!(FamilyInvitation); + do_export!(FamilyMembership); + do_export!(FamilyInvitationStatus); + do_export!(PastFamilyInvitation); + do_export!(PastFamilyMember); + do_export!(NodeFamilyResponse); + do_export!(NodeFamilyByOwnerResponse); + do_export!(NodeFamilyMembershipResponse); + do_export!(PendingFamilyInvitationDetails); + do_export!(PendingFamilyInvitationResponse); + do_export!(FamilyMemberRecord); + do_export!(FamilyMembersPagedResponse); + do_export!(PendingFamilyInvitationsPagedResponse); + do_export!(PendingInvitationsForNodePagedResponse); + do_export!(PastFamilyInvitationsPagedResponse); + do_export!(PastFamilyMembersPagedResponse); + // common/types/src do_export!(Account); do_export!(AccountEntry); diff --git a/ts-packages/types/src/types/rust/Account.ts b/ts-packages/types/src/types/rust/Account.ts index 33471c6846..4980e9b69e 100644 --- a/ts-packages/types/src/types/rust/Account.ts +++ b/ts-packages/types/src/types/rust/Account.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 { CurrencyDenom } from './CurrencyDenom'; +import type { CurrencyDenom } from "./CurrencyDenom"; -export type 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 f10dc906df..39db6db6cc 100644 --- a/ts-packages/types/src/types/rust/AccountEntry.ts +++ b/ts-packages/types/src/types/rust/AccountEntry.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 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 df7450403a..82d73ac020 100644 --- a/ts-packages/types/src/types/rust/AccountWithMnemonic.ts +++ b/ts-packages/types/src/types/rust/AccountWithMnemonic.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 { Account } from './Account'; +import type { Account } from "./Account"; -export type 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 index 8bf64f0368..20e5640581 100644 --- a/ts-packages/types/src/types/rust/ActiveSetUpdate.ts +++ b/ts-packages/types/src/types/rust/ActiveSetUpdate.ts @@ -3,17 +3,16 @@ /** * 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; -}; +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/AnnotationResponseV1.ts b/ts-packages/types/src/types/rust/AnnotationResponseV1.ts new file mode 100644 index 0000000000..eafc7b7c81 --- /dev/null +++ b/ts-packages/types/src/types/rust/AnnotationResponseV1.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 { NodeAnnotationV1 } from "./NodeAnnotationV1"; + +export type AnnotationResponseV1 = { node_id: number, annotation: NodeAnnotationV1 | null, }; diff --git a/ts-packages/types/src/types/rust/AnnotationResponseV2.ts b/ts-packages/types/src/types/rust/AnnotationResponseV2.ts new file mode 100644 index 0000000000..8af71c768f --- /dev/null +++ b/ts-packages/types/src/types/rust/AnnotationResponseV2.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 { NodeAnnotationV2 } from "./NodeAnnotationV2"; + +export type AnnotationResponseV2 = { node_id: number, annotation: NodeAnnotationV2 | null, }; diff --git a/ts-packages/types/src/types/rust/Balance.ts b/ts-packages/types/src/types/rust/Balance.ts index 6d3d51b5a4..b2632511e3 100644 --- a/ts-packages/types/src/types/rust/Balance.ts +++ b/ts-packages/types/src/types/rust/Balance.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 './DecCoin'; +import type { DecCoin } from "./DecCoin"; -export type 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 be2edc24fa..4dc9188584 100644 --- a/ts-packages/types/src/types/rust/Coin.ts +++ b/ts-packages/types/src/types/rust/Coin.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 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 a741cbce59..bcb0edc1aa 100644 --- a/ts-packages/types/src/types/rust/CosmosFee.ts +++ b/ts-packages/types/src/types/rust/CosmosFee.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 { Coin } from './Coin'; +import type { Coin } from "./Coin"; -export type 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/CurrencyDenom.ts b/ts-packages/types/src/types/rust/CurrencyDenom.ts index 3e7696c28d..939585e625 100644 --- a/ts-packages/types/src/types/rust/CurrencyDenom.ts +++ b/ts-packages/types/src/types/rust/CurrencyDenom.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 CurrencyDenom = 'unknown' | 'nym' | 'nymt' | 'nyx' | 'nyxt'; +export type CurrencyDenom = "unknown" | "nym" | "nymt" | "nyx" | "nyxt"; diff --git a/ts-packages/types/src/types/rust/DecCoin.ts b/ts-packages/types/src/types/rust/DecCoin.ts index 9411bf358b..5b0a446ba8 100644 --- a/ts-packages/types/src/types/rust/DecCoin.ts +++ b/ts-packages/types/src/types/rust/DecCoin.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 { CurrencyDenom } from './CurrencyDenom'; +import type { CurrencyDenom } from "./CurrencyDenom"; -export type DecCoin = { denom: CurrencyDenom; amount: string }; +export type DecCoin = { denom: CurrencyDenom, amount: string, }; diff --git a/ts-packages/types/src/types/rust/DeclaredRoles.ts b/ts-packages/types/src/types/rust/DeclaredRoles.ts index 6675391d48..c26482b51b 100644 --- a/ts-packages/types/src/types/rust/DeclaredRoles.ts +++ b/ts-packages/types/src/types/rust/DeclaredRoles.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 DeclaredRoles = { mixnode: boolean; entry: boolean; exit_nr: boolean; exit_ipr: boolean }; +export type DeclaredRolesV1 = { 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 bef093e881..44112fa3cf 100644 --- a/ts-packages/types/src/types/rust/Delegation.ts +++ b/ts-packages/types/src/types/rust/Delegation.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 './DecCoin'; +import type { DecCoin } from "./DecCoin"; -export type 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 4891306e80..86a62f4c26 100644 --- a/ts-packages/types/src/types/rust/DelegationEvent.ts +++ b/ts-packages/types/src/types/rust/DelegationEvent.ts @@ -1,11 +1,5 @@ // 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 { DelegationEventKind } from './DelegationEventKind'; +import type { DecCoin } from "./DecCoin"; +import type { DelegationEventKind } from "./DelegationEventKind"; -export type DelegationEvent = { - kind: DelegationEventKind; - mix_id: number; - address: string; - amount: DecCoin | null; - proxy: string | null; -}; +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/DelegationEventKind.ts b/ts-packages/types/src/types/rust/DelegationEventKind.ts index a242220102..ad43ee8282 100644 --- a/ts-packages/types/src/types/rust/DelegationEventKind.ts +++ b/ts-packages/types/src/types/rust/DelegationEventKind.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 DelegationEventKind = 'Delegate' | 'Undelegate'; +export type DelegationEventKind = "Delegate" | "Undelegate"; diff --git a/ts-packages/types/src/types/rust/DelegationResult.ts b/ts-packages/types/src/types/rust/DelegationResult.ts index 765e11e98b..66cb790c18 100644 --- a/ts-packages/types/src/types/rust/DelegationResult.ts +++ b/ts-packages/types/src/types/rust/DelegationResult.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 './DecCoin'; +import type { DecCoin } from "./DecCoin"; -export type 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 bb86fd9ced..113f6ac944 100644 --- a/ts-packages/types/src/types/rust/DelegationSummaryResponse.ts +++ b/ts-packages/types/src/types/rust/DelegationSummaryResponse.ts @@ -1,9 +1,5 @@ // 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 { DelegationWithEverything } from './DelegationWithEverything'; +import type { DecCoin } from "./DecCoin"; +import type { DelegationWithEverything } from "./DelegationWithEverything"; -export type DelegationsSummaryResponse = { - delegations: Array; - total_delegations: DecCoin; - total_rewards: DecCoin; -}; +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 4adde3e782..1ba2be7775 100644 --- a/ts-packages/types/src/types/rust/DelegationWithEverything.ts +++ b/ts-packages/types/src/types/rust/DelegationWithEverything.ts @@ -1,24 +1,10 @@ // 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 { NodeCostParams } from './MixNodeCostParams'; +import type { DecCoin } from "./DecCoin"; +import type { DelegationEvent } from "./DelegationEvent"; +import type { NodeCostParams } from "./MixNodeCostParams"; -export type DelegationWithEverything = { - owner: string; - mix_id: number; - node_identity: string; - historical_node_identity: string | null; - amount: DecCoin; - accumulated_by_delegates: DecCoin | null; - accumulated_by_operator: DecCoin | null; - block_height: bigint; - delegated_on_iso_datetime: string | 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; -}; +export type DelegationWithEverything = { owner: string, mix_id: number, node_identity: string, +/** + * Prior node identity when `node_identity` is synthetic (registry miss after unbond). + */ +historical_node_identity: string | null, amount: DecCoin, accumulated_by_delegates: DecCoin | null, accumulated_by_operator: DecCoin | null, block_height: bigint, delegated_on_iso_datetime: string | 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, }; diff --git a/ts-packages/types/src/types/rust/DescribedNodeType.ts b/ts-packages/types/src/types/rust/DescribedNodeType.ts index 3cfc95f140..c8a22ae3c5 100644 --- a/ts-packages/types/src/types/rust/DescribedNodeType.ts +++ b/ts-packages/types/src/types/rust/DescribedNodeType.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 DescribedNodeType = 'legacy_mixnode' | 'legacy_gateway' | 'nym_node'; +export type DescribedNodeTypeV1 = "legacy_mixnode" | "legacy_gateway" | "nym_node"; diff --git a/ts-packages/types/src/types/rust/FamilyConfig.ts b/ts-packages/types/src/types/rust/FamilyConfig.ts new file mode 100644 index 0000000000..68990ef04c --- /dev/null +++ b/ts-packages/types/src/types/rust/FamilyConfig.ts @@ -0,0 +1,24 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Runtime configuration of the node families contract. + */ +export type FamilyConfig = { +/** + * Fee charged on each successful `create_family` execution. + */ +create_family_fee: { denom: string, amount: string }, +/** + * Maximum allowed length, in characters, of a family name. + */ +family_name_length_limit: number, +/** + * Maximum allowed length, in characters, of a family description. + */ +family_description_length_limit: number, +/** + * Default lifetime, in seconds, used by `invite_to_family` when the + * sender doesn't supply an explicit value. Senders may override this + * per-invitation via the optional `validity_secs` argument. + */ +default_invitation_validity_secs: number, }; diff --git a/ts-packages/types/src/types/rust/FamilyInvitation.ts b/ts-packages/types/src/types/rust/FamilyInvitation.ts new file mode 100644 index 0000000000..43ddd8ffcb --- /dev/null +++ b/ts-packages/types/src/types/rust/FamilyInvitation.ts @@ -0,0 +1,22 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * A pending invitation for a node to join a particular family. + * + * Invitations are stored until they are accepted, rejected, revoked, or until the + * chain advances past `expires_at` (in which case they remain in storage but are + * treated as inert — there is no background process clearing expired invitations). + */ +export type FamilyInvitation = { +/** + * The family that issued the invitation. + */ +family_id: number, +/** + * The node being invited. + */ +node_id: number, +/** + * Block timestamp (unix seconds) after which the invitation is no longer valid. + */ +expires_at: number, }; diff --git a/ts-packages/types/src/types/rust/FamilyInvitationStatus.ts b/ts-packages/types/src/types/rust/FamilyInvitationStatus.ts new file mode 100644 index 0000000000..d78c955a52 --- /dev/null +++ b/ts-packages/types/src/types/rust/FamilyInvitationStatus.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Terminal status for an invitation that has been moved out of the pending set. + * + * Note: timed-out invitations are not represented here — they are simply left in + * the pending set (see `FamilyInvitation::expires_at`). + */ +export type FamilyInvitationStatus = { "pending": { at: bigint, } } | { "accepted": { at: bigint, } } | { "rejected": { at: bigint, } } | { "revoked": { at: bigint, } }; diff --git a/ts-packages/types/src/types/rust/FamilyMemberRecord.ts b/ts-packages/types/src/types/rust/FamilyMemberRecord.ts new file mode 100644 index 0000000000..d4f31d3f6f --- /dev/null +++ b/ts-packages/types/src/types/rust/FamilyMemberRecord.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. +import type { FamilyMembership } from "./FamilyMembership"; + +/** + * One entry in a [`FamilyMembersPagedResponse`] page — pairs a node id with + * its [`FamilyMembership`] record (notably its `joined_at` timestamp). + */ +export type FamilyMemberRecord = { +/** + * The node currently in the family. + */ +node_id: number, +/** + * The membership record (carries `family_id` and `joined_at`). + */ +membership: FamilyMembership, }; diff --git a/ts-packages/types/src/types/rust/FamilyMembersPagedResponse.ts b/ts-packages/types/src/types/rust/FamilyMembersPagedResponse.ts new file mode 100644 index 0000000000..2b338fc655 --- /dev/null +++ b/ts-packages/types/src/types/rust/FamilyMembersPagedResponse.ts @@ -0,0 +1,21 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { FamilyMemberRecord } from "./FamilyMemberRecord"; + +/** + * Response to [`QueryMsg::GetFamilyMembersPaged`](crate::QueryMsg::GetFamilyMembersPaged). + */ +export type FamilyMembersPagedResponse = { +/** + * The family whose members were queried, echoed back so paginated + * callers can correlate. + */ +family_id: number, +/** + * The members on this page, in ascending [`NodeId`] order. + */ +members: Array, +/** + * Cursor to pass as `start_after` on the next call, or `None` if this + * page is empty (which the caller should treat as end-of-list). + */ +start_next_after: number | null, }; diff --git a/ts-packages/types/src/types/rust/FamilyMembership.ts b/ts-packages/types/src/types/rust/FamilyMembership.ts new file mode 100644 index 0000000000..e89d81717f --- /dev/null +++ b/ts-packages/types/src/types/rust/FamilyMembership.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. + +/** + * On-chain record of a node's current family membership. + * + * A node belongs to at most one family at a time, so this is keyed by + * `NodeId` alone — `family_id` is carried in the value to support reverse + * lookups (all nodes in a given family) via a secondary index. + */ +export type FamilyMembership = { +/** + * The family the node is currently a member of. + */ +family_id: number, +/** + * Block timestamp (unix seconds) at which the node accepted its + * invitation and joined the family. + */ +joined_at: number, }; diff --git a/ts-packages/types/src/types/rust/Fee.ts b/ts-packages/types/src/types/rust/Fee.ts index 1e3f747e92..d88be5b4c4 100644 --- a/ts-packages/types/src/types/rust/Fee.ts +++ b/ts-packages/types/src/types/rust/Fee.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 { CosmosFee } from './CosmosFee'; +import type { CosmosFee } from "./CosmosFee"; -export type Fee = { Manual: CosmosFee } | { Auto: number | null }; +export type Fee = { "Manual": CosmosFee } | { "Auto": number | null }; diff --git a/ts-packages/types/src/types/rust/FeeDetails.ts b/ts-packages/types/src/types/rust/FeeDetails.ts index 7db283dbc1..7383077844 100644 --- a/ts-packages/types/src/types/rust/FeeDetails.ts +++ b/ts-packages/types/src/types/rust/FeeDetails.ts @@ -1,5 +1,5 @@ // 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 { Fee } from './Fee'; +import type { DecCoin } from "./DecCoin"; +import type { Fee } from "./Fee"; -export type FeeDetails = { amount: DecCoin | null; fee: Fee }; +export type FeeDetails = { amount: DecCoin | null, fee: Fee, }; diff --git a/ts-packages/types/src/types/rust/Gas.ts b/ts-packages/types/src/types/rust/Gas.ts index 0329a5df89..a76fdfecd9 100644 --- a/ts-packages/types/src/types/rust/Gas.ts +++ b/ts-packages/types/src/types/rust/Gas.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Gas = { - /** - * units of gas used - */ - gas_units: bigint; -}; +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 4ee0a2431e..b51eb3c02d 100644 --- a/ts-packages/types/src/types/rust/GasInfo.ts +++ b/ts-packages/types/src/types/rust/GasInfo.ts @@ -1,13 +1,12 @@ // 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'; +import type { Gas } from "./Gas"; -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; -}; +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 3a9da4f7a7..7ecd1e6789 100644 --- a/ts-packages/types/src/types/rust/Gateway.ts +++ b/ts-packages/types/src/types/rust/Gateway.ts @@ -1,14 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -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; -}; +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 a8f619b5b4..1bbdf83099 100644 --- a/ts-packages/types/src/types/rust/GatewayBond.ts +++ b/ts-packages/types/src/types/rust/GatewayBond.ts @@ -1,11 +1,5 @@ // 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 { Gateway } from './Gateway'; +import type { DecCoin } from "./DecCoin"; +import type { Gateway } from "./Gateway"; -export type GatewayBond = { - pledge_amount: DecCoin; - owner: string; - block_height: bigint; - gateway: Gateway; - proxy: string | null; -}; +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 623a7fa638..44738d7f32 100644 --- a/ts-packages/types/src/types/rust/GatewayConfigUpdate.ts +++ b/ts-packages/types/src/types/rust/GatewayConfigUpdate.ts @@ -1,9 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type GatewayConfigUpdate = { - host: string; - mix_port: number; - clients_port: number; - location: string; - version: string; -}; +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 57ff4032f5..1b60aaeeaf 100644 --- a/ts-packages/types/src/types/rust/GatewayCoreStatusResponse.ts +++ b/ts-packages/types/src/types/rust/GatewayCoreStatusResponse.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 GatewayCoreStatusResponse = { identity: string; count: number }; +export type GatewayCoreStatusResponse = { identity: string, count: bigint, }; diff --git a/ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts b/ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts index 9df1733a85..c0ba1e59c5 100644 --- a/ts-packages/types/src/types/rust/HistoricalPerformanceResponse.ts +++ b/ts-packages/types/src/types/rust/HistoricalPerformanceResponse.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 HistoricalPerformanceResponse = { date: string; performance: number }; +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 index 7bd83ffeda..ba46e77889 100644 --- a/ts-packages/types/src/types/rust/HistoricalUptimeResponse.ts +++ b/ts-packages/types/src/types/rust/HistoricalUptimeResponse.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 HistoricalUptimeResponse = { date: string; uptime: number }; +export type HistoricalUptimeResponse = { date: string, uptime: number, }; diff --git a/ts-packages/types/src/types/rust/Interval.ts b/ts-packages/types/src/types/rust/Interval.ts index 61863be4ca..5efd2d2dc5 100644 --- a/ts-packages/types/src/types/rust/Interval.ts +++ b/ts-packages/types/src/types/rust/Interval.ts @@ -3,29 +3,28 @@ /** * 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; -}; +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 35984285e5..a582bf138b 100644 --- a/ts-packages/types/src/types/rust/IntervalRewardParams.ts +++ b/ts-packages/types/src/types/rust/IntervalRewardParams.ts @@ -3,50 +3,49 @@ /** * 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; -}; +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 f3cc67df7c..7ed7f7907a 100644 --- a/ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts +++ b/ts-packages/types/src/types/rust/IntervalRewardingParamsUpdate.ts @@ -1,36 +1,35 @@ // 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'; +import type { RewardedSetParams } from "./RewardedSetParams"; /** * 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; - /** - * Defines the parameters of the rewarded set. - */ - rewarded_set_params: RewardedSetParams | null; -}; +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, +/** + * 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 3034b30398..730582750b 100644 --- a/ts-packages/types/src/types/rust/MixNodeBond.ts +++ b/ts-packages/types/src/types/rust/MixNodeBond.ts @@ -1,13 +1,5 @@ // 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 { MixNode } from './Mixnode'; +import type { DecCoin } from "./DecCoin"; +import type { MixNode } from "./Mixnode"; -export type MixNodeBond = { - mix_id: number; - owner: string; - original_pledge: DecCoin; - mix_node: MixNode; - proxy: string | null; - bonding_height: bigint; - is_unbonding: boolean; -}; +export type MixNodeBond = { mix_id: number, owner: string, original_pledge: DecCoin, 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 60cef5816f..96bd132f52 100644 --- a/ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts +++ b/ts-packages/types/src/types/rust/MixNodeConfigUpdate.ts @@ -1,9 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type MixNodeConfigUpdate = { - host: string; - mix_port: number; - verloc_port: number; - http_api_port: number; - version: string; -}; +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 4c65d08efc..8658f9c91e 100644 --- a/ts-packages/types/src/types/rust/MixNodeCostParams.ts +++ b/ts-packages/types/src/types/rust/MixNodeCostParams.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 './DecCoin'; +import type { DecCoin } from "./DecCoin"; -export type NodeCostParams = { 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 81d0f1dbe9..7103354d40 100644 --- a/ts-packages/types/src/types/rust/MixNodeDetails.ts +++ b/ts-packages/types/src/types/rust/MixNodeDetails.ts @@ -1,5 +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 { NodeRewarding } from './NodeRewarding'; +import type { MixNodeBond } from "./MixNodeBond"; +import type { NodeRewarding } from "./NodeRewarding"; -export type MixNodeDetails = { bond_information: MixNodeBond; rewarding_details: NodeRewarding }; +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 2456af17ab..ada169d2b4 100644 --- a/ts-packages/types/src/types/rust/Mixnode.ts +++ b/ts-packages/types/src/types/rust/Mixnode.ts @@ -3,33 +3,32 @@ /** * 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; -}; +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 c49b713e97..2ad20c4401 100644 --- a/ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.ts +++ b/ts-packages/types/src/types/rust/MixnodeCoreStatusResponse.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 MixnodeCoreStatusResponse = { mix_id: number; count: number }; +export type MixnodeCoreStatusResponse = { mix_id: number, count: bigint, }; diff --git a/ts-packages/types/src/types/rust/MixnodeStatus.ts b/ts-packages/types/src/types/rust/MixnodeStatus.ts index 6421988dce..4047d50af3 100644 --- a/ts-packages/types/src/types/rust/MixnodeStatus.ts +++ b/ts-packages/types/src/types/rust/MixnodeStatus.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 MixnodeStatus = 'active' | 'standby' | 'inactive' | 'not_found'; +export type MixnodeStatus = "active" | "standby" | "inactive" | "not_found"; diff --git a/ts-packages/types/src/types/rust/MixnodeStatusResponse.ts b/ts-packages/types/src/types/rust/MixnodeStatusResponse.ts index 7d680a2f32..eb9221fc37 100644 --- a/ts-packages/types/src/types/rust/MixnodeStatusResponse.ts +++ b/ts-packages/types/src/types/rust/MixnodeStatusResponse.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 { MixnodeStatus } from './MixnodeStatus'; +import type { MixnodeStatus } from "./MixnodeStatus"; -export type MixnodeStatusResponse = { status: MixnodeStatus }; +export type MixnodeStatusResponse = { status: MixnodeStatus, }; diff --git a/ts-packages/types/src/types/rust/NodeAnnotationV1.ts b/ts-packages/types/src/types/rust/NodeAnnotationV1.ts new file mode 100644 index 0000000000..7186c4ed95 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeAnnotationV1.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 { DetailedNodePerformanceV1 } from "./DetailedNodePerformanceV1"; +import type { DisplayRole } from "./DisplayRole"; + +export type NodeAnnotationV1 = { last_24h_performance: string, current_role: DisplayRole | null, detailed_performance: DetailedNodePerformanceV1, }; diff --git a/ts-packages/types/src/types/rust/NodeAnnotationV2.ts b/ts-packages/types/src/types/rust/NodeAnnotationV2.ts new file mode 100644 index 0000000000..8e2f175310 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeAnnotationV2.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 { DetailedNodePerformanceV2 } from "./DetailedNodePerformanceV2"; +import type { DisplayRole } from "./DisplayRole"; + +export type NodeAnnotationV2 = { current_role: DisplayRole | null, detailed_performance: DetailedNodePerformanceV2, }; diff --git a/ts-packages/types/src/types/rust/NodeConfigUpdate.ts b/ts-packages/types/src/types/rust/NodeConfigUpdate.ts index bb512a7fde..b39d3997e4 100644 --- a/ts-packages/types/src/types/rust/NodeConfigUpdate.ts +++ b/ts-packages/types/src/types/rust/NodeConfigUpdate.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 type NodeConfigUpdate = { - host: string | null; - custom_http_port: number | null; - restore_default_http_port: boolean; -}; +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 index 12c85fe364..720f52e078 100644 --- a/ts-packages/types/src/types/rust/NodeDatePerformanceResponse.ts +++ b/ts-packages/types/src/types/rust/NodeDatePerformanceResponse.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 NodeDatePerformanceResponse = { node_id: number; date: string; performance: number | null }; +export type NodeDatePerformanceResponse = { node_id: number, date: string, performance: number | null, }; diff --git a/ts-packages/types/src/types/rust/NodeFamily.ts b/ts-packages/types/src/types/rust/NodeFamily.ts new file mode 100644 index 0000000000..a81b42bcf9 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeFamily.ts @@ -0,0 +1,40 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * On-chain representation of a node family. + */ +export type NodeFamily = { +/** + * The id of the node family + */ +id: number, +/** + * The name of the node family + */ +name: string, +/** + * Normalised name of the node family used for uniqueness checks + */ +normalised_name: string, +/** + * The optional description of the node family + */ +description: string, +/** + * The owner of the node family + */ +owner: string, +/** + * Records the fee paid when the family was created, + * so that the appropriate amount could be returned upon it getting disbanded. + */ +paid_fee: { denom: string, amount: string }, +/** + * Memoized value of the current number of members in the node family + * Used to detect if the family is empty + */ +members: number, +/** + * Timestamp of the creation of the node family + */ +created_at: number, }; diff --git a/ts-packages/types/src/types/rust/NodeFamilyByOwnerResponse.ts b/ts-packages/types/src/types/rust/NodeFamilyByOwnerResponse.ts new file mode 100644 index 0000000000..983e1f2be9 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeFamilyByOwnerResponse.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. +import type { NodeFamily } from "./NodeFamily"; + +/** + * Response to [`QueryMsg::GetFamilyByOwner`](crate::QueryMsg::GetFamilyByOwner). + */ +export type NodeFamilyByOwnerResponse = { +/** + * The (validated) owner address that was queried, echoed back so callers + * can correlate. + */ +owner: string, +/** + * The matching family, or `None` if `owner` does not currently own one. + */ +family: NodeFamily | null, }; diff --git a/ts-packages/types/src/types/rust/NodeFamilyMembershipResponse.ts b/ts-packages/types/src/types/rust/NodeFamilyMembershipResponse.ts new file mode 100644 index 0000000000..1a82910294 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeFamilyMembershipResponse.ts @@ -0,0 +1,15 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Response to [`QueryMsg::GetFamilyMembership`](crate::QueryMsg::GetFamilyMembership). + */ +export type NodeFamilyMembershipResponse = { +/** + * The node that was queried. + */ +node_id: number, +/** + * The id of the family the node currently belongs to, or `None` if the + * node is not currently a member of any family. + */ +family_id: number | null, }; diff --git a/ts-packages/types/src/types/rust/NodeFamilyResponse.ts b/ts-packages/types/src/types/rust/NodeFamilyResponse.ts new file mode 100644 index 0000000000..2200b131d2 --- /dev/null +++ b/ts-packages/types/src/types/rust/NodeFamilyResponse.ts @@ -0,0 +1,15 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { NodeFamily } from "./NodeFamily"; + +/** + * Response to [`QueryMsg::GetFamilyById`](crate::QueryMsg::GetFamilyById). + */ +export type NodeFamilyResponse = { +/** + * The id that was queried, echoed back so paginated callers can correlate. + */ +family_id: number, +/** + * The matching family, or `None` if no family with `family_id` exists. + */ +family: NodeFamily | null, }; diff --git a/ts-packages/types/src/types/rust/NodePerformanceResponse.ts b/ts-packages/types/src/types/rust/NodePerformanceResponse.ts index 37ee3c165d..698ea013f8 100644 --- a/ts-packages/types/src/types/rust/NodePerformanceResponse.ts +++ b/ts-packages/types/src/types/rust/NodePerformanceResponse.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 NodePerformanceResponse = { node_id: number; performance: number | null }; +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 fd3273c8c2..1d472fbfcb 100644 --- a/ts-packages/types/src/types/rust/NodeRewarding.ts +++ b/ts-packages/types/src/types/rust/NodeRewarding.ts @@ -1,12 +1,4 @@ // 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 type NodeRewarding = { - cost_params: NodeCostParams; - operator: string; - delegates: string; - total_unit_reward: string; - unit_delegation: string; - last_rewarded_epoch: number; - unique_delegations: number; -}; +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 index 25dff5a2a6..8354619ff9 100644 --- a/ts-packages/types/src/types/rust/NodeRewardingParameters.ts +++ b/ts-packages/types/src/types/rust/NodeRewardingParameters.ts @@ -3,14 +3,13 @@ /** * 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; -}; +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 4836322136..a113827957 100644 --- a/ts-packages/types/src/types/rust/NymNode.ts +++ b/ts-packages/types/src/types/rust/NymNode.ts @@ -3,19 +3,18 @@ /** * 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; -}; +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 545c674c55..0d50d01f55 100644 --- a/ts-packages/types/src/types/rust/NymNodeBond.ts +++ b/ts-packages/types/src/types/rust/NymNodeBond.ts @@ -1,40 +1,39 @@ // 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 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; -}; +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 5bebd8492e..3baee09908 100644 --- a/ts-packages/types/src/types/rust/NymNodeDetails.ts +++ b/ts-packages/types/src/types/rust/NymNodeDetails.ts @@ -1,22 +1,21 @@ // 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"; /** * 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; -}; +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 ffd03fe975..33d307ba18 100644 --- a/ts-packages/types/src/types/rust/OriginalVestingResponse.ts +++ b/ts-packages/types/src/types/rust/OriginalVestingResponse.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 './DecCoin'; +import type { DecCoin } from "./DecCoin"; -export type 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 index 7b64cdbb4d..26ed36c828 100644 --- a/ts-packages/types/src/types/rust/PaginatedResponse.ts +++ b/ts-packages/types/src/types/rust/PaginatedResponse.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 { Pagination } from './Pagination'; +import type { Pagination } from "./Pagination"; -export type PaginatedResponse = { pagination: Pagination; data: Array }; +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 index 963ec90ae2..b0a0d46b8a 100644 --- a/ts-packages/types/src/types/rust/Pagination.ts +++ b/ts-packages/types/src/types/rust/Pagination.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 Pagination = { total: number; page: number; size: number }; +export type Pagination = { total: number, page: number, size: number, }; diff --git a/ts-packages/types/src/types/rust/PastFamilyInvitation.ts b/ts-packages/types/src/types/rust/PastFamilyInvitation.ts new file mode 100644 index 0000000000..d8c8707dd7 --- /dev/null +++ b/ts-packages/types/src/types/rust/PastFamilyInvitation.ts @@ -0,0 +1,18 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { FamilyInvitation } from "./FamilyInvitation"; +import type { FamilyInvitationStatus } from "./FamilyInvitationStatus"; + +/** + * Historical record of an invitation that has reached a terminal state + * (`Accepted`, `Rejected`, or `Revoked`). Timed-out invitations are **not** + * archived here — they remain in the pending map until explicitly cleared. + */ +export type PastFamilyInvitation = { +/** + * The original invitation as it was issued. + */ +invitation: FamilyInvitation, +/** + * What ultimately happened to it. + */ +status: FamilyInvitationStatus, }; diff --git a/ts-packages/types/src/types/rust/PastFamilyInvitationsPagedResponse.ts b/ts-packages/types/src/types/rust/PastFamilyInvitationsPagedResponse.ts new file mode 100644 index 0000000000..5cf924cbc1 --- /dev/null +++ b/ts-packages/types/src/types/rust/PastFamilyInvitationsPagedResponse.ts @@ -0,0 +1,22 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PastFamilyInvitation } from "./PastFamilyInvitation"; + +/** + * Response to [`QueryMsg::GetPastInvitationsForFamilyPaged`](crate::QueryMsg::GetPastInvitationsForFamilyPaged). + */ +export type PastFamilyInvitationsPagedResponse = { +/** + * The family whose archived invitations were queried, echoed back so + * paginated callers can correlate. + */ +family_id: number, +/** + * The archived invitations on this page, in ascending + * `(node_id, counter)` order across all terminal statuses. + */ +invitations: Array, +/** + * Cursor to pass as `start_after` on the next call, or `None` if this + * page is empty (treat as end-of-list). + */ +start_next_after: [number, number] | null, }; diff --git a/ts-packages/types/src/types/rust/PastFamilyMember.ts b/ts-packages/types/src/types/rust/PastFamilyMember.ts new file mode 100644 index 0000000000..b1f1e38f48 --- /dev/null +++ b/ts-packages/types/src/types/rust/PastFamilyMember.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. + +/** + * Historical record of a node that used to be part of a family but has since been + * removed (kicked, left voluntarily, or because the family was disbanded). + */ +export type PastFamilyMember = { +/** + * The family the node used to belong to. + */ +family_id: number, +/** + * The node that was removed. + */ +node_id: number, +/** + * Block timestamp (unix seconds) at which the membership was terminated. + */ +removed_at: number, }; diff --git a/ts-packages/types/src/types/rust/PastFamilyMembersPagedResponse.ts b/ts-packages/types/src/types/rust/PastFamilyMembersPagedResponse.ts new file mode 100644 index 0000000000..b3dcef4b5c --- /dev/null +++ b/ts-packages/types/src/types/rust/PastFamilyMembersPagedResponse.ts @@ -0,0 +1,22 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PastFamilyMember } from "./PastFamilyMember"; + +/** + * Response to [`QueryMsg::GetPastMembersForFamilyPaged`](crate::QueryMsg::GetPastMembersForFamilyPaged). + */ +export type PastFamilyMembersPagedResponse = { +/** + * The family whose archived memberships were queried, echoed back so + * paginated callers can correlate. + */ +family_id: number, +/** + * The archived membership records on this page, in ascending + * `(node_id, counter)` order. + */ +members: Array, +/** + * Cursor to pass as `start_after` on the next call, or `None` if this + * page is empty (treat as end-of-list). + */ +start_next_after: [number, number] | null, }; diff --git a/ts-packages/types/src/types/rust/PendingEpochEvent.ts b/ts-packages/types/src/types/rust/PendingEpochEvent.ts index 8b937f2164..9df4241249 100644 --- a/ts-packages/types/src/types/rust/PendingEpochEvent.ts +++ b/ts-packages/types/src/types/rust/PendingEpochEvent.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 { PendingEpochEventData } from './PendingEpochEventData'; +import type { PendingEpochEventData } from "./PendingEpochEventData"; -export type 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 9fc3c9da4c..8ce22bacf9 100644 --- a/ts-packages/types/src/types/rust/PendingEpochEventData.ts +++ b/ts-packages/types/src/types/rust/PendingEpochEventData.ts @@ -1,10 +1,5 @@ // 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 { ActiveSetUpdate } from "./ActiveSetUpdate"; +import type { DecCoin } from "./DecCoin"; -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 } }; +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, } } | { "NymNodePledgeMore": { node_id: number, amount: DecCoin, } } | { "NymNodeDecreasePledge": { node_id: number, decrease_by: DecCoin, } } | { "UnbondNymNode": { node_id: number, } } | { "UpdateActiveSet": { update: ActiveSetUpdate, } }; diff --git a/ts-packages/types/src/types/rust/PendingFamilyInvitationDetails.ts b/ts-packages/types/src/types/rust/PendingFamilyInvitationDetails.ts new file mode 100644 index 0000000000..471737c98c --- /dev/null +++ b/ts-packages/types/src/types/rust/PendingFamilyInvitationDetails.ts @@ -0,0 +1,17 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { FamilyInvitation } from "./FamilyInvitation"; + +/** + * A pending [`FamilyInvitation`] paired with whether it has already timed + * out at the time the query was served. + */ +export type PendingFamilyInvitationDetails = { +/** + * The stored invitation as it was issued. + */ +invitation: FamilyInvitation, +/** + * `true` iff `now >= invitation.expires_at` at query time, i.e. the + * invitation is still in the pending map but can no longer be acted on. + */ +expired: boolean, }; diff --git a/ts-packages/types/src/types/rust/PendingFamilyInvitationResponse.ts b/ts-packages/types/src/types/rust/PendingFamilyInvitationResponse.ts new file mode 100644 index 0000000000..71e5b03318 --- /dev/null +++ b/ts-packages/types/src/types/rust/PendingFamilyInvitationResponse.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. +import type { PendingFamilyInvitationDetails } from "./PendingFamilyInvitationDetails"; + +/** + * Response to [`QueryMsg::GetPendingInvitation`](crate::QueryMsg::GetPendingInvitation). + */ +export type PendingFamilyInvitationResponse = { +/** + * The family component of the queried `(family_id, node_id)` key. + */ +family_id: number, +/** + * The node component of the queried `(family_id, node_id)` key. + */ +node_id: number, +/** + * The matching pending invitation along with an explicit expiry flag, + * or `None` if no such invitation exists. + */ +invitation: PendingFamilyInvitationDetails | null, }; diff --git a/ts-packages/types/src/types/rust/PendingFamilyInvitationsPagedResponse.ts b/ts-packages/types/src/types/rust/PendingFamilyInvitationsPagedResponse.ts new file mode 100644 index 0000000000..b8ef9417b5 --- /dev/null +++ b/ts-packages/types/src/types/rust/PendingFamilyInvitationsPagedResponse.ts @@ -0,0 +1,23 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PendingFamilyInvitationDetails } from "./PendingFamilyInvitationDetails"; + +/** + * Response to [`QueryMsg::GetPendingInvitationsForFamilyPaged`](crate::QueryMsg::GetPendingInvitationsForFamilyPaged). + */ +export type PendingFamilyInvitationsPagedResponse = { +/** + * The family whose pending invitations were queried, echoed back so + * paginated callers can correlate. + */ +family_id: number, +/** + * The pending invitations on this page, in ascending invitee + * [`NodeId`] order, each stamped with whether it had already timed out + * at the time the query was served. + */ +invitations: Array, +/** + * Cursor (last invitee node id) to pass as `start_after` on the next + * call, or `None` if this page is empty (treat as end-of-list). + */ +start_next_after: number | null, }; diff --git a/ts-packages/types/src/types/rust/PendingIntervalEvent.ts b/ts-packages/types/src/types/rust/PendingIntervalEvent.ts index db0abeae02..5358a2a823 100644 --- a/ts-packages/types/src/types/rust/PendingIntervalEvent.ts +++ b/ts-packages/types/src/types/rust/PendingIntervalEvent.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 { PendingIntervalEventData } from './PendingIntervalEventData'; +import type { PendingIntervalEventData } from "./PendingIntervalEventData"; -export type 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 ccde6b5c23..788ea37be8 100644 --- a/ts-packages/types/src/types/rust/PendingIntervalEventData.ts +++ b/ts-packages/types/src/types/rust/PendingIntervalEventData.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 { IntervalRewardingParamsUpdate } from './IntervalRewardingParamsUpdate'; -import type { NodeCostParams } from './MixNodeCostParams'; +import type { IntervalRewardingParamsUpdate } from "./IntervalRewardingParamsUpdate"; +import type { NodeCostParams } from "./MixNodeCostParams"; -export type PendingIntervalEventData = - | { ChangeMixCostParams: { mix_id: number; new_costs: NodeCostParams } } - | { UpdateRewardingParams: { update: IntervalRewardingParamsUpdate } } - | { UpdateIntervalConfig: { epochs_in_interval: number; epoch_duration_secs: bigint } }; +export type PendingIntervalEventData = { "ChangeMixCostParams": { mix_id: number, new_costs: NodeCostParams, } } | { "ChangeNymNodeCostParams": { node_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/PendingInvitationsForNodePagedResponse.ts b/ts-packages/types/src/types/rust/PendingInvitationsForNodePagedResponse.ts new file mode 100644 index 0000000000..c29323691d --- /dev/null +++ b/ts-packages/types/src/types/rust/PendingInvitationsForNodePagedResponse.ts @@ -0,0 +1,23 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PendingFamilyInvitationDetails } from "./PendingFamilyInvitationDetails"; + +/** + * Response to [`QueryMsg::GetPendingInvitationsForNodePaged`](crate::QueryMsg::GetPendingInvitationsForNodePaged). + */ +export type PendingInvitationsForNodePagedResponse = { +/** + * The node whose pending invitations were queried, echoed back so + * paginated callers can correlate. + */ +node_id: number, +/** + * The pending invitations addressed to this node on this page, in + * ascending [`NodeFamilyId`] order, each stamped with whether it had + * already timed out at the time the query was served. + */ +invitations: Array, +/** + * Cursor (last issuing family id) to pass as `start_after` on the + * next call, or `None` if this page is empty (treat as end-of-list). + */ +start_next_after: number | null, }; diff --git a/ts-packages/types/src/types/rust/PendingNodeChanges.ts b/ts-packages/types/src/types/rust/PendingNodeChanges.ts index 1dd646ccbd..b1667a190e 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 type PendingNodeChanges = { pledge_change: number | null; cost_params_change: number | null }; +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 index 63f5a3bbc1..9b1e93ebc9 100644 --- a/ts-packages/types/src/types/rust/PerformanceHistoryResponse.ts +++ b/ts-packages/types/src/types/rust/PerformanceHistoryResponse.ts @@ -1,5 +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'; +import type { HistoricalPerformanceResponse } from "./HistoricalPerformanceResponse"; +import type { PaginatedResponse } from "./PaginatedResponse"; -export type PerformanceHistoryResponse = { node_id: number; history: 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 40ccf4f9cc..8dfc1576da 100644 --- a/ts-packages/types/src/types/rust/Period.ts +++ b/ts-packages/types/src/types/rust/Period.ts @@ -3,4 +3,4 @@ /** * The vesting period. */ -export type Period = 'Before' | { In: number } | 'After'; +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 20fd4fd314..3accba8d63 100644 --- a/ts-packages/types/src/types/rust/PledgeData.ts +++ b/ts-packages/types/src/types/rust/PledgeData.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 './DecCoin'; +import type { DecCoin } from "./DecCoin"; -export type 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 31723c2e99..9eea44b06e 100644 --- a/ts-packages/types/src/types/rust/RewardEstimate.ts +++ b/ts-packages/types/src/types/rust/RewardEstimate.ts @@ -1,21 +1,20 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -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; -}; +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/RewardedSetParams.ts b/ts-packages/types/src/types/rust/RewardedSetParams.ts index 61ba4ccfb6..e1d09ac0e3 100644 --- a/ts-packages/types/src/types/rust/RewardedSetParams.ts +++ b/ts-packages/types/src/types/rust/RewardedSetParams.ts @@ -1,20 +1,19 @@ // 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; -}; +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 25dd44778e..5c8263bb6d 100644 --- a/ts-packages/types/src/types/rust/RewardingParams.ts +++ b/ts-packages/types/src/types/rust/RewardingParams.ts @@ -1,14 +1,12 @@ // 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'; +import type { IntervalRewardParams } from "./IntervalRewardParams"; +import type { RewardedSetParams } from "./RewardedSetParams"; /** * Parameters used for reward calculation. */ -export type RewardingParams = { - /** - * Parameters that should remain unchanged throughout an interval. - */ - interval: IntervalRewardParams; - rewarded_set: RewardedSetParams; -}; +export type RewardingParams = { +/** + * Parameters that should remain unchanged throughout an interval. + */ +interval: IntervalRewardParams, rewarded_set: RewardedSetParams, }; diff --git a/ts-packages/types/src/types/rust/Role.ts b/ts-packages/types/src/types/rust/Role.ts index 9e96a76120..9a83df27a7 100644 --- a/ts-packages/types/src/types/rust/Role.ts +++ b/ts-packages/types/src/types/rust/Role.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 Role = 'EntryGateway' | 'Layer1' | 'Layer2' | 'Layer3' | 'ExitGateway' | 'Standby'; +export type Role = "eg" | "l1" | "l2" | "l3" | "xg" | "stb"; diff --git a/ts-packages/types/src/types/rust/RpcTransactionResponse.ts b/ts-packages/types/src/types/rust/RpcTransactionResponse.ts index e9711bf47f..6067e083ca 100644 --- a/ts-packages/types/src/types/rust/RpcTransactionResponse.ts +++ b/ts-packages/types/src/types/rust/RpcTransactionResponse.ts @@ -1,13 +1,5 @@ // 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 { Gas } from './Gas'; +import type { DecCoin } from "./DecCoin"; +import type { Gas } from "./Gas"; -export type RpcTransactionResponse = { - index: number; - tx_result_json: string; - block_height: bigint; - transaction_hash: string; - gas_used: Gas; - gas_wanted: Gas; - fee: DecCoin | null; -}; +export type RpcTransactionResponse = { index: number, tx_result_json: string, block_height: bigint, transaction_hash: string, 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 15481d175a..cb39f47184 100644 --- a/ts-packages/types/src/types/rust/SendTxResult.ts +++ b/ts-packages/types/src/types/rust/SendTxResult.ts @@ -1,14 +1,6 @@ // 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 { Gas } from './Gas'; -import type { TransactionDetails } from './TransactionDetails'; +import type { DecCoin } from "./DecCoin"; +import type { Gas } from "./Gas"; +import type { TransactionDetails } from "./TransactionDetails"; -export type SendTxResult = { - block_height: bigint; - code: number; - details: TransactionDetails; - gas_used: Gas; - gas_wanted: Gas; - tx_hash: string; - fee: DecCoin | null; -}; +export type SendTxResult = { block_height: bigint, code: number, details: TransactionDetails, gas_used: Gas, 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 c5ef3d705e..58ebc65d53 100644 --- a/ts-packages/types/src/types/rust/StakeSaturationResponse.ts +++ b/ts-packages/types/src/types/rust/StakeSaturationResponse.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 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 3ad842a513..2bcef1a14d 100644 --- a/ts-packages/types/src/types/rust/TransactionDetails.ts +++ b/ts-packages/types/src/types/rust/TransactionDetails.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 './DecCoin'; +import type { DecCoin } from "./DecCoin"; -export type 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 d2595e5848..5e5e902f90 100644 --- a/ts-packages/types/src/types/rust/TransactionExecuteResult.ts +++ b/ts-packages/types/src/types/rust/TransactionExecuteResult.ts @@ -1,11 +1,5 @@ // 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 { GasInfo } from './GasInfo'; +import type { DecCoin } from "./DecCoin"; +import type { GasInfo } from "./GasInfo"; -export type TransactionExecuteResult = { - logs_json: string; - msg_responses_json: string; - transaction_hash: string; - gas_info: GasInfo; - fee: DecCoin | null; -}; +export type TransactionExecuteResult = { logs_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 c213f6d461..adde1f385a 100644 --- a/ts-packages/types/src/types/rust/UnbondedMixnode.ts +++ b/ts-packages/types/src/types/rust/UnbondedMixnode.ts @@ -3,22 +3,21 @@ /** * 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; -}; +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 index cdcbc0e14c..1370fdb206 100644 --- a/ts-packages/types/src/types/rust/UptimeHistoryResponse.ts +++ b/ts-packages/types/src/types/rust/UptimeHistoryResponse.ts @@ -1,5 +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'; +import type { HistoricalUptimeResponse } from "./HistoricalUptimeResponse"; +import type { PaginatedResponse } from "./PaginatedResponse"; -export type UptimeHistoryResponse = { node_id: number; history: 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 6d09f24caf..5602f9a381 100644 --- a/ts-packages/types/src/types/rust/VestingAccountInfo.ts +++ b/ts-packages/types/src/types/rust/VestingAccountInfo.ts @@ -1,11 +1,5 @@ // 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 { VestingPeriod } from './VestingPeriod'; +import type { DecCoin } from "./DecCoin"; +import type { VestingPeriod } from "./VestingPeriod"; -export type VestingAccountInfo = { - owner_address: string; - staking_address: string | null; - start_time: bigint; - periods: Array; - amount: DecCoin; -}; +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 5125eab75b..242962750f 100644 --- a/ts-packages/types/src/types/rust/VestingPeriod.ts +++ b/ts-packages/types/src/types/rust/VestingPeriod.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 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 4e710530fb..854982c359 100644 --- a/ts-packages/types/src/types/rust/WrappedDelegationEvent.ts +++ b/ts-packages/types/src/types/rust/WrappedDelegationEvent.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 { DelegationEvent } from './DelegationEvent'; +import type { DelegationEvent } from "./DelegationEvent"; -export type WrappedDelegationEvent = { event: DelegationEvent; node_identity: string }; +export type WrappedDelegationEvent = { event: DelegationEvent, node_identity: string, };