-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alexander Tanti <[email protected]>
- Loading branch information
Showing
11 changed files
with
235 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Examples/CSharp/MarginAccountTrade/MarginDustlog_Example.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Binance.Spot.MarginAccountTradeExamples | ||
{ | ||
using System; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using Binance.Common; | ||
using Binance.Spot; | ||
using Binance.Spot.Models; | ||
using Microsoft.Extensions.Logging; | ||
|
||
public class MarginDustlog_Example | ||
{ | ||
public static async Task Main(string[] args) | ||
{ | ||
using var loggerFactory = LoggerFactory.Create(builder => | ||
{ | ||
builder.AddConsole(); | ||
}); | ||
ILogger logger = loggerFactory.CreateLogger<MarginDustlog_Example>(); | ||
|
||
HttpMessageHandler loggingHandler = new BinanceLoggingHandler(logger: logger); | ||
HttpClient httpClient = new HttpClient(handler: loggingHandler); | ||
|
||
string apiKey = "api-key"; | ||
string apiSecret = "api-secret"; | ||
|
||
var marginAccountTrade = new MarginAccountTrade(httpClient, apiKey: apiKey, apiSecret: apiSecret); | ||
|
||
var result = await marginAccountTrade.MarginDustlog(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Binance.Spot.WalletExamples | ||
{ | ||
using System; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using Binance.Common; | ||
using Binance.Spot; | ||
using Binance.Spot.Models; | ||
using Microsoft.Extensions.Logging; | ||
|
||
public class UserAsset_Example | ||
{ | ||
public static async Task Main(string[] args) | ||
{ | ||
using var loggerFactory = LoggerFactory.Create(builder => | ||
{ | ||
builder.AddConsole(); | ||
}); | ||
ILogger logger = loggerFactory.CreateLogger<UserAsset_Example>(); | ||
|
||
HttpMessageHandler loggingHandler = new BinanceLoggingHandler(logger: logger); | ||
HttpClient httpClient = new HttpClient(handler: loggingHandler); | ||
|
||
string apiKey = "api-key"; | ||
string apiSecret = "api-secret"; | ||
|
||
var wallet = new Wallet(httpClient, apiKey: apiKey, apiSecret: apiSecret); | ||
|
||
var result = await wallet.UserAsset(); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Examples/FSharp/MarginAccountTrade/MarginDustlog_Example.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
open System | ||
open System.Net | ||
open System.Net.Http | ||
open System.Threading.Tasks | ||
open Microsoft.Extensions.Logging | ||
open Binance.Common | ||
open Binance.Spot | ||
open Binance.Spot.Models | ||
|
||
[<EntryPoint>] | ||
let main argv = | ||
let loggerFactory = LoggerFactory.Create(fun (builder:ILoggingBuilder) -> | ||
builder.AddConsole() |> ignore | ||
) | ||
let logger = loggerFactory.CreateLogger() | ||
|
||
let loggingHandler = new BinanceLoggingHandler(logger) | ||
let httpClient = new HttpClient(loggingHandler) | ||
|
||
let apiKey = "api-key"; | ||
let apiSecret = "api-secret"; | ||
|
||
let marginAccountTrade = new MarginAccountTrade(httpClient, apiKey = apiKey, apiSecret = apiSecret) | ||
|
||
let result = marginAccountTrade.MarginDustlog() |> Async.AwaitTask |> Async.RunSynchronously | ||
|
||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
open System | ||
open System.Net | ||
open System.Net.Http | ||
open System.Threading.Tasks | ||
open Microsoft.Extensions.Logging | ||
open Binance.Common | ||
open Binance.Spot | ||
open Binance.Spot.Models | ||
|
||
[<EntryPoint>] | ||
let main argv = | ||
let loggerFactory = LoggerFactory.Create(fun (builder:ILoggingBuilder) -> | ||
builder.AddConsole() |> ignore | ||
) | ||
let logger = loggerFactory.CreateLogger() | ||
|
||
let loggingHandler = new BinanceLoggingHandler(logger) | ||
let httpClient = new HttpClient(loggingHandler) | ||
|
||
let apiKey = "api-key"; | ||
let apiSecret = "api-secret"; | ||
|
||
let wallet = new Wallet(httpClient, apiKey = apiKey, apiSecret = apiSecret) | ||
|
||
let result = wallet.UserAsset() |> Async.AwaitTask |> Async.RunSynchronously | ||
|
||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters