class Banano::Protocol

Attributes

node[R]

Public Class Methods

new(uri: Client::LOCAL_ENDPOINT, timeout: Client::DEFAULT_TIMEOUT) click to toggle source
# File lib/banano.rb, line 9
def initialize(uri: Client::LOCAL_ENDPOINT, timeout: Client::DEFAULT_TIMEOUT)
  @node = Node.new(uri: uri, timeout: timeout)
end

Public Instance Methods

account(address) click to toggle source

Returns a new instance of {Banano::Account}.

Example:

account = Banano::Protocol.new.account(address: "ban_3e3j...")

@param address [String] the id of the account you want to work with @return [Banano::Account]

# File lib/banano.rb, line 20
def account(address)
  Banano::Account.new(node: @node, address: address)
end
block(block) click to toggle source

Returns a new instance of {Banano::Block}.

Example:

block = Banano::Protocol.new.block("FBF8B0E...")

@param block [String] the id/hash of the block you want to work with @return [Banano::Block]

# File lib/banano.rb, line 31
def block(block)
  Banano::Block.new(node: @node, block: block)
end
key(key = nil) click to toggle source

Returns a new instance of {Banano::Key}.

Example:

key = Banano::Protocol.new.key("3068BB...")

@param key [String] a private key @return [Banano::Key]

# File lib/banano.rb, line 42
def key(key = nil)
  Banano::Key.new(node: @node, key: key)
end
wallet(wallet = nil) click to toggle source

Returns a new instance of {Banano::Wallet}.

Example:

wallet = Banano::Protocol.new.wallet("000D1BAE...")

@param wallet [String] the id of the wallet you want to work with @return [Banano::Wallet]

# File lib/banano.rb, line 53
def wallet(wallet = nil)
  Banano::Wallet.new(node: @node, wallet: wallet)
end