Skip to content

Class BSV::Wallet::WalletWireProcessor

Inherits: Object Includes: BSV::Wallet::WalletWire

Server-side BRC-103 dispatcher.

Takes any {Interface::BRC100} implementation and exposes it as a {WalletWire}. Decodes incoming binary request frames, dispatches to the wallet, serialises the result, and returns a binary result frame.

Error boundary: any {Error} from the wallet is serialised into an error frame so the client can rehydrate it. Any other {StandardError} is wrapped in {Error} (code 1) before framing — the processor never lets a Ruby exception propagate past this boundary.

@example Wrap a ProtoWallet for loopback testing

processor = BSV::Wallet::WalletWireProcessor.new(proto_wallet)
transceiver = BSV::Wallet::WalletWireTransceiver.new(processor)

Public Instance Methods

initialize(wallet)

  • @param wallet [Interface::BRC100] any BRC-100 wallet implementation
  • @return [WalletWireProcessor] a new instance of WalletWireProcessor

transmit_to_wallet(request_bytes)

Process a binary request frame and return a binary result frame. - @param request_bytes [String] binary request frame - @return [String] binary result frame (success or error)