New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

stealthjs-lib

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stealthjs-lib

Stealth coin (XST) SDK library for Javascript

latest
npmnpm
Version
0.5.6
Version published
Maintainers
4
Created
Source

Stealth (ticker symbol XST) Javascript SDK

This is a Javascript SDK library for querying Stealth RPC daemon.

Install:

npm install --save stealthjs-lib

Stealth features:

  • 5 second block
  • Fee-less transactions
  • Cryptographic private transactions
  • Massive blockchain scalability
  • On-Chain governance
  • Supports smart contracts, Blockchain Oracles and side chains

Learn more about Stealth, the fastest private digital currency at the official website https://stealth.org/

Usage

const Stealth = require('stealthjs-lib');

const client = new Stealth({
  host: "localhost", // Host for the RPC daemon
  port: 46502, // Port for the RPC daemon
  username: "rpcclientusername", // Username for RPC daemon
  password: "rpcclientpassword", // Password for RPC daemon
  jsonRpc: "2.0", // JSON rpc version
  debug: false, // Turns on logging of the request and response
});

await client.help();

API definition

request(method, params) ⇒ Promise.<object>

Make request to any of the RPC functions directly

ParamType
methodstring
paramsArray.<any>

addmultisigaddress(nRequired, keys, [account]) ⇒ Promise.<Object>

Add a n-required-to-sign multi-signature address to the wallet each key is an XST address or hex-encoded public key If [account] is specified, assign address to [account].

ParamTypeDefault
nRequirednumber
keysArray.<string>
[account]string""

backupwallet(destination) ⇒ Promise.<Object>

Safely copies wallet.dat to destination, which can be a directory or a path with filename.

ParamType
destinationstring

checkwallet() ⇒ Promise.<Object>

Check wallet for integrity.

claimqposbalance(txId, vOut, amount) ⇒ Promise.<Object>

claimqposbalance is the transaction ID of the input is the prevout index of the input is the amount to claim Amount is real and rounded to the nearest 0.000001. Claim plus change is returned to claimant hashed pubkey

ParamType
txIdstring
vOutnumber
amountnumber

clearwallettransactions() ⇒ Promise.<Object>

delete all transactions from wallet - reload with scanforalltxns Warning: Backup your wallet first!

createrawtransaction(transactions, addresses) ⇒ Promise.<Object>

createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...} Create a transaction spending given inputs (array of objects containing transaction id and output number), sending to given address(es). Returns hex-encoded raw transaction. Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.

ParamTypeDescription
transactionsArray.<object>[{"txid":txid,"vOut":n},...]
addressesobject{address:amount,...}

decoderawtransaction(hex) ⇒ Promise.<Object>

Return a JSON object representing the serialized, hex-encoded transaction.

ParamType
hexstring

disablestaker(txId, vOut, alias) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
txIdstringtransaction ID of the input
vOutnumberprevout index of the input
aliasaliasnon-case sensitive staker alias

dumpprivkey(XSTAddress) ⇒ Promise.<Object>

Reveals the private key corresponding to .

ParamType
XSTAddressstring

enablestaker(txId, vOut, alias) ⇒ Promise.<Object>

enablestaker is the transaction ID of the input is the prevout index of the input is a non-case sensitive staker alias

ParamType
txIdstring
vOutnumber
aliasstring

encryptwallet(passphrase) ⇒ Promise.<Object>

Encrypts the wallet with

ParamType
passphrasestring

exitreplay() ⇒ Promise.<Object>

Manually exits registry replay (testnet only).

getaccount(XSTAddress) ⇒ Promise.<Object>

Returns the account associated with the given address.

ParamType
XSTAddressstring

getaccountaddress(account) ⇒ Promise.<Object>

Returns the current XST address for receiving payments to this account.

ParamType
accountstring

getaddressbalance(address) ⇒ Promise.<Object>

Returns the balance of

.

ParamType
addressstring

getaddressesbyaccount(account) ⇒ Promise.<Object>

Returns the list of addresses for the given account.

ParamType
accountstring

getaddressinfo(address) ⇒ Promise.<Object>

Returns info about

.

ParamType
addressstring

getaddressinouts(address, [start], [max]) ⇒ Promise.<Object>

Returns [max] inputs + outputs of

