@recoilpay/intent-widget 0.6.0 → 0.7.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.5/dist/recoilpay-intent-widget.js"></script>
6
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@recoilpay/intent-widget@0.7/dist/recoilpay-intent-widget.js"></script>
7
7
 
8
8
  <recoilpay-intent
9
9
  hf-access-token="YOUR_HUGGING_FACE_TOKEN"
@@ -23,6 +23,7 @@ The widget brings its own wallet picker:
23
23
  - **WalletConnect** (mobile wallets over QR) appears only when you set `walletconnect-project-id`. Use **your own** project id: create one free at [cloud.reown.com](https://cloud.reown.com) and add your site's domain to its allowlist. WalletConnect's code is downloaded only when a visitor chooses it.
24
24
  - **Returning visitors** are reconnected silently, and switching accounts or disconnecting inside the wallet is followed.
25
25
  - **Testnets** the wallet doesn't know yet are added for the visitor when a swap needs them.
26
+ - **Solana wallets** (Phantom, Solflare, Backpack and any other [Wallet Standard](https://github.com/wallet-standard/wallet-standard) wallet) are listed in the same picker, for cashing out and buying on Solana devnet. A visitor can connect one alone or beside an EVM wallet, and it's reconnected silently on a return visit too.
26
27
 
27
28
  **Already have a connected wallet on your page?** Hand it over, and the picker is skipped:
28
29
 
@@ -60,6 +61,7 @@ document.addEventListener('recoilpay-complete', (e) => {
60
61
  | Event | `detail` |
61
62
  |---|---|
62
63
  | `recoilpay-wallet` | `{ address }`, where `address` is `null` on disconnect |
64
+ | `recoilpay-solana-wallet` | `{ address }` (base58), where `address` is `null` on disconnect |
63
65
  | `recoilpay-order-submitted` | `{ orderId }` |
64
66
  | `recoilpay-complete` | `{ orderId, status, explorerUrl }` |
65
67
  | `recoilpay-error` | `{ message }`, already written for the end user |
@@ -88,8 +90,8 @@ python3 -m http.server 5299
88
90
  ## Notes
89
91
 
90
92
  - **Hugging Face token:** Plain-English parsing calls a language model on Hugging Face **from the browser**, with your own access token. The token is visible to anyone who loads your page, so use a fine-grained token with only the "Make calls to Inference Providers" permission, use it for nothing else, and rotate it if it's abused. Without a token, parsing is off and users see an example sentence.
91
- - **Testnets only** for now: Base Sepolia, OP Sepolia, Ethereum Sepolia and Polygon Amoy, with mock tokens.
93
+ - **Testnets only** for now: Base Sepolia, OP Sepolia, Ethereum Sepolia, Polygon Amoy and BNB Chain Testnet, with mock tokens, plus Solana devnet.
92
94
  - **The first swap of a token needs a one-time Permit2 approval.** The widget explains this before it happens.
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.
95
+ - **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. On Solana devnet ("cash out 2 USDC on Solana to NGN") the visitor signs the lock with their Solana wallet and needs no SOL: the solver pays the fees.
94
96
  - **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.
95
97
  - **Browser requirements:** module scripts, custom elements and Shadow DOM. Every current browser qualifies.