{"id":21501578,"url":"https://github.com/alex0112/aurum","last_synced_at":"2025-07-01T10:03:24.672Z","repository":{"id":45313213,"uuid":"194204875","full_name":"alex0112/aurum","owner":"alex0112","description":"Coinbase API Wrapper","archived":false,"fork":false,"pushed_at":"2021-12-22T02:21:38.000Z","size":64,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-27T09:03:30.417Z","etag":null,"topics":["coinbase","coinbase-api","cryptocurrency","elixir"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/aurum","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alex0112.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-28T04:14:27.000Z","updated_at":"2025-02-19T23:45:22.000Z","dependencies_parsed_at":"2022-08-29T14:23:19.980Z","dependency_job_id":null,"html_url":"https://github.com/alex0112/aurum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alex0112/aurum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex0112%2Faurum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex0112%2Faurum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex0112%2Faurum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex0112%2Faurum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex0112","download_url":"https://codeload.github.com/alex0112/aurum/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex0112%2Faurum/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262941541,"owners_count":23388148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coinbase","coinbase-api","cryptocurrency","elixir"],"created_at":"2024-11-23T17:51:47.703Z","updated_at":"2025-07-01T10:03:24.646Z","avatar_url":"https://github.com/alex0112.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aurum\n\nAurum is an Elixir Client for the Coinbase API.\n\n\u003e If gold rusts, what then can iron do?\n\u003e ― Geoffrey Chaucer, The Canterbury Tales \n\n## Installation\nAdd `aurum` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:aurum, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\n## Usage: \n\n### API Key/Secret\nFirst, ensure that you have a coinbase API Key, and an API Secret. Details about how to obtain those can be found in the [Coinbase Documentation](https://developers.coinbase.com/docs/wallet/api-key-authentication).\n\nOnce you have obtained them, make sure that they are in the environment your module will be running in under the names `COINBASE_KEY` and `COINBASE_SECRET`:\n```bash\n$ export COINBASE_KEY=...\n$ export COINBASE_SECRET=...\n```\n\nThis will enable the client library to correctly sign your requests.\n\n### Making requests to the API:\nTo use the client, alias `Coinbase` into your module:\n\n```elixir\ndefmodule MyModule do\n   alias Aurum.Coinbase\n\n   ...\n\nend\n```\n\n### Basic Usage:\nOnce you have access to the `Coinbase` module, you can begin making any of the requests outlined in [the documentation](https://developers.coinbase.com/api/v2#introduction) for V2 of the Coinbase API. All of the authentication steps should be completed automatically provided the `COINBASE_KEY` and `COINBASE_SECRET` are properly set. All calls to the API should follow the pathing scheme of `/v2/\u003cresource path\u003e`. \n\nFor example:\n\n```elixir\ndef fetch_btc_account do\n  Coinbase.get(\"/v2/accounts/btc\")\nend\n```\n\nSucessful responses are always in the form of:\n```elixir\n%{\n  \"data\" =\u003e %{\n    ...\n  },\n  \"warnings\" =\u003e [ ## If any\n    \n  ]\n}\n```\n\nAnd for any HTTP verbs that require a body (i.e. PUT/PATCH/POST), the body may be defined as a bare map:\n```elixir\nCoinbase.post(\"/v2/...\", %{amount: 10, currency: \"USD\"})\n```\n\n...or as a valid JSON string:\n```elixir\nCoinbase.post(\"/v2/...\", ~S({\"amount\": \"10\", \"currency\": \"USD\"}))\n```\n\n### Example: Buy $10.00 worth of Ethereum\n```elixir\niex(1)\u003e alias Aurum.Coinbase\nAurum.Coinbase\niex(2)\u003e eth_account = Coinbase.get(\"/v2/accounts/eth\")\n%{\n  \"data\" =\u003e %{\n    \"allow_deposits\" =\u003e true,\n    \"allow_withdrawals\" =\u003e true,\n    \"balance\" =\u003e %{\"amount\" =\u003e \"\u003camount\u003e\", \"currency\" =\u003e \"ETH\"},\n    \"created_at\" =\u003e \"...\",\n    \"currency\" =\u003e %{\n      \"address_regex\" =\u003e \"...\",\n      \"asset_id\" =\u003e \"...\",\n      \"code\" =\u003e \"ETH\",\n      \"color\" =\u003e \"#627EEA\",\n      \"exponent\" =\u003e 8,\n      \"name\" =\u003e \"Ethereum\",\n      \"slug\" =\u003e \"ethereum\",\n      \"sort_index\" =\u003e 102,\n      \"type\" =\u003e \"crypto\"\n    },\n    \"id\" =\u003e \"...\",\n    \"name\" =\u003e \"ETH Wallet\",\n    \"primary\" =\u003e true,\n    \"resource\" =\u003e \"account\",\n    \"resource_path\" =\u003e \"/v2/accounts/\u003caccount_id\u003e\",\n    \"type\" =\u003e \"wallet\",\n    \"updated_at\" =\u003e \"2021-04-08T21:25:29Z\"\n  },\n}\niex(3)\u003e eth_resource = eth_account[\"data\"][\"resource_path\"]\n\"/v2/accounts/\u003caccount_id\u003e\"\niex(4)\u003e buy_string = eth_resource \u003c\u003e \"/buys\"\n\"/v2/accounts/\u003caccount_id\u003e/buys\"\niex(5)\u003e Coinbase.post(buy_string, %{amount: 10, currency: \"USD\"})\n%{\n  \"data\" =\u003e %{\n    \"amount\" =\u003e %{\"amount\" =\u003e \"0.00248885\", \"currency\" =\u003e \"ETH\"},\n    \"committed\" =\u003e true,\n    \"created_at\" =\u003e \"2021-12-22T01:02:32Z\",\n    \"fee\" =\u003e %{\"amount\" =\u003e \"0.99\", \"currency\" =\u003e \"USD\"},\n    \"hold_days\" =\u003e 3,\n    \"hold_until\" =\u003e \"2021-12-25T00:00:00Z\",\n    \"id\" =\u003e \"...\",\n    \"idem\" =\u003e \"...\",\n    \"instant\" =\u003e true,\n    \"is_first_buy\" =\u003e false,\n    \"next_step\" =\u003e nil,\n    \"payment_method\" =\u003e %{\n      \"id\" =\u003e \"...\",\n      \"resource\" =\u003e \"payment_method\",\n      \"resource_path\" =\u003e \"/v2/payment-methods/...\"\n    },\n    \"payout_at\" =\u003e \"2021-12-22T01:02:32Z\",\n    \"requires_completion_step\" =\u003e false,\n    \"resource\" =\u003e \"buy\",\n    \"resource_path\" =\u003e \"/v2/accounts/\u003caccount_id\u003e/buys/\u003cbuy_id\u003e\",\n    \"status\" =\u003e \"created\",\n    \"subtotal\" =\u003e %{\"amount\" =\u003e \"10.00\", \"currency\" =\u003e \"USD\"},\n    \"total\" =\u003e %{\"amount\" =\u003e \"10.99\", \"currency\" =\u003e \"USD\"},\n    \"transaction\" =\u003e nil,\n    \"unit_price\" =\u003e %{\"amount\" =\u003e \"4017.92\", \"currency\" =\u003e \"USD\", \"scale\" =\u003e 2},\n    \"updated_at\" =\u003e \"2021-12-22T01:02:33Z\",\n    \"user_reference\" =\u003e \"...\"\n  },\n}\n```\n\n## Known issues:\nYou may see this warning pop up from time to time:\n```\n17:55:32.021 [warn]  Description: 'Authenticity is not established by certificate path validation'\n     Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing'\n```\n\nThis is due to some configuration problems with the underlying HTTP client, and will be adressed in a future update.\n\n## Disclaimer:\nThanks for using this library! Pull requests and contributions are always welcome. Until this library is published as `\u003e= 1.0.0` it should be considered public beta. You are welcome to use it in any of your projects, but until it is fully published please do not consider the API stable.\n\nIt is my sincerest wish as the creator and maintainer of this repo to produce software that is as high quality as possible. That being said, this is a project I maintain in my free time and since there is potential to mis-use this library in ways that may cost you real money, I feel the need to re-iterate this portion of the license:\n\n\u003e EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n\u003e PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR\n\u003e IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY  \n\u003e AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND\n\u003e PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU \n\u003e ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\nI am not responsible for any financial loss you incur while using this library to trade cryptocurrency. May the odds be ever in your favor.\n\n## Documentation:\nDocs can be found at [https://hexdocs.pm/aurum](https://hexdocs.pm/aurum).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex0112%2Faurum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex0112%2Faurum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex0112%2Faurum/lists"}