INT RPC API

getBlock

Returns information of a block by block hash or block number

Parameters

  1. which - String | Number: The block hash or block number.
  2. transactions - Boolean: Default false. If true, the returned block will contain all transactions as array.
params: {
    "funName": "getBlock",
    "args": {
        "which": "014e33a615f460b6b6fdb81030e5248497371da62d0a1817fd37479dfb796e78",
        "transactions": true        
    }
}

Returns

Returns Object: The block object:

  • err - Number: 0 if the block was successful.
  • block - Object:
    • hash - String: Hash of the block where this transaction was in.
    • number - Number: Block number where this transaction was in.
    • timestamp - Number: The unix timestamp for when the block was collated.
    • preBlock - String: Hash of the previous block.
    • merkleRoot - String: The root of the transaction trie of the block.
    • coinbase - String: The coinbase address to which mining rewards will go.
    • creator - String: The creater address of the block.
    • wage - String: The reward of the block.
  • transactions - Array:
    • hash - String: Hash of the transaction.
    • method - String: The name of the function to call.
    • input - Array: The input data of the transaction.
    • nonce - Number: The number of transactions made by the sender prior to this one.
    • caller - String: The sender of this transaction.
    • value - String: The value transferred for this transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).

Example

// Request
curl -X POST --data '{"funName":"getBlock", "args":{ "which": "537de0c747475bc2dbdff53bbb02fc3cb115f04483c35a34992312d5b4a9f5cd", "transactions": true}}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "block":{
        "hash":"537de0c747475bc2dbdff53bbb02fc3cb115f04483c35a34992312d5b4a9f5cd",
        "number":15153,
        "timestamp":1543032327,
        "preBlock":"0a9656b1ae2bda81ed2e5e7af50b9dd311669e6b4ffa24be89b67b801315abbb",
        "merkleRoot":"d723e57e55835536dadeea99ac03967847c8a4ab95d7d42fee3fa7cea61ca4c3",
        "storageHash":"6d935f722a449a162c8b947b80837409053c9065aa9f64a2e5cc86884e1cb28b",
        "m_receiptHash":"ac56980ffdab49c0bc5c59020386b681e996f3a84e8db4440270949b9e135bae",
        "coinbase":"INT1BYNp2jQC8WF2vs7bofQUzsHLwP2UfyD9K",
        "creator":"INT12nD5LgUnLZDbyncFnoFB43YxhSFsERcgQ",
        "wage":"1"
    },
    "transactions":[{...},{...}]

getNonce

Returns the number of transactions sent from an address

Parameters

  1. address - String: INT address.
