mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
Rename "Isolated" app permission to "Sub-wallet" (#982)
* Rename "Isolated" app permission to "Sub-wallet" * chore: undo comment * chore: more renaming of isolated app to sub-wallet --------- Co-authored-by: Roland <33993199+rolznz@users.noreply.github.com> Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
This commit is contained in:
parent
e2694252dc
commit
fae02f39df
8 changed files with 10 additions and 14 deletions
|
|
@ -489,7 +489,7 @@ The LNClient interface abstracts the differences between wallet implementations
|
|||
|
||||
### Transactions Service
|
||||
|
||||
Alby Hub maintains its own database of transactions to enable features like self-payments for isolated app connections (subaccounts), additional metadata (that apps can provide when creating invoices or making keysend payments), and to associate transactions with apps, providing additional context to users about how their wallet is being used across apps.
|
||||
Alby Hub maintains its own database of transactions to enable features like self-payments for isolated app connections (sub-wallets), additional metadata (that apps can provide when creating invoices or making keysend payments), and to associate transactions with apps, providing additional context to users about how their wallet is being used across apps.
|
||||
|
||||
The transactions service sits between the LNClient and two possible entry points: the NIP-47 handlers, and our internal API which is used by the Alby Hub frontend.
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ func (api *api) CreateApp(createAppRequest *CreateAppRequest) (*CreateAppRespons
|
|||
backendType != "LDK" &&
|
||||
backendType != "LND" {
|
||||
return nil, fmt.Errorf(
|
||||
"isolated apps are currently not supported on your node backend. Try LDK or LND")
|
||||
"sub-wallets are currently not supported on your node backend. Try LDK or LND")
|
||||
}
|
||||
|
||||
expiresAt, err := api.parseExpiresAt(createAppRequest.ExpiresAt)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ func (api *api) TopupIsolatedApp(ctx context.Context, userApp *db.App, amountMsa
|
|||
return errors.New("LNClient not started")
|
||||
}
|
||||
if !userApp.Isolated {
|
||||
return errors.New("app is not isolated")
|
||||
return errors.New("this app is not a sub-wallet")
|
||||
}
|
||||
|
||||
transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amountMsat, "top up", "", 0, nil, api.svc.GetLNClient(), &userApp.ID, nil)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ func NewAppsService(db *gorm.DB, eventPublisher events.EventPublisher, keys keys
|
|||
func (svc *appsService) CreateApp(name string, pubkey string, maxAmountSat uint64, budgetRenewal string, expiresAt *time.Time, scopes []string, isolated bool, metadata map[string]interface{}) (*db.App, string, error) {
|
||||
if isolated && (slices.Contains(scopes, constants.SIGN_MESSAGE_SCOPE)) {
|
||||
// cannot sign messages because the isolated app is a custodial sub-wallet
|
||||
return nil, "", errors.New("isolated app cannot have sign_message scope")
|
||||
return nil, "", errors.New("Sub-wallet app connection cannot have sign_message scope")
|
||||
}
|
||||
|
||||
var pairingPublicKey string
|
||||
|
|
|
|||
|
|
@ -44,15 +44,11 @@ export function IsolatedAppTopupDialog({
|
|||
});
|
||||
await reloadApp();
|
||||
toast({
|
||||
title: "Successfully increased isolated app balance",
|
||||
title: "Successfully increased sub-wallet balance",
|
||||
});
|
||||
setOpen(false);
|
||||
} catch (error) {
|
||||
handleRequestError(
|
||||
toast,
|
||||
"Failed to increase isolated app balance",
|
||||
error
|
||||
);
|
||||
handleRequestError(toast, "Failed to increase sub-wallet balance", error);
|
||||
}
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const scopeGroupIconMap: ScopeGroupIconMap = {
|
|||
const scopeGroupTitle: Record<ScopeGroup, string> = {
|
||||
full_access: "Full Access",
|
||||
read_only: "Read Only",
|
||||
isolated: "Isolated",
|
||||
isolated: "Sub-wallet",
|
||||
custom: "Custom",
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ function AppCreatedInternal() {
|
|||
</li>
|
||||
{app?.isolated && (
|
||||
<li>
|
||||
Optional: Increase isolated balance (
|
||||
Optional: Increase sub-wallet balance (
|
||||
{new Intl.NumberFormat().format(Math.floor(app.balance / 1000))}{" "}
|
||||
sats){" "}
|
||||
<IsolatedAppTopupDialog appPubkey={app.appPubkey}>
|
||||
|
|
|
|||
|
|
@ -874,9 +874,9 @@ func (httpSvc *HttpService) isolatedAppTopupHandler(c echo.Context) error {
|
|||
err := httpSvc.api.TopupIsolatedApp(c.Request().Context(), dbApp, requestData.AmountSat*1000)
|
||||
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("Failed to topup isolated app")
|
||||
logger.Logger.WithError(err).Error("Failed to topup sub-wallet")
|
||||
return c.JSON(http.StatusInternalServerError, ErrorResponse{
|
||||
Message: fmt.Sprintf("Failed to topup isolated app: %v", err),
|
||||
Message: fmt.Sprintf("Failed to topup sub-wallet: %v", err),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue