JS API

Installation and use

Download

GitHub:https://github.com/MatrixAINetwork/aiman

Installation through npm

1
npm install aiman

Example

1
2
3
4
5
6
7
8
//Initialization process
var AIMan = require('AIMan');
if (typeof aiman !== 'undefined') {
aiman = new AIMan(aiman.currentProvider);
} else {
// set the provider you want from AIMan.providers
aiman = new AIMan(new AIMan.providers.HttpProvider("http://localhost:8567"));
}

aiman.version.network

Returns the network protocol version.

  • Synchronous mode: aiman.version.network
  • Asynchronous mode: aiman.version.getNetwork(callback(error, result){ … })
Parameter

None

Return Value
  • String - Network protocol version.
Example
1
2
3
//Omit initialization
var version = aiman.version.network;
console.log(version);

aiman.setProvider

Set up Provider.

Parameter

None

Return Value

undefine

Example
1
aiman.setProvider(new aiman.providers.HttpProvider('http://localhost:8545'));

aiman.sha3

Returns hashed results using Keccak-256 SHA3 algorithm.

Parameter
  • String - The inputted string that needs to be hashed using the Keccak-256 SHA3 algorithm.
  • Object - Optional settings. If you want to parse a hexadecimal string in hex format, you need to set the encoding to hex. Because 0x is ignored by default in JS.
Return Value
  • String - The hashed results using Keccak-256 SHA3 algorithm.
Example
1
2
3
4
5
//Omit initialization
var hash = aiman.sha3("Some string to be hashed");
console.log(hash);
var hashOfHash = aiman.sha3(hash, {encoding: 'hex'});
console.log(hashOfHash);

aiman.toHex

Converts any value to HEX.

Parameter
  • String|Number|Object|Array|BigNumber - It needs to be converted to the value of HEX. If it is an object or array type, it will be converted to a string using JSON. If BigNumber is inputted, the corresponding Number’s HEX will be obtained.
Return Value
  • Hexadecimal string.
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Initialize basic objects
var AIMan = require('aiman');
var aiman = new AIMan(new AIMan.providers.HttpProvider("http://localhost:8545"));
var BigNumber = require('bignumber.js'); //version 5.0.0

var str = "abcABC";
var obj = {abc: 'ABC'};
var bignumber = new BigNumber('12345678901234567890');

var hstr = aiman.toHex(str);
var hobj = aiman.toHex(obj);
var hbg = aiman.toHex(bignumber);

console.log("Hex of Sring:" + hstr);
console.log("Hex of Object:" + hobj);
console.log("Hex of BigNumber:" + hbg);

$ node test.js
Hex of Sring:0x616263414243
Hex of Object:0x7b22616263223a22414243227d
Hex of BigNumber:0xab54a98ceb1f0ad2

aiman.toAscii

Converts the HEX string to an ASCII string.

Parameter
  • String - Hexadecimal string.
Return Value
  • String - Given the ASCII code value corresponding to the hexadecimal string.

aiman.fromAscii

Converts any ASCII code string to a HEX string.

Parameter
  • String - ASCII code string.
  • Number - The returned string byte size.It will be filled automatically if it is not long enough.
Return Value
  • String - The converted HEX string.
Example
1
2
3
4
5
var** str = aiman.fromAscii('matrix');
console.log(str); *//*

**var** str2 = aiman.fromAscii('matrix', 32);
console.log(str2); *//*

aiman.toDecimal

Converts a hexadecimal number to a decimal number.

Parameter
  • String - Hexadecimal string.
Return Value
  • Number - The hexadecimal value represented by the inputted string.
Example
1
2
var number = aiman.toDecimal('0x15');
console.log(number); // 21

aiman.fromDecimal

Converts a number, or a number in the form of a string, to a hexadecimal string.

Parameter
  • Number|String - Number
Return Value
  • String - The hexadecimal format of a given number.
1
2
var value = aiman.fromDecimal('21');
console.log(value); // "0x15"

aiman.toBigNumber

Converts a given number or hexadecimal string to BigNumber.

Parameter
  • Number|String - Numbers in digital or hexadecimal format
Return Value
  • BigNumber - Instance of BigNumber.
Example
1
2
3
4
var value = aiman.toBigNumber('200000000000000000000001');
console.log(value); // instanceOf BigNumber
console.log(value.toNumber()); // 2.0000000000000002e+23
console.log(value.toString(10)); // '200000000000000000000001'

aiman.net.listening

If the client is in a listening state, the call returns true.

  • Synchronous mode: aiman.net.listening
  • Asynchronous mode: aiman.net.getListener(callback(error, result){ … })
Parameter

None

Return Value
  • Boolean - When the client is in a listening state, it returns true. Otherwise, it returns false.
Example
1
2
var listening = aiman.net.listening;
console.log("client listening: " + listening);

aiman.net.peerCount

Returns the number of peers connected to the current client.

  • Synchronous mode: aiman.net.peerCount
  • Asynchronous mode: aiman.net.getPeerCount(callback(error, result){ … })
Parameter

None

Return Value
  • Number - the number of connected peers.
Example
1
2
var peerCount = aiman.net.peerCount;
console.log("Peer count: " + peerCount);

aiman.man.defaultBlock

When using the following method, you will use the default block settings, and you can override the default configuration by inputting defaultBlock.

aiman.man.getBalance()

aiman.man.getCode()

aiman.man.getTransactionCount()

aiman.man.getStorageAt()

aiman.man.call()

The optional block parameter may be one of the following values:

  • Number – Block number
  • String – earliest, Genesis block.
  • String – latest, the latest block just mined, the current block leader.

The default value is latest.

Parameter

None

Return Value
  • Number|String - The block number of the status is checked by default.
Example
1
2
3
console.log("defaultBlock: " + aiman.man.defaultBlock);
aiman.man.defaultBlock = 231;
console.log("defaultBlock: " + aiman.man.defaultBlock);

aiman.man.syncing

If it is synchronizing, it returns the synchronization object. Otherwise it returns false.

  • Synchronous mode: aiman.man.syncing
  • Asynchronous mode: aiman.man.getSyncing(callback(error, result){ … })
Parameter

None

Return Value

Object|Boolean - If it is synchronizing, it returns a synchronization object with the following properties.Otherwise it returns false.

  • startingBlock: Number – The block number that started synchronization.
  • currentBlock: Number – The block number that the node is currently synchronizing.
  • highestBlock: Number – The estimated block number of the block to be synchronized to.
Example
1
2
var sync = aiman.man.syncing;
console.log(sync);

aiman.man.mining

If the client is actively mining, the call returns true.

  • Synchronous mode: aiman.man.coinbase
  • Asynchronous mode: aiman.man.getCoinbase(callback(error, result){ … })
Parameter

None

Return Value
  • Boolean - When the client is mining, it returns true, otherwise it returns false.
Example
1
2
var mining = aiman.man.mining;
console.log(mining); // true or false

aiman.man.hashrate

Returns the number of hashes that can be calculated per second when mining.

  • Synchronous mode: aiman.man.hashrate
  • Asynchronous mode: aiman.man.getHashrate(callback(error, result){ … })
Parameter

None

Return Value
  • Number - The number of hashes calculated per second.
Example
1
2
var hashrate = aiman.man.hashrate;
console.log(hashrate);

aiman.man.gasPrice

Returns the current price of gas.

  • Synchronous mode: aiman.man.gasPrice
  • Asynchronous mode: aiman.man.getGasPrice(callback(error, result){ … })
Parameter

None

Return Value
  • BigNumber - the current price of gas, unit: zhu.
Example
1
2
var gasPrice = aiman.man.gasPrice;
console.log(gasPrice.toString(10)); // "10000000000000"

aiman.man.accounts

Returns a list of address strings held by the client.

  • Synchronous mode: aiman.man.accounts
  • Asynchronous mode: aiman.man.getAccounts(callback(error, result){ … })
Parameter

None

Return Value
  • Array - A list of address strings held by the client.
Example
1
2
var accounts = aiman.man.accounts;
console.log(accounts); // [ 'MAN.9HE223J2nC8HYjEBecdB1xGXFETG' ]

aiman.man.blockNumber

Returns the number of the latest block.

  • Synchronous mode: aiman.man.blockNumber
  • Asynchronous mode: aiman.man.getBlockNumber(callback(error, result){ … })
Parameter

None

Return Value

Number - the number of the current block.

Example
1
2
var number = aiman.man.blockNumber;
console.log(number); // 2744

aiman.man.getBalance

Returns the balance of the specified address account.

Parameter
  • String - The address in which the balance needs to be checked.

  • Number|String -(Optional) If you do not set this value, use the block set by aiman.man.defaultBlock, otherwise use the specified block.

  • Funciton - (Optional) Callback function that supports asynchronous execution [async].

Return Value

OBJECT – The corresponding account currency balance object array is structured as
follows:

  • accountType:QUANTITY – Integer, currency number. 0, represents the main currency, MAN

  • balance:QUANTITY – Integer, balance, Unit: zhu

Request:

1
2
var number = aiman.man.blockNumber;
console.log(number); // 2744

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[
{
"accountType": 0,
"balance": "0xaf572216ba03ec528459"
},
{
"accountType": 1,
"balance": "0x0"
},
{
"accountType": 2,
"balance": "0x0"
},
{
"accountType": 3,
"balance": "0x0"
},
{
"accountType": 4,
"balance": "0x0"
}
]

aiman.man.getCode

Returns the code for the specified address.

