@ethereumjs/wallet / Wallet
Defined in: wallet.ts:273
new Wallet(
privateKey?,publicKey?):Wallet
Defined in: wallet.ts:277
Uint8Array<ArrayBufferLike>
Uint8Array<ArrayBufferLike>
Wallet
getAddress():
Uint8Array
Defined in: wallet.ts:570
Returns the wallet’s address.
Uint8Array
getAddressString():
`0x${string}`
Defined in: wallet.ts:577
Returns the wallet’s address as a “0x” prefixed hex string
`0x${string}`
getChecksumAddressString():
`0x${string}`
Defined in: wallet.ts:585
Returns the wallet’s private key as a “0x” prefixed hex string checksummed according to EIP 55.
`0x${string}`
getPrivateKey():
Uint8Array
Defined in: wallet.ts:545
Returns the wallet’s private key.
Uint8Array
getPrivateKeyString():
`0x${string}`
Defined in: wallet.ts:549
`0x${string}`
getPublicKey():
Uint8Array
Defined in: wallet.ts:556
Returns the wallet’s public key.
Uint8Array
getPublicKeyString():
`0x${string}`
Defined in: wallet.ts:563
Returns the wallet’s public key as a “0x” prefixed hex string
`0x${string}`
getV3Filename(
timestamp?):string
Defined in: wallet.ts:657
Return the suggested filename for V3 keystores.
number
string
toV3(
password,opts?):Promise<V3Keystore>
Defined in: wallet.ts:595
Returns an Ethereum Version 3 Keystore Format object representing the wallet
string
The password used to encrypt the Keystore.
Partial<V3Params>
The options for the keystore. See its spec for more info.
Promise<V3Keystore>
toV3String(
password,opts?):Promise<string>
Defined in: wallet.ts:680
string
Partial<V3Params>
Promise<string>
verifyPublicKey(
publicKey):boolean
Defined in: wallet.ts:689
Verify the publicKey, privateKey pair
Uint8Array
the public key to verify against the private key of the wallet
boolean
staticfromEthSale(input,password):Promise<Wallet>
Defined in: wallet.ts:485
string | EthSaleKeystore
string
Promise<Wallet>
staticfromExtendedPrivateKey(extendedPrivateKey):Wallet
Defined in: wallet.ts:373
Create an instance based on a BIP32 extended private key (xprv)
string
Wallet
staticfromExtendedPublicKey(extendedPublicKey):Wallet
Defined in: wallet.ts:354
Create an instance based on a BIP32 extended public key (xpub)
string
Wallet
staticfromPrivateKey(privateKey):Wallet
Defined in: wallet.ts:366
Create an instance based on a raw private key
Uint8Array
Wallet
staticfromPublicKey(publicKey,nonStrict?):Wallet
Defined in: wallet.ts:344
Create an instance based on a public key (certain methods will not be available)
This method only accepts uncompressed Ethereum-style public keys, unless
the nonStrict flag is set to true.
Uint8Array
boolean = false
Wallet
staticfromV1(input,password):Promise<Wallet>
Defined in: wallet.ts:390
Import a wallet (Version 1 of the Ethereum wallet format).
string | V1Keystore
A JSON serialized string, or an object representing V1 Keystore.
string
The keystore password.
Promise<Wallet>
staticfromV3(input,password,nonStrict?):Promise<Wallet>
Defined in: wallet.ts:425
Import a wallet (Version 3 of the Ethereum wallet format). Set nonStrict true to accept files with mixed-caps.
string | V3Keystore
A JSON serialized string, or an object representing V3 Keystore.
string
The keystore password.
boolean = false
Promise<Wallet>
staticgenerate(icapDirect?):Wallet
Defined in: wallet.ts:304
Create an instance based on a new random key.
boolean = false
setting this to true will generate an address suitable for the ICAP Direct mode
Wallet
staticgenerateVanityAddress(pattern):Wallet
Defined in: wallet.ts:322
Create an instance where the address is valid against the supplied pattern (this will be very slow)
string | RegExp
Wallet