Wallet
Wallet
Wallet to manager accounts.
Kind: global class
.has(address) ⇒
boolean
.delete(address) ⇒
boolean
.set(address, account) ⇒
any
.get(address) ⇒
Account
.addPrivateKey(privateKey) ⇒
PrivateKeyAccount
.addRandom([entropy]) ⇒
PrivateKeyAccount
.addKeystore(keystore, password) ⇒
PrivateKeyAccount
new Wallet(networkId)
Param | Type |
---|---|
networkId |
|
wallet.setNetworkId(networkId)
Set network id
Kind: instance method of Wallet
Param | Type |
---|---|
networkId |
|
wallet.has(address) ⇒ boolean
boolean
Check if address exist
Kind: instance method of Wallet
Param | Type |
---|---|
address |
|
wallet.delete(address) ⇒ boolean
boolean
Drop one account by address
Kind: instance method of Wallet
Param | Type |
---|---|
address |
|
wallet.clear()
Drop all account in wallet
Kind: instance method of Wallet
wallet.set(address, account) ⇒ any
any
Kind: instance method of Wallet
Param | Type | Description |
---|---|---|
address |
| Key of account, usually is |
account |
| Account instance |
wallet.get(address) ⇒ Account
Account
Kind: instance method of Wallet
Param | Type |
---|---|
address |
|
wallet.addPrivateKey(privateKey) ⇒ PrivateKeyAccount
PrivateKeyAccount
Kind: instance method of Wallet
Param | Type | Description |
---|---|---|
privateKey |
| Private key of account |
wallet.addRandom([entropy]) ⇒ PrivateKeyAccount
PrivateKeyAccount
Kind: instance method of Wallet
Param | Type | Description |
---|---|---|
[entropy] |
| Entropy of random account |
wallet.addKeystore(keystore, password) ⇒ PrivateKeyAccount
PrivateKeyAccount
Kind: instance method of Wallet
Param | Type | Description |
---|---|---|
keystore |
| Keystore version 3 object. |
password |
| Password for keystore to decrypt with. |
Last updated