Coinbase.Pro.REST.Request (coinbasepro_rest v1.0.0) View Source
Module responsible for wrapping logic of the HTTP requests issues to the Coinbase Pro API.
Example
alias Coinbase.Pro.REST.{Context,Request}
# Obtain these values from Coinbase
context = %Context{key: "...", secret: "...", passphrase: "..."}
{:ok, response} = Request.get(context, "/orders?limit=10")
Link to this section Summary
Link to this section Functions
Specs
get(Coinbase.Pro.REST.Context.t(), Tesla.Env.url(), [Tesla.option()]) :: {:ok, Coinbase.Pro.REST.Response.t()} | {:error, {:http, any()}} | {:error, {:code, pos_integer(), any()}}
Issues a signed GET request to the Coinbase Pro REST API.
On success it returns {:ok, response}
where response is
a Response
struct.
On error it returns either {:error, {:http, reason}}
when
underlying HTTP call has failed or {:error, {:code, code, body}}
when the HTTP call suceeded but it returned unexpected status
code.
Specs
get_all(Coinbase.Pro.REST.Context.t(), Tesla.Env.url(), [Tesla.option()]) :: {:ok, Coinbase.Pro.REST.Response.t()} | {:error, {:http, any()}} | {:error, {:code, pos_integer(), any()}}
Works similarly to get/3
but issues multiple requests
to handle pagination and fetch the whole collection.
Issues a signed POST request to the Coinbase Pro REST API.
On success it returns {:ok, response}
where response is
a Response
struct.
On error it returns either {:error, {:http, reason}}
when
underlying HTTP call has failed or {:error, {:code, code, body}}
when the HTTP call suceeded but it returned unexpected status
code.