params: {
    "funName": "getNonce",
    "args": {
        "address": "INT1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79"       
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • nonce - Number: The number of transactions send from this address.

Example

// Request
curl -X POST --data '{"funName":"getNonce", "args":{ "address": "INT1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79" }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "nonce": 23691
}

getPrice

Returns current price

Parameters

params: {
    "funName": "getPrice",
    "args": {}
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • price - String: The current price of the latest two blocks.

Example

// Request
curl -X POST --data '{"funName":"getPrice", "args":{}}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "price": "200000000000"
}

getTransactionLimit

Returns the limit of transaction

Parameters

  1. method - String: The method name of the transaction.
  2. input - Object: The input of the transaction.
params: {
    "funName": "getTransactionLimit",
    "args": {
        `input of transaction`       
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • limit - String: The limit of transaction.

Example

// Request
curl -X POST --data '{"funName":"getTransactionLimit", "args":{"method": "transferTo", "input": {"to": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"}}}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "limit":"39000"
}

getPendingTransactions

Returns the pending transactions.

Parameters

params: {
    "funName": "getPendingTransactions",
    "args": {}
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • pendingTransactions - Array: The pending transactions.

Example

// Request
curl -X POST --data '{"funName":"getPendingTransactions", "args":{}}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "pendingTransactions": [...]
}

getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

Parameters

  1. tx-String:Hash of a transaction.
params: {
    "funName": "getTransactionReceipt",
    "args": { "tx": "4981e584a33771dbfcfb0f1e1451e1de39d250c79ab7d9d2033cc2ab48bec2ce"}
}

Returns

Promise returns Object: The transaction receipt object:

  • err - Number: 0 if the transaction was successful.
  • block - Object:
    • hash - String: Hash of the block where this transaction was in.
    • number - Number: Block number where this transaction was in.
    • timestamp - Number: The unix timestamp for when the block was collated.
    • preBlock - String: Hash of the previous block.
    • merkleRoot - String: The root of the transaction trie of the block.
    • coinbase - String: The coinbase address to which mining rewards will go.
    • creator - String: The creater address of the block.
  • tx - Object:
    • hash - String: Hash of the transaction.
    • method - String: The name of the function to call.
    • input - Array: The input data of the transaction.
    • nonce - Number: The number of transactions made by the sender prior to this one.
    • caller - String: The sender of this transaction.
    • value - String: The value transferred for this transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
  • receipt - Object:
    • hash - String: Hash of the transaction.
    • returnCode - Number: 0 if the transaction was successful.
    • logs - Array: Log of the transaction.
    • cost - String: The actual fee for the transaction in min unit (attoINT).

Example

// Request
curl -X POST --data '{"funName":"getTransactionReceipt", "args":{ "tx": "4981e584a33771dbfcfb0f1e1451e1de39d250c79ab7d9d2033cc2ab48bec2ce"}}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "block":{
        "hash":"537de0c747475bc2dbdff53bbb02fc3cb115f04483c35a34992312d5b4a9f5cd",
        "number":15153,
        "timestamp":1543032327,
        "preBlock":"0a9656b1ae2bda81ed2e5e7af50b9dd311669e6b4ffa24be89b67b801315abbb",
        "merkleRoot":"d723e57e55835536dadeea99ac03967847c8a4ab95d7d42fee3fa7cea61ca4c3",
        "storageHash":"6d935f722a449a162c8b947b80837409053c9065aa9f64a2e5cc86884e1cb28b",
        "m_receiptHash":"ac56980ffdab49c0bc5c59020386b681e996f3a84e8db4440270949b9e135bae",
        "coinbase":"INT1BYNp2jQC8WF2vs7bofQUzsHLwP2UfyD9K",
        "creator":"INT12nD5LgUnLZDbyncFnoFB43YxhSFsERcgQ"
    },
    "tx":{
        "hash":"4981e584a33771dbfcfb0f1e1451e1de39d250c79ab7d9d2033cc2ab48bec2ce",
        "method":"transferTo",
        "input":{
            "to":"INT15UKrWZGtySCUdRo9JLCtbJLgGBT83AS7y"
        },
        "nonce":9112,
        "caller":"INT1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79",
        "value":"1e+21",
        "limit":"100000",
        "price":"300000000000"
    },
    "receipt":{
        "transactionHash":"4981e584a33771dbfcfb0f1e1451e1de39d250c79ab7d9d2033cc2ab48bec2ce",
        "returnCode":0,
        "logs":[

        ],
        "cost":"11700000000000000"
    }
}

isValidAddress

Returns true or false, if the address is valid or not.

Parameters

  1. address - String: INT address.
params: {
    "funName": "isValidAddress",
    "args": {
        "address": "INT1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79"       
    }
}

Returns

Returns boolean : true if the address is valid, otherwise false.

Example

// Request
curl -X POST --data '{"funName":"isValidAddress", "args":{ "address": "INT1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79" }}' http://127.0.0.1:8555/rpc
// Result
true

createContractAddress

Returns contract address.

Parameters

  1. address - String: INT address.
