Skip to content

feat!: Upgrade to casper-js-sdk 5.x #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@ The library is built on top of the [casper-js-sdk](https://github.com/casper-eco
Here is an example of parsing CES events using `ces-js-parser` from a real Testnet deploy loaded with `casper-js-sdk`:

```typescript
import { CasperServiceByJsonRPC } from 'casper-js-sdk';
import { HttpHandler, RpcClient } from 'casper-js-sdk';
import { Parser } from '@make-software/ces-js-parser';
import { ExecutionResult } from "./casper/types";

(async() => {
const rpcClient = new CasperServiceByJsonRPC(
`http://${process.env.NODE_ADDRESS}:7777/rpc`
const rpcHandler = new HttpHandler('http://${process.env.NODE_ADDRESS}:7777/rpc');

const rpcClient = new RpcClient(rpcHandler);

const transaction = await rpcClient.getTransactionByDeployHash(
'c1bb9ae27877f5ecf4ef71307e7ee3c403bcace065565c3645b81ec0a9bc8978'
);

const parser = await Parser.create(rpcClient, [
'0640eb43bd95d5c88b799862bc9fb42d7a241f1a8aae5deaa03170a27ee8eeaa'
]);

const deploy = await rpcClient.getDeployInfo(
'c1bb9ae27877f5ecf4ef71307e7ee3c403bcace065565c3645b81ec0a9bc8978'
);

const events = parser.parseExecutionResult(
deploy.execution_results[0].result as ExecutionResult
);
Expand Down Expand Up @@ -82,12 +81,12 @@ Parser that accepts a list of observed contracts and provides possibility to par
**Example**

```typescript
import { CasperServiceByJsonRPC } from 'casper-js-sdk';
import { HttpHandler, RpcClient } from 'casper-js-sdk';
import { Parser } from '@make-software/ces-js-parser';

const rpcClient = new CasperServiceByJsonRPC(
`http://${process.env.NODE_ADDRESS}:7777/rpc`
);
const rpcHandler = new HttpHandler('http://${process.env.NODE_ADDRESS}:7777/rpc');

const rpcClient = new RpcClient(rpcHandler);

const parser = await Parser.create(rpcClient, [
'214a0e730e14501d1e3e03504d3a2f940ef32830b13fa47f9d85a40f73b78161'
Expand Down
Loading
Loading