Ejemplo n.º 1
0
        public async Task amendMultipleOrders()
        {
            Dictionary <string, object> requestParameters1 = new Dictionary <string, object>();

            requestParameters1["instId"]    = "BTC-USDT";
            requestParameters1["cxlOnFail"] = false;
            requestParameters1["ordId"]     = "";
            requestParameters1["clOrdId"]   = "testplaceorder120201211";
            requestParameters1["reqId"]     = "";
            requestParameters1["newSz"]     = "1.3";
            requestParameters1["newPx"]     = "16666";
            Dictionary <string, object> requestParameters2 = new Dictionary <string, object>();

            requestParameters2["instId"]    = "BTC-USDT";
            requestParameters2["cxlOnFail"] = false;
            requestParameters2["ordId"]     = "";
            requestParameters2["clOrdId"]   = "testplaceorder120201211";
            requestParameters2["reqId"]     = "";
            requestParameters2["newSz"]     = "1.3";
            requestParameters2["newPx"]     = "16666";

            List <Dictionary <string, object> > objs = new List <Dictionary <string, object> >();

            objs.Add(UnitTestBasic.cleanNullKey(requestParameters1));
            objs.Add(UnitTestBasic.cleanNullKey(requestParameters2));
            var result = await UnitTestBasic.tradeApi.AmendMultipleOrders(objs);

            System.Console.WriteLine(result);
        }