Parameter
  • String - String, MAN address.
  • String - String, currency name.
  • Number|String -(Optional) If no parameters are inputted, the block defined by aiman.man.defaultBlock is used by default, otherwise the specified block is used.
  • Function - Callback function that supports asynchronous execution [async].
Return Value
  • String - Compiled byte code for a given address contract.
Example
1
2
var code = aiman.man.getCode('MAN.4Pn182LSJ3JNr9by4T5kDKsf127Jb','MAN','latest');
console.log(code); // 0x

aiman.man.getBlock

Returns the block corresponding to the block number or block hash value.

Parameter
  • Number|String – (Optional) If no parameters are inputted, the block defined by aiman.man.defaultBlock is used by default, otherwise the specified block is used.
  • Boolean – (Optional) The default value is false. True returns all transactions contained in the block as objects. Otherwise only returns the hashes of the transactions.
  • Function – Callback function that supports asynchronous execution [async].
Return Value
  • difficulty – BigNumber type. The difficulty of the current block, integer.
  • elect – Array. Election information
  • extraData – String. The extra data field of the current block.
  • gasLimit – Number, the maximum gas allowed in the current block.
  • gasUsed – The total gas used accumulatively in the current block.
  • hash – String, hashes of blocks..
  • leader –String. Leader of this block.
  • miner – String. The miners in this block that are rewarded.
  • mixHash – String. Mixed hash.
  • nettopology – json object. Network topology
  • nonce – String, 8 bytes. Hash generated by POW. When the block is pending, it returns null.
  • Number – Block number. When the block is pending, it returns null.
  • parentHash – String, the hash value of a 32-byte parent block.
  • sha3Uncles – String, 32 bytes. Hash values of uncle blocks.
  • sharding – Array, slice information
  • signatures – Array, signature array.
  • signHash – String, signature hash.
  • size – Number. The byte size of the current block.
  • stateRoot – Array, status information.
  • timestamp – Number. Unix timestamp for block packing.
  • totalDifficulty – BigNumber type. The total difficulty of starting block to the current block, integer.
  • transactions – Array. The object of the transaction. Or a 32-byte transaction hash.
  • uncles – Array. The array of uncle hash.
  • Version – String. Version information
  • VrfValue – String. Vrf information.
Example

Request:

