-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
``` |