Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connectors): add raspiblitz #683

Closed
wants to merge 110 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
bf09fbb
Adding userEmail value to types and state
AustinKelsay Jan 20, 2022
df26f63
Adding in email form on frontend and payerdata parsing function
AustinKelsay Jan 20, 2022
3162632
Removing extra 'or' operator
AustinKelsay Jan 20, 2022
c1deabc
Merge master
bumi Feb 18, 2022
0fd092c
Simplifying variable checks on getPayerData
AustinKelsay Feb 23, 2022
26d9f05
feat(connectors): add raspiblitz
secondl1ght Mar 11, 2022
da20da1
feat: add instructions
secondl1ght Mar 18, 2022
ae0fd7a
Merge branch 'master' into add-raspiblitz
secondl1ght Mar 18, 2022
75d88e1
Merge branch 'getAlby:master' into add-raspiblitz
secondl1ght Mar 18, 2022
f339b51
refactor: remove upload macaroon, update port, update textfield
secondl1ght Mar 18, 2022
6128c80
feat: add https and port for user automatically
secondl1ght Mar 21, 2022
3690ccf
Merge branch 'getAlby:master' into add-raspiblitz
secondl1ght Mar 21, 2022
e219b94
fix: update input pattern regex and message, add conditional to onChange
secondl1ght Mar 21, 2022
142dcee
Merge branch 'master' into add-raspiblitz
secondl1ght Mar 21, 2022
150a8f0
fix: change URL references to .onion address
secondl1ght Mar 21, 2022
87e065a
Merge branch 'add-raspiblitz' of github.com:secondl1ght/lightning-bro…
secondl1ght Mar 21, 2022
454aacf
feat: show active account in prompts and allow to switch
dylancom Mar 22, 2022
0354139
refactor: make 2 functions for change and remove onion validation
secondl1ght Mar 23, 2022
dbce16e
Merge branch 'getAlby:master' into add-raspiblitz
secondl1ght Mar 23, 2022
0e89a17
fix: keysend API
kiwiidb Mar 23, 2022
7757a20
feat: confirmorcancel component
dylancom Mar 23, 2022
91ce2bf
refactor: reorganise
dylancom Mar 23, 2022
fb66861
feat: success message component
dylancom Mar 23, 2022
8b59c62
refactor: make use of success message comp
dylancom Mar 23, 2022
0861eb9
feat: sat buttons component
dylancom Mar 23, 2022
b3efeec
feat: form lower-case
dylancom Mar 23, 2022
a8505d1
refactor: move setting into components
dylancom Mar 23, 2022
5eb3931
fix: default screen shortly rendered before the allowance view
dylancom Mar 22, 2022
0081fbe
feat: render publisher card with tipping button
bumi Mar 18, 2022
6656d98
refactor: rename advanced
dylancom Mar 23, 2022
93c9cbe
Merge pull request #729 from getAlby/fix/keysend-webln
bumi Mar 23, 2022
ff06931
refactor: make port configurable
secondl1ght Mar 23, 2022
50d115b
chore: add vscode extension recommendations
escapedcat Mar 24, 2022
6b55bb4
Feature: Tipping support for medium.com (#701)
reneaaron Mar 24, 2022
bccdaaa
Merge pull request #734 from escapedcat/chore/vscode-ext-recommendations
bumi Mar 24, 2022
548b279
chore: remove unused code #721
escapedcat Mar 24, 2022
1293c46
style: highlight delete button in menu
im-adithya Mar 24, 2022
87de3c3
Merge pull request #736 from getAlby/chore/721_remove-unused-code
escapedcat Mar 24, 2022
01d8322
style: use danger prop for delete
im-adithya Mar 24, 2022
631c004
refactor: setting component
dylancom Mar 24, 2022
e100265
Merge pull request #730 from getAlby/feature/layout-components
bumi Mar 24, 2022
a7d9362
Update README.md
secondl1ght Mar 6, 2022
074c1bc
Update README.md
bumi Mar 25, 2022
aa6c11a
feat: show account name in navbar
bumi Mar 25, 2022
9d5123d
chore: get currentAccountId as string as we do in other places
bumi Mar 25, 2022
65f0691
Merge pull request #737 from im-adithya/task-highlight-delete
bumi Mar 25, 2022
b3ab181
fix: multiple backgrounds and shadow
dylancom Mar 26, 2022
68b6593
Merge pull request #750 from getAlby/bugfix/unlock-prompt-styling
bumi Mar 26, 2022
693ede4
Update all development Yarn dependencies (2022-03-28)
depfu[bot] Mar 28, 2022
1fef120
test: add tests
dylancom Mar 28, 2022
80b9792
Merge pull request #751 from getAlby/depfu/batch_dev/yarn/2022-03-28
bumi Mar 28, 2022
7b1bfb6
refactor: return null instead of loading component
dylancom Mar 28, 2022
2a1a202
feat: input focus animation
dylancom Mar 28, 2022
b56df16
refactor: move connectors to their own folder
dylancom Mar 29, 2022
3c4a8dd
refactor: re-use connector routes to automate choose connector
dylancom Mar 29, 2022
1bd3b91
refactor: move newwallet to connectors
dylancom Mar 29, 2022
1a89a64
feat: created new connector form component
dylancom Mar 29, 2022
d51ba4d
refactor: easier margins
dylancom Mar 29, 2022
b3a43ef
refactor: easier margins
dylancom Mar 29, 2022
bcec40e
Merge pull request #755 from getAlby/feat/dry-connectors
bumi Mar 29, 2022
cc615b6
Merge pull request #744 from getAlby/feature/show-name-in-navbar
bumi Mar 29, 2022
a9cfd6f
feat: new wallet account creation with lightning address
bumi Mar 29, 2022
3e91b7c
fix: pre-defined amount buttons text wrapping (#749)
Mar 30, 2022
d5aad99
fix: match input border color
dylancom Mar 30, 2022
fa8b962
feat: add lnurl legacy auth setting
kiwiidb Mar 30, 2022
77d7c76
fix: don't use api inside background script
kiwiidb Mar 30, 2022
67ad14c
Merge pull request #758 from getAlby/bugfix/button-border-should-matc…
bumi Mar 30, 2022
8ff2b7f
Merge branch 'master' into feature/new-signup
bumi Mar 30, 2022
ebc5e19
refactor: signMessage doesn't need to be async
kiwiidb Mar 30, 2022
488943c
feat: lnbits and verifymessage
kiwiidb Mar 30, 2022
1d4970c
fix: use uint8array for legacy msg
kiwiidb Mar 30, 2022
4f25d19
chore: rm debug file
kiwiidb Mar 30, 2022
9214699
fix: wrong import in lnbits
kiwiidb Mar 30, 2022
7b0c819
fix: lnbits: new keyHex
kiwiidb Mar 30, 2022
64a8cb1
fix: setting text
kiwiidb Mar 30, 2022
15ce97d
fix: setting text
kiwiidb Mar 30, 2022
32ab797
fix: list calls in content-scripts
bumi Mar 30, 2022
a2fc473
Merge pull request #723 from getAlby/feature/account-in-prompt
bumi Mar 30, 2022
55dfb37
chore: cleanup
bumi Mar 30, 2022
7a3e9c8
v1.8.0
bumi Mar 30, 2022
650acd9
fix: update NavBar title in prompt
bumi Mar 30, 2022
925b16c
chore: use message.type as default
bumi Mar 30, 2022
f492a3e
fix: do not pass any object to the background script from webln
bumi Mar 30, 2022
183a98e
Merge pull request #756 from getAlby/fix/signmessage
bumi Mar 30, 2022
1d65c54
Merge branch 'master' into feature/lud-18-email-support
bumi Mar 30, 2022
0b4c1bc
Merge pull request #541 from AustinKelsay/feature/lud-18-email-support
bumi Mar 30, 2022
2062916
feat: input suffix
dylancom Mar 31, 2022
3f6877f
feat: upgrade to react 18
dylancom Mar 31, 2022
9158683
Update @tailwindcss/forms to version 0.5.0
depfu[bot] Mar 12, 2022
48b8b1d
fix: the LNURL payerdata and commentsAllowed is optional
bumi Mar 30, 2022
ad399ca
feat: nest webln calls under the webln/ namespace
bumi Mar 31, 2022
34a178f
chore: ignore the `action` in the message for now we still use type
bumi Mar 31, 2022
7de48b0
Merge pull request #757 from getAlby/feature/new-signup
bumi Mar 31, 2022
42f206c
v1.9.0
bumi Mar 31, 2022
022637b
fix: signMessage call
bumi Mar 31, 2022
a7410e0
v1.9.1
bumi Mar 31, 2022
e724fb2
Merge pull request #764 from getAlby/feature/hello-react-18-bye-inter…
bumi Apr 1, 2022
c91dedb
feat(i18n): initial setup
pavanjoshi914 Mar 25, 2022
36c1efd
refactor: some minor improvements
pavanjoshi914 Apr 1, 2022
f05e50f
fix: update citadel sdk for core lightning support
AaronDewes Apr 1, 2022
d7f1aac
feat: check for http and add if not present
secondl1ght Apr 2, 2022
6516983
Merge pull request #769 from runcitadel/fix/core-ln-citadel
bumi Apr 3, 2022
44a396e
Update all development Yarn dependencies (2022-04-04)
depfu[bot] Apr 4, 2022
bf63762
Merge pull request #772 from getAlby/depfu/batch_dev/yarn/2022-04-04
bumi Apr 4, 2022
369c507
Merge pull request #711 from pavanjoshi914/i18n-inital-setup
bumi Apr 5, 2022
206d1f7
refactor: use bumi suggestion to dry handleUrl function
secondl1ght Apr 5, 2022
f256fd9
Merge branch 'add-raspiblitz' of https://github.com/secondl1ght/light…
secondl1ght Apr 5, 2022
3a819ad
fix: add raspiblitz back in after merge
secondl1ght Apr 5, 2022
304eb52
fix: delete unused code
secondl1ght Apr 5, 2022
e9a41f4
fix: filepath
secondl1ght Apr 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ dist/
# Editor directories and files
.idea
.nova
.vscode
.vscode/**/*
!.vscode/extensions.json
*.suo
*.ntvs*
*.njsproj
Expand Down
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"ecmel.vscode-html-css",
"bradlc.vscode-tailwindcss",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ The extension can connect to different node implementations and supports custodi
- [x] [LNURL-withdraw](https://xn--57h.bigsun.xyz/lnurl-withdraw-flow.txt) support
- [x] WebLN signMessage, verifyMessage support
- [x] WebLN dynamic makeInvoice support
- [x] Keysend
- [ ] [Lsat](https://lsat.tech/) support


### STATUS: 🚀

## Join the conversation
Expand Down
40 changes: 21 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lightning-browser-extension",
"version": "1.7.0",
"version": "1.9.1",
"description": "Lightning browser extension",
"private": true,
"repository": "https://github.com/bumi/lightning-browser-extension.git",
Expand Down Expand Up @@ -36,7 +36,7 @@
"prepare": "husky install"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": [
"src/**/*.{js,jsx,ts,tsx,json}": [
"eslint --fix --max-warnings 0",
"prettier --write"
]
Expand All @@ -45,8 +45,8 @@
"@babel/runtime": "^7.15.4",
"@bitcoin-design/bitcoin-icons-react": "^0.1.9",
"@headlessui/react": "^1.5.0",
"@runcitadel/sdk": "^0.3.3",
"@tailwindcss/forms": "^0.4.0",
"@runcitadel/sdk": "^0.3.8",
"@tailwindcss/forms": "^0.5.0",
"assert": "^2.0.0",
"axios": "^0.26.1",
"bech32": "^2.0.0",
Expand All @@ -57,21 +57,23 @@
"dexie": "^3.2.1",
"elliptic": "^6.5.4",
"html5-qrcode": "^2.2.0",
"i18next": "^21.6.12",
"i18next-browser-languagedetector": "^6.1.3",
"invoices": "2.0.3",
"lodash": "^4.17.21",
"memoizee": "^0.4.15",
"postcss-cli": "^9.1.0",
"pubsub-js": "^1.9.4",
"query-string": "^7.1.1",
"react": "^17.0.2",
"react": "^18.0.0",
"react-confetti": "^6.0.1",
"react-dom": "^17.0.2",
"react-dom": "^18.0.0",
"react-i18next": "^11.15.5",
"react-loading-skeleton": "^3.0.3",
"react-modal": "^3.14.4",
"react-palette": "^1.0.2",
"react-qr-code": "^2.0.3",
"react-router-dom": "^6.2.2",
"sha.js": "^2.4.11",
"stream": "^0.0.2",
"uuid": "^8.3.2",
"webextension-polyfill": "^0.8.0",
Expand All @@ -80,13 +82,13 @@
"zustand": "^3.7.1"
},
"devDependencies": {
"@babel/core": "^7.17.5",
"@babel/core": "^7.17.8",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@commitlint/cli": "^16.2.1",
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@storybook/addon-actions": "^6.4.19",
"@storybook/addon-essentials": "^6.4.19",
Expand All @@ -96,23 +98,23 @@
"@storybook/cli": "^6.4.19",
"@storybook/manager-webpack5": "^6.4.19",
"@storybook/react": "^6.4.19",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"@types/crypto-js": "^4.1.1",
"@types/elliptic": "^6.4.14",
"@types/jest": "^27.4.1",
"@types/memoizee": "^0.4.7",
"@types/pubsub-js": "^1.8.3",
"@types/react-dom": "^17.0.14",
"@types/react-modal": "^3.13.1",
"@types/sha.js": "^2.4.0",
"@types/uuid": "^8.3.4",
"@types/webextension-polyfill": "^0.8.2",
"@types/webextension-polyfill": "^0.8.3",
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"autoprefixer": "^10.4.2",
"autoprefixer": "^10.4.4",
"babel-jest": "^27.5.1",
"babel-loader": "^8.2.3",
"babel-loader": "^8.2.4",
"babel-plugin-import": "^1.13.3",
"buffer": "^6.0.3",
"clean-webpack-plugin": "^4.0.0",
Expand All @@ -123,19 +125,19 @@
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-react": "^7.29.3",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.3.0",
"filemanager-webpack-plugin": "^6.1.7",
"html-webpack-plugin": "^5.5.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"jest-transform-stub": "^2.0.0",
"jest-webextension-mock": "^3.7.19",
"lint-staged": "^12.3.5",
"lint-staged": "^12.3.7",
"mini-css-extract-plugin": "^2.6.0",
"postcss": "^8.4.7",
"postcss": "^8.4.12",
"postcss-loader": "^6.2.1",
"prettier": "^2.5.1",
"prettier": "^2.6.0",
"process": "^0.11.10",
"react-test-renderer": "^17.0.2",
"resolve-url-loader": "^5.0.0",
Expand All @@ -145,7 +147,7 @@
"tailwindcss": "^3.0.23",
"terser-webpack-plugin": "5.3.1",
"ts-node": "^10.7.0",
"typescript": "^4.6.2",
"typescript": "^4.6.3",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2",
"wext-manifest-loader": "^2.3.0",
Expand Down
60 changes: 60 additions & 0 deletions src/app/components/AccountMenu/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { BrowserRouter } from "react-router-dom";

import * as AccountsContext from "../../context/AccountsContext";
import AccountMenu from ".";
import type { Accounts } from "../../../types";

const mockAccounts: Accounts = {
"1": { id: "1", connector: "lnd", config: "", name: "LND account" },
"2": { id: "2", connector: "galoy", config: "", name: "Galoy account" },
};

jest.spyOn(AccountsContext, "useAccounts").mockReturnValue({
accounts: mockAccounts,
getAccounts: jest.fn(),
});

describe("AccountMenu", () => {
test("renders the toggle button", async () => {
render(
<BrowserRouter>
<AccountMenu />
</BrowserRouter>
);

expect(screen.getByRole("button")).toHaveTextContent("Toggle Dropdown");
});

test("displays accounts and options", async () => {
render(
<BrowserRouter>
<AccountMenu />
</BrowserRouter>
);

fireEvent.click(screen.getByText("Toggle Dropdown"));

await waitFor(() => screen.getByText("Switch account"));

expect(screen.getByText("LND account")).toBeInTheDocument();
expect(screen.getByText("Galoy account")).toBeInTheDocument();
expect(screen.getByText("Add a new account")).toBeInTheDocument();
expect(screen.getByText("Accounts")).toBeInTheDocument();
});

test("displays accounts without options", async () => {
render(
<BrowserRouter>
<AccountMenu showOptions={false} />
</BrowserRouter>
);

fireEvent.click(screen.getByText("Toggle Dropdown"));

expect(screen.getByText("LND account")).toBeInTheDocument();
expect(screen.getByText("Galoy account")).toBeInTheDocument();
expect(screen.queryByText("Add a new account")).not.toBeInTheDocument();
expect(screen.queryByText("Accounts")).not.toBeInTheDocument();
});
});
45 changes: 27 additions & 18 deletions src/app/components/AccountMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { useAccounts } from "../../context/AccountsContext";
import Badge from "../Badge";
import Menu from "../Menu";

function AccountMenu() {
export type Props = {
showOptions?: boolean;
};

function AccountMenu({ showOptions = true }: Props) {
const auth = useAuth();
const navigate = useNavigate();
const { accounts, getAccounts } = useAccounts();
Expand Down Expand Up @@ -50,6 +54,7 @@ function AccountMenu() {
<Menu as="div">
<Menu.Button className="h-full px-2 rounded-r-md hover:bg-gray-200 dark:hover:bg-gray-500 transition-colors duration-200">
<CaretDownIcon className="h-4 w-4 dark:text-white" />
<span className="sr-only">Toggle Dropdown</span>
</Menu.Button>
<Menu.List position="left">
<Menu.Subheader>Switch account</Menu.Subheader>
Expand All @@ -74,23 +79,27 @@ function AccountMenu() {
</Menu.ItemButton>
);
})}
<Menu.Divider />
<Menu.ItemButton
onClick={() => {
openOptions("accounts/new");
}}
>
<PlusIcon className="h-5 w-5 mr-2 text-gray-500" />
Add a new account
</Menu.ItemButton>
<Menu.ItemButton
onClick={() => {
openOptions("accounts");
}}
>
<AddressBookIcon className="h-5 w-5 mr-2 text-gray-500" />
Accounts
</Menu.ItemButton>
{showOptions && (
<>
<Menu.Divider />
<Menu.ItemButton
onClick={() => {
openOptions("accounts/new");
}}
>
<PlusIcon className="h-5 w-5 mr-2 text-gray-500" />
Add a new account
</Menu.ItemButton>
<Menu.ItemButton
onClick={() => {
openOptions("accounts");
}}
>
<AddressBookIcon className="h-5 w-5 mr-2 text-gray-500" />
Accounts
</Menu.ItemButton>
</>
)}
</Menu.List>
</Menu>
);
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/AllowanceMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import utils from "../../../common/lib/utils";

import Button from "../Button";
import Menu from "../Menu";
import TextField from "../Form/TextField";
import TextField from "../form/TextField";

type Props = {
allowance: {
Expand Down Expand Up @@ -57,6 +57,7 @@ function AllowanceMenu({ allowance, onEdit, onDelete }: Props) {
<Menu.List position="right">
<Menu.ItemButton onClick={openModal}>Edit</Menu.ItemButton>
<Menu.ItemButton
danger
onClick={async () => {
if (
window.confirm("Are you sure you want to delete this website?")
Expand Down
65 changes: 65 additions & 0 deletions src/app/components/BudgetControl/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { ChangeEventHandler } from "react";
import { Transition } from "@headlessui/react";

import Checkbox from "../form/Checkbox";
import TextField from "../form/TextField";

type Props = {
remember: boolean;
onRememberChange: ChangeEventHandler<HTMLInputElement>;
budget: string;
onBudgetChange: ChangeEventHandler<HTMLInputElement>;
};

function BudgetControl({
remember,
onRememberChange,
budget,
onBudgetChange,
}: Props) {
return (
<div className="mb-8">
<div className="flex items-center">
<Checkbox
id="remember_me"
name="remember_me"
checked={remember}
onChange={onRememberChange}
/>
<label
htmlFor="remember_me"
className="ml-2 block text-sm text-gray-900 font-medium dark:text-white"
>
Remember and set a budget
</label>
</div>

<Transition
show={remember}
enter="transition duration-100 ease-out"
enterFrom="scale-95 opacity-0"
enterTo="scale-100 opacity-100"
leave="transition duration-75 ease-out"
leaveFrom="scale-100 opacity-100"
leaveTo="scale-95 opacity-0"
>
<p className="mt-4 mb-3 text-gray-500 text-sm">
You may set a balance to not be asked for confirmation on payments
until it is exhausted.
</p>
<div>
<TextField
id="budget"
label="Budget"
placeholder="sat"
value={budget}
type="number"
onChange={onBudgetChange}
/>
</div>
</Transition>
</div>
);
}

export default BudgetControl;
Loading