getExpirations
getExpirations(
client,options):Promise<Record<SessionKeyPermissions,bigint>>
Defined in: packages/synapse-core/src/session-key/authorization-expiry.ts:206
Get the expirations for all permissions.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use. |
options | { address: `0x${string}`; contractAddress?: `0x${string}`; sessionKeyAddress: `0x${string}`; } | getExpirations.OptionsType |
options.address | `0x${string}` | The address of the user account. |
options.contractAddress? | `0x${string}` | Session key registry contract address. If not provided, the default is the session key registry contract address for the chain. |
options.sessionKeyAddress | `0x${string}` | The address of the session key. |
Returns
Section titled “Returns”Promise<Record<SessionKeyPermissions, bigint>>
The expirations as a record of SessionKeyPermissions to bigint getExpirations.OutputType
Throws
Section titled “Throws”Errors getExpirations.ErrorType
Example
Section titled “Example”import { getExpirations } from '@filoz/synapse-core/session-key'import { createPublicClient, http } from 'viem'import { calibration } from '@filoz/synapse-core/chains'
const client = createPublicClient({ chain: calibration, transport: http(),})
const expirations = await getExpirations(client, { address: '0x1234567890123456789012345678901234567890', sessionKeyAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',})
console.log(expirations)