Fordefi Signer
FordefiSigner
is a signer implementation which extends SmartAccountAuthenticator
to leverage the Fordefi Web3 Provider. It supports features such as authentication, message and typed data signing, and authentication details retrieval.
FordefiSigner
provides implementations for all methods on SmartAccountAuthenticator
:
authenticate
-- supports user authentication.getAddress
-- gets the address of the smart contract account's connected EOA signer account.signMessage
-- supports message signatures.signTypedData
-- supports typed data signatures.getAuthDetails
-- verifies that this signer is authenticated, it does not return any details.
Install Dependencies
FordefiSigner
requires installation of the @fordefi/web3-provider
SDK. aa-signers
lists it as an optional dependency.
npm
npm i -s @fordefi/web3-provider
Usage
example.ts
import { createFordefiSigner } from "./fordefi";
const fordefiSigner = await createFordefiSigner();
const address = await fordefiSigner.getAddress();
const details = await fordefiSigner.getAuthDetails();
const signedMessage = await fordefiSigner.signMessage("test");
const typedData = {
types: {
Request: [{ name: "hello", type: "string" }],
},
primaryType: "Request",
message: {
hello: "world",
},
};
const signTypedData = await fordefiSigner.signTypedData(typedData);