API about transaction


1. sendtoaddress

Transfer coin from the source address to the destination address,10000 sawi fee default.

Parameters

sender sender address(Optional)

recviver receiver address

amount amount unit is sawi, smallest amount 10000 sawi

Returns

hash transaction hash

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","method":"sendtoaddress","params":["wTwrWser78mEa22f8mHfiHGrdKysTv8eBU","wXscdWVUN9irrLGvJJDZiaBoKXvat6Pqa9",1000000000],"id":168141569}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
  "result":
  {
    "hash":"c8260a08723192c74fb2025093bb876e6532baa5af952e6f7758a40c7f61c81f"
  },
  "error":null,
  "id":168141569
}

2. sendtoaddresswithfee

Transfer coin from the source address to the destination address and set the fee manually,

Parameters

sender sender address(Optional)

recviver receiver address

amount amount unit is sawi, smallest amount 10000 sawi

fee fee unitis sawi, smallest fee 10000 sawi

Returns

hash transaction hash

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","method":"sendtoaddresswithfee","params":["wTwrWser78mEa22f8mHfiHGrdKysTv8eBU","wXscdWVUN9irrLGvJJDZiaBoKXvat6Pqa9",1000000000,10000],"id":168141569}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
  "result":
  {
    "hash":"c8260a08723192c74fb2025093bb876e6532baa5af952e6f7758a40c7f61c81f"
  },
  "error":null,
  "id":168141569
}

3. gensendtoaddressraw

Create a transaction signature field, set the coin manually, and submit the transaction using the submittx method.

Parameters

src address sender address(Optional)

recv address receiver address

amount amount unit is sawi, smallest amount 10000 sawi

fee fee unit is sawi, smallest fee 10000 sawi

Returns

rawtx Field generated by transaction signature

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","method":"gensendtoaddressraw","params":["wLKf2NqwtHk3BfzK5wMDfbKYN1SC3weyR4","wXscdWVUN9irrLGvJJDZiaBoKXvat6Pqa9",100000,10000],"id":403309340}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
  "result":
  {
    "rawtx":"03018de95e0480c855010486db2601cd10858c20004630440220733eb4610e5cbb599ef409fd871cb1a999af2743f4d87b2c1f8e792c0c901f3a022000ce48fea9250faf25cc6a4bf19ec098a249a4f89116e2f033e60921c26fef55"
  },
  "error":null,
  "id":403309340
}

4. submittx

Broadcast transaction signature data to blockchain

Parameters

rawtx Field generated by transaction signature,can be created by method gensendtoaddressraw

Returns

hash transaction hash

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","id":"curltext","method":"submittx","params":["030192af0f020008146902285df4bba1d69952f3f9e5b071ed3e4e8df4cd10aed6c1000046304402204d3ac6de164f4bdfa65075e54bcd32161fa0ae3745d7b0e3e5da7f79ec17b45802206dd239adbbe5b3cc66adbb138505327036e111283c15e046b1b5fce5d52aa295"]}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
  "result":
  {
    "hash":"72a9ac4e3adb1ad93f7d6da59e61d9bf22918db17c4320555782fdcfe68899f8"
  },
  "error":null,
  "id":"curltext"
}

5. gettxdetail

Get an object about the transaction detail information by txhash.Including confirmed and unrecognized transactions

Parameters

txhash transaction hash

Returns

hash transaction hash

txtype type of transaction

  • REG_ACCT_TX:transaction of registering account
  • COMMON_TX:transaction of Transfer
  • REG_CONT_TX:transaction of publishing smart contract
  • CONTRACT_TX:transaction of calling smart contract
  • REWARD_TX:transaction of rewarding miner
  • DELEGATE_TX: transaction of vote

ver block version

regid sender's regID

addr sender's address

desregid receiver's regID

desaddr receiver's address

money amount unit is sawi

fees fee unit is sawi

height current height

arguments call the parameters of the contract, only if txtype is CONTRACT_TX

blockhash block hash

