Types

Type names defined here are scoped under the monetization namespace. Implementations expose them as namespace-scoped dictionaries on `chrome.monetization` (for example, {{monetization/Wallet}} corresponds to `chrome.monetization.Wallet`).

Wallet

Describes the connected user wallet, including its current budget balance.

      enum ReconnectReason {
        "unauthorized"
      };

      dictionary Wallet {
        required DOMString address;
        required DOMString name;
        required DOMString currency;
        required DOMString initialBalance;
        required DOMString remainingBalance;
        DOMString? renewDate;
        ReconnectReason? reconnectReason;
      };
    

Properties

address
The canonical wallet address URL, as returned in the `id` field of the Open Payments wallet address resource. This is the resolved address (e.g. `"https://ilp.example.com/123456/usd"`), which may differ from the URL the user originally entered (such as a `.well-known/pay` shortcut).
name
A human-readable name for the wallet.
currency
An ISO 4217 currency code (e.g. `"USD"`).
initialBalance
A decimal string representing the total budget allocated for the current billing period (e.g. `"10.00"`).
remainingBalance
A decimal string representing the budget remaining for the current billing period (e.g. `"7.50"`).
renewDate
An ISO 8601 date string indicating when the budget next renews. Absent when the budget does not renew monthly.
reconnectReason
When present, indicates that the wallet must be reconnected before it can be used, and conveys the reason. When absent, the wallet is usable. Possible values:
`"unauthorized"`
The stored access token is no longer valid (for example, it has expired or been revoked).

The {{Wallet/currency}}, {{Wallet/initialBalance}}, and {{Wallet/remainingBalance}} members use the same conventions as the `currency` and `value` members of the {{PaymentCurrencyAmount}} dictionary defined in [[payment-request]] (and the `MonetizationCurrencyAmount` interface in [[WebMonetization]]).

Session

Identifies a monetization session and the document it belongs to.

      dictionary Session {
        required long tabId;
        required long frameId;
        required long sessionId;
        required DOMString walletAddress;
      };
    

Properties

tabId
The identifier of the tab containing the monetized document.
frameId
The identifier of the frame within the tab. `0` denotes the top-level (main) frame.
sessionId
The identifier of the monetization session.
walletAddress
The wallet address being paid by this session.