1
1
import {
2
- Address ,
3
2
eth_getTransactionCount ,
4
3
getAddress ,
5
4
getRpcClient ,
5
+ type Address ,
6
6
} from "thirdweb" ;
7
7
import { getChain } from "../../utils/chain" ;
8
8
import { logger } from "../../utils/logger" ;
@@ -37,7 +37,7 @@ export const getUsedBackendWallets = async (
37
37
return keys . map ( ( key ) => {
38
38
const tokens = key . split ( ":" ) ;
39
39
return {
40
- chainId : parseInt ( tokens [ 1 ] ) ,
40
+ chainId : Number . parseInt ( tokens [ 1 ] ) ,
41
41
walletAddress : getAddress ( tokens [ 2 ] ) ,
42
42
} ;
43
43
} ) ;
@@ -61,7 +61,7 @@ export const lastUsedNonceKey = (chainId: number, walletAddress: Address) =>
61
61
export const splitLastUsedNonceKey = ( key : string ) => {
62
62
const _splittedKeys = key . split ( ":" ) ;
63
63
const walletAddress = normalizeAddress ( _splittedKeys [ 2 ] ) ;
64
- const chainId = parseInt ( _splittedKeys [ 1 ] ) ;
64
+ const chainId = Number . parseInt ( _splittedKeys [ 1 ] ) ;
65
65
return { walletAddress, chainId } ;
66
66
} ;
67
67
@@ -87,7 +87,7 @@ export const sentNoncesKey = (chainId: number, walletAddress: Address) =>
87
87
export const splitSentNoncesKey = ( key : string ) => {
88
88
const _splittedKeys = key . split ( ":" ) ;
89
89
const walletAddress = normalizeAddress ( _splittedKeys [ 2 ] ) ;
90
- const chainId = parseInt ( _splittedKeys [ 1 ] ) ;
90
+ const chainId = Number . parseInt ( _splittedKeys [ 1 ] ) ;
91
91
return { walletAddress, chainId } ;
92
92
} ;
93
93
@@ -166,7 +166,7 @@ export const acquireNonce = async (args: {
166
166
nonce,
167
167
queueId,
168
168
} ) ;
169
- return { nonce, isRecycledNonce : false } ;
169
+ return { nonce, isRecycledNonce } ;
170
170
} ;
171
171
172
172
/**
@@ -181,7 +181,7 @@ export const recycleNonce = async (
181
181
walletAddress : Address ,
182
182
nonce : number ,
183
183
) => {
184
- if ( isNaN ( nonce ) ) {
184
+ if ( Number . isNaN ( nonce ) ) {
185
185
logger ( {
186
186
level : "warn" ,
187
187
message : `[recycleNonce] Invalid nonce: ${ nonce } ` ,
@@ -209,7 +209,7 @@ const _acquireRecycledNonce = async (
209
209
if ( result . length === 0 ) {
210
210
return null ;
211
211
}
212
- return parseInt ( result [ 0 ] ) ;
212
+ return Number . parseInt ( result [ 0 ] ) ;
213
213
} ;
214
214
215
215
/**
@@ -246,7 +246,7 @@ export const syncLatestNonceFromOnchain = async (
246
246
export const inspectNonce = async ( chainId : number , walletAddress : Address ) => {
247
247
const key = lastUsedNonceKey ( chainId , walletAddress ) ;
248
248
const nonce = await redis . get ( key ) ;
249
- return nonce ? parseInt ( nonce ) : 0 ;
249
+ return nonce ? Number . parseInt ( nonce ) : 0 ;
250
250
} ;
251
251
252
252
/**
0 commit comments