lib/katapaty/party.rb in katapaty-0.5.1 vs lib/katapaty/party.rb in katapaty-1.0.0

- old
+ new

@@ -4,33 +4,37 @@ module Katapaty class Party class << self def get_running_info - request(__method__.to_s) + request('get_running_info') end def address_token_balance(address, token_name) rs = request('get_balances', {"filters": [{ "field": 'address', "op": '==', "value": address }, { "field": 'asset', "op": '==', "value": token_name }]}) return 0 if rs.blank? rs.first['quantity'].to_i end def get_asset_info(assets) - request(__method__, { assets: assets }) + request('get_asset_info', { assets: assets }) end def get_blocks(block_indexes) - request(__method__, { block_indexes: block_indexes }) + request('get_blocks', { block_indexes: block_indexes }) end def getrawtransaction(tx_hash) - request(__method__, { tx_hash: tx_hash }) + request('getrawtransaction', { tx_hash: tx_hash }) end def create_send(payload) - request(__method__, payload) + request('create_send', payload) + end + + def create_order(payload) + request('create_order', payload) end def btc_unconfirm_balance(address) (unspent_txouts(address).map { |a| a['amount'] }.sum.to_d * 1e8).to_i end