Skip to content

Borlay/Borlay.Iota.Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Attention

For now this library is not working. IOTA changed encryption (Curl) and theses changes in this library are not implemented yet.

Introduction

The Borlay.Iota.Library implements [IOTA IRI api calls]. It also can do the proof of work for you.

http://iota.org https://github.com/iotaledger

Donate

PJGEZFOH99UVRUTRNWPZIYHHKWBMQKG9BHCMJGOZWWSPEWLTJYOHEFSJFQJHDBVOXLHMJATJIALSXELYXRBGAMWZHW

Technologies

The Borlay.Iota.Library is writen for .NET Standard 1.1 framework. It can be used in .net 4.5 and .net core 1.0 as well. For full .net frameworks support visit .NET Standard 1.1

Nuget

Install-Package Borlay.Iota.Library

Borlay.Iota.Library nuget

Getting started

Get the address with the balance and the transactions hashes

var api = new IotaApi("http://node.iotawallet.info:14265", 15);
var address = await api.GetAddress("YOURSEED", 0);

// use address
var balance = address.Balance;
var transactionHashes = address.Transactions;

Renew your addresses

api.RenewBalances(address); // gets the balances
api.RenewTransactions(address); // gets the transactions hashes
api.RenewAddresses(address); // both

You can send empty transaction simply by doing this

var transfer = new TransferItem()
{
  Address = "ADDRESS",
  Value = 0,
  Message = "MESSAGETEST",
  Tag = "TAGTEST"
};
var transactionItem = await api.SendTransfer(transfer, CancellationToken.None);

Or you can send the transaction with the value

var transfer = new TransferItem()
{
  Address = "ADDRESS",
  Value = 1000,
  Message = "MESSAGETEST",
  Tag = "TAGTEST"
};
var transactionItem = await api.SendTransfer(transfer, "YOURSEED", 0, CancellationToken.None);

By default the pow will run on local pc but you can change to run it on iri

api.NonceSeeker = api.IriApi;

POW

You can do the pow (attachToTangle) like this

var transactionTrytes = transfer.CreateTransactions().GetTrytes(); // gets transactions from transfer and then trytes
var toApprove = await api.IriApi.GetTransactionsToApprove(9); // gets transactions to approve
var trunk = toApprove.TrunkTransaction;
var branch = toApprove.BranchTransaction;

var trytesToSend = await transactionTrytes
                .DoPow(trunk, branch, 15, 0, CancellationToken.None); // do the pow
await api.BroadcastAndStore(trytesToSend); // broadcast and send the trytes

About

IOTA library for .NET Standard framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages