class BitShares::Client

Defined in:

bitshares-crystal/client.cr

Constructors

Instance Method Summary

Instance methods inherited from class BitShares::GrapheneConnection

application_options : JSON::Any | Nil application_options, batch_call_api(*args) batch_call_api, call_api(api_name, method, params = nil, callback : GrapheneWebSocket::SubscribeCallbackType | Nil = nil) call_api, call_asset(method, params = nil, callback : GrapheneWebSocket::SubscribeCallbackType | Nil = nil) call_asset, call_custom_operations(method, params = nil, callback : GrapheneWebSocket::SubscribeCallbackType | Nil = nil) call_custom_operations, call_db(method, params = nil, callback : GrapheneWebSocket::SubscribeCallbackType | Nil = nil) call_db, call_history(method, params = nil, callback : GrapheneWebSocket::SubscribeCallbackType | Nil = nil) call_history, call_net(method, params = nil, callback : GrapheneWebSocket::SubscribeCallbackType | Nil = nil) call_net, close close, config : BitShares::Config config, graphene_address_prefix : String graphene_address_prefix, graphene_chain_config : JSON::Any | Nil graphene_chain_config, graphene_chain_id : String graphene_chain_id, graphene_chain_properties : JSON::Any | Nil graphene_chain_properties, graphene_core_asset_symbol : String graphene_core_asset_symbol

Constructor methods inherited from class BitShares::GrapheneConnection

new(config : BitShares::Config) new

Constructor Detail

def self.new(config_object : BitShares::Config | Nil = nil) #

[View source]

Instance Method Detail

def cache : Cache #

获取关联的 #cache 对象。


[View source]
def do_account_create(registrar, referrer, referrer_percent, voting_account, name, owner_public_key, active_public_key, memo_public_key = nil) #

[View source]
def do_account_storage_map(account, remove, catalog, key_values) #

[View source]
def do_account_storage_map_core(account, account_storage_map_opdata) #

OP - 存储账号自定义数据(REMARK:在 custom OP 的 data 字段中存储数据)


[View source]
def do_account_upgrade(account) #

[View source]
def do_assert(op_data) #

[View source]
def do_asset_create(issuer, symbol : String, precision : UInt8, common_options, bitasset_opts = nil, is_prediction_market = false) #

[View source]
def do_asset_publish_feed(publisher_id, core_asset, feeds) #

OP - 发布喂价 TODO:ing


[View source]
def do_balance_claim(deposit_to_account, balance_to_claim, balance_owner_key, total_claimed_amount, total_claimed_asset_id) #

[View source]
def do_liquidity_pool_create(account, asset_a, asset_b, share_asset, taker_fee_percent, withdrawal_fee_percent) #

[View source]
def do_liquidity_pool_delete(account, pool_or_id) #

[View source]
def do_liquidity_pool_deposit(account, pool_or_id, amount_a, amount_b) #

[View source]
def do_liquidity_pool_exchange(account, pool_or_id, sell_amount, sell_asset_id, receive_amount, receive_asset_id) #

[View source]
def do_liquidity_pool_withdraw(account, pool_or_id, share_amount) #

[View source]
def do_samet_fund_borrow(borrower, fund : JSON::Any | String, borrow_asset_id_or_symbol, borrow_amount) #

[View source]
def do_samet_fund_create(account, asset_id_or_symbol, balance, fee_rate) #

[View source]
def do_samet_fund_delete(account, fund : JSON::Any | String) #

[View source]
def do_samet_fund_repay(borrower, fund : JSON::Any | String, asset_id_or_symbol, repay_amount, fee_amount) #

[View source]
def do_transfer(from, to, asset_amount, asset_id, memo = nil) #

[View source]
def do_witness_update(witness_account_name_or_id, new_url = nil, new_signing_key = nil) #

OP - 更新见证人


[View source]
def fast_build(data_dynamic_global_properties, &) : Bytes #

=> REMARK: 需要手动设置 opdata 的 fee。


[View source]
def loop_new_block(sleep_interval = 0.2, &) #

[View source]
def make_account_create(registrar, referrer, referrer_percent, voting_account, name, owner_public_key, active_public_key, memo_public_key = nil, ext = nil) #

