Visual Studio C# (.Net version 6.0 and above)
Visual Studio C# (.Net version 3.0 to 5.0)
In this example we built an application in Visual Studio using C# Windows Forms App.
This allows you to create a Windows application that will interact with the Theta Guardian Node API running on a Windows computer. To change API commands edit the "json" string
with the correct json for the API call needed. In the source file below we have included 5 different API calls.
There are two limitations with this example. The first is the “Get Block” function. If pruning is set in the config file to 2048 then you can only retrieve the last 2048 blocks. The second is the “Get Transaction” function. This will only return transactions that happened after the snapshot was taken.
In the source file we used the older httpWebRequest to call the api instead of HttpClient because it was faster at returning the API call.
The above code could also be used to call a remote api such as our price api to display the current Theta or Tfuel price directly in the application.
© 2024 Thetascan.io