Private
_blockPrivate
_connectingPrivate
_epochPrivate
_networkPrivate
_stakingPrivate
_stakingPrivate
_epochPrivate
_connectPrivate
_fetchPrivate
_getPrivate
_getPrivate
_handlePrivate
_handshakePrivate
_listenPrivate
_runPrivate
Handshakes with all nodes that are in bootstrapUrls
Returns a set of the urls of nodes that we successfully connected to, an object containing their returned keys, and our 'core' config (most common values for critical values)
Private
_schedulePrivate
Currently, we perform a full sync every 30s, including handshaking with every node However, we also have a state change listener that watches for staking contract state change events, which should be the only time that we need to perform handshakes with every node.
However, the current block hash does need to be updated regularly, and we currently update it only when we handshake with every node.
We can remove this network sync code entirely if we refactor our code to fetch latest blockhash on-demand.
Private
_syncThrow node error
Calculates a Key Id for claiming a pkp based on a user identifier and an app identifier. The key Identifier is an Auth Method Id which scopes the key uniquely to a specific application context. These identifiers are specific to each auth method and will derive the public key portion of a pkp which will be persisted when a key is claimed.
Auth Method | User ID | App ID |
---|---|---|
Google OAuth | token sub |
token aud |
Discord OAuth | user id | client app identifier |
Stytch OTP | token sub |
token aud |
Lit Actions | user defined | ipfs cid |
Note Lit Action claiming uses a different schema than other auth methods |
public key of pkp when claimed
user identifier for the Key Identifier
app identifier for the Key Identifier
should be set for true if using claiming through actions
Get different formats of access control conditions, eg. evm, sol, unified etc.
Get hash of access control conditions
Retrieves the session signature for a given URL from the sessionSigs map. Throws an error if sessionSigs is not provided or if the session signature for the URL is not found.
The session signature for the given URL.
An error if sessionSigs is not provided or if the session signature for the URL is not found.
Handle node promises
requestId to be logged in case of error
number of nodes we need valid results from in order to resolve
Handshake with Node
Send a command to nodes
Generated using TypeDoc
Sets up a listener to detect state changes (new epochs) in the staking contract. When a new epoch is detected, it triggers the
setNewConfig
function to update the client's configuration based on the new state of the network. This ensures that the client's configuration is always in sync with the current state of the staking contract.Returns
A promise that resolves when the listener is successfully set up.