main.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:CTPrivAPI 作者: doubleelforbes 项目源码 文件源码
def gettransactions():
    global privapi
    global transactions
    window.lsttransactions.delete(0, tk.END)
    debugout("Requesting Transaction History...")
    # The API Doesn't allow for Null type or "All" so we have to pull both dicts and combine them.
    txlist = privapi.gettransactions("Deposit")
    # After the first API call we'll check for an error string.
    if isinstance(txlist, str):
        debugout(txlist)
    else:
        txlist = txlist + privapi.gettransactions("Withdraw")
        itx = 0
        for tx in txlist:
            tid = tx["Id"]
            currency = tx["Currency"]
            txid = tx["TxId"]
            ttype = tx["Type"]
            amount = tx["Amount"]
            fee = tx["Fee"]
            status = tx["Status"]
            confirmations = tx["Confirmations"]
            timestamp = tx["Timestamp"]
            address = tx["Address"]
            tmptx = transaction.Transaction(tid, currency, txid, ttype, amount, fee, status, confirmations, timestamp,
                                            address)
            key = tmptx.tostring()
            transactions[key] = tmptx
            window.lsttransactions.insert(tk.END, key)
            itx = itx + 1
        debugout("Transaction History data received, " + str(itx) + " transactions found.")


# Cancel a single trade via it's OrderId
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号