Ejemplo n.º 2
0
        public async Task getBalance()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();
            var result = await UnitTestBasic.fundingApi.GetBalance(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 3
0
        public async Task setPositionMode()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["posMode"] = "long_short_mode";
            var result = await UnitTestBasic.accountApi.GetAccountConfiguration(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 4
0
        public async Task getMaximumWithdrawals()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["greeksType"] = "";
            var result = await UnitTestBasic.accountApi.GetMaximumWithdrawals(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
        public async Task getTicker()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"] = "BTC-USD-SWAP";
            var result = await UnitTestBasic.marketDataApi.GetTicker(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 6
0
        public async Task getDepositHistory()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["ccy"] = "";
            var result = await UnitTestBasic.fundingApi.GetDepositHistory(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
        public async Task getIndexTickers()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["quoteCcy"] = "USD";
            requestParameters["instId"]   = "";
            var result = await UnitTestBasic.marketDataApi.GetIndexTickers(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
        public async Task getOptionMarketData()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["uly"]     = "BTC-USD";
            requestParameters["expTime"] = "";
            var result = await UnitTestBasic.publicDataApi.GetOptionMarketData(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 9
0
        public async Task getPositions()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instType"] = "FUTURES";
            requestParameters["instId"]   = "BTC-USDT-201225";
            var result = await UnitTestBasic.accountApi.GetPositions(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 10
0
        public async Task getLeverage()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"]  = "BTC-USDT-201225";
            requestParameters["mgnMode"] = "cross";
            var result = await UnitTestBasic.accountApi.GetLeverage(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
        public async Task getOpenInterest()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instType"] = "SWAP";
            requestParameters["uly"]      = "";
            requestParameters["instId"]   = "";
            var result = await UnitTestBasic.publicDataApi.GetOpenInterest(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 12
0
        public async Task cancelOrder()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"]  = "ETH-USDT";
            requestParameters["ordId"]   = "";
            requestParameters["clOrdId"] = "testplaceorder2eth20201211";
            var result = await UnitTestBasic.tradeApi.CancelOrder(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 13
0
        public async Task getOrderDetails()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"]  = "BTC-USDT";
            requestParameters["ordId"]   = "258542316990898178";
            requestParameters["clOrdId"] = "";
            var result = await UnitTestBasic.tradeApi.GetOrderDetails(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 14
0
        public async Task piggyBankPurchaseOrRedemption()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["ccy"]  = "BTC";
            requestParameters["amt"]  = "0.1";
            requestParameters["side"] = "purchase";
            var result = await UnitTestBasic.fundingApi.PiggyBankPurchasOrRedemption(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 15
0
        public async Task increaseDecreaseMargin()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"]  = "BTC-USDT-201225";
            requestParameters["posSide"] = "net";
            requestParameters["type"]    = "add";
            requestParameters["amt"]     = "10";
            var result = await UnitTestBasic.accountApi.IncreaseOrDecreaseMargin(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 16
0
        public async Task getMaximumTradableSizeForInstrument()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"] = "BTC-USDT-201225";
            requestParameters["tdMode"] = "cross";
            requestParameters["ccy"]    = "";
            requestParameters["px"]     = "";
            var result = await UnitTestBasic.accountApi.GetAccountConfiguration(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 17
0
        public async Task closePositions()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"]  = "BTC-USD-201225";
            requestParameters["posSide"] = "long";
            requestParameters["mgnMode"] = "cross";
            requestParameters["ccy"]     = "";
            var result = await UnitTestBasic.tradeApi.ClosePositions(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
        public async Task getFundingRateHistory()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"] = "BTC-USD-SWAP";
            requestParameters["after"]  = "";
            requestParameters["before"] = "";
            requestParameters["limit"]  = "";
            var result = await UnitTestBasic.publicDataApi.GetFundingRateHistory(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 19
0
        public async Task getAccountConfiguration()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["uid"]        = "";
            requestParameters["acctLv"]     = "";
            requestParameters["posMode"]    = "";
            requestParameters["autoLoan"]   = "";
            requestParameters["greeksType"] = "";
            var result = await UnitTestBasic.accountApi.GetAccountConfiguration(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 20
0
        public async Task cancelAlgoOrder()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["algoId"] = "260170643321270272";
            requestParameters["instId"] = "BTC-USDT";
            List <Dictionary <string, string> > objs = new List <Dictionary <string, string> >();

            objs.Add(UnitTestBasic.cleanNullKey(requestParameters));
            var result = await UnitTestBasic.tradeApi.CancelAlgoOrder(objs);

            System.Console.WriteLine(result);
        }
        public async Task getMarkPriceCandlesticks()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"] = "BTC-USD-SWAP";
            requestParameters["after"]  = "";
            requestParameters["before"] = "";
            requestParameters["bar"]    = "";
            requestParameters["limit"]  = "";
            var result = await UnitTestBasic.marketDataApi.GetMarkPriceCandlesticks(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 22
0
        public async Task assetBillsDetails()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["ccy"]    = "BTC";
            requestParameters["type"]   = "";
            requestParameters["after"]  = "";
            requestParameters["before"] = "";
            requestParameters["limit"]  = "";
            var result = await UnitTestBasic.fundingApi.AssetBillsDetails(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 23
0
        public async Task getWithdrawalHistory()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["ccy"]    = "";
            requestParameters["state"]  = "";
            requestParameters["after"]  = "";
            requestParameters["before"] = "";
            requestParameters["limit"]  = "";
            var result = await UnitTestBasic.fundingApi.GetWithdrawalHistory(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 24
0
        public async Task getInterest_accrued()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instId"]  = "";
            requestParameters["ccy"]     = "";
            requestParameters["mgnMode"] = "";
            requestParameters["after"]   = "";
            requestParameters["before"]  = "";
            requestParameters["limit"]   = "";
            var result = await UnitTestBasic.accountApi.GetInterest_accrued(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 25
0
        public async Task withdrawal()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["ccy"]    = "USDT";
            requestParameters["amt"]    = "10";
            requestParameters["dest"]   = "3";
            requestParameters["toAddr"] = "ARDOR-7JF3-8F2E-QUWZ-CAN7F:123456";
            requestParameters["pwd"]    = "123456";
            requestParameters["fee"]    = "1";
            var result = await UnitTestBasic.fundingApi.Withdrawal(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 26
0
        public async Task getTransactionDetails()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instType"] = "";
            requestParameters["uly"]      = "";
            requestParameters["instId"]   = "";
            requestParameters["ordId"]    = "";
            requestParameters["after"]    = "";
            requestParameters["before"]   = "";
            requestParameters["limit"]    = "";
            var result = await UnitTestBasic.tradeApi.GetTransactionDetails(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 27
0
        public async Task amendOrder()
        {
            Dictionary <string, object> requestParameters = new Dictionary <string, object>();

            requestParameters["instId"]    = "BTC-USDT";
            requestParameters["cxlOnFail"] = false;
            requestParameters["ordId"]     = "";
            requestParameters["clOrdId"]   = "testplaceorder120201211";
            requestParameters["reqId"]     = "";
            requestParameters["newSz"]     = "1.3";
            requestParameters["newPx"]     = "16666";
            var result = await UnitTestBasic.tradeApi.AmendOrder(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 28
0
        public async Task getAlgoOrderList()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["algoId"]   = "260170643321270272";
            requestParameters["instType"] = "";
            requestParameters["instId"]   = "";
            requestParameters["ordType"]  = "conditional";
            requestParameters["after"]    = "";
            requestParameters["before"]   = "";
            requestParameters["limit"]    = "";
            var result = await UnitTestBasic.tradeApi.GetAlgoOrderList(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 29
0
        public async Task getOrderHistory_3months()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["instType"] = "SWAP";
            requestParameters["uly"]      = "";
            requestParameters["instId"]   = "";
            requestParameters["ordType"]  = "";
            requestParameters["state"]    = "";
            requestParameters["after"]    = "";
            requestParameters["before"]   = "";
            requestParameters["limit"]    = "";
            var result = await UnitTestBasic.tradeApi.GetOrderHistory_3months(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }
Ejemplo n.º 30
0
        public async Task fundsTransfer()
        {
            Dictionary <string, string> requestParameters = new Dictionary <string, string>();

            requestParameters["ccy"]      = "USDT";
            requestParameters["amt"]      = "10";
            requestParameters["type"]     = "0";
            requestParameters["from"]     = "1";
            requestParameters["to"]       = "3";
            requestParameters["subAcct"]  = "";
            requestParameters["instId"]   = "";
            requestParameters["toInstId"] = "BTC-USDT";
            var result = await UnitTestBasic.fundingApi.FundsTransfer(UnitTestBasic.cleanNullKey(requestParameters));

            System.Console.WriteLine(result);
        }