Class BSV::Network::Protocols::TAALBinary ¶
Inherits: BSV::Network::Protocol
TAALBinary implements the TAAL broadcast API using raw binary transaction submission over HTTP.
TAAL quirks handled here: * Content-Type is application/octet-stream (not JSON) * Authorization header is applied via the standard apply_auth mechanism * A response containing txn-already-known in the error field is treated as success (the transaction is already in the mempool — idempotent)
Example¶
protocol = BSV::Network::Protocols::TAALBinary.new(
base_url: 'https://api.taal.com',
auth: { api_key: 'mainnet_your_key_here' }
)
result = protocol.call(:broadcast, tx)
puts result.data[:txid] if result.http_success?
- @see
https://docs.taal.comTAAL API documentation
Public Instance Methods¶
initialize(base_url:, api_key: = nil, auth: = nil, http_client: = nil) ¶
- @param
base_url[String] base URL for the TAAL binary API - @param
api_key[String, nil] legacy API key shorthand (no Bearer prefix) — use +auth:+ for new code - @param
auth[Hash, Symbol, nil] auth config; takes precedence over +api_key:+ - @param
http_client[Object, nil] injectable HTTP client for testing - @return [TAALBinary] a new instance of TAALBinary