Alexandria.net
1.0.1
See the version list below for details.
dotnet add package Alexandria.net --version 1.0.1
NuGet\Install-Package Alexandria.net -Version 1.0.1
<PackageReference Include="Alexandria.net" Version="1.0.1" />
paket add Alexandria.net --version 1.0.1
#r "nuget: Alexandria.net, 1.0.1"
// Install Alexandria.net as a Cake Addin #addin nuget:?package=Alexandria.net&version=1.0.1 // Install Alexandria.net as a Cake Tool #tool nuget:?package=Alexandria.net&version=1.0.1
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 | Versions 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. |
-
.NETCoreApp 2.0
- Newtonsoft.Json (>= 11.0.2)
- Serilog (>= 2.7.1)
- Serilog.Extensions.Logging (>= 2.0.2)
- Serilog.Formatting.Compact (>= 1.0.0)
- Serilog.Sinks.File (>= 4.0.0)
- Serilog.Sinks.Seq (>= 4.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.