Skip to content

Commit

Permalink
Add 2.10.0 API (neo-project#800)
Browse files Browse the repository at this point in the history
* Add 2.10.0 API

* update
  • Loading branch information
Celia18305 authored Apr 15, 2019
1 parent adb92b5 commit bfd14ec
Show file tree
Hide file tree
Showing 48 changed files with 4,394 additions and 5 deletions.
3 changes: 2 additions & 1 deletion en-us/node/cli/2.10.0/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ For P2P and WebSocket information see [Node/Introduction](../../introduction.md)
| [getrawtransaction](api/getrawtransaction.md) | \<txid> [verbose=0] | Returns the corresponding transaction information based on the specified hash value | |
| [getunclaimedgas](api/getunclaimedgas.md) | | Gets the amount of unclaimed GAS in the wallet. | Need to open the wallet |
| [getstorage](api/getstorage.md) | \<script_hash> \<key> | Returns the stored value based on the contract script hash and key | |
| [gettransactionheight](api/gettransactionheight.md) | \<txid> | Returns the block index in which the transaction is found. | |
| [gettxout](api/gettxout.md) | \<txid> \<n> | Returns the corresponding transaction output (change) information based on the specified hash and index | |
| [getpeers](api/getpeers.md) | | Gets a list of nodes that are currently connected/disconnected by this node | |
| [getversion](api/getversion.md) | | Gets version information of this node | |
Expand All @@ -93,7 +94,7 @@ For P2P and WebSocket information see [Node/Introduction](../../introduction.md)
| [sendfrom](api/sendfrom.md) | \<asset_id> \<address> \<value> [fee=0] | Transfers from the specified address to the destination address. | Need to open the wallet |
| [sendtoaddress](api/sendtoaddress.md) | \<asset_id> \<address> \<value> [fee=0] | Transfer to specified address | Need to open the wallet |
| [sendmany](api/sendmany.md) | \<outputs_array> \[fee=0] \[change_address] | Bulk transfer order | Need to open the wallet |
| submitblock | \<hex> | Submit new blocks | Needs to be a consensus node |
| [submitblock](api/submitblock.md) | \<hex> | Relay a new block to the network | Needs to be a consensus node |
| [validateaddress](api/validateaddress.md) | \<address> | Verify that the address is a correct NEO address | |

## GET request example
Expand Down
5 changes: 4 additions & 1 deletion en-us/node/cli/latest-version/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ For P2P and WebSocket information see [Node/Introduction](../../introduction.md)

| Command | Reference | Explanation | Comments |
| ----------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------ | ---------------------------- |
| [claimgas](api/claimgas.md) | [address] | Claims GAS in the wallet. | Need to open the wallet |
| [dumpprivkey](api/dumpprivkey.md) | \<address> | Exports the private key of the specified address | Need to open the wallet |
| [getaccountstate](api/getaccountstate.md) | \<address> | Checks account asset information according to account address | |
| [getassetstate](api/getassetstate.md) | \<asset_id> | Queries asset information according to the specified asset number | |
Expand All @@ -76,13 +77,15 @@ For P2P and WebSocket information see [Node/Introduction](../../introduction.md)
| [getnewaddress](api/getnewaddress.md) | | Creates a new address | Need to open the wallet |
| [getrawmempool](api/getrawmempool.md) | | Gets a list of unconfirmed transactions in memory | |
| [getrawtransaction](api/getrawtransaction.md) | \<txid> [verbose=0] | Returns the corresponding transaction information based on the specified hash value | |
| [getunclaimedgas](api/getunclaimedgas.md) | | Gets the amount of unclaimed GAS in the wallet. | Need to open the wallet |
| [getstorage](api/getstorage.md) | \<script_hash> \<key> | Returns the stored value based on the contract script hash and key | |
| [gettransactionheight](api/gettransactionheight.md)| \<txid> | Returns the block index in which the transaction is found. |
| [gettransactionheight](api/gettransactionheight.md)| \<txid> | Returns the block index in which the transaction is found. ||
| [gettxout](api/gettxout.md) | \<txid> \<n> | Returns the corresponding transaction output (change) information based on the specified hash and index | |
| [getpeers](api/getpeers.md) | | Gets a list of nodes that are currently connected/disconnected by this node | |
| [getversion](api/getversion.md) | | Gets version information of this node | |
| [getvalidators](api/getvalidators.md) | | Gets NEO consensus nodes information | |
| [getwalletheight](api/getwalletheight.md) | | Gets the current wallet index height. | Need to open the wallet |
| [importprivkey](api/importprivkey.md) | \<key> | Imports the private key to the wallet. | Need to open the wallet |
| [invoke](api/invoke.md) | \<script_hash> \<params> | Invokes a smart contract at specified script hash with the given parameters | |
| [invokefunction](api/invokefunction.md) | \<script_hash> \<operation> \<params> | Invokes a smart contract at specified script hash, passing in an operation and its params | |
| [invokescript](api/invokescript.md) | \<script> | Runs a script through the virtual machine and returns the results | |
Expand Down
99 changes: 99 additions & 0 deletions en-us/node/cli/latest-version/api/claimgas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# claimgas Method

Claims GAS in the wallet.

> [!Note]
>
> Before you can invoke this method you must open the wallet in NEO-CLI.
## Parameter Description

address (optional): The address that you want to send the claimed GAS to. This address should be a standard address.

## Example

Request body:

```
{
"jsonrpc": "2.0",
"method": "claimgas",
"params": [],
"id": 1
}
```

Response body:

```
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txid": "0xa6d16b98dbd4b2d140bd8316f595de3c6770456454d5aa48e1d3dbe11c1acd3e",
"size": 543,
"type": "ClaimTransaction",
"version": 0,
"attributes": [],
"vin": [],
"vout": [
{
"n": 0,
"asset": "0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7",
"value": "0.499384",
"address": "AH2TGXkKgiWm4xMQzVT5R9zV1yxwVXNAPT"
}
],
"sys_fee": "0",
"net_fee": "0",
"scripts": [
{
"invocation": "4000b71a53738761ec03d9cd5d85fc8ea2acf42cda076e7a5f690adb897b2ee8ed018a0000494d6ee047cd66ec926806a0c934fe1a84aec171f66eedf8309d6a9a",
"verification": "2102bac395577bf47e7dd6058b7dfc38d2b351966ac03ea84ba7bca410e8a8aded20ac"
},
{
"invocation": "4086cdf2622d901110f2c04e646f8e78f4c995f3be399bbe5d2d4ac81918fd4a5d5c39a7df60f827c00de1f19e3584c3253541c52b88bed54ba1b9a448548b0e5d",
"verification": "2103991949671a85ba5eb09a982c94e0d205b81c94f958109895b4ebafa747caaf09ac"
}
],
"claims": [
{
"txid": "0xe1e44f41a1f0854063ccdc9beb7537fc40565575e0ae2366b4a93a73c18b6166",
"vout": 2
},
{
"txid": "0x69fd452c92fb0e5861b27588549a8e55d3f9fee542884ae317600508bbacedbb",
"vout": 2
},
{
"txid": "0x152d823d5cf1ce58cf33879e23309dc83152cfb8c50ba05cc03c090dcd00198e",
"vout": 0
},
{
"txid": "0x152d823d5cf1ce58cf33879e23309dc83152cfb8c50ba05cc03c090dcd00198e",
"vout": 1
},
{
"txid": "0xe1e44f41a1f0854063ccdc9beb7537fc40565575e0ae2366b4a93a73c18b6166",
"vout": 0
},
{
"txid": "0xe1e44f41a1f0854063ccdc9beb7537fc40565575e0ae2366b4a93a73c18b6166",
"vout": 1
},
{
"txid": "0x668e9be5185e1cfa1efb08b673062038ce04ebc9db41f75dc74d6faacbaf71ea",
"vout": 0
},
{
"txid": "0x668e9be5185e1cfa1efb08b673062038ce04ebc9db41f75dc74d6faacbaf71ea",
"vout": 1
}
]
}
}
```

Response description:

Returns the transaction details.
37 changes: 37 additions & 0 deletions en-us/node/cli/latest-version/api/getunclaimedgas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# getunclaimedgas Method

Gets the amount of unclaimed GAS in the wallet.

> [!Note]
>
> Before you can invoke this method you must open the wallet in NEO-CLI.
## Example

Request body:

```json
{
"jsonrpc": "2.0",
"method": "getunclaimedgas",
"params": [],
"id": 1
}
```

Response body:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"available": "0.140771",
"unavailable": "0.096224"
}
}
```

Response description:

Returns the unclaimed GAS amount.
44 changes: 44 additions & 0 deletions en-us/node/cli/latest-version/api/importprivkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# importprivkey Method

Imports the private key to the wallet.

> [!Note]
>
> Before you can invoke this method you must open the wallet in NEO-CLI.
## Parameter Description

Key: The WIF-format private key.

## Example

Request body:

```json
{
"jsonrpc": "2.0",
"method": "importprivkey",
"params": ["L5c6jz6Rh8arFJW3A5vg7Suaggo28ApXVF2EPzkAXbm94ThqaA6r"],
"id": 1
}
```

Response body:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"address": "Ad8S24trcuchyLfEbJWqRP7BUScUT4t2pw",
"haskey": true,
"label": null,
"watchonly": false
}
}
```