1
2
var info = aiman.man.getBlock(3150);
console.log(info);

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{"VrfValue":"0x038b5d8384b06f4f6006f1e27803ea7d26fc4e2b43dff3ad6839334b784500be9d04fdae385d7a70c70ad8de0d1c35a8e6e974b0c851ebaed2ca7d44896692c4d5936bc8b5d7c3be2ef0376808faef3aa038b8149a54a5ca6dd53d47dc313e7f82b7718080a40ad323b5425664307f153c60845c7c62f6c6c5109983095faaa186823316e88ea050d736b911e680b93a434c90983be6ec2cd826bfd4777de60cab8e",
"difficulty":"690",
"elect":[],
"extraData":"0x",
"gasLimit":1050000000,
"gasUsed":0,
"hash":"0x199adb32a7a08a6f97df00b6c3ca5391a989e38ff6d0d5fd536e2b6b9a7fda4c",
"leader":"MAN.qTQXrAzCg6ZxPY1bEXW2Yfj8zB4d",
"miner":"MAN.4DnD4CZ1LNiHeb9SZNrn6XQfuETPC",
"mixHash":"0xe76f1e217cf57b29e928a8ab2cba8d62e76f1e217cf57b29e928a8ab2cba8d62",
"nettopology":{"Type":1,"NetTopologyData":null},
"nonce":"0x3a765fee9997be02",
"number":3150,
"parentHash":"0x83800c55e124eb51ddb88cc7760572e24a339d098554b033aacd5174e5088e47",
"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"sharding":[{"Root":"0xafaf9148ff954252a9a8aad63849f0e6daffe90b6a1708c23cff861a83e9eb55","Byte256":["0xe6590d918827229832b351eddefdd2ffa922852a72defc10e3eb12817e5a43ea","0x7163165f55280bee02522bb850dd807215447d570485757b6d2c556385ca056d","0xc5de1c1fe88658a98297cd9e0cc9a4fca32980c3eb097bd6b176b051c38ec5bb","0x21f0e0bfe74e06f0f368afc2f2ceb2b5642733c5ff71a702185eca2df63c3f97","0xdfb3d32d05462e4d7ac5e7fa0e4931d8eed705d8ae6a9d8899d936ad3dd9decd","0xe7d0455130d5b93fe2f5a987a5dd88d4a106fc5a0e58fe62f6e8b2cc117138cb","0xa4df5abd03a97ebf85d624bf50413c6361c5c4ab89e3330ddf6722963e6dc065","0x13bb3b2236a0c6c815316617b50fcd9d9163acb751fc5283913eaec04f9ae11e","0x75452404af28ae8eb6ee4d38446bf6a42b1a1165e9e250b46de35261d2864867","0x89deec31e14e282c0a5fc18144b00c79c31cea4754d4e589a7cf34550ca79b11","0x5dcd592532bec8f6382d0e3d305ba4a4b80aef1a311eaa2ebe44475a2af6c765","0x1ff0f9ca7c285ef174fe30c0e4048575687fff699f597f0e20ca3298e38efa5f","0x9fecfb9faedfdd7c46859f242f2c8f9e8d6314372386f478a90135fbf3952cb9","0x0391168fc774cec8df68f0c4e144319be13b3cf38788a2cdc6a828059515a14a","0x3605f2f12a3d2b3c3c92e12a0ba1ddeabdf20d4754b29a047af6ad6fbd49b39a","0x9b0be14f07e284ad130a2ab04422c109d56f763399cba695c63996daeb894f8e","0x70bd6c45c0ed54bfc4f61dee1a25782cfd4ac5a9ae068de54427e7f1e399bbfc","0x971e9cdf52213bb549ce26e80dc94dd4efac812ec0eb786723505f3b471d5d4d","0x699532b14721f9fd71b458b4c52fdbe55c2c848f1333a80274e281ef36dd526d","0x234a1cfe34a17439982aa6d9ec7531948436fbfe8f1415f0c52130e78ef457f1","0xb3fc99671bf1d4167aed47e533cf57e810babbe83de9d9b30d63ad64f587deac","0x9a37434dfcc65fa92aaacf8968e7f11dbe91f68417761d231e83d5fcadb31cc9","0xf763a80df775939c25446e1abbd817f85a72bbc234193dd6de3ddb9300dee39b","0x20dcaeaf049fa153c796f82c392deeaf79bbfb1eb16c7bdec15e6cefab9ea3a5","0x72ac1a4d8db6e6775dc68ac34ac54a6247c672d71c3350cb92ac2fd718f208e5","0xd0c8382fefacb87cfa0bb0e50fae89c090cce0c40502d1148a9c53087d04fb87","0x52719a079d3740b52778497173ca3bebbfeb6009e6af2a7055e816631689c7c0","0x40e8495a046c71f6791975c7ed29bbda697b871ecb6aae3222d776892734b8d1","0xb5c5bb6e73cffc4108b77beb3b417f253c5901c679b97ece6bed6eb88ec2237b","0x0416a2871f6ea7ad8a95d2365ef77c72318fc47084b2714d6245d456978f1a54","0xbe7a609193640832f1cbeb9af1162ff7179b0b3516b5aa79b33f1b71f85f95e6","0xd0cd185766c029a32af30cd825cede93c5fbae14bb065c8ece2bcb2eb70e702b","0x288e21626e217c39884555e6c5b8bffac62d6bb06084efae613bb4970a7f7452","0x3392e641ffc12f7eeee881114a9258654d9b331d8ec8aaffd04241c7e541ccde","0xce0e6f0872e991c1836f1ad299982f15c9881cb74960339c67b01081101df1e0","0x9f73c49264ebba52f8ddf0c172c93ce27f8a7b493cef701287f6fe63ad22550a","0xf7dcc5579e4104225e7231b18646d9c376319d67299ee9aaa432e341a4d26116","0x4d3cf0e7795b7763b40e8232a458b3653d40a13ce91a676444bdc20242fb1ee1","0xc92f0f6d4d1f9644ab367fab98187c3a334a833510dc2b32e85155bd7ef21312","0x756fe107b7ec9ad076c1c5ca6c0bc18060446e56ce5b50bb398c2331b88c6b4d","0x547dd89a5e22b122b3ffcba4b155a7979e8ef4dcb81c8271a86a4a1e640e629e","0x3a2e34b40a053dc5c4559a55f583c995d406ac0d53f50fb39c20f1d847c3adbf","0x1b6448957b61c7ac9d2c0f74b3bfaddc41108fc6545ba4dc90a549b3ba834a76","0x94d341f9d0384ed1898acd2da4a53d10e21e9521ead4b31a5ad8e72fd9f32c7b","0x9539b39dfa6d9e7af40529a20f056e28333beca05ec16b95ae5184ffac96cf2e","0x7a4279d69ef2c58cf0f14325c8e1b929b7117a08f184ecd1a87c17973f8cc7c7","0x9afe12f36ff66e669a1ba8cc5b14fb7070d7fa34036023a9916c0624a15c2931","0xa868ef9c103c004ce52b175385df3621d737f40a3d4931b68a0da8ed26d2bddc","0xa0334b29d8cd5ef96f2c086bdc4fde93705c0f81397e5e6c81169c7ec23f1d8c","0x13123b3734537e98843a49087dc8cb07ef1adda95383da846a33fecfae2e6c92","0xb105262159e3a0a5a5b776d32331f713c7e9abfeb19731d8dc412713c83884e3","0x90b512b0d8aa7737b7cf8b346bbd424b44030b627a6e0799dd4fb2cdcc1879a2","0xa5bf0695bccdbd4c24ad7ca5d716f758a1e450cce380fe6cb6bad44f636b9e77","0xa648f02943fa9ed8afe48779ad82edeb13769eacc332ed99bb0df7adb39a331d","0x1da012faf7f0c94d382971c16b65839b4e7ee58028579a775a146d8322c2daef","0x9e14356f94e6445f4bddde2ba62feb8af547aebc40957cc78a0615eac38c04ab","0xf201ec9dd3d6f80963bfdee0af2e939f380b33919db27d03029b32b12918e397","0x61781aa36cae99cba90265d70a49060df19a139397a182f39001dc91fe0cea45","0x4ba711017308c0c00d9601b47560d21fe9d698bbdfb4dcfe4e41399d579de477","0x351711e48e82840efa0e60197c7679e50116eae728c881c9848da08e76189a03","0x8aada78a5223d38d7a5388c9084c8bdf2d37033e9afa6104ec8061be062afa1e","0x8103a8ab498e48a36aaa4bbac38e5abd56aac8a57cf25b13f942c8c5a3dc5374","0x769d9eb87946d830d00000aa9a5d83b9931416f80fff5ff4925c7d3414c81df6","0x9f1a67bd31f4f87e62cef8491016b718d2c64588da25e1da0ff0d6de461070a2","0x40b2be055265b0117d45869b0902ee23bb9bf6ae59ac0886a41b2b40f7a928c5","0x7fe06c8b32387b553992666a30d00e835b5aa3b8441054cc78734ed0d173a24e","0x5c34557e038bd7b1754dc02605956b546b4a72fe6cebb200d0f2403c42a77880","0xbf29a6a4985f8471b5015dc222475b5d9710c25852746f24deb4507cd0ddffb0","0x1638721471fb466150dd5e32eaa9cdf6dcb62ba4fbf4f844e1385b8b5e02dd3c","0xef238acd785955cd06295bec91f445fa16ad3a4ad695082cc75ba8a94217cb80","0x413ba7fa12dd7b3770e7766b40d233541432838ad17254654e7d99ff214a9dcf","0xb8f3ba91bb941cbdc9e41ae3c14c8ff419633b3e59cfa063e4dd01185a6d9c08","0x62b9373fa92a8049ceaea4b5e3ef218711e30da252e7133d1e44f4da1a626d69","0x0c6116f9d499db8dedb54c906bfb9175094989bedd619f519b18ef1cf966d412","0x14834a646d74c07c89ff67136523b822477ba1172bc503297bd967ec7d8ece24","0xd8c574fd52984134aeb490615ee08905447c219dae53946bf465dcc90546a93e","0x28ee89c2fb1611273459e162fd7663518d46b406eefe41a881f243ec74888b8c","0x721fb8f5b55afb4c8708f77824ae3bf2f12937465396b97a2a80739c2b786366","0x2e39ae5f7776a121fd73ca32a534954332eea5bd55294abd2f6af382fba7eaa9","0xbacc4c0db2ca52c35deb0e14cb6f3a721491f2651915ca1ea225356108eaf115","0x0f8205ffce5451a62394babf1f448e96a8a113fec01549f52a52065e57a9cac6","0x678d574571323db93ff07e87b5e1530bd823446cfe68eb1b095bd4e2048c19d6","0xb47c22e3ebb1c72a293210bea5c3662905f41d40b8f035066738c47c346208de","0x38085f62a6f684ce0ac34d76cbab0b0beb0098cd186fefa898d23ce9ff905f7b","0xdabfd9bf5d6adfe6df389164c5782b9b0baf48efe6ff29e80886e74ce07a40e5","0x4175bca51277ff969e5513d34cf3ea5cb12128fb0ffb42eb74b0ea922e7d6b43","0xff6b6d383f7863f3cfdc9f55772c80bd8c90ca3fe7b757abc943720f7e358a76","0xae3063b849fd8c43a8fe147cd4c4621f211572622f8a94f88510ff276d001baf","0xa6c88bbe6c083324c88f725f58b9ec6ae9720a2943e8ab32d76ec45cc1a6b9e0","0x91d78cc6349e4a00c485b545b6775fbf373a497d03f4fb7c5f630252387f532a","0x02dd65b990c9221ed78f5a9cf40524d72192a83afdd2ba717774b873c557b5f4","0x137c3716409470f5db914c4ba0565dd61a0e0ff32f36620ef9cf02801a32dafe","0xff57c9d79d649a463adfdb1ef7df84d92cef0605c62998060bb5c4adf59ac424","0x3fbb48e0094c823de6c7b4e223981fa7bda805e36f58773e86eef8f86d669c5c","0x04bf865d6eee647795a2bf5aecb34d61cdf153b6271df5cbb4fffa8981cbbdd9","0x6ad3357f88240bac475711f9cff875cbb2cda070b74331ba366cfa629fa8e93d","0x6cdec23a2e1f529a86e756bae00b43d859ded2d76112a1f6855a898f8d8b490b","0x4ff46618a6825eaea9eab5430d57fdf6625fc6278d7df1a4d6a0d19ec7e219bb","0x4242fd03771263ec45b36dc92db602d545c89ecdc5e5b7b66521319cef1a3d1f","0xd3198dfc98f890cb856446b69e2765c33c63258ca608fb066686d3b699929343","0x020923cf821d1e31f6cad317e093ca147b85180379d482bb4445b19b127edb5c","0x52fcd2bd2b4db91cac6a4867920275540cc28de87eefdb8396bba69157db004d","0xb47d1fd69b8645e12d1f8ff6aa1b1537ee5441678f82408e2d6e4a02fed5b2ab","0x0256a37db4d6c325b507ed801ff18d1da0275940e190b31cd8aca1f567bc3f8e","0xaa6baf2af1428ee2ef818768b435cb4572d34907169dd196dabba01020664828","0x08a9fa6c9aecfe5e41238148487236a9578547eb78639bf3db67d1ef10a4066e","0x40e7e542bdd72c8342294713cdebc4a0283ed2f14dc70ae14a5f230acf73c249","0xf8d379f256cd7c3a9c2332cbf0ff5ac631f6cfcb7e675dfac2dae8fc72c5cf22","0x297f0134889eef56a64216b584394d49468343a5834499ba52bd824b04960fae","0x67c1328f094a914bd5f9568d8ea57d99d9af0b8dc1f6450e3cab95ce0628424e","0xbff1a8a2b96c6e8156332bf4c3b57f06aad869a6dca895cb2b14ddd58706649a","0xa5d4c497a6ce8681c9d547bef6451c2016686dded565cde71429a481757e4234","0xf57764735a1ee377ce639674d1a07b0f6cdebf6b0c44c61dca646fc11c5f1f6f","0xbf3be5cf6becd367fbc6313812ee60349f5ff8b60854cf7224289cf07dea768f","0x8b7a74a6eee5ffd21d43fde7cd1d8e5dce0d698bcfb5a64c8cc455651cdbbf66","0x4cff2483bdc053c9c10f257ac6aabc5d47d5875cb132be1b9ebb378029eab988","0xfefcec28b72dfa27152759c5bc9969267b40d88588741d34523b843471e1881d","0x291ad9735c7265151d280025c65ccb411db71513b1e2bf9573ad75ec36b76d0f","0x22a0cec16cb2c7acc95f4f9eba7ab0c4fa999a56828260cf0ac52849b7736a36","0x20120404b96c4d378f8419c78f626d1b8b8b4b12311de3dd559b9fedae3175ff","0x9131cdaa15c62d798e93c52eea9e50a9fe71a396da926891318f843747306b69","0xfe9a9a9db3f84f77c7a21ec3badac9e4834502e7cb680e466dea637925a6a566","0x21c4c2d904141ad3352e221f23fb05d61a521c5082a4dfd6f179ddcc3c591531","0x666188ee8e31db7c5ea44d2b0e01f01ddcc299082d0f593fb7d17e4b300efd28","0x110b0dfee5de3e846afb6e7abd120f6b07c71193705471bdf2afccf2b3ec6e27","0xf4bb37a12f26eef416c1e8c1d7e67d2bc2a0c3da627bdd79fca5d62abad6ea5d","0x5e63854709ac743dbb840bfbe034e040d22235e58a6b74186c715a37a42c2201","0x3bef4403866b7604d50d132e5a7e13ca2b6dcd2df93a4e23d285fe76c9d36347","0x3358308885d63dd54a50336f30ee433f5aa980b31b0a6c5bc8e4cb96df410255","0x55f70387c523df74e9d20a77a67cbde75b6f153ac12ade27383fae797c9a5ac3","0xa7df48178569dde629880bee5e44f1ded1374a89f09e436ba34f2829f8d4caa7","0x1c7a5e557b4af373f8d6c183748200d7fcfd09d7142b4c20a3842fd585fb5707","0xc770b41054624cc864daec7f250ee8fe781ba6e0e2e0d8e9610597439e3e06da","0xf92cb15120b13a95bf4de3c5c8e4b14db7d7eda9b877378212e0cdd57dc4dc90","0x5f77df2a0e5b8cf424f45f9f9978a285c7711e61773aaa3573cfca6bd54f0a41","0x7504b29f0c65ab498a9a1ccad5866b96daa35189513895d5ea06f54f2351c52b","0x06ac11e45ceb7a53aa8dd5104c21aab558e7c64caff3f5d587d8aa04790d9822","0x2e288ed7289094e87ca9d2c4c6c6200499b8eeb0b79638bec71cb9df0af5a489","0xe1d2fbf3bbbe25e9a1202910ee6907326058e5dc9891151a35e2e4e449203d1d","0x7a055ed069ee0ada54155b6c6651ae8a615ad057b5633876f3dd9d0c43d97729","0xc3b54cecd3f14501bf9e8593099fb3859e04f6768f2e54600df55949f22a0037","0x6cb2115b57d9d315d4fe16c385c2745fe33ed8882bff2ef302cca2d716f9908a","0x16258ee59baf5ffc2274cbf0ea137c2c15b5f2aafc69de30dc279985f58c48ce","0xcba12563131731a767d300db3e75a3f6dae8f55d252e5032bc625719efb2436e","0x23e465f11c1050b30385ef99c16346c1cfb430105512c77d914e369523e7b3c4","0x7e7de9683d90899a25d50cee103269c143435bf792caff5a1bbf51a654cafa4e","0x16677d9766a3889603a9f5aaf1e20e7cc8547abae277a8ac32904166df11716d","0xbe64d258666f5295b77fe67a778c844aca02cd4fcebde871ec48666ec35e2753","0xbb29933e3f0cfa4d08ad53eae5701e7a922053f5f7ff9622decfe7dfcc3cbfb9","0xb1fe88e10018afbda76a9cf019db7d5181d54a0aabc759b381409eb058974234","0xfc48952e1266841d9d5a569f51bde55eeb6e180398b5889d573e2267040c7fdf","0x2a48736588da2cc1ed175507f40b6058a307d8a481c92cc93ab8d6700bff1927","0x90e376a96b6a8391fcd2fef254f0baca9bcd6d0670fb733689edb1c83b1d62db","0x6559999cdc81ff7bd75c6b8953c7a18174f03f3b0a92bdcf324f38a34b35a143","0x2df96271ef834a40278ed1a41610cf7ff4946b7783e0e16c5e585c0f2ad583c5","0x95ffd0dbf463c2c5feac86c6f92f9e6655c612fa30bc3c41c63b62cfba2b0f73","0x1b4d8dfde74b8d479c59a24516ec887bf1b62a8bc5a70b7b7d43b312991a0806","0xe01db0fcf41e6e89d4fc056b3b71314f1a10daa28d0433d175620c2c2dca5cd9","0xe7b2faacb699911eeac61056bd18a8efa2453fedace0035bfb0025ab20e40a6f","0x31a1e84826638b6f89583fef0b5ff904e0277bfbe493a594c1b496d6543c6b90","0xf16992183a0bc4695a46e7ca77d59d091582dac4c9e04cca361886dc2fb8e276","0x9cfbf475cc1da24b8bb37a8db378efbd6e8b08191388c1fc0ae5c806a142eaed","0xadb2378580665af002b263d304e7300e776c3e90f6b82bfa4dfc2101911def68","0x3790e1d138725c247b0295ae4321b6be0a241e82bc70884fd1baaab1825df513","0x5df8dcab4b83d585fc87b240840cd455319a8173fb3a72715da0609fb2e8a030","0xfbbece8ddec2aa0e23972775b47b560c2b7f9cd793198daed2818f1a219de44c","0x206cf5c26897225a482017d4538919ee068bdeab6373759a65f087b479691174","0x027010b9a36ad57664a5fd91b5bd7719622dedba1916f2365ff56b1d79b2762a","0xf49573c17a156fb10d5713ac19d05622a4d4087c2a2725c49c9715cb31cd6070","0x18e618d99eb1e5d2ec654f728925cd5e1db7393c274f45885826e1feaf4987b6","0x7ddedcb75a608a5839b8903b49ba0c658a6da9a0bff98b34d540fbe5b41ce62f","0x92072e87df3c6f2f0ad57b023678353dfe209eaf8b8d4369cdec5f033df2dda3","0x9a3f62f63c7e870b63bc80b8ef49334bafdac68270546ccfdd2ebcf1ff0c8e44","0x87598abd8196418d8ab34f73c49e78a2929bb974f7858858348c276101afc7a2","0x78a04c6b2dddda8424a466e7aeb4898798e111686cae3c23017391d84407d140","0x1d8b61f91164ce93eae82f12d89d2530785845ebb3093de6ead31d148b6b1fb8","0xb01932d0603d0065e5d23a1737f6b28bf985d89e32d4be5b5f54c688e4346e8c","0xdcbbe27b67e33190b637ace4f33d1738451d0653a5ae4dab2cce7cf7ed4e42ae","0x7377f3ff5f30daa3d8a1aa4a1009f9749a769fa7eedfd5728845310221ffed62","0x2798517065c1e3b3d3857e990fddc0407412bb2c92cbda1b2575faa6792e5042","0x645e852af5d450f1b215f95cb06153640e32ce94811e553465eb0d004b869c08","0xb87687d539d4c1911375b4f4127e4fd7d2cf4827431b4e0c481298d4157c82cd","0xcae9920f196fb11f5625a8dd6ea9449c3882d833f269a4781f1b6c7201464d39","0x161bf9474bc762aa131b9449bc556341f635d2bafd685d3d82d28383759397d9","0xcec323cbd363c288259ace37d22b9c9361cdc535a8a7735e70f69670ab191e21","0x9fde3d2c1f4f53a58f7098f590badf9be377ce6ac60d94ccc4641a90a88eb7ad","0xb278c66a18f16e8a16987608e8c5e4f06f2612bb6e22f290f67a614f96f6512a","0x990aa6ab928bad88fddd243ff5fef79bb2d07f3472515aeebb9eaadfee79c54b","0xe6b6cdc7bdde0798bb76c590e480c19b434b988b657d6b34e7a233ca42ff0197","0x122dcb8ef90f4ce69e3e9a453ee4ec975f22ef41fe53163595d1e1610e79e075","0xa7c6819f9ab6b144b762273941c47beaac208b433fcff4f8f31d84ef558cb061","0xd64e213b13ad576e6ac19ccd7de2b511f398477d9fe3443f7cf2a29005de06bc","0x43c9cbf5a38b11f7f54f8f7c4cdae2857372a8700192b038b36dbf139d075ff3","0x0f4f7492ca85edc4b9cbb51b3bb2a4ff813dbc61f16bf3f72f4bad39392d23a6","0x6932384e0ce5e88fff48e97d1d388b55100d1c932817b421ee8fd904fe22df47","0x5743b18392ff55c3b4116cdc2d94f16979ba0728e6f94e1cc3506edf8176c7f3","0x0bb9ac5e5c6ab4badce637c08775d01b139c5d185e71184d6b3e919960522212","0x359d87f6216074504e6efb22d96b932417aabe85063146d840d4f98fe875f97c","0x55cd314f9b6e179164ed3363d845c6a57a6f9f266dc9f93f78a20a5302985811","0xfaee4bbb7391caaf9bc68e4c2d0a4b401b78b0a0c4f2d79c8420bf6fce006dee","0xf7caae8fa5f18012aa9251bd2713a1b96524ab35ddded12c1486b0d37049b202","0x1b331782c4f6e9bd5df7c63e46ffae72d80e1798559ee9c9e49855c39a0ea096","0x7340fc29d0b716fea37015088a5608da394553eca1a12d33bb63ddb3304497dc","0x6bb5b4e55025a5e106b492112828688e7e8b2a2ad4e1ea72918da75e88271582","0x86c8c1bb9d684b5885ac1ee734b0aa8faed2229eb12ad382993a031eab607747","0x620c755cc27d355105ed7d66014a125999cea6db4afe072549438001ecd4757c","0x8ba7e585ff17c458cbf6a40db234f3b5859fa529a6b5f6609b32ca8206256fe7","0xac5d6dcc299a5713cb741e50bac4073efe5fc8303b901194300df46f35edcc60","0x16007207f7ccede26f9b9523e5dbcbafae53ce1bccfe1449e9b9cac7906ba850","0x98093f2773810eb201586bd6e0b112cff53d74707cc61ffa250dcff6baedc198","0xfd8baa0b48768ed0280db6497bf8017b03f6a0f6584469fb4fb764b616d2ddc5","0x8784f0b933ba5178be11298b1b75ff604288542605cf65c7840606ac526b1517","0xd00f3d92b364de15728e90ee271df3713affbc3dc70be0d2d3f46a81ffa46da9","0x71f2294972442308afd85b00411428013e1f827b845bead91caffd383e212e79","0x24e595289faee4a1809ffb9bc8d782ed0b414144ea618fbef8775231ddec07ad","0xa1cd74cf63003cb527551b6566c1bba5a072a46b0bb5db3ee1dfa8cc08bab9dd","0xd24c91e40d83b034b6d401c898a01fcf06c9d6514a7efc77b3d8ac3a7f12648f","0x1fe3380ca9600854fa0c09cd468c782343930bd17b8388f3cbfd7c9761b568c4","0x3f8b5a828cecdf4127ccaf44332919843a825f9e6d01662e0a0bb4d76719390f","0x3ff37816f7fbeaeafe34a7c3721185371646660869d272bc7eb69da7f6673fd0","0xbc11e08c0d4ee9a349d53a504abbebd965c0f4d0e4e9ba7eced6f0a264a6932c","0x194b843e93eff7fb6bbccb727c77cc097633f9bfa84f2ad217fceb638367e7fd","0x07795ec819e52a82b9a262f1d95c4dc6c337db7d94f7aaa7a7992da901347467","0x1ff792174ab21acbfeec63d0a4b2efb90cab7187fb0a6df502ec868131b09038","0xf06584200d16fdc2a275aa7835d57ccc7ea8dcad877e09a36db125f4a0b94a4b","0xa72112a00effb680fa719f70b3304f877e04801974d270e3c074f8102dbe606e","0xca8821bf566a12a556a35476f21a5a4a7c706a0038f46365cbf644efb0dee8f8","0x3ddb95460f645f90203f85f338d760963e0ee04c4efb2f9dd72d25c73b27f705","0xabbfe4f928b4846bb37d0e84ae1796f1f736d8d317ed7c91f94ec7dcadc59dce","0xb4e55742b56f2d51261fb803729a2a679fce12fb3ecbaf8b2500b0af32cf14ad","0xa966be7f0db63633decd03d9e517f589fed37401656554ed7e0a00a21c5aeda9","0x643e12c631f2404ef63802109d1d8593d4d25699e2fc385a08322f873680a2ff","0x3c935be7fe5d8ffe4a47a0ff58985c080c39156900e119981ef833d6519afed1","0xbdbb6c4bc339a45efdb79e4cb3172fd4e47d47e47236b7ab636786b3c6e4d82c","0x55ba55d3fa40491e03b70d03aa4c5139c210726130783672f2c7b55f4ec5500b","0x3e0eff0faeaccf64d6b306ff073e5472947ce045ac97c2f547730a6f56fcdc4c","0xaa41263a0957d92c3fbc9a0e6d260c14a3e65c0c1a37ddb044dc6d00481a307c","0x8cdb7c42597116494b402e7badfe0e9440588c1b6c997a66d3ccfe4d12bab6ed","0x418ae305af89e63feaf0e1a16b33016729855f2214044d1a293a6fb7eff8d22b","0x690027f8ab5fbd4b770d4215bee4fd0b3b27a0143af1d9ec5f11859e7b72ab8f","0x2554e968489ed202ee17f266e518947acd02647fed1017baec68e285ea794ce8","0xce18a019b280c741c9969fc127dddd32c2be450daa3f96dfd15e8443e51206e0","0x7e19d69551f6e4a0bd747386a3256c715e9c0fe42b50734b0f67864e4a4b1574","0x73c51fca8f96dfd5640c3ae1fa9e8a195d94d5d58bb5b88b63aa7caa7fdac09f","0x4ee60e6af2c56f4e9f2e2ec4c1cb933b60269fee57f26fe6437b279c944ffdbc","0xca81ab22c32c996588cb0fa6dcdb8867d3e38becc629e7714a07f1d16a123da6","0xa5b08976e4c7c07ec3eb96003e7559d4d9c569736f5e3a5059a7768c778a845b","0xca29176c624becd00e3568390a89cf079f21088248f7d0a3db7855fb383cb52c","0xd4455c24de8ae99406e93d697b2c6a91cf0c8499b364c55e3101a857b123ef99","0x83dd11f3983cd5580689f0c785b71b7743c7f79e8717fc6ccfeb3217c88379da","0xbcbdbd3fe90375cc470e61ff14a2c872c8a1ba586bc9e4fe0120b5878e884caa","0xe59c7749d113c120e8c85cb857a684308013fe581dac6db3c73f76af9fee9003","0x34fa84718e245f11efc2f5fa059741886cf789adbe9aaa7f578bf049f890bd5e","0xc30e67a73ff4aec5a2f8ca4d76302009f551108ef5602d064f486be499bd4cef","0x5d9613b6e0ee24b4413fb2ec986859f57ba3272dfc4cf7d6939d4ec2e925c636","0x3d9af48134b80914da76d7a225d6f31c5b4215b3dd6d46621c828b17a46cac38"]}],
"signHash":"0x759f9e22b215519de1085404835f17f5d828633fc7e811040e17e48c99b74e2d",
"signatures":["0x7027759d43fd87a25383c4dc7c255eafaba8b9797ea91c215795a71301999b9f7cf0ec7793a156014ec7423009ad12a87fcdd3fa0c8170bd1678a92a4e27cd6e01","0xd994d982501b04469dc71442b623063a8af943c1fde289503396910eca5af042087f2229f89e9e331fff76b55fcf92ed34ede513199824496db752f18dfb236901","0x771b31760dbee7ff15f6443ddb9b8df95cd277b09da097ac0a34a5e1e6f5a2f322a7bdf72781e55fcf35e456aa7de6d55bbc463f7c7fdcf1022aa463d8682dbe01","0xd03cdd43823d7f210ee12d5804326956cdc70afb8ef0732e262c2aab164e93562f4ae7a8e517d119cb2d3e388de4178f1a22d6601acc72efec538f34c3658ad901","0xe47652bf5fff54158cf0ab32498375980189de184b1580393b6c2b9db8a775d84d63d027ff8aae0da6fb75dcd0dee442cea886a93d3cb0c0d557b1e928ccd03901","0x87d094568f51c56c40ba1b45131af0b72d27cde3922e0cf209aa258b07611a860b89ddd44a587ada7ce39a456bfb81cd9a2ed69ae3ac6dd4f82c6a852cc824fa00","0xe216381b5cce085a8922a930ebcf741111bb19d4adbf06eece9084d9ca78c6fb4a590077cb335c4a82bc41da74c69e31edb82e61ba80957e31f609b3c4fefab100"],
"size":10420,
"stateRoot":[{"Cointyp":"MAN","Root":"0xafaf9148ff954252a9a8aad63849f0e6daffe90b6a1708c23cff861a83e9eb55","TxHash":"0x91043e03d3576dd34f536c31d649d1149b43220d04757e9341d03d108b7b1393","ReceiptHash":"0x34da222b8545ec839225d66f32c6b29eee304c1e417bfe8bb9e0fcbc834fe148","Bloom":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],
"timestamp":1562260538,
"totalDifficulty":"2862609",
"transactions":{"MAN":["0x459b9c910d46527befe5ccfe41a21b30ea9056a118e1ee86662b189ad9601556","0x6a0f6e9984a33a084e1cc3cfafed527b82962aef4ab590500febfd6de6107088"]},
"uncles":[],
"version":"0x312e302e302e33"}

aiman.man.getBlockTransactionCount

Returns the number of transactions within the specified block.

Parameter
  • Number|String - block number.
  • Function - Callback function that supports asynchronous execution [async].
Return Value
  • Nubmer - Number of transactions within a specified block.
Example
1
2
var number = aiman.man.getBlockTransactionCount(122);
console.log(number); //

aiman.man.getTransaction

Returns a transaction with the specified hash value.

  • aiman.man.getTransaction(transactionHash [, callback])
Parameter
  • String - transaction hash value.
  • Function - Callback function that supports asynchronous execution [async].
Return Value

Object - A transaction object.

  • hash: String - 32 bytes – transaction hash.
  • nonce: Number - Number of transactions that occurred prior to this transaction by the sender.
  • blockHash: String - 32 bytes – Hash value of blocks containing transactions. Pending blocks return null
  • blockNumber: Number - Block number of blocks containing transactions. Pending blocks return null
  • transactionIndex: Number - Transaction Index. Pending blocks return null
  • from: String - 20 bytes,Transaction sender address
  • to: String - 20 bytes,Transaction receiver address
  • value: BigNumber - he quantity of MAN sent, unit: zhu
  • gasPrice: BigNumber - the price of gas paid by the sender, unit: zhu
  • gas: Number - the amount of gas available to the sender
  • input: String - data sent alongside the transaction
  • IsEntrustTx
    • 0: self-paid gas
    • 1: gas paid by others
  • CommitTime – submit time.
  • matrixType – transaction types (normal transactions are set as 0)
  • extra_to – extended transaction (should be filled for one to many transactions)
  • TxEnterType – transaction pool types (normal transactions are set as 0)
  • v – String,ECDSA recovery id
  • r – String,ECDSA signature r
  • s – String,ECDSA signature s
Example

Request:

1
2
var transaction = aiman.man.getTransaction('0x8838fd149ea46f4c182f2de9b465b731d6cb67794233602dddb5362474122841');
console.log(transaction);

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{"blockHash":"0x1d7d46eeee21cfb1028bc85d254e0cd432d3cc128624fc219340e0ee93db8f65",
"blockNumber":216803,
"from":"MAN.2nRsUetjWAaYUizRkgBxGETimfUTz",
"gas":0,
"gasPrice":"0",
"hash":"0x9ad5310bf83afcbd2f3fb2b7da43f03cc1b9ae45af15d706541c7d17bbaa333e",
"input":"0x",
"nonce":4503599627799762,
"to":"MAN.5xYzBHrJfXeJi9yQ8Qq8hvm19bU4",
"transactionIndex":0,
"value":"600000000000000000",
"v":"0x0",
"r":"0x0",
"s":"0x0",、"TxEnterType":0,
"IsEntrustTx":false,
"Currency":"MAN",
"CommitTime":"0x0",
"matrixType":2,
"extra_to":[{"to":"MAN.YaMnyEHkBFsx9mMKweDFv6qc6PCc","value":"0x853a0d2313c0000","input":"0x"},{"to":"MAN.2J6nGbdsqu8XSMfWWDKbYDSBmYFSF","value":"0x6a94d74f4300000","input":"0x"},{"to":"MAN.2M2AG1FspqrbBfWNuA3Hzd6DJsFdr","value":"0x853a0d2313c0000","input":"0x"},{"to":"MAN.2WeBpo7BxfUxVmryJrqLSAKwxMW2U","value":"0x22f8d6a601fc0000","input":"0x"}]}

aiman.man.getTransactionFromBlock

Returns the transaction with the specified index number in the specified block.

  • getTransactionFromBlock(hashStringOrNumber,indexNumber,Currency,[, callback])
Parameter
  • String – Block number or hash. Or earliest, latest string. Input aiman. man. defaultBlock to view optional values.
  • Number – The serial number of the transaction.
  • Currency – Currency name.
  • Function – Callback function that supports asynchronous execution [async].
Return Value
  • Object - Transaction object. For details, see aiman.man.getTransaction.
Example
1
2
var transaction = aiman.man.getTransactionFromBlock('0x4534534534', 2);
console.log(transaction); // see aiman.man.getTransaction

aiman.man.getTransactionReceipt

Returns the receipt for the specified transaction. The transactions are specified by hash.

  • aiman.man.getTransactionReceipt(hashString[, callback])

Note: For pending transactions, receipts are not available.

Parameter
  • String - Transaction hash
  • Function - Callback function that supports asynchronous execution [async].
Return Value

Object - The transaction’s receipt object, if not found, it returns null

  • blockHash: String - 32 bytes , hash of transaction blocks
  • blockNumber: Number - transaction block number
  • transactionHash: String - 32 bytes ,transaction hash
  • transactionIndex: Number - transaction Index
  • from: String- the address of transaction sender
  • to: String - the address of transaction recipient.If it is a transaction created by a contract, returns null.
  • cumulativeGasUsed: Number - Total gas consumption of blocks in the transaction process
  • gasUsed: Number:The amount of gas consumed in transactions
  • contractAddress:String - In a new contract creation transaction, this value is the newly created contract address. Otherwise, it returns null.
  • logs: Array - An array of log objects generated by this transaction
Example

Request:

1
2
var receipt = aiman.man.getTransactionReceipt('0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b');
console.log(receipt);

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
{
"transactionHash": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b",
"transactionIndex": 0,
"blockHash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46",
"blockNumber": 3,
"contractAddress": "MAN.38nGzwi5Xn5ApxHXquT8ALaMLpbyG",
"cumulativeGasUsed": 314159,
"gasUsed": 30234,
"logs": [{
// logs as returned by getFilterLogs, etc.
}, ...]
}

aiman.man.getTransactionCount

Return to the number of transactions sent from a specified address.

  • aiman.man.getTransactionCount(addressString [, defaultBlock] [, callback])
Parameter
  • String – Address
  • Number|String – (Optional) If no parameters are inputted, the block defined by aiman.man.defaultBlock is used by default, otherwise the specified block is used.
  • Function – Callback function that supports asynchronous execution [async].
Return Value
  • Number - Number of transactions sent from a specified address.The starting number is 0x10000000000000.
Example
1
2
var number = aiman.man.getTransactionCount("MAN.38nGzwi5Xn5ApxHXquT8ALaMLpbyG");
console.log(number); //

aiman.man.sendTransaction

Launches a transaction.

  • aiman.man.sendTransaction(transactionObject [, callback])
Parameter

Object - The object of the transaction. The structure is as follows:

  • from: String - Specified the sender’s address. If not specified, use aiman.man.defaultAccount.
  • to: String - The target address of the transaction. If created by a contract, it is null
  • value: Number|String|BigNumber - Number of currencies carried in a transaction, in zhu. If the transaction is created through a contract, it is the initial capital.
  • gas: Number|String|BigNumber - The amount of gas used in transactions; unused gases will be returned.
  • gasPrice: Number|String|BigNumber - Gas fees for transactions.
  • data: String - (optional) a byte string containing relevant data. If created through a contract, it’s code for initialization
  • nonce: Number - Integer, using this value you can use the same nonce to cover your own pending transactions
  • Function - Callback function that supports asynchronous execution [async].
  • Currency – Type of currency
Return Value
  • String - 32-byte transaction hash string. Denoted in hexadecimal.

When creating a contract, you can use aiman.man.getTransactionReceipt() to get the contract address.

Example
1
2
3
4
5
6
7
// compiled solidity source code using https://chrisman.github.io/cpp-manereum/
var code = "603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b6007600435028060005260206000f3";

aiman.man.sendTransaction({data: code}, function(err, address) {
if (!err)
console.log(address); // "MAN.38nGzwi5Xn5ApxHXquT8ALaMLpbyG"
});

aiman.man.sendRawTransaction

Initiates a transaction or contract to sign a transaction.

  • aiman.man.sendRawTransaction(signedTransactionJSONObject [, callback])
Parameter
  • Object - The transaction object to be sent:
    • to: String - The target address of the transaction. If created by a contract, it is null
    • value: Number|String|BigNumber - Number of currencies carried in a transaction, in zhu. If the transaction is created through a contract, it is the initial capital.
    • gas: Number|String|BigNumber - The amount of gas used in transactions; unused gases will be returned.
      • gasPrice: Number|String|BigNumber - Gas fees for transactions
    • data: String - (optional) a byte string containing relevant data. If created through a contract, it is the code used for initialization.
    • nonce: Number -Integer, using this value you can use the same nonce to cover your own pending transactions.
    • V: Signature results
    • R: Signature results
    • S: Signature results
    • txEnterType Type of transaction pool (normal transaction set to 0)
    • Currency: The type of currency
    • TxType:transaction type (normal transaction set to 0)
    • LockHeight:Reserved fields
    • IsEntrustTx
      • 0: self-paid gas
      • 1: gas paid by others
    • CommitTime:Submission time, available only for schduled and revocable transactions
    • ExtraTo: Extended transactions (1 to more transactions should be filled in)
  • Function - Callback function that supports asynchronous execution [async].
Return Value
  • String - 32 Bytes, transaction hash. If transaction is invalid, null is returned.

When creating a contract, you can use aiman.man.getTransactionReceipt() to get the contract address.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var rawtx= {
"to":"MAN.3amuUsMTakirpLt7uvS5pzsQp3ZPo",
"value":"0x69e679aec4a433900000",
"gasPrice":"0x430e23400",
"gas":"0x5208",
"data":"0x",
"nonce":"0x10000000000000",
"TxEnterType":0,
"IsEntrustTx":0,
"CommitTime":1547539401231,
"extra_to":[],
"chainId":23,
"v":"0x52",
"r":"0x8fcb04c556e6412fd4273cea0ff26405dd56dfa604f354e8d7196d7e94cc4290",
"s":"0x1c6f2d8df3efb5228ebb180934df7a608f5d1a286c84fca4df1d2736ec06fff4",
"lockHeight":0,
"currency":"MAN",
"txType":0
}
aiman.man.sendRawTransaction(rawtx, function(err, hash) {
if (!err)
console.log(hash); // "0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385"
});

aiman.man.call()

A new message call is executed immediately without creating a transaction on the blockchain.

Parameter
  • Object – The transaction object to be sent:
    • from: STRING – The original address that send the transaction, optional
    • to: STRING – Transaction target address
    • Currency: STRING – Transaction currency name
    • gas: QUANTITY – The amount of gas available for transaction, optional. aiman.man.call does not consume gas, but some implementations require this parameter
    • gasPrice: QUANTITY – Gas price, optional
    • value: QUANTITY – The number of MAN tokens sent by the transaction, optional
    • data: DATA – Method signature and hash of encoding parameters, optional
  • QUANTITY|TAG – Integer block number, or the “latest”, “earliest” string
Return Value
  • DATA - Return Value of the executed contract.
Example
1
2
3
var obj = {"to": "MAN.468kLTuAEjm53ro2pPErnAAHqbccK","data": "0x58975919","currency": "MAN"};
var result = aiman.man.call(obj,"latest");
console.log(result)

aiman.man.sign

Signed by the specified account. The data needs to be sent while the account needs to be in the unlocked state.

  • aiman.man.sign(address, dataToSign, [, callback])
Parameter
  • String - MAN Address
  • String - Message to Sign
  • Function -(Optional)Callback function that supports asynchronous execution [async].
Return Value

String – Signed data.
The returned value corresponds to a string signed by ECDSA (Elliptic Curve Digital Signature Algorithm) 12.
r = signature[0:64]
s = signature[64:128]
v = signature[128:130]
Note that if you use ecrecover, the v value here is 00 or 01, so if you want to use them, you need to convert the v value here to an integer, plus 27. The final value you will use will be 27 or 2813.

Example
1
2
3
var result = aiman.man.sign("0x135a7de83802408321b74c322f8558db1679ac20",
"0x9dd2c369a187b4e6b9c402f030e50743e619301ea62aa4c0737d4ef7e10a3d49"); // second argument is aiman.sha3("xyz")
console.log(result); // "0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"

aiman.man.estimateGas

Executes and estimates the amount of gas required for a transaction. The transaction will not be written to the blockchain. Note that, for reasons such as the EVM mechanism and node performance, the estimated values may be much larger than during actual usage.

  • aiman.man.estimateGas(callObject [, callback])
Parameter

Refer to aiman.man.sendTransaction, all properties are optional.

Return Value
  • Number - Gas consumed by simulated call/transaction.
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var r = aiman.man.estimateGas({currency:"MAN"});
console.log(r);
aiman.man.estimateGas({ from: "MAN.3Hr2UCai2qz5FftusnJpn6dvrQGua",
to: "MAN.3Hr2UCai2qz5FftusnJpn6dvrQGua",
gas: "0x76c0a",
gasPrice: "0x9184e72a000",
value: "0xe",
nonce:"0x1000000000000f",
extraTo: [],
data: "0x",
currency:"MAN"
}
,function (err,res){
if (!err) {
console.log(res);
} else {
console.log(err);
}
});

aiman.man.getDepositByAddr

Returns the stake information of the specified account.

  • aiman.man.getDepositByAddr(“MAN.4DnD4CZ1LNiHeb9SZNrn6XQfuETPC”,”latest”)
Parameter
  • String – String, MAN address.
  • QUANTITY|TAG - Integer block number, “latest”、”earliest” string .
Return Value

OBJECT – Stake account information, the information structure is as follows:

  • AddressA0:STRING-The address of stake.
  • AddressA1: STRING- The address of signature.
  • OnlineTime: QUANTITY-Integer, online time, counted by block height.
  • Role:QUANTITY-Election identity, 128: Verifiers; 16: Miners.
  • PositionNonce: QUANTITY-Integer, position nonce value.
  • Dpstmsg:OBJECT-stake position information list, stake warehouse information structure is as follows:
    • DepositType:QUANTITY-Integer,//0-flexible,1-fixed1month,3-fixed3months,6-fixed6months.
    • DepositAmount:QUANTITY-Integer, stake amount in zhu.
    • Interest:QUANTITY-Integer,interest value in zhu.
    • Slash:QUANTITY-Integer, punish value in zhu.
    • BeginTime: QUANTITY-Integer, UTC time, the start time of stake; The start time of flexible stake is 0 .
    • EndTime: QUANTITY-Integer, UTC time, represents the unstake time for fixed stakes, or the earliest withdrawal time for flexible stakes.
    • Position: QUANTITY-Integer, the number of warehouse.
  • WithDrawInfo:OBJECT-Refund object array, the information structure of refund object is as follows:
    • WithDrawAmount:QUANTITY-Integer, refund amount in zhu
    • WithDrawTime:QUANTITY-Integer, UTC time, refund time
Example

Request:

1
var result = aiman.man.getDepositByAddr("MAN.4DnD4CZ1LNiHeb9SZNrn6XQfuETPC","latest")

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"AddressA0": "MAN.4Pn182LSJ3JNr9by4T5kDKsf127Jb",
"AddressA1": "MAN.Tfr4DZYNeWqqTth87phrg2KZcqya",
"OnlineTime": "0x81923",
"Role": "0x80",
"PositionNonce": 0,
"Dpstmsg": [
{
"DepositType": 0,
"DepositAmount": "0x8631d81fc94c92f9b336d",
"Interest": "0x2bf9f54df6717b96ef",
"Slash": "0x0",
"BeginTime": 0,
"EndTime": 0,
"Position": 0,
"WithDrawInfolist": []
}
]
}

