From c513c04d0f6222630f2454e93f1386eff29383d2 Mon Sep 17 00:00:00 2001 From: Dmytro Vynnyk Date: Wed, 20 Nov 2024 17:21:13 +0100 Subject: [PATCH] Fix doc links --- src/rpc/{README.MD => README.md} | 38 +++++++++----------------------- 1 file changed, 11 insertions(+), 27 deletions(-) rename src/rpc/{README.MD => README.md} (89%) diff --git a/src/rpc/README.MD b/src/rpc/README.md similarity index 89% rename from src/rpc/README.MD rename to src/rpc/README.md index 2042309a7..5847aa3c9 100644 --- a/src/rpc/README.MD +++ b/src/rpc/README.md @@ -1,27 +1,24 @@ # RPC -Provides access to the exported methods of RPC Client and data structures where serialized response. -The `RpcClient` implements RPC methods according to [spec](https://docs.casperlabs.io/developers/json-rpc/json-rpc-informational/). -`RpcClient` unites implementation of `ClientInformational` interface related to [spec](https://docs.casperlabs.io/developers/json-rpc/json-rpc-informational/) and `ClientPOS` interface related to [spec](https://docs.casperlabs.io/developers/json-rpc/json-rpc-pos/). +Provides access to the exported methods of RPC Client and data structures where serialized response. +The `RpcClient` implements RPC methods according to [spec](https://docs.casperlabs.io/developers/json-rpc/json-rpc-informational/). `RpcClient` unites implementation of `ClientInformational` interface related to [spec](https://docs.casperlabs.io/developers/json-rpc/json-rpc-informational/) and `ClientPOS` interface related to [spec](https://docs.casperlabs.io/developers/json-rpc/json-rpc-pos/). ## Usage The configuration is flexible, and caller can provide custom configurations, the most common usage is to create `RpcClient` which depends on `HttpHandler` interface. + ```ts import { HttpHandler, RpcClient } from 'casper-js-sdk'; const rpcHandler = new HttpHandler('http://:7777/rpc'); const rpcCient = new RpcClient(rpcHandler); -const deployHash = '3facbc4133e722c5c5630b6ad2331383ba849ef719da582cc026e9dd85e72ac9'; ``` - ## Methods The `RpcClient` combines the functionalities of `ClientPOS`, `ClientInformational`, and `ClientTransactional`. - ### [`ClientPOS`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/client.ts#L40) The `ClientPOS` interface includes methods related to the Proof-of-Stake functionality of the Casper network. @@ -30,37 +27,30 @@ The `ClientPOS` interface includes methods related to the Proof-of-Stake functio Returns the latest auction information. **Returns:** [`StateGetAuctionInfoResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L55) - -- **`getAuctionInfoByHash(blockHash: string)`** +* **`getAuctionInfoByHash(blockHash: string)`** Retrieves auction information for a specific block by hash. **Returns:** [`StateGetAuctionInfoResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L55) - - **`getAuctionInfoByHeight(height: number)`** Retrieves auction information for a specific block by height. **Returns:** [`StateGetAuctionInfoResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L55) - -- **`getEraInfoLatest()`** +* **`getEraInfoLatest()`** Fetches the latest era information. **Returns:** [`ChainGetEraInfoResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L433) - - **`getEraInfoByBlockHeight(height: number)`** Fetches era information for a specific block by height. **Returns:** [`ChainGetEraInfoResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L433) - -- **`getEraInfoByBlockHash(hash: string)`** +* **`getEraInfoByBlockHash(hash: string)`** Fetches era information for a specific block by hash. **Returns:** [`ChainGetEraInfoResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L433) - - **`getValidatorChangesInfo()`** Retrieves validator status changes during an era. **Returns:** [`InfoGetValidatorChangesResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L572) - ### [`ClientInformational`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/client.ts#L52) The `ClientInformational` interface provides methods for querying node-specific and network-wide information. @@ -71,8 +61,7 @@ The `ClientInformational` interface provides methods for querying node-specific Retrieves the latest balance for a given purse. **Returns:** [`StateGetBalanceResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L66) - -- **`getBalanceByStateRootHash(purseURef: string, stateRootHash: string)`** +* **`getBalanceByStateRootHash(purseURef: string, stateRootHash: string)`** Retrieves the balance for a specific state root hash. **Returns:** [`StateGetBalanceResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L66) @@ -82,8 +71,7 @@ The `ClientInformational` interface provides methods for querying node-specific Retrieves a deploy by its hash. **Returns:** [`InfoGetDeployResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L223) - -- **`getDeployFinalizedApproval(hash: string)`** +* **`getDeployFinalizedApproval(hash: string)`** Retrieves a deploy with finalized approvals. **Returns:** [`InfoGetDeployResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L223) @@ -93,8 +81,7 @@ The `ClientInformational` interface provides methods for querying node-specific Retrieves a transaction by its hash. **Returns:** [`InfoGetTransactionResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L253) - -- **`getTransactionByDeployHash(deployHash: string)`** +* **`getTransactionByDeployHash(deployHash: string)`** Retrieves a transaction by its deploy hash. **Returns:** [`InfoGetTransactionResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L253) @@ -104,8 +91,7 @@ The `ClientInformational` interface provides methods for querying node-specific Retrieves an item from a dictionary. **Returns:** [`StateGetDictionaryResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L455) - -- **`getDictionaryItemByIdentifier(stateRootHash: string | null, identifier: ParamDictionaryIdentifier)`** +* **`getDictionaryItemByIdentifier(stateRootHash: string | null, identifier: ParamDictionaryIdentifier)`** Retrieves an item using a dictionary identifier. **Returns:** [`StateGetDictionaryResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L455) @@ -139,7 +125,6 @@ The `ClientInformational` interface provides methods for querying node-specific Fetches the node's current status. **Returns:** [`InfoGetStatusResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L583) - ### [`ClientTransactional`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/client.ts#L227) The `ClientTransactional` interface provides methods for deploying transactions to the network. @@ -148,7 +133,6 @@ The `ClientTransactional` interface provides methods for deploying transactions Sends a deploy to the network. **Returns:** [`PutDeployResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L685) - -- **`putTransactionV1(transaction: TransactionV1)`** +* **`putTransactionV1(transaction: TransactionV1)`** Sends a transaction (v1) to the network. **Returns:** [`PutTransactionResult`](https://github.com/casper-ecosystem/casper-js-sdk/blob/573b563d0bc038e46b07f12789286d336536f8c9/src/rpc/response.ts#L707)