Skip to content

Commit 8dc0d5c

Browse files
chore: updated README file
1 parent c18db24 commit 8dc0d5c

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node_modules
22
/dist/
33
.eslintcache
44
.nyc_output
5+
.idea
56

67
.vscode
78

Diff for: README.md

+16-13
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,27 @@ Here is an example of parsing CES events using `ces-js-parser` from a real Testn
2020
```typescript
2121
import { CasperServiceByJsonRPC } from 'casper-js-sdk';
2222
import { Parser } from '@make-software/ces-js-parser';
23+
import { ExecutionResult } from "./casper/types";
2324

24-
const rpcClient = new CasperServiceByJsonRPC(
25-
`http://${process.env.NODE_ADDRESS}:7777/rpc`
26-
);
25+
(async() => {
26+
const rpcClient = new CasperServiceByJsonRPC(
27+
`http://${process.env.NODE_ADDRESS}:7777/rpc`
28+
);
2729

28-
const parser = await Parser.create(rpcClient, [
29-
'0640eb43bd95d5c88b799862bc9fb42d7a241f1a8aae5deaa03170a27ee8eeaa'
30-
]);
30+
const parser = await Parser.create(rpcClient, [
31+
'0640eb43bd95d5c88b799862bc9fb42d7a241f1a8aae5deaa03170a27ee8eeaa'
32+
]);
3133

32-
const deploy = await rpcClient.getDeployInfo(
33-
'c1bb9ae27877f5ecf4ef71307e7ee3c403bcace065565c3645b81ec0a9bc8978'
34-
);
34+
const deploy = await rpcClient.getDeployInfo(
35+
'c1bb9ae27877f5ecf4ef71307e7ee3c403bcace065565c3645b81ec0a9bc8978'
36+
);
3537

36-
const events = await parser.parseExecutionResult(
37-
deploy.execution_results[0].result as ExecutionResult
38-
);
38+
const events = parser.parseExecutionResult(
39+
deploy.execution_results[0].result as ExecutionResult
40+
);
3941

40-
events.forEach(console.log);
42+
events.forEach(console.log);
43+
})()
4144
```
4245

4346
## API

0 commit comments

Comments
 (0)