Skip to content

Commit

Permalink
Update json-rpc.md (#64)
Browse files Browse the repository at this point in the history
* Update json-rpc.md

* fix lint

* Update json-rpc.md
  • Loading branch information
alidevjimmy authored Nov 22, 2024
1 parent cc34d53 commit 4a12e3a
Showing 1 changed file with 97 additions and 104 deletions.
201 changes: 97 additions & 104 deletions content/api/json-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ title: JSON-RPC API Reference
weight: 2
---

Each node in the Pactus network can be configured to use the [JSON-RPC](https://www.jsonrpc.org/specification)
protocol for communication.
Each node in the Pactus network can be configured
to use the [JSON-RPC](https://www.jsonrpc.org/specification)
protocol for communication.
Here, you can find the list of all JSON-RPC methods and messages.

All the amounts and values in JSON-RPC endpoints are in NanoPAC units,
Expand Down Expand Up @@ -79,10 +80,6 @@ curl --location 'http://localhost:8545/' \
<a href="#pactus.transaction.broadcast_transaction">
<span class="rpc-badge"></span> pactus.transaction.broadcast_transaction</a>
</li>
<li>
<a href="#pactus.transaction.get_raw_transaction">
<span class="rpc-badge"></span> pactus.transaction.get_raw_transaction</a>
</li>
<li>
<a href="#pactus.transaction.get_raw_transfer_transaction">
<span class="rpc-badge"></span> pactus.transaction.get_raw_transfer_transaction</a>
Expand Down Expand Up @@ -171,6 +168,14 @@ curl --location 'http://localhost:8545/' \
<a href="#pactus.utils.verify_message">
<span class="rpc-badge"></span> pactus.utils.verify_message</a>
</li>
<li>
<a href="#pactus.utils.b_l_s_public_key_aggregation">
<span class="rpc-badge"></span> pactus.utils.b_l_s_public_key_aggregation</a>
</li>
<li>
<a href="#pactus.utils.b_l_s_signature_aggregation">
<span class="rpc-badge"></span> pactus.utils.b_l_s_signature_aggregation</a>
</li>
</ul>
</li>
<li> Wallet Service
Expand Down Expand Up @@ -622,96 +627,9 @@ and payload type.</p>
</tbody>
</table>

### pactus.transaction.get_raw_transaction <span id="pactus.transaction.get_raw_transaction" class="rpc-badge"></span>

<p>GetRawTransaction retrieves raw details of transfer, bond, unbond or withdraw transaction.</p>

<h4>Parameters</h4>

<table class="table table-bordered table-responsive table-sm">
<thead>
<tr><td>Field</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td class="fw-bold">lock_time</td>
<td> numeric</td>
<td>
The lock time for the transaction. If not set, defaults to the last block height.
</td>
</tr>
<tr>
<td class="fw-bold">memo</td>
<td> string</td>
<td>
A memo string for the transaction.
</td>
</tr>
<tr>
<td class="fw-bold">fee</td>
<td> numeric</td>
<td>
The fee for the transaction in NanoPAC.
</td>
</tr>
<tr>
<td class="fw-bold">transfer</td>
<td> object</td>
<td>
(OneOf)
</td>
</tr>
<tr>
<td class="fw-bold">bond</td>
<td> object</td>
<td>
(OneOf)
</td>
</tr>
<tr>
<td class="fw-bold">unbond</td>
<td> object</td>
<td>
(OneOf)
</td>
</tr>
<tr>
<td class="fw-bold">withdraw</td>
<td> object</td>
<td>
(OneOf)
</td>
</tr>
</tbody>
</table>
<h4>Result</h4>

<table class="table table-bordered table-responsive table-sm">
<thead>
<tr><td>Field</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td class="fw-bold">raw_transaction</td>
<td> string</td>
<td>
The raw transaction data.
</td>
</tr>
<tr>
<td class="fw-bold">id</td>
<td> string</td>
<td>
The unique ID of the transaction.
</td>
</tr>
</tbody>
</table>

### pactus.transaction.get_raw_transfer_transaction <span id="pactus.transaction.get_raw_transfer_transaction" class="rpc-badge"></span>

<p>Deprecated: GetRawTransferTransaction retrieves raw details of a transfer transaction.
Use GetRawTransaction instead.</p>
<p>GetRawTransferTransaction retrieves raw details of a transfer transaction.</p>

<h4>Parameters</h4>

Expand Down Expand Up @@ -791,8 +709,7 @@ height.

### pactus.transaction.get_raw_bond_transaction <span id="pactus.transaction.get_raw_bond_transaction" class="rpc-badge"></span>

<p>Deprecated: GetRawBondTransaction retrieves raw details of a bond transaction.
Use GetRawTransaction instead.</p>
<p>GetRawBondTransaction retrieves raw details of a bond transaction.</p>

<h4>Parameters</h4>

Expand Down Expand Up @@ -879,8 +796,7 @@ height.

### pactus.transaction.get_raw_unbond_transaction <span id="pactus.transaction.get_raw_unbond_transaction" class="rpc-badge"></span>

<p>Deprecated: GetRawUnbondTransaction retrieves raw details of an unbond transaction.
Use GetRawTransaction instead.</p>
<p>GetRawUnbondTransaction retrieves raw details of an unbond transaction.</p>

<h4>Parameters</h4>

Expand Down Expand Up @@ -939,8 +855,7 @@ height.

### pactus.transaction.get_raw_withdraw_transaction <span id="pactus.transaction.get_raw_withdraw_transaction" class="rpc-badge"></span>

<p>Deprecated: GetRawWithdrawTransaction retrieves raw details of a withdraw transaction.
Use GetRawTransaction instead.</p>
<p>GetRawWithdrawTransaction retrieves raw details of a withdraw transaction.</p>

<h4>Parameters</h4>

Expand Down Expand Up @@ -2779,7 +2694,7 @@ signing and verification.</p>

### pactus.utils.sign_message_with_private_key <span id="pactus.utils.sign_message_with_private_key" class="rpc-badge"></span>

<p>SignMessageWithPrivateKey sign message with provided private key.</p>
<p>SignMessageWithPrivateKey signs message with provided private key.</p>

<h4>Parameters</h4>

Expand Down Expand Up @@ -2823,7 +2738,7 @@ signing and verification.</p>

### pactus.utils.verify_message <span id="pactus.utils.verify_message" class="rpc-badge"></span>

<p>VerifyMessage verify signature with public key and message</p>
<p>VerifyMessage verifies signature with public key and message.</p>

<h4>Parameters</h4>

Expand Down Expand Up @@ -2872,6 +2787,80 @@ signing and verification.</p>
</tbody>
</table>

### pactus.utils.b_l_s_public_key_aggregation <span id="pactus.utils.b_l_s_public_key_aggregation" class="rpc-badge"></span>

<p>BLSPublicKeyAggregation aggregates bls public keys.</p>

<h4>Parameters</h4>

<table class="table table-bordered table-responsive table-sm">
<thead>
<tr><td>Field</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td class="fw-bold">public_keys</td>
<td>repeated string</td>
<td>
The public keys to aggregate.
</td>
</tr>
</tbody>
</table>
<h4>Result</h4>

<table class="table table-bordered table-responsive table-sm">
<thead>
<tr><td>Field</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td class="fw-bold">public_key</td>
<td> string</td>
<td>
The aggregated public key.
</td>
</tr>
</tbody>
</table>

### pactus.utils.b_l_s_signature_aggregation <span id="pactus.utils.b_l_s_signature_aggregation" class="rpc-badge"></span>

<p>BLSSignatureAggregation aggregates bls signatures.</p>

<h4>Parameters</h4>

<table class="table table-bordered table-responsive table-sm">
<thead>
<tr><td>Field</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td class="fw-bold">signatures</td>
<td>repeated string</td>
<td>
The signatures to aggregate.
</td>
</tr>
</tbody>
</table>
<h4>Result</h4>

<table class="table table-bordered table-responsive table-sm">
<thead>
<tr><td>Field</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td class="fw-bold">signature</td>
<td> string</td>
<td>
The aggregated signature.
</td>
</tr>
</tbody>
</table>

## Wallet Service

<p>Define the Wallet service with various RPC methods for wallet management.</p>
Expand Down Expand Up @@ -3453,12 +3442,16 @@ Note: Generating a new Ed25519 address requires the wallet password.)</li>
<tr>
<td class="fw-bold">total_stake</td>
<td> numeric</td>
<td></td>
<td>

</td>
</tr>
<tr>
<td class="fw-bold">wallet_name</td>
<td> string</td>
<td></td>
<td>

</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 4a12e3a

Please sign in to comment.