Skip to content

Commit

Permalink
#7 account endpoint doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tkowalczyk committed Dec 2, 2019
1 parent aff34af commit 8c45fad
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Algorand/Algorand.Test.Client.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class Program
{
static void Main(string[] args)
{
var algoapi = new AlgorandApiClient("https://testnet-algorand.api.purestake.io/ps1");
algoapi.SetApiKey("X-API-Key", "");
var algoApi = new AlgorandApiClient("https://testnet-algorand.api.purestake.io/ps1");
algoApi.SetApiKey("X-API-Key", "");

var algod = new AlgodClient(algoapi);
var algod = new AlgodClient(algoApi);

var addre = algod.GetTransactionsPendingAsync("LHHQJ6UMXRGEPXBVFKT7SY26BQOIK64VVPCLVRL3RNQLX5ZMBYG6ZHZMBE").Result;
var addre = algod.GetAccountInformationAsync("LHHQJ6UMXRGEPXBVFKT7SY26BQOIK64VVPCLVRL3RNQLX5ZMBYG6ZHZMBE").Result;

Console.ReadLine();
}
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,48 @@
# Algorand-SDK
Unofficial Algorand SDK in .NET Core for Algorand API

## How to use

First you need to choose Algod API Endpoint to use:

- Algod BetaNet API (`https://betanet-algorand.api.purestake.io/ps1`)
- Algod TestNet API (`https://testnet-algorand.api.purestake.io/ps1`)
- Algod MainNet API (`https://mainnet-algorand.api.purestake.io/ps1`)

Above endpoints are from [PureStake](https://developer.purestake.io/home) so you do not need to run Algorand Node on your own machine.

var algoApi = new AlgorandApiClient("https://testnet-algorand.api.purestake.io/ps1");

You will also need the Api Key it is available also on [PureStake](https://developer.purestake.io/dashboard)

algoApi.SetApiKey("X-API-Key", "");

var algod = new AlgodClient(algoApi);

## Algo API status from PureStake

var status = await algod.GetHealthAsync();

Returns OK if healthy.

## Algod Process

The algod process handles processing the protocol, proposing blocks, interacting with the ledger, and building voting committees. The algod process also provides an API that retrieves information about the blockchain, like specific transactions, blocks, and network status.

### Account Endpoint

Given a specific account public key, this call returns the accounts status, balance and spendable amounts.

var accountInfo = await algod.GetAccountInformationAsync("LHHQJ6UMXRG..");

Given a wallet address and a transaction id, it returns the confirmed transaction information. This call scans up to .MaxTxnLife blocks in the past.

var transactionsInfo = await algod.GetTransactionInformationAsync("LHHQ..", "6GZWBHH..");

Returns the list of confirmed transactions between within a date range. This call is available only when the indexer is running.

var transactions = await algod.GetTransactionsAsync("LHHQJ6UM...);

Get the list of pending transactions by address, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.

var pendingTx = await algod.GetTransactionsPendingAsync("LHHQJ6UM..");

0 comments on commit 8c45fad

Please sign in to comment.