Function Signature
Description
Creates a backup of the user’s wallet using the specified backup method. The backup allows the user to recover their wallet on a new device.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
method | PortalBackupMethod | Yes | The backup method to use |
password | String | No | Required when using PortalBackupMethod.password |
PortalBackupMethod
| Value | Description |
|---|---|
password | Backup using a user-provided password |
googleDrive | Backup to Google Drive |
iCloud | Backup to iCloud (iOS only) |
passkey | Backup using passkey/WebAuthn |
Returns
PortalBackupResponse - An object containing:
| Property | Type | Description |
|---|---|---|
cipherText | String? | The encrypted backup data (for self-managed backups) |
shareIds | List<String>? | List of share identifiers |
Example
Errors
| Code | Description |
|---|---|
NOT_INITIALIZED | Portal was not initialized |
WALLET_NOT_FOUND | No wallet exists to backup |
BACKUP_FAILED | The backup operation failed |
PASSWORD_REQUIRED | Password method selected but no password provided |