aiman.man.getDeposit()

Returns the stake information of the specified block. The block is specified by height.

Parameter
  • QUANTITY|TAG - Integer block number, or the “latest”, “earliest” string .
Return Value
  • OBJECT – The information of stake account is structured as follows:
    • Address: STRING – The address of stake.
    • SignAddress: STRING – The address of signature.
    • Deposit: QUANTITY – Stake amount.
    • Withdraw: QUANTITY – Election state, 0, in the election; non-0, withdrawal height.
    • OnlineTime: QUANTITY – Integer, online time, counted by block height.
    • Role: QUANTITY – Election identity, 128: Verifiers; 16: Miners.
Example

Request:

1
var var result = aiman.man. getDeposit("latest"));

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[
{
"Address": "MAN.4M29vNSn7jG1dwLs7bxG2RHYLikWG",
"SignAddress": "MAN.3EX7HepVHi85wAh6duzGotYGbpBQR",
"Deposit": 1e+25,
"WithdrawH": 0,
"OnlineTime": 0,
"Role": 128
},
{
"Address": "MAN.439xNJTQrmmYEkm2wm5ThU79UsMiu",
"SignAddress": "MAN.4URp9YU7ufxNf1i1EbUs1PGhYwFzJ",
"Deposit": 1e+25,
"WithdrawH": 0,
"OnlineTime": 0,
"Role": 128
},
{
"Address": "MAN.2LrYy4EbhAi7Az4HdzKHbbyraMPBj",
"SignAddress": "MAN.4PMxVeKv9JZpBxK8oWcMDmcTUZtn9",
"Deposit": 1e+22,
"WithdrawH": 0,
"OnlineTime": 0,
"Role": 16
}
]

