Skip to content

Commit

Permalink
feat: nest webln calls under the webln/ namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bumi committed Mar 31, 2022
1 parent 48b8b1d commit ad399ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/router/Prompt/Prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Prompt extends Component<
element={<Navigate to={`/${this.state.type}`} replace />}
/>
<Route
path="enable"
path="webln/enable"
element={<Enable origin={this.state.origin} />}
/>
<Route
Expand Down
17 changes: 6 additions & 11 deletions src/extension/background-script/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import * as webln from "./actions/webln";

// TODO: potential nesting/grouping of actions for better organization
const routes = {
/*
webln: {
enable: allowances.enable,
getInfo: ln.getInfo,
sendPayment: ln.sendPayment,
sendPaymentOrPrompt: webln.sendPaymentOrPrompt,
keysendOrPrompt: webln.keysendOrPrompt,
lnurl: lnurl,
makeInvoice: ln.makeInvoice,
signMessage: ln.signMessage,
verifyMessage: ln.verifyMessage,
},
ln: ln,
accounts: accounts,
*/
addAllowance: allowances.add,
enable: allowances.enable,
getAllowance: allowances.get,
getAllowanceById: allowances.getById,
listAllowances: allowances.list,
Expand All @@ -29,16 +29,11 @@ const routes = {
isUnlocked: accounts.isUnlocked,
unlock: accounts.unlock,
getInfo: ln.getInfo,
lnurl,
lnurlPay,
sendPaymentOrPrompt: webln.sendPaymentOrPrompt,
keysendOrPrompt: webln.keysendOrPrompt,
signMessageOrPrompt: webln.signMessageOrPrompt,
sendPayment: ln.sendPayment,
keysend: ln.keysend,
checkPayment: ln.checkPayment,
signMessage: ln.signMessage,
verifyMessage: ln.verifyMessage,
makeInvoice: ln.makeInvoice,
getBalance: ln.getBalance,
getPayments: payments.all,
Expand Down
2 changes: 1 addition & 1 deletion src/extension/content-script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (shouldInject()) {
return;
}
const messageWithOrigin = {
type: ev.data.type, // TODO: rename type to action
type: `webln/${ev.data.type}`, // TODO: rename type to action
args: ev.data.args,
application: "LBE",
public: true, // indicate that this is a public call from the content script
Expand Down

0 comments on commit ad399ca

Please sign in to comment.