Module: NOWPayments::API::Conversions
- Included in:
- Client
- Defined in:
- lib/nowpayments/api/conversions.rb
Overview
Conversion endpoints (requires JWT auth)
Instance Method Summary collapse
-
#conversion_status(conversion_id) ⇒ Hash
Get status of a specific conversion GET /v1/conversion/:conversion_id Requires JWT authentication.
-
#create_conversion(from_currency:, to_currency:, amount:) ⇒ Hash
Create a new conversion between currencies POST /v1/conversion Requires JWT authentication.
-
#list_conversions(limit: 10, offset: 0) ⇒ Hash
List all conversions with pagination GET /v1/conversion Requires JWT authentication.
Instance Method Details
#conversion_status(conversion_id) ⇒ Hash
Get status of a specific conversion GET /v1/conversion/:conversion_id Requires JWT authentication
27 28 29 |
# File 'lib/nowpayments/api/conversions.rb', line 27 def conversion_status(conversion_id) get("conversion/#{conversion_id}").body end |
#create_conversion(from_currency:, to_currency:, amount:) ⇒ Hash
Create a new conversion between currencies POST /v1/conversion Requires JWT authentication
14 15 16 17 18 19 20 |
# File 'lib/nowpayments/api/conversions.rb', line 14 def create_conversion(from_currency:, to_currency:, amount:) post("conversion", body: { from_currency: from_currency, to_currency: to_currency, amount: amount }).body end |
#list_conversions(limit: 10, offset: 0) ⇒ Hash
List all conversions with pagination GET /v1/conversion Requires JWT authentication
37 38 39 |
# File 'lib/nowpayments/api/conversions.rb', line 37 def list_conversions(limit: 10, offset: 0) get("conversion", params: { limit: limit, offset: offset }).body end |