params: {
    "funName": "createContractAddress",
    "args": {
        "address": "INT1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79"       
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • contract - String: The contract address.

Example

// Request
curl -X POST --data '{"funName":"createContractAddress", "args":{ "address": "INT1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79" }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "contract":"INT1cq51p2iNJLneTYJP3sLRxo7UU1Q6QXSh"
}

newAccount

Create keystore file and return address of the new account.

Parameters

  1. password - String: Password to encrypt the keystore file.
  2. privateKey - String: 32 Bytes - Private key. If you want to create a new account, please don't pass privateKey.
params: {
    "funName": "newAccount",
    "args": {
        "password": "123456789",
        "privateKey": "cb83e2475bbb4213d1f5921102f8e318281e17cc6416f1168716e6b37dff8d26"       
    }
}

or

params: {
    "funName": "newAccount",
    "args": {
        "password": "123456789"      
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • address - String: INT address.

Example

// Request
curl -X POST --data '{"funName":"newAccount", "args":{ "password": "123456789" }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "address":"INT1KS5oUQAXZjDcNFAR4hRHsoetL48ziBBNY"
}

getAccounts

Returns address list of your local keystores.

Parameters

params: {
    "funName": "getAccounts",
    "args": {

    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • accounts - Array: INT address list.

Example

// Request
curl -X POST --data '{"funName":"getAccounts", "args":{ }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "accounts": [...]
}

sendSignedTransaction

Create an new transaction.

Parameters

  1. tx - String: The singed transaction data.
params: {
    "funName": "sendSignedTransaction",
    "args": {
        "tx": "0a7472616e73666572546f0200000003705fe2eea24eb666f6e68bfc12f703f725a7ed72e0eb1b91e0311b463913f2632f7b22746f223a2273494e543137595a79356739455a53344736485434704c58795350754577786978764233786f227d0731303030303030063130303030300c333030303030303030303030c124b56cccf1f5af400b191c3c3334b4d28c36d895c81b36823c5845073963cc55b9af8e28b1788062e90f20c04050760350efce531c93f76a62900244695a96"
    } 
   }

The valid methods are createToken, transferTokenTo, vote, mortgage, unmortgage, register.

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendSignedTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "a91be51c9d320fe241082219b64bb44ab2ef6c42d30bb1e305e038563ab4b847"
}

sendTransaction

Create new transaction.

transferTo

Transfer INT.

Parameters

  1. Object: The transaction object to send:
    • from - String: The address for the sending account.
    • method - String: The name of the function to call.
    • value - String: The value transferred for the transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
    • input - Object: The input data of the transaction.
      • to - String: The destination address to send INT to.
    • password - String: The password of the sending account.
params: {
   "funName": "sendTransaction",
   "args": {
       "from":"INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo",
       "method":"transferTo",
       "value":"10000000000",
       "limit":"100000",
       "price":"300000000000",
       "input":{"to":"INT12nD5LgUnLZDbyncFnoFB43YxhSFsERcgQ"},
       "password":"123456789"       

   }
}

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "14876f86f3d4238ec0cc6a8f6463724a821bc40844a1921ce07cb79e3c3206a5"
}

register

Register as candidates.

Parameters

  1. Object: The transaction object to send:
    • from - String: The address for the sending account.
    • method - String: The name of the function to call.
    • value - String: The value transferred for the transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
    • input - Object: The input data of the transaction.
      • coinbase - String: The address to receive rewards.
    • password - String: The password of the sending account.
params: {
   "funName": "sendTransaction",
   "args": {
       "from":"INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo",
       "method":"register",
       "value":"0",
       "limit":"100000",
       "price":"300000000000",
       "input":{"coinbase": "INT13CS9dBwmaboedj2hPWx6Dgzt4cowWWoNZ"},
       "password":"123456789"       

   }
}

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "14876f86f3d4238ec0cc6a8f6463724a821bc40844a1921ce07cb79e3c3206a5"
}

mortgage

Mortgage.

Parameters

  1. Object: The transaction object to send:
    • from - String: The address for the sending account.
    • method - String: The name of the function to call.
    • value - String: The value transferred for the transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
    • input - Object: The input data of the transaction.
      • amount - String: The amount to mortgage.
    • password - String: The password of the sending account.
params: {
   "funName": "sendTransaction",
   "args": {
       "from":"INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo",
       "method":"mortgage",
       "value":"100000000000000000000",
       "limit":"100000",
       "price":"300000000000",
       "input":{"amount": "100000000000000000000"},
       "password":"123456789"       

   }
}

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "14876f86f3d4238ec0cc6a8f6463724a821bc40844a1921ce07cb79e3c3206a5"
}

unmortgage

Unmortgage.

Parameters

  1. Object: The transaction object to send:
    • from - String: The address for the sending account.
    • method - String: The name of the function to call.
    • value - String: The value transferred for the transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
    • input - Object: The input data of the transaction.
      • amount - String: The amount to mortgage.
    • password - String: The password of the sending account.
params: {
   "funName": "sendTransaction",
   "args": {
       "from":"INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo",
       "method":"unmortgage",
       "value":"0",
       "limit":"100000",
       "price":"300000000000",
       "input":{"amount": "100000000000000000000"},
       "password":"123456789"       

   }
}

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "14876f86f3d4238ec0cc6a8f6463724a821bc40844a1921ce07cb79e3c3206a5"
}

