Skip to content

loginSync(client, options): Promise<OutputType>

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

Authorize a session key and wait for confirmation.

ParameterTypeDescription
clientClient<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?: SessionKeyPermissions[]; }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?bigintThe expiry time as Unix timestamp (seconds). Defaults to now + 1 hour.
options.onHash?(hash) => voidCallback function called with the transaction hash before waiting for the receipt.
options.origin?stringThe origin of the session key authorization. Defaults to ‘synapse’.
options.permissions?SessionKeyPermissions[]The permissions to authorize for the session key. Defaults to all permissions.

Promise<OutputType>

The transaction receipt and extracted event loginSync.OutputType

Errors loginSync.ErrorType