BitShares Forum

Main => Technical Support => Topic started by: oddhome on April 05, 2018, 08:05:54 am

Title: pybitshares how to withdraw to external wallet
Post by: oddhome on April 05, 2018, 08:05:54 am
please guide me to dev for pybitshares withdraw BTC to external wallet
Title: Re: pybitshares how to withdraw to external wallet
Post by: abit on April 05, 2018, 09:42:30 am
You need the help of gateway service.
1. find out the correct gateway account name and memo syntax. For example, if your BTC is OPEN.BTC, contact openledger.io to get correct gateway account name and memo syntax, or figure out by your own via light wallet or web wallet (try to withdraw manually).
2. use pybitshares, send your BTC to the gateway account with correct memo
Title: Re: pybitshares how to withdraw to external wallet
Post by: runestone on April 05, 2018, 01:46:44 pm
Get list of all coins at Openledger. Here you'll see "intermediateAccount" which contains the destination account name:
Code: [Select]
url = "https://ol-api1.openledger.info/api/v0/ol/support/coins"
r = requests.get(url).json()

This checks if the address you're about to send to is valid.
Code: [Select]
url = "https://ol-api1.openledger.info/api/v0/ol/support/wallets/"+asset+"/address-validator?address="+address
r = requests.get(url).json()

Memo is usually:
Code: [Select]
{{asset}}:{{address_where_openledger_should_transfer_to}}
Once you have all this, you can make your bitshares.transfer() call.