@pythnetwork/client
Advanced tools
Comparing version 2.22.0 to 2.22.1
@@ -96,5 +96,5 @@ "use strict"; | ||
var key = _a[_i]; | ||
offset += buffer.subarray(offset).writeUInt8(key.length); | ||
offset += buffer.subarray(offset).writeUInt8(buffer_1.Buffer.byteLength(key)); | ||
offset += buffer.subarray(offset).write(key); | ||
offset += buffer.subarray(offset).writeUInt8(ix.productMetadata[key].length); | ||
offset += buffer.subarray(offset).writeUInt8(buffer_1.Buffer.byteLength(ix.productMetadata[key])); | ||
offset += buffer.subarray(offset).write(ix.productMetadata[key]); | ||
@@ -101,0 +101,0 @@ } |
{ | ||
"name": "@pythnetwork/client", | ||
"version": "2.22.0", | ||
"version": "2.22.1", | ||
"description": "Client for consuming Pyth price data", | ||
@@ -5,0 +5,0 @@ "homepage": "https://pyth.network", |
# @pythnetwork/client | ||
## A library for reading on-chain Pyth oracle data | ||
## A library for reading Pyth accounts on Pythnet | ||
[Pyth](https://pyth.network/) is building a way to deliver a decentralized, cross-chain market of verifiable data from high-quality nodes to any smart contract, anywhere. | ||
This library reads on-chain Pyth data from [@solana/web3.js](https://www.npmjs.com/package/@solana/web3.js) and returns JavaScript-friendly objects. | ||
This library reads Pythnet (Pyth's app-specific SVM blockchain) data using [@solana/web3.js](https://www.npmjs.com/package/@solana/web3.js) and returns JavaScript-friendly objects. | ||
> ⚠️ **Important Warning**: For most use cases, it is recommended and more user-friendly to use Pyth's off-chain API ([Hermes](https://hermes.pyth.network/docs/)) via the [@pythnetwork/hermes-client](https://www.npmjs.com/package/@pythnetwork/hermes-client) package to get the most up-to-date Pyth prices. Using `@pythnetwork/client` requires a Pythnet RPC connection and exposes many low-level details. | ||
## Installation | ||
@@ -32,3 +34,3 @@ | ||
```typescript | ||
const pythConnection = new PythConnection(solanaWeb3Connection, getPythProgramKeyForCluster(solanaClusterName)) | ||
const pythConnection = new PythConnection(pythnetWeb3Connection, getPythProgramKeyForCluster(pythnetClusterName)) | ||
pythConnection.onPriceChange((product, price) => { | ||
@@ -35,0 +37,0 @@ // sample output: |
141523
83