serum-vial
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -37,3 +37,3 @@ "use strict"; | ||
} | ||
await helpers_1.wait(100); | ||
await (0, helpers_1.wait)(100); | ||
} | ||
@@ -57,3 +57,3 @@ resolve(); | ||
// just in case to not get hit by serum RPC node rate limits... | ||
await helpers_1.wait(1000); | ||
await (0, helpers_1.wait)(1000); | ||
} | ||
@@ -65,3 +65,3 @@ await new Promise(async (resolve) => { | ||
} | ||
await helpers_1.wait(100); | ||
await (0, helpers_1.wait)(100); | ||
} | ||
@@ -74,5 +74,5 @@ resolve(); | ||
helpers_1.cleanupChannel.postMessage('cleanup'); | ||
await helpers_1.wait(10 * 1000); | ||
await (0, helpers_1.wait)(10 * 1000); | ||
} | ||
exports.stopServer = stopServer; | ||
//# sourceMappingURL=boot_server.js.map |
@@ -27,3 +27,3 @@ "use strict"; | ||
this._options = _options; | ||
this._version = serum_1.getLayoutVersion(this._options.market.programId); | ||
this._version = (0, serum_1.getLayoutVersion)(this._options.market.programId); | ||
const zero = 0; | ||
@@ -85,3 +85,3 @@ this._zeroWithPrecision = zero.toFixed(this._options.sizeDecimalPlaces); | ||
const diffIsValid = this._validateL3DiffCorrectness(l3Diff); | ||
if (diffIsValid === false && this._invalidSubsequentL3DiffsCount >= 1) { | ||
if (diffIsValid === false && this._invalidSubsequentL3DiffsCount >= 0) { | ||
logger_1.logger.log('warn', 'Resetting data mapper state due to invalid l3diff', { | ||
@@ -175,2 +175,3 @@ market: this._options.symbol, | ||
logger_1.logger.log('warn', 'Crossed L2 Book', { | ||
market: this._options.symbol, | ||
quote: newQuote, | ||
@@ -177,0 +178,0 @@ slot, |
@@ -14,3 +14,3 @@ "use strict"; | ||
if (typeof input === 'string') { | ||
let result = didyoumean2_1.default(input, allowedValues, {}); | ||
let result = (0, didyoumean2_1.default)(input, allowedValues, {}); | ||
if (result !== null) { | ||
@@ -102,3 +102,3 @@ tip = ` Did you mean '${result}'?`; | ||
} | ||
await exports.wait(500 * attempts * attempts); | ||
await (0, exports.wait)(500 * attempts * attempts); | ||
} | ||
@@ -105,0 +105,0 @@ } |
@@ -104,3 +104,3 @@ "use strict"; | ||
if (this._listenSocket !== undefined) { | ||
uWebSockets_js_1.us_listen_socket_close(this._listenSocket); | ||
(0, uWebSockets_js_1.us_listen_socket_close)(this._listenSocket); | ||
} | ||
@@ -116,3 +116,3 @@ } | ||
const markets = await Promise.all(this._markets.map((market) => { | ||
return helpers_1.executeAndRetry(async () => { | ||
return (0, helpers_1.executeAndRetry)(async () => { | ||
const connection = new web3_js_1.Connection(this._nodeEndpoint); | ||
@@ -125,3 +125,3 @@ 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)); | ||
quoteCurrency: quoteCurrency, | ||
version: serum_1.getLayoutVersion(programId), | ||
version: (0, serum_1.getLayoutVersion)(programId), | ||
address: market.address, | ||
@@ -141,3 +141,3 @@ programId: market.programId, | ||
} | ||
await helpers_1.wait(1); | ||
await (0, helpers_1.wait)(1); | ||
if (!res.aborted) { | ||
@@ -277,3 +277,3 @@ res.writeStatus('200 OK'); | ||
while (ws.getBufferedAmount() > 0) { | ||
await helpers_1.wait(10); | ||
await (0, helpers_1.wait)(10); | ||
retries += 1; | ||
@@ -304,3 +304,3 @@ if (retries > 200) { | ||
isValid: false, | ||
error: `Invalid op: '${payload.op}'.${helpers_1.getDidYouMean(payload.op, consts_1.OPS)} ${helpers_1.getAllowedValuesText(consts_1.OPS)}` | ||
error: `Invalid op: '${payload.op}'.${(0, helpers_1.getDidYouMean)(payload.op, consts_1.OPS)} ${(0, helpers_1.getAllowedValuesText)(consts_1.OPS)}` | ||
}; | ||
@@ -311,3 +311,3 @@ } | ||
isValid: false, | ||
error: `Invalid channel provided: '${payload.channel}'.${helpers_1.getDidYouMean(payload.channel, consts_1.CHANNELS)} ${helpers_1.getAllowedValuesText(consts_1.CHANNELS)}` | ||
error: `Invalid channel provided: '${payload.channel}'.${(0, helpers_1.getDidYouMean)(payload.channel, consts_1.CHANNELS)} ${(0, helpers_1.getAllowedValuesText)(consts_1.CHANNELS)}` | ||
}; | ||
@@ -331,3 +331,3 @@ } | ||
isValid: false, | ||
error: `Invalid market name provided: '${market}'.${helpers_1.getDidYouMean(market, this._marketNames)} ${helpers_1.getAllowedValuesText(this._marketNames)}` | ||
error: `Invalid market name provided: '${market}'.${(0, helpers_1.getDidYouMean)(market, this._marketNames)} ${(0, helpers_1.getAllowedValuesText)(this._marketNames)}` | ||
}; | ||
@@ -334,0 +334,0 @@ } |
@@ -51,3 +51,3 @@ "use strict"; | ||
async getAccountInfo(publicKey, commitment) { | ||
const { result } = await helpers_1.executeAndRetry(async () => this._getAccountInfoRPCResponseRaw(publicKey.toBase58(), commitment), { maxRetries: 10 }); | ||
const { result } = await (0, helpers_1.executeAndRetry)(async () => this._getAccountInfoRPCResponseRaw(publicKey.toBase58(), commitment), { maxRetries: 10 }); | ||
if (result.value === null) { | ||
@@ -70,3 +70,3 @@ return null; | ||
try { | ||
const response = await node_fetch_1.default(this._options.nodeEndpoint, { | ||
const response = await (0, node_fetch_1.default)(this._options.nodeEndpoint, { | ||
signal: controller.signal, | ||
@@ -177,3 +177,3 @@ method: 'POST', | ||
this._monitorConnectionIfStale(ws); | ||
const { accountsData, slot } = await helpers_1.executeAndRetry(async () => this._fetchAccountsSnapshot(), { | ||
const { accountsData, slot } = await (0, helpers_1.executeAndRetry)(async () => this._fetchAccountsSnapshot(), { | ||
maxRetries: 10 | ||
@@ -253,3 +253,3 @@ }); | ||
try { | ||
const response = await node_fetch_1.default(this._options.nodeRestEndpoint, { | ||
const response = await (0, node_fetch_1.default)(this._options.nodeRestEndpoint, { | ||
signal: controller.signal, | ||
@@ -303,3 +303,3 @@ method: 'POST', | ||
if (delayMs > 0) { | ||
await helpers_1.wait(delayMs); | ||
await (0, helpers_1.wait)(delayMs); | ||
} | ||
@@ -306,0 +306,0 @@ this._retriesCount++; |
@@ -38,4 +38,4 @@ "use strict"; | ||
const market = await serum_1.Market.load(rpcClient, new web3_js_1.PublicKey(marketMeta.address), undefined, new web3_js_1.PublicKey(marketMeta.programId)); | ||
const priceDecimalPlaces = helpers_1.decimalPlaces(market.tickSize); | ||
const sizeDecimalPlaces = helpers_1.decimalPlaces(market.minOrderSize); | ||
const priceDecimalPlaces = (0, helpers_1.decimalPlaces)(market.tickSize); | ||
const sizeDecimalPlaces = (0, helpers_1.decimalPlaces)(market.minOrderSize); | ||
const dataMapper = new data_mapper_1.DataMapper({ | ||
@@ -42,0 +42,0 @@ symbol: this._options.marketName, |
{ | ||
"name": "serum-vial", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"engines": { | ||
@@ -41,4 +41,4 @@ "node": ">=15" | ||
"dependencies": { | ||
"@project-serum/serum": "^0.13.54", | ||
"@solana/web3.js": "^1.22.0", | ||
"@project-serum/serum": "^0.13.60", | ||
"@solana/web3.js": "^1.29.1", | ||
"@types/bintrees": "^1.0.3", | ||
@@ -50,21 +50,21 @@ "@types/bn.js": "^5.1.0", | ||
"didyoumean2": "^5.0.0", | ||
"is-docker": "^2.2.1", | ||
"is-docker": "^3.0.0", | ||
"node-fetch": "^2.6.1", | ||
"uWebSockets.js": "git+https://git@github.com/uNetworking/uWebSockets.js.git#v19.4.0", | ||
"uWebSockets.js": "git+https://git@github.com/uNetworking/uWebSockets.js.git#v19.5.0", | ||
"winston": "^3.3.3", | ||
"ws": "^7.5.3", | ||
"yargs": "^17.0.1" | ||
"ws": "^8.2.2", | ||
"yargs": "^17.2.1" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.24", | ||
"@types/node": "^16.4.3", | ||
"@types/jest": "^27.0.2", | ||
"@types/node": "^16.10.1", | ||
"@types/node-fetch": "^2.5.12", | ||
"@types/ws": "^7.4.7", | ||
"@types/ws": "^8.2.0", | ||
"cross-var": "^1.1.0", | ||
"husky": "^7.0.1", | ||
"jest": "^27.0.6", | ||
"lint-staged": "^11.1.1", | ||
"prettier": "^2.3.2", | ||
"ts-jest": "^27.0.4", | ||
"typescript": "^4.3.5" | ||
"husky": "^7.0.2", | ||
"jest": "^27.2.2", | ||
"lint-staged": "^11.1.2", | ||
"prettier": "^2.4.1", | ||
"ts-jest": "^27.0.5", | ||
"typescript": "^4.4.3" | ||
}, | ||
@@ -71,0 +71,0 @@ "lint-staged": { |
@@ -142,3 +142,3 @@ import { EVENT_QUEUE_LAYOUT, Market, Orderbook, getLayoutVersion } from '@project-serum/serum' | ||
if (diffIsValid === false && this._invalidSubsequentL3DiffsCount >= 1) { | ||
if (diffIsValid === false && this._invalidSubsequentL3DiffsCount >= 0) { | ||
logger.log('warn', 'Resetting data mapper state due to invalid l3diff', { | ||
@@ -252,2 +252,3 @@ market: this._options.symbol, | ||
logger.log('warn', 'Crossed L2 Book', { | ||
market: this._options.symbol, | ||
quote: newQuote, | ||
@@ -254,0 +255,0 @@ slot, |
@@ -318,3 +318,3 @@ import { getLayoutVersion, Market } from '@project-serum/serum' | ||
}) | ||
} catch (err) { | ||
} catch (err: any) { | ||
const message = 'Subscription request internal error' | ||
@@ -321,0 +321,0 @@ const errorMessage = typeof err === 'string' ? err : `${err.message}, ${err.stack}` |
@@ -241,3 +241,3 @@ import { Market } from '@project-serum/serum' | ||
this._currentSlot = slot | ||
} catch (err) { | ||
} catch (err: any) { | ||
logger.log('warn', `Failed to fetch accounts snapshot, ${err.message}`, { market: this._options.marketName }) | ||
@@ -244,0 +244,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.
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
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
279755
4112
+ Addedis-docker@3.0.0(transitive)
- Removedis-docker@2.2.1(transitive)
Updated@solana/web3.js@^1.29.1
Updatedis-docker@^3.0.0
UpdateduWebSockets.js@git+https://git@github.com/uNetworking/uWebSockets.js.git#v19.5.0
Updatedws@^8.2.2
Updatedyargs@^17.2.1