Skip to content

jingtum-lib to be used for interacting with jingtum blockchain network。This is the c# version。

License

Notifications You must be signed in to change notification settings

jccdream/jingtum-lib-csharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jingtum-lib-csharp

The jingtum-lib-csharp library to be used for interacting with jingtum blockchain network. This is the c# version.

Source code

  • src/jingtum-lib - The source codes of jingtum lib.
  • src/UnitTests - The unit tests for jingtum lib.
  • src/TestApp - The Windows Forms application for testing the jingtum lib apis.
  • Samples - The samples to use the jingtum lib.
  • docs - The documentation for the jingtum lib.

Development Environment

  • Windows 10
  • VisualStudio 2017
  • C# 7.0
  • .NET Framework 4.5

References:

The following libraries are referenced.

Install

Install from nuget package manager.

https://www.nuget.org/packages/JingTum.Lib/

Summary

The jingtum-lib-csharp library is based on the ws protocol to connect with jingtum system. The Remote class provides public APIs to create two kinds of objects: Request object by GET method, and Transaction object by POST method. And then can submit data to server through Submit() method.

How to use

  1. Create a new instance of Remote class.
    var remote = new Remote("wss://s.jingtum.com:5020", true);
  1. Connect to server.
    remote.Connect();
  1. Create a Request object by calling the Request*** methods. Call the Submit method to send request to server. You can get the result data by the callback function.
    remote.RequestServerInfo.Submit((result)=>  
    {
        // log result.Exception or result.Message  
    });  
  1. Close the connection.
    remote.Disconnect();

Remote class

Main handler for backend system. It creates a handle with jingtum, makes request to jingtum, subscribes event to jingtum, and gets info from jingtum.

Request<T> class

Request server and account info without secret. Request is used to get server, account, orderbook and path info. Request is not secret required, and will be public to every one. All requests are asynchronized and should provide a callback. Each callback provides the json message, exception, and result object.

Transaction<T> class

Post request to server with account secret. Transaction is used to make transaction and collect transaction parameter. Each transaction is secret required, and transaction can be signed local or remote. Now remote sign and local sign are supported. All transactions are asynchronized and should provide a callback. Each callback provides the json message, exception, and result object.

Events

You can listen events of the server.

  • Listening all transactions occur in the system. (Remote.Transactions event)
  • Listening all last closed ledger event. (Remote.LedgerClosed event)
  • Listening all server status change event. (Remote.ServerStatusChanged event)
  • Listening all events for specific account. (Remote.CreateAccountStub method)
  • Listening all events for specific orderbook pair. (Remote.CreateOrderBookStub method)

About

jingtum-lib to be used for interacting with jingtum blockchain network。This is the c# version。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%