-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Web Monetization + Open Payments: Part 1 Connecting Wallet #163
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
base: main
Are you sure you want to change the base?
Conversation
c969584 to
a55bf35
Compare
a55bf35 to
86bad07
Compare
|
Top quality information. Indentation looks good to me |
|
|
||
| A browser extension consists of several key components. The pop-up is the user interface that appears when users click the extension icon in the browser's toolbar. The pop-up is typically the main interface that users interact with. In the Web Monetization extension, you will first use this pop-up to enter your wallet address and set a budget for the wallet connection process. Later, you can check a website's monetization status and send one-time payments there. | ||
|
|
||
| The background script (also known as the background service worker) functions as a secure backend server within your browser. It coordinates activities and securely stores sensitive data, such as payment information, away from the web pages. The Open Payments bits of the extension are live here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to call out the use of 'live' at the end of the sentence. It's a heteronym, so I wasn't sure if you meant "...bits of the extension live here" or as it's written. Both are fine :)
|
|
||
| The standard Open Payments Node.js SDK, as the name suggests, is designed specifically for a Node.js environment. Getting it to work within a browser extension requires addressing a couple of key differences. | ||
|
|
||
| The first hurdle is that the SDK relies on crypto modules specific to Node.js. To make it functional in the browser environment, we must polyfill these dependencies. The `crypto-browserify` npm package works well for this use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crypto modules?! Web Monetization is a crypto thing? (Kidding, but maybe the first usage should be expanded to cryptography juuuust to be clear.)
|
|
||
| To control spending, you can set a budget in your wallet's currency. This budget represents the maximum amount the extension is allowed to spend on your behalf. | ||
|
|
||
| The extension assists you by fetching [default budget recommendations from our data store](https://github.com/interledger/web-monetization-budget-suggestions) for that currency. If no specific recommendation is available, it converts a generic $5 USD equivalent to serve as a sensible default. You can always define your own budget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The extension assists you by fetching [default budget recommendations from our data store](https://github.com/interledger/web-monetization-budget-suggestions) for that currency. If no specific recommendation is available, it converts a generic $5 USD equivalent to serve as a sensible default. You can always define your own budget. | |
| The extension assists you by fetching [default budget recommendations from our data store](https://github.com/interledger/web-monetization-budget-suggestions) for that currency. If no specific recommendation is available, it converts a generic $5 USD equivalent to serve as a sensible default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest removing last line as it repeats the first line of the previous paragraph.
|
|
||
| The extension assists you by fetching [default budget recommendations from our data store](https://github.com/interledger/web-monetization-budget-suggestions) for that currency. If no specific recommendation is available, it converts a generic $5 USD equivalent to serve as a sensible default. You can always define your own budget. | ||
|
|
||
| Additionally, the system provides a default rate of pay fetched from our data store, which limits how quickly funds can be spent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the user adjust this?
| In case your account balance temporarily falls below your budget, payments will fail. The extension can seamlessly resume spending from the same grant once you add new funds. | ||
|
|
||
| You can choose to set your budget for automatic monthly replenishment. When you enable this option during wallet connection, the extension creates a recurring grant by adding an interval parameter to the grant request. This grant will automatically reset your spending limit each month, allowing you to spend up to your chosen amount without requiring a new approval each time your previous funds are utilized. Remember, the monthly limit is just an upper boundary; any remaining budget at the end of the cycle will stay in your wallet.\ | ||
| If you choose to opt out of this monthly renewal option, the grant will eventually run out of funds, and you will need to manually approve a new grant to continue receiving payments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you choose to opt out of this monthly renewal option, the grant will eventually run out of funds, and you will need to manually approve a new grant to continue receiving payments. | |
| If you choose to opt out of this monthly renewal option, the grant will eventually run out of funds, and you will need to manually approve a new grant to continue sending payments. |
PR Checklist
Fixes #123)Summary
I'm writing a 3-article series on how Web Monetization uses Open Payments. This is first article in the series.
I anticipate the second one to be ready this week.