serum-vial
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -62,20 +62,22 @@ "use strict"; | ||
if (this._cachedListMarketsResponse === undefined) { | ||
const markets = await Promise.all(this._markets.map(async (market) => { | ||
const connection = new web3_js_1.Connection(this._nodeEndpoint); | ||
const { tickSize, minOrderSize, baseMintAddress, quoteMintAddress, programId } = await serum_1.Market.load(connection, new web3_js_1.PublicKey(market.address), undefined, new web3_js_1.PublicKey(market.programId)); | ||
const [baseCurrency, quoteCurrency] = market.name.split('/'); | ||
const serumMarket = { | ||
name: market.name, | ||
baseCurrency: baseCurrency, | ||
quoteCurrency: quoteCurrency, | ||
version: serum_1.getLayoutVersion(programId), | ||
address: market.address, | ||
programId: market.programId, | ||
baseMintAddress: baseMintAddress.toBase58(), | ||
quoteMintAddress: quoteMintAddress.toBase58(), | ||
tickSize, | ||
minOrderSize, | ||
deprecated: market.deprecated | ||
}; | ||
return serumMarket; | ||
const markets = await Promise.all(this._markets.map((market) => { | ||
return helpers_1.executeAndRetry(async () => { | ||
const connection = new web3_js_1.Connection(this._nodeEndpoint); | ||
const { tickSize, minOrderSize, baseMintAddress, quoteMintAddress, programId } = await serum_1.Market.load(connection, new web3_js_1.PublicKey(market.address), undefined, new web3_js_1.PublicKey(market.programId)); | ||
const [baseCurrency, quoteCurrency] = market.name.split('/'); | ||
const serumMarket = { | ||
name: market.name, | ||
baseCurrency: baseCurrency, | ||
quoteCurrency: quoteCurrency, | ||
version: serum_1.getLayoutVersion(programId), | ||
address: market.address, | ||
programId: market.programId, | ||
baseMintAddress: baseMintAddress.toBase58(), | ||
quoteMintAddress: quoteMintAddress.toBase58(), | ||
tickSize, | ||
minOrderSize, | ||
deprecated: market.deprecated | ||
}; | ||
return serumMarket; | ||
}, { maxRetries: 4 }); | ||
})); | ||
@@ -82,0 +84,0 @@ this._cachedListMarketsResponse = JSON.stringify(markets, null, 2); |
{ | ||
"name": "serum-vial", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=15" |
@@ -8,2 +8,3 @@ import { getLayoutVersion, Market } from '@project-serum/serum' | ||
cleanupChannel, | ||
executeAndRetry, | ||
getAllowedValuesText, | ||
@@ -136,26 +137,31 @@ getDidYouMean, | ||
const markets = await Promise.all( | ||
this._markets.map(async (market) => { | ||
const connection = new Connection(this._nodeEndpoint) | ||
const { tickSize, minOrderSize, baseMintAddress, quoteMintAddress, programId } = await Market.load( | ||
connection, | ||
new PublicKey(market.address), | ||
undefined, | ||
new PublicKey(market.programId) | ||
this._markets.map((market) => { | ||
return executeAndRetry( | ||
async () => { | ||
const connection = new Connection(this._nodeEndpoint) | ||
const { tickSize, minOrderSize, baseMintAddress, quoteMintAddress, programId } = await Market.load( | ||
connection, | ||
new PublicKey(market.address), | ||
undefined, | ||
new PublicKey(market.programId) | ||
) | ||
const [baseCurrency, quoteCurrency] = market.name.split('/') | ||
const serumMarket: SerumListMarketItem = { | ||
name: market.name, | ||
baseCurrency: baseCurrency!, | ||
quoteCurrency: quoteCurrency!, | ||
version: getLayoutVersion(programId), | ||
address: market.address, | ||
programId: market.programId, | ||
baseMintAddress: baseMintAddress.toBase58(), | ||
quoteMintAddress: quoteMintAddress.toBase58(), | ||
tickSize, | ||
minOrderSize, | ||
deprecated: market.deprecated | ||
} | ||
return serumMarket | ||
}, | ||
{ maxRetries: 4 } | ||
) | ||
const [baseCurrency, quoteCurrency] = market.name.split('/') | ||
const serumMarket: SerumListMarketItem = { | ||
name: market.name, | ||
baseCurrency: baseCurrency!, | ||
quoteCurrency: quoteCurrency!, | ||
version: getLayoutVersion(programId), | ||
address: market.address, | ||
programId: market.programId, | ||
baseMintAddress: baseMintAddress.toBase58(), | ||
quoteMintAddress: quoteMintAddress.toBase58(), | ||
tickSize, | ||
minOrderSize, | ||
deprecated: market.deprecated | ||
} | ||
return serumMarket | ||
}) | ||
@@ -162,0 +168,0 @@ ) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
273907
4003