@glacislabs/stablegenie-zerodelta 4.0.0 → 4.1.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 +52 -20
- package/dist/{chunk-ABI6ZH7O.js → chunk-6BYXMDVN.js} +214 -49
- package/dist/{chunk-FJQQLB2K.js → chunk-MQ4XLBVF.js} +167 -16
- package/dist/core/index.cjs +169 -15
- package/dist/core/index.d.cts +25 -4
- package/dist/core/index.d.ts +25 -4
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +381 -65
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{mount-D5k_u92L.d.ts → mount-CoLgvvsE.d.ts} +1 -1
- package/dist/{mount-mcyZAzZc.d.cts → mount-Dz9LffFx.d.cts} +1 -1
- package/dist/mount.cjs +381 -65
- package/dist/mount.d.cts +2 -2
- package/dist/mount.d.ts +2 -2
- package/dist/mount.js +2 -2
- package/dist/standalone.global.js +63 -7
- package/dist/{verify-C9vzpm4T.d.cts → verify-Bdw8-YWZ.d.cts} +74 -3
- package/dist/{verify-C9vzpm4T.d.ts → verify-Bdw8-YWZ.d.ts} +74 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,28 +1,54 @@
|
|
|
1
1
|
# @glacislabs/stablegenie-zerodelta
|
|
2
2
|
|
|
3
|
-
A lightweight, embeddable **ZeroDelta payment + swap widget**.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
24
|
-
and copy the embed
|
|
25
|
-
the same repository that publishes the
|
|
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`
|
|
38
|
-
viewer key server-side. Copy it into your own
|
|
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
|
|
53
|
-
|
|
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 `
|
|
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
|
|
105
|
-
React component (including the display `variant`) and returning an unmount
|
|
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@
|
|
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@
|
|
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@
|
|
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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHAIN_DISPLAY_NAMES, EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, complianceView, complianceChecks, DIRECT_CHECK_IDS, complianceTagOf, symbolKey, normalizeDecimalText, parseUnitsDecimal, assetDecimals, findToken, counterpartTokens, assetClassOf, brokenLaneFor, brokenLaneReason, destinationAvailability, SUPPORTED_CHAIN_IDS, formatUnits, unattributedComplianceReasons, distinctScreenedWallets, humanizeComplianceReason, DIRECT_SCOPE_NOTE, categoryLabel, SCREENING_BUCKETS, createEngine, routeNativeValue, checkNativeFee, nativeFeeShortLabel, nativeSymbol, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, BUNDLED_RPC } from './chunk-
|
|
1
|
+
import { CHAIN_DISPLAY_NAMES, EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, complianceView, complianceChecks, DIRECT_CHECK_IDS, complianceTagOf, symbolKey, normalizeDecimalText, parseUnitsDecimal, assetDecimals, findToken, counterpartTokens, assetClassOf, brokenLaneFor, brokenLaneReason, destinationAvailability, SUPPORTED_CHAIN_IDS, formatUnits, unattributedComplianceReasons, distinctScreenedWallets, humanizeComplianceReason, DIRECT_SCOPE_NOTE, categoryLabel, SCREENING_BUCKETS, createEngine, routeNativeValue, checkNativeFee, nativeFeeShortLabel, nativeSymbol, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, BUNDLED_RPC } from './chunk-MQ4XLBVF.js';
|
|
2
2
|
import { createContext, useState, useRef, useEffect, useMemo, useCallback, useId, createElement, useContext } from 'react';
|
|
3
3
|
import { createRoot } from 'react-dom/client';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -453,7 +453,10 @@ function useFlow(args) {
|
|
|
453
453
|
account,
|
|
454
454
|
recipient,
|
|
455
455
|
settlement: route.state === "DIRECT" ? "direct" : "escrow",
|
|
456
|
-
status: v.status === "confirmed" ? "confirmed" : v.status === "mismatch" || v.status === "reverted" ? "error" : "unconfirmed"
|
|
456
|
+
status: v.status === "confirmed" ? "confirmed" : v.status === "mismatch" || v.status === "reverted" ? "error" : "unconfirmed",
|
|
457
|
+
// One signature can be several orders. Record them, or the history of a chained RWA trade
|
|
458
|
+
// reads as a single hop that skipped a chain it demonstrably went through.
|
|
459
|
+
legs: route.legs
|
|
457
460
|
});
|
|
458
461
|
setLastTxEntry(entry.hash ? entry : null);
|
|
459
462
|
appendTxHistory(account, entry);
|
|
@@ -674,6 +677,12 @@ var WIDGET_CSS = `
|
|
|
674
677
|
@keyframes sg-shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
|
|
675
678
|
|
|
676
679
|
.sg-foot{margin-top:14px;display:flex;align-items:center;justify-content:center;gap:6px;font-size:11px;color:var(--sg-text-muted);text-align:center}
|
|
680
|
+
/* display:inline-block is load-bearing, not tidiness. A host running a CSS reset \u2014 Tailwind
|
|
681
|
+
preflight, which most integrators use and which this repo's own playground applies \u2014 sets
|
|
682
|
+
svg{display:block}, and the padlock then takes a line of its own above the sentence. Every other
|
|
683
|
+
glyph in the widget sits in a flex or absolute box where that is harmless; this is the one that
|
|
684
|
+
lives in normal text flow. (WIDGET_CSS is a template literal: no backticks in these comments.) */
|
|
685
|
+
.sg-foot svg{display:inline-block;vertical-align:-1px;margin-right:5px}
|
|
677
686
|
|
|
678
687
|
/* fixed-height variant \u2014 head/foot pinned, body scrolls */
|
|
679
688
|
.sg-widget[data-sg-fixed="true"]{display:flex;flex-direction:column}
|
|
@@ -693,6 +702,7 @@ var WIDGET_CSS = `
|
|
|
693
702
|
.sg-tile:disabled{cursor:default}
|
|
694
703
|
.sg-tile-label{font-size:12px;color:var(--sg-text-muted)}
|
|
695
704
|
.sg-tile-main{display:flex;align-items:center;gap:10px;min-width:0}
|
|
705
|
+
.sg-tile-text{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
696
706
|
.sg-tile-sym{font-size:16px;font-weight:700;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
697
707
|
.sg-tile-chain{font-size:11px;color:var(--sg-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
698
708
|
.sg-tile-empty{color:var(--sg-text-muted);font-size:15px;font-weight:600}
|
|
@@ -727,7 +737,9 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
|
|
|
727
737
|
.sg-sel-head{display:flex;align-items:center;margin-bottom:14px}
|
|
728
738
|
.sg-back{width:32px;height:32px;flex:0 0 auto;border:none;border-radius:999px;background:transparent;color:var(--sg-text);cursor:pointer;font:inherit;display:flex;align-items:center;justify-content:center;transition:background 120ms ease}
|
|
729
739
|
.sg-back:hover{background:var(--sg-surface)}
|
|
730
|
-
.sg-sel-title{flex:1 1 auto;text-align:center;font-size:15px;font-weight:600;margin-right:32px}
|
|
740
|
+
.sg-sel-title{flex:1 1 auto;min-width:0;text-align:center;font-size:15px;font-weight:600;margin-right:32px}
|
|
741
|
+
/* Whose transactions these are \u2014 history is per wallet, and the takeover hides the header's pill. */
|
|
742
|
+
.sg-sel-sub{display:block;font-size:11px;font-weight:600;color:var(--sg-text-muted);margin-top:1px}
|
|
731
743
|
/* Scrolls at ~2.5 rows. The catalogue's destination chains outnumber its source chains three to one
|
|
732
744
|
(9 escrow chains, ~37 total), so an ungated grid was eight rows tall and pushed the token list \u2014
|
|
733
745
|
the thing the panel exists for \u2014 below the fold. The fade is a scroll affordance, not decoration. */
|
|
@@ -786,6 +798,53 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
|
|
|
786
798
|
.sg-hist{width:32px;height:32px;flex:0 0 auto;border:1px solid var(--sg-border);border-radius:999px;background:transparent;color:var(--sg-text-muted);cursor:pointer;font:inherit;display:flex;align-items:center;justify-content:center;transition:color 120ms ease,border-color 120ms ease}
|
|
787
799
|
.sg-hist:hover{color:var(--sg-accent);border-color:var(--sg-accent)}
|
|
788
800
|
|
|
801
|
+
/* transaction history row. NOT the picker's flex row: at 390px that layout wrapped the pair onto two
|
|
802
|
+
lines and then ellipsised the whole meta line down to "\u2026". A 3-column grid instead, where the meta
|
|
803
|
+
spans the badge column so it always has the full card width to wrap into. */
|
|
804
|
+
.sg-txrow{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:11px;row-gap:3px;align-items:center;width:100%;padding:10px 8px;border:none;border-radius:var(--sg-radius-control);background:transparent;color:var(--sg-text);cursor:pointer;font:inherit;text-align:left;transition:background 120ms ease}
|
|
805
|
+
.sg-txrow:hover{background:var(--sg-surface)}
|
|
806
|
+
/* Both ends of the trade, side by side \u2014 the RWA gets a mark of its own. NOT overlapped: each disc
|
|
807
|
+
carries a chain badge at its bottom-right, and an overlap parks that badge on top of its neighbour. */
|
|
808
|
+
.sg-txrow-glyphs{grid-column:1;grid-row:1 / span 2;display:flex;align-items:center;gap:9px}
|
|
809
|
+
/* Each side is its own nowrap span, so a narrow card breaks the line AT THE ARROW, never mid-symbol. */
|
|
810
|
+
.sg-txrow-pair{grid-column:2;grid-row:1;display:flex;flex-wrap:wrap;align-items:baseline;gap:0 6px;font-size:14px;font-weight:700;line-height:1.35;min-width:0}
|
|
811
|
+
.sg-txrow-side{white-space:nowrap;display:inline-flex;align-items:center;gap:5px}
|
|
812
|
+
.sg-txrow-arrow{display:inline-flex;color:var(--sg-text-muted)}
|
|
813
|
+
/* Meta and status share line 2. The badge sat beside the pair until it squeezed the pair onto two
|
|
814
|
+
lines at 390px; down here the pair gets the card's full width and the badge still reads at a glance. */
|
|
815
|
+
/* flex-start, not center: on a phone the meta wraps to two lines, and a centred badge then floats
|
|
816
|
+
between them. Pinned to the first line it reads as the row's status rather than as a third line. */
|
|
817
|
+
.sg-txrow-meta{grid-column:2;grid-row:2;display:flex;align-items:flex-start;gap:8px;font-size:11.5px;color:var(--sg-text-muted);line-height:1.4}
|
|
818
|
+
.sg-txrow-when{flex:1 1 auto;min-width:0;display:flex;flex-wrap:wrap;column-gap:8px}
|
|
819
|
+
/* The kind+chain+orders unit WRAPS; only the timestamp is unbreakable. Holding both as nowrap made
|
|
820
|
+
the express card (the narrowest surface) overflow its text straight under the status pill. */
|
|
821
|
+
.sg-txrow-time{white-space:nowrap}
|
|
822
|
+
.sg-txrow-what{display:flex;flex-wrap:wrap;column-gap:5px;min-width:0}
|
|
823
|
+
.sg-txrow-what>span{white-space:nowrap}
|
|
824
|
+
/* The separator is the literal character, never a CSS unicode escape. WIDGET_CSS is a JS template
|
|
825
|
+
literal, so a backslash-zero-zero escape in here is a legacy octal sequence and esbuild refuses to
|
|
826
|
+
build the package at all \u2014 including inside a comment like this one. */
|
|
827
|
+
.sg-txrow-what>span:not(:last-child)::after{content:"\xB7";margin-left:5px}
|
|
828
|
+
.sg-txrow-end{flex:0 0 auto;margin-left:auto}
|
|
829
|
+
|
|
830
|
+
/* transaction detail: the route, one row per ORDER. A chained (RWA) trade is ONE signature and TWO
|
|
831
|
+
orders; the numbered rail is what makes the middle hop visible instead of merely implied. */
|
|
832
|
+
/* The pair's artwork above the anchor amount, same marks the pickers draw. */
|
|
833
|
+
.sg-panel > .sg-txrow-glyphs{margin-bottom:10px}
|
|
834
|
+
.sg-legs{margin-top:14px}
|
|
835
|
+
.sg-legs-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;margin-bottom:6px}
|
|
836
|
+
.sg-leg-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
|
|
837
|
+
.sg-leg{display:flex;align-items:flex-start;gap:10px;padding:8px 0;border-bottom:1px solid var(--sg-border)}
|
|
838
|
+
.sg-leg:last-child{border-bottom:none}
|
|
839
|
+
/* The step number doubles as the rail: a pseudo-element joins consecutive orders, so two legs read as
|
|
840
|
+
one continuous path rather than as two unrelated rows. */
|
|
841
|
+
.sg-leg-n{position:relative;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-top:1px;border-radius:999px;background:color-mix(in srgb,var(--sg-accent) 14%,transparent);color:var(--sg-accent);font-size:10px;font-weight:700;font-variant-numeric:tabular-nums}
|
|
842
|
+
.sg-leg:not(:last-child) .sg-leg-n::after{content:"";position:absolute;top:19px;left:50%;width:1px;height:calc(100% + 6px);background:var(--sg-border)}
|
|
843
|
+
.sg-leg-body{min-width:0;flex:1 1 auto}
|
|
844
|
+
.sg-leg-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:13px;font-weight:600}
|
|
845
|
+
.sg-leg-arrow{display:inline-flex;color:var(--sg-text-muted)}
|
|
846
|
+
.sg-leg-sub{margin-top:2px;font-size:11.5px;color:var(--sg-text-muted);line-height:1.45}
|
|
847
|
+
|
|
789
848
|
/* transaction detail: copyable hash row (no external links \u2014 everything stays in-widget) */
|
|
790
849
|
.sg-txd-hash{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:13px}
|
|
791
850
|
.sg-txd-hash .sg-mono{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1175,10 +1234,10 @@ function WidgetShell(props) {
|
|
|
1175
1234
|
] })
|
|
1176
1235
|
] }),
|
|
1177
1236
|
/* @__PURE__ */ jsx("div", { className: "sg-body", children: props.children }),
|
|
1178
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ jsx("div", { className: "sg-foot", children: /* @__PURE__ */ jsxs("span", { children: [
|
|
1179
1238
|
/* @__PURE__ */ jsx(LockGlyph, {}),
|
|
1180
1239
|
" Your wallet signs every transaction \xB7 Powered by ZeroDelta"
|
|
1181
|
-
] })
|
|
1240
|
+
] }) })
|
|
1182
1241
|
] });
|
|
1183
1242
|
}
|
|
1184
1243
|
function shortAddress(a) {
|
|
@@ -1674,9 +1733,15 @@ var BUNDLED_TOKEN_LOGO = {
|
|
|
1674
1733
|
function isHttpsUrl(u) {
|
|
1675
1734
|
return typeof u === "string" && /^https:\/\//i.test(u);
|
|
1676
1735
|
}
|
|
1736
|
+
function isSameOriginPath(u) {
|
|
1737
|
+
return typeof u === "string" && u.startsWith("/") && !u.startsWith("//") && !u.startsWith("/\\");
|
|
1738
|
+
}
|
|
1739
|
+
function isDisplayableImageSrc(u) {
|
|
1740
|
+
return isHttpsUrl(u) || isSameOriginPath(u);
|
|
1741
|
+
}
|
|
1677
1742
|
function tokenLogoCandidates(symbol, logoUrl) {
|
|
1678
1743
|
const out = [];
|
|
1679
|
-
if (
|
|
1744
|
+
if (isDisplayableImageSrc(logoUrl)) out.push(logoUrl);
|
|
1680
1745
|
const bundled = BUNDLED_TOKEN_LOGO[symbolKey(symbol)];
|
|
1681
1746
|
if (bundled && !out.includes(bundled)) out.push(bundled);
|
|
1682
1747
|
return out;
|
|
@@ -1723,7 +1788,7 @@ function TokenTile(props) {
|
|
|
1723
1788
|
const shown = props.token?.symbol ?? props.pick?.symbol ?? "";
|
|
1724
1789
|
const glyph = props.pick ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1725
1790
|
/* @__PURE__ */ jsx(TokenGlyph, { symbol: props.pick.symbol, logoUrl: props.token?.logoUrl, chainId: props.pick.chainId }),
|
|
1726
|
-
/* @__PURE__ */ jsxs("span", {
|
|
1791
|
+
/* @__PURE__ */ jsxs("span", { className: "sg-tile-text", children: [
|
|
1727
1792
|
/* @__PURE__ */ jsx("span", { className: "sg-tile-sym", children: shown }),
|
|
1728
1793
|
/* @__PURE__ */ jsx("span", { className: "sg-tile-chain", children: CHAIN_LABELS[props.pick.chainId] || `Chain ${props.pick.chainId}` })
|
|
1729
1794
|
] })
|
|
@@ -1911,6 +1976,59 @@ function HistoryButton(props) {
|
|
|
1911
1976
|
function chainLabel(entry) {
|
|
1912
1977
|
return entry.chainId != null && CHAIN_LABELS[entry.chainId] || entry.chainName || (entry.chainId != null ? `Chain ${entry.chainId}` : "Unknown chain");
|
|
1913
1978
|
}
|
|
1979
|
+
function chainName(chainId, fallback) {
|
|
1980
|
+
return CHAIN_LABELS[chainId] || fallback || (chainId ? `Chain ${chainId}` : "Unknown chain");
|
|
1981
|
+
}
|
|
1982
|
+
function legsOf(entry) {
|
|
1983
|
+
if (entry.legs?.length) return entry.legs;
|
|
1984
|
+
const leg = {
|
|
1985
|
+
index: 1,
|
|
1986
|
+
fromAsset: entry.fromAsset,
|
|
1987
|
+
fromChainId: entry.chainId ?? 0,
|
|
1988
|
+
fromChainName: entry.chainName,
|
|
1989
|
+
fromAmount: entry.payAmount,
|
|
1990
|
+
toAsset: entry.toAsset,
|
|
1991
|
+
toChainId: 0,
|
|
1992
|
+
toChainName: "",
|
|
1993
|
+
toAmount: entry.receiveAmount,
|
|
1994
|
+
executionChainId: 0,
|
|
1995
|
+
executionChainName: ""
|
|
1996
|
+
};
|
|
1997
|
+
return [leg];
|
|
1998
|
+
}
|
|
1999
|
+
function ordersLabel(count) {
|
|
2000
|
+
return count === 1 ? "1 order" : `${count} orders`;
|
|
2001
|
+
}
|
|
2002
|
+
function LegArrowGlyph() {
|
|
2003
|
+
return /* @__PURE__ */ jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
2004
|
+
/* @__PURE__ */ jsx("path", { d: "M5 12h14" }),
|
|
2005
|
+
/* @__PURE__ */ jsx("path", { d: "m13 6 6 6-6 6" })
|
|
2006
|
+
] });
|
|
2007
|
+
}
|
|
2008
|
+
function TxLegs(props) {
|
|
2009
|
+
const multi = props.legs.length > 1;
|
|
2010
|
+
return /* @__PURE__ */ jsxs("div", { className: "sg-legs", "data-multi": multi || void 0, children: [
|
|
2011
|
+
/* @__PURE__ */ jsxs("div", { className: "sg-legs-head", children: [
|
|
2012
|
+
/* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "Route" }),
|
|
2013
|
+
/* @__PURE__ */ jsx("span", { className: "sg-badge", children: ordersLabel(props.legs.length) })
|
|
2014
|
+
] }),
|
|
2015
|
+
/* @__PURE__ */ jsx("ol", { className: "sg-leg-list", children: props.legs.map((leg) => /* @__PURE__ */ jsxs("li", { className: "sg-leg", children: [
|
|
2016
|
+
multi ? /* @__PURE__ */ jsx("span", { className: "sg-leg-n", "aria-hidden": "true", children: leg.index }) : null,
|
|
2017
|
+
/* @__PURE__ */ jsxs("div", { className: "sg-leg-body", children: [
|
|
2018
|
+
/* @__PURE__ */ jsxs("div", { className: "sg-leg-line", children: [
|
|
2019
|
+
/* @__PURE__ */ jsx("span", { className: "sg-mono", children: `${leg.fromAmount ? `${leg.fromAmount} ` : ""}${leg.fromAsset || "\u2014"}` }),
|
|
2020
|
+
/* @__PURE__ */ jsx("span", { className: "sg-leg-arrow", "aria-hidden": "true", children: /* @__PURE__ */ jsx(LegArrowGlyph, {}) }),
|
|
2021
|
+
/* @__PURE__ */ jsx("span", { className: "sg-mono", children: `${leg.toAmount ? `${leg.toAmount} ` : ""}${leg.toAsset || "\u2014"}` })
|
|
2022
|
+
] }),
|
|
2023
|
+
/* @__PURE__ */ jsxs("div", { className: "sg-leg-sub", children: [
|
|
2024
|
+
chainName(leg.fromChainId, leg.fromChainName),
|
|
2025
|
+
leg.toChainId ? ` \u2192 ${chainName(leg.toChainId, leg.toChainName)}` : "",
|
|
2026
|
+
leg.executionChainId && leg.executionChainId !== leg.fromChainId ? ` \xB7 filled on ${chainName(leg.executionChainId, leg.executionChainName)}` : ""
|
|
2027
|
+
] })
|
|
2028
|
+
] })
|
|
2029
|
+
] }, `${leg.index}:${leg.fromChainId}:${leg.toChainId}`)) })
|
|
2030
|
+
] });
|
|
2031
|
+
}
|
|
1914
2032
|
function statusBadge(status) {
|
|
1915
2033
|
if (status === "confirmed")
|
|
1916
2034
|
return /* @__PURE__ */ jsx("span", { className: "sg-badge", "data-tone": "ok", children: "Confirmed" });
|
|
@@ -1920,40 +2038,73 @@ function statusBadge(status) {
|
|
|
1920
2038
|
}
|
|
1921
2039
|
function whenLabel(at) {
|
|
1922
2040
|
const d = new Date(at);
|
|
1923
|
-
|
|
2041
|
+
if (Number.isNaN(d.getTime())) return "";
|
|
2042
|
+
const sameYear = d.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear();
|
|
2043
|
+
try {
|
|
2044
|
+
return d.toLocaleString(void 0, { day: "numeric", month: "short", year: sameYear ? void 0 : "numeric", hour: "2-digit", minute: "2-digit" });
|
|
2045
|
+
} catch {
|
|
2046
|
+
return d.toLocaleString();
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
function endpoints(entry) {
|
|
2050
|
+
const legs = entry.legs;
|
|
2051
|
+
return {
|
|
2052
|
+
fromChainId: entry.chainId ?? legs?.[0]?.fromChainId ?? void 0,
|
|
2053
|
+
toChainId: legs?.length ? legs[legs.length - 1].toChainId || void 0 : void 0
|
|
2054
|
+
};
|
|
2055
|
+
}
|
|
2056
|
+
function TxPairGlyphs(props) {
|
|
2057
|
+
const e = props.entry;
|
|
2058
|
+
const { fromChainId, toChainId } = endpoints(e);
|
|
2059
|
+
return /* @__PURE__ */ jsxs("span", { className: "sg-txrow-glyphs", children: [
|
|
2060
|
+
/* @__PURE__ */ jsx(TokenGlyph, { symbol: e.fromAsset || "?", logoUrl: logoFor(props.art, e.fromAsset, fromChainId ?? null), chainId: fromChainId, size: "sm" }),
|
|
2061
|
+
/* @__PURE__ */ jsx(TokenGlyph, { symbol: e.toAsset || "?", logoUrl: logoFor(props.art, e.toAsset, toChainId ?? null), chainId: toChainId, size: "sm" })
|
|
2062
|
+
] });
|
|
1924
2063
|
}
|
|
1925
|
-
function
|
|
1926
|
-
|
|
2064
|
+
function TxPair(props) {
|
|
2065
|
+
const e = props.entry;
|
|
2066
|
+
return /* @__PURE__ */ jsxs("span", { className: "sg-txrow-pair", children: [
|
|
2067
|
+
/* @__PURE__ */ jsx("span", { className: "sg-txrow-side sg-mono", children: `${e.payAmount} ${e.fromAsset}` }),
|
|
2068
|
+
/* @__PURE__ */ jsxs("span", { className: "sg-txrow-side sg-mono", children: [
|
|
2069
|
+
/* @__PURE__ */ jsx("span", { className: "sg-txrow-arrow", "aria-hidden": "true", children: /* @__PURE__ */ jsx(LegArrowGlyph, {}) }),
|
|
2070
|
+
`${e.receiveAmount} ${e.toAsset}`
|
|
2071
|
+
] })
|
|
2072
|
+
] });
|
|
2073
|
+
}
|
|
2074
|
+
function logoFor(art, symbol, chainId) {
|
|
1927
2075
|
const key = symbolKey(symbol);
|
|
1928
2076
|
if (!key) return void 0;
|
|
1929
|
-
const
|
|
1930
|
-
|
|
2077
|
+
const tokens = art.tokens;
|
|
2078
|
+
if (tokens?.length) {
|
|
2079
|
+
const sameChain = chainId == null ? void 0 : tokens.find((t) => Number(t.chainId) === chainId && symbolKey(t.symbol) === key);
|
|
2080
|
+
const found = (sameChain ?? tokens.find((t) => symbolKey(t.symbol) === key))?.logoUrl;
|
|
2081
|
+
if (found) return found;
|
|
2082
|
+
}
|
|
2083
|
+
return art.vaultIcons?.get(key);
|
|
1931
2084
|
}
|
|
1932
2085
|
function TxHistoryList(props) {
|
|
1933
2086
|
if (!props.entries.length) {
|
|
1934
2087
|
return /* @__PURE__ */ jsx("div", { className: "sg-sel-empty", children: "No transactions yet \u2014 activity from this wallet will appear here." });
|
|
1935
2088
|
}
|
|
1936
|
-
return /* @__PURE__ */ jsx("section", { className: "sg-toklist", "aria-label": "Transaction history", children: props.entries.map((e) =>
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
"
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
whenLabel(e.at) ? ` \xB7 ${whenLabel(e.at)}` : ""
|
|
2089
|
+
return /* @__PURE__ */ jsx("section", { className: "sg-toklist", "aria-label": "Transaction history", children: props.entries.map((e) => (
|
|
2090
|
+
// A GRID, not the picker's flex row: the meta line spans the badge column too, so at 390px it
|
|
2091
|
+
// has the full card width to wrap into instead of being ellipsised away to "…".
|
|
2092
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: "sg-txrow", onClick: () => props.onPick(e), children: [
|
|
2093
|
+
/* @__PURE__ */ jsx(TxPairGlyphs, { entry: e, art: props }),
|
|
2094
|
+
/* @__PURE__ */ jsx(TxPair, { entry: e }),
|
|
2095
|
+
/* @__PURE__ */ jsxs("span", { className: "sg-txrow-meta", children: [
|
|
2096
|
+
/* @__PURE__ */ jsxs("span", { className: "sg-txrow-when", children: [
|
|
2097
|
+
/* @__PURE__ */ jsxs("span", { className: "sg-txrow-what", children: [
|
|
2098
|
+
/* @__PURE__ */ jsx("span", { children: e.kind === "payment" ? "Payment" : "Swap" }),
|
|
2099
|
+
/* @__PURE__ */ jsx("span", { children: chainLabel(e) }),
|
|
2100
|
+
(e.legs?.length ?? 1) > 1 ? /* @__PURE__ */ jsx("span", { children: ordersLabel(e.legs.length) }) : null
|
|
2101
|
+
] }),
|
|
2102
|
+
whenLabel(e.at) ? /* @__PURE__ */ jsx("span", { className: "sg-txrow-time", children: whenLabel(e.at) }) : null
|
|
2103
|
+
] }),
|
|
2104
|
+
/* @__PURE__ */ jsx("span", { className: "sg-txrow-end", children: statusBadge(e.status) })
|
|
1953
2105
|
] })
|
|
1954
|
-
] })
|
|
1955
|
-
|
|
1956
|
-
] }, `${e.hash}:${e.at}`)) });
|
|
2106
|
+
] }, `${e.hash}:${e.at}`)
|
|
2107
|
+
)) });
|
|
1957
2108
|
}
|
|
1958
2109
|
function TxDetail(props) {
|
|
1959
2110
|
const e = props.entry;
|
|
@@ -1976,6 +2127,7 @@ function TxDetail(props) {
|
|
|
1976
2127
|
}
|
|
1977
2128
|
};
|
|
1978
2129
|
return /* @__PURE__ */ jsxs("div", { className: "sg-panel", children: [
|
|
2130
|
+
/* @__PURE__ */ jsx(TxPairGlyphs, { entry: e, art: props }),
|
|
1979
2131
|
/* @__PURE__ */ jsxs("div", { className: "sg-anchor sg-mono", children: [
|
|
1980
2132
|
e.receiveAmount,
|
|
1981
2133
|
" ",
|
|
@@ -1985,6 +2137,7 @@ function TxDetail(props) {
|
|
|
1985
2137
|
e.kind === "payment" ? "Payment" : "Swap",
|
|
1986
2138
|
whenLabel(e.at) ? ` \xB7 ${whenLabel(e.at)}` : ""
|
|
1987
2139
|
] }),
|
|
2140
|
+
/* @__PURE__ */ jsx(TxLegs, { legs: legsOf(e) }),
|
|
1988
2141
|
/* @__PURE__ */ jsxs("div", { className: "sg-meta", children: [
|
|
1989
2142
|
/* @__PURE__ */ jsxs("div", { className: "sg-meta-row", children: [
|
|
1990
2143
|
/* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "Status" }),
|
|
@@ -1999,7 +2152,7 @@ function TxDetail(props) {
|
|
|
1999
2152
|
] })
|
|
2000
2153
|
] }),
|
|
2001
2154
|
/* @__PURE__ */ jsxs("div", { className: "sg-meta-row", children: [
|
|
2002
|
-
/* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "
|
|
2155
|
+
/* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "Signed on" }),
|
|
2003
2156
|
/* @__PURE__ */ jsx("b", { children: chainLabel(e) })
|
|
2004
2157
|
] }),
|
|
2005
2158
|
e.recipient ? /* @__PURE__ */ jsxs("div", { className: "sg-meta-row", children: [
|
|
@@ -2018,14 +2171,17 @@ function TxDetail(props) {
|
|
|
2018
2171
|
] })
|
|
2019
2172
|
] });
|
|
2020
2173
|
}
|
|
2021
|
-
function displayableHistory(entries) {
|
|
2022
|
-
|
|
2174
|
+
function displayableHistory(entries, account) {
|
|
2175
|
+
const owner = typeof account === "string" ? account.toLowerCase() : "";
|
|
2176
|
+
return entries.filter((e) => e.txKind !== "approve" && (!e.account || !owner || e.account.toLowerCase() === owner));
|
|
2023
2177
|
}
|
|
2024
2178
|
function TxHistoryPanel(props) {
|
|
2025
|
-
const
|
|
2026
|
-
const
|
|
2179
|
+
const account = props.account;
|
|
2180
|
+
const entries = displayableHistory(useTxHistory(account), account);
|
|
2181
|
+
const deepLink = props.initialEntry && displayableHistory([props.initialEntry], account).length ? props.initialEntry : null;
|
|
2182
|
+
const [selected, setSelected] = useState(deepLink);
|
|
2027
2183
|
const backRef = useRef(null);
|
|
2028
|
-
useEffect(() => setSelected(
|
|
2184
|
+
useEffect(() => setSelected(deepLink), [deepLink]);
|
|
2029
2185
|
const pick = (entry) => {
|
|
2030
2186
|
setSelected(entry);
|
|
2031
2187
|
requestAnimationFrame(() => backRef.current?.focus());
|
|
@@ -2033,9 +2189,12 @@ function TxHistoryPanel(props) {
|
|
|
2033
2189
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2034
2190
|
/* @__PURE__ */ jsxs("div", { className: "sg-sel-head", children: [
|
|
2035
2191
|
/* @__PURE__ */ jsx("button", { type: "button", autoFocus: true, ref: backRef, className: "sg-back", onClick: selected ? () => setSelected(null) : props.onBack, "aria-label": "Back", children: /* @__PURE__ */ jsx(BackGlyph2, {}) }),
|
|
2036
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsxs("div", { className: "sg-sel-title", children: [
|
|
2193
|
+
selected ? "Transaction" : "Transaction history",
|
|
2194
|
+
account ? /* @__PURE__ */ jsx("span", { className: "sg-sel-sub sg-mono", children: shortAddress(account) }) : null
|
|
2195
|
+
] })
|
|
2037
2196
|
] }),
|
|
2038
|
-
selected ? /* @__PURE__ */ jsx(TxDetail, { entry: selected }) : /* @__PURE__ */ jsx(TxHistoryList, { entries, tokens: props.tokens, onPick: pick })
|
|
2197
|
+
selected ? /* @__PURE__ */ jsx(TxDetail, { entry: selected, tokens: props.tokens, vaultIcons: props.vaultIcons }) : /* @__PURE__ */ jsx(TxHistoryList, { entries, tokens: props.tokens, vaultIcons: props.vaultIcons, onPick: pick })
|
|
2039
2198
|
] });
|
|
2040
2199
|
}
|
|
2041
2200
|
var IDENTITY_KEY_PREFIX = "sg:link:v1:";
|
|
@@ -2098,7 +2257,7 @@ function forgetIdentity(account) {
|
|
|
2098
2257
|
}
|
|
2099
2258
|
}
|
|
2100
2259
|
var addrEq = (a, b) => String(a || "").toLowerCase() === String(b || "").toLowerCase();
|
|
2101
|
-
var
|
|
2260
|
+
var chainName2 = (id) => id != null ? CHAIN_LABELS[id] || `Chain ${id}` : "";
|
|
2102
2261
|
var STABLES = EXECUTABLE_STABLE_ASSETS;
|
|
2103
2262
|
function BankGlyph() {
|
|
2104
2263
|
return /* @__PURE__ */ jsx(
|
|
@@ -2614,6 +2773,7 @@ function PaymentIsland(props) {
|
|
|
2614
2773
|
const [expanded, setExpanded] = useState(() => Boolean(props.defaultExpanded) || rampMode);
|
|
2615
2774
|
const [view, setView] = useState("main");
|
|
2616
2775
|
const [hist, setHist] = useState(null);
|
|
2776
|
+
const histBtnRef = useRef(null);
|
|
2617
2777
|
const pillRef = useRef(null);
|
|
2618
2778
|
const methodRowRef = useRef(null);
|
|
2619
2779
|
const exFromTileRef = useRef(null);
|
|
@@ -2621,6 +2781,7 @@ function PaymentIsland(props) {
|
|
|
2621
2781
|
const regionRef = useRef(null);
|
|
2622
2782
|
const panelId = useId();
|
|
2623
2783
|
useEffect(() => setView("main"), [wallet.account, payParamsKey]);
|
|
2784
|
+
useEffect(() => setHist(null), [wallet.account]);
|
|
2624
2785
|
const firstRender = useRef(true);
|
|
2625
2786
|
useEffect(() => {
|
|
2626
2787
|
if (firstRender.current) {
|
|
@@ -2644,7 +2805,7 @@ function PaymentIsland(props) {
|
|
|
2644
2805
|
};
|
|
2645
2806
|
const closeHistory = () => {
|
|
2646
2807
|
setHist(null);
|
|
2647
|
-
requestAnimationFrame(() => (methodRowRef.current ?? regionRef.current)?.focus());
|
|
2808
|
+
requestAnimationFrame(() => (histBtnRef.current ?? methodRowRef.current ?? regionRef.current)?.focus());
|
|
2648
2809
|
};
|
|
2649
2810
|
const pickFunding = (pick) => {
|
|
2650
2811
|
const r = visibleRoutes.find((x) => x.source.chainId === pick.chainId && symbolKey(x.source.asset) === symbolKey(pick.symbol));
|
|
@@ -2706,7 +2867,11 @@ function PaymentIsland(props) {
|
|
|
2706
2867
|
/* @__PURE__ */ jsx("span", { className: "sg-link-word", children: "ZeroDelta" }),
|
|
2707
2868
|
/* @__PURE__ */ jsx("span", { className: "sg-badge", "data-tone": "accent", children: "Link" })
|
|
2708
2869
|
] });
|
|
2709
|
-
const
|
|
2870
|
+
const linkMenu = menuItems.length ? /* @__PURE__ */ jsx(LinkMenu, { items: menuItems }) : null;
|
|
2871
|
+
const walletSlot = wallet.account || linkMenu ? /* @__PURE__ */ jsxs("div", { className: "sg-head-tools", children: [
|
|
2872
|
+
wallet.account ? /* @__PURE__ */ jsx(HistoryButton, { btnRef: histBtnRef, disabled: submitting, onClick: () => setHist({}) }) : null,
|
|
2873
|
+
linkMenu
|
|
2874
|
+
] }) : void 0;
|
|
2710
2875
|
const activeStep = flow.steps.find((s) => s.state === "active");
|
|
2711
2876
|
const liveMsg = flow.status === "loading" ? isPay ? "Finding the best way to pay." : "Finding the best route." : flow.status === "submitting" ? `${activeStep?.label ?? (isPay ? "Processing your payment" : `Processing your ${verb.present.toLowerCase()}`)} \u2014 in progress.` : flow.status === "success" || flow.status === "pending" ? flow.verdict?.status === "confirmed" ? isPay ? "Payment confirmed on-chain \u2014 the merchant has been settled." : `${verb.past} \u2014 confirmed on-chain.` : isPay ? "Payment sent \u2014 confirmation is still pending." : "Submitted \u2014 confirmation is still pending." : "";
|
|
2712
2877
|
const loading = flow.status === "loading";
|
|
@@ -2740,7 +2905,7 @@ function PaymentIsland(props) {
|
|
|
2740
2905
|
] });
|
|
2741
2906
|
let body;
|
|
2742
2907
|
if (hist && wallet.account) {
|
|
2743
|
-
body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory });
|
|
2908
|
+
body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory });
|
|
2744
2909
|
} else if (isPay && view === "select" && wallet.account) {
|
|
2745
2910
|
body = /* @__PURE__ */ jsx(
|
|
2746
2911
|
TokenSelect,
|
|
@@ -2919,7 +3084,7 @@ function PaymentIsland(props) {
|
|
|
2919
3084
|
] }),
|
|
2920
3085
|
/* @__PURE__ */ jsxs("div", { className: "sg-anchor-sub", children: [
|
|
2921
3086
|
"on ",
|
|
2922
|
-
|
|
3087
|
+
chainName2(sel.source.chainId),
|
|
2923
3088
|
selBal ? ` \xB7 balance ${selBal.formatted}` : ""
|
|
2924
3089
|
] })
|
|
2925
3090
|
] }) : null,
|
|
@@ -2932,7 +3097,7 @@ function PaymentIsland(props) {
|
|
|
2932
3097
|
] }),
|
|
2933
3098
|
/* @__PURE__ */ jsxs("div", { className: "sg-anchor-sub", children: [
|
|
2934
3099
|
"on ",
|
|
2935
|
-
|
|
3100
|
+
chainName2(sel.source.chainId)
|
|
2936
3101
|
] })
|
|
2937
3102
|
] }) : null,
|
|
2938
3103
|
sel && !loading && !quoteError ? /* @__PURE__ */ jsx(CompliancePanel, { compliance: sel.quote.compliance, direct: sel.state === "DIRECT" }) : null,
|
|
@@ -3204,7 +3369,7 @@ function StableGeniePay(props) {
|
|
|
3204
3369
|
] })
|
|
3205
3370
|
] }) : void 0;
|
|
3206
3371
|
if (props.variant === "pill") return /* @__PURE__ */ jsx(PaymentIsland, { kind: "pay", ...props });
|
|
3207
|
-
return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, children: hist && wallet.account ? /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsx(
|
|
3372
|
+
return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, children: hist && wallet.account ? /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsx(
|
|
3208
3373
|
TokenSelect,
|
|
3209
3374
|
{
|
|
3210
3375
|
title: "Pay with",
|
|
@@ -3377,7 +3542,7 @@ function StableGenieSwap(props) {
|
|
|
3377
3542
|
/* @__PURE__ */ jsx("div", { className: "sg-brand", children: "ZeroDelta" })
|
|
3378
3543
|
] }) : void 0;
|
|
3379
3544
|
if (hist && wallet.account) {
|
|
3380
|
-
return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Swap", theme: config.theme, walletSlot, children: /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory }) });
|
|
3545
|
+
return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Swap", theme: config.theme, walletSlot, children: /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory }) });
|
|
3381
3546
|
}
|
|
3382
3547
|
if (flow.status === "success" || flow.status === "pending") {
|
|
3383
3548
|
return /* @__PURE__ */ jsxs(WidgetShell, { title: config.title || "Swap", theme: config.theme, walletSlot, children: [
|
|
@@ -3627,7 +3792,7 @@ function StableGenieExchange(props) {
|
|
|
3627
3792
|
if (props.variant === "pill") return /* @__PURE__ */ jsx(PaymentIsland, { kind: "exchange", ...props });
|
|
3628
3793
|
let body;
|
|
3629
3794
|
if (hist && connected) {
|
|
3630
|
-
body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens, initialEntry: hist.entry ?? null, onBack: closeHistory });
|
|
3795
|
+
body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory });
|
|
3631
3796
|
} else if (view === "from" || view === "to") {
|
|
3632
3797
|
const isFrom = view === "from";
|
|
3633
3798
|
body = /* @__PURE__ */ jsx(
|