@celo/wallet-rpc › "rpc-signer" › RpcSigner
Class: RpcSigner
Implements the signer interface on top of the JSON-RPC interface.
Hierarchy
- RpcSigner
Implements
- Signer
Index
Constructors
Methods
- computeSharedSecret
- decrypt
- getNativeKey
- init
- isUnlocked
- signPersonalMessage
- signRawTransaction
- signTransaction
- signTypedData
- unlock
Constructors
constructor
+ new RpcSigner(rpc
: RpcCaller, account
: string, unlockBufferSeconds
: number, unlockTime?
: undefined | number, unlockDuration?
: undefined | number): RpcSigner
Defined in wallet-rpc/src/rpc-signer.ts:54
Construct a new instance of the RPC signer
Parameters:
Name | Type | Default | Description |
---|---|---|---|
rpc |
RpcCaller | - | RPC caller instance |
account |
string | - | Account address derived from the private key to be called in init |
unlockBufferSeconds |
number | 5 | Number of seconds to shrink the unlocked duration by to account for latency and timing inconsistencies on the node |
unlockTime? |
undefined | number | - | Timestamp in seconds when the signer was last unlocked |
unlockDuration? |
undefined | number | - | Number of seconds that the signer was last unlocked for |
Returns: RpcSigner
Methods
computeSharedSecret
▸ computeSharedSecret(_publicKey
: string): Promise‹Buffer‹››
Defined in wallet-rpc/src/rpc-signer.ts:169
Parameters:
Name | Type |
---|---|
_publicKey |
string |
Returns: Promise‹Buffer‹››
decrypt
▸ decrypt(ciphertext
: Buffer): Promise‹Buffer‹››
Defined in wallet-rpc/src/rpc-signer.ts:160
Parameters:
Name | Type |
---|---|
ciphertext |
Buffer |
Returns: Promise‹Buffer‹››
getNativeKey
▸ getNativeKey(): string
Defined in wallet-rpc/src/rpc-signer.ts:118
Returns: string
init
▸ init(privateKey
: string, passphrase
: string): Promise‹string›
Defined in wallet-rpc/src/rpc-signer.ts:74
Parameters:
Name | Type |
---|---|
privateKey |
string |
passphrase |
string |
Returns: Promise‹string›
isUnlocked
▸ isUnlocked(): boolean
Defined in wallet-rpc/src/rpc-signer.ts:142
Returns: boolean
signPersonalMessage
▸ signPersonalMessage(data
: string): Promise‹object›
Defined in wallet-rpc/src/rpc-signer.ts:110
Parameters:
Name | Type |
---|---|
data |
string |
Returns: Promise‹object›
signRawTransaction
▸ signRawTransaction(tx
: CeloTx): Promise‹EncodedTransaction›
Defined in wallet-rpc/src/rpc-signer.ts:80
Parameters:
Name | Type |
---|---|
tx |
CeloTx |
Returns: Promise‹EncodedTransaction›
signTransaction
▸ signTransaction(): Promise‹object›
Defined in wallet-rpc/src/rpc-signer.ts:97
Returns: Promise‹object›
signTypedData
▸ signTypedData(typedData
: EIP712TypedData): Promise‹object›
Defined in wallet-rpc/src/rpc-signer.ts:101
Parameters:
Name | Type |
---|---|
typedData |
EIP712TypedData |
Returns: Promise‹object›
unlock
▸ unlock(passphrase
: string, duration
: number): Promise‹boolean›
Defined in wallet-rpc/src/rpc-signer.ts:120
Parameters:
Name | Type |
---|---|
passphrase |
string |
duration |
number |
Returns: Promise‹boolean›