Skip to content

Latest commit

 

History

History
421 lines (238 loc) · 11 KB

wallet.md

File metadata and controls

421 lines (238 loc) · 11 KB

ethereumjs-wallet > Wallet

Class: Wallet

Hierarchy

Wallet

Index

Constructors

Properties

Accessors

Methods


Constructors

constructor

new Wallet(privateKey: Buffer | undefined, publicKey?: Buffer | undefined): Wallet

Defined in index.ts:229

Parameters:

Name Type Default value
Optional privateKey Buffer | undefined -
Default value publicKey Buffer | undefined undefined

Returns: Wallet


Properties

<Private>``<Optional> privateKey

● privateKey: Buffer | undefined

Defined in index.ts:231


<Private> publicKey

● publicKey: Buffer | undefined

Defined in index.ts:232


Accessors

<Private> privKey

privKey:

Defined in index.ts:480


<Private> pubKey

pubKey:

Defined in index.ts:470


Methods

getAddress

getAddress(): Buffer

Defined in index.ts:520

Returns: Buffer


getAddressString

getAddressString(): string

Defined in index.ts:527

Returns: string


getChecksumAddressString

getChecksumAddressString(): string

Defined in index.ts:535

Returns: string


getPrivateKey

getPrivateKey(): Buffer

Defined in index.ts:494

Returns: Buffer


getPrivateKeyString

getPrivateKeyString(): string

Defined in index.ts:498

Returns: string


getPublicKey

getPublicKey(): Buffer

Defined in index.ts:506

Returns: Buffer


getPublicKeyString

getPublicKeyString(): string

Defined in index.ts:513

Returns: string


getV3Filename

getV3Filename(timestamp: undefined | number): string

Defined in index.ts:617

Parameters:

Name Type
Optional timestamp undefined | number

Returns: string


toV3

toV3(password: string, opts: Partial<V3Params>): V3Keystore

Defined in index.ts:545

Parameters:

Name Type Description
password string The password used to encrypt the Keystore.
Optional opts Partial<V3Params> The options for the keystore. See its spec for more info.

Returns: V3Keystore


toV3String

toV3String(password: string, opts: Partial<V3Params>): string

Defined in index.ts:635

Parameters:

Name Type
password string
Optional opts Partial<V3Params>

Returns: string


<Static> fromEthSale

fromEthSale(input: string | EthSaleKeystore, password: string): Wallet

Defined in index.ts:444

Parameters:

Name Type
input string | EthSaleKeystore
password string

Returns: Wallet


<Static> fromExtendedPrivateKey

fromExtendedPrivateKey(extendedPrivateKey: string): Wallet

Defined in index.ts:321

Parameters:

Name Type
extendedPrivateKey string

Returns: Wallet


<Static> fromExtendedPublicKey

fromExtendedPublicKey(extendedPublicKey: string): Wallet

Defined in index.ts:302

Parameters:

Name Type
extendedPublicKey string

Returns: Wallet


<Static> fromPrivateKey

fromPrivateKey(privateKey: Buffer): Wallet

Defined in index.ts:314

Parameters:

Name Type
privateKey Buffer

Returns: Wallet


<Static> fromPublicKey

fromPublicKey(publicKey: Buffer, nonStrict?: boolean): Wallet

Defined in index.ts:292

Parameters:

Name Type Default value
publicKey Buffer -
Default value nonStrict boolean false

Returns: Wallet


<Static> fromV1

fromV1(input: string | V1Keystore, password: string): Wallet

Defined in index.ts:338

Parameters:

Name Type Description
input string | V1Keystore A JSON serialized string, or an object representing V1 Keystore.
password string The keystore password.

Returns: Wallet


<Static> fromV3

fromV3(input: string | V3Keystore, password: string, nonStrict?: boolean): Wallet

Defined in index.ts:378

Parameters:

Name Type Default value Description
input string | V3Keystore - A JSON serialized string, or an object representing V3 Keystore.
password string - The keystore password.
Default value nonStrict boolean false

Returns: Wallet


<Static> generate

generate(icapDirect?: boolean): Wallet

Defined in index.ts:254

Parameters:

Name Type Default value Description
Default value icapDirect boolean false setting this to `true` will generate an address suitable for the `ICAP Direct mode`

Returns: Wallet


<Static> generateVanityAddress

generateVanityAddress(pattern: RegExp | string): Wallet

Defined in index.ts:271

Parameters:

Name Type
pattern RegExp | string

Returns: Wallet