@recoilpay/intent-widget 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  RecoilPay intents on any website, with no framework or build step. Add one script tag and one element. Your visitors type what they want ("swap 10 USDC on Base for ETH on Arbitrum"), connect a wallet, confirm, and watch it settle.
4
4
 
5
5
  ```html
6
- <script type="module" src="https://cdn.jsdelivr.net/npm/@recoilpay/intent-widget@0.1/dist/recoilpay-intent-widget.js"></script>
6
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@recoilpay/intent-widget@0.5/dist/recoilpay-intent-widget.js"></script>
7
7
 
8
8
  <recoilpay-intent
9
9
  hf-access-token="YOUR_HUGGING_FACE_TOKEN"
@@ -65,6 +65,8 @@ document.addEventListener('recoilpay-complete', (e) => {
65
65
  | `recoilpay-error` | `{ message }`, already written for the end user |
66
66
  | `recoilpay-cash-out-started` | `{ tradeId }` |
67
67
  | `recoilpay-cash-out-ended` | `{ tradeId, state }`, where `state` is `settled_to_fiat_payer`, `refunded_to_funder` or `failed` |
68
+ | `recoilpay-purchase-started` | `{ tradeId }` |
69
+ | `recoilpay-purchase-ended` | `{ tradeId, state }`, as for a cash-out |
68
70
 
69
71
  ## Isolation
70
72
 
@@ -89,4 +91,5 @@ python3 -m http.server 5299
89
91
  - **Testnets only** for now: Base Sepolia, OP Sepolia, Ethereum Sepolia and Polygon Amoy, with mock tokens.
90
92
  - **The first swap of a token needs a one-time Permit2 approval.** The widget explains this before it happens.
91
93
  - **Cash out to a bank (testnet, NGN):** "cash out 50 USDC on Base Sepolia to NGN". Bank details are encrypted on the visitor's device for the solver who pays out. A cash-out in progress is remembered in `localStorage` (its trade id only), so a visitor who reloads comes back to confirm it. This adds about 10 KB gzipped.
94
+ - **Buy with a bank transfer (testnet, NGN):** "buy ₦50,000 of USDC on Base Sepolia". A first purchase needs a one-time identity check in Dojah's widget, which loads from `widget.dojah.io` when it's needed and opens above the page; allow it in your Content Security Policy if you have one. Where to pay is shown only once the solver's USDC is locked for the visitor. A purchase in progress is remembered in `localStorage` (its trade id only), so a visitor who reloads can still pay.
92
95
  - **Browser requirements:** module scripts, custom elements and Shadow DOM. Every current browser qualifies.