|
1 | 1 | # TRON Built-in Http Introduction
|
2 | 2 | ## hexString and base58check transcode demo
|
3 |
| -java: |
4 |
| -https://github.com/tronprotocol/wallet-cli/blob/master/src/main/java/org/tron/demo/TransactionSignDemo.java#L92 |
5 |
| -php: |
6 |
| -https://github.com/tronprotocol/Documentation/blob/master/TRX_CN/index.php |
| 3 | +JAVA: |
| 4 | +[https://github.com/tronprotocol/wallet-cli/blob/master/src/main/java/org/tron/demo/TransactionSignDemo.java#L92](https://github.com/tronprotocol/wallet-cli/blob/master/src/main/java/org/tron/demo/TransactionSignDemo.java#L92) |
| 5 | +PHP: |
| 6 | +[https://github.com/tronprotocol/Documentation/blob/master/TRX_CN/index.php](https://github.com/tronprotocol/Documentation/blob/master/TRX_CN/index.php) |
7 | 7 |
|
8 | 8 | **Since v3.6, parameter 'visible' is added, when 'visible' is set true, no need to transcode the relevant address and string. This parameter is valid for all api, including solidityNode api and FullNode api.**
|
9 | 9 |
|
10 | 10 | When 'visible' is set true, the format of the input address must be base58, input string must text string, so does the format of the output. If 'visible' is set false or null, the api acts the same as previous version. If the format of the parameters do not match with the set of visible, it will throw out an error.
|
11 | 11 |
|
12 |
| -Way to set the 'visible' parameter: |
13 |
| -1. For the api need no parameter: By adding 'visible' parameter in the url, like 127.0.0.1:8090/wallet/listexchanges?visible=true |
14 |
| -2. For POST method api: By adding 'visible' parameter to the most out layer of the json, like curl -X POST http://127.0.0.1:8090/wallet/createtransaction |
15 |
| -{"owner_address_":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", |
16 |
| -"to_address_":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW","amount":1000000,"visible":true} |
17 |
| -3. For GET method api: By adding 'visible' parameter in the url, as way 1 |
| 12 | +Way to set the 'visible' parameter: |
| 13 | + |
| 14 | +1. For the api need no parameter: by adding 'visible' parameter in the url |
| 15 | + |
| 16 | ++ example: |
| 17 | +```text |
| 18 | +http://127.0.0.1:8090/wallet/listexchanges?visible=true |
| 19 | +``` |
| 20 | +2. For POST method api: By adding 'visible' parameter to the most out layer of the json |
| 21 | + |
| 22 | ++ example: |
| 23 | +```text |
| 24 | +curl -X POST http://127.0.0.1:8090/wallet/createtransaction |
| 25 | +
|
| 26 | +{"owner_address_":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "to_address_":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW", "amount":1000000, "visible":true} |
| 27 | +``` |
| 28 | +3. For GET method api: By adding 'visible' parameter in the url, as way 1 |
18 | 29 |
|
19 | 30 |
|
20 | 31 | ## SolidityNode Api Introduction
|
21 | 32 |
|
22 |
| -solidityNode api's default http port is 8091, when solidityNode is started, http service will be started too. |
23 |
| -``` |
| 33 | +SolidityNode api's default http port is 8091, when solidityNode is started, http service will be started too. |
| 34 | +```text |
24 | 35 | /walletsolidity/getaccount
|
25 | 36 | Description: Query an account information
|
26 | 37 | demo: curl -X POST http://127.0.0.1:8091/walletsolidity/getaccount -d '{"address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0"}'
|
@@ -199,8 +210,7 @@ Return: Deferred transaction fee & block height
|
199 | 210 | ## FullNode Api Introduction
|
200 | 211 | FullNode api's default http port is 8090, when FullNode is started, http service will be started too.
|
201 | 212 |
|
202 |
| -``` |
203 |
| -
|
| 213 | +```text |
204 | 214 | wallet/createtransaction
|
205 | 215 | Description: Create a transfer transaction, if to address is not existed, then create the account on the blockchain
|
206 | 216 | demo: curl -X POST http://127.0.0.1:8090/wallet/createtransaction -d '{"to_address": "41e9d79cc47518930bc322d9bf7cddd260a0260a8d", "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292", "amount": 1000 }'
|
|
0 commit comments