aiman.man.getMatrixCoin

Returns the multi-currency information.

Parameter
  • QUANTITY|TAG - Integer block number, or the “latest”, “earliest” string
Return Value
  • OBJECT – STRING array, the names of multi-currency.
Example

Request:

1
var result = aiman.man.getMatrixCoin('latest');

Respons:

1
2
3
4
5
6
7
8
9
[
"MBN",
"MCN",
"MDN",
"MEN",
"MIN",
"MSN",
"MUSD"
]

aiman.man.getMatrixCoinConfig

Returns the configuration information for multi-currency.

Parameter
  • STRING – The name of currency.
  • QUANTITY|TAG - Integer block number, or the “latest”, “earliest” string
Return Value
  • OBJECT – Currency configuration information. The structure is as follows:
    • CoinRange: STRING. The range of the coin.
    • CoinType: STRING. The name of the coin.
    • PackNum: QUANTITY. Integer, the maximum number of transactions per block.
    • CoinUnit: QUANTITY. Integer, coin unit.
    • CoinTotal: QUANTITY. Integer, coin total circulation.
    • CoinAddress: DATA, 20 bytes. Coin transaction fee account address.
Example

Request:

1
var result = aiman.man.getMatrixCoinConfig("MBN","latest")

Respons:

1
2
3
4
5
6
7
8
9
10
[	
{
"CoinRange": "MEN",
"CoinType": "MEN",
"PackNum": 9999,
"CoinUnit": "0xde0b6b3a7640000",
"CoinTotal": "0x33b2e3c9fd0803ce8000000",
"CoinAddress": "0x8000000000000000000000000000000000000001"
}
]

