- SDK to create a wallet, upload a Smart Contract, or use the IOST blockchain for application integration
- Supports .Net Standard 2.0+ / .Net Framework 4.5+
- Uses a Secure Keychain to keep the private key secured
- Implements all APIs
- Implements all queries to IOST contracts: System, Economic, and Token
using IOSTSdk.Contract.System;
...
var tx = iost.NewTransaction()
.AuthSignUp(...);
using IOSTSdk.Contract.Economic;
...
var tx = iost.NewTransaction()
.RamBuy(...);
using IOSTSdk.Contract.Token;
...
var tx = iost.NewTransaction()
.TokenTransfer(...);
var client = Client.NewKorea();
var iost = new IOST(client, new Options { ExpirationInMillis = 5000 });
var tx = iost.NewTransaction()
.CreateAccount(newAccountName, creatorsName, newAccountPublicKey, newAccountPublicKey);
var kc = new Keychain(creatorsName);
kc.AddKey(
new SecureBytes(IOST.Base58Decode(
creatorsPrivateKeyInBase58)),
"active");
tx.AddApprove("*", "unlimited");
kc.Sign(tx);
var hash = await iost.Send(tx);
var client = Client.NewJapan();
var iost = new IOST(client, new Options { ExpirationInMillis = 5000 });
var tx = iost.NewTransaction()
.Transfer("iost", fromAccountName, toAccountName, amount, "");
var kc = new Keychain(fromAccountName);
kc.AddKey(
new SecureBytes(IOST.Base58Decode(
fromAccountsPrivateKeyBase58)),
"active");
kc.Sign(tx);
var hash = await iost.Send(tx);
var client = Client.NewKorea();
var iost = new IOST(client, new Options { ExpirationInMillis = 5000 });
var tx = iost.NewTransaction()
.VoteProducerVote(accountName, candidateAccountName, "10000");
var kc = new Keychain(accountName);
kc.AddKey(
new SecureBytes(IOST.Base58Decode(
accountPrivateKey)),
"active");
tx.AddApprove("*", "unlimited");
kc.Sign(tx);
var hash = await iost.Send(tx);
var client = Client.NewJapan();
var iost = new IOST(client, new Options { ExpirationInMillis = 5000 });
var tx = iost.NewTransaction()
.VoteProducerUnvote(accountName, candidateAccountName, "10000");
var kc = new Keychain(accountName);
kc.AddKey(
new SecureBytes(IOST.Base58Decode(
accountPrivateKey)),
"active");
tx.AddApprove("*", "unlimited");
kc.Sign(tx);
var hash = await iost.Send(tx);
var tx = iost.NewTransaction();
using (var abiFile = File.OpenRead(Path.Combine(WORKDIR, "abi.json")))
using (var abiRdr = new StreamReader(abiFile))
using (var jsFile = File.OpenRead(Path.Combine(WORKDIR, "code.js")))
using (var jsRdr = new StreamReader(jsFile))
{
tx.PublishContract(abiRdr, jsRdr);
}
var kc = new Keychain(accountName);
kc.AddKey(
new SecureBytes(IOST.Base58Decode(
accountPrivateKey)),
"active");
tx.AddApprove("*", "unlimited");
kc.Sign(tx);
return iost.Send(tx);
var tx = _iost.NewTransaction();
using (var abiFile = File.OpenRead(Path.Combine(WORKDIR, "abi2.json")))
using (var abiRdr = new StreamReader(abiFile))
using (var jsFile = File.OpenRead(Path.Combine(WORKDIR, "code.js")))
using (var jsRdr = new StreamReader(jsFile))
{
tx.UpdateContract("ContractF5qwDudF1z5RFnUbJ9muguX4CF1ptex8nBbgZWmRuZ9b", abiRdr, jsRdr, "");
}
var kc = new Keychain(accountName);
kc.AddKey(
new SecureBytes(IOST.Base58Decode(
accountPrivateKey)),
"active");
kc.Sign(tx);
var hash = await _iost.Send(tx);
For .Net Framework 4.5+, must define the following functions if Secp256k1 is needed
- IOST.CryptoSignSecp256k1
- IOST.CryptoGetPubkeySecp256k1
- IOST.CryptoGetPubkeySecp256k1Compressed
- IOST.CryptoGeneratePrivateKeySecp256k1
<ItemGroup>
<Content Include="..\packages\libsodium.1.0.17\runtimes\win-$(Platform)\native\libsodium.dll">
<Link>libsodium.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>