Skip to content

Commit

Permalink
fix optional blockNumber property in eth_getTransactionCount (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMantrov committed Jul 10, 2023
1 parent 77e0cf5 commit 74a419d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/rpc/evm/AbstractEvmBasedRpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export abstract class AbstractEvmBasedRpc implements EvmBasedRpcInterface {
return ResponseUtils.fromRpcResult(r)
}

async getTransactionCount(address: string, blockNumber?: BlockNumber): Promise<ResponseDto<BigNumber>> {
async getTransactionCount(address: string, blockNumber: BlockNumber = 'latest'): Promise<ResponseDto<BigNumber>> {
const r = await this.rpcCall<JsonRpcResponse>('eth_getTransactionCount', [
address,
typeof blockNumber === 'number' ? '0x' + new BigNumber(blockNumber).toString(16) : blockNumber,
Expand Down

0 comments on commit 74a419d

Please sign in to comment.