Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 531d00a

Browse files
committed
Lint
1 parent c73a44d commit 531d00a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ interface V3ParamsStrict {
7171
p: number
7272
}
7373

74+
// helpers
75+
function keyExists(k: Buffer | undefined | null): k is Buffer {
76+
return k !== undefined && k !== null
77+
}
78+
7479
function validateHexString(paramName: string, str: string, length?: number) {
7580
if (str.toLowerCase().startsWith('0x')) {
7681
str = str.slice(2)
@@ -288,7 +293,7 @@ export default class Wallet {
288293
public static generate(icapDirect: boolean = false): Wallet {
289294
if (icapDirect) {
290295
const max = BigInt('0x088f924eeceeda7fe92e1f5b0fffffffffffffff')
291-
while (true) {
296+
for (;;) {
292297
const privateKey = randomBytes(32) as Buffer
293298
const hex = privateToAddress(privateKey).toString('hex')
294299
if (BigInt('0x' + hex) <= max) {
@@ -308,7 +313,7 @@ export default class Wallet {
308313
pattern = new RegExp(pattern)
309314
}
310315

311-
while (true) {
316+
for (;;) {
312317
const privateKey = randomBytes(32) as Buffer
313318
const address = privateToAddress(privateKey)
314319

@@ -665,8 +670,3 @@ export default class Wallet {
665670
return privateToPublic(this.privateKey as Buffer).equals(publicKey)
666671
}
667672
}
668-
669-
// helpers
670-
function keyExists(k: Buffer | undefined | null): k is Buffer {
671-
return k !== undefined && k !== null
672-
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy