@pythnetwork/client
Advanced tools
Comparing version 1.0.2 to 1.0.3
# Changelog | ||
## 1.0.3 | ||
### Fixed | ||
Do not rely on Buffer's readBig(U)Int64LE | ||
## 1.0.2 | ||
@@ -4,0 +10,0 @@ |
@@ -16,2 +16,3 @@ "use strict"; | ||
var buffer_1 = require("buffer"); | ||
var read_bigint_1 = require("read-bigint"); | ||
var web3_js_1 = require("@solana/web3.js"); | ||
@@ -93,6 +94,6 @@ exports.Magic = 0xa1b2c3d4; | ||
// aggregate price | ||
var priceComponent = data.readBigInt64LE(0); | ||
var priceComponent = read_bigint_1.readBigInt64LE(data, 0); | ||
var price = Number(priceComponent) * Math.pow(10, exponent); | ||
// aggregate confidence | ||
var confidenceComponent = data.readBigUInt64LE(8); | ||
var confidenceComponent = read_bigint_1.readBigUInt64LE(data, 8); | ||
var confidence = Number(confidenceComponent) * Math.pow(10, exponent); | ||
@@ -104,3 +105,3 @@ // aggregate status | ||
// aggregate publish slot | ||
var publishSlot = data.readBigUInt64LE(24); | ||
var publishSlot = read_bigint_1.readBigUInt64LE(data, 24); | ||
return { | ||
@@ -134,5 +135,5 @@ priceComponent: priceComponent, | ||
// currently accumulating price slot | ||
var currentSlot = data.readBigUInt64LE(32); | ||
var currentSlot = read_bigint_1.readBigUInt64LE(data, 32); | ||
// valid on-chain slot of aggregate price | ||
var validSlot = data.readBigUInt64LE(40); | ||
var validSlot = read_bigint_1.readBigUInt64LE(data, 40); | ||
// product id / reference account | ||
@@ -139,0 +140,0 @@ var productAccountKey = new web3_js_1.PublicKey(data.slice(48, 80)); |
{ | ||
"name": "@pythnetwork/client", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Pyth price oracle data structures", | ||
@@ -41,4 +41,5 @@ "homepage": "https://pyth.network", | ||
"assert": "^2.0.0", | ||
"buffer": "^6.0.1" | ||
"buffer": "^6.0.1", | ||
"read-bigint": "^0.1.6" | ||
} | ||
} |
22886
243
4
+ Addedread-bigint@^0.1.6
+ Addedread-bigint@0.1.7(transitive)