Generate

The provider comes with a generate action that creates a connection URI and deeplink for custom wallet buttons and actions.

// Some where within your codebase...

const { actions } = useProvider();

const response = await actions.generate()

Input (Optional)

This action does not require any inputs (similar to the `connect` action), but allows for a `walletId` parameter which will automatically generate a custom URI and deeplink for a targeted wallet.

The walletId passed into the generate action has to match one of the wallet provided in the provider conifuration walletDetails. If not, the action will fallback to default wc syntax for the generated uri and deeplink (ie: wc://)

{
    walletId?: string;    
    chain?: string;
    walletId?: string;
    pairing?: { topic: string };
    openModal?: boolean;
}

Return Type

The method will resolve if a connection is re-established by the user.

Promise<{
    uri: string;
    deeplink: string;
}>

Example usage:

Last updated