Exemple #1
0
        public static void GetAccount()
        {
            var         userName = "******";
            PlatformApi api      = PlatformApi.GetInstance(userName);

            var accounts = api.GetAllAccount();

            Console.WriteLine(JsonConvert.SerializeObject(accounts));

            var account = api.GetAccountBalance("529880");

            Console.WriteLine(JsonConvert.SerializeObject(account));
        }
Exemple #2
0
        public void OrderPlaceTest()
        {
            PlatformApi api           = PlatformApi.GetInstance("xx");
            var         accounts      = api.GetAllAccount();
            var         spotAccountId = accounts.FirstOrDefault(a => a.Type == "spot" && a.State == "working")?.Id;

            if (spotAccountId <= 0)
            {
                throw new ArgumentException("spot account unavailable");
            }
            OrderPlaceRequest req = new OrderPlaceRequest();

            req.account_id = spotAccountId.ToString();
            req.amount     = "0.1";
            req.price      = "800";
            req.source     = "api";
            req.symbol     = "ethusdt";
            req.type       = "buy-limit";
            var result = api.OrderPlace(req);
            //Assert.AreEqual(result.Status, "ok");
        }
Exemple #3
0
 public void GetAllAccountTest()
 {
     PlatformApi api    = PlatformApi.GetInstance("xx");
     var         result = api.GetAllAccount();
 }