Class: Chain::Client
- Inherits:
-
Object
- Object
- Chain::Client
- Defined in:
- lib/chain/client.rb
Instance Method Summary collapse
- #access_tokens ⇒ AccessToken::ClientModule
- #accounts ⇒ Account::ClientModule
- #assets ⇒ Asset::ClientModule
- #balances ⇒ Balance::ClientModule
- #config ⇒ Config::ClientModule
- #conn ⇒ Connection
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
- #mock_hsm ⇒ MockHSM::ClientModule
- #opts ⇒ Object
- #transaction_feeds ⇒ TransactionFeed::ClientModule
- #transactions ⇒ Transaction::ClientModule
- #unspent_outputs ⇒ UnspentOutput::ClientModule
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
16 17 18 |
# File 'lib/chain/client.rb', line 16 def initialize(opts = {}) @opts = {url: DEFAULT_API_HOST}.merge(opts) end |
Instance Method Details
#access_tokens ⇒ AccessToken::ClientModule
30 31 32 |
# File 'lib/chain/client.rb', line 30 def access_tokens @access_tokens ||= AccessToken::ClientModule.new(self) end |
#accounts ⇒ Account::ClientModule
35 36 37 |
# File 'lib/chain/client.rb', line 35 def accounts @accounts ||= Account::ClientModule.new(self) end |
#assets ⇒ Asset::ClientModule
40 41 42 |
# File 'lib/chain/client.rb', line 40 def assets @assets ||= Asset::ClientModule.new(self) end |
#balances ⇒ Balance::ClientModule
45 46 47 |
# File 'lib/chain/client.rb', line 45 def balances @balances ||= Balance::ClientModule.new(self) end |
#config ⇒ Config::ClientModule
50 51 52 |
# File 'lib/chain/client.rb', line 50 def config @config ||= Config::ClientModule.new(self) end |
#conn ⇒ Connection
25 26 27 |
# File 'lib/chain/client.rb', line 25 def conn @conn ||= Connection.new(@opts) end |
#mock_hsm ⇒ MockHSM::ClientModule
55 56 57 |
# File 'lib/chain/client.rb', line 55 def mock_hsm @mock_hsm ||= MockHSM::ClientModule.new(self) end |
#opts ⇒ Object
20 21 22 |
# File 'lib/chain/client.rb', line 20 def opts @opts.dup end |
#transaction_feeds ⇒ TransactionFeed::ClientModule
65 66 67 |
# File 'lib/chain/client.rb', line 65 def transaction_feeds @transaction_feeds ||= TransactionFeed::ClientModule.new(self) end |
#transactions ⇒ Transaction::ClientModule
60 61 62 |
# File 'lib/chain/client.rb', line 60 def transactions @transactions ||= Transaction::ClientModule.new(self) end |
#unspent_outputs ⇒ UnspentOutput::ClientModule
70 71 72 |
# File 'lib/chain/client.rb', line 70 def unspent_outputs @unspent_outputs ||= UnspentOutput::ClientModule.new(self) end |