Skip to content

loginSync

loginSync(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/session-key/login.ts:87

Authorize a session key and wait for confirmation.

Parameter Type Description
client Client<Transport, Chain, Account> The client to use to authorize the session key.
options { address: `0x${string}`; contractAddress?: `0x${string}`; expiresAt?: bigint; onHash?: (hash) => void; origin?: string; permissions?: Permission[]; } loginSync.OptionsType
options.address `0x${string}` Session key address.
options.contractAddress? `0x${string}` Session key registry contract address. If not provided, defaults to the chain contract address.
options.expiresAt? bigint The expiry time as Unix timestamp (seconds). Defaults to now + 1 hour.
options.onHash? (hash) => void Callback function called with the transaction hash before waiting for the receipt.
options.origin? string The origin of the session key authorization. Defaults to ‘synapse’.
options.permissions? Permission[] The permissions to authorize for the session key. Defaults to all FWSS permissions.

Promise<OutputType>

The transaction receipt and extracted event loginSync.OutputType

Errors loginSync.ErrorType