beginning with [start] For example, if [start]=101 and [max]=100 means to return the second 100 in-outs (if possible). [start] is the nth in-out (default: 1) [max] is the max in-outs to return (default: 100)

ParamTypeDefault
addressstring
[start]number1
[max]number100

getaddressinputs(address, [start], [max]) ⇒ Promise.<Object>

Returns [max] inputs of

beginning with [start] For example, if [start]=101 and [max]=100 means to return the second 100 inputs (if possible).

ParamTypeDefault
addressstring
[start]number1
[max]number100

getaddressoutputs(address, [start], [max]) ⇒ Promise.<Object>

Returns [max] outputs of

beginning with [start] For example, if [start]=101 and [max]=100 means to return the second 100 outputs (if possible).

ParamTypeDefault
addressstring
[start]number1
[max]number100

getadjustedtime() ⇒ Promise.<Object>

Returns the Stealth network adjusted time.

getbalance(account, [minConf]) ⇒ Promise.<Object>

If [account] is not specified, returns the server's total available balance. If [account] is specified, returns the balance in the account.

ParamTypeDefault
accountstring
[minConf]number1

getbestblockhash() ⇒ Promise.<Object>

Returns the hash of the best block in the longest block chain.

getblock(hash, [txInfo]) ⇒ Promise.<Object>

Returns data needed to construct a block to work on:

  • "version" : block version
  • "previousblockhash" : hash of current highest block
  • "transactions" : contents of non-coinbase transactions that should be included in the next block
  • "coinbaseaux" : data that should be included in coinbase
  • "coinbasevalue" : maximum allowable input to coinbase transaction, including the generation award and transaction fees
  • "target" : hash target
  • "mintime" : minimum timestamp appropriate for next block
  • "curtime" : current timestamp
  • "mutable" : list of ways the block template may be changed
  • "noncerange" : range of valid nonces
  • "sigoplimit" : limit of sigops in blocks
  • "sizelimit" : limit of block size
  • "bits" : compressed target of next block
  • "height" : height of the next block

See https://en.bitcoin.it/wiki/BIP_0022 for full specification.

ParamTypeDefault
hashstring
[txInfo]booleanfalse

getblockbynumber(number, [txInfo]) ⇒ Promise.<Object>

Returns details of a block with given block-number.

ParamTypeDefault
numberstring
[txInfo]booleanfalse

getblockcount() ⇒ Promise.<Object>

Returns the number of blocks in the longest block chain

getblockhash(index) ⇒ Promise.<Object>

Returns hash of block in best-block-chain at .

ParamType
indexnumber

getblockinterval(period, windowSize, windowSpacing) ⇒ Promise.<Object>

Total block interval for the window in seconds

ParamType
periodnumber
windowSizenumber
windowSpacingnumber

getblockintervalmean(period, windowSize, windowSpacing) ⇒ Promise.<Object>

RMSD of the block intervals for the window in seconds

ParamType
periodstring
windowSizestring
windowSpacingstring

getblockintervalrmsd(period, windowSize, windowSpacing) ⇒ Promise.<Object>

RMSD of the block intervals for the window in seconds

ParamType
periodstring
windowSizestring
windowSpacingstring

getblockschedule(blocks) ⇒ Promise.<Object>

Returns details of Stealthnodes in the block schedule

ParamType
blocksstring

getcheckpoint() ⇒ Promise.<Object>

Show info of synchronized checkpoint.

getchildkey(extendedKey, child, [networkByte]) ⇒ Promise.<Object>

Returns key and address information about the child.

ParamType
extendedKeystring
childnumber
[networkByte]string

getconnectioncount() ⇒ Promise.<Object>

Returns the number of connections to other nodes.

getdifficulty() ⇒ Promise.<Object>

Returns the difficulty as a multiple of the minimum difficulty.

gethashespersec() ⇒ Promise.<Object>

Returns a recent hashes per second performance measurement while generating.

gethdaccount(extendedKey) ⇒ Promise.<Object>

Returns all transactions for the hdaccount.

ParamType
extendedKeystring

gethourlymissed(hours) ⇒ Promise.<Object>

Returns an object with an array of numbers that represent number of missed blocks in the last .

ParamType
hoursnumber

getinfo() ⇒ Promise.<Object>

Returns an object containing various state info.

getmininginfo() ⇒ Promise.<Object>

Returns an object containing mining-related information.