vote

Vote to candidates.

Parameters

  1. Object: The transaction object to send:
    • from - String: The address for the sending account.
    • method - String: The name of the function to call.
    • value - String: The value transferred for the transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
    • input - Object: The input data of the transaction.
      • candidates - Array: The candidates nodes.
    • password - String: The password of the sending account.
params: {
   "funName": "sendTransaction",
   "args": {
       "from":"INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo",
       "method":"vote",
       "value":"0",
       "limit":"100000",
       "price":"300000000000",
       "input":{"candidates": ["INT13CS9dBwmaboedj2hPWx6Dgzt4cowWWoNZ","INT1LuwjNj8wkqo237N7Gh8nZSSvUa6TZ5ds4","INT12nD5LgUnLZDbyncFnoFB43YxhSFsERcgQ"]},
       "password":"123456789"    
   }
}

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "14876f86f3d4238ec0cc6a8f6463724a821bc40844a1921ce07cb79e3c3206a5"
}

createToken

Create token.

Parameters

  1. Object: The transaction object to send:
    • from - String: The address for the sending account.
    • method - String: The name of the function to call.
    • value - String: The value transferred for the transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
    • input - Object: The input data of the transaction.
      • tokenid - String: Contract address from createContractAddress.
      • amount - String: The total supply of the token.
      • name - String: The full name of the token.
      • symbol - String: The symbol of the token.
    • password - String: The password of the sending account.
params: {
   "funName": "sendTransaction",
   "args": {
       "from":"INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo",
       "method":"createToken",
       "value":"0",
       "limit":"100000",
       "price":"300000000000",
       "input":{"tokenid": "INT1cq51p2iNJLneTYJP3sLRxo7UU1Q6QXSh", "amount": "1000000000000000000000000000", "name": "Test Coin", "symbol": "TC"},
       "password":"123456789"       
   }
}

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "14876f86f3d4238ec0cc6a8f6463724a821bc40844a1921ce07cb79e3c3206a5"
}

transferTokenTo

Transfer token.

Parameters

  1. Object: The transaction object to send:
    • from - String: The address for the sending account.
    • method - String: The name of the function to call.
    • value - String: The value transferred for the transaction in min unit (attoINT).
    • limit - String: Limit provided by the sender.
    • price - String: Price provided by the sender min unit (attoINT).
    • input - Object: The input data of the transaction.
      • tokenid - String: The tokenid of the token.
      • to - String: The destination address to send token to.
      • amount - String: The destination address to send token to.
    • password - String: The password of the sending account.
params: {
   "funName": "sendTransaction",
   "args": {
       "from":"INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo",
       "method":"transferTokenTo",
       "value":"0",
       "limit":"100000",
       "price":"300000000000",
       "input":{"tokenid": "INT1cq51p2iNJLneTYJP3sLRxo7UU1Q6QXSh", "to": "1EYLLvMtXGeiBJ7AZ6KJRP2BdAQ2Bof79", "amount": "100000000000000000000"},
       "password":"123456789"       
   }
}

Returns

Returns Object:

  • err - Number: 0 if the method was successful.
  • hash - String: The hash of the transaction.

Example

// Request
curl -X POST --data '{"funName":"sendTransaction", "args":{ see above }}' http://127.0.0.1:8555/rpc
// Result
{
    "err": 0,
    "hash": "14876f86f3d4238ec0cc6a8f6463724a821bc40844a1921ce07cb79e3c3206a5"
}

view

getBalance

Returns the balance of the account of given address.

Parameters

  1. method - String: The method name.
  2. params - Object: Empty if the method has no params.
    • address - String: INT address.
