@@ -63,6 +63,13 @@ export type TransactionManagerConfig = {
6363 * Defaults to false.
6464 */
6565 allowDebug ?: boolean
66+
67+ /**
68+ * Specifies the fraction of the block time to be used as the polling interval.
69+ * This setting is applicable only when the RPC protocol is HTTP.
70+ * By default, the polling interval is set to 1/8 of the block time, meaning the system will poll every 1/8th of the block time.
71+ */
72+ pollingIntervalFraction ?: number
6673 }
6774 /** The private key of the account used for signing transactions. */
6875 privateKey : Hex
@@ -159,6 +166,8 @@ export class TransactionManager {
159166 public readonly rpcAllowDebug : boolean
160167 public readonly blockTime : bigint
161168 public readonly finalizedTransactionPurgeTime : number
169+ public readonly pollingIntervalFraction : number
170+ public readonly transportProtocol : "http" | "websocket"
162171
163172 public started : boolean
164173
@@ -171,12 +180,14 @@ export class TransactionManager {
171180 throw protocol . error
172181 }
173182
183+ this . transportProtocol = protocol . value
184+
174185 const retries = _config . rpc . retries || 2
175186 const retryDelay = _config . rpc . retryDelay || 50
176187 const timeout = _config . rpc . timeout || 500
177188
178189 let transport : ViemTransport
179- if ( protocol . value === "http" ) {
190+ if ( this . transportProtocol === "http" ) {
180191 transport = viemHttpTransport ( _config . rpc . url , {
181192 timeout,
182193 retryCount : retries ,
@@ -250,6 +261,8 @@ export class TransactionManager {
250261 this . blockTime = _config . blockTime || 2n
251262 this . finalizedTransactionPurgeTime = _config . finalizedTransactionPurgeTime || 2 * 60 * 1000
252263
264+ this . pollingIntervalFraction = _config . rpc . pollingIntervalFraction || 8
265+
253266 this . started = false
254267 }
255268
0 commit comments