confirmHeight height when transaction is confirmed

confirmedtime time when transaction is confirmed

rawtx field generated by transaction signature

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","id":"curltext","method":"gettxdetail","params":["27ab6bc6b1761d208d255564073ada97aab86c8a5259f7b3def3c92c6925e2ef"]}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
  "result": {
    "hash": "27ab6bc6b1761d208d255564073ada97aab86c8a5259f7b3def3c92c6925e2ef",
    "txtype": "COMMON_TX",
    "ver": 1,
    "regid": "19396-1",
    "addr": "We4jaf5wSFYdFUaxzK5dKGoC2YPb9ATUPB",
    "desregid": " ",
    "desaddr": "WR4fyUnQKhrxgXuMnjMCea6TNjK29GgHnY",
    "money": 100000000,
    "fees": 10000,
    "height": 27991,
    "arguments": "",
    "blockhash": "c37f3e9869c6f8e7a73a3f05225f3190bbbdfe95d3e5472b306e24337b164ad6",
    "confirmHeight": 27994,
    "confirmedtime": 1525918120,
    "rawtx": "030180d9570480964401141a385e61ce1ffb4d9e9adc1d70e7a493adee3dd9cd10aed6c100004630440220422e3b013e9c6096efec06e5187f3afada5ad8537af251078b1923ec14efc6c80220147bd6d8e79ecaf94090d37f07f8f9458d8018a584f59782055cfa7fd34e8556"
  },
  "error": null,
  "id": "curltext"
}

6. listtx

get all confirmed and unconfirmed transactions from wallet.

Parameters

none

Returns

ConfirmTx the list of confirmed transaction

UnConfirmTx the list of unconfirmed transaction

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","id":"curltext","method":"listtx"}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
    "result":
    {
        "ConfirmTx":
        [
          "9b0626c3c2d248ad6559e4ce419cb27f35d80a226351cc00e4e10ec5438e1b70",
          "5ad2939094020cd58247b6d93620b5442ac3635e1b0a406bb52a18021241c4e2",
          "be21c999f2273cb0413a5a05f148d1271eca23b3333078c11e07537b1f0a2bf2",
          "d7036ba89bc441b16896b329fb141b478c199cc5708de44e4209aa6fc16efa16",
          "37c31dec529d07c4bffbd70670fc245032301460a1c946f9ebe897c4b6fbf937",
          "c6ac8b3b1bfd70bf9160a2dddb194435d00d47d8727f47b350aa5a4c80e4ed56",
          "7cef103b31f07dbb0c88c06e59d2becc0f29636377f3b1083f39b646b2185390",
          "0702b6c9cc96287b1226558eee08b114a3f99b788e2c61346416175d4b418a9b",
          "6b82eaa22da56afafeee3df1807974f36600d7181c1e9e703fa4c9d77046549f",
          "f1aced4bcfc914d0d0cde1fa98cb851c20e537df444b9161f57fa07d50a933cc"
        ],
        "UnConfirmTx":[]
    },
    "error":null,
    "id":"curltext"
}

7. listunconfirmedtx

get the list of unconfirmedtx.

Parameters

  • none

Returns

UnConfirmTx the list of unconfirmed transaction

*txType= type of transaction. refer togettxdetail *hash tx hash *ver *srcId sender regid *desId receiver regid *llFees fees ,unit is sawi *vContract content of contract. if txType=CONTRACT_TX *nValidHeight height when transaction is submited

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","id":"curltext","method":"listunconfirmedtx"}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
  "result":
  {
    "UnConfirmTx":
    [
      "txType=COMMON_TX, hash=cca0868ce56515f3929296e393b2b7151b5baf7e2ee5828889378b2da3c92549, ver=1, srcId=138259-1 desId=185091-1, llFees=10000, vContract=, nValidHeight=283078\n"
    ]
  },
  "error":null,
  "id":"curltext"
}

8. getalltxinfo

if no input params, return all transaction in wallet including confirmed and unconfirmed, else return number fo nlimitCount transaction report.

