165165
166166** ● publicToAddress** : * [ pubToAddress] ( ) * = pubToAddress
167167
168- * Defined in [ index .ts:271 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L271 ) *
168+ * Defined in [ account .ts:151 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L151 ) *
169169
170170___
171171<a id =" setlength " ></a >
174174
175175** ● setLength** : * [ setLengthLeft] ( ) * = setLengthLeft
176176
177- * Defined in [ index .ts:79 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L79 ) *
177+ * Defined in [ bytes .ts:37 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L37 ) *
178178
179179___
180180<a id =" stripzeros " ></a >
183183
184184** ● stripZeros** : * [ unpad] ( ) * = unpad
185185
186- * Defined in [ index .ts:106 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L106 ) *
186+ * Defined in [ bytes .ts:64 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L64 ) *
187187
188188___
189189
195195
196196▸ ** addHexPrefix** (str: * ` string ` * ): ` string `
197197
198- * Defined in [ index .ts:488 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L488 ) *
198+ * Defined in [ bytes .ts:135 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L135 ) *
199199
200200Adds "0x" to a given ` String ` if it does not already start with "0x".
201201
212212
213213### ` <Const> ` baToJSON
214214
215- ▸ ** baToJSON** (ba: * ` any ` * ): ` undefined ` \| ` string ` \| ` any ` [ ]
215+ ▸ ** baToJSON** (ba: * ` any ` * ): ` any `
216216
217- * Defined in [ index .ts:540 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L540 ) *
217+ * Defined in [ bytes .ts:148 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L148 ) *
218218
219219Converts a ` Buffer ` or ` Array ` to JSON.
220220
@@ -224,7 +224,7 @@ Converts a `Buffer` or `Array` to JSON.
224224| ------ | ------ | ------ |
225225| ba | ` any ` | (Buffer\| Array) |
226226
227- ** Returns:** ` undefined ` \| ` string ` \| ` any ` [ ]
227+ ** Returns:** ` any `
228228(Array|String|null)
229229
230230___
234234
235235▸ ** bufferToHex** (buf: * ` Buffer ` * ): ` string `
236236
237- * Defined in [ index .ts:151 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L151 ) *
237+ * Defined in [ bytes .ts:111 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L111 ) *
238238
239239Converts a ` Buffer ` into a hex ` String ` .
240240
253253
254254▸ ** bufferToInt** (buf: * ` Buffer ` * ): ` number `
255255
256- * Defined in [ index .ts:143 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L143 ) *
256+ * Defined in [ bytes .ts:103 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L103 ) *
257257
258258Converts a ` Buffer ` to a ` Number ` .
259259
272272
273273▸ ** defineProperties** (self: * ` any ` * , fields: * ` any ` * , data: * ` any ` * ): ` void `
274274
275- * Defined in [ index .ts:562 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L562 ) *
275+ * Defined in [ object .ts:17 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/object .ts#L17 ) *
276276
277277Defines properties on a ` Object ` . It make the assumption that underlying data is binary.
278278
293293
294294▸ ** ecrecover** (msgHash: * ` Buffer ` * , v: * ` number ` * , r: * ` Buffer ` * , s: * ` Buffer ` * , chainId?: * ` undefined ` \| ` number ` * ): ` Buffer `
295295
296- * Defined in [ index .ts:329 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L329 ) *
296+ * Defined in [ signature .ts:36 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/signature .ts#L36 ) *
297297
298298ECDSA public key recovery from signature.
299299
317317
318318▸ ** ecsign** (msgHash: * ` Buffer ` * , privateKey: * ` Buffer ` * , chainId?: * ` undefined ` \| ` number ` * ): [ ECDSASignature] ( interfaces/ecdsasignature.md )
319319
320- * Defined in [ index .ts:297 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L297 ) *
320+ * Defined in [ signature .ts:15 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/signature .ts#L15 ) *
321321
322322Returns the ECDSA signature of a message hash.
323323
338338
339339▸ ** fromRpcSig** (sig: * ` string ` * ): [ ECDSASignature] ( interfaces/ecdsasignature.md )
340340
341- * Defined in [ index .ts:363 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L363 ) *
341+ * Defined in [ signature .ts:70 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/signature .ts#L70 ) *
342342
343343Convert signature format of the ` eth_sign ` RPC method to signature parameters NOTE: all because of a bug in geth: [ https://github.com/ethereum/go-ethereum/issues/2053 ] ( https://github.com/ethereum/go-ethereum/issues/2053 )
344344
357357
358358▸ ** fromSigned** (num: * ` Buffer ` * ): ` BN `
359359
360- * Defined in [ index .ts:160 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L160 ) *
360+ * Defined in [ bytes .ts:120 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L120 ) *
361361
362362Interprets a ` Buffer ` as a signed integer and returns a ` BN ` . Assumes 256-bit numbers.
363363
376376
377377▸ ** generateAddress** (from: * ` Buffer ` * , nonce: * ` Buffer ` * ): ` Buffer `
378378
379- * Defined in [ index .ts:438 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L438 ) *
379+ * Defined in [ account .ts:63 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L63 ) *
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 [ index .ts:458 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L458 ) *
399+ * Defined in [ account .ts:83 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L83 ) *
400400
401401Generates an address for a contract created using CREATE2.
402402
@@ -415,17 +415,17 @@ ___
415415
416416### ` <Const> ` hashPersonalMessage
417417
418- ▸ ** hashPersonalMessage** (message: * ` any ` * ): ` Buffer `
418+ ▸ ** hashPersonalMessage** (message: * ` Buffer ` * ): ` Buffer `
419419
420- * Defined in [ index .ts:320 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L320 ) *
420+ * Defined in [ signature .ts:136 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/signature .ts#L136 ) *
421421
422422Returns the keccak-256 hash of ` message ` , prefixed with the header used by the ` eth_sign ` RPC call. The output of this function can be fed into ` ecsign ` to produce the same signature as the ` eth_sign ` call for a given ` message ` , or fed to ` ecrecover ` along with a signature to recover the public key used to produce the signature.
423423
424424** Parameters:**
425425
426426| Name | Type |
427427| ------ | ------ |
428- | message | ` any ` |
428+ | message | ` Buffer ` |
429429
430430** Returns:** ` Buffer `
431431
436436
437437▸ ** importPublic** (publicKey: * ` Buffer ` * ): ` Buffer `
438438
439- * Defined in [ index .ts:286 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L286 ) *
439+ * Defined in [ account .ts:174 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L174 ) *
440440
441441Converts a public key to the Ethereum format.
442442
455455
456456▸ ** isPrecompiled** (address: * ` Buffer ` \| ` string ` * ): ` boolean `
457457
458- * Defined in [ index .ts:480 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L480 ) *
458+ * Defined in [ account .ts:105 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L105 ) *
459459
460460Returns true if the supplied address belongs to a precompiled account (Byzantium).
461461
474474
475475▸ ** isValidAddress** (address: * ` string ` * ): ` boolean `
476476
477- * Defined in [ index .ts:395 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L395 ) *
477+ * Defined in [ account .ts:20 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L20 ) *
478478
479479Checks if the address is a valid. Accepts checksummed addresses too.
480480
493493
494494▸ ** isValidChecksumAddress** (address: * ` string ` * ): ` boolean `
495495
496- * Defined in [ index .ts:429 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L429 ) *
496+ * Defined in [ account .ts:54 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L54 ) *
497497
498498Checks if the address is a valid checksummed address.
499499
512512
513513▸ ** isValidPrivate** (privateKey: * ` Buffer ` * ): ` boolean `
514514
515- * Defined in [ index .ts:233 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L233 ) *
515+ * Defined in [ account .ts:113 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L113 ) *
516516
517517Checks if the private key satisfies the rules of the curve secp256k1.
518518
531531
532532▸ ** isValidPublic** (publicKey: * ` Buffer ` * , sanitize?: * ` boolean ` * ): ` boolean `
533533
534- * Defined in [ index .ts:243 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L243 ) *
534+ * Defined in [ account .ts:123 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L123 ) *
535535
536536Checks if the public key satisfies the rules of the curve secp256k1 and the requirements of Ethereum.
537537
551551
552552▸ ** isValidSignature** (v: * ` number ` * , r: * ` Buffer ` * , s: * ` Buffer ` * , homesteadOrLater?: * ` boolean ` * , chainId?: * ` undefined ` \| ` number ` * ): ` boolean `
553553
554- * Defined in [ index .ts:500 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L500 ) *
554+ * Defined in [ signature .ts:95 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/signature .ts#L95 ) *
555555
556556Validate a ECDSA signature.
557557
574574
575575▸ ** isZeroAddress** (address: * ` string ` * ): ` boolean `
576576
577- * Defined in [ index .ts:402 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L402 ) *
577+ * Defined in [ account .ts:27 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L27 ) *
578578
579579Checks if a given address is a zero address.
580580
@@ -593,15 +593,15 @@ ___
593593
594594▸ ** keccak** (a: * ` any ` * , bits?: * ` number ` * ): ` Buffer `
595595
596- * Defined in [ index .ts:177 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L177 ) *
596+ * Defined in [ hash .ts:13 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/hash .ts#L13 ) *
597597
598598Creates Keccak hash of the input
599599
600600** Parameters:**
601601
602602| Name | Type | Default value | Description |
603603| ------ | ------ | ------ | ------ |
604- | a | ` any ` | - | The input data (Buffer\| Array\| String\| Number) |
604+ | a | ` any ` | - | The input data (Buffer\| Array\| String\| Number) If the string is a 0x-prefixed hex value it's interpreted as hexadecimal, otherwise as utf8. |
605605| ` Default value ` bits | ` number ` | 256 | The Keccak width |
606606
607607** Returns:** ` Buffer `
613613
614614▸ ** keccak256** (a: * ` any ` * ): ` Buffer `
615615
616- * Defined in [ index .ts:190 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L190 ) *
616+ * Defined in [ hash .ts:31 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/hash .ts#L31 ) *
617617
618618Creates Keccak-256 hash of the input, alias for keccak(a, 256).
619619
632632
633633▸ ** privateToAddress** (privateKey: * ` Buffer ` * ): ` Buffer `
634634
635- * Defined in [ index .ts:388 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L388 ) *
635+ * Defined in [ account .ts:157 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L157 ) *
636636
637637Returns the ethereum address of a given private key.
638638
651651
652652▸ ** privateToPublic** (privateKey: * ` Buffer ` * ): ` Buffer `
653653
654- * Defined in [ index .ts:277 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L277 ) *
654+ * Defined in [ account .ts:165 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L165 ) *
655655
656656Returns the ethereum public key of a given private key.
657657
670670
671671▸ ** pubToAddress** (pubKey: * ` Buffer ` * , sanitize?: * ` boolean ` * ): ` Buffer `
672672
673- * Defined in [ index .ts:262 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L262 ) *
673+ * Defined in [ account .ts:142 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L142 ) *
674674
675675Returns the ethereum address of a given public key. Accepts "Ethereum public keys" and SEC1 encoded keys.
676676
690690
691691▸ ** ripemd160** (a: * ` any ` * , padded: * ` boolean ` * ): ` Buffer `
692692
693- * Defined in [ index .ts:210 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L210 ) *
693+ * Defined in [ hash .ts:51 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/hash .ts#L51 ) *
694694
695695Creates RIPEMD160 hash of the input.
696696
710710
711711▸ ** rlphash** (a: * ` rlp.Input ` * ): ` Buffer `
712712
713- * Defined in [ index .ts:226 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L226 ) *
713+ * Defined in [ hash .ts:67 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/hash .ts#L67 ) *
714714
715715Creates SHA-3 hash of the RLP encoded version of the input.
716716
729729
730730▸ ** setLengthLeft** (msg: * ` any ` * , length: * ` number ` * , right?: * ` boolean ` * ): ` any `
731731
732- * Defined in [ index .ts:62 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L62 ) *
732+ * Defined in [ bytes .ts:20 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L20 ) *
733733
734734Left Pads an ` Array ` or ` Buffer ` with leading zeros till it has ` length ` bytes. Or it truncates the beginning if it exceeds.
735735
751751
752752▸ ** setLengthRight** (msg: * ` any ` * , length: * ` number ` * ): ` any `
753753
754- * Defined in [ index .ts:88 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L88 ) *
754+ * Defined in [ bytes .ts:46 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L46 ) *
755755
756756Right Pads an ` Array ` or ` Buffer ` with leading zeros till it has ` length ` bytes. Or it truncates the beginning if it exceeds.
757757
772772
773773▸ ** sha256** (a: * ` any ` * ): ` Buffer `
774774
775- * Defined in [ index .ts:198 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L198 ) *
775+ * Defined in [ hash .ts:39 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/hash .ts#L39 ) *
776776
777777Creates SHA256 hash of the input.
778778
791791
792792▸ ** toBuffer** (v: * ` any ` * ): ` Buffer `
793793
794- * Defined in [ index .ts:112 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L112 ) *
794+ * Defined in [ bytes .ts:70 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L70 ) *
795795
796796Attempts to turn a value into a ` Buffer ` . As input it supports ` Buffer ` , ` String ` , ` Number ` , null/undefined, ` BN ` and other objects with a ` toArray() ` method.
797797
810810
811811▸ ** toChecksumAddress** (address: * ` string ` * ): ` string `
812812
813- * Defined in [ index .ts:410 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L410 ) *
813+ * Defined in [ account .ts:35 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L35 ) *
814814
815815Returns a checksummed address.
816816
829829
830830▸ ** toRpcSig** (v: * ` number ` * , r: * ` Buffer ` * , s: * ` Buffer ` * , chainId?: * ` undefined ` \| ` number ` * ): ` string `
831831
832- * Defined in [ index .ts:349 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L349 ) *
832+ * Defined in [ signature .ts:56 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/signature .ts#L56 ) *
833833
834834Convert signature parameters into the format of ` eth_sign ` RPC method.
835835
852852
853853▸ ** toUnsigned** (num: * ` BN ` * ): ` Buffer `
854854
855- * Defined in [ index .ts:168 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L168 ) *
855+ * Defined in [ bytes .ts:128 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L128 ) *
856856
857857Converts a ` BN ` to an unsigned integer and returns it as a ` Buffer ` . Assumes 256-bit numbers.
858858
871871
872872▸ ** unpad** (a: * ` any ` * ): ` any `
873873
874- * Defined in [ index .ts:97 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L97 ) *
874+ * Defined in [ bytes .ts:55 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L55 ) *
875875
876876Trims leading zeros from a ` Buffer ` or an ` Array ` .
877877
891891
892892▸ ** zeroAddress** (): ` string `
893893
894- * Defined in [ index .ts:48 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L48 ) *
894+ * Defined in [ account .ts:11 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account .ts#L11 ) *
895895
896896Returns a zero address.
897897
904904
905905▸ ** zeros** (bytes: * ` number ` * ): ` Buffer `
906906
907- * Defined in [ index .ts:41 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/index .ts#L41 ) *
907+ * Defined in [ bytes .ts:8 ] ( https://github.com/ethereumjs/ethereumjs-util/blob/master/src/bytes .ts#L8 ) *
908908
909909Returns a buffer filled with 0s.
910910
0 commit comments