createSigner
Create a Signer object
This function will create a
Signer
that allows the user to sign or execute a transaction. Consider a Signer as the approval of the user.venlyConnect.createSigner();
In order for the user the give his approval he requires to enter his PIN. A
Signer
will enable him to do so. The Signer
object also has the WindowMode
and PopupOptions
available.If you are using the popup signer and you want to execute a transaction as a reaction to an event (e.g. a button click), then call
venlyConnect.createSigner(…)
as very first in your event handler otherwise, the popup might get blocked by the popup blocker of the browser.When using the POPUP
WindowMode
you can close the Signer
popup manually in case something went wrong. You can use the code snippet below to close it. The type guard, isn’t mandatory, but it makes the code more robust.if (venlyConnect.isPopupSigner(signer)) {
signer.closePopup();
}
venlyConnect.createSigner(signUsing?: WindowMode, popupOptions?: PopupOptions): Signer
Signer
Parameter | Required | Description |
signUsing | False | |
popupOptions | False |
const signer = venlyConnect.createSigner('REDIRECT');
const signer = venlyConnect.createSigner('POPUP');
if (venlyConnect.isPopupSigner(signer)) {
signer.closePopup();
}
Last modified 1yr ago