Interface GetSessionSigsProps

Hierarchy

  • GetSessionSigsProps

Properties

authNeededCallback?: AuthCallback

This is a callback that will be called if the user needs to authenticate using a PKP. For example, if the user has no wallet, but owns a Lit PKP though something like Google Oauth, then you can use this callback to prompt the user to authenticate with their PKP. This callback should use the LitNodeClient.signSessionKey function to get a session signature for the user from their PKP. If you don't pass this callback, then the user will be prompted to authenticate with their wallet, like metamask.

capacityDelegationAuthSig?: AuthSig

Used for delegation of Capacity Credit. This signature will be checked for proof of capacity credit. On both manzano and habanero networks capacity credit proof is required.

See more here: https://developer.litprotocol.com/v3/sdk/capacity-credits

chain: string

The chain to use for the session signature. This is the chain that will be used to sign the session key. If you're using EVM then this probably doesn't matter at all.

expiration?: any

When this session signature will expire. The user will have to reauthenticate after this time using whatever auth method you set up. This means you will have to call this signSessionKey function again to get a new session signature. This is a RFC3339 timestamp. The default is 24 hours from now.

Example value: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(), // 24 hours

resourceAbilityRequests: LitResourceAbilityRequest[]

An array of resource abilities that you want to request for this session. These will be signed with the session key.

Example

If you want to request the ability to decrypt an access control condition, then you would pass
[{ resource: new LitAccessControlConditionResource('someResource), ability: LitAbility.AccessControlConditionDecryption }]
sessionCapabilityObject?: ISessionCapabilityObject

The session capability object that you want to request for this session. If you pass nothing, then this will default to a wildcard for each type of resource you're accessing.

Example

If you passed nothing, and you're requesting to perform a decryption operation for an access
control condition, then the session capability object will be a wildcard for the access control condition,
which grants this session signature the ability to decrypt this access control condition.
sessionKey?: any

The serialized session key pair to sign. If not provided, a session key pair will be fetched from localStorge or generated.

switchChain?: boolean

If you want to ask Metamask to try and switch the user's chain, you may pass true here. This will only work if the user is using Metamask. If the user is not using Metamask, then this will be ignored.

Generated using TypeDoc