signAuthorization

Signs an EIP-7702 Authorization and then returns the authorization with the signature.

Import

1import { BaseAlchemySigner } from "@account-kit/signer";

Usage

import { 
class AlchemyWebSigner

A SmartAccountSigner that can be used with any SmartContractAccount

AlchemyWebSigner
} from "@account-kit/signer";
const
const signer: AlchemyWebSigner
signer
= new
new AlchemyWebSigner(params: AlchemySignerParams): AlchemyWebSigner

Initializes 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: string
rpcUrl
: "/api/rpc",
},
iframeConfig: { iframeContainerId: string; }
iframeConfig
: {
iframeContainerId: string
iframeContainerId
: "alchemy-signer-iframe-container",
}, }, }); const
const tx: Authorization<number, true>
tx
= await
const signer: AlchemyWebSigner
signer
.
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: string
contractAddress
: "0x1234123412341234123412341234123412341234",
chainId: number

Chain ID.

chainId
: 1,
nonce: number

Nonce 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