165165
166166** ● publicToAddress** : * [ pubToAddress] ( ) * = pubToAddress
167167
168- * Defined in [ account.ts:151 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L151 ) *
168+ * Defined in [ account.ts:160 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L160 ) *
169169
170170___
171171<a id =" setlength " ></a >
@@ -225,7 +225,7 @@ Converts a `Buffer` or `Array` to JSON.
225225| ba | ` any ` | (Buffer\| Array) |
226226
227227** Returns:** ` any `
228- (Array|String|null)
228+ (Array\ | String\ | null)
229229
230230___
231231<a id =" buffertohex " ></a >
236236
237237* Defined in [ bytes.ts:111] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes.ts#L111 ) *
238238
239- Converts a ` Buffer ` into a hex ` String ` .
239+ Converts a ` Buffer ` into a ` 0x ` \- prefixed hex ` String ` .
240240
241241** Parameters:**
242242
376376
377377▸ ** generateAddress** (from: * ` Buffer ` * , nonce: * ` Buffer ` * ): ` Buffer `
378378
379- * Defined in [ account.ts:63 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L63 ) *
379+ * Defined in [ account.ts:72 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L72 ) *
380380
381381Generates an address of a newly created contract.
382382
396396
397397▸ ** generateAddress2** (from: * ` Buffer ` \| ` string ` * , salt: * ` Buffer ` \| ` string ` * , initCode: * ` Buffer ` \| ` string ` * ): ` Buffer `
398398
399- * Defined in [ account.ts:83 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L83 ) *
399+ * Defined in [ account.ts:92 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L92 ) *
400400
401401Generates an address for a contract created using CREATE2.
402402
436436
437437▸ ** importPublic** (publicKey: * ` Buffer ` * ): ` Buffer `
438438
439- * Defined in [ account.ts:174 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L174 ) *
439+ * Defined in [ account.ts:183 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L183 ) *
440440
441441Converts a public key to the Ethereum format.
442442
455455
456456▸ ** isPrecompiled** (address: * ` Buffer ` \| ` string ` * ): ` boolean `
457457
458- * Defined in [ account.ts:105 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L105 ) *
458+ * Defined in [ account.ts:114 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L114 ) *
459459
460460Returns true if the supplied address belongs to a precompiled account (Byzantium).
461461
@@ -491,17 +491,20 @@ ___
491491
492492### ` <Const> ` isValidChecksumAddress
493493
494- ▸ ** isValidChecksumAddress** (address: * ` string ` * ): ` boolean `
494+ ▸ ** isValidChecksumAddress** (address: * ` string ` * , chainId?: * ` undefined ` \| ` number ` * ): ` boolean `
495495
496- * Defined in [ account.ts:54 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L54 ) *
496+ * Defined in [ account.ts:63 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L63 ) *
497497
498498Checks if the address is a valid checksummed address.
499499
500+ If a chainId is provided, the address is compared to an EIP-1191 checksum. Otherwise, it will be compared to an EIP-55 checksum.
501+
500502** Parameters:**
501503
502504| Name | Type |
503505| ------ | ------ |
504506| address | ` string ` |
507+ | ` Optional ` chainId | ` undefined ` \| ` number ` |
505508
506509** Returns:** ` boolean `
507510
512515
513516▸ ** isValidPrivate** (privateKey: * ` Buffer ` * ): ` boolean `
514517
515- * Defined in [ account.ts:113 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L113 ) *
518+ * Defined in [ account.ts:122 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L122 ) *
516519
517520Checks if the private key satisfies the rules of the curve secp256k1.
518521
531534
532535▸ ** isValidPublic** (publicKey: * ` Buffer ` * , sanitize?: * ` boolean ` * ): ` boolean `
533536
534- * Defined in [ account.ts:123 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L123 ) *
537+ * Defined in [ account.ts:132 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L132 ) *
535538
536539Checks if the public key satisfies the rules of the curve secp256k1 and the requirements of Ethereum.
537540
632635
633636▸ ** privateToAddress** (privateKey: * ` Buffer ` * ): ` Buffer `
634637
635- * Defined in [ account.ts:157 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L157 ) *
638+ * Defined in [ account.ts:166 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L166 ) *
636639
637640Returns the ethereum address of a given private key.
638641
651654
652655▸ ** privateToPublic** (privateKey: * ` Buffer ` * ): ` Buffer `
653656
654- * Defined in [ account.ts:165 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L165 ) *
657+ * Defined in [ account.ts:174 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L174 ) *
655658
656659Returns the ethereum public key of a given private key.
657660
670673
671674▸ ** pubToAddress** (pubKey: * ` Buffer ` * , sanitize?: * ` boolean ` * ): ` Buffer `
672675
673- * Defined in [ account.ts:142 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L142 ) *
676+ * Defined in [ account.ts:151 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L151 ) *
674677
675678Returns the ethereum address of a given public key. Accepts "Ethereum public keys" and SEC1 encoded keys.
676679
@@ -742,7 +745,7 @@ Left Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.
742745| ` Default value ` right | ` boolean ` | false | whether to start padding form the left or right |
743746
744747** Returns:** ` any `
745- (Buffer|Array)
748+ (Buffer\ | Array)
746749
747750___
748751<a id =" setlengthright " ></a >
@@ -763,7 +766,7 @@ Right Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.
763766| length | ` number ` | the number of bytes the output should be |
764767
765768** Returns:** ` any `
766- (Buffer|Array)
769+ (Buffer\ | Array)
767770
768771___
769772<a id =" sha256 " ></a >
@@ -808,17 +811,20 @@ ___
808811
809812### ` <Const> ` toChecksumAddress
810813
811- ▸ ** toChecksumAddress** (address: * ` string ` * ): ` string `
814+ ▸ ** toChecksumAddress** (address: * ` string ` * , chainId?: * ` undefined ` \| ` number ` * ): ` string `
812815
813- * Defined in [ account.ts:35 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L35 ) *
816+ * Defined in [ account.ts:38 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L38 ) *
814817
815818Returns a checksummed address.
816819
820+ If a chainId is provided, the result will be an EIP-1191 checksum. Otherwise, it will be an EIP-55 checksum.
821+
817822** Parameters:**
818823
819824| Name | Type |
820825| ------ | ------ |
821826| address | ` string ` |
827+ | ` Optional ` chainId | ` undefined ` \| ` number ` |
822828
823829** Returns:** ` string `
824830
@@ -882,7 +888,7 @@ Trims leading zeros from a `Buffer` or an `Array`.
882888| a | ` any ` | (Buffer\| Array\| String) |
883889
884890** Returns:** ` any `
885- (Buffer|Array|String)
891+ (Buffer\ | Array\ | String)
886892
887893___
888894<a id =" zeroaddress " ></a >
0 commit comments