Alexandria.js
Alexandria.js API library for SophiaTX Blockchain
Table of Contents
Install
git clone https://github.com/SophiaTX/Alexandria.js.git
npm install
npm run build
or, use the new updated sophiatx-alexandria-api, npm module to run the project
npm install sophiatx-alexandria-api --save
let sophia=;
Connect to http services
sophiaapi;
Help
Get the current version and information about the blockchain
sophiaapi;
Get the recent updates on the blockchain.
sophiaapi;
Get help to work with the blockchain, this returns all the method and necessary details about the blockchain its functionalities.
sophiaapi;
Details
Get details about the block using block_id
sophiaapi;
Get details of operations inside a block
sophiaapi;
Check if the account still exists
sophiaapi;
Get transaction history of an account from (-1 means most recent entry) and limit (number of data to be displayed)
sophiaapi;
Get Account History filtered using its type (transfer, transfer_to_vesting, witness_update, account_create, account_delete,account_update, withdraw_vesting, vote, witness_update, transfer_to_vesting, account_witness_vote, account_witness_proxy, custom_json, custom_binary, etc.)
sophiaapi;
Get ActiveKey related to the account
sophiaapi;
Get MemoKey related to the account
sophiaapi;
Get OwnerKey related to the account
sophiaapi;
Get account balance of an account
sophiaapi;
Get account name using the seed(Any data string including uppercase,lowercase and numbers) used to create the account.
sophiaapi;
Get vesting balance of the account
sophiaapi;
Get feed history of the currency using its symbol
sophiaapi;
Keys
Generates separate public key for each of the roles
console;
Validates account name whether it can be set or not
console;
Generates public key and private key pair
console;
Checks the format of Public key and decides if it is valid with prefix
console;
Checks the format of Private key and decides if it is valid
console;
Returns public key on supplied Private key
console;
Matches public key with private key returns boolean value
console;
Corrects the caps and spaces in distorted passPhrase (brainKey)
console;
Cryptography
Use privateKey of sender's account and publicKey of receiver's account to encrypt the message
console;
Use publicKey of sender's account and privateKey of receiver's account to decrypt the message
console;
Accounts
Create account using seed(Any data string including uppercase,lowercase and numbers), creator as Witness's name, Witness's PrivateKey and user's PublicKey as ActiveKey
sophiaapi;
Delete account using user's PrivateKey
sophiaapi;
Update ActiveKey, OwnerKey, MemoKey and JsonMetadata of the account using user's PrivateKey
sophiaapi;
Get account details
sophiaapi;
Sponsor an account, isSponsored is a boolean value to enable and disable the sponsorship
sophiaapi;
Transaction
Transfer an amount (in the form of "amount (space) currencySymbol, 10.000 SPHTX") to other account with a memo (receipt/details) attached to the transfer using Sender's Priavtekey.
sophiaapi;
Get transaction id using transaction object as an argument.
console;
Transfer amount (in the form of "amount currencySymbol, 10.000 SPHTX") to Vesting.
sophiaapi;
Withdraw amount (in the form of "amount currencySymbol, 10.000 SPHTX") from Vesting in fractions.
sophiaapi;
Get transaction details using transaction id
sophiaapi;
Witness
Get list of Witnesses or miners
sophiaapi;
Get list of Witnesses by votes in descending order
sophiaapi;
Get details about a Witness
sophiaapi;
Update witness is the function to update an existing account as a witness contender it needs prize feed update as an argument,
prizeFeed example ([["USD",{"base":"1 USD","quote":"0.187331 SPHTX"}]]
) can be used for testing,
blockSigningKey (publicKey format) is used to sign all the blocks. It also needs a description url, where the willing user can put detail about herself.
To become a witness the user must have at least 250,000 SPHTX tokens in her vesting account.
sophiaapi;
Voting
Set a proxy account for doing votes on behalf of first account.
sophiaapi;
Vote for a witness using witness name and voter's PrivateKey
sophiaapi;
Data Transmission
Get the list of received documents, it can be searched by by_sender, by_recipient,by_sender_datetime,by_recipient_datetime.
sophiaapi;
Send binary data to the list of recipients (Secured/Encoded data could be transmitted using this function).
sophiaapi;
Send JSON data to the list of recipients.
sophiaapi;
Daemon Methods
Run other endpoint methods
sophiaapi;