/** * Protocol type definitions for Steem RPC return values. * * These interfaces mirror the C++ node's condenser_api / database_api / * follow_api FC_REFLECT serialization structs and are cross-checked against * the dsteem TypeScript implementation. Field order follows JSON * serialization order. C++ prototype types are noted in comments: * - time_point_sec / account_name_type / signature_type → string * - fc::object_id (account_id_type, comment_id_type, etc.) → number * - hash id types (block_id_type, transaction_id_type, etc.) → string * - legacy_asset → string literal e.g. "1.000 STEEM" (condenser form) * - share_type (fc::safe) → number | string (may exceed safe int) * - uint128_t → string * - flat_map → array of [K, V] tuples * * Source of truth: * steem/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp */ import type { Authority, Transaction } from '../types'; /** steem::chain::util::manabar */ export interface Manabar { current_mana: number | string; last_update_time: number; } /** steem::protocol::beneficiary_route_type */ export interface BeneficiaryRoute { account: string; weight: number; } /** * steem::plugins::follow::api_follow_object (follow_api). * Returned by condenser_api.get_followers / get_following. */ export interface FollowApiObject { follower: string; following: string; /** Follow type tags: "blog", "ignore", or empty. */ what: string[]; } /** Vote entry inside Discussion.active_votes (steem::plugins::tags::vote_state). */ export interface ActiveVote { voter: string; percent: number; reputation: number | string; rshares: number; time: string; weight: number; } /** * steem::plugins::condenser_api::api_operation_object. * The value element of get_account_history entries. */ export interface AppliedOperation { trx_id: string; block: number; trx_in_block: number; op_in_trx: number; virtual_op: number; timestamp: string; /** [operation_name, operation_body] static_variant. */ op: [string, unknown]; } /** * condenser_api.get_account_history returns a map * serialized as an array of [index, operation] tuples. */ export type AccountHistoryEntry = [number, AppliedOperation]; /** * condenser_api::extended_account. Returned by get_accounts / * get_account_references. Fields common to api_account_object come first, * then the extended_account additions. * * Note: the *_history / comments / blog / feed / recent_replies fields are * lazily populated by specific RPC calls and are absent from get_accounts. */ export interface ExtendedAccount { id: number; name: string; owner: Authority; active: Authority; posting: Authority; memo_key: string; json_metadata: string; posting_json_metadata: string; proxy: string; last_owner_update: string; last_account_update: string; created: string; mined: boolean; recovery_account: string; last_account_recovery: string; reset_account: string; comment_count: number; lifetime_vote_count: number; post_count: number; can_vote: boolean; voting_manabar: Manabar; downvote_manabar: Manabar; voting_power: number; balance: string; savings_balance: string; sbd_balance: string; sbd_seconds: string; sbd_seconds_last_update: string; sbd_last_interest_payment: string; savings_sbd_balance: string; savings_sbd_seconds: string; savings_sbd_seconds_last_update: string; savings_sbd_last_interest_payment: string; savings_withdraw_requests: number; reward_sbd_balance: string; reward_steem_balance: string; reward_vesting_balance: string; reward_vesting_steem: string; vesting_shares: string; delegated_vesting_shares: string; received_vesting_shares: string; vesting_withdraw_rate: string; next_vesting_withdrawal: string; withdrawn: number | string; to_withdraw: number | string; withdraw_routes: number; curation_rewards: number | string; posting_rewards: number | string; proxied_vsf_votes: (number | string)[]; witnesses_voted_for: number; last_post: string; last_root_post: string; last_vote_time: string; post_bandwidth: number; pending_claimed_accounts: number | string; vesting_balance: string; reputation: number | string; transfer_history: unknown[]; market_history: unknown[]; post_history: unknown[]; vote_history: unknown[]; other_history: unknown[]; witness_votes: string[]; tags_usage: unknown[]; guest_bloggers: unknown[]; open_orders?: unknown[]; comments?: unknown[]; blog?: unknown[]; feed?: unknown[]; recent_replies?: unknown[]; recommended?: unknown[]; } /** * extended_dynamic_global_properties. * Returned by get_dynamic_global_properties. */ export interface DynamicGlobalProperties { id: number; head_block_number: number; head_block_id: string; time: string; current_witness: string; total_pow: number; num_pow_witnesses: number; virtual_supply: string; current_supply: string; confidential_supply: string; init_sbd_supply: string; current_sbd_supply: string; confidential_sbd_supply: string; total_vesting_fund_steem: string; total_vesting_shares: string; total_reward_fund_steem: string; total_reward_shares2: string; pending_rewarded_vesting_shares: string; pending_rewarded_vesting_steem: string; sbd_interest_rate: number; sbd_print_rate: number; maximum_block_size: number; required_actions_partition_percent: number; current_aslot: number; recent_slots_filled: string; participation_count: number; last_irreversible_block_num: number; vote_power_reserve_rate: number; delegation_return_period: number; reverse_auction_seconds: number; available_account_subsidies: number; sbd_stop_percent: number; sbd_start_percent: number; next_maintenance_time: string; last_budget_time: string; content_reward_percent: number; vesting_reward_percent: number; sps_fund_percent: number; sps_interval_ledger: string; downvote_pool_percent: number; } /** * condenser_api::discussion. Returned by get_content. * Includes api_comment_object base fields + discussion additions. */ export interface Discussion { id: number; author: string; permlink: string; category: string; parent_author: string; parent_permlink: string; title: string; body: string; json_metadata: string; last_update: string; created: string; active: string; last_payout: string; depth: number; children: number; net_rshares: number | string; abs_rshares: number | string; vote_rshares: number | string; children_abs_rshares: number | string; cashout_time: string; max_cashout_time: string; total_vote_weight: number; reward_weight: number; total_payout_value: string; curator_payout_value: string; author_rewards: number | string; net_votes: number; root_author: string; root_permlink: string; max_accepted_payout: string; percent_steem_dollars: number; allow_replies: boolean; allow_votes: boolean; allow_curation_rewards: boolean; beneficiaries: BeneficiaryRoute[]; url: string; root_title: string; pending_payout_value: string; total_pending_payout_value: string; active_votes: ActiveVote[]; replies: string[]; author_reputation: number | string; promoted: string; body_length: number; reblogged_by: string[]; first_reblogged_by?: string; first_reblogged_on?: string; } /** * condenser_api::legacy_signed_block (BlockHeader → SignedBlockHeader → * SignedBlock merged). Returned by get_block. */ export interface SignedBlock { previous: string; timestamp: string; witness: string; transaction_merkle_root: string; extensions: unknown[]; witness_signature: string; block_id: string; signing_key: string; transaction_ids: string[]; /** * Transactions in this block. NOTE: this reuses the broadcast-input * `Transaction` type, which omits the `transaction_id` / `block_num` / * `transaction_num` annotation fields that condenser's * legacy_signed_transaction includes on every block transaction. A * dedicated annotated-output transaction type should replace this in a * follow-up (see PR #542 review). */ transactions: Transaction[]; }