ssxserver
Last updated
Was this helpful?
Last updated
Was this helpful?
> >
SSX-Server is a server-side library made to work with the SSX client libraries. SSX-Server is the base class that takes in a configuration object and works with various middleware libraries to add authentication and metrics to your server.
Signature:
Extends: EventEmitter
Constructs a new instance of the SSXServer
class
() => string
Generates a nonce for use in the SSX client libraries. Nonce is a random string that is used to prevent replay attacks. Wraps the generateNonce function from the SIWE library.
() => SessionOptions
Gets Express Session config params to configure the session.
Registers a new event to the API
Verifies the SIWE message, signature, and nonce for a sign-in request. If the message is verified, a session token is generated and returned.
(destroySession?: () => Promise<any>) => Promise<boolean>
Logs out the user by deleting the session. Currently this is a no-op.
ethers.providers.BaseProvider
EthersJS provider.
ENS data supported by SSX.
RequestHandler
Session is a configured instance of express-session middleware.
(data: ) => Promise<boolean>
(siwe: Partial<SiweMessage> | string, signature: string, daoLogin: boolean, resolveEns: boolean | , nonce: string) => Promise<{ success: boolean; error: SiweError; session: Partial<SessionData>; }>
(address: string, resolveEnsOpts?: ) => Promise<>