Aurum.Coinbase (aurum v0.2.0)

This module provides abstractions around basic HTTP methods within the context of the coinbase ecosystem. It takes care of using your Coinbase API Key/Secret to generate the required HMAC authentication signature based on the current timestamp so that the consumer of this module can focus on application logic.

Link to this section Summary

Functions

Perform a signed delete request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

Perform a signed get request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

Perform a signed put request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

Perform a signed post request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

Perform a signed put request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

Link to this section Functions

Specs

delete(path :: String.t()) :: map()

Perform a signed delete request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

Specs

get(path :: String.t()) :: map()

Perform a signed get request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

Link to this function

patch(path, body)

Specs

patch(path :: String.t(), body :: map()) :: map()

Perform a signed put request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

The request body can be in the form of a map for your convienience, for example:

Coinbase.patch("/v2/some/resource", %{total: 10, currency: "USD"})

Is equivalent to:

Coinbase.patch("/v2/some/resource", ~S({"total": "10", "currency": "USD"}))
Link to this function

post(path, body)

Specs

post(path :: String.t(), body :: map()) :: map()

Perform a signed post request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

The request body can be in the form of a map for your convienience, for example:

Coinbase.post("/v2/accounts/<account_id>/sells", %{total: 10, currency: "USD"})

Is equivalent to:

Coinbase.post("/v2/accounts/<account_id>/sells", ~S({"total": "10", "currency": "USD"}))
Link to this function

put(path, body)

Specs

put(path :: String.t(), body :: map()) :: map()

Perform a signed put request to the specified path. Due to some of the implementation details the path string must begin with /v2 in order to correctly call the API.

The request body can be in the form of a map for your convienience, for example:

Coinbase.put("/v2/some/resource", %{total: 10, currency: "USD"})

Is equivalent to:

Coinbase.put("/v2/some/resource", ~S({"total": "10", "currency": "USD"}))