Class: BSV::Network::Providers::TAAL
- Inherits:
-
Object
- Object
- BSV::Network::Providers::TAAL
- Defined in:
- lib/bsv/network/providers/taal.rb
Overview
TAAL returns pre-configured Provider instances using the TAAL infrastructure.
Mainnet composes two protocols:
-
ARC at
https://arc.taal.comfor standard ARC operations -
TAALBinary at
https://api.taal.comfor binary broadcast
ARC is registered first, so :broadcast is served by ARC (first-registered wins). TAALBinary registers its own :broadcast command but will not win the index. To use TAALBinary directly, call provider.protocol_for(:broadcast) on the TAALBinary instance via provider.protocols.last, or build a custom Provider.
There is no TAAL testnet default — TAAL does not publish a supported testnet ARC URL.
Example
provider = BSV::Network::Providers::TAAL.mainnet(api_key: 'mainnet_...')
provider.call(:broadcast, tx)
Class Method Summary collapse
-
.default(testnet: false, **opts) ⇒ Provider
Returns a mainnet or testnet Provider depending on the
testnet:flag. -
.mainnet(**opts) ⇒ Provider
Returns a mainnet Provider configured with ARC and TAALBinary.
-
.testnet(**opts) ⇒ Provider
Returns a testnet Provider configured with ARC only.
Class Method Details
.default(testnet: false, **opts) ⇒ Provider
Returns a mainnet or testnet Provider depending on the testnet: flag.
51 52 53 |
# File 'lib/bsv/network/providers/taal.rb', line 51 def self.default(testnet: false, **opts) testnet ? testnet(**opts) : mainnet(**opts) end |
.mainnet(**opts) ⇒ Provider
Returns a mainnet Provider configured with ARC and TAALBinary.
28 29 30 31 32 33 34 |
# File 'lib/bsv/network/providers/taal.rb', line 28 def self.mainnet(**opts) common = opts.slice(:api_key, :http_client) Provider.new('TAAL') do |p| p.protocol Protocols::ARC, base_url: 'https://arc.taal.com', **opts p.protocol Protocols::TAALBinary, base_url: 'https://api.taal.com', **common end end |