Skip to content

Latest commit

 

History

History
113 lines (77 loc) · 3.17 KB

Wallet.md

File metadata and controls

113 lines (77 loc) · 3.17 KB

Wallet

Wallet to manager accounts.

Kind: global class

new Wallet(networkId)

Param Type
networkId number

wallet.setNetworkId(networkId)

Set network id

Kind: instance method of Wallet

Param Type
networkId number

wallet.has(address) ⇒ boolean

Check if address exist

Kind: instance method of Wallet

Param Type
address string

wallet.delete(address) ⇒ boolean

Drop one account by address

Kind: instance method of Wallet

Param Type
address string

wallet.clear()

Drop all account in wallet

Kind: instance method of Wallet

wallet.set(address, account) ⇒ any

Kind: instance method of Wallet

Param Type Description
address any Key of account, usually is address
account any Account instance

wallet.get(address) ⇒ Account

Kind: instance method of Wallet

Param Type
address string

wallet.addPrivateKey(privateKey) ⇒ PrivateKeyAccount

Kind: instance method of Wallet

Param Type Description
privateKey string | Buffer Private key of account

wallet.addRandom([entropy]) ⇒ PrivateKeyAccount

Kind: instance method of Wallet

Param Type Description
[entropy] string | Buffer Entropy of random account

wallet.addKeystore(keystore, password) ⇒ PrivateKeyAccount

Kind: instance method of Wallet

Param Type Description
keystore object Keystore version 3 object.
password string | Buffer Password for keystore to decrypt with.