Skip to content

Commit

Permalink
docs: add usage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dexturr committed May 22, 2024
1 parent 30b085d commit 07b2034
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# Rest clients

WIP project that autogenerates types and clients for interacting with the Vega REST APIs

## Usage

Install the client you wish to use:

```bash
npm i @vegaprotocol/rest-client
```

or

```bash
yarn add @vegaprotocol/rest-client
```

Then use it in your code:

```typescript
// Choose API you wish to access; BlockExplorer, Core, CoreState or TradingData
import { BlockExplorer } from "@vegaprotocol/rest-clients";

// Set the base URL of for the client you are connecting to.
BlockExplorer.OpenAPI.BASE = "node-url-here";
const service = BlockExplorer.BlockExplorerService;
service.blockExplorerListTransactions().then((markets) => {
console.log(markets);
});
```

0 comments on commit 07b2034

Please sign in to comment.