SteemConnect .Net Standard client library with Test Console
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SteemConnect.Net
.gitattributes
.gitignore
LICENSE
README.md

README.md

SteemConnect.Net

SteemConnect .Net Standard client library with Test Console

Like many of the libraries in other languages, there was no .Net Standard library for SteemConnect.

Documentation is being worked on. In the meantime, the main methods have their summary comments implemented.

The library is also available on Nuget

Quickstart

Initialize Library:

Config.Instance.Init("APIKEY", "APISECRET", "CALLBACK");

Create Login-Url:

var scopes = new string[] { Constants.PARAM_ACTION_OFFLINE, Constants.PARAM_ACTION_LOGIN, Constants.PARAM_ACTION_VOTE, Constants.PARAM_ACTION_COMMENT, Constants.PARAM_ACTION_CUSTOMJSON, Constants.PARAM_ACTION_DELETECOMMENT, Constants.PARAM_ACTION_COMMENT_OPTIONS, Constants.PARAN_ACTION_CLAIMREWARDBALANCE };
var loginUrl = Authentication.GetLoginUrl(scopes, null, true);

The call to the loginUrl will show the login to the user and return your callback url with additional parameters. Just pass this response to GetAccessTokenAsync method.

Get AccessToken

if (!string.IsNullOrWhiteSpace(response))
{
   SteemConnectEntity<AccessTokenResponse> accessTokenResponse = await Authentication.GetAccessTokenAsync(response, true);
}

This will return an AccessToken as well as a RefreshToken. It is your task to save them securely in your app or website.

Get user data

After obtaining the AccessToken, you can fetch the user data:

SteemConnectEntity<User> user = await SteemConnectRequest.GetUserDataAsync(AccessTokenResponse.Value.Accesstoken);

Create a new post with additional options

var meta = JsonConvert.SerializeObject(new BroadcastMetaData("DEV APP/0.0.1", "busy", new string[] { "test", "dev", "testing" }, PostFormat.MarkDown));

var beneficiaries = new BeneficiariesExtension();
beneficiaries.Beneficiaries.Add(new Beneficiary("beneficiary", 5000));

var permlink = "qs-app-dev-test-" + DateTime.Now.Ticks.ToString();
var commentOptions = new CommentOptions(DesUser.Value.Name, permlink, false, 1000, 0, true, null);

var post = await SteemConnectRequest.CreateNewCommentAsync(AccessTokenResponse.Value.Accesstoken, string.Empty, "test", DesUser.Value.Name, permlink, "Post Title", "Post Body <?>", meta, commentOptions);

If you want to create a post, author has to be empty. PermLink is the first category you are using

The full documentation is currently under construction, see the tester project for more samples.

If you have any problems, open an issue or feel free to contribute via a pull request.

Library works similar to official JS SDK