Class BSV::Network::Protocols::ARC ¶
Inherits: BSV::Network::Protocol
ARC protocol implementation for submitting transactions to the BSV network.
Extends Protocol with five endpoints and two escape hatches for broadcast logic: EF format preference, rejection detection, and custom headers.
The protocol returns Result objects (never raises). The facade layer (Phase D) is responsible for translating Results to BroadcastResponse / BroadcastError as needed by consumer code.
Example¶
arc = BSV::Network::Protocols::ARC.new(
base_url: 'https://arc.taal.com',
api_key: 'my-api-key'
)
result = arc.call(:broadcast, tx)
result.success? # => true
result.data[:txid] # => "abc123..."
Constants¶
ORPHAN_MARKER ¶
Substring marker for orphan detection in txStatus or extraInfo fields.
REJECTED_STATUSES ¶
ARC response statuses that indicate a transaction was NOT accepted. Matches the TypeScript SDK's ARC broadcaster failure set.
Public Instance Methods¶
initialize(base_url:, api_key: = nil, network: = nil, deployment_id: = nil, callback_url: = nil, callback_token: = nil, http_client: = nil) ¶
- @param
base_url[String] ARC base URL (may contain {network}) - @param
api_key[String, nil] optional bearer token - @param
network[String, nil] network name for base URL interpolation - @param
deployment_id[String, nil] deployment identifier for the XDeployment-ID header; defaults to a per-instance random hex value - @param
callback_url[String, nil] optional X-CallbackUrl header value - @param
callback_token[String, nil] optional X-CallbackToken header value - @param
http_client[#request, nil] injectable HTTP client for testing - @return [ARC] a new instance of ARC