Comment on page
☘
Root Methods
These are the methods available for SSX regardless of modules or external resources.
These are the methods available before the user signs in.
Request the user to sign in and start the session. Returns an object containing information about the session.
signIn = () => Promise<SSXClientSession>;
Here is an example of how to use it:
const session = await ssx.signIn();
These are the methods available after the user signs in.
Gets the address that is connected and signed in.
address = () => string | undefined;
Here is an example of how to use it:
const address = ssx.address();
Get the chainId that the address is connected and signed in on.
chainId = () => number | undefined;
Here is an example of how to use it:
const chainId = ssx.chainId();
Extends SSX with functions that are called after connecting and signing in.
extend = (extension: SSXExtension) => void;
Here is an example of how to use it:
ssx.extend(extension);
Gets the provider that is connected and signed in.
getProvider = () => ethers.providers.BrowserProvider | undefined;
Here is an example of how to use it:
const provider = ssx.getProvider();
Returns the signer of the connected address.
getSigner = () => ethers.Signer | undefined;
Here is an example of how to use it:
const signer = ssx.getSigner();
Resolve ENS data supported by SSX.
resolveEns = (
address: string,
resolveEnsOpts: {
domain: boolean,
avatar: boolean
}
) => Promise<SSXEnsData>;
Here is an example of how to use it:
const ensData = await ssx.resolveEns('0xADDRESS', {
domain: true,
avatar: false
});
Resolves Lens profiles owned by the given Ethereum Address. Each request is limited to 10. To get other pages, you must pass the pageCursor parameter.
This feature is available for Polygon Mainnet and Mumbai Testnet. Visit the Lens docs for more information.
resolveLens = (
address: string,
pageCursor: string,
) => Promise<string | SSXLensProfileResponse>;
Here is an example of how to use it:
const lensData = await ssx.resolveLens('0xADDRESS');
Gets the session representation.
session = () => SSXSession | undefined;
Here is an example of how to use it:
ssx.session();
Invalidates the user's session.
signOut = () => Promise<void>;
Here is an example of how to use it:
await ssx.signOut();
Last modified 4mo ago