@celo/wallet-local › "local-wallet" › LocalWallet
Class: LocalWallet
Hierarchy
- WalletBase‹LocalSigner›
↳ LocalWallet
Implements
- ReadOnlyWallet
- Wallet
Index
Methods
- addAccount
- computeSharedSecret
- decrypt
- getAccounts
- hasAccount
- removeAccount
- signPersonalMessage
- signTransaction
- signTypedData
Methods
addAccount
▸ addAccount(privateKey
: string): void
Defined in wallet-local/src/local-wallet.ts:10
Register the private key as signer account
Parameters:
Name | Type | Description |
---|---|---|
privateKey |
string | account private key |
Returns: void
computeSharedSecret
▸ computeSharedSecret(address
: Address, publicKey
: string): Promise‹Buffer›
Inherited from LocalWallet.computeSharedSecret
Defined in wallet-base/lib/wallet-base.d.ts:64
Computes the shared secret (an ECDH key exchange object) between two accounts
Parameters:
Name | Type |
---|---|
address |
Address |
publicKey |
string |
Returns: Promise‹Buffer›
decrypt
▸ decrypt(address
: string, ciphertext
: Buffer): Promise‹Buffer›
Inherited from LocalWallet.decrypt
Defined in wallet-base/lib/wallet-base.d.ts:60
Parameters:
Name | Type |
---|---|
address |
string |
ciphertext |
Buffer |
Returns: Promise‹Buffer›
getAccounts
▸ getAccounts(): Address[]
Inherited from LocalWallet.getAccounts
Defined in wallet-base/lib/wallet-base.d.ts:18
Gets a list of accounts that have been registered
Returns: Address[]
hasAccount
▸ hasAccount(address?
: Address): boolean
Inherited from LocalWallet.hasAccount
Defined in wallet-base/lib/wallet-base.d.ts:28
Returns true if account has been registered
Parameters:
Name | Type | Description |
---|---|---|
address? |
Address | Account to check |
Returns: boolean
removeAccount
▸ removeAccount(address
: Address): void
Overrides void
Defined in wallet-local/src/local-wallet.ts:24
Remove the account
Parameters:
Name | Type | Description |
---|---|---|
address |
Address | Adddress of the account to remove |
Returns: void
signPersonalMessage
▸ signPersonalMessage(address
: Address, data
: string): Promise‹string›
Inherited from LocalWallet.signPersonalMessage
Defined in wallet-base/lib/wallet-base.d.ts:51
Sign a personal Ethereum signed message.
Parameters:
Name | Type | Description |
---|---|---|
address |
Address | Address of the account to sign with |
data |
string | Hex string message to sign |
Returns: Promise‹string›
Signature hex string (order: rsv)
signTransaction
▸ signTransaction(txParams
: CeloTx): Promise‹EncodedTransaction›
Inherited from LocalWallet.signTransaction
Defined in wallet-base/lib/wallet-base.d.ts:44
Gets the signer based on the 'from' field in the tx body
Parameters:
Name | Type | Description |
---|---|---|
txParams |
CeloTx | Transaction to sign |
Returns: Promise‹EncodedTransaction›
signTypedData
▸ signTypedData(address
: Address, typedData
: EIP712TypedData): Promise‹string›
Inherited from LocalWallet.signTypedData
Defined in wallet-base/lib/wallet-base.d.ts:58
Sign an EIP712 Typed Data message.
Parameters:
Name | Type | Description |
---|---|---|
address |
Address | Address of the account to sign with |
typedData |
EIP712TypedData | the typed data object |
Returns: Promise‹string›
Signature hex string (order: rsv)