Create a wallet
Onboard your user with a few lines of code
Last updated
Onboard your user with a few lines of code
Last updated
To begin with, you'll have to create an instance of the cometh wallet using the sdk, specifying the needed variables (network, apiKey, rpcurl...).
When your user doesn't already have a wallet, create a new one by calling the connect method without any parameter.
You'll be prompted to create a passKey for your current domain. Depending on the user's device, the UX might be different.
Thanks to these credentials, your wallet address will be predicted and can already be used to receive funds.
However, note that at this point the wallet has not been created onchain yet: the Safe is deployed on the first transaction of the wallet.
To get the address of the wallet created, you'll just have to call:
When you already have created your user's wallet through Cometh Connect, just pass the wallet address to the connect method in order to instantiate it.
Once your wallet is connected, the user will be prompted to use biometrics when executing a transaction.
When instantiating the sdk, you are able to configure some optional parameters:
passKeyName: Allows to name the webAuthn credential that you create through cometh connect.
RpcUrl: You can provide your own Rpc for better performance.
uiConfig: Allows you to disable the gas indication modal used for non-sponsored transactions. By default displayValidationModal is set as true.
gasToken: Allows you to pay gas fees with an ERC20 token instead of the chain's native token by specifying the ERC20 token's address on the network you are using. ( please contact us if you want to activate this feature )
webAuthnOptions: Allows you to customize your webAuthn credentials (, ...). By default we use , but you can customize it the way you like.
disableEoaFallback: By default we provide a local wallet solution in the rare case of browser not fully . You have the ability to disable that feature using this boolean.