Method: Hive::Broadcast.limit_order_create
- Defined in:
- lib/hive/broadcast.rb
.limit_order_create(options, &block) ⇒ Object
This operation creates a limit order and matches it against existing open orders.
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/hive/broadcast.rb', line 365 def self.limit_order_create(, &block) required_fields = %i(owner orderid amount_to_sell min_to_receive fill_or_kill) params = [:params] check_required_fields(params, *required_fields) params[:amount_to_sell] = normalize_amount(.merge amount: params[:amount_to_sell]) params[:min_to_receive] = normalize_amount(.merge amount: params[:min_to_receive]) if !!params[:expiration] params[:expiration] = Time.parse(params[:expiration].to_s) params[:expiration] = params[:expiration].strftime('%Y-%m-%dT%H:%M:%S') end ops = [[:limit_order_create, params]] process(.merge(ops: ops), &block) end |