@celo/wallet-rpc › "rpc-wallet" › RpcWallet
Class: RpcWallet
Hierarchy
- RemoteWallet‹RpcSigner›
↳ RpcWallet
Implements
- ReadOnlyWallet
- ReadOnlyWallet
- UnlockableWallet
Index
Constructors
Properties
Methods
- addAccount
- computeSharedSecret
- decrypt
- getAccounts
- hasAccount
- init
- isAccountUnlocked
- loadAccountSigners
- removeAccount
- signPersonalMessage
- signTransaction
- signTypedData
- unlockAccount
Constructors
constructor
+ new RpcWallet(_provider
: Provider): RpcWallet
Defined in wallet-rpc/src/rpc-wallet.ts:18
Parameters:
Name | Type |
---|---|
_provider |
Provider |
Returns: RpcWallet
Properties
isSetupFinished
• isSetupFinished: function
Inherited from RpcWallet.isSetupFinished
Defined in wallet-remote/lib/remote-wallet.d.ts:51
Type declaration:
▸ (): boolean
Methods
addAccount
▸ addAccount(privateKey
: string, passphrase
: string): Promise‹string›
Defined in wallet-rpc/src/rpc-wallet.ts:38
Parameters:
Name | Type |
---|---|
privateKey |
string |
passphrase |
string |
Returns: Promise‹string›
computeSharedSecret
▸ computeSharedSecret(address
: Address, publicKey
: string): Promise‹Buffer›
Inherited from RpcWallet.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 RpcWallet.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 RpcWallet.getAccounts
Overrides void
Defined in wallet-remote/lib/remote-wallet.d.ts:27
Get a list of accounts in the remote wallet
Returns: Address[]
hasAccount
▸ hasAccount(address?
: Address): boolean
Inherited from RpcWallet.hasAccount
Overrides void
Defined in wallet-remote/lib/remote-wallet.d.ts:32
Returns true if account is in the remote wallet
Parameters:
Name | Type | Description |
---|---|---|
address? |
Address | Account to check |
Returns: boolean
init
▸ init(): Promise‹void›
Defined in wallet-remote/lib/remote-wallet.d.ts:15
Discovers wallet accounts and caches results in memory Idempotent to ensure multiple calls are benign
Returns: Promise‹void›
isAccountUnlocked
▸ isAccountUnlocked(address
: string): boolean
Defined in wallet-rpc/src/rpc-wallet.ts:54
Parameters:
Name | Type |
---|---|
address |
string |
Returns: boolean
loadAccountSigners
▸ loadAccountSigners(): Promise‹Map‹string, RpcSigner››
Overrides void
Defined in wallet-rpc/src/rpc-wallet.ts:25
Returns: Promise‹Map‹string, RpcSigner››
removeAccount
▸ removeAccount(_address
: string): void
Inherited from RpcWallet.removeAccount
Defined in wallet-base/lib/wallet-base.d.ts:23
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›
Inherited from RpcWallet.signPersonalMessage
Overrides void
Defined in wallet-remote/lib/remote-wallet.d.ts:43
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›
Overrides void
Defined in wallet-rpc/src/rpc-wallet.ts:64
Gets the signer based on the 'from' field in the tx body
dev
overrides WalletBase.signTransaction
Parameters:
Name | Type | Description |
---|---|---|
txParams |
CeloTx | Transaction to sign |
Returns: Promise‹EncodedTransaction›
signTypedData
▸ signTypedData(address
: Address, typedData
: EIP712TypedData): Promise‹string›
Inherited from RpcWallet.signTypedData
Overrides void
Defined in wallet-remote/lib/remote-wallet.d.ts:49
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)
unlockAccount
▸ unlockAccount(address
: string, passphrase
: string, duration
: number): Promise‹boolean›
Defined in wallet-rpc/src/rpc-wallet.ts:49
Parameters:
Name | Type |
---|---|
address |
string |
passphrase |
string |
duration |
number |
Returns: Promise‹boolean›