示例#1
0
## 填写 apiKey APISECRET
apiKey = 'your api key'
secretKey = 'your api secret'
## address
btcAddress = 'your btc address'

## Provide constants

API_URL = 'data.gate.io'

## Create a gate class instance

gate = GateIO(API_URL, apiKey, secretKey)

# 所有交易对
print(gate.pairs())

## Below, use general methods that query the exchange

# 市场订单参数
# print(gate.marketinfo())

# 交易市场详细行情
# print(gate.marketlist())

# 所有交易行情
# print(gate.tickers())
# 所有交易对的市场深度
# print(gate.orderBooks())

# 获取下单状态
示例#2
0
secretKey = 'your api secret'
## address
btcAddress = 'your btc address'

## Provide constants

API_QUERY_URL = 'data.gateio.io'
API_TRADE_URL = 'api.gateio.io'

## Create a gate class instance

gate_query = GateIO(API_QUERY_URL, apiKey, secretKey)
gate_trade = GateIO(API_TRADE_URL, apiKey, secretKey)

# Trading Pairs
print(gate_query.pairs())

## Below, use general methods that query the exchange

#  Market Info
# print(gate_query.marketinfo())

# Market Details
# print(gate_query.marketlist())

# Tickers
# print(gate_query.tickers())
# Depth
# print(gate_query.orderBooks())

# orders
示例#3
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
# encoding: utf-8

from gateAPI import GateIO

# 填写 APIKEY APISECRET
apikey = 'your api key'
secretkey = 'your api secret'
API_URL = 'data.gate.io'

gate = GateIO(API_URL, apikey, secretkey)

# 所有交易对
pairs = gate.pairs()
print(gate.pairs())
for item in pairs:
    print gate.ticker(item)

# 市场订单参数
# print (gate.marketinfo())

# 交易市场详细行情
# print (gate.marketlist())

# 所有交易行情
# print (gate.tickers())

# 单项交易行情
# print (gate.ticker('btc_usdt'))
示例#4
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
# encoding: utf-8

from gateAPI import GateIO

# 填写 APIKEY APISECRET
apikey = 'your api key'
secretkey = 'your api secret'
API_URL = 'data.gate.io'

gate = GateIO(API_URL,apikey,secretkey)


# 所有交易对
print (gate.pairs())


# 市场订单参数
# print (gate.marketinfo())


# 交易市场详细行情
# print (gate.marketlist())


# 所有交易行情
# print (gate.tickers())


# 单项交易行情
示例#5
0
    'subu <coin>': 'Elimina par USDT'
}
try:
    f = open("users.py", "r")
    knownUsers = eval(f.read())
    f.close()
except:
    print("No hay usuarios definidos")
    knownUsers = dict()
    knownUsers = {'usuarios': []}
    f = open("users.py", "w")
    f.write(str(knownUsers))
    f.close()

file = open('gate_pairs.py', 'w')
pairs = gate.pairs()
print(str(pairs), end="", file=file)
file.close()

file = open("coin_names.py", "r")
coin_names = eval(file.read())
file.close()


def new_user(cid):
    global knownUsers
    dict_tmp = {'user_id': cid, 'interval': 300, 'lasttime': 0, 'coin': []}
    knownUsers['usuarios'].append(dict_tmp)
    save_knownusers()