File tree 2 files changed +17
-13
lines changed
2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ node_modules
2
2
/dist /
3
3
.eslintcache
4
4
.nyc_output
5
+ .idea
5
6
6
7
.vscode
7
8
Original file line number Diff line number Diff line change @@ -20,24 +20,27 @@ Here is an example of parsing CES events using `ces-js-parser` from a real Testn
20
20
``` typescript
21
21
import { CasperServiceByJsonRPC } from ' casper-js-sdk' ;
22
22
import { Parser } from ' @make-software/ces-js-parser' ;
23
+ import { ExecutionResult } from " ./casper/types" ;
23
24
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
+ );
27
29
28
- const parser = await Parser .create (rpcClient , [
29
- ' 0640eb43bd95d5c88b799862bc9fb42d7a241f1a8aae5deaa03170a27ee8eeaa'
30
- ]);
30
+ const parser = await Parser .create (rpcClient , [
31
+ ' 0640eb43bd95d5c88b799862bc9fb42d7a241f1a8aae5deaa03170a27ee8eeaa'
32
+ ]);
31
33
32
- const deploy = await rpcClient .getDeployInfo (
33
- ' c1bb9ae27877f5ecf4ef71307e7ee3c403bcace065565c3645b81ec0a9bc8978'
34
- );
34
+ const deploy = await rpcClient .getDeployInfo (
35
+ ' c1bb9ae27877f5ecf4ef71307e7ee3c403bcace065565c3645b81ec0a9bc8978'
36
+ );
35
37
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
+ );
39
41
40
- events .forEach (console .log );
42
+ events .forEach (console .log );
43
+ })()
41
44
```
42
45
43
46
## API
You can’t perform that action at this time.
0 commit comments