Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function for generating the API signature for Vaultoro's API - https://api.vaultoro.com
defmodule Vaultoro do
@doc """
secret = The Vaultoro secret generated along with your API key
endpoint = The full URL that you are requesting (with all params) e.g: https://api.vaultoro.com/1/balance?nonce=9&apikey=_MY_API_KEY_
"""
def signature(secret, endpoint) do
:crypto.hmac(:sha256, secret, endpoint)
|> Base.encode16(case: :lower)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment