☘️Root Methods

These are the methods available for SSX regardless of modules or external resources.

Before Sign-in

These are the methods available before the user signs in.

signIn

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();

After Sign-in

These are the methods available after the user signs in.

address

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();

chainId

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();

extend

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);

getProvider

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();

getSigner

Returns the signer of the connected address.

getSigner = () => ethers.Signer | undefined;

Here is an example of how to use it:

const signer = ssx.getSigner();

resolveEns

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
});

resolveLens

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');

session

Gets the session representation.

session = () => SSXSession | undefined;

Here is an example of how to use it:

ssx.session();

signOut

Invalidates the user's session.

signOut = () => Promise<void>;

Here is an example of how to use it:

await ssx.signOut();

Last updated