This is the Axis compatible JavaScript API which base on ethereum/web3.js version with v0.20.6 latest maintenance release .It is used by gero client as embed js that
can interract with the Axis blockchain. It alse can be as a reference for dApps to interract with the Axis blockchain.
Differences from web3.js
1. value of unit
The minimum unit of Axis is ta, and one axis is equivalent to 10 to the 9th power ta.
var unitMap = {
'noether':'0',
'ta': '1',
'kta': '1000',
'Kta': '1000',
'babbage': '1000',
'femtoether': '1000',
'mta': '1000000',
'Mta': '1000000',
'lovelace': '1000000',
'picoether': '1000000',
'gta': '1000000000',
'Gta': '1000000000',
'shannon': '1000000000',
'nanoaxis': '1000000000',
'nano': '1000000000',
'szabo': '1000000000000',
'microaxis': '1000000000000',
'micro': '1000000000000',
'finney': '1000000000000000',
'milliaxis': '1000000000000000',
'milli': '1000000000000000',
'axis': '1000000000000000000',
'AXIS': '1000000000000000000',
'kaxis': '1000000000000000000000',
'gaxis': '1000000000000000000000',
'maxis': '1000000000000000000000000',
'gaxis': '1000000000000000000000000000',
};
/**
* Takes a number of Ta and converts it to any other axis unit.
*
*
* @method fromTa
* @param {Number|String} number can be a number, number string or a HEX of a decimal
* @param {String} unit the unit to convert to, default ether
* @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number
The method of SendTransaction Json params add cy、dy、catg,tkt key. The dy only be used when call contract that means whether to regenerate a one-time address. The cy is the currency unit of the transaction, default is axis
,the catg is the Ticket category and the tkt is the Ticket Id.
{
from:axis.accounts[0],
to: axis.accounts[1],
value: 1000,
gas: 30000,
gasPrice: 5,
data: [],
cy: 'axis',
dy: false,
catg: '',
tkt: ''
}
6. transaction info
The showed transaction info add Zero knowledge proof
/**
* Formats the output of a transaction to its proper values