Signer
The interface all signing implementations satisfy. signTx signs a tx; signArbitrary signs an off-chain payload.
Definition
type Signer = {
getKeyHash(): Promise<KeyHash>
signTx(signDoc: SignDoc): Promise<SignatureOutcome>
signArbitrary<T extends JsonValue = JsonValue>(
payload: ArbitraryDoc<T>,
): Promise<ArbitrarySignatureOutcome>
}Methods
getKeyHash() — return the KeyHash of the key this signer uses.
signTx(signDoc) — sign an EIP-712-typed transaction document. Returns the credential plus the (possibly re-shaped) signed payload.
signArbitrary(payload) — sign an arbitrary typed data payload. Used for session creation and off-chain proofs.
Built-in implementations
PrivateKeySigner— local secp256k1 key.createSessionSigner— session key + stored authorization. Note:signArbitrarysignspayload.messagerather than the full payload.