Okex akaun (kontrak, duit syiling, dompet) menukar wang syiling, ada contoh kod?
Seting akaun anak berbeza di setiap bursa, minta contoh okex kod.
MartinashSila tanyakan, adakah pemindahan akaun koin ke akaun kontrak boleh dilakukan melalui API?
Jumlah pelaburan 01Terima kasih banyak!
Pencipta Kuantiti - Impian KecilSelagi pertukaran menyediakan antara muka API seperti Coinbase, Coinbase, dan lain-lain, anda boleh memanggil antara muka ini secara langsung dengan exchange.IO. Kod yang berkaitan boleh dilihat dalam Template Perpustakaan Perdagangan Mata Wang Digital: `` $.withdraw = function ((e, currency, address, amount, fee, password) { var withdraw_id = null; var ret = null; currency = currency.toLowerCase ((() switch (e.GetName)) { Kes "OKCoin_EN": ret = e.IO (("api", "POST", "/api/v1/withdraw.do", "symbol="+currency.toLowerCase() +"_usd&chargefee=" + fee + "&trade_pwd=" + password + "&withdraw_address=" + address + "&withdraw_amount=" + amount); if (ret && typeof(ret.withdraw_id)!== 'undefined') { withdraw_id = ret.withdraw_id; } else { var err = GetLastError (); if (err && err.indexOf('10031')!== -1) { Log (("OKCoin_EN memerlukan 6 pengesahan rangkaian untuk mendapatkan pembayaran")); {C:$0000FF} {C:$0000FF} Pergilah. Kes "Huobi": if (currency == "bch") { currency = "bcc" {C:$0000FF} ret = e.IO (("api", "POST", "/v1/dw/withdraw-virtual/create", "currency="+currency+"&fee=" + fee + "&address=" + address + "&amount=" + amount); if (ret && typeof(ret.withdraw_id)!== 'undefined') { withdraw_id = ret.data; {C:$0000FF} Pergilah. Kes "Bithumb": ret = e.IO (("api", "POST", "/trade/btc_withdrawal", "currency="+currency.toUpperCase() +"&address=" + address + "&units=" + amount); if (ret && parseInt ((ret.status) == 0) { withdraw_id = 9999; {C:$0000FF} Pergilah. Kes "GateIO": ret = e.IO (("api", "POST", "/api2/1/private/withdraw", "currency="+currency+" & address=" + address + "&amount=" + amount); if (ret && parseInt ((ret.code) == 0) { withdraw_id = 9999; {C:$0000FF} Pergilah. Kes "ZB": ret = e.IO (("api", "POST", "/api/withdraw", "method=withdraw&itransfer=0¤cy="+currency+"&receiveAddr=" + address + "&amount=" + amount+"&fees="+fee+"&safePwd="+password); if (ret && parseInt ((ret.code) == 0) { withdraw_id = ret.id; {C:$0000FF} Pergilah. Kes "Bitfinex": var cMap = { "BTC": "Bitcoin", "Bitcoin" dan "Bitcoin". LTC: Litecoin, "eth": "ethereum", "etc": "ethereum c", "zec": "zcash", "xmr": "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero", "Monero" Omni: "Mastercoin" "usd": "Wire", "dash": "dash", "xrp": "ripple", "eos": "eos"}; if (typeof ((cMap[currency]) == 'undefined') { throw "bitfinex not support" + currency; {C:$0000FF} var withdraw_type = cMap[currency]; ret = e.IO (("api", "POST", "/v1/withdraw", "withdraw_type=" + withdraw_type + "&walletselected=exchange&address=" + address + "&amount='" + amount + "'"); if (ret && ret.length == 1 && typeof(ret[0].withdrawal_id)!== 'undefined') { withdraw_id = ret[0].withdrawal_id; {C:$0000FF} Pergilah. Kes "Poloniex": var ext = ""; if (currency == 'xrp') { /ext = '&paymentId=' + PXRPLabel; {C:$0000FF} if (currency.toLowerCase() == 'bts' && address.indexOf('_') == -1) { alamat = "poloniexwallet_" + alamat; {C:$0000FF} ret = e.IO (("api", "POST", "withdraw", "amount=" + amount + "¤cy="+currency.toUpperCase() +"&address=" + address+ext); if (ret && ret.response.indexOf('With')!== -1) { withdraw_id = 9999; {C:$0000FF} break Kes "Bittrex": ret = e.IO (("api", "GET", "/api/v1.1/account/withdraw", "quantity=" + amount + "¤cy="+currency.toUpperCase() +"&address=" + address); if (ret && ret.success) { withdraw_id = ret.result.uuid; {C:$0000FF} break Kes "Binance": ret = e.IO (("api", "POST", "/wapi/v1/withdraw.html", "amount=" + amount + "&asset=" + currency + "&address=" + address); if (ret && ret.success) { withdraw_id = 9999; {C:$0000FF} break Kes "OKEX": ret = e.IO (("api", "POST", "/api/v1/withdraw.do", "target=address&withdraw_amount=" + amount + "&symbol="+currency+"_usd&withdraw_address=" + address+"&chargefee="+fee+"&trade_pwd="+password); if (ret && ret.result) { withdraw_id = ret.withdraw_id; {C:$0000FF} break default: Membuang "Operasi tidak disokong"; {C:$0000FF} return {info: ret, withdraw_id: withdraw_id} {C:$0000FF} ``