Parameters

txcount number of transaction records(Optional)get all transaction details by defualt

Returns

Confirmed the list of confirmed details of the confirmed transaction

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc":"2.0","id":"curltext","method":"getalltxinfo","params":[2]}' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
  "result":
  {
    "Confirmed":
    [
      {
        "hash":"cca0868ce56515f3929296e393b2b7151b5baf7e2ee5828889378b2da3c92549",
        "txtype":"COMMON_TX",
        "ver":1,
        "regid":"138259-1",
        "addr":"wQWKaN4n7cr1HLqXY3eX65rdQMAL5R34k6",
        "desregid":"185091-1",
        "desaddr":"web3Xj77ShBZJjQ54jzttZpAfdB8BAYn7M",
        "money":100000000,
        "fees":10000,
        "height":283078,
        "Contract":"",
        "blockhash":"c99e077ce23524cc8bb7dbdc24f75e611a85c9f91efe91fe6d7972187ef48a25",
        "confirmHeight":283079,
        "confirmedtime":1541216320,"rawtx":"030190a2460487b71301048aa50301cd10aed6c10000473045022100917610f3f7c271c3e1435238a316d38c9f58c0f3bbc541ea9ae51c7442e263fd022042a18a39857cc912c5ebda2962fa23747605d3f2a326dbd35a905629bcb63ba9"
      },
      {
        "hash":"f36d5058d28769e413f905c6604ac79de8ed3799fc6fca678bb76cbb74d51a69",
        "txtype":"COMMON_TX",
        "ver":1,
        "regid":"138259-1",
        "addr":"wQWKaN4n7cr1HLqXY3eX65rdQMAL5R34k6",
        "desregid":"185091-1",
        "desaddr":"web3Xj77ShBZJjQ54jzttZpAfdB8BAYn7M",
        "money":100000000,
        "fees":10000,
        "height":282993,
        "Contract":"",
        "blockhash":"230eee735caf9a6abccdb2652e8b5000e76ba504d79ccbb7de69fa22f82e9db0",
        "confirmHeight":282995,
        "confirmedtime":1541214790,"rawtx":"030190a1710487b71301048aa50301cd10aed6c10000473045022100c4f65991e9ba08a4dfd0792b1a792f7e534dc40e07426a9abc49ba6b206430ba022058cbd26bd5fc82e701632d6ccbc4b025e65e21a6cd9c21cdaa3550088f28c704"
      }
    ]
  },
  "error":null,
  "id":"curltext"
}

9. decoderawtx

Parse the original transaction order based on the signature field

Parameters

rawtx signature field

Returns

hash transaction hash

txtype transaction type

ver version

regid sender regid

addr sender address

desregid receiver regid

desaddr receiver address

money transaction amount ,unit is sawi

fees fee,unit is sawi

height the height of transaction creating

contract contract content

Example

// Request
curl -u Waykichain:admin -d '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtx", "params": ["0301d60002000114865044b3ac4f7e1facb0f881666ef557d441e0ffcd10858c20004630440220656c7badc84d3625139bd0935200a0ba3ee763ae9fce76c64457785e1c46470302200590c2941168828305514d978261456eb82c46bd390624c9bccdaabee9894252"] }' -H 'content-type:application/json;' http://127.0.0.1:6967

// Response
{
    "result": {
        "hash": "6cab7e9b4b6e25f2390de3087f1024adf1f430c2aedab9eed6d82d33786436da",
        "txtype": "COMMON_TX",
        "ver": 1,
        "regid": "0-1",
        "addr": "wLKf2NqwtHk3BfzK5wMDfbKYN1SC3weyR4",
        "desregid": " ",
        "desaddr": "wXscdWVUN9irrLGvJJDZiaBoKXvat6Pqa9",
        "money": 100000,
        "fees": 10000,
        "height": 11136,
        "contract": ""
    },
    "error": null,
    "id": "curltest"
}

results matching ""

    No results matching ""