getnewaddress([account]) ⇒ Promise.<Object>

Returns a new XST address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].

ParamType
[account]string

getnewestblockbeforetime(time) ⇒ Promise.<Object>

Returns the hash of the newest block that has a time stamp earlier than is a unix epoch (seconds)

ParamType
timenumber

getnewpubkey([account]) ⇒ Promise.<Object>

Returns new public key for coinbase generation.

ParamType
[account]string

getnewstealthaddress([label]) ⇒ Promise.<Object>

Returns a new StealthAddress for receiving payments anonymously.

ParamType
[label]string

getpeerinfo() ⇒ Promise.<Object>

Returns data about each connected network node.

getpicopowermean(period, windowSize, windowSpacing) ⇒ Promise.<Object>

Returns an object with attributes: window_start: starting time of each window, number_blocks: number of blocks in each window, pico_power_mean: mean expressed in units of 1e-12 power".

ParamType
periodnumber
windowSizenumber
windowSpacingnumber

getqposbalance(pubKey) ⇒ Promise.<Object>

Returns qPoS balance owned by

ParamType
pubKeystring

getqposinfo([height]) ⇒ Promise.<Object>

Returns exhaustive qPoS information Optional [height] will get info as of that height (expensive)

ParamType
[height]number

getrawmempool() ⇒ Promise.<Object>

Returns all transaction ids in memory pool.

getrawtransaction(txId, [verbose]) ⇒ Promise.<Object>

If verbose=0, returns a string that is serialized, hex-encoded data for . If verbose is non-zero, returns an Object with information about .

ParamTypeDefault
txIdstring
[verbose]number0

getreceivedbyaccount(account, [minConf]) ⇒ Promise.<Object>

Returns the total amount received by addresses with in transactions with at least [minconf] confirmations.

ParamTypeDefault
accountstring
[minConf]number1

getreceivedbyaddress(XSTAddress, [minConf]) ⇒ Promise.<Object>

Returns the total amount received by in transactions with at least [minconf] confirmations.

ParamTypeDefault
XSTAddressstring
[minConf]number1

getrecentqueue(blocks) ⇒ Promise.<Object>

is the number of blocks to look back. Returns a 1, 0 array, where 1 is hit and 0 is miss. The array is ordered chronologically.

ParamTypeDefault
blocksnumber

getrichlist([start], [max]) ⇒ Promise.<Object>

Returns the number of addresses with balances greater than [minimum].

ParamTypeDefault
[start]number0
[max]number10

getrichlistsize([minimum]) ⇒ Promise.<Object>

Returns the number of addresses with balances greater than [minimum].

ParamTypeDefault
[minimum]number0

getstakersbyid([disqualified]) ⇒ Promise.<Object>

Returns details of StealthNodes by ascending id. Optional [disqualified=false] includes disqualified stakers if true.

ParamTypeDefault
[disqualified]boolfalse

getstakerid(alias) ⇒ Promise.<Object>

Returns the id of the staker registered with .

ParamType
aliasstring

getstakerinfo(alias) ⇒ Promise.<Object>

Returns exhaustive information about the qPoS registry. is a non-case sensitive staker alias.

ParamType
aliasstring

getstakerprice() ⇒ Promise.<Object>

Returns the current staker price.

getstakerpriceinfo() ⇒ Promise.<Object>

Returns staker price history and ROI information. is the number of stakers for which to calculate prices.

ParamType
stakersnumber

getstakersbyweight() ⇒ Promise.<Object>

Returns details of Stealthnodes in descending weight.

getstakersummary() ⇒ Promise.<Object>

Returns a summary of the state and activity of Stealthnodes.

getsubsidy([nTarget]) ⇒ Promise.<Object>

Returns proof-of-work subsidy value for the specified value of target.

ParamType
[nTarget]string

gettransaction(txId) ⇒ Promise.<Object>

Get detailed information about

ParamType
txIdstring

gettxvolume(period, windowSize, windowSpacing) ⇒ Promise.<Object>

Number of transactions in each window

ParamType
periodnumber
windowSizenumber
windowSpacingnumber

getxstvolume(period, windowSize, windowSpacing) ⇒ Promise.<Object>

Amount of xst transferred in each window

ParamType
periodnumber
windowSizenumber
windowSpacingnumber

help(command) ⇒ Promise.<Object>

