π¨βπ»OpenAPI
Last updated
Last updated
Note: the API Key need auth pass before it works. This may take some days.SDK path: https://github.com/satoridao/satori_openapi_sdk# config.ini
[keys]
base_url= https://openapi.satori.finance
ws_url= wss://openapi.satori.finance/api/market/ws
api_key= ${your api key}
api_secret= ${your api address private key}Note: The same address at different chain have different account in satori. Please choose the same chain with your api key you applyed.import json
β
from satori.client import Client
from examples.utils.prepare_env import get_env
β
if __name__ == '__main__':
Β config = get_env()
Β print(config)
Β cs = Client(api_key=config["api_key"], api_secret=config["api_secret"], api_sign_type=config["api_sign_type"], base_url=config["base_url"])
Β time = cs.time()["data"]
Β print(json.dumps(cs.balance("USD", time), ensure_ascii=False))#!/usr/bin/env python
import json
β
from satori.client import Client,Order
from examples.utils.prepare_env import get_env
β
if __name__ == '__main__':
Β config = get_env()
Β cs = Client(api_key=config["api_key"], api_secret=config["api_secret"], api_sign_type=config["api_sign_type"], base_url=config["base_url"])
Β time = cs.time()["data"]
Β order1 = Order(str(time), True, False, 1, 1, "ETH-USD", 3, "0.02", "2000")
Β print(json.dumps(cs.create_order(order1,str(time)), ensure_ascii=False))#!/usr/bin/env python
import json
β
from satori.client import Client
from examples.utils.prepare_env import get_env
β
if __name__ == '__main__':
Β config = get_env()
Β cs = Client(api_key=config["api_key"], api_secret=config["api_secret"], api_sign_type=config["api_sign_type"], base_url=config["base_url"])
Β time = cs.time()["data"]
Β # print(cs.order_list("ETH-USD",time))
Β print(json.dumps(cs.cancel_order(entrustId=178790278,timestamp=str(time)), ensure_ascii=False))