This section describes how to check in on the status of each MPC operation
Progress Callback Support
The portal.createWallet(), portal.backupWallet(), and portal.recoverWallet() functions all support an optional argument for a progress callback. This is a function that will be triggered at key points within these respective MPC operations to provide incremental updates, These incremental updates enable you to update your UI as the MPC operation progresses.
Using Progress Callbacks
import { MpcStatus } from'@portal-hq/web'// Example using createWallet()constaddress=portal.createWallet((update:MpcStatus) => {console.log(`Status update:`,update.status)console.log(`MPC Operation done:`,update.done)})// Example using backupWallet()constaddress=portal.backupWallet((update:MpcStatus) => {console.log(`Status update:`,update.status)console.log(`MPC Operation done:`,update.done)})// Example using recoverWallet()constaddress=portal.recoverWallet(cipherText, (update:MpcStatus) => {console.log(`Status update:`,update.status)console.log(`MPC Operation done:`,update.done)})
MPC Statuses
These are all the possible statuses that will be returned through the callbacks on the MPC operations.