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
- #authorization_grants ⇒ AuthorizationGrant::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.
17 18 19 |
# File 'lib/chain/client.rb', line 17 def initialize(opts = {}) @opts = {url: DEFAULT_API_HOST}.merge(opts) end |
Instance Method Details
#access_tokens ⇒ AccessToken::ClientModule
31 32 33 |
# File 'lib/chain/client.rb', line 31 def access_tokens @access_tokens ||= AccessToken::ClientModule.new(self) end |
#accounts ⇒ Account::ClientModule
41 42 43 |
# File 'lib/chain/client.rb', line 41 def accounts @accounts ||= Account::ClientModule.new(self) end |
#assets ⇒ Asset::ClientModule
46 47 48 |
# File 'lib/chain/client.rb', line 46 def assets @assets ||= Asset::ClientModule.new(self) end |
#authorization_grants ⇒ AuthorizationGrant::ClientModule
36 37 38 |
# File 'lib/chain/client.rb', line 36 def @authorization_grants ||= AuthorizationGrant::ClientModule.new(self) end |
#balances ⇒ Balance::ClientModule
51 52 53 |
# File 'lib/chain/client.rb', line 51 def balances @balances ||= Balance::ClientModule.new(self) end |
#config ⇒ Config::ClientModule
56 57 58 |
# File 'lib/chain/client.rb', line 56 def config @config ||= Config::ClientModule.new(self) end |
#conn ⇒ Connection
26 27 28 |
# File 'lib/chain/client.rb', line 26 def conn @conn ||= Connection.new(@opts) end |
#mock_hsm ⇒ MockHSM::ClientModule
61 62 63 |
# File 'lib/chain/client.rb', line 61 def mock_hsm @mock_hsm ||= MockHSM::ClientModule.new(self) end |
#opts ⇒ Object
21 22 23 |
# File 'lib/chain/client.rb', line 21 def opts @opts.dup end |
#transaction_feeds ⇒ TransactionFeed::ClientModule
71 72 73 |
# File 'lib/chain/client.rb', line 71 def transaction_feeds @transaction_feeds ||= TransactionFeed::ClientModule.new(self) end |
#transactions ⇒ Transaction::ClientModule
66 67 68 |
# File 'lib/chain/client.rb', line 66 def transactions @transactions ||= Transaction::ClientModule.new(self) end |
#unspent_outputs ⇒ UnspentOutput::ClientModule
76 77 78 |
# File 'lib/chain/client.rb', line 76 def unspent_outputs @unspent_outputs ||= UnspentOutput::ClientModule.new(self) end |