@glacislabs/stablegenie-zerodelta 3.4.0 → 4.1.0

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
@@ -1,28 +1,54 @@
1
1
  # @glacislabs/stablegenie-zerodelta
2
2
 
3
- A lightweight, embeddable **ZeroDelta payment + swap widget**. Two variants share one
3
+ A lightweight, embeddable **ZeroDelta payment, exchange + swap widget**. Every surface shares one
4
4
  dependency-free engine:
5
5
 
6
+ - **`<StableGenieExchange>`** — the full exchange card (li.fi-style), in `compact`, `wide` or `pill`.
7
+ - **`<StableGenieRwaExchange>`** — the same card over real-world assets, one leg on each side.
6
8
  - **`<StableGeniePay>`** — *exact-receive*. A merchant/dApp needs exactly `X` USDC on chain `Y` at
7
9
  address `Z`; the user pays in any supported asset/chain and ZeroDelta routes to the exact receive.
8
- - **`<StableGenieSwap>`** — *exact-in* swap between supported assets/chains (li.fi-style).
10
+ - **`<StableGenieSwap>`** — *exact-in* swap between supported assets/chains.
11
+ - **`<PaymentIsland>`** — ZeroDelta Link: a collapsed express-checkout pill that expands to a
12
+ one-click card. `variant="pill"` on any of the above renders it.
9
13
 
10
14
  The user's own wallet always owns the final signature — the widget never holds keys and never
11
15
  submits silently. Every ZeroDelta quote is re-validated (`assertQuoteMatchesSelection`), every
12
16
  planned transaction is re-decoded before signing (`validatePlannedTransaction`), and the settling
13
17
  transaction is confirmed on-chain in a trusted realm (`verifySubmittedTx`).
14
18
 
15
- Supported chains: Ethereum, Optimism, Arbitrum, Base, Ink, Unichain, Plasma, Sonic, Plume.
16
- Supported assets: USDC, USDT, USDE, XAUT. (Card/fiat rails are roadmap, not shipped.)
19
+ Supported **source** chains: Ethereum, Optimism, Arbitrum, Base, Ink, Unichain, Plasma, Sonic, Plume.
20
+ Destinations are not limited to that set — receiving needs no escrow on the far chain, only a
21
+ published route.
22
+
23
+ Supported assets — three nested allowlists (`src/core/constants.ts`), 26 symbols in total:
24
+
25
+ | List | Members |
26
+ |---|---|
27
+ | Executable stables (stable ⇄ stable) | USDC, USDT, USDE, USDTB, AUSD, PYUSD, USDG |
28
+ | Additional RWA-side stables | USD1, wM, USDS, DAI, RLUSD |
29
+ | Tradeable RWA | XAUT, nALPHA, nTBILL, nBASIS, nCREDIT, nOPAL, nWISDOM, nACRDX, nLCRD, nAXI, nCLOA, nFALCON, deJAAA, deSPXA |
30
+
31
+ ⚠️ These **bound** what can be named; they are not the catalogue. What is selectable is derived per
32
+ load from `/chains` + `/tokens` + `/routes` + `/route-health` (`engine.fetchCatalogue()`).
33
+
34
+ Fiat on/off-ramp and bank settlement are roadmap, not shipped — those modes render an honest
35
+ coming-soon panel rather than a quote the engine cannot perform.
17
36
 
18
37
  The engine targets the **production** ZeroDelta escrow (`0x5e25c8ABc19b88d6A7Ab0D805C77A34987a68b40` on
19
38
  every supported chain, pinned offline and re-verified against `GET /api/v1/chains`).
20
39
 