aiman.man.getDestroyBalance

Returns the number of MANs consumed to create multiple currencies.

Parameter

None

Return Value
  • QUANTITY - Integer, the number of MANs consumed to create multiple currencies in zhu.
Example

Request:

1
var result = aiman.man.getDestroyBalance()

Respons:

1
"0x152d02c7e14af6800000" // 100000000000000000000000

aiman.man.getSignAccounts

Returns a list of block signatures for the specified block. The block is specified by block hash/height.

Parameter

block hash/height

Return Value
  • Object Array – The array of signature object. The signature structure is as follows:
    • Sign: DATA, 65 bytes – signature
    • Account:STRING, – signature account
    • Validate:BOOL, – signature state。TRUE:signed;FALSE:unsigned
    • Stock: QUANTITY, stock right. Invalid for now.
Example

Request:

1
2
var result = aiman.man.getSignAccounts(911);
var result1 = aiman.man.getSignAccounts("0x4bb2bb1ffc4e4f44b862c058fbafc948dd6942857368c76af34cb0fde777228e"));

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[
{
"sign": "0xf3fd53b57786bee28aa27e8439251e8c1c5233db964b8b69528ebc46861e79090f4ae49e617707c11e121e24ef099160262bcdf2347033d399d003ef7f6d69e100",
"account": "MAN.3pTAH8pGwmJ94Zm1B1sNMcm4q1kVr",
"validate": true,
"stock": 0
},
{
"sign": "0xcd577141ac1a9173316f20df9a39318a107169c5d93659a04b749cddb606e9f16e70b37cad5230c4e4a0e2c071f5d6b701dadf005211539b92309a9fc75e6c4501",
"account": "MAN.4Pn182LSJ3JNr9by4T5kDKsf127Jb",
"validate": true,
"stock": 0
},
{
"sign": "0xdc61de03cae70a4e010c695c123142e51aa9beff7b29be25c09cf784130558c634044c5d86f9c19898255d95494283a19ac77bb7ab59c96159537b6fa94a858f01",
"account": "MAN.23983gYFh8YH1ovpzKa3wpcNaRVn7",
"validate": true,
"stock": 0
}
]