OP - 创建账号


[View source]
def make_account_upgrade(account) #

OP - 升级终生会员


[View source]
def make_assert_account(fee_account, account_id, account_name) #

OP - 断言


[View source]
def make_assert_asset(fee_account, asset_id, asset_symbol) #

[View source]
def make_assert_block(fee_account, block_id) #

[View source]
def make_asset_create(issuer, symbol : String, precision : UInt8, common_options, bitasset_opts = nil, is_prediction_market = false) #

TODO class OP_asset_create < T_composite add_field :fee, T_asset add_field :issuer, Tm_protocol_id_type(ObjectType::Account) add_field :symbol, T_string add_field :precision, T_uint8 add_field :common_options, T_asset_options add_field :bitasset_opts, Tm_optional(T_bitasset_options) add_field :is_prediction_market, T_bool add_field :extensions, Tm_set(T_future_extensions) end


[View source]
def make_balance_claim(deposit_to_account, balance_to_claim, balance_owner_key, total_claimed_amount, total_claimed_asset_id) #

OP - 提取资金


[View source]
def make_liquidity_pool_create(account, asset_a, asset_b, share_asset, taker_fee_percent, withdrawal_fee_percent) #

OP - 创建流动性池 taker_fee_percent - 有效值 0..100 单位:百分之1 withdrawal_fee_percent - 有效值 0..100 单位:百分之1


[View source]
def make_liquidity_pool_delete(account, pool_or_id) #

OP - 删除流动性池


[View source]
def make_liquidity_pool_deposit(account, pool_or_id, amount_a, amount_b) #

OP - 流动性池注资


[View source]
def make_liquidity_pool_exchange(account, pool_or_id, sell_amount, sell_asset_id, receive_amount, receive_asset_id) #

OP - 流动性池兑换


[View source]
def make_liquidity_pool_withdraw(account, pool_or_id, share_amount) #

OP - 流动性池撤资


[View source]
def make_samet_fund_borrow(borrower, fund : JSON::Any | String, borrow_asset_id_or_symbol, borrow_amount) #

[View source]
def make_samet_fund_create(account, asset_id_or_symbol, balance, fee_rate) #

[View source]
def make_samet_fund_delete(account, fund : JSON::Any | String) #

[View source]
def make_samet_fund_repay(borrower, fund : JSON::Any | String, asset_id_or_symbol, repay_amount, fee_amount) #

[View source]
def make_transfer(from, to, asset_amount, asset_id, memo = nil) #

OP - 转账操作 from 付款账号 to 收款账号 asset_amount 转账数量 asset_id 转账资产名称或ID。 memo 转账备注


[View source]
def query_account(account_name_or_id : String) : JSON::Any | Nil #

API - 查询账号信息。

DEPRECATED Use #query_account?


[View source]
def query_account!(account_name_or_id : String) : JSON::Any | Nil #

[View source]
def query_account?(account_name_or_id : String) : JSON::Any | Nil #

[View source]
def query_asset(asset_symbol_or_id : String) : JSON::Any | Nil #

API - 查询资产信息。

DEPRECATED Use #query_asset?


[View source]
def query_asset!(asset_symbol_or_id : String) : JSON::Any | Nil #

[View source]
def query_asset?(asset_symbol_or_id : String) : JSON::Any | Nil #

[View source]
def query_objects(object_id_or_id_array : String | Array(String)) : Hash(String, JSON::Any) #

API - 根据对象ID或者ID数组查询对象。


[View source]
def query_one_object(oid : String) : JSON::Any | Nil #

API - 根据对象ID查询对象。

DEPRECATED Use #query_one_object?


[View source]
def query_one_object!(oid : String) : JSON::Any #

[View source]
def query_one_object?(oid : String) : JSON::Any | Nil #

[View source]
def query_witness(witness_account_name_or_id) #

API - 查询见证人信息


[View source]
def query_witness_by_id(witness_account_id : String) : JSON::Any | Nil #

API - 根据见证人账号ID查询见证人信息


[View source]
def wallet : Wallet #

获取关联的 #wallet 对象。


[View source]