Skip to content

Commit

Permalink
Fix doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
Comp0te committed Nov 20, 2024
1 parent 42b6abe commit c513c04
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions src/rpc/README.MD → src/rpc/README.md
Original file line number Diff line number Diff line change
@@ -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://<Node Address>: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.
Expand All @@ -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.
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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.
Expand All @@ -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)

0 comments on commit c513c04

Please sign in to comment.