aiman.man.getValidatorGroupInfo

Returns the joint mining information of the specified block. Block is specified by block height.

Parameter
  • QUANTITY|TAG - Integer block number, or the “latest”, “earliest” string .
Return Value

OBJECT – Joint Mining Information MAP. MAP: subcontract address as key value; STRING; slice with contract storage information as value, OBJECT.

The contract storage information structure is as follows:

  • OwnerInfo.OBJECT, contract creation information is structured as follows:
    • Owner: String – Owner account address
    • SignAddress: String – Signature account address
    • WithdrawAllTime: QUANTITY – All revocation time
  • Reward.OBJECT, return allocation information is structured as follows:
    • LevelRate: OBJECT – Participant Threshold and Returns Ratio Information, structured as follows:
      • Rate: OBJECT – Distribution proportional coefficient { Decimal : denominator; Rate: numerator };
      • Threshold: QUANTITY – Integer, minimum threshold for participation. Unit zhu.
    • NodeRate: OBJECT – Management fee information is structured as follows:
      • Decimal: QUANTITY – Integer, denominator of management fee ratio.
      • Rate: QUANTITY – Integer, numerator of management fee ratio.
    • OwnerRate: OBJECT – owner return ratio information, structured as follows:
      • Decimal: QUANTITY – Integer, denominator of owner’s return ratio.
      • Rate: QUANTITY – Integer, numerator of owner’s return ratio.
    • ValidatorMap: OBJECT, an array of participant information, including Owner; participant information structure is as follows:
      • Address: STRING – Participant account address;
      • Reward: QUANTITY – Integer, Incentive distribution accumulated value.
      • AllAmount: QUANTITY – Integer, Total stake amount.
      • Current: OBJECT – flexible stake information, structured as follows:
        • Amount: QUANTITY – Integer, the amount of flexible stake.
        • PreAmount: QUANTITY – Integer, the amount of flexible stake in the previous round.
        • Interest: QUANTITY – Integer, flexible interest.
        • WithdrawList: Withdraw stake information list a) WithDrawAmount Withdraw Amount;b) .
      • WithDrawTime :Withdraw time
      • Positions: OBJECT – fixed stake warehouse information list; fixed stake information is structured as follows:
        • DType: QUANTITY – Integer, fixed stake type
        • Position: QUANTITY – Integer, fixed stake warehouse
        • Amount: QUANTITY – Integer, fixed stake amount
        • EndTime: QUANTITY – Integer, fixed stake end time
