# Class BSV::Network::Providers::WhatsOnChain <a id="class-BSV-Network-Providers-WhatsOnChain"></a>

**Inherits:** `Object`

WhatsOnChain returns pre-configured Provider instances using the WhatsOnChain
REST API (WoCREST protocol).

The base URL is fully resolved per network — no +{network}+ template is used
in provider defaults. The WoCREST protocol's <code>network:</code> param is
omitted since the URL already encodes the network segment.

## Example

    provider = BSV::Network::Providers::WhatsOnChain.mainnet
    provider.call(:get_tx, 'abc123...')

    provider = BSV::Network::Providers::WhatsOnChain.mainnet(auth: { api_key: 'my-key' })
    provider.call(:broadcast, tx)

    # Legacy api_key: shorthand — still supported
    provider = BSV::Network::Providers::WhatsOnChain.testnet(api_key: 'my-key')

## Constants
### `DEFAULT_RATE_LIMIT` <a id="constant-DEFAULT_RATE_LIMIT"></a> <a id="DEFAULT_RATE_LIMIT-constant"></a>
Default requests-per-second limit for unauthenticated use.

## Public Class Methods
### `default(testnet: = false, network: = nil, auth: = nil, rate_limit: = DEFAULT_RATE_LIMIT, **opts)` <a id="method-c-default"></a> <a id="default-class_method"></a>
Returns a Provider for the given network.
- **@param** `testnet` [Boolean] when true, returns the testnet Provider
- **@param** `network` [Symbol, nil] explicit network (:main, :test, :stn) — overrides +testnet:+
- **@param** `auth` [Hash, Symbol, nil] auth config forwarded to Provider and WoCREST protocol
- **@param** `rate_limit` [Numeric, nil] requests per second; defaults to +DEFAULT_RATE_LIMIT+
- **@param** `opts` [Hash] keyword arguments forwarded to the WoCREST protocol constructor
- **@return** [Provider]

### `mainnet(auth: = nil, rate_limit: = DEFAULT_RATE_LIMIT, **opts)` <a id="method-c-mainnet"></a> <a id="mainnet-class_method"></a>
Returns a mainnet Provider configured with WoCREST.
- **@param** `auth` [Hash, Symbol, nil] auth config forwarded to Provider and WoCREST protocol
- **@param** `rate_limit` [Numeric, nil] requests per second; defaults to +DEFAULT_RATE_LIMIT+
- **@param** `opts` [Hash] keyword arguments forwarded to the WoCREST protocol constructor
- **@return** [Provider]

### `stn(auth: = nil, rate_limit: = DEFAULT_RATE_LIMIT, **opts)` <a id="method-c-stn"></a> <a id="stn-class_method"></a>
Returns a Provider for the BSV Scaling Test Network (STN).
- **@param** `auth` [Hash, Symbol, nil] auth config forwarded to Provider and WoCREST protocol
- **@param** `rate_limit` [Numeric, nil] requests per second; defaults to +DEFAULT_RATE_LIMIT+
- **@param** `opts` [Hash] keyword arguments forwarded to the WoCREST protocol constructor
- **@return** [Provider]

### `testnet(auth: = nil, rate_limit: = DEFAULT_RATE_LIMIT, **opts)` <a id="method-c-testnet"></a> <a id="testnet-class_method"></a>
Returns a testnet Provider configured with WoCREST.
- **@param** `auth` [Hash, Symbol, nil] auth config forwarded to Provider and WoCREST protocol
- **@param** `rate_limit` [Numeric, nil] requests per second; defaults to +DEFAULT_RATE_LIMIT+
- **@param** `opts` [Hash] keyword arguments forwarded to the WoCREST protocol constructor
- **@return** [Provider]
