Class: Fcoin::EndPoint::OrdersTask

Inherits:
Thor
  • Object
show all
Defined in:
lib/fcoin/cli/endpoint/orders_task.rb

Instance Method Summary collapse

Instance Method Details

#cancelJSON

Note:

This method can not be invoked without authentication.

Cancel order.

curl: POST api.fcoin.com/v2/orders/$order_id/submit-cancel

Examples:

cancel order specified by order_id.

export FCOIN_API_KEY='your_fcoin_api_key'
export FCOIN_SECRET_KEY='your_fcoin_secret_key'
./exe/fcoin cancel_order --order_id nMEC_VrW0LYlP4iCcWzmdL50jFrvNWZoaQxvZSjeUSA=

Parameters:

  • order_id (String)

Returns:

  • (JSON)

Raises:

  • (ArgumentError)

    If the order_id does not have.

See Also:



117
# File 'lib/fcoin/cli/endpoint/orders_task.rb', line 117

desc 'cancel', 'Cancel order'

#create_limitJSON

Note:

This method can not be invoked without authentication.

Create limit order

curl: POST api.fcoin.com/v2/orders

Examples:

Create an order to sell 0.010eth at a price of 1000usdt.

export FCOIN_API_KEY='your_fcoin_api_key'
export FCOIN_SECRET_KEY='your_fcoin_secret_key'
./exe/fcoin order create_limit --symbol ethusdt --side sell --price 1000 --amount 0.001

Parameters:

  • symbol (String)

    Transaction of pair.

  • side (String)

    Direction of the transaction.

  • type (String)

    Order type.

  • price (Float)
  • amount (Float)

Returns:

  • (JSON)

    Returns receipt contains order_id.

Raises:

  • (ArgumentError)

    If the symbol or side or type or price or amount does not have.

  • (InvalidValueError)

    If symbol or side or type or price or amount is invalid.

See Also:



28
# File 'lib/fcoin/cli/endpoint/orders_task.rb', line 28

desc 'create_limit', 'Create limit order'

#listJSON

Note:

This method can not be invoked without authentication.

Get order list.

curl: GET api.fcoin.com/v2/orders

Examples:

get the canceled order list of ethusdt limit 20 per page.

export FCOIN_API_KEY='your_fcoin_api_key'
export FCOIN_SECRET_KEY='your_fcoin_secret_key'
./exe/fcoin order_list --symbol ethusdt, --states canceled --per_page 20

Parameters:

  • symbol (String)

    Transaction of pair.

  • states (String)

    Order states. states must be incldued in [submitted, partial_filled, canceled, partial_canceled, filled, pending_cancel]

  • page_before (Integer)

    Query order before page number.

  • page_after (Integer)

    Query order after page number.

  • per_page (Integer)

    Order quantity per page. default is 20.

Returns:

  • (JSON)

    Returns order list.

Raises:

  • (ArgumentError)

    If the symbol or states or per_page does not have.

  • (InvalidValueError)

    If symbol or states or per_page is invalid.

See Also:



63
# File 'lib/fcoin/cli/endpoint/orders_task.rb', line 63

desc 'list', 'Get order list'

#referenceJSON

Note:

This method can not be invoked without authentication.

Query order.

curl: GET api.fcoin.com/v2/orders/$order_id

Examples:

query order specified by order_id.

export FCOIN_API_KEY='your_fcoin_api_key'
export FCOIN_SECRET_KEY='your_fcoin_secret_key'
./exe/fcoin order --order_id L7rbALEIoI0ymo3uOXBF4gT4Bl********jvptIv2U=

Parameters:

  • order_id (String)

Returns:

  • (JSON)

    Returns order specified by order_id.

Raises:

  • (ArgumentError)

    If the order_id does not have.

See Also:



94
# File 'lib/fcoin/cli/endpoint/orders_task.rb', line 94

desc 'reference', 'Ouery order'

#transactionJSON

Note:

This method can not be invoked without authentication.

Query the transaction record for the specified by order_id.

curl: GET api.fcoin.com/v2/orders/$order_id/match-results

Examples:

Query the transaction record for the specified by order_id.

export FCOIN_API_KEY='your_fcoin_api_key'
export FCOIN_SECRET_KEY='your_fcoin_secret_key'
./exe/fcoin order_transaction --order_id kW3cRiXIGHG-cHNdter*********qfoMzbeHEQcqp4=

Parameters:

  • order_id (String)

Returns:

  • (JSON)

    Returns transaction record for the specified by order_id.

Raises:

  • (ArgumentError)

    If the order_id does not have.

See Also:



140
# File 'lib/fcoin/cli/endpoint/orders_task.rb', line 140

desc 'transaction', 'Query the transaction record for the specified by order_id'