Add a new device
Allow your user to access their wallet from several devices
Last updated
Allow your user to access their wallet from several devices
Last updated
To add a new device, the user's wallet must already exist in our system. When the user attempts to connect to their wallet on a new secondary device, no signer is available.
There are 2 possible scenarios when a user is connecting to a secondary device:
User has lost access to his primary device: in this case, you have to .
User has access to their primary device: this will be described in the following steps.
From the SDK, you need to call initNewSignerRequest on the secondary device. It will create a signer and initiate a new signer request. This request, once validated on the primary device, will grant access to the secondary signer on the Safe smart wallet.
The user will be asked to use its biometrics to create the new passkey.
You need to implement a service within your backend to validate and send new signer requests.
It will do two things:
validate the user's identity and the wallet associated with them
call our dedicated route to save the request.
This API route is protected by your API Secret. Your API Secret should stay private, only be used in your backend, and never exposed in your front end.
Once the user's request is created. You must display it on your user's primary device to confirm the addition of the secondary device.
To retrieve all active new signer requests for a wallet, you can call :
You have to create a UI to let your user validate or delete pending requests.
In your backend you will need a validation route to execute the following logic:
validate the user's identity and the associated wallet
call the Cometh Connect API route to validate a request
This API route is protected by your API Secret. Your API Secret should stay private, only be used in your backend, and never exposed in your front end.
You'll be able to call this service from your front-end to validate the request.
If the request is not of type WEBAUTHN you don't need to do the following code to wait for the deployment of the new webauthn signer
Then, you can add the new signer as an owner of the user wallet.
Here is a TS code example of the entire validation flow:
In your backend you will need a deletion route to execute the following logic:
validate the user's identity and the associated wallet
call the Cometh Connect API route to delete a request
This API route is protected by your API Secret. Your API Secret should stay private, only be used in your backend, and never exposed in your front end.
Delete a new signer request by signer address.
A signer address
0x5029832B2F0002D11D59BA0DdF5a67720706f638
Pattern: ^0x[a-fA-F0-9]{40}$
A string representation of a customer ApiSecret.
78d8e101a-9154-4000-91c5-b02527f4c70e
Create a new signer request linked to a project.
A string representation of a customer ApiSecret.
78d8e101a-9154-4000-91c5-b02527f4c70e
The account address.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
The signer address.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
The device system information.
The type of signer.
WEBAUTHN
the credential Id of the WebAuthn signer.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
the x point of the WebAuthn signer.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
the y point of the WebAuthn signer.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
Validate a new signer request.
A string representation of a customer ApiSecret.
78d8e101a-9154-4000-91c5-b02527f4c70e
The account address.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
The signer address.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
The device system information.
The type of signer.
WEBAUTHN
the credential Id of the WebAuthn signer.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
the x point of the WebAuthn signer.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160
the y point of the WebAuthn signer.
0x84ADD3fa2c2463C8cF2C95aD70e4b5F602332160