@celo/wallet-base › "wallet-base" › WalletBase
Class: WalletBase <TSigner>
Type parameters
▪ TSigner: Signer
Hierarchy
- WalletBase
Implements
- ReadOnlyWallet
Index
Methods
- computeSharedSecret
- decrypt
- getAccounts
- hasAccount
- removeAccount
- signPersonalMessage
- signTransaction
- signTypedData
Methods
computeSharedSecret
▸ computeSharedSecret(address
: Address, publicKey
: string): Promise‹Buffer›
Defined in wallets/wallet-base/src/wallet-base.ts:140
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‹››
Defined in wallets/wallet-base/src/wallet-base.ts:132
Parameters:
Name | Type |
---|---|
address |
string |
ciphertext |
Buffer |
Returns: Promise‹Buffer‹››
getAccounts
▸ getAccounts(): Address[]
Defined in wallets/wallet-base/src/wallet-base.ts:27
Gets a list of accounts that have been registered
Returns: Address[]
hasAccount
▸ hasAccount(address?
: Address): boolean
Defined in wallets/wallet-base/src/wallet-base.ts:43
Returns true if account has been registered
Parameters:
Name | Type | Description |
---|---|---|
address? |
Address | Account to check |
Returns: boolean
removeAccount
▸ removeAccount(_address
: string): void
Defined in wallets/wallet-base/src/wallet-base.ts:35
Removes the account with the given address. Needs to be implemented by subclass, otherwise throws error
Parameters:
Name | Type |
---|---|
_address |
string |
Returns: void
signPersonalMessage
▸ signPersonalMessage(address
: Address, data
: string): Promise‹string›
Defined in wallets/wallet-base/src/wallet-base.ts:96
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›
Defined in wallets/wallet-base/src/wallet-base.ts:75
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›
Defined in wallets/wallet-base/src/wallet-base.ts:113
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)