params: {
    "funName": "view",
    "args": {
        "method": "getBalance",
        "params": {"address": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"}
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • value - BigNumber: The balance of an address.

Example

// Request
curl -X POST --data '{"funName":"view", "args":{ "method": "getBalance","params": {"address": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"} }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "value": "n1.010988299990001e+21"
}

getTokenBalance

Returns the token balance of the account of given address.

Parameters

  1. method - String: The method name.
  2. params - Object: Empty if the method has no params.
    • tokenid - String: The token contract address.
    • address - String: INT address.
params: {
    "funName": "view",
    "args": {
        "method": "getTokenBalance",
        "params": {"tokenid": "INT1cq51p2iNJLneTYJP3sLRxo7UU1Q6QXSh", "address": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"}
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • value - BigNumber: The token balance of given address.

Example

// Request
curl -X POST --data '{"funName":"view", "args":{ "method": "getTokenBalance", "params": {"tokenid": "INT1cq51p2iNJLneTYJP3sLRxo7UU1Q6QXSh", "address": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"} }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "value": "n1.010988299990001e+21"
}

getTokenTotalSupply

Returns the token total supply.

Parameters

  1. method - String: The method name.
  2. params - Object: Empty if the method has no params.
    • tokenid - String: The token contract address.
params: {
    "funName": "view",
    "args": {
        "method": "getTokenTotalSupply",
        "params": {"tokenid": "INT1cq51p2iNJLneTYJP3sLRxo7UU1Q6QXSh"}
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • value - BigNumber: The token total supply.

Example

// Request
curl -X POST --data '{"funName":"view", "args":{ "method": "getTokenTotalSupply", "params": {"tokenid": "INT1cq51p2iNJLneTYJP3sLRxo7UU1Q6QXSh", "address": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"} }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "value": "n1e+27"
}

getVote

Returns the nodes address and it's vote.

Parameters

  1. method - String: The method name.
  2. params - Object: Empty if the method has no params.
params: {
    "funName": "view",
    "args": {
        "method": "getVote",
        "params": {}
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • value - Array: The nodes address and it's vote.

Example

// Request
curl -X POST --data '{"funName":"view", "args":{ "method": "getVote", "params": {} }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "value": [ { address: 'INT12CdrtMEKwRqycjYWHw2gSUVTHKoF4wULx', vote: BigNumber { s: 1, e: 22, c: [Array] } },
               { address: 'INT12nD5LgUnLZDbyncFnoFB43YxhSFsERcgQ', vote: BigNumber { s: 1, e: 22, c: [Array] } },
               { address: 'INT13CS9dBwmaboedj2hPWx6Dgzt4cowWWoNZ', vote: BigNumber { s: 1, e: 22, c: [Array] } }
             ]
}

getStake

Returns the stake of given address.

Parameters

  1. method - String: The method name.
  2. params - Object: Empty if the method has no params.
    • address - String: INT address.
params: {
    "funName": "view",
    "args": {
        "method": "getStake",
        "params": {"address": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"}
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • value - BigNumber: The stake of given address.

Example

// Request
curl -X POST --data '{"funName":"view", "args":{ "method": "getStake", "params": {"address": "INT17YZy5g9EZS4G6HT4pLXySPuEwxixvB3xo"} }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "value": "n1e+20"
}

getCandidates

Returns all candidate nodes.

Parameters

  1. method - String: The method name.
  2. params - Object: Empty if the method has no params.
params: {
    "funName": "view",
    "args": {
        "method": "getCandidates",
        "params": {}
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • value - Array: The candidate nodes list.

Example

// Request
curl -X POST --data '{"funName":"view", "args":{ "method": "getCandidates", "params": {} }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "value": ["sINT12nD5LgUnLZDbyncFnoFB43YxhSFsERcgQ","sINT13CS9dBwmaboedj2hPWx6Dgzt4cowWWoNZ","sINT1LuwjNj8wkqo237N7Gh8nZSSvUa6TZ5ds4"]
}

getMiners

Returns nodes address of block producer.

Parameters

  1. method - String: The method name.
  2. params - Object: Empty if the method has no params.
params: {
    "funName": "view",
    "args": {
        "method": "getMiners",
        "params": {}
    }
}

Returns

Returns Object :

  • err - Number: 0 if the method was successful.
  • value - Array: The nodes address of block producer.

Example

// Request
curl -X POST --data '{"funName":"view", "args":{ "method": "getMiners", "params": {} }}' http://127.0.0.1:8555/rpc
// Result
{
    "err":0,
    "value": ["sINT12nD5LgUnLZDbyncFnoFB43YxhSFsERcgQ","sINT13CS9dBwmaboedj2hPWx6Dgzt4cowWWoNZ","sINT1LuwjNj8wkqo237N7Gh8nZSSvUa6TZ5ds4"]
}
Copyright © developer@intchain.io 2018 all right reserved,powered by GitbookLast modified: 2019-01-25 17:10:41

results matching ""

    No results matching ""