class Cryptopay::ExchangeTransfers

Attributes

connection[R]

Public Class Methods

new(connection) click to toggle source
# File lib/cryptopay/api/exchange_transfers.rb, line 8
def initialize(connection)
  @connection = connection
end

Public Instance Methods

commit(exchange_transfer_id, _opts = {}) click to toggle source

Commit an exchange transfer @param exchange_transfer_id [String] Exchange transfer ID @param [Hash] opts the optional parameters @return [ExchangeTransferResult]

# File lib/cryptopay/api/exchange_transfers.rb, line 16
def commit(exchange_transfer_id, _opts = {})
  path = '/api/exchange_transfers/{exchange_transfer_id}/commit'
  path = path.sub('{exchange_transfer_id}', CGI.escape(exchange_transfer_id.to_s))

  req = Request.new(
    method: :post,
    path: path
  )

  connection.call(req, return_type: ExchangeTransferResult)
end
create(exchange_transfer_params, _opts = {}) click to toggle source

Create an exchange transfer @param exchange_transfer_params [ExchangeTransferParams] @param [Hash] opts the optional parameters @return [ExchangeTransferResult]

# File lib/cryptopay/api/exchange_transfers.rb, line 32
def create(exchange_transfer_params, _opts = {})
  path = '/api/exchange_transfers'

  req = Request.new(
    method: :post,
    path: path,
    body_params: exchange_transfer_params
  )

  connection.call(req, return_type: ExchangeTransferResult)
end
retrieve(exchange_transfer_id, _opts = {}) click to toggle source

Retrieve an exchange transfer @param exchange_transfer_id [String] Exchange transfer ID @param [Hash] opts the optional parameters @return [ExchangeTransferResult]

# File lib/cryptopay/api/exchange_transfers.rb, line 48
def retrieve(exchange_transfer_id, _opts = {})
  path = '/api/exchange_transfers/{exchange_transfer_id}'
  path = path.sub('{exchange_transfer_id}', CGI.escape(exchange_transfer_id.to_s))

  req = Request.new(
    method: :get,
    path: path
  )

  connection.call(req, return_type: ExchangeTransferResult)
end