项目作者: shannonwells

项目描述 :
Coinpayments API wrapper in Elixir
高级语言: Elixir
项目地址: git://github.com/shannonwells/coinpayments_ex.git
创建时间: 2018-03-07T16:11:13Z
项目社区:https://github.com/shannonwells/coinpayments_ex

开源协议:MIT License

下载


Coinpayments

A wrapper for the Coinpayments API v1 in Elixir.

Installation

If available in Hex, the package can be installed
by adding coinpayments to your list of dependencies in mix.exs:

  1. def deps do
  2. [
  3. {:coinpayments, "~> 0.5.0"}
  4. ]
  5. end

Then running mix deps.get.

Afterward, set up per-environment config files to set API key and secret. Please see the config/dev.secret.exs.example.

Usage

  • One can verify that it is working by running:

    1. iex -S mix
    2. iex> Coinpayments.get_basic_info
    3. body: "{\"error\":\"ok\",\"result\":{\"uername\":\"MyFancyUser\",\"username\":\"MyFancyUser\",\"merchant_id\":\"somehexcode\",\"email\":\"someuser@example.com\",\"public_name\":\"MyFancyUser\",\"time_joined\":11111111111}}",
    4. headers: %{"access-control-allow-origin" => "*",
    5. "cache-control" => "no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
    6. "connection" => "Keep-Alive",
    7. "content-disposition" => "attachment; filename=coinpayments_api.json",
    8. "content-length" => "196", "content-type" => "application/json",
    9. "date" => "Mon, 19 Mar 2018 23:09:43 GMT",
    10. "expires" => "Thu, 19 Nov 1981 08:52:00 GMT",
    11. "keep-alive" => "timeout=5, max=98", "pragma" => "no-cache",
    12. "server" => "Apache",
    13. "set-cookie" => "incap_ses_124_992349=QA+iiiiivvvvcccc8888jjjjbbbbZZZZ8pjNkFBtUi+jy81/A==; path=/; Domain=.coinpayments.net",
    14. "strict-transport-security" => "max-age=31536000", "x-cdn" => "Incapsula",
    15. "x-frame-options" => "sameorigin",
    16. "x-iinfo" => "9-87141792-87137184 PNNN RT(1521500982876 171) q(0 0 0 0) r(2 2) U6"},
    17. method: :post, opts: [], query: [], status: 200,
    18. url: "https://www.coinpayments.net/api.php"}
  • Functions are the same name as their corresponding API endpoints, and options are passed in a Map:

    1. iex> get_withdrawal_history(%{limit: 100, start: 1234, newer: 1919191})

Please see the Coinpayments API Documentation for more details about the different available commands and options.

Contributing

Please fork and submit a pull request. Pull requests that fix current issues will be prioritized highest.