Module: Etherlite
- Extended by:
- Api::Node
- Defined in:
- lib/etherlite.rb,
lib/etherlite/abi.rb,
lib/etherlite/utils.rb,
lib/etherlite/client.rb,
lib/etherlite/errors.rb,
lib/etherlite/address.rb,
lib/etherlite/api/rpc.rb,
lib/etherlite/railtie.rb,
lib/etherlite/version.rb,
lib/etherlite/api/node.rb,
lib/etherlite/connection.rb,
lib/etherlite/api/address.rb,
lib/etherlite/transaction.rb,
lib/etherlite/account/local.rb,
lib/etherlite/configuration.rb,
lib/etherlite/nonce_manager.rb,
lib/etherlite/api/parity_rpc.rb,
lib/etherlite/event_provider.rb,
lib/etherlite/account/anonymous.rb,
lib/etherlite/account/private_key.rb,
lib/generators/etherlite/init_generator.rb
Defined Under Namespace
Modules: Abi, Account, Api, Contract, EventProvider, Railties, Support, Types, Utils
Classes: Address, Client, Configuration, Connection, Error, InitGenerator, NodeError, NonceManager, NotSupportedError, RPCError, Railtie, Transaction, UnlinkedContractError
Constant Summary
collapse
- VERSION =
'0.6.0'.freeze
Class Method Summary
collapse
Methods included from Api::Node
accounts, anonymous_account, default_account, get_block_number, get_gas_price, get_logs, get_transaction, load_account, load_address, load_transaction, register_account
#address, #get_balance
Class Method Details
.config ⇒ Object
64
65
66
|
# File 'lib/etherlite.rb', line 64
def self.config
@config ||= Configuration.new
end
|
72
73
74
75
|
# File 'lib/etherlite.rb', line 72
def self.configure(_options = nil, &_block)
config.assign_attributes(_options) unless _options.nil?
_block.call(config) unless _block.nil?
end
|
.connect(_url, _options = {}) ⇒ Object
55
56
57
58
59
60
61
62
|
# File 'lib/etherlite.rb', line 55
def self.connect(_url, _options = {})
_url = URI(_url) unless _url.is_a? URI
options = config.default_connection_options
options = options.merge _options.slice(*options.keys)
Client.new Connection.new(_url, options)
end
|
.connection ⇒ Object
77
78
79
|
# File 'lib/etherlite.rb', line 77
def self.connection
@connection ||= Connection.new(URI(config.url), config.default_connection_options)
end
|
.logger ⇒ Object
68
69
70
|
# File 'lib/etherlite.rb', line 68
def self.logger
config.logger
end
|
.valid_address?(_value) ⇒ Boolean
51
52
53
|
# File 'lib/etherlite.rb', line 51
def self.valid_address?(_value)
Utils.valid_address? _value
end
|