Example

Request:

1
var result = aiman.man.getValidatorGroupInfo(“latest”);

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
"MAN.w8Nvei3g98GAtbuCzPWHb9UiDRZj": {
"OwnerInfo": {
"Owner": "MAN.s7jf4pkbZdfnUaZyDL4EGZprWrHm",
"SignAddress": "MAN.4SYA8BxUZaevRXczJvdoSMT2p89Np",
"WithdrawAllTime": 0
},
"Reward": {
"LevelRate": [
{
"Rate": {
"Decimal": "1000000000",
"Rate": "1"
},
"Threshold": "0"
},
{
"Rate": {
"Decimal": "1000000000",
"Rate": "1"
},
"Threshold": "10000000000000000000000"
},
{
"Rate": {
"Decimal": "1000000000",
"Rate": "1"
},
"Threshold": "100000000000000000000000"
}
],
"NodeRate": {
"Decimal": "1000000000",
"Rate": "0"
},
"OwnerRate": {
"Decimal": "1000000000",
"Rate": "1"
}
},
"ValidatorMap": [
{
"Address": "MAN.B1dmKTmWqNfHpv6mKytRrCy2NkWi",
"AllAmount": "100000000000000000000",
"Current": {
"Amount": "100000000000000000000",
"Interest": "5891875148930089",
"PreAmount": "0",
"WithdrawList": []
},
"Positions": [],
"Reward": "57970186835851759"
},
{
"Address": "MAN.G8dYKuZvPQAqVXRSzCTV7sYPhGFK",
"AllAmount": "10000000000000000000000",
"Current": {
"Amount": "10000000000000000000000",
"Interest": "589187514893008924",
"PreAmount": "0",
"WithdrawList": []
},
"Positions": [],
"Reward": "0"
}
]
}

aiman.man.getStorageAt

Returns the value of the specified address storage location.

Parameter
  • STRING –String, MAN address
  • QUANTITY – Location number in storage
  • STRING –String, currency name
  • QUANTITY|TAG – Integer block number, or the “latest”, “earliest” string
Return Value
  • DATA - The value of the specified storage location.
Example

Request:

1
var result = aiman.man.getStorageAt("MAN.468kLTuAEjm53ro2pPErnAAHqbccK",12,"MAN","latest")

Respons:

1
{"0x000000000000000000000000000000000000000000000000000000000000162e"}

aiman.man.getTopologyStatusByNumber

Returns the top-level node topology information of the specified block. Block is specified by height.

Parameter
  • QUANTITY|TAG - Integer block number, or the “latest”, “earliest” string
Return Value

Object – Matched Topological Information Objects. The structure is as follows:

  • leader_reelect: BOOL – Verifier Reelection Status. False: No verifier re-election occurred; True: Verifier re-election occurred;
  • validators: An array of verifier information. The verifier information structure is as follows:
    • account: STRING – Account;
    • online: BOOL – Online status. True: Online; False: Offline
    • position: QUANTITY – Location number
  • backup_validators: Backup the verifier information array. For backup verifier information structure, see verifier information structure.
  • miners: Miners information array. For miner information structure, see verifier information structure.
  • elect_validators: Verifier masternode consensus online and offline information. For information structure, see verifier information structure.
  • electbackupvalidators: Verifier backup node consensus online and offline information. For information structure, see verifier information structure.
Example

Request:

1
var result = aiman.man.getTopologyStatus(120);

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"leader_reelect": false,
"validators": [
{
"account": "MAN.4Pn182LSJ3JNr9by4T5kDKsf127Jb",
"online": true,
"position": 8192
},
{
"account": "MAN.23983gYFh8YH1ovpzKa3wpcNaRVn7",
"online": true,
"position": 8193
},
… //省略
{
"account": "MAN.2JJ1KuzNDAgfRRby6hfM7V256V1mD",
"online": true,
"position": 8210
}
],
"backup_validators": [
{
"account": "MAN.31uRb2uAFrGvAoJwurJaZrNwpw6vn",
"online": true,
"position": 12288
},
…//省略
{
"account": "MAN.3ygAdEiWqv9U8pdQxw6T5C8DGqYqF",
"online": true,
"position": 12291
},
{
"account": "MAN.kaXBV56J1MayJzrcTQdm4LaGKA6a",
"online": true,
"position": 12292
}
],
"miners": [
{
"account": "MAN.253ZT6RZWK28o78gqAn2HkS73mcdN",
"online": true,
"position": 0
},
{
"account": "MAN.3pFY9DFmU3MWTFQeQRiCzs9bzKyqm",
"online": true,
"position": 1
},
…//省略
{
"account": "MAN.NcLaq3ZuHvuahrBn1tBNzGz55giv",
"online": true,
"position": 31
}
],
"elect_validators": null,
"elect_backup_validators": [
{
"account": "MAN.2mHv8WkPczgZaoruUx9nn8b7dQaev",
"online": false,
"position": 61440
}
]
}

aiman.man.getBlackList

Returns transaction blacklist accounts, which cannot transfer transactions.

Parameter

None

Return Value

OBJECT: String array – Blacklisted transaction account address.

Example

Request:

1
var result = aiman.man.getBlackList();

Respons:

1
{"MAN.4Pn182LSJ3JNr9by4T5kDKsf127Jb"," MAN.Tfr4DZYNeWqqTth87phrg2KZcqya"}

Note: Non-consensus data, node data, are unauthenticated on the chain.`

aiman.man.getSelfLevel

Returns the identity of the current node in the network.

Parameter

None

Return Value

QUANTITY – Identity mark. 0: Error; 1-4 bucket; 5 top-level nodes; 6 basic nodes.

Example
1
console.log(aiman.man.getSelfLevel()); // 6

aiman.man.getUpTime

Returns the uptime of the specified account from the latest mortgage to the specified block. The block is specified by the block height.

Parameter
  • STRING – Account address
  • QUANTITY|TAG – Integer block number, or the “latest”, “earliest” string
Return Value
  • QUANTITY – Integer online time, counted by block height.
Example
1
console.log(aiman.man.getUpTime("MAN.4Kq1ciivykmrCFzz5YjLgamcNdU76")) //0x85edb

aiman.man.newBlockFilter

Creates a filter in the node to notify when a new block is generated. To check whether the state changes, call aiman.man.getFilterChanges

Parameter

None

Return Value

QUANTITY - Filter Number

Example

Request:

1
var result  = aiman.man.newBlockFilter();

Respons:

1
" 0x15842a94627e19e5571559236b5b1700 "

aiman.man.uninstallFilter

Uninstalls a filter with a specified number. When you do not need to listen, you always need to execute the call. In addition, if the filter does not receive the aiman.man.getFilterChanges call within a certain period of time, it will automatically timeout.

Parameter
  • QUANTITY - Filter Number
Return Value
  • Boolean - Return true if uninstalled successfully, otherwise return false
Example
1
var result aiman.man.uninstallFilter("0xb"); // true

aiman.man.getEntrustList

Returns entrust list for specified authorized account.

Parameter
  • STRING- Authorized account address.
Return Value

OBJECT – Entrusted account information list. The information structure of the entrusted account is as follows:

  • EntrustAddres: STRING – Entrusted account address
  • IsEntrustGas: BOOLEAN – Whether to entrust others to pay for gas. True means that gas is paid by others entrusted.
  • IsEntrustSign: BOOLEAN – Whether to entrust signature or not. True means that it is an entrusted signature.
  • EnstrustSetType: DATA, 1byte- 0: entrusted by height, 1: entrusted by time, 2: entrusted by number of times
  • StartHeight: QUANTITY – Integer block number, start height of entrust
  • EndHeight: QUANTITY – Integer block number, end height of entrust
  • StartTime: QUANTITY – UTC time, start time of entrust
  • EndTime: QUANTITY – UTC time, end time of entrust
  • EntrustCount: QUANTITY – Number of entrusts
Example

Request:

1
var result = aiman.man.getEntrustList("MAN.21LDRQtTVBdv3EcktxrVQebpQmLEA”);

Respons:

1
2
3
4
5
6
7
8
9
10
11
12
13
[
{
"EntrustAddres": "MAN.CUVXBNBpqXipn5JtDsnWKz3e59to",
"IsEntrustGas":false,
"IsEntrustSign":false,
"EnstrustSetType":2,
"StartHeight":0,
"EndHeight":0,
"StartTime":0,
"EndTime":0,
"EntrustCount": 5
}
]