diff --git a/apps/hermes/client/js/README.md b/apps/hermes/client/js/README.md index f16ce9a851..eebdb3f5f0 100644 --- a/apps/hermes/client/js/README.md +++ b/apps/hermes/client/js/README.md @@ -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 -- `. 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 \ diff --git a/apps/hermes/client/js/package.json b/apps/hermes/client/js/package.json index 96b6f80fd4..6bcaf9daa9 100644 --- a/apps/hermes/client/js/package.json +++ b/apps/hermes/client/js/package.json @@ -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", diff --git a/apps/hermes/client/js/turbo.json b/apps/hermes/client/js/turbo.json index d8ff9714e9..098d3b7133 100644 --- a/apps/hermes/client/js/turbo.json +++ b/apps/hermes/client/js/turbo.json @@ -14,6 +14,10 @@ "build": { "dependsOn": ["build:typescript", "build:schemas"] }, + "example": { + "dependsOn": ["build"], + "cache": false + }, "pull:schema": { "outputs": ["schema.json"], "cache": false diff --git a/package.json b/package.json index 794096157a..2f82f2a9a7 100644 --- a/package.json +++ b/package.json @@ -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",