Skip to content

Commit

Permalink
docs: sdk example
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed May 26, 2023
1 parent ba39926 commit 961e0fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vea-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ npm install @kleros/vea-sdk
```typescript
import { Wallet } from "@ethersproject/wallet";
import VeaSdk from "../src/index";
import envVar from "../src/utils/envVar";

// Create the Vea client
const vea = VeaSdk.ClientFactory.arbitrumGoerliToChiadoDevnet(envVar("RPC_ARB_GOERLI"), envVar("RPC_CHIADO"));
const vea = VeaSdk.ClientFactory.arbitrumGoerliToChiadoDevnet(
"https://rpc.goerli.eth.gateway.fm",
"https://rpc.chiado.gnosis.gateway.fm"
);

// Get the message info
const messageId = 42;
const messageInfo = await vea.getMessageInfo(messageId);

// Relay the message
const privateKey = envVar("PRIVATE_KEY");
const privateKey = process.env["PRIVATE_KEY"] ?? "";
const wallet = new Wallet(privateKey, vea.outboxProvider);
await vea.relay(messageInfo, wallet);
```

0 comments on commit 961e0fe

Please sign in to comment.