@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:562
Returns the wallet’s address.
Uint8Array
getAddressString():
`0x${string}`
Defined in: wallet.ts:569
Returns the wallet’s address as a “0x” prefixed hex string
`0x${string}`
getChecksumAddressString():
`0x${string}`
Defined in: wallet.ts:577
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:537
Returns the wallet’s private key.
Uint8Array
getPrivateKeyString():
`0x${string}`
Defined in: wallet.ts:541
`0x${string}`
getPublicKey():
Uint8Array
Defined in: wallet.ts:548
Returns the wallet’s public key.
Uint8Array
getPublicKeyString():
`0x${string}`
Defined in: wallet.ts:555
Returns the wallet’s public key as a “0x” prefixed hex string
`0x${string}`
getV3Filename(
timestamp?
):string
Defined in: wallet.ts:647
Return the suggested filename for V3 keystores.
number
string
toV3(
password
,opts?
):Promise
<V3Keystore
>
Defined in: wallet.ts:587
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:668
string
Partial
<V3Params
>
Promise
<string
>
verifyPublicKey(
publicKey
):boolean
Defined in: wallet.ts:677
Verify the publicKey, privateKey pair
Uint8Array
the public key to verify against the private key of the wallet
boolean
static
fromEthSale(input
,password
):Promise
<Wallet
>
Defined in: wallet.ts:479
string |
EthSaleKeystore |
string
Promise
<Wallet
>
static
fromExtendedPrivateKey(extendedPrivateKey
):Wallet
Defined in: wallet.ts:371
Create an instance based on a BIP32 extended private key (xprv)
string
Wallet
static
fromExtendedPublicKey(extendedPublicKey
):Wallet
Defined in: wallet.ts:352
Create an instance based on a BIP32 extended public key (xpub)
string
Wallet
static
fromPrivateKey(privateKey
):Wallet
Defined in: wallet.ts:364
Create an instance based on a raw private key
Uint8Array
Wallet
static
fromPublicKey(publicKey
,nonStrict
):Wallet
Defined in: wallet.ts:342
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
static
fromV1(input
,password
):Promise
<Wallet
>
Defined in: wallet.ts:388
Import a wallet (Version 1 of the Ethereum wallet format).
A JSON serialized string, or an object representing V1 Keystore.
string |
V1Keystore |
string
The keystore password.
Promise
<Wallet
>
static
fromV3(input
,password
,nonStrict
):Promise
<Wallet
>
Defined in: wallet.ts:421
Import a wallet (Version 3 of the Ethereum wallet format). Set nonStrict
true to accept files with mixed-caps.
A JSON serialized string, or an object representing V3 Keystore.
string |
V3Keystore |
string
The keystore password.
boolean
= false
Promise
<Wallet
>
static
generate(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
static
generateVanityAddress(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