@pythnetwork/client
Advanced tools
Comparing version 2.8.0 to 2.9.0
# Changelog | ||
## 2.9.0 | ||
- Add Anchor client | ||
## 2.8.0 | ||
@@ -4,0 +6,0 @@ - Added `onPriceChangeVerbose` callback to `PythConnection` to support getting account keys and slots on each price update. |
@@ -42,5 +42,5 @@ "use strict"; | ||
var _1 = require("."); | ||
var SOLANA_CLUSTER_NAME = 'mainnet-beta'; | ||
var connection = new web3_js_1.Connection(cluster_1.getPythClusterApiUrl(SOLANA_CLUSTER_NAME)); | ||
var pythPublicKey = cluster_1.getPythProgramKeyForCluster(SOLANA_CLUSTER_NAME); | ||
var PYTHNET_CLUSTER_NAME = 'pythnet'; | ||
var connection = new web3_js_1.Connection(cluster_1.getPythClusterApiUrl(PYTHNET_CLUSTER_NAME)); | ||
var pythPublicKey = cluster_1.getPythProgramKeyForCluster(PYTHNET_CLUSTER_NAME); | ||
function runQuery() { | ||
@@ -47,0 +47,0 @@ return __awaiter(this, void 0, void 0, function () { |
@@ -7,5 +7,5 @@ "use strict"; | ||
var _1 = require("."); | ||
var SOLANA_CLUSTER_NAME = 'devnet'; | ||
var connection = new web3_js_1.Connection(cluster_1.getPythClusterApiUrl(SOLANA_CLUSTER_NAME)); | ||
var pythPublicKey = cluster_1.getPythProgramKeyForCluster(SOLANA_CLUSTER_NAME); | ||
var PYTHNET_CLUSTER_NAME = 'pythnet'; | ||
var connection = new web3_js_1.Connection(cluster_1.getPythClusterApiUrl(PYTHNET_CLUSTER_NAME)); | ||
var pythPublicKey = cluster_1.getPythProgramKeyForCluster(PYTHNET_CLUSTER_NAME); | ||
var pythConnection = new PythConnection_1.PythConnection(connection, pythPublicKey); | ||
@@ -17,3 +17,3 @@ pythConnection.onPriceChangeVerbose(function (productAccount, priceAccount) { | ||
// sample output: | ||
// SRM/USD: $8.68725 ±$0.0131 | ||
// SOL/USD: $14.627930000000001 ±$0.01551797 | ||
if (price.price && price.confidence) { | ||
@@ -20,0 +20,0 @@ // tslint:disable-next-line:no-console |
@@ -112,1 +112,2 @@ /// <reference types="node" /> | ||
export { getPythProgramKeyForCluster } from './cluster'; | ||
export { pythOracleProgram, PythOracleCoder } from './anchor'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPythProgramKeyForCluster = exports.PythHttpClient = exports.PythConnection = exports.parsePriceData = exports.parseProductData = exports.parseMappingData = exports.parseBaseData = exports.AccountType = exports.DeriveType = exports.PriceType = exports.CorpAction = exports.PriceStatus = exports.MAX_SLOT_DIFFERENCE = exports.Version = exports.Version2 = exports.Magic = void 0; | ||
exports.PythOracleCoder = exports.pythOracleProgram = exports.getPythProgramKeyForCluster = exports.PythHttpClient = exports.PythConnection = exports.parsePriceData = exports.parseProductData = exports.parseMappingData = exports.parseBaseData = exports.AccountType = exports.DeriveType = exports.PriceType = exports.CorpAction = exports.PriceStatus = exports.MAX_SLOT_DIFFERENCE = exports.Version = exports.Version2 = exports.Magic = void 0; | ||
var web3_js_1 = require("@solana/web3.js"); | ||
@@ -285,1 +285,4 @@ var buffer_1 = require("buffer"); | ||
Object.defineProperty(exports, "getPythProgramKeyForCluster", { enumerable: true, get: function () { return cluster_1.getPythProgramKeyForCluster; } }); | ||
var anchor_1 = require("./anchor"); | ||
Object.defineProperty(exports, "pythOracleProgram", { enumerable: true, get: function () { return anchor_1.pythOracleProgram; } }); | ||
Object.defineProperty(exports, "PythOracleCoder", { enumerable: true, get: function () { return anchor_1.PythOracleCoder; } }); |
{ | ||
"name": "@pythnetwork/client", | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"description": "Client for consuming Pyth price data", | ||
@@ -32,4 +32,7 @@ "homepage": "https://pyth.network", | ||
"devDependencies": { | ||
"@coral-xyz/anchor": "^0.26.0", | ||
"@solana/web3.js": "^1.30.2", | ||
"@types/jest": "^26.0.23", | ||
"@types/bn.js": "^5.1.1", | ||
"@types/bs58": "^4.0.1", | ||
"@types/jest": "^27.0.7", | ||
"@types/node-fetch": "^2.6.2", | ||
@@ -47,4 +50,5 @@ "jest": "^27.3.1", | ||
"peerDependencies": { | ||
"@coral-xyz/anchor": "^0.26.0", | ||
"@solana/web3.js": "^1.30.2" | ||
} | ||
} |
115039
37
2493
3
12