Wallet

Wallet

Wallet to manager accounts.

Kind: global class

new Wallet(networkId)

ParamType

networkId

number

wallet.setNetworkId(networkId)

Set network id

Kind: instance method of Wallet

ParamType

networkId

number

wallet.has(address) ⇒ boolean

Check if address exist

Kind: instance method of Wallet

ParamType

address

string

wallet.delete(address) ⇒ boolean

Drop one account by address

Kind: instance method of Wallet

ParamType

address

string

wallet.clear()

Drop all account in wallet

Kind: instance method of Wallet

wallet.set(address, account) ⇒ any

Kind: instance method of Wallet

ParamTypeDescription

address

any

Key of account, usually is address

account

any

Account instance

wallet.get(address) ⇒ Account

Kind: instance method of Wallet

ParamType

address

string

wallet.addPrivateKey(privateKey) ⇒ PrivateKeyAccount

Kind: instance method of Wallet

ParamTypeDescription

privateKey

string | Buffer

Private key of account

wallet.addRandom([entropy]) ⇒ PrivateKeyAccount

Kind: instance method of Wallet

ParamTypeDescription

[entropy]

string | Buffer

Entropy of random account

wallet.addKeystore(keystore, password) ⇒ PrivateKeyAccount

Kind: instance method of Wallet

ParamTypeDescription

keystore

object

Keystore version 3 object.

password

string | Buffer

Password for keystore to decrypt with.

Last updated