@@ -22,7 +22,6 @@ import { Logger } from "pino";
2222
2323const DEFAULT_GAS_PRICE = 160000000 ;
2424const DEFAULT_GAS_MULTIPLIER = 1.05 ;
25- const DEFAULT_PRICE_IDS_PROCESS_CHUNK_SIZE = - 1 ;
2625const INJECTIVE_TESTNET_CHAIN_ID = "injective-888" ;
2726
2827type PriceQueryResponse = {
@@ -92,7 +91,9 @@ type InjectiveConfig = {
9291 chainId : string ;
9392 gasMultiplier : number ;
9493 gasPrice : number ;
95- priceIdsProcessChunkSize : number ;
94+ // The number of price ids to process in a single chunk. If not provided,
95+ // all price ids will be processed in a single chunk.
96+ priceIdsProcessChunkSize : number | undefined ;
9697} ;
9798export class InjectivePricePusher implements IPricePusher {
9899 private wallet : PrivateKey ;
@@ -113,9 +114,7 @@ export class InjectivePricePusher implements IPricePusher {
113114 chainId : chainConfig ?. chainId ?? INJECTIVE_TESTNET_CHAIN_ID ,
114115 gasMultiplier : chainConfig ?. gasMultiplier ?? DEFAULT_GAS_MULTIPLIER ,
115116 gasPrice : chainConfig ?. gasPrice ?? DEFAULT_GAS_PRICE ,
116- priceIdsProcessChunkSize :
117- chainConfig ?. priceIdsProcessChunkSize ??
118- DEFAULT_PRICE_IDS_PROCESS_CHUNK_SIZE ,
117+ priceIdsProcessChunkSize : chainConfig ?. priceIdsProcessChunkSize ,
119118 } ;
120119 }
121120
@@ -215,7 +214,7 @@ export class InjectivePricePusher implements IPricePusher {
215214 throw new Error ( "Invalid arguments" ) ;
216215
217216 const priceIdChunks =
218- this . chainConfig . priceIdsProcessChunkSize === - 1
217+ this . chainConfig . priceIdsProcessChunkSize === undefined
219218 ? [ priceIds ]
220219 : splitArrayToChunks ( {
221220 array : priceIds ,
0 commit comments