Skip to content
ICON SDK for .Net (Unofficial)
Branch: master
Clone or download
Latest commit f0073e6 Dec 22, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.

ICON SDK for .Net

ICON SDK for .Net supports to communicate ICON network. It will help you integrate your application in .Net with ICON network. It follows ICON JSON-RPC API v3.

Quick start

using IconSDK.Account;

// Create new wallet.
// It will have random private key if you do not privide.
var wallet = Wallet.Create();

// Get your balance.
// It will retrieve the value from Testnet if you do not specify network.
var balance = await wallet.GetBalance();

// Transfer ICX
// It will transfer the value in Testnet if you do not specify network.
Address to = "hx0000000000000000000000000000000000000000";
BigInteger amount = 10 * Consts.Loop2ICX;
BigInteger stepLimit = 1 * Consts.Loop2ICX;
await wallet.Transfer(to, amount, stepLimit);

// Specify network.
wallet.ApiUrl = Consts.ApiUrl.MainNet;

// Store your key with password.
wallet.Store("yourPassword", "yourKeystorePath");

// Load your wallet from keystore.
wallet = Wallet.Load("yourPassword", "yourKeystorePath");



Referencing this project as a library.

$ git clone
$ mkdir myproject
$ cd myproject
$ dotnet new console
$ dotnet add reference ../IconSDK.Net/IconSDK/IconSDK.csproj

Getting DLL files

$ git clone
$ cd IconSDK.Net
$ dotnet restore
$ dotnet test IconSDK.Tests
$ dotnet publish --configuration Release


There are two methods to do it.

using IconSDK.RPCs;

// First
var getBalance = GetBalance.Create(Consts.ApiUrl.TestNet);
var balance = await getBalance("hx0000000000000000000000000000000000000000");
using IconSDK.RPCs;

// Second
var getBalance = new GetBalance(Consts.Api.TestNet);
var balance = await getBalance.Invoke("hx0000000000000000000000000000000000000000");


  • icx_getLastBlock
  • icx_getBlockByHeight
  • icx_getBlockByHash
  • icx_call
  • icx_getBalance
  • icx_getScoreApi
  • icx_getTotalSupply
  • icx_getTransactionResult
  • icx_getTransactionByHash
  • icx_sendTransaction
using IconSDK.RPCs;

// GetLastBlock
var getLastBlock = GetLastBlock.Create(Consts.ApiUrl.TestNet);
var block = await getLastBlock();

// GetTotalSupply
var getTotalSupply = new GetTotalSupply(Consts.ApiUrl.TestNet);
var totalSupply = await getTotalSupply.Invoke();

// SendTransaction
var txBuilder = new TransferTransactionBuilder();
txBuilder.PrivateKey = PrivateKey.Random();  // Your private key
txBuilder.To = "hx0000000000000000000000000000000000000000";
txBuilder.Value = 10 * Consts.Loop2ICX;
txBuilder.StepLimit = 1 * Consts.Loop2ICX;;
txBuilder.NID = 2;
var tx = txBuilder.Build();
var sendTransaction = new SendTransaction(Consts.ApiUrl.TestNet);

// It will raise an exception if your address does not have ICX enough.
var txHash = await sendTransaction.Invoke(tx);

// GetScoreApi
var getScoreApi = new GetScoreApi(Consts.ApiUrl.TestNet);
var scoreApi = await getScoreApi.Invoke("cx0000000000000000000000000000000000000001");

Console.WriteLine(JsonConvert.SerializeObject(scoreApi, Formatting.Indented));

var privateKey = PrivateKey.Random();
var address = Addresser.Create(privateKey);

// Call
var call = new Call(Consts.ApiUrl.TestNet);
var result = await call.Invoke(
    ("address", address)

// 0x0

var call0 = new Call<bool>(Consts.ApiUrl.TestNet);
var result0 = await call0.Invoke(
    ("address", address)

// false

var call1 = new Call<BigInteger>(Consts.ApiUrl.TestNet);
var result1 = await call1.Invoke(


var call2 = new Call<Dictionary<string, BigInteger>>(Consts.ApiUrl.TestNet);
var result2 = await call2.Invoke(




  • Unity Asset store
  • Sync RPC
  • Query v2 tx
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.