signAuthorization
Signs an EIP-7702 Authorization and then returns the authorization with the signature.
Import
Usage
import { class AlchemyWebSignerA SmartAccountSigner that can be used with any SmartContractAccount
AlchemyWebSigner } from "@account-kit/signer";
const const signer: AlchemyWebSignersigner = new new AlchemyWebSigner(params: AlchemySignerParams): AlchemyWebSignerInitializes an instance with the provided Alchemy signer parameters after parsing them with a schema.
AlchemyWebSigner({
client: ({
connection: {
apiKey: string;
rpcUrl?: undefined;
jwt?: undefined;
} | {
jwt: string;
rpcUrl?: undefined;
apiKey?: undefined;
} | {
rpcUrl: string;
apiKey?: undefined;
jwt?: undefined;
} | {
rpcUrl: string;
jwt: string;
apiKey?: undefined;
};
... 4 more ...;
enablePopupOauth?: boolean | undefined;
} | AlchemySignerWebClient) & (AlchemySignerWebClient | ... 1 more ... | undefined)client: {
connection: {
rpcUrl: string;
}connection: {
rpcUrl: stringrpcUrl: "/api/rpc",
},
iframeConfig: {
iframeContainerId: string;
}iframeConfig: {
iframeContainerId: stringiframeContainerId: "alchemy-signer-iframe-container",
},
},
});
const const tx: Authorization<number, true>tx = await const signer: AlchemyWebSignersigner.BaseAlchemySigner<AlchemySignerWebClient>.signAuthorization: (unsignedAuthorization: Authorization<number, false>) => Promise<Authorization<number, true>>Signs an EIP-7702 Authorization and then returns the authorization with the signature.
signAuthorization({
contractAddress: stringcontractAddress: "0x1234123412341234123412341234123412341234",
chainId: numberChain ID.
chainId: 1,
nonce: numberNonce of the EOA to delegate to.
nonce: 0,
});
Parameters
unsignedAuthorization
AuthorizationRequest<number>
the authorization to be signed
Returns
Promise<SignedAuthorization<number>> | undefined
a promise that resolves to the authorization with the signature