# Class BSV::Wallet::Substrates::HTTPWalletWire <a id="class-BSV-Wallet-Substrates-HTTPWalletWire"></a>

**Inherits:** `Object`
**Includes:** `BSV::Wallet::WalletWire`

Concrete {WalletWire} implementation over HTTP/HTTPS.

Transmits binary BRC-103 request frames via HTTP POST to `{base_url}/wallet`
using `Content-Type: application/octet-stream`, and returns the raw binary
response body.

The optional <code>http_client:</code> parameter accepts any object responding
to `#request(uri, net_http_request)` — matching the injectable client
convention used throughout this SDK. When omitted, <code>Net::HTTP</code> is
used directly.

**@example Direct wire usage**
```ruby
wire   = BSV::Wallet::Substrates::HTTPWalletWire.new(base_url: 'https://wallet.example')
client = BSV::Wallet::WalletWireTransceiver.new(wire)
client.get_network  #=> { network: :mainnet }
```

**@example Convenience factory**
```ruby
client = BSV::Wallet::Substrates::HTTPWalletWire.client(base_url: 'https://wallet.example')
client.get_network  #=> { network: :mainnet }
```

## Public Class Methods
### `client(base_url:, http_client: = nil, headers: = {})` <a id="method-c-client"></a> <a id="client-class_method"></a>
Convenience factory: wraps a new {HTTPWalletWire} in a
{WalletWireTransceiver}.
- **@param** `base_url` [String]
- **@param** `http_client` [#request, nil]
- **@param** `headers` [Hash]
- **@return** [WalletWireTransceiver]

## Public Instance Methods
### `initialize(base_url:, http_client: = nil, headers: = {})` <a id="method-i-initialize"></a> <a id="initialize-instance_method"></a>
- **@param** `base_url` [String] wallet base URL (e.g. 'https://wallet.example')
- **@param** `http_client` [#request, nil] injectable HTTP client for testing;
must respond to +#request(uri, net_http_request)+. Defaults to +Net::HTTP+.
- **@param** `headers` [Hash] additional headers merged into every request
- **@return** [HTTPWalletWire] a new instance of HTTPWalletWire

### `transmit_to_wallet(message)` <a id="method-i-transmit_to_wallet"></a> <a id="transmit_to_wallet-instance_method"></a>
POST binary frame to `{base_url}/wallet` and return the binary response body.
- **@param** `message` [String] binary request frame (ASCII-8BIT)
- **@raise** [BSV::Wallet::Error] on non-2xx HTTP status or network failure
- **@return** [String] binary result frame (ASCII-8BIT)
