Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions apps/hermes/client/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ By default, these updates are returned as binary data and is serialized as eithe

### Examples

The [HermesClient](./src/examples/HermesClient.ts) example demonstrates both the examples above.
You can run it with `npm run example`.
A full command that prints BTC and ETH price feeds, in the testnet network, looks like so:
The [HermesClient](./src/examples/HermesClient.ts) example demonstrates both the
examples above. To run the example:

1. Clone [the Pyth monorepo](https://github.com/pyth-network/pyth-crosschain)
2. In the root of the monorepo, run `pnpm example:hermes-client -- <args>`. For
example, to print BTC and ETH price feeds in the testnet network, run:

```bash
npm run example -- \
pnpm example:hermes-client -- \
--endpoint https://hermes.pyth.network \
--price-ids \
0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 \
Expand Down
2 changes: 1 addition & 1 deletion apps/hermes/client/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build:typescript": "tsc",
"build:schemas": "openapi-zod-client ./schema.json --output src/zodSchemas.ts",
"pull:schema": "curl -o schema.json -z schema.json https://hermes.pyth.network/docs/openapi.json",
"example": "pnpm run build && node lib/examples/HermesClient.js",
"example": "node lib/examples/HermesClient.js",
"format": "prettier --write \"src/**/*.ts\"",
"test:lint": "eslint src/",
"prepublishOnly": "pnpm run build && pnpm run test:lint",
Expand Down
4 changes: 4 additions & 0 deletions apps/hermes/client/js/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"build": {
"dependsOn": ["build:typescript", "build:schemas"]
},
"example": {
"dependsOn": ["build"],
"cache": false
},
"pull:schema": {
"outputs": ["schema.json"],
"cache": false
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"pnpm": "^9.12.1"
},
"scripts": {
"example:hermes-client": "pnpm i && turbo example --filter @pythnetwork/hermes-client --ui stream",
"fix": "pnpm i && turbo fix",
"start:dev": "pnpm i && turbo start:dev",
"start:prod": "pnpm i && turbo start:prod",
Expand Down
Loading