Response description:

Returns the address corresponding to the key.

83 changes: 82 additions & 1 deletion en-us/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
href: node/cli/latest-version/api/getrawtransaction.md
- name: getstorage
href: node/cli/latest-version/api/getstorage.md
- name: gettransactionheight
href: node/cli/latest-version/api/gettransactionheight.md
- name: gettxout
href: node/cli/latest-version/api/gettxout.md
- name: getpeers
Expand All @@ -102,13 +104,15 @@
- name: getwalletheight
href: node/cli/latest-version/api/getwalletheight.md
- name: importkey
href: node/cli/latest-version/api/importprivkey.md
href: node/cli/latest-version/api/importkey.md
- name: invoke
href: node/cli/latest-version/api/invoke.md
- name: invokefunction
href: node/cli/latest-version/api/invokefunction.md
- name: invokescript
href: node/cli/latest-version/api/invokescript.md
- name: listplugins
href: node/cli/latest-version/api/listplugins.md
- name: listaddress
href: node/cli/latest-version/api/listaddress.md
- name: sendfrom
Expand All @@ -119,8 +123,85 @@
href: node/cli/latest-version/api/sendtoaddress.md
- name: sendmany
href: node/cli/latest-version/api/sendmany.md
- name: submitblock
href: node/cli/latest-version/api/submitblock.md
- name: validateaddress
href: node/cli/latest-version/api/validateaddress.md
- name: v2.10.0
href: node/cli/2.10.0/api.md
items:
- name: claimgas
href: node/cli/2.10.0/api/claimgas.md
- name: dumpprivkey
href: node/cli/2.10.0/api/dumpprivkey.md
- name: getaccountstate
href: node/cli/2.10.0/api/getaccountstate.md
- name: getassetstate
href: node/cli/2.10.0/api/getassetstate.md
- name: getbalance
href: node/cli/2.10.0/api/getbalance.md
- name: getbestblockhash
href: node/cli/2.10.0/api/getbestblockhash.md
- name: getblock
href: node/cli/2.10.0/api/getblock.md
- name: getblock
href: node/cli/2.10.0/api/getblock2.md
- name: getblockcount
href: node/cli/2.10.0/api/getblockcount.md
- name: getblockheader
href: node/cli/2.10.0/api/getblockheader.md
- name: getblockhash
href: node/cli/2.10.0/api/getblockhash.md
- name: getblocksysfee
href: node/cli/2.10.0/api/getblocksysfee.md
- name: getconnectioncount
href: node/cli/2.10.0/api/getconnectioncount.md
- name: getcontractstate
href: node/cli/2.10.0/api/getcontractstate.md
- name: getnewaddress
href: node/cli/2.10.0/api/getnewaddress.md
- name: getrawmempool
href: node/cli/2.10.0/api/getrawmempool.md
- name: getrawtransaction
href: node/cli/2.10.0/api/getrawtransaction.md
- name: getstorage
href: node/cli/2.10.0/api/getstorage.md
- name: gettransactionheight
href: node/cli/2.10.0/api/gettransactionheight.md
- name: gettxout
href: node/cli/2.10.0/api/gettxout.md
- name: getpeers
href: node/cli/2.10.0/api/getpeers.md
- name: getunclaimedgas
href: node/cli/2.10.0/api/getunclaimedgas.md
- name: getvalidators
href: node/cli/2.10.0/api/getvalidators.md
- name: getversion
href: node/cli/2.10.0/api/getversion.md
- name: getwalletheight
href: node/cli/2.10.0/api/getwalletheight.md
- name: importkey
href: node/cli/2.10.0/api/importkey.md
- name: invoke
href: node/cli/2.10.0/api/invoke.md
- name: invokefunction
href: node/cli/2.10.0/api/invokefunction.md
- name: invokescript
href: node/cli/2.10.0/api/invokescript.md
- name: listaddress
href: node/cli/2.10.0/api/listaddress.md
- name: sendfrom
href: node/cli/2.10.0/api/sendfrom.md
- name: sendrawtransaction
href: node/cli/2.10.0/api/sendrawtransaction.md
- name: sendtoaddress
href: node/cli/2.10.0/api/sendtoaddress.md
- name: sendmany
href: node/cli/2.10.0/api/sendmany.md
- name: submitblock
href: node/cli/2.10.0/api/submitblock.md
- name: validateaddress
href: node/cli/2.10.0/api/validateaddress.md
- name: v2.9.0+
href: node/cli/2.9.4/api.md
items:
Expand Down
Loading

0 comments on commit bfd14ec

Please sign in to comment.