class Bitshares::Wallet

Attributes

account[R]
name[R]

Public Class Methods

new(name) click to toggle source
# File lib/bitshares/wallet.rb, line 7
def initialize(name)
  @name = name
  @account = nil
  @password = Bitshares.config[:wallet][@name]
end

Public Instance Methods

closed?() click to toggle source
# File lib/bitshares/wallet.rb, line 35
def closed?
  !open?
end
lock() click to toggle source
# File lib/bitshares/wallet.rb, line 21
def lock
  open # must be opened first
  CLIENT.request 'wallet_lock'
end
locked?() click to toggle source
# File lib/bitshares/wallet.rb, line 44
def locked?
  !unlocked?
end
method_missing(m, *args) click to toggle source
# File lib/bitshares/wallet.rb, line 48
def method_missing(m, *args)
  CLIENT.request('wallet_' + m.to_s, args)
end
open() click to toggle source
# File lib/bitshares/wallet.rb, line 17
def open
  CLIENT.request('wallet_open', [@name])
end
open?() click to toggle source
# File lib/bitshares/wallet.rb, line 31
def open?
  self.get_info['open']
end
unlock(timeout = 1776) click to toggle source
# File lib/bitshares/wallet.rb, line 26
def unlock(timeout = 1776)
  open # must be opened first
  CLIENT.request('wallet_unlock', [timeout, @password])
end
unlocked?() click to toggle source
# File lib/bitshares/wallet.rb, line 39
def unlocked?
  open
  get_info['unlocked']
end