List commands, or get help for a command.

ParamType
commandstring

importprivkey(XSTPrivateKey, [label]) ⇒ Promise.<Object>

Adds a private key (as returned by dumpprivkey) to your wallet.

ParamType
XSTPrivateKeystring
[label]string

importstealthaddress(scanSecret, spendSecret, [label]) ⇒ Promise.<Object>

Import an owned StealthAddresses.

ParamType
scanSecretstring
spendSecretstring
[label]string

keypoolrefill([newSize]) ⇒ Promise.<Object>

Fills the keypool.

ParamType
[newSize]string

listaccounts([minConf]) ⇒ Promise.<Object>

Returns Object that has account names as keys, account balances as values.

ParamTypeDefault
[minConf]number1

listaddressgroupings() ⇒ Promise.<Object>

Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions

listreceivedbyaccount([minConf], [includeEmpty]) ⇒ Promise.<Object>

Returns an array of objects containing:

  • "account" : the account of the receiving addresses
  • "amount" : total amount received by addresses with this account
  • "confirmations" : number of confirmations of the most recent transaction included
ParamTypeDefaultDescription
[minConf]number1minimum number of confirmations before payments are included
[includeEmpty]booleanfalsewhether to include addresses that haven't received any payments

listreceivedbyaddress([minConf], [includeEmpty]) ⇒ Promise.<Object>

Returns an array of objects containing:

  • "address" : receiving address
  • "account" : the account of the receiving address
  • "amount" : total amount received by the address
  • "confirmations" : number of confirmations of the most recent transaction included
ParamTypeDefaultDescription
[minConf]number1minimum number of confirmations before payments are included
[includeEmpty]booleanfalsewhether to include addresses that haven't received any payments

listsinceblock([blockHash], [targetConfirmations]) ⇒ Promise.<Object>

Get all transactions in blocks since block [blockHash], or all transactions if omitted

ParamTypeDefault
[blockHash]string
[targetConfirmations]number0

liststealthaddresses(showSecrets) ⇒ Promise.<Object>

List owned StealthAddresses.

ParamType
showSecretsstring

listtransactions(account, count, from) ⇒ Promise.<Object>

Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].

ParamTypeDefault
accountstring
countnumber10
fromnumber0

listunspent([minConf], [maxConf], [txOuts]) ⇒ Promise.<Object>

Returns array of unspent transaction outputs with between minConf and maxConf (inclusive) confirmations. Optionally filtered to only include txOuts paid to specified addresses. Results are an array of Objects, each of which has: {txId, vOut, scriptPubKey, amount, confirmations}

ParamTypeDefaultDescription
[minConf]number1
[maxConf]number9999999
[txOuts]Array.<string>["address",...]

makekeypair([prefix]) ⇒ Promise.<Object>

Make a public/private key pair. [prefix] is optional preferred prefix for the public key.

ParamType
[prefix]string

move(fromAccount, toAccount, amount, [minConf], [comment]) ⇒ Promise.<Object>

Move from one account in your wallet to another.

ParamTypeDefault
fromAccountstring
toAccountstring
amountnumber
[minConf]number1
[comment]string""

purchasestaker(txId, vOut, alias, owner, [amount], [delegate], [controller], [payout]) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
txIdstring
vOutnumber
aliasstring
ownerstring
[amount]numberis is the amount to pay If the amount is not specified it will be calculated automatically
[delegate]stringand [controller] are compressed pubkeys If delegate and controller are not specified then they are taken from owner.
[controller]string
[payout]numberis in percentage, and is rounded to the nearest thousandths of a percent Either just the owner key or all 3 keys plus the payout must be specified.

repairwallet() ⇒ Promise.<Object>

Repair wallet if checkwallet reports any problem.

resendtx() ⇒ Promise.<Object>

Re-send unconfirmed transactions.

reservebalance([reserve], [amount]) ⇒ Promise.<Object>

Set reserve amount not participating in network protection. If no parameters provided current setting is printed.

ParamTypeDefault
[reserve]boolean
[amount]number0

scanforalltxns([fromHeight]) ⇒ Promise.<Object>

Scan blockchain for owned transactions.

ParamTypeDefault
[fromHeight]number0

scanforstealthtxns([fromHeight]) ⇒ Promise.<Object>

Scan blockchain for owned stealth transactions.

