Skip to content

Commit

Permalink
chore: updated README file
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr-Kuchinskyi committed Dec 18, 2024
1 parent c18db24 commit 8dc0d5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
/dist/
.eslintcache
.nyc_output
.idea

.vscode

Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,27 @@ Here is an example of parsing CES events using `ces-js-parser` from a real Testn
```typescript
import { CasperServiceByJsonRPC } from 'casper-js-sdk';
import { Parser } from '@make-software/ces-js-parser';
import { ExecutionResult } from "./casper/types";

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

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

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

const events = await parser.parseExecutionResult(
deploy.execution_results[0].result as ExecutionResult
);
const events = parser.parseExecutionResult(
deploy.execution_results[0].result as ExecutionResult
);

events.forEach(console.log);
events.forEach(console.log);
})()
```

## API
Expand Down

0 comments on commit 8dc0d5c

Please sign in to comment.