|
165 | 165 |
|
166 | 166 | **● publicToAddress**: *[pubToAddress]()* = pubToAddress |
167 | 167 |
|
168 | | -*Defined in [account.ts:160](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L160)* |
| 168 | +*Defined in [account.ts:163](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L163)* |
169 | 169 |
|
170 | 170 | ___ |
171 | 171 | <a id="setlength"></a> |
|
376 | 376 |
|
377 | 377 | ▸ **generateAddress**(from: *`Buffer`*, nonce: *`Buffer`*): `Buffer` |
378 | 378 |
|
379 | | -*Defined in [account.ts:72](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L72)* |
| 379 | +*Defined in [account.ts:75](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L75)* |
380 | 380 |
|
381 | 381 | Generates an address of a newly created contract. |
382 | 382 |
|
|
396 | 396 |
|
397 | 397 | ▸ **generateAddress2**(from: *`Buffer` \| `string`*, salt: *`Buffer` \| `string`*, initCode: *`Buffer` \| `string`*): `Buffer` |
398 | 398 |
|
399 | | -*Defined in [account.ts:92](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L92)* |
| 399 | +*Defined in [account.ts:95](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L95)* |
400 | 400 |
|
401 | 401 | Generates an address for a contract created using CREATE2. |
402 | 402 |
|
|
436 | 436 |
|
437 | 437 | ▸ **importPublic**(publicKey: *`Buffer`*): `Buffer` |
438 | 438 |
|
439 | | -*Defined in [account.ts:183](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L183)* |
| 439 | +*Defined in [account.ts:186](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L186)* |
440 | 440 |
|
441 | 441 | Converts a public key to the Ethereum format. |
442 | 442 |
|
|
455 | 455 |
|
456 | 456 | ▸ **isPrecompiled**(address: *`Buffer` \| `string`*): `boolean` |
457 | 457 |
|
458 | | -*Defined in [account.ts:114](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L114)* |
| 458 | +*Defined in [account.ts:117](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L117)* |
459 | 459 |
|
460 | 460 | Returns true if the supplied address belongs to a precompiled account (Byzantium). |
461 | 461 |
|
@@ -491,20 +491,20 @@ ___ |
491 | 491 |
|
492 | 492 | ### `<Const>` isValidChecksumAddress |
493 | 493 |
|
494 | | -▸ **isValidChecksumAddress**(address: *`string`*, chainId?: *`undefined` \| `number`*): `boolean` |
| 494 | +▸ **isValidChecksumAddress**(address: *`string`*, eip1191ChainId?: *`undefined` \| `number`*): `boolean` |
495 | 495 |
|
496 | | -*Defined in [account.ts:63](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L63)* |
| 496 | +*Defined in [account.ts:66](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L66)* |
497 | 497 |
|
498 | 498 | Checks if the address is a valid checksummed address. |
499 | 499 |
|
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. |
| 500 | +See toChecksumAddress' documentation for details about the eip1191ChainId parameter. |
501 | 501 |
|
502 | 502 | **Parameters:** |
503 | 503 |
|
504 | 504 | | Name | Type | |
505 | 505 | | ------ | ------ | |
506 | 506 | | address | `string` | |
507 | | -| `Optional` chainId | `undefined` \| `number` | |
| 507 | +| `Optional` eip1191ChainId | `undefined` \| `number` | |
508 | 508 |
|
509 | 509 | **Returns:** `boolean` |
510 | 510 |
|
|
515 | 515 |
|
516 | 516 | ▸ **isValidPrivate**(privateKey: *`Buffer`*): `boolean` |
517 | 517 |
|
518 | | -*Defined in [account.ts:122](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L122)* |
| 518 | +*Defined in [account.ts:125](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L125)* |
519 | 519 |
|
520 | 520 | Checks if the private key satisfies the rules of the curve secp256k1. |
521 | 521 |
|
|
534 | 534 |
|
535 | 535 | ▸ **isValidPublic**(publicKey: *`Buffer`*, sanitize?: *`boolean`*): `boolean` |
536 | 536 |
|
537 | | -*Defined in [account.ts:132](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L132)* |
| 537 | +*Defined in [account.ts:135](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L135)* |
538 | 538 |
|
539 | 539 | Checks if the public key satisfies the rules of the curve secp256k1 and the requirements of Ethereum. |
540 | 540 |
|
|
635 | 635 |
|
636 | 636 | ▸ **privateToAddress**(privateKey: *`Buffer`*): `Buffer` |
637 | 637 |
|
638 | | -*Defined in [account.ts:166](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L166)* |
| 638 | +*Defined in [account.ts:169](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L169)* |
639 | 639 |
|
640 | 640 | Returns the ethereum address of a given private key. |
641 | 641 |
|
|
654 | 654 |
|
655 | 655 | ▸ **privateToPublic**(privateKey: *`Buffer`*): `Buffer` |
656 | 656 |
|
657 | | -*Defined in [account.ts:174](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L174)* |
| 657 | +*Defined in [account.ts:177](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L177)* |
658 | 658 |
|
659 | 659 | Returns the ethereum public key of a given private key. |
660 | 660 |
|
|
673 | 673 |
|
674 | 674 | ▸ **pubToAddress**(pubKey: *`Buffer`*, sanitize?: *`boolean`*): `Buffer` |
675 | 675 |
|
676 | | -*Defined in [account.ts:151](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L151)* |
| 676 | +*Defined in [account.ts:154](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L154)* |
677 | 677 |
|
678 | 678 | Returns the ethereum address of a given public key. Accepts "Ethereum public keys" and SEC1 encoded keys. |
679 | 679 |
|
@@ -811,20 +811,22 @@ ___ |
811 | 811 |
|
812 | 812 | ### `<Const>` toChecksumAddress |
813 | 813 |
|
814 | | -▸ **toChecksumAddress**(address: *`string`*, chainId?: *`undefined` \| `number`*): `string` |
| 814 | +▸ **toChecksumAddress**(address: *`string`*, eip1191ChainId?: *`undefined` \| `number`*): `string` |
815 | 815 |
|
816 | | -*Defined in [account.ts:38](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L38)* |
| 816 | +*Defined in [account.ts:42](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L42)* |
817 | 817 |
|
818 | 818 | Returns a checksummed address. |
819 | 819 |
|
820 | | -If a chainId is provided, the result will be an EIP-1191 checksum. Otherwise, it will be an EIP-55 checksum. |
| 820 | +If a eip1191ChainId is provided, the chainId will be included in the checksum calculation. This has the effect of checksummed addresses for one chain having invalid checksums for others. For more details, consult EIP-1191. |
| 821 | + |
| 822 | +WARNING: Checksums with and without the chainId will differ. As of 2019-06-26, the most commonly used variation in Ethereum was without the chainId. This may change in the future. |
821 | 823 |
|
822 | 824 | **Parameters:** |
823 | 825 |
|
824 | 826 | | Name | Type | |
825 | 827 | | ------ | ------ | |
826 | 828 | | address | `string` | |
827 | | -| `Optional` chainId | `undefined` \| `number` | |
| 829 | +| `Optional` eip1191ChainId | `undefined` \| `number` | |
828 | 830 |
|
829 | 831 | **Returns:** `string` |
830 | 832 |
|
|
0 commit comments