11import {
2- Address ,
32 eth_getTransactionCount ,
43 getAddress ,
54 getRpcClient ,
5+ type Address ,
66} from "thirdweb" ;
77import { getChain } from "../../utils/chain" ;
88import { logger } from "../../utils/logger" ;
@@ -37,7 +37,7 @@ export const getUsedBackendWallets = async (
3737 return keys . map ( ( key ) => {
3838 const tokens = key . split ( ":" ) ;
3939 return {
40- chainId : parseInt ( tokens [ 1 ] ) ,
40+ chainId : Number . parseInt ( tokens [ 1 ] ) ,
4141 walletAddress : getAddress ( tokens [ 2 ] ) ,
4242 } ;
4343 } ) ;
@@ -61,7 +61,7 @@ export const lastUsedNonceKey = (chainId: number, walletAddress: Address) =>
6161export const splitLastUsedNonceKey = ( key : string ) => {
6262 const _splittedKeys = key . split ( ":" ) ;
6363 const walletAddress = normalizeAddress ( _splittedKeys [ 2 ] ) ;
64- const chainId = parseInt ( _splittedKeys [ 1 ] ) ;
64+ const chainId = Number . parseInt ( _splittedKeys [ 1 ] ) ;
6565 return { walletAddress, chainId } ;
6666} ;
6767
@@ -87,7 +87,7 @@ export const sentNoncesKey = (chainId: number, walletAddress: Address) =>
8787export const splitSentNoncesKey = ( key : string ) => {
8888 const _splittedKeys = key . split ( ":" ) ;
8989 const walletAddress = normalizeAddress ( _splittedKeys [ 2 ] ) ;
90- const chainId = parseInt ( _splittedKeys [ 1 ] ) ;
90+ const chainId = Number . parseInt ( _splittedKeys [ 1 ] ) ;
9191 return { walletAddress, chainId } ;
9292} ;
9393
@@ -166,7 +166,7 @@ export const acquireNonce = async (args: {
166166 nonce,
167167 queueId,
168168 } ) ;
169- return { nonce, isRecycledNonce : false } ;
169+ return { nonce, isRecycledNonce } ;
170170} ;
171171
172172/**
@@ -181,7 +181,7 @@ export const recycleNonce = async (
181181 walletAddress : Address ,
182182 nonce : number ,
183183) => {
184- if ( isNaN ( nonce ) ) {
184+ if ( Number . isNaN ( nonce ) ) {
185185 logger ( {
186186 level : "warn" ,
187187 message : `[recycleNonce] Invalid nonce: ${ nonce } ` ,
@@ -209,7 +209,7 @@ const _acquireRecycledNonce = async (
209209 if ( result . length === 0 ) {
210210 return null ;
211211 }
212- return parseInt ( result [ 0 ] ) ;
212+ return Number . parseInt ( result [ 0 ] ) ;
213213} ;
214214
215215/**
@@ -246,7 +246,7 @@ export const syncLatestNonceFromOnchain = async (
246246export const inspectNonce = async ( chainId : number , walletAddress : Address ) => {
247247 const key = lastUsedNonceKey ( chainId , walletAddress ) ;
248248 const nonce = await redis . get ( key ) ;
249- return nonce ? parseInt ( nonce ) : 0 ;
249+ return nonce ? Number . parseInt ( nonce ) : 0 ;
250250} ;
251251
252252/**
0 commit comments