Skip to content

Documentation / react-auth / useLinkWithSiwe

Function: useLinkWithSiwe()

useLinkWithSiwe(callbacks?): UseLinkWithSiwe

Use this hook to link an ethereum wallet to a user, without using any Privy UIs.

Parameters

callbacks?: Object

callbacks.onError?: (error, details) => void

Callback that will execute in the case of a non-successful account linking.

Param {PrivyErrorCode} - the corresponding error code

Param {LoginMethod} - the type of (attempted) linked account

callbacks.onSuccess?: (user, linkMethod, linkedAccount) => void

Callback that will execute once on a successful linking of a new account/login method. This will run when any of the 'link' methods are called manually.

ParamUser- the user the account was linked to

Param [LoginMethod]([object Object])- the type of linked account

Param the newly linked account

Returns

UseLinkWithSiwe

generateSiweMessage - [generateSiweMessage]([object Object]) generates a SIWE message for a given EIP-55 wallet address and eip-155 chain ID.

linkWithSiwe - [linkWithSiwe]([object Object]) - Links a wallet to a user via the signature created for the SIWE message.