1

i would like to know can you transfert some currencies from Kraken to Poloniex using API functions ? Didn't see anything talking about that.

Thank a lot

M1n1M1n1ng
  • 57
  • 7

2 Answers2

4

*

  1. create new API key with "Withdraw funds" right on kraken

    • Go to account settings then click on "api" to go to settings api page, then click on "generate new key"

    • Fill all field and tick the box "Withdraw Funds", then validate.

  2. add the poloniex deposit address in kraken (assuming deposit address already created)

    • Go to funding deposit page then click on "withdraw" to go to funding withdraw page

    • Select the currency on the left side (here we assume that you want withdraw BTC) so you have to click on "Bitcoin (XBT)" on the left panel

    • Then click on "add address" then fill both "Description" & "Bitcoin address" field.

      Write down "Description" field because it will be required later when you will send API request to withdraw from Kraken to Poloniex.

  3. Create the API request which will be sent to Kraken

Use the following code (re-use this example python library):

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import requests
import urllib
import urllib2
import json
import hashlib
import httplib
import hmac
import random
import string
import base64

def _query( urlpath, req = {}, conn = None, headers = {}):
 """Low-level query handling.

 Arguments:
 urlpath -- API URL path sans host (string, no default)
 req     -- additional API request parameters (default: {})
 conn    -- kraken.Connection object (default: None)
 headers -- HTTPS headers (default: {})

 """
 uri = 'https://api.kraken.com'
 url = uri + urlpath

 if conn is None:
    conn = Connection()

 ret = conn._request(url, req, headers)
 return json.loads(ret)


def query_private( method, req={}, conn = None):

 #secret data
 key = "123456789_my_api_key"
 secret = "123456798_my_api_secret"

 apiversion='0'

 uri='https://api.kraken.com'
 urlpath = '/' + apiversion + '/private/' + method

 req['nonce'] = int(1000*time.time())
 postdata = urllib.urlencode(req)
 message = urlpath + hashlib.sha256(str(req['nonce']) +
                                   postdata).digest()
 signature = hmac.new(base64.b64decode(secret),
                     message, hashlib.sha512)
 headers = {
    'API-Key': key,
    'API-Sign': base64.b64encode(signature.digest())
 }

 return _query(urlpath, req, conn, headers)



withdraw_params={
    'asset': 'xbt',
    'key': "Withdrawal address Description",
    'amount': 0.25,

}

res=query_private('Withdraw', withdraw_params)
A. STEFANI
  • 6,707
  • 1
  • 23
  • 48
  • If you require more information on avaible API method use @Cyphrags link to respective API documentation – A. STEFANI Nov 25 '17 at 18:32
  • How the hell did you found this info? The documentation (https://www.kraken.com/features/api#withdraw-funds) only states: aclass = asset class (optional): currency (default) asset = asset being withdrawn key = withdrawal key name, as set up on your account amount = amount to withdraw, including fees – Alex 75 Dec 05 '19 at 19:44
  • How to create "on the fly" a "key" for a new XRP wallet ? I mean when the XRP wallet (with destination tag) is "new" and not manually registered ?(some exchanges, like Coinbase, create a new wallet destination tag for EVERY deposit) – Alex 75 Dec 05 '19 at 19:45
  • 1
    I use this code inside an old trading bot... On Kraken side, there is a security feature that will not allow you to withdraw to an unknow address, you need first to manualy add the withdrawal adress in your address list and chose a 'Description' name, then confirm the creation by clicking the link in the email, after that finaly you can withdraw to this new adress using the "Description' name. Sorry it is not possible to create "on fly" or have a full automatic withdrawal process to unknow address. – A. STEFANI Dec 06 '19 at 01:00
  • Thanks. A workaround can be to use an "in the middle" wallet that is registered as secure address into Kraken and makes the second transfer (to the final destination address) using the Ripple API. Unfortunately I only used the JavaScript Ripple API, I need to imlement this second transaction with C#. I'll definetly try this way. – Alex 75 Dec 06 '19 at 12:23
2

You'll need the withdrawFunds method from the Kraken API (https://www.kraken.com/help/api#withdraw-funds).

Using the Poloniex API, you'll need to get your deposit address using returnDepositAddresses. If you don't have a deposit address for the given cryptocurrency, use generateNewAddress.

Kraken API Documentation: https://www.kraken.com/help/api

Poloniex API Documentation: https://poloniex.com/support/api/

Cyphrags
  • 528
  • 1
  • 7
  • 16