40
+ ## Documentation
41
+
42
+ Integration docs are published at
43
+ **[docs.glacislabs.com/zero-delta/widget](https://docs.glacislabs.com/zero-delta/widget)** — install
44
+ and embed, configuration, theming, the keyless proxy you must deploy, and the API reference.
45
+
21
46
  ## Playground
22
47
 
23
- A single-page playground — configure every widget, preview it live against the production gateway,
24
- and copy the embed — lives in this repo under [`playground/`](playground/) and deploys to Vercel from
25
- the same repository that publishes the package.
48
+ **[playground.glacislabs.com](https://playground.glacislabs.com/)** — configure every
49
+ widget, preview it live against the production gateway, and copy the embed. It lives in this repo
50
+ under [`playground/`](playground/) and deploys to Vercel from the same repository that publishes the
51
+ package.
26
52
 
27
53
  ```sh
28
54
  cp .env.example .env # STABLEGENIE_API_KEY=<a ZeroDelta viewer key>
@@ -34,9 +60,11 @@ npm run test:e2e # offline Playwright suite against the production bu
34
60
  reference integration: it imports the widgets by package name and passes plain props — exactly what
35
61
  the playground's "React" snippet prints.
36
62
  - [`api/`](api/) is the same-origin **keyless proxy** the widget's default `apiBase` (`/api/widget/v1`)
37
- expects: it forwards only `chains`, `tokens`, `routes` and `quote` to the gateway and injects the
38
- viewer key server-side. Copy it into your own deployment (Vercel function or any Node handler —
39
- `api/_proxy.ts` is framework-free).
63
+ expects: it forwards only `chains`, `tokens`, `routes`, `route-health`, `quote` and
64
+ `screen/wallet` to the gateway and injects the viewer key server-side. Copy it into your own
65
+ deployment (Vercel function or any Node handler — `api/_proxy.ts` is framework-free).
66
+ ⚠️ Omitting `screen/wallet` (added in 4.0.0) fails **closed**: the engine cannot screen the
67
+ direct-settlement path, so direct settlement disappears from the picker.
40
68
  - `vercel.json`, `.env.example` and `.github/workflows/ci.yml` document the deploy: Vercel project
41
69
  at the repo root, `npm run build:playground`, output `playground/dist`, env
42
70
  `STABLEGENIE_API_KEY` (+ optional `ZD_API_UPSTREAM`, `WIDGET_ALLOWED_ORIGINS`; the aliases
@@ -49,8 +77,12 @@ npm i @glacislabs/stablegenie-zerodelta
49
77
  ```
50
78
 
51
79
  No registry configuration and no auth token are needed — the package is published publicly to
52
- npmjs.com with [npm provenance](https://docs.npmjs.com/generating-provenance-statements), so you can
53
- verify on the package page that a given tarball was built by this repo's release workflow.
80
+ npmjs.com.
81
+
82
+ > [npm provenance](https://docs.npmjs.com/generating-provenance-statements) is **currently off**: it
83
+ > requires a public source repository and this one is still private, so the tarball carries no
84
+ > sigstore attestation. `id-token: write` stays on the release job, so restoring it is a one-line
85
+ > change to `publishConfig` once the repo goes public — see [PUBLISHING.md](PUBLISHING.md).
54
86
 
55
87
  `react` and `react-dom` are **required peerDependencies** for the main entry (they are kept external
56
88
  in the ESM/CJS builds, so the host's React is reused — no double bundle). CSS is auto-injected; there
@@ -60,9 +92,9 @@ is no stylesheet to import.
60
92
 
61
93
  | Import | Contains | React required |
62
94
  |---|---|---|
63
- | `@glacislabs/stablegenie-zerodelta` | the React components (`StableGeniePay`, `StableGenieSwap`, `StableGenieExchange`, `StableGenieProvider`) | **yes** |
95
+ | `@glacislabs/stablegenie-zerodelta` | the React components (`StableGeniePay`, `StableGenieSwap`, `StableGenieExchange`, `StableGenieRwaExchange`, `PaymentIsland`, `StableGenieProvider`) | **yes** |
64
96
  | `…/core` | the framework-agnostic engine — quoting, routing, encoding, the pre-sign validator and the on-chain verifier | **no** |
65
- | `…/mount` | imperative `mountPay` / `mountSwap` for non-React hosts | yes (bundled by the host build) |
97
+ | `…/mount` | imperative `mount(el, config)` for non-React hosts | yes (bundled by the host build) |
66
98
  | `…/standalone` | the prebuilt IIFE with React bundled in, for plain `<script>` embeds | no |
67
99
 
68
100
  Use `…/core` if you want the routing/validation engine without pulling in React — it is verifiably
@@ -101,9 +133,9 @@ import { StableGenieSwap } from "@glacislabs/stablegenie-zerodelta";
101
133
  ```
102
134
 
103
135
  The `standalone.global.js` build bundles React; the ESM/CJS builds keep it external. The global
104
- exposes `mountPay`, `mountSwap`, `mountExchange` and `mountExpress`, each taking the same props as the
105
- React component (including the display `variant`) and returning an unmount function. The playground's
106
- "Script tag" tab prints the exact call for any configuration.
136
+ exposes `mountPay`, `mountSwap`, `mountExchange`, `mountRwaExchange` and `mountExpress`, each taking
137
+ the same props as the React component (including the display `variant`) and returning an unmount
138
+ function. The playground's "Script tag" tab prints the exact call for any configuration.
107
139
 
108
140
  **Getting the file.** It ships in the package at `dist/standalone.global.js`, reachable as the
109
141
  `./standalone` export. Copy it into your own static assets as part of your build, e.g.
@@ -118,12 +150,12 @@ React component (including the display `variant`) and returning an unmount funct
118
150
  **Or load it from a CDN.** The `unpkg` and `jsdelivr` fields point at the standalone build:
119
151
 
120
152
  ```html
121
- <script src="https://unpkg.com/@glacislabs/stablegenie-zerodelta@3.1.0/dist/standalone.global.js"></script>
153
+ <script src="https://unpkg.com/@glacislabs/stablegenie-zerodelta@4.0.0/dist/standalone.global.js"></script>
122
154
  <!-- or -->
123
- <script src="https://cdn.jsdelivr.net/npm/@glacislabs/stablegenie-zerodelta@3.1.0/dist/standalone.global.js"></script>
155
+ <script src="https://cdn.jsdelivr.net/npm/@glacislabs/stablegenie-zerodelta@4.0.0/dist/standalone.global.js"></script>
124
156
  ```
125
157
 
126
- ★ For production, pin an exact version (`…/stablegenie-zerodelta@1.1.0`) rather than tracking
158
+ ★ For production, pin an exact version (`…/stablegenie-zerodelta@4.0.0`) rather than tracking
127
159
  `latest`, and prefer self-hosting if your CSP disallows third-party script origins — this widget
128
160
  sits in a payment path.
129
161