sigil-wallet · rpc_client
Source declarations, signatures and documentation for rpc_client.
Source: sigil/node/sigil-wallet/src/rpc_client.rs. SHA-256: 2fdac48228793a27b395913665cd3f97e6419906161646fa2bb7ad65f34c5c4e.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
rpc_client::NodeInfo
Node information response.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NodeInfo {
/// Node software version.
pub version: String,
/// Chain identifier.
pub chain_id: String,
/// Protocol version.
pub protocol_version: String
}Source line: 45.
rpc_client::SyncStatus
Sync status response.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SyncStatus {
/// Whether the node is fully synced.
pub synced: bool,
/// Current block height.
pub current_height: u64,
/// Highest known block height.
pub highest_known: u64
}Source line: 56.
rpc_client::MempoolStatus
Mempool status response.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MempoolStatus {
/// Number of transactions in the mempool.
pub size: u64,
/// Maximum mempool capacity.
pub max_size: u64
}Source line: 67.
rpc_client::SendTransactionResult
Transaction submission response.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SendTransactionResult {
/// The hash of the submitted transaction.
pub tx_hash: String
}Source line: 76.
rpc_client::SponsoredSetupPolicy
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SponsoredSetupPolicy {
pub version: u64,
pub envelope: String,
pub sponsor_signs_full_envelope: bool,
pub subject_proof_required: bool,
pub fees_debited_from: String,
pub replay_key: Vec<String>,
pub max_idempotency_key_bytes: usize,
pub allowed_setup_scopes: Vec<String>,
pub currently_enabled_scopes: Vec<String>,
pub explicitly_disallowed: Vec<String>
}Source line: 82.
rpc_client::SponsoredSetupReceipt
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SponsoredSetupReceipt {
pub hash: String,
#[serde(default, alias = "blockHeight")]
pub block_height: Option<u64>,
pub tx_index: usize,
pub status: String,
pub sponsor_did: String,
pub subject_did: String,
pub setup_scope: String,
pub idempotency_key: String
}Source line: 96.
rpc_client::BalanceResult
Account balance response from sigil_getBalance.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BalanceResult {
pub did: String,
pub balance: u64,
pub nonce: u64
}Source line: 110.
rpc_client::AccountResult
Account snapshot response from sigil_getAccount.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AccountResult {
pub did: String,
pub balance: u64,
pub nonce: u64,
#[serde(default, alias = "stakedAmount")]
pub staked_amount: u64,
#[serde(default, alias = "transactionCount")]
pub transaction_count: u64,
#[serde(default, alias = "identityDoc")]
pub identity_doc: Option<serde_json::Value>
}Source line: 118.
rpc_client::ValidatorResult
Validator snapshot response from sigil_getValidator.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValidatorResult {
pub did: String,
pub stake: u64,
#[serde(default)]
pub delegated_stake: u64,
#[serde(default)]
pub total_stake: u64,
pub mode: String,
pub active: bool,
#[serde(default)]
pub accumulated_rewards: u64,
#[serde(default)]
pub unbonding_epoch: Option<u64>
}Source line: 132.
rpc_client::AccountTransactionsResult
Account transaction list response from sigil_getAccountTransactions.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AccountTransactionsResult {
pub did: String,
pub latest_height: u64,
pub limit: usize,
pub offset: usize,
#[serde(default)]
pub transactions: Vec<serde_json::Value>
}Source line: 149.
rpc_client::ProposalResult
Governance proposal query response from sigil_getProposal.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProposalResult {
#[serde(default)]
pub proposal: Option<serde_json::Value>,
#[serde(default)]
pub found: bool
}Source line: 160.
rpc_client::ProposalListResult
Governance proposal list response from sigil_listProposals.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProposalListResult {
#[serde(default)]
pub proposals: Vec<serde_json::Value>,
#[serde(default)]
pub count: usize,
#[serde(default)]
pub limit: usize,
#[serde(default)]
pub offset: usize
}Source line: 169.
rpc_client::RegisterContractCodeResult
Contract-code registration submission response.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RegisterContractCodeResult {
/// Hash of the submitted transaction.
pub tx_hash: String,
/// Content hash of the registered bytecode.
pub code_hash: String,
/// Bytecode size in bytes.
pub code_len: usize,
/// Required registration fee in micro-MINT.
pub required_fee: u64,
/// Whether the node already had this bytecode hash.
#[serde(default)]
pub already_registered: bool
}Source line: 182.
rpc_client::SigilRpcClient
A typed JSON-RPC client for the Sigil node.
pub struct SigilRpcClient {
}Source line: 197.
rpc_client::SigilRpcClient::new
Create a new RPC client targeting the given endpoint URL.
The URL should include the path (e.g. http://localhost:12618/rpc).
pub fn new(rpc_url: &str) -> WalletResult<Self>;Source line: 207.
rpc_client::SigilRpcClient::get_node_info
Retrieve node information (version, chain ID, protocol version).
pub async fn get_node_info(&self) -> WalletResult<NodeInfo>;Source line: 276.
rpc_client::SigilRpcClient::get_sync_status
Retrieve the node's sync status.
pub async fn get_sync_status(&self) -> WalletResult<SyncStatus>;Source line: 283.
rpc_client::SigilRpcClient::get_mempool_status
Retrieve mempool status (size, max).
pub async fn get_mempool_status(&self) -> WalletResult<MempoolStatus>;Source line: 292.
rpc_client::SigilRpcClient::get_balance
Retrieve an account's balance and nonce.
pub async fn get_balance(&self, did: &str) -> WalletResult<BalanceResult>;Source line: 301.
rpc_client::SigilRpcClient::get_account
Retrieve an account snapshot.
pub async fn get_account(&self, did: &str) -> WalletResult<AccountResult>;Source line: 310.
rpc_client::SigilRpcClient::get_account_transactions
Retrieve recent transactions involving an account.
pub async fn get_account_transactions(
&self,
did: &str,
limit: u32,
) -> WalletResult<AccountTransactionsResult>;Source line: 319.
rpc_client::SigilRpcClient::get_validator
Retrieve a validator record. Missing validators are returned as None.
pub async fn get_validator(&self, did: &str) -> WalletResult<Option<ValidatorResult>>;Source line: 335.
rpc_client::SigilRpcClient::get_proposal
Retrieve a governance proposal by ID.
pub async fn get_proposal(&self, id: &str) -> WalletResult<ProposalResult>;Source line: 349.
rpc_client::SigilRpcClient::list_proposals
List governance proposals.
pub async fn list_proposals(
&self,
status: Option<&str>,
limit: u32,
) -> WalletResult<ProposalListResult>;Source line: 358.
rpc_client::SigilRpcClient::resolve_username
Resolve a username record by canonical or user-entered name.
pub async fn resolve_username(&self, name: &str) -> WalletResult<Option<serde_json::Value>>;Source line: 373.
rpc_client::SigilRpcClient::list_usernames
List all usernames owned by a DID.
pub async fn list_usernames(&self, owner_did: &str) -> WalletResult<Vec<serde_json::Value>>;Source line: 385.
rpc_client::SigilRpcClient::send_transaction
Submit a signed transaction to the node's mempool.
pub async fn send_transaction(
&self,
tx: &SignedTransaction,
) -> WalletResult<SendTransactionResult>;Source line: 397.
rpc_client::SigilRpcClient::send_sponsored_setup_transaction
pub async fn send_sponsored_setup_transaction(
&self,
tx: &SignedTransaction,
) -> WalletResult<SendTransactionResult>;Source line: 409.
rpc_client::SigilRpcClient::get_sponsored_setup_policy
pub async fn get_sponsored_setup_policy(&self) -> WalletResult<SponsoredSetupPolicy>;Source line: 426.
rpc_client::SigilRpcClient::get_sponsored_setup_receipt
pub async fn get_sponsored_setup_receipt(
&self,
hash: &str,
) -> WalletResult<SponsoredSetupReceipt>;Source line: 434.
rpc_client::SigilRpcClient::register_contract_code
Submit a signed RegisterContractCode transaction to the typed
contract-code registration endpoint.
pub async fn register_contract_code(
&self,
tx: &SignedTransaction,
) -> WalletResult<RegisterContractCodeResult>;Source line: 450.
rpc_client::SigilRpcClient::url
Returns the RPC endpoint URL (for display purposes).
pub fn url(&self) -> &str;Source line: 471.
rpc_client::SigilRpcClient::get_gal_hmr
Fetch the typed HmrAnchor for a DID, or None if the GAL has
no HMR anchor for it.
pub async fn get_gal_hmr(&self, did: &str) -> WalletResult<Option<sigil_core::HmrAnchor>>;Source line: 492.
rpc_client::SigilRpcClient::get_gal_mhr
Fetch the typed MhrAnchor for a DID.
pub async fn get_gal_mhr(&self, did: &str) -> WalletResult<Option<sigil_core::MhrAnchor>>;Source line: 497.
rpc_client::SigilRpcClient::get_gal_enr
Fetch the typed EnrAnchor for a DID.
pub async fn get_gal_enr(&self, did: &str) -> WalletResult<Option<sigil_core::EnrAnchor>>;Source line: 502.
rpc_client::SigilRpcClient::get_gal_org_root
Fetch the typed OrgLineageRoot for an org DID.
pub async fn get_gal_org_root(
&self,
org_did: &str,
) -> WalletResult<Option<sigil_core::OrgLineageRoot>>;Source line: 507.
rpc_client::SigilRpcClient::get_gal_shard
Fetch the typed shard summary for a subject DID. The optional
assignment field is None when the GAL has no shard
assignment for the DID; the topology vector carries any
relevant shard-topology lineage entries (split / merge
migrate).
pub async fn get_gal_shard(&self, did: &str) -> WalletResult<GalShard>;Source line: 519.
rpc_client::SigilRpcClient::check_gal_revocation
Revocation-first check. Returns the typed RevocationStatus
shape — revoked: bool plus an optional inline record. Wallet
callers MUST treat revoked == true as authoritative regardless
of any other state.
pub async fn check_gal_revocation(
&self,
did: &str,
) -> WalletResult<sigil_core::RevocationStatus>;Source line: 529.
rpc_client::SigilRpcClient::get_gal_shard_topology
Fetch the full shard topology snapshot.
pub async fn get_gal_shard_topology(&self) -> WalletResult<GalShardTopology>;Source line: 541.
rpc_client::GalShard
Wallet-side response shape for gal_getShard.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GalShard {
/// Current shard assignment for the subject, or `None` if the GAL
/// has no assignment for the DID.
#[serde(default)]
pub assignment: Option<sigil_core::ShardAssignment>,
/// Relevant topology lineage entries (split / merge / migrate
/// history). Empty when the shard is freshly added.
#[serde(default)]
pub topology: Vec<sigil_core::ShardTopologyEntry>
}Source line: 552.
rpc_client::GalShardTopology
Wallet-side response shape for gal_getShardTopology.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GalShardTopology {
/// All known shard-topology entries, in chronological order.
#[serde(default)]
pub entries: Vec<sigil_core::ShardTopologyEntry>
}Source line: 565.