This is a demo application using Io.Gate.GateApi to show how Gate APIv4 works.
Instead of running it, it is recommended to read the source code to get a general idea of
how this SDK is used. However, you can modify this code directly to implement your own logic.
-
Clone this SDK project and run
dotnet buildin the cloned project to build the library.default target framework is
netstandard2.0, you can change it into local framework available, but framework supported must be satisfied. -
Create our demo project directory along side the SDK project like the following:
mkdir GateApiDemo && cd GateApiDemo dotnet new console -lang C#
-
Copy all the files in the example directory to
GateApiDemoproject created above. -
Edit the
GateApiDemo.csprojfile; change theTargetFrameworkto the target framework used in building the SDK; Change theHintPathto the path of SDK dll file generated in step 1 -
Run
dotnet buildto build the demo application, which will probably be generated atbin/Debug/<framework-used>/GateApiDemo.dll
READ THIS BEFORE YOU RUN ANYTHING
This application is shown for demo only. It will try to use your input API key and secret to trade, lend and borrow, etc. Make sure you know exactly what it does before running it.
Examples shown below use
dotnet runto run the application without explicit building. You can change todotnet /path/to/your/demo/dllafterdotnet buildto avoid building every time before running.
# run futures demo against TestNet
dotnet run futures -k <YOUR_TESTNET_API_KEY> -s <YOUR_TESTNET_API_SECRET> -u fx-api-testnet.gateio.ws
# run futures demo against real trading
dotnet run futures -k <YOUR_API_KEY> -s <YOUR_API_SECRET>
# run spot demo
dotnet run spot -k <YOUR_API_KEY> -s <YOUR_API_SECRET>
# run margin demo
dotnet run margin -k <YOUR_API_KEY> -s <YOUR_API_SECRET>