@cere-ddc-sdk/ddc / Signer
This abstract class provides a blueprint for creating different types of signers.
Example
class MySigner extends Signer {
// Implement abstract properties and methods...
}
const mySigner = new MySigner();
const isReady = await mySigner.isReady();
console.log(isReady);
-
Signer
▸ isReady(): Promise
<boolean
>
Checks if the signer is ready.
Promise
<boolean
>
A promise that resolves to a boolean indicating whether the signer is ready.
▸ sign(data
): Promise
<Uint8Array
>
Signs data with the signer.
Name | Type | Description |
---|---|---|
data |
string | Uint8Array |
The data to sign. |
Promise
<Uint8Array
>
A promise that resolves to the signature.
▸ unlock(passphrase?
): Promise
<void
>
Unlocks the signer with a passphrase.
Name | Type | Description |
---|---|---|
passphrase? |
string |
The passphrase to unlock the signer. |
Promise
<void
>
▸ isSigner(signer
): signer is Signer
Checks if an object is a signer.
Name | Type | Description |
---|---|---|
signer |
unknown |
The object to check. |
signer is Signer
A boolean indicating whether the object is a signer.
• Readonly
Abstract
address: string
The address of the signer.
• Readonly
Abstract
isLocked: boolean
A boolean indicating whether the signer is locked.
• Readonly
Abstract
publicKey: Uint8Array
The public key of the signer.
• Readonly
Abstract
type: KeypairType
The type of the signer ('ed25519' or 'sr25519').