Skip to content

SessionKey

Defined in: packages/synapse-sdk/src/session/key.ts:31

new SessionKey(client, account): SessionKey

Defined in: packages/synapse-sdk/src/session/key.ts:37

ParameterType
clientClient<Transport, Chain, Account>
accountAccount

SessionKey

get account(): Account

Defined in: packages/synapse-sdk/src/session/key.ts:48

Account


get chain(): Chain

Defined in: packages/synapse-sdk/src/session/key.ts:52

Chain


get client(): Client<Transport, Chain, Account>

Defined in: packages/synapse-sdk/src/session/key.ts:55

Client<Transport, Chain, Account>

fetchExpiries(permissions): Promise<Record<SessionKeyPermissions, bigint>>

Defined in: packages/synapse-sdk/src/session/key.ts:64

Queries current permission expiries from the registry

ParameterTypeDefault valueDescription
permissionsSessionKeyPermissions[]SK.ALL_PERMISSIONSExpiries to fetch, as a list of bytes32 hex strings

Promise<Record<SessionKeyPermissions, bigint>>

map of each permission to its expiry for this session key


login(expiry, permissions, origin): Promise<`0x${string}`>

Defined in: packages/synapse-sdk/src/session/key.ts:97

Authorize signer with permissions until expiry. This can also be used to renew existing authorization by updating the expiry.

ParameterTypeDefault valueDescription
expirybigintundefinedunix time (block.timestamp) that the permissions expire
permissionsSessionKeyPermissions[]SK.ALL_PERMISSIONSlist of permissions granted to the signer, as a list of bytes32 hex strings
originstringDEFAULT_ORIGINthe name of the application prompting this login

Promise<`0x${string}`>

signed and broadcasted login transaction details


revoke(permissions): Promise<`0x${string}`>

Defined in: packages/synapse-sdk/src/session/key.ts:116

Invalidate signer permissions, setting their expiry to zero.

ParameterTypeDefault valueDescription
permissionsSessionKeyPermissions[]SK.ALL_PERMISSIONSlist of permissions removed from the signer, as a list of bytes32 hex strings

Promise<`0x${string}`>

signed and broadcasted revoke transaction details