mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
fix: update bark onboarding and backup messaging for seed-based recovery
Since bark 0.6.0, offchain funds are recoverable from the mnemonic alone via the seed-derived recovery mailbox. Remove the outdated warnings that the recovery phrase is not sufficient, show the standard recovery guidance for bark during onboarding, and expose the seed-recovery scan result as a 'recoveryreport' custom node command so users migrating to a new device can verify their funds were restored. Closes #2512 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
d198b19bef
commit
8347449fcd
4 changed files with 41 additions and 24 deletions
10
api/api.go
10
api/api.go
|
|
@ -1730,10 +1730,12 @@ func (api *api) Setup(ctx context.Context, setupRequest *SetupRequest) error {
|
|||
return errors.New("no unlock password provided")
|
||||
}
|
||||
|
||||
// Bark and Cashu both store wallet state on local disk and have no
|
||||
// remote-backup mechanism, so they cannot run in environments without
|
||||
// persistent volumes (e.g. Alby Cloud). The default OAuth client ID
|
||||
// identifies a local / self-hosted deployment.
|
||||
// Bark and Cashu both store wallet state on local disk, so they cannot
|
||||
// run in environments without persistent volumes (e.g. Alby Cloud). Bark
|
||||
// can recover spendable VTXOs from the mnemonic alone, but in-flight
|
||||
// payment checkpoints and wallet metadata are local-only, so persistent
|
||||
// storage is still required. The default OAuth client ID identifies a
|
||||
// local / self-hosted deployment.
|
||||
if !api.cfg.GetEnv().IsDefaultClientId() {
|
||||
switch setupRequest.LNBackendType {
|
||||
case config.BarkBackendType, config.CashuBackendType:
|
||||
|
|
|
|||
|
|
@ -125,16 +125,6 @@ export default function Backup() {
|
|||
phrase, you will lose access to your funds.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
{info?.backendType === "BARK" && (
|
||||
<Alert variant="destructive">
|
||||
<AlertTriangleIcon />
|
||||
<AlertTitle>Bark Support Coming Soon</AlertTitle>
|
||||
<AlertDescription>
|
||||
During the beta period, your recovery phrase is not
|
||||
sufficient to restore your funds.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
{info?.backendType === "CASHU" && <CashuMnemonicWarning />}
|
||||
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import {
|
||||
ClockIcon,
|
||||
HandCoinsIcon,
|
||||
HardDriveIcon,
|
||||
LandmarkIcon,
|
||||
ShieldAlertIcon,
|
||||
UnlockIcon,
|
||||
|
|
@ -76,14 +75,6 @@ export function SetupSecurity() {
|
|||
small fee.
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex gap-3 items-center">
|
||||
<HardDriveIcon className="size-6 shrink-0" />
|
||||
<span className="text-sm text-muted-foreground">
|
||||
During beta, your funds{" "}
|
||||
<span className="underline">cannot</span> be recovered from
|
||||
your recovery phrase alone.
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
<div className="flex gap-3 items-center">
|
||||
|
|
@ -109,7 +100,7 @@ export function SetupSecurity() {
|
|||
choose the LDK node type.
|
||||
</span>
|
||||
</div>
|
||||
) : store.nodeInfo.backendType === "BARK" ? null : (
|
||||
) : (
|
||||
<div className="flex gap-3 items-center">
|
||||
<div className="shrink-0">
|
||||
<ShieldAlertIcon className="size-6" />
|
||||
|
|
|
|||
|
|
@ -745,6 +745,7 @@ const (
|
|||
nodeCommandDebug = "debug"
|
||||
nodeCommandClaimLightningReceives = "claimlightningreceives"
|
||||
nodeCommandRunMaintenance = "runmaintenance"
|
||||
nodeCommandRecoveryReport = "recoveryreport"
|
||||
)
|
||||
|
||||
func (bs *BarkService) GetCustomNodeCommandDefinitions() []lnclient.CustomNodeCommandDef {
|
||||
|
|
@ -764,6 +765,11 @@ func (bs *BarkService) GetCustomNodeCommandDefinitions() []lnclient.CustomNodeCo
|
|||
Description: "Run wallet maintenance, which progresses pending rounds and refreshes VTXOs. Use this to nudge funds that are stuck 'pending in round'.",
|
||||
Args: nil,
|
||||
},
|
||||
{
|
||||
Name: nodeCommandRecoveryReport,
|
||||
Description: "Show the result of the seed-recovery scan that runs when a wallet is created from an existing recovery phrase. Use this to verify your funds were restored after migrating to a new device.",
|
||||
Args: nil,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -775,6 +781,8 @@ func (bs *BarkService) ExecuteCustomNodeCommand(ctx context.Context, command *ln
|
|||
return bs.executeCommandClaimLightningReceives()
|
||||
case nodeCommandRunMaintenance:
|
||||
return bs.executeCommandRunMaintenance()
|
||||
case nodeCommandRecoveryReport:
|
||||
return bs.executeCommandRecoveryReport()
|
||||
}
|
||||
|
||||
return nil, lnclient.ErrUnknownCustomNodeCommand
|
||||
|
|
@ -893,3 +901,29 @@ func (bs *BarkService) executeCommandClaimLightningReceives() (*lnclient.CustomN
|
|||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (bs *BarkService) executeCommandRecoveryReport() (*lnclient.CustomNodeCommandResponse, error) {
|
||||
// The report is produced by the seed-recovery scan bark runs during the
|
||||
// wallet open that creates the wallet locally (e.g. when restoring from a
|
||||
// recovery phrase on a new device). It is only available in the session
|
||||
// that created the wallet; on subsequent starts no scan runs.
|
||||
report := bs.wallet.RecoveryReport()
|
||||
if report == nil {
|
||||
return &lnclient.CustomNodeCommandResponse{
|
||||
Response: map[string]interface{}{
|
||||
"message": "No recovery scan ran on this wallet start. A scan only runs when the wallet is first created, e.g. after restoring from a recovery phrase.",
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &lnclient.CustomNodeCommandResponse{
|
||||
Response: map[string]interface{}{
|
||||
"isComplete": report.IsComplete,
|
||||
"recovered": report.Recovered,
|
||||
"skipped": report.Skipped,
|
||||
"foreign": report.Foreign,
|
||||
"failed": report.Failed,
|
||||
"exited": report.Exited,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue