Alexandria.net 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Alexandria.net --version 1.0.2
NuGet\Install-Package Alexandria.net -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alexandria.net" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Alexandria.net --version 1.0.2
#r "nuget: Alexandria.net, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Alexandria.net as a Cake Addin
#addin nuget:?package=Alexandria.net&version=1.0.2

// Install Alexandria.net as a Cake Tool
#tool nuget:?package=Alexandria.net&version=1.0.2

Alexandria

Alexandria.NET library for SophiaTX blockchain

Table of Contents

Install

git clone https://github.com/SophiaTX/Alexandria.git

Create Connection

 protected readonly SophiaClient _client = new SophiaClient(IpAddress, DemonPort, WalletPort); 

Library Functions

Details

Get Feed History

_client.Transaction.GetFeedHistory(CurrencySymbol);

Get details about the Blockchain

_client.Transaction.About();

Get a list of functions and How-To available on the sophia blockchain

_client.Transaction.Help();

Get recent transaction and block information on the blockchain

_client.Transaction.Info();

Get block infromation using blockId

_client.Transaction.GetBlock(blockNumber);

Get operations from a block

_client.Transaction.GetOpsInBlock(blockNumber, onlyVirtual);

Get Transaction details

var trx=_client.Transaction.GetTransaction(transactionId);

Keys

Generate Private Key and Public Key pair

_client.Key.GeneratePrivateKey(new byte[51], new byte[53]);

Get public key using private key

_client.Key.GetPublicKey(privateKey, new byte[53]);

Cryptography

Encrypt Memo with private key and receiver's public key for sending secure data across the blockchain

_client.Key.EncryptMemo(memo, PrivateKey, PublicKey2, new byte[1024]);

Decrypt the received using private key and sender's public key

_client.Key.DecryptMemo(encryptedMemo, PrivateKey2, PublicKey, new byte[1024]);

Send JSON data to list of recepients

var test = "{\"new_book_name\":\"test9999\"}";
           
var data = new SenderData
            {
                AppId = 2,
                PrivateKey = PrivateKey,
                Recipients = new List<string> {accountName1, acocuntName2},
                Sender = accountName,
                Document = test
            };
            
_client.Data.Send(data);

Send plain text to list of recepients

var data = new SenderData
            {
                AppId = 2,
                PrivateKey = PrivateKey,
                Recipients = new List<string> {accountName1, acocuntName2},
                Sender = accountName,
                DocumentChars = memo
            };
            
_client.Data.SendBinary(data);

List recieved documents, sorted depending on the search type, start(ISOTimeStamp)

_client.Data.Receive(AppID, accountName, SearchType, start, numberOfEntries);

Accounts

Create account using private key. Same public key can be used for all three keys required to create accoun.

Seed, can be any unique value string (have atleast 3 digits and no special characters ($, £, #, etc.)) for genrating new account name.

Creator, is an account with enough balance to pay for account creation.

_client.Account.CreateAccount(seed, jsonData, ownerKey, activeKey, memoKey, creator, creatorPrivateKey);

Get account details

_client.Account.GetAccount(accountName);

Delete account

_client.Account.DeleteAccount(accountName, PrivateKey);

Update account keys and JSON details

_client.Account.UpdateAccount(accountName, jsonData, ownerKey, activeKey, memoKey, privateKey);

Get account history

_client.Account.GetAccountHistory(accountName, from, limit);

Get account name from seed (used to create account)

_client.Account.GetAccountNameFromSeed(accountName);

Get account vesting balance

_client.Account.GetVestingBalance(accountName);

Get account balance

_client.Account.GetAccountBalance(accountName);

Check if account still exists

_client.Account.AccountExists(accountName);

Get account authority key

_client.Account.GetActiveAuthority(accountName);

Get account memo key

_client.Account.GetMemoKey(accountName);

Get account owner key

_client.Account.GetOwnerAuthority(accountName);

Create simple multi-signature authority

var pubkeys = new List<string> {publicKey1, publicKey2};
_client.Account.CreateSimpleMultisigAuthority(pubkeys, requiredSignatures);

Create simple managing authority

_client.Account.CreateSimpleManagedAuthority(managingAccountName);

Create simple multi-signature managing authority

var pubkeys = new List<string> {publicKey1, publicKey2};
_client.Account.CreateSimpleMultiManagedAuthority(pubkeys, requiredSignatures);

Transactions

Transfer amount (argument in the format "250000.00 SPHTX") from one to other account

_client.Asset.Transfer(accountName, beneficiaryAccountName, amount, memo, privateKey);

Withdraw amount (argument in the format "250000.00 SPHTX") vesting account balance

_client.Asset.WithdrawVesting(acocuntName, ammount, PrivateKey);

Transfer amount to vesting account

_client.Asset.TransferToVesting(accountName, beneficiaryAccountName, amount, privateKey);

Witnesses

Get Active Witnesses

_client.Witness.GetActiveWitnesses();

Get List of all witnesses

_client.Witness.ListWitnesses(witnessName, numberOfEntries);

Get details of a witness

_client.Witness.GetWitness(witnessName);

Become a witness, price feed example can be as

var feed1 = new List<PrizeFeedQuoteMessage>
            {
                new PrizeFeedQuoteMessage
                {
                    Currency = "USD",
                    PrizeFeedQuote = new PrizeFeedQuote {Base = "1 USD", Quote = "0.152063 SPHTX"}
                }
                
            };
            var feed2= new List<PrizeFeedQuoteMessage>
            {
                new PrizeFeedQuoteMessage
                {
                    Currency = "EUR",
                    PrizeFeedQuote = new PrizeFeedQuote {Base = "1 EUR", Quote = "0.154988 SPHTX"}
                }
                
            };     
        
var pricefeed=new List<List<PrizeFeedQuoteMessage>>{feed1,feed2};

_client.Witness.UpdateWitness(accountName, url, blockSigningKey, accountCreationFee, minimumBlockSize, pricefeed, privateKey);

Votes

Set voting proxy

_client.Account.SetVotingProxy(accountName, proxyAccountName, PrivateKey);

Vote for a witness

_client.Witness.VoteForWitness(accountName, witnessName, voteType, privateKey);

Applications

Create application (the price parameter that specifies billing for the app (1 or 0))

_client.Application.CreateApplication(accountName, applicationName, URL, jsonData, priceParam, PrivateKey);

Update application

_client.Application.UpdateApplication(accountName, applicationName, URL, jsonData, priceParam, PrivateKey);

Delete application

_client.Application.DeleteApplication(accountName, applicationName, PrivateKey);

Buy Application

_client.Application.BuyApplication(accountName, appId, PrivateKey);

Cancel Application purchase

_client.Application.CancelApplicationBuying(sellerAccountName, buyerAccountName, appId, PrivateKey);

Get a list of all bought application and sorting is done depending on search type (bySeller or byBuyer)

_client.Application.GetApplicationBuyings(accountName, SearchType, numberOfEntries);

Get details of list of applications

var names = new List<string>{applicationName1, applicationName2};
_client.Application.GetApplications(names);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4.1 1,121 11/13/2018
1.0.4 858 11/1/2018
1.0.3.8 923 10/24/2018
1.0.3.7 996 10/1/2018
1.0.3.6 928 9/30/2018
1.0.3.5 974 9/5/2018
1.0.2 1,072 8/2/2018
1.0.1 926 7/25/2018

Added platform dependent native libraries.