Steem API for Microsoft .NET available

avatar

Hello fellow devs, let me introduce Microsoft .NET class library for steemd's RPC endpoint : Steem.NET

Not everybody is familiar with Python or JavaScript. Some Microsoft Visual Studio developers might get frustrated avaing to move away from their favorite programming language.

That's why I created an easy to use .NET class exposing nearly all steemd API, giving you the power to play with any RPC endpoint. The library is really easy to use, check the example below.

I will maintain and improve the library as I am using it.
If you have any comment, request or want to add your own touch to the project, feel free to contact me or join steem.net group on steemitchat.

Here a small code example :

Imports Newtonsoft.Json
Module Test

    Public Sub Main()

        Using oSteem As New CSteemAPI

            Debug.Print(oSteem.get_config.ToString)
            Debug.Print(oSteem.get_account_count.ToString)

            Dim arrAcct As New ArrayList
            arrAcct.Add("arcange")
            For Each oAccount In oSteem.get_accounts(arrAcct)
                Debug.Print(oAccount.ToString)
            Next

            Dim oBlock As Linq.JObject
            Dim oTrans As Linq.JObject

            Dim lLastBlockID As Long = oSteem.get_dynamic_global_properties().Item("last_irreversible_block_num")

            For lBlockID As Long = 4000000 To lLastBlockID
                oBlock = oSteem.get_block(lBlockID)
                If Not oBlock.Item("transactions") Is Nothing Then

                    Debug.Print(String.Format("Block {0} {1} contains {2} transactions",
                                                oBlock.Item("block_num"),
                                                oBlock.Item("timestamp").ToObject(Of DateTime),
                                                oBlock.Item("transactions").Count))

                    For Each oTrans In oBlock.Item("transactions")
                        Debug.Print(String.Format("Transaction is {0} operations", 
                                                    oTrans.Item("operations").Item(0).Item(0)))
                    Next
                End If
            Next

        End Using

    End Sub

End Module
this code is downloadable from the repository

Full source code can be found on here and is currently available for VB.NET. I will port it to C# soon.

Enjoy and get full Steem Power !!!



0
0
0.000
7 comments
avatar

Been looking for a .NET Steemit library, I'll have to check this out later!

0
0
0.000
avatar

Cool. Any feedback is welcome :)

0
0
0.000
avatar

Thank you for this API, it's going to be extra useful to Future Media Vision.
Is there a post on which parts of the API you actually put in C# or did you integrate the whole API?

0
0
0.000
avatar

I implemented all the API that allows you to interact with the blockchain.
I have been lazier with the APIs that allow you to retrieve filtered data because I find it easier to use SteemSQL.

These not implemented APIs can be found here. It should not be difficult to implement them. Feel free to make a PR.

0
0
0.000
avatar

Those that you didn't implement seems better suited to be dealt with SteemSQL than with a direct query to a node, it might be much faster/cost-effective way to handle this than calling the nodes of the network.

Again, thanks for all the work you've done!

0
0
0.000
avatar

You're welcome @djennyfloro

BTW, feel free to support my work and vote for me as a witness.

0
0
0.000
avatar
(Edited)

You've long been on my Witness Voted List. Ever since back then I went to the Steem Chat, and you were the one who answered my newb questions lol. I was only worth 10 SP back then, but as someone who knew about the importance of witness in DPOS. I dutifully began to pick my witnesses. I guessed that someone who would answer the most basic questions of a steemian would do a good witness ^^".

Still, I clicked on your link to make sure... It's been a long while I haven't gone to my list and see who's in there.

0
0
0.000