Withdraw

POST /auth/withdraw

Submit a withdrawal. Requires a signed payload in HMAC form to be appended to the x-signature header. The signed payload must be base64-encoded.

Note: For security reasons, withdrawals submitted through the API will only be processed once confirmed by email.

Javascript example:

  const formurlencoded = require('form-urlencoded').default;
  const crypto = require("crypto-js");
  const fetch = require("node-fetch");
  const API_KEY = "<YOUR_API_KEY>";
  const SECRET_KEY = "<YOUR_SECRET_KEY>";

  (async function() {
    const payload = {'asset': 'ETH', qty: 5, address: '0x829bd824b016326a401d083b33d092293333a830', timestamp: Date.now()};
    const payload_url_encoded = formurlencoded(payload);
    const HMAC = crypto.HmacSHA256(payload_url_encoded, SECRET_KEY).toString(crypto.enc.Base64);
    const submitted = await fetch('https://api.testnet.everstrike.io/auth/withdraw', {method: 'POST', body: payload_url_encoded, headers: {'content-type': 'application/x-www-form-urlencoded', 'x-api-key': API_KEY, 'x-signature': HMAC}});
    const response = await submitted.json();
    console.log(response);
  })();

Python example (Python3):

  import requests
  import urllib
  import hmac
  import hashlib
  import base64
  from time import time

  api_key = '<YOUR_API_KEY>'
  secret_key = '<YOUR_SECRET_KEY>'
  url='https://api.testnet.everstrike.io/auth/withdraw'
  payload = {'asset': 'ETH', 'qty': 5, 'address': '0x829bd824b016326a401d083b33d092293333a830', 'timestamp': time()*1000.0}
  urlencoded_payload = urllib.parse.urlencode(payload)
  hmac_signature = hmac.new(bytes(secret_key , 'utf-8'), msg = bytes(urlencoded_payload , 'utf-8'), digestmod = hashlib.sha256).digest()
  hmac_signature_base64 = base64.b64encode(hmac_signature)
  headers = {'content-type': 'application/x-www-form-urlencoded', 'x-api-key': api_key, 'x-signature': hmac_signature_base64}

  response = requests.post(url, data=payload, headers=headers)

  print(response.text)
  print(response.status_code, response.reason)

application/x-www-form-urlencoded

Body Required

  • asset string Required

    Asset to withdraw (e.g. 'ETH')

  • qty integer(int32) Required

    Quantity to withdraw (e.g. 100)

  • address string Required

    Address to withdraw to (e.g. '0x829bd824b016326a401d083b33d092293333a830')

  • timestamp integer(int32) Required

    UNIX timestamp in milliseconds

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • code integer

      Response code

    • msg string

      Diagnostic message

    • result object

      Request result

      Hide result attributes Show result attributes object
      • address string

        Address of withdrawal

      • Your unique Account ID

      • asset string

        Asset of withdrawal

      • time number

        Time of withdrawal

      • qty number

        Quantity of withdrawal

      • net number

        Net Quantity of withdrawal. Net Quantity = Quantity - Fee.

      • status string

        Status of withdrawal. Can be PENDING or COMPLETED.

      • id string

        Unique identifier of withdrawal.

      • qty_usd number

        USD quantity of withdrawal, at time of withdrawal.

      • Blockchain transaction associated with the withdrawal

        Hide transaction attributes Show transaction attributes object
        • hash string

          Transaction hash

        • from string

          Sender of transaction

  • 503 application/json

    Error

    Hide response attributes Show response attributes object
POST /auth/withdraw
curl \
 -X POST https://api.testnet.everstrike.io/auth/withdraw \
 -H "x-api-key: $API_KEY" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'asset=string&qty=42&address=string&timestamp=42'
Response examples (200)
{
  "code": 200,
  "msg": "null",
  "result": [
    {
      "net": 0.009,
      "qty": 0.01,
      "time": 1551127794034,
      "asset": "ETH",
      "status": "ACTIVE",
      "address": 904896849601772900000000000000000000000000000000,
      "qty_usd": 1.3930651399,
      "customer_id": "5f9ca5f0380e11e9bf5191a076098e19",
      "manually_approved": false
    }
  ]
}
Response examples (503)
{
  "code": 503,
  "msg": "Invalid request",
  "result": {}
}