Module BSV::Wallet::Client::Network ¶
Blockchain and network data methods for {Client}.
Public Instance Methods¶
get_header_for_height(args, originator: = nil) ¶
Returns the block header at the given height.
Delegates to the substrate when configured; falls back to the local chain data source otherwise.
Note: BRC-100 specifies +{ header: String }+ (80-byte raw hex), but the local fallback returns the richer WoC JSON hash (containing hash, merkleroot, previousblockhash, time, nonce, bits, version, and height) under the header key. This is strictly more useful for local callers and avoids error-prone byte-order reassembly.
Warning: the WalletWire binary serialiser expects header to be a hex string. This local fallback should not be used behind a wire transport without first converting the JSON hash to raw 80-byte hex. - @option args - @param args [Hash] - @raise [UnsupportedActionError] - @return [Hash] { header: Hash } WoC block header JSON
get_height(args = {}, originator: = nil) ¶
Returns the current blockchain height.
Delegates to the substrate when configured. Falls back to the local chain data source when present. Raises {UnsupportedActionError} when neither is available. - @raise [UnsupportedActionError] - @return [Hash] { height: Integer }
get_network(args = {}, originator: = nil) ¶
Returns the network this wallet is configured for. - @return [Hash] { network: String } 'mainnet' or 'testnet'
get_version(args = {}, originator: = nil) ¶
Returns the wallet version string. - @return [Hash] { version: String } in vendor-major.minor.patch format