· 4 years ago · Aug 13, 2021, 09:50 PM
1private static async Task UniversalTransfer(string apiKey, string secretKey, string fromAccountType,
2 string toAccountType, string asset,
3 decimal amount)
4 {
5 var client = new BinanceClient(new BinanceClientOptions()
6 {
7 // Specify options for the client
8 ApiCredentials = new ApiCredentials(apiKey, secretKey), LogLevel = LogLevel.Debug,
9 LogWriters = new List<ILogger> {new ConsoleLogger()}
10 });
11 var callResult =
12 await client.Spot.Futures.TransferFuturesAccountAsync("USDT", Convert.ToDecimal(1),
13 FuturesTransferType.FromSpotToUsdtFutures);
14
15 // Make sure to check if the call was successful
16 if (!callResult.Success)
17 {
18 // Call failed, check callResult.Error for more info
19 Console.WriteLine("Don't Work!");
20 }
21 else
22 {
23 // Call succeeded, callResult.Data will have the resulting data
24 Console.WriteLine("WORK!");
25 }
26 }