ParamTypeDefault
[fromHeight]number0

sendalert(message, privateKey, minVer, maxVer, priority, id, [cancelUpTo]) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
messagestringalert text message
privateKeystringhex string of alert master private key
minVerstringminimum applicable internal client version
maxVerstringmaximum applicable internal client version
prioritystringinteger priority number
idstringalert id (id=0 canels all alerts except id=1 alerts)
[cancelUpTo]stringcancels all alert id's up to this number

sendfrom(fromAccount, toXSTAddress, amount, [minConf], [comment], [commentTo]) ⇒ Promise.<Object>

Kind: global function

ParamTypeDefaultDescription
fromAccountstring
toXSTAddressstring
amountnumberreal and is rounded to the nearest 0.000001
[minConf]number1
[comment]string""
[commentTo]string""

sendmany(fromAccount, addressAmount, [minConf], [comment]) ⇒ Promise.<Object>

Kind: global function

ParamTypeDefaultDescription
fromAccountstring
addressAmountobject{address: amount,...} amounts are double-precision floating point numbers
[minConf]number1
[comment]string""

sendrawtransaction(hex) ⇒ Promise.<Object>

Submits raw transaction (serialized, hex-encoded) to local node and network.

ParamType
hexstring

sendtoaddress(XSTAddress, amount, [comment], [commentTo]) ⇒ Promise.<Object>

Kind: global function

ParamTypeDefaultDescription
XSTAddressstring
amountnumberreal and is rounded to the nearest 0.000001
[comment]string""
[commentTo]string""

sendtostealthaddress(address, amount, [narration], [comment], [commentTo]) ⇒ Promise.<Object>

Kind: global function

ParamTypeDefaultDescription
addressstring
amountnumberreal and is rounded to the nearest 0.000001
[narration]string""
[comment]string""
[commentTo]string""

setaccount(XSTAddress, account) ⇒ Promise.<Object>

Sets the account associated with the given address.

ParamType
XSTAddressstring
accountstring

setstakercontroller(txId, vOut, alias, controller) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
txIdstringtransaction ID of the input
vOutnumberprevout index of the input
aliasstringnon-case sensitive staker alias
controllerstringcompressed pubkey

setstakerdelegate(txId, vOut, alias, delegate, payout) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
txIdstringtransaction ID of the input
vOutnumberprevout index of the input
aliasstringon-case sensitive staker alias
delegatestringcompressed pubkey
payoutstringfraction of block rewards to pay to the delegate in millipercent

setstakermeta(txId, vOut, alias, key, value) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
txIdstringtransaction ID of the input
vOutnumberprevout index of the input
aliasstringon-case sensitive staker alias
keystringmetadata key
valuenumbermetadata value

setstakerowner(txId, vOut, alias, owner) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
txIdstringtransaction ID of the input
vOutnumberprevout index of the input
aliasstringon-case sensitive staker alias
ownerstringowners compressed pubkey

settxfee(amount) ⇒ Promise.<Object>

Kind: global function

ParamTypeDescription
amountnumberis a real and is rounded to the nearest 0.01

signmessage(XSTAddress, message) ⇒ Promise.<Object>

Sign a message with the private key of an address

ParamType
XSTAddressstring
messagestring

signrawtransaction(hex, transactions, privateKeys, [signHashTypes]) ⇒ Promise.<Object>

Sign inputs for raw transaction (serialized, hex-encoded).

ParamTypeDefault
hexstring
transactionsArray.<object>
privateKeysArray.<string>
[signHashTypes]string"&quot;ALL&quot;"

stop(detach) ⇒ Promise.<Object>

Stop StalthCoin server (and possibly override the detachdb config value).

ParamType
detachboolean

validateaddress(XSTAddress) ⇒ Promise.<Object>

Return information about .

ParamType
XSTAddressstring

validatepubkey(XSTPubKey) ⇒ Promise.<Object>

Return information about .

ParamType
XSTPubKeystring

verifymessage(XSTAddress, signature, message) ⇒ Promise.<Object>

Verify a signed message

ParamType
XSTAddressstring
signaturestring
messagestring

getcharacterspg(page, perPage, ordering) ⇒ Promise.<Object>

Verify a signed message

ParamType
pagenubmer
perPagenubmer
orderingboolean

Keywords

stealth

FAQs

Package last updated on 10 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts