mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 16:28:06 +00:00
33 lines
743 B
Markdown
33 lines
743 B
Markdown
- [Binance Universal Transfer](./examples/py/)
|
|
|
|
|
|
```python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import os
|
|
import sys
|
|
from pprint import pprint
|
|
|
|
|
|
import ccxt # noqa: E402
|
|
|
|
|
|
def main():
|
|
|
|
# apiKey must have universal transfer permissions
|
|
binance = ccxt.binance({
|
|
"apiKey": "YOUR_API_KEY",
|
|
"secret": "YOUR_SECRET",
|
|
})
|
|
binance.load_markets()
|
|
|
|
pprint(binance.transfer('USDT', 0.1, 'spot', 'future'))
|
|
transfers = binance.fetch_transfers()
|
|
pprint('there is ' + str(len(transfers)) + ' transfers')
|
|
pprint(binance.transfer('USDT', 0.1, 'spot', 'cross')) # For transfer to cross margin wallet
|
|
pprint(binance.transfer('USDT', 0.1, 'spot', 'ADA/USDT')) # For transfer to an isolated margin wallet
|
|
|
|
|
|
main()
|
|
|
|
``` |