0.1.13 • Published 4 years ago

cron-lib-alpha v0.1.13

Weekly downloads
69
License
-
Repository
-
Last release
4 years ago

Client

Client class for Cron RPC. Node.js CRON integration example

Kind: global class

new Client(url, protocol, host, port)

ParamTypeDefaultDescription
urlstringconnection url (use other params if not specified)
protocolstring"http"connection protocol
hoststringconnection host
portstringconnection port

client.newPrivateKey() ⇒ String

Generate new privateKey

Kind: instance method of Client
Returns: String - new privateKey

client.getKeys(id) ⇒ Promise

get keys info by privateKey

Kind: instance method of Client
Returns: Promise - Promise object with object with publicKey, privateKey and other key info

ParamTypeDefault
idnumber1

client.generateKeyPair(id) ⇒ Promise

Generate new key pair

Kind: instance method of Client
Returns: Promise - Promise object with object with publicKey and privateKey

ParamTypeDefault
idnumber1

client.getBalance(address, id) ⇒ Promise

Get address current balance

Kind: instance method of Client
Returns: Promise - Promise object with current balance of given address

ParamTypeDefault
addressstring
idnumber1

client.getUnspents(address,, asset, id) ⇒ Promise

Get address unspents

Kind: instance method of Client
Returns: Promise - Promise object with current unspents

ParamTypeDescription
address,string
assetstring(not required),
idnumber

client.getTxHeight(txId, id) ⇒ Promise

Get transaction height

Kind: instance method of Client
Returns: Promise - txBlock

ParamTypeDefault
txIdstring
idnumber1

client.getTxOut(txId, index, id) ⇒ Promise

Get transaction out

Kind: instance method of Client
Returns: Promise - tx data

ParamTypeDefaultDescription
txIdstring
indexnumber0The index of the transaction output to be obtained in the transaction (starts from 0)
idnumber1

client.getTxInfo(txId, verbose, id) ⇒ Promise

Get transaction info (getrawtransaction)

Kind: instance method of Client
Returns: Promise - tx data

ParamTypeDefaultDescription
txIdstring
verbosenumber1When verbose is 1, detailed information of the corresponding block in Json format string, is returned
idnumber1

client.getTxs(wallet) ⇒ Promise

Get transactions by address (cron_get_transactions)

Kind: instance method of Client
Returns: Promise - txs list

ParamTypeDescription
walletstring/arrayaddress

client.sendTransaction(data, id) ⇒ Promise

Send transaction

Kind: instance method of Client
Returns: Promise - Promise object with hash of new transaction

ParamTypeDefaultDescription
dataobjectObject with privateKey, to, amount, asset(optional), message(optional), fee(optional)
idnumber1

client.getBlockCount() ⇒ Promise

Get blockchain block count

Kind: instance method of Client
Returns: Promise - Promise object with blockCount

client.callRpc(method, id, params) ⇒ Promise

Call RPC API-method

Kind: instance method of Client
Returns: Promise - Promise object with blockCount

ParamType
methodstring
idnumber
paramsobject
0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago