@pythnetwork/client
Advanced tools
Comparing version 2.14.0 to 2.15.0
@@ -39,2 +39,3 @@ "use strict"; | ||
var idl_1 = require("./idl"); | ||
var MAX_METADATA_SIZE = 464; | ||
/** | ||
@@ -91,4 +92,4 @@ * Encodes and decodes program instructions. | ||
} | ||
/// updProduct has its own format | ||
if (methodName === 'updProduct') { | ||
/// updProduct and addProduct have their own format | ||
if (methodName === 'updProduct' || methodName === 'addProduct') { | ||
var offset = 0; | ||
@@ -102,3 +103,3 @@ for (var _i = 0, _a = Object.keys(ix.productMetadata); _i < _a.length; _i++) { | ||
} | ||
if (offset > 464) { | ||
if (offset > MAX_METADATA_SIZE) { | ||
throw new Error('The metadata is too long'); | ||
@@ -137,4 +138,4 @@ } | ||
} | ||
/// updProduct has its own format | ||
if (decoder.name === 'updProduct') { | ||
/// updProduct and addProduct have their own format | ||
if (decoder.name === 'updProduct' || decoder.name === 'addProduct') { | ||
var product = {}; | ||
@@ -141,0 +142,0 @@ var idx = 0; |
@@ -106,3 +106,10 @@ { | ||
], | ||
"args": [] | ||
"args": [ | ||
{ | ||
"name": "productMetadata", | ||
"type": { | ||
"defined": "ProductMetadata" | ||
} | ||
} | ||
] | ||
}, | ||
@@ -109,0 +116,0 @@ { |
@@ -123,3 +123,10 @@ import { PublicKey } from '@solana/web3.js'; | ||
]; | ||
args: []; | ||
args: [ | ||
{ | ||
name: 'productMetadata'; | ||
type: { | ||
defined: 'ProductMetadata'; | ||
}; | ||
} | ||
]; | ||
}, | ||
@@ -126,0 +133,0 @@ { |
@@ -12,3 +12,3 @@ "use strict"; | ||
var feeds = [new web3_js_1.PublicKey('H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG')]; | ||
var pythConnection = new PythConnection_1.PythConnection(connection, pythPublicKey, "confirmed", feeds); | ||
var pythConnection = new PythConnection_1.PythConnection(connection, pythPublicKey, 'confirmed', feeds); | ||
pythConnection.onPriceChangeVerbose(function (productAccount, priceAccount) { | ||
@@ -15,0 +15,0 @@ // The arguments to the callback include solana account information / the update slot if you need it. |
{ | ||
"name": "@pythnetwork/client", | ||
"version": "2.14.0", | ||
"version": "2.15.0", | ||
"description": "Client for consuming Pyth price data", | ||
@@ -5,0 +5,0 @@ "homepage": "https://pyth.network", |
135463
2986