diff --git a/echo_handlers.go b/echo_handlers.go index 34d2e1d3..35f7b1f2 100644 --- a/echo_handlers.go +++ b/echo_handlers.go @@ -68,7 +68,6 @@ func (svc *Service) AppsListHandler(c echo.Context) error { if err != nil { return c.JSON(http.StatusBadRequest, ErrorResponse{ Error: true, - Code: 8, Message: fmt.Sprintf("Bad arguments %s", err.Error()), }) } @@ -105,7 +104,6 @@ func (svc *Service) AppsShowHandler(c echo.Context) error { if err != nil { return c.JSON(http.StatusBadRequest, ErrorResponse{ Error: true, - Code: 8, Message: fmt.Sprintf("Bad arguments %s", err.Error()), }) } @@ -117,10 +115,8 @@ func (svc *Service) AppsShowHandler(c echo.Context) error { svc.db.Where("user_id = ? AND nostr_pubkey = ?", user.ID, c.Param("pubkey")).First(&app) if app.NostrPubkey == "" { - // TODO: Show not found? - return c.JSON(http.StatusBadRequest, ErrorResponse{ + return c.JSON(http.StatusNotFound, ErrorResponse{ Error: true, - Code: 8, Message: "App does not exist", }) } @@ -184,7 +180,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error { if err != nil { return c.JSON(http.StatusBadRequest, ErrorResponse{ Error: true, - Code: 8, Message: fmt.Sprintf("Bad arguments %s", err.Error()), }) } @@ -206,7 +201,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error { svc.Logger.Errorf("Invalid public key format: %s", pairingPublicKey) return c.JSON(http.StatusBadRequest, ErrorResponse{ Error: true, - Code: 8, Message: fmt.Sprintf("Invalid public key format: %s", pairingPublicKey), }) } @@ -222,7 +216,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error { svc.Logger.Errorf("Invalid expiresAt: %s", pairingPublicKey) return c.JSON(http.StatusBadRequest, ErrorResponse{ Error: true, - Code: 8, Message: fmt.Sprintf("Invalid expiresAt: %v", err), }) } @@ -273,7 +266,6 @@ func (svc *Service) AppsCreateHandler(c echo.Context) error { }).Errorf("Failed to save app: %v", err) return c.JSON(http.StatusInternalServerError, ErrorResponse{ Error: true, - Code: 8, Message: fmt.Sprintf("Failed to save app: %v", err), }) } diff --git a/frontend/index.html b/frontend/index.html index 5f13130d..dd2981cf 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@
- - - Log in with Alby Account - -
+ {isAlby && ( ++ + + Log in with Alby Account + +
+ )}
diff --git a/frontend/src/screens/apps/NewApp.tsx b/frontend/src/screens/apps/NewApp.tsx
index e07ee611..a9b58037 100644
--- a/frontend/src/screens/apps/NewApp.tsx
+++ b/frontend/src/screens/apps/NewApp.tsx
@@ -117,11 +117,11 @@ const NewApp = () => {
const formData = new FormData();
formData.append("name", appName);
- formData.append("pubkey", pubkey);
formData.append("maxAmount", maxAmount.toString());
formData.append("budgetRenewal", budgetRenewal);
formData.append("expiresAt", expiresAt);
formData.append("requestMethods", requestMethods);
+ formData.append("pubkey", pubkey);
formData.append("returnTo", returnTo);
try {
@@ -164,6 +164,22 @@ const NewApp = () => {
[NIP_47_PAY_INVOICE_METHOD]: LightningIcon,
};
+ const expiryOptions: Record
- The page you are looking for does not exist.
-
- Nostr Wallet Connect (NWC) is a way for applications like Nostr clients to access a remote Lightning wallet through a standardized protocol.
- For instance, you can link your Alby account with any other application using this feature.
-
- Enable the application by creating a permissioned connection to your wallet. This access
- can be revoked at any time.
-
- Connect your application by adding the connection secret. Either by
- scanning the connect QR code or clicking a link.
-
- Zapp and Boost! Your lightning wallet is available where you need it.
-
- Nostr Wallet Connect uses the existing Nostr infrastructure to allow
- applications to communicate with lightning wallets. This makes it easy for
- developers to integrate and gives the users full flexibility on choice.
-
- Amethyst
- is the first Nostr Client to fully support Nostr Wallet Connect. More are
- working on support for it and are following shortly.
-
- Of course! Nostr Wallet Connect is an open standard and our implementation
- is
- open source on GitHub
-
- Yes, Nostr Wallet Connect is for every wallet and can easily be
- self-hosted.
- Nostr Wallet Connect is an open protocol enabling applications to interact
- with bitcoin lightning wallets. It allows users to connect their existing
- wallets to your application allowing you to easily integrate bitcoin
- lightning functionality but still focus on the core functionality of your
- app.
-
- Happy zapping!
-
- {{.App.Description}}
- This will revoke the permission and will no longer allow calls from this public key.
-
@@ -172,11 +188,7 @@ const NewApp = () => {
404 Page Not Found
- tl;dr
- How to connect your app?
-
-
-
- And if you ever want to disable it again, simply disconnect the connection again.
- FAQs
-
- How does it work?
-
- To learn more about the details have a look at
- the specs (NIP47)
- Which apps support it?
- Is it open source?
- Can I run my own?
-
- We are looking for contributors to add support for more wallet backends. If
- you're interested please contact us
- on GitHub
- or
- hello@getalby.com
- For developers
-
-
-
-
- 🚀 Almost there!
-
- Connected apps
-
-
-
- Connect app
-
-
-
-
-
-
-
-
- {{if not .Apps}}
- Name
-
-
-
-
- {{else}}
- {{range .Apps}}
-
- No apps connected yet.
-
-
-
- {{end}}
- {{end}}
-
-
- {{.Name}}
-
-
-
- Details
-
-
- {{if .Name}}
- Connect to {{.Name}}
- {{else}}
- Connect a new app
- {{end}}
-
-
-
-
-
-{{end}}
diff --git a/views/apps/show.html b/views/apps/show.html
deleted file mode 100644
index c74fca3e..00000000
--- a/views/apps/show.html
+++ /dev/null
@@ -1,83 +0,0 @@
-{{define "body"}}
-
-
-{{.App.Name}}
-
-
-
-
- Public Key
- {{.App.NostrPubkey}}
-
-
- Last used
-
- {{if gt .EventsCount 0 }}
- {{.LastEvent.CreatedAt.Format "02 Jan 06 15:04 MST" }}
- {{else}}
- never
- {{end}}
-
-
-
- Expires at
-
- {{ if not .ExpiresAt.IsZero}}
- {{.ExpiresAtFormatted}}
- {{else}}
- never
- {{end}}
-
- Permissions
-
- {{range .RequestMethods}}
-
- {{ if gt .PaySpecificPermission.MaxAmount 0 }}
-
-
-
-
- Budget
- {{.PaySpecificPermission.MaxAmount}} sats ({{.BudgetUsage}} sats used)
-
-
- Renews in
- {{.RenewsIn}} (set to {{.PaySpecificPermission.BudgetRenewal}})
- ⚠️ Danger zone
-
- Nostr Wallet Connect
-
-
-
- Securely connect your Alby Account to Nostr clients and applications.
-
-
-
-
-
-
- Nostr Wallet Connect
-
-
-
- Securely connect your LND wallet to Nostr clients and applications.
-
-
-
-