SessionKey
Defined in: packages/synapse-sdk/src/session/key.ts:51
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SessionKey(   provider,   sessionKeyRegistryAddress,   signer,   owner): SessionKey;Defined in: packages/synapse-sdk/src/session/key.ts:57
Parameters
Section titled “Parameters”| Parameter | Type | 
|---|---|
provider | Provider | 
sessionKeyRegistryAddress | string | 
signer | Signer | 
owner | Signer | 
Returns
Section titled “Returns”SessionKey
Methods
Section titled “Methods”fetchExpiries()
Section titled “fetchExpiries()”fetchExpiries(permissions): Promise<Record<string, bigint>>;Defined in: packages/synapse-sdk/src/session/key.ts:78
Queries current permission expiries from the registry
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description | 
|---|---|---|---|
permissions | string[] | PDP_PERMISSIONS | Expiries to fetch, as a list of bytes32 hex strings | 
Returns
Section titled “Returns”Promise<Record<string, bigint>>
map of each permission to its expiry for this session key
getSigner()
Section titled “getSigner()”getSigner(): Signer;Defined in: packages/synapse-sdk/src/session/key.ts:69
Returns
Section titled “Returns”login()
Section titled “login()”login(   expiry,   permissions,origin): Promise<TransactionResponse>;Defined in: packages/synapse-sdk/src/session/key.ts:130
Authorize signer with permissions until expiry. This can also be used to renew existing authorization by updating the expiry.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description | 
|---|---|---|---|
expiry | bigint | undefined | unix time (block.timestamp) that the permissions expire | 
permissions | string[] | PDP_PERMISSIONS | list of permissions granted to the signer, as a list of bytes32 hex strings | 
origin | string | DEFAULT_ORIGIN | the name of the application prompting this login | 
Returns
Section titled “Returns”signed and broadcasted login transaction details
revoke()
Section titled “revoke()”revoke(permissions): Promise<TransactionResponse>;Defined in: packages/synapse-sdk/src/session/key.ts:144
Invalidate signer permissions, setting their expiry to zero.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description | 
|---|---|---|---|
permissions | string[] | PDP_PERMISSIONS | list of permissions removed from the signer, as a list of bytes32 hex strings | 
Returns
Section titled “Returns”signed and broadcasted revoke transaction details