-
Notifications
You must be signed in to change notification settings - Fork 166
feat(spec/ext) specify getWallet/onPayment #664
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,91 @@ | ||
| <section id="types"> | ||
| <h2>Types</h2> | ||
|
|
||
| <section data-dfn-for="MonetizationInfo"> | ||
| <h3><dfn>MonetizationInfo</dfn></h3> | ||
| <p class="note"> | ||
| Type names defined here are scoped under the | ||
| <a>monetization</a> namespace. Implementations expose them as | ||
| namespace-scoped dictionaries on <code>chrome.monetization</code> | ||
| (for example, {{monetization/Wallet}} corresponds to | ||
| <code>chrome.monetization.Wallet</code>). | ||
| </p> | ||
|
|
||
| <section data-dfn-for="monetization/Wallet"> | ||
| <h3><dfn data-dfn-for="monetization">Wallet</dfn></h3> | ||
|
|
||
| <p> | ||
| Describes the document where a monetization state change occurred. | ||
| Describes the connected user wallet, including its current | ||
| budget balance. Currency amounts follow | ||
| {{CurrencyAmount}} conventions defined in [[WebMonetization]]. | ||
| </p> | ||
|
|
||
| <pre class="idl"> | ||
| dictionary MonetizationInfo { | ||
| dictionary Wallet { | ||
| required DOMString address; | ||
|
asurkov marked this conversation as resolved.
|
||
| required DOMString name; | ||
|
asurkov marked this conversation as resolved.
|
||
| required DOMString currency; | ||
| required DOMString initial; | ||
| required DOMString remaining; | ||
|
asurkov marked this conversation as resolved.
Outdated
|
||
| DOMString? renewDate; | ||
| required boolean needsReconnect; | ||
|
asurkov marked this conversation as resolved.
Outdated
|
||
| }; | ||
| </pre> | ||
|
|
||
| <h4>Properties</h4> | ||
| <dl> | ||
| <dt><dfn>address</dfn></dt> | ||
| <dd> | ||
| The wallet address URL. | ||
| </dd> | ||
|
|
||
| <dt><dfn>name</dfn></dt> | ||
| <dd> | ||
| A human-readable name for the wallet. | ||
| </dd> | ||
|
|
||
| <dt><dfn>currency</dfn></dt> | ||
| <dd> | ||
| An ISO 4217 currency code (e.g. <code>"USD"</code>). | ||
|
asurkov marked this conversation as resolved.
Outdated
|
||
| </dd> | ||
|
|
||
| <dt><dfn>initial</dfn></dt> | ||
| <dd> | ||
| A decimal string representing the total budget for the current | ||
|
asurkov marked this conversation as resolved.
Outdated
|
||
| billing period (e.g. <code>"10.00"</code>). | ||
| </dd> | ||
|
|
||
| <dt><dfn>remaining</dfn></dt> | ||
| <dd> | ||
| A decimal string representing the remaining budget for the | ||
|
asurkov marked this conversation as resolved.
Outdated
|
||
| current billing period (e.g. <code>"7.50"</code>). | ||
| </dd> | ||
|
|
||
| <dt><dfn>renewDate</dfn></dt> | ||
| <dd> | ||
| An ISO 8601 date string indicating when the budget next renews. | ||
| Absent when the budget does not renew monthly. | ||
| </dd> | ||
|
|
||
| <dt><dfn>needsReconnect</dfn></dt> | ||
| <dd> | ||
| <code>true</code> when the stored access token is invalid and the | ||
| wallet must be reconnected. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens when remaining budget is too low? Do we set
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nothing right now I suspect, needsReconnect is set on the user wallet response, current implementation doesn't guess about reasons. |
||
| </dd> | ||
| </dl> | ||
| </section> | ||
|
|
||
| <section data-dfn-for="monetization/Session"> | ||
| <h3><dfn data-dfn-for="monetization">Session</dfn></h3> | ||
|
|
||
| <p> | ||
| Identifies a monetization session and the document it belongs to. | ||
| </p> | ||
|
|
||
| <pre class="idl"> | ||
| dictionary Session { | ||
| required long tabId; | ||
| required long frameId; | ||
| required DOMString url; | ||
| required long sessionId; | ||
| required DOMString walletAddress; | ||
| }; | ||
| </pre> | ||
|
|
||
|
|
@@ -29,9 +102,14 @@ <h4>Properties</h4> | |
| <code>0</code> denotes the top-level (main) frame. | ||
| </dd> | ||
|
|
||
| <dt><dfn>url</dfn></dt> | ||
| <dt><dfn>sessionId</dfn></dt> | ||
| <dd> | ||
| The identifier of the monetization session. | ||
| </dd> | ||
|
|
||
| <dt><dfn>walletAddress</dfn></dt> | ||
| <dd> | ||
| The URL of the monetized document. | ||
| The wallet address being paid by this session. | ||
| </dd> | ||
| </dl> | ||
| </section> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.