Back to Ccxt

https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code

wiki/examples/py/gateio-watch-balance.md

4.5.58803 B
Original Source
python
import os
import sys

# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
import asyncio
import ccxt.pro as ccxt  # noqa: E402


# AUTO-TRANSPILE #
'use strict'


print('CCXT Version:', ccxt.version)  # eslint-disable-line import/no-named-as-default-member


async def main():
    exchange = ccxt.gate({
        'apiKey': 'YOUR_API_KEY',
        'secret': 'YOUR_SECRET',
    })
    await exchange.load_markets()
    exchange.verbose = True
    while True:
        try:
            response = await exchange.watch_balance()
            print(Date(), response)
        except Exception as e:
            print(e)
            await exchange.sleep(1000)

    await exchange.close()

main()