module BitShares

Constants

API
RPC
VERSION

Public Class Methods

account(name) click to toggle source
# File lib/bitshares.rb, line 33
def account name
        Account[name]
end
assets(*ids) click to toggle source
# File lib/bitshares.rb, line 41
def assets *ids
        Asset[*ids]
end
balance(name,*ids) click to toggle source
# File lib/bitshares.rb, line 37
def balance name,*ids
        Wallet[name,*ids]
end
config(autoconnect=true, &block) click to toggle source
# File lib/bitshares.rb, line 14
def config autoconnect=true, &block
        @node = 'wss://node.testnet.bitshares.eu'
        @login = ''
        @pass = ''
        instance_eval(&block) if block_given?
        start if autoconnect
end
list_assets(name, limit=1) click to toggle source
# File lib/bitshares.rb, line 45
def list_assets name, limit=1
        Asset.search name, limit
end
login(n=nil) click to toggle source
# File lib/bitshares.rb, line 23
def login(n=nil)      n ||= @login; @login = n; end
node(n=nil) click to toggle source
# File lib/bitshares.rb, line 22
def node(n=nil)               n ||= @node; @node = n;              end
pass(n=nil) click to toggle source
# File lib/bitshares.rb, line 24
def pass(n=nil)               n ||= @pass; @pass = n;              end
start() click to toggle source
# File lib/bitshares.rb, line 26
def start
        WSocket.start
        RPC.new(1,'login',[@login,@pass]).send
end
stop() click to toggle source
# File lib/bitshares.rb, line 31
def stop() WSocket.stop end
subscribe_callback(id, clear_filter=true) click to toggle source
# File lib/bitshares.rb, line 49
def subscribe_callback id, clear_filter=true
        RPC.new('set_subscribe_callback', [id, clear_filter]).send
end
transfer(that, amount, from, to) click to toggle source
# File lib/bitshares.rb, line 53
def transfer that, amount, from, to
        RPC.new 'transfer',[]
end