@cookill/wallet-adapter 3.1.4 → 3.1.7
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 +127 -118
- package/dist/react.cjs +94 -109
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +94 -109
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Wallet adapter for **Sheep Wallet** — the browser extension wallet for the Rialo blockchain.
|
|
4
4
|
|
|
5
|
-
Provides a drop-in React provider, responsive connect modal, and vanilla JS class so dApp developers can integrate Sheep Wallet without writing custom UI.
|
|
6
|
-
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
```bash
|
|
@@ -25,7 +23,38 @@ function App() {
|
|
|
25
23
|
}
|
|
26
24
|
```
|
|
27
25
|
|
|
28
|
-
`WalletProvider` renders a built-in connect modal automatically. On desktop
|
|
26
|
+
`WalletProvider` renders a built-in connect modal automatically. On desktop it opens as a centered dialog; on mobile it slides up as a bottom sheet with swipe-to-dismiss.
|
|
27
|
+
|
|
28
|
+
## Built-in Modal
|
|
29
|
+
|
|
30
|
+
The built-in modal is rendered inside `WalletProvider` and includes:
|
|
31
|
+
|
|
32
|
+
- **Extension tab** — detects Sheep Wallet, shows install link if not found, triggers `window.rialo.connect()` on click
|
|
33
|
+
- **Scan to Connect tab** — generates a `rialo-wc://` QR code for cross-device pairing
|
|
34
|
+
- **Responsive layout** — centered dialog on desktop, slide-up sheet on mobile
|
|
35
|
+
- **Auto-close** — closes automatically after successful connection
|
|
36
|
+
|
|
37
|
+
Control it programmatically:
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
const { openModal, closeModal } = useWallet();
|
|
41
|
+
|
|
42
|
+
// Open the built-in modal
|
|
43
|
+
openModal();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or use `ConnectButton` which handles everything:
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
<ConnectButton
|
|
50
|
+
connectLabel="Connect Wallet"
|
|
51
|
+
disconnectLabel="Disconnect"
|
|
52
|
+
showAddress={true}
|
|
53
|
+
showBalance={false}
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> When the extension is installed, `ConnectButton` calls `connect()` directly without opening the modal. When not installed, it opens the modal with a download link.
|
|
29
58
|
|
|
30
59
|
## React Hooks
|
|
31
60
|
|
|
@@ -34,31 +63,29 @@ function App() {
|
|
|
34
63
|
```tsx
|
|
35
64
|
import { useWallet } from '@cookill/wallet-adapter/react';
|
|
36
65
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} = useWallet();
|
|
61
|
-
}
|
|
66
|
+
const {
|
|
67
|
+
connected, // boolean
|
|
68
|
+
connecting, // boolean
|
|
69
|
+
activeAccount, // WalletAccount | null
|
|
70
|
+
chainId, // string — e.g. "rialo:devnet"
|
|
71
|
+
isInstalled, // boolean — extension detected
|
|
72
|
+
|
|
73
|
+
// Actions
|
|
74
|
+
connect, // () => Promise<WalletAccount[]>
|
|
75
|
+
disconnect, // () => Promise<void>
|
|
76
|
+
switchNetwork, // (network) => Promise<void>
|
|
77
|
+
refreshBalance, // () => Promise<void>
|
|
78
|
+
|
|
79
|
+
// Signing & Transactions
|
|
80
|
+
signMessage, // (msg: string) => Promise<SignedMessage>
|
|
81
|
+
signTransaction, // (tx) => Promise<string>
|
|
82
|
+
sendTransaction, // (tx) => Promise<TransactionResult>
|
|
83
|
+
signAndSendTransaction, // (tx) => Promise<TransactionResult>
|
|
84
|
+
|
|
85
|
+
// Modal control
|
|
86
|
+
openModal, // () => void
|
|
87
|
+
closeModal, // () => void
|
|
88
|
+
} = useWallet();
|
|
62
89
|
```
|
|
63
90
|
|
|
64
91
|
### Focused Hooks
|
|
@@ -72,30 +99,76 @@ const accounts = useAccounts();
|
|
|
72
99
|
const { balance, refresh } = useBalance();
|
|
73
100
|
const { network, chainId } = useNetwork();
|
|
74
101
|
const { switchNetwork } = useSwitchNetwork();
|
|
75
|
-
const { sendTransaction, signAndSendTransaction } = useSendTransaction();
|
|
102
|
+
const { sendTransaction, signAndSendTransaction, sendGaslessTransaction } = useSendTransaction();
|
|
76
103
|
const { signMessage } = useSignMessage();
|
|
77
104
|
```
|
|
78
105
|
|
|
79
|
-
|
|
106
|
+
### REX (Confidential Transactions)
|
|
80
107
|
|
|
81
|
-
|
|
108
|
+
```tsx
|
|
109
|
+
const { capabilities, supported, submitREXTransaction } = useREX();
|
|
110
|
+
```
|
|
82
111
|
|
|
83
|
-
|
|
84
|
-
2. **Scan to Connect** — Generates a QR code that a mobile Sheep Wallet can scan to pair cross-device. Also supports the reverse flow (wallet shows QR, dApp scans).
|
|
112
|
+
### SfS (Stake-for-Service / Gasless)
|
|
85
113
|
|
|
86
|
-
|
|
114
|
+
```tsx
|
|
115
|
+
const { positions, credits, hasCredits, createPosition, sendGasless, refresh } = useSfS();
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Scan-to-Connect
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
const { scanURI, status, generateQR, approveSession, rejectSession } = useScanConnect();
|
|
122
|
+
```
|
|
87
123
|
|
|
88
|
-
|
|
124
|
+
## Custom Modal (Optional)
|
|
89
125
|
|
|
90
|
-
|
|
126
|
+
If you need full control over the UI, build your own modal using the hooks:
|
|
91
127
|
|
|
92
128
|
```tsx
|
|
93
|
-
|
|
129
|
+
import { useConnectWallet, useScanConnect, isInstalled } from '@cookill/wallet-adapter/react';
|
|
130
|
+
|
|
131
|
+
function MyConnectModal({ open, onClose }) {
|
|
132
|
+
const { connect, connecting, error } = useConnectWallet();
|
|
133
|
+
const { scanURI, status, generateQR } = useScanConnect();
|
|
134
|
+
|
|
135
|
+
const handleConnect = async () => {
|
|
136
|
+
try {
|
|
137
|
+
const accounts = await connect();
|
|
138
|
+
console.log('Connected:', accounts[0].address);
|
|
139
|
+
onClose();
|
|
140
|
+
} catch (err) {
|
|
141
|
+
console.error('Connection failed:', err);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
if (!open) return null;
|
|
94
146
|
|
|
95
|
-
|
|
96
|
-
<
|
|
147
|
+
return (
|
|
148
|
+
<div className="modal-overlay" onClick={onClose}>
|
|
149
|
+
<div className="modal-content" onClick={e => e.stopPropagation()}>
|
|
150
|
+
<h2>Connect Wallet</h2>
|
|
151
|
+
|
|
152
|
+
{isInstalled() ? (
|
|
153
|
+
<button onClick={handleConnect} disabled={connecting}>
|
|
154
|
+
{connecting ? 'Approve in extension...' : 'Connect Sheep Wallet'}
|
|
155
|
+
</button>
|
|
156
|
+
) : (
|
|
157
|
+
<a href="https://rialo.io/wallet" target="_blank">Install Sheep Wallet</a>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
{error && <p className="error">{error.message}</p>}
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
97
165
|
```
|
|
98
166
|
|
|
167
|
+
Key points:
|
|
168
|
+
- `connect()` calls `window.rialo.connect()` which triggers the extension's approval popup
|
|
169
|
+
- The `connect()` call has a 20-second timeout to prevent dApp freezes
|
|
170
|
+
- Use `isInstalled()` to check if the extension is present before connecting
|
|
171
|
+
|
|
99
172
|
## Vanilla JavaScript
|
|
100
173
|
|
|
101
174
|
```typescript
|
|
@@ -108,8 +181,6 @@ if (!wallet.isInstalled) {
|
|
|
108
181
|
}
|
|
109
182
|
|
|
110
183
|
const accounts = await wallet.connect();
|
|
111
|
-
console.log('Address:', accounts[0].address);
|
|
112
|
-
|
|
113
184
|
const balance = await wallet.getBalance();
|
|
114
185
|
console.log('Balance:', formatBalance(balance));
|
|
115
186
|
|
|
@@ -121,31 +192,17 @@ await wallet.signAndSendTransaction({
|
|
|
121
192
|
await wallet.disconnect();
|
|
122
193
|
```
|
|
123
194
|
|
|
124
|
-
## ConnectButton
|
|
125
|
-
|
|
126
|
-
```tsx
|
|
127
|
-
<ConnectButton
|
|
128
|
-
connectLabel="Connect Wallet" // label when disconnected
|
|
129
|
-
disconnectLabel="Disconnect" // dropdown label when connected
|
|
130
|
-
showAddress={true} // show truncated address when connected
|
|
131
|
-
showBalance={false} // show RLO balance next to address
|
|
132
|
-
/>
|
|
133
|
-
```
|
|
134
|
-
|
|
135
195
|
## WalletProvider Props
|
|
136
196
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
{children}
|
|
147
|
-
</WalletProvider>
|
|
148
|
-
```
|
|
197
|
+
| Prop | Type | Default | Description |
|
|
198
|
+
|------|------|---------|-------------|
|
|
199
|
+
| `network` | `RialoNetwork` | `'devnet'` | Default network |
|
|
200
|
+
| `autoConnect` | `boolean` | `true` | Silently restore previous session on load |
|
|
201
|
+
| `scanConnectRelay` | `string` | `'wss://relay.rialo.io'` | Relay URL for scan-to-connect |
|
|
202
|
+
| `onConnect` | `(accounts) => void` | — | Called after successful connection |
|
|
203
|
+
| `onDisconnect` | `() => void` | — | Called after disconnect |
|
|
204
|
+
| `onError` | `(error) => void` | — | Called on connection errors |
|
|
205
|
+
| `onNetworkChange` | `(network) => void` | — | Called when network changes |
|
|
149
206
|
|
|
150
207
|
## Networks
|
|
151
208
|
|
|
@@ -156,56 +213,6 @@ await wallet.disconnect();
|
|
|
156
213
|
| Devnet | rialo:devnet | https://devnet.rialo.io:4101 | dRLO |
|
|
157
214
|
| Localnet | rialo:localnet | http://localhost:4101 | lRLO |
|
|
158
215
|
|
|
159
|
-
## Provider Interface (window.rialo)
|
|
160
|
-
|
|
161
|
-
When the Sheep Wallet extension is installed, it injects `window.rialo` with this interface:
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
interface RialoProvider {
|
|
165
|
-
isRialo: boolean;
|
|
166
|
-
isSheepWallet: boolean;
|
|
167
|
-
version: string;
|
|
168
|
-
|
|
169
|
-
// Connection
|
|
170
|
-
connect(): Promise<WalletAccount[]>;
|
|
171
|
-
disconnect(): Promise<void>;
|
|
172
|
-
isConnected(): Promise<boolean>;
|
|
173
|
-
getAccounts(): Promise<WalletAccount[]>;
|
|
174
|
-
|
|
175
|
-
// Transactions
|
|
176
|
-
signTransaction(tx: TransactionRequest): Promise<{ signature: string }>;
|
|
177
|
-
sendTransaction(tx: TransactionRequest): Promise<TransactionResult>;
|
|
178
|
-
signAndSendTransaction(tx: TransactionRequest): Promise<TransactionResult>;
|
|
179
|
-
|
|
180
|
-
// Message Signing
|
|
181
|
-
signMessage(message: string | Uint8Array): Promise<SignedMessage>;
|
|
182
|
-
|
|
183
|
-
// Network
|
|
184
|
-
getNetwork(): Promise<RialoNetwork>;
|
|
185
|
-
switchNetwork(network: RialoNetwork): Promise<void>;
|
|
186
|
-
getBalance(address?: string): Promise<BalanceResult>;
|
|
187
|
-
|
|
188
|
-
// Events
|
|
189
|
-
on(event: WalletEvent, callback: Function): () => void;
|
|
190
|
-
|
|
191
|
-
// State (synchronous getters)
|
|
192
|
-
readonly connected: boolean;
|
|
193
|
-
readonly accounts: WalletAccount[];
|
|
194
|
-
readonly address: string | null;
|
|
195
|
-
readonly network: RialoNetwork;
|
|
196
|
-
readonly chainId: string;
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Supported Events
|
|
201
|
-
|
|
202
|
-
| Event | Payload |
|
|
203
|
-
|-------------------|-----------------------------------|
|
|
204
|
-
| `connect` | `{ accounts: WalletAccount[] }` |
|
|
205
|
-
| `disconnect` | — |
|
|
206
|
-
| `accountsChanged` | `WalletAccount[]` |
|
|
207
|
-
| `networkChanged` | `{ network, chainId }` |
|
|
208
|
-
|
|
209
216
|
## Key Types
|
|
210
217
|
|
|
211
218
|
```typescript
|
|
@@ -219,6 +226,7 @@ interface TransactionRequest {
|
|
|
219
226
|
value: string; // amount in kelvins (1 RLO = 1_000_000_000 kelvins)
|
|
220
227
|
data?: string;
|
|
221
228
|
memo?: string;
|
|
229
|
+
gasless?: boolean; // set by sendGaslessTransaction
|
|
222
230
|
}
|
|
223
231
|
|
|
224
232
|
interface TransactionResult {
|
|
@@ -244,16 +252,17 @@ import {
|
|
|
244
252
|
formatBalance, // (kelvins, decimals?) => "1.0000"
|
|
245
253
|
parseBalance, // (rlo) => bigint (kelvins)
|
|
246
254
|
isValidAddress, // (address) => boolean
|
|
247
|
-
isInstalled, // () => boolean
|
|
255
|
+
isInstalled, // () => boolean — checks window.rialo
|
|
248
256
|
NETWORKS, // Record<RialoNetwork, NetworkConfig>
|
|
249
257
|
} from '@cookill/wallet-adapter';
|
|
250
258
|
```
|
|
251
259
|
|
|
252
260
|
## Architecture Notes
|
|
253
261
|
|
|
254
|
-
- All provider calls
|
|
255
|
-
- `autoConnect` uses
|
|
256
|
-
- The
|
|
262
|
+
- All provider calls have a 20-second timeout to prevent dApp freezes
|
|
263
|
+
- `autoConnect` uses `checkSession()` — never triggers a user-facing popup
|
|
264
|
+
- The built-in modal uses a sibling DOM architecture (backdrop and content are separate elements) to prevent click events from interfering with tab switching or button interactions
|
|
265
|
+
- `ConnectButton` bypasses the modal when the extension is installed
|
|
257
266
|
|
|
258
267
|
## License
|
|
259
268
|
|
package/dist/react.cjs
CHANGED
|
@@ -1528,124 +1528,111 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1528
1528
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|
|
1529
1529
|
] });
|
|
1530
1530
|
if (isMobile) {
|
|
1531
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1531
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "fixed", inset: 0, zIndex: 9999 }, children: [
|
|
1532
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
+
"div",
|
|
1534
|
+
{
|
|
1535
|
+
style: {
|
|
1536
|
+
position: "absolute",
|
|
1537
|
+
inset: 0,
|
|
1538
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
1539
|
+
backdropFilter: "blur(8px)",
|
|
1540
|
+
WebkitBackdropFilter: "blur(8px)"
|
|
1541
|
+
},
|
|
1542
|
+
onClick: closeModal
|
|
1543
|
+
}
|
|
1544
|
+
),
|
|
1545
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1546
|
+
"div",
|
|
1547
|
+
{
|
|
1548
|
+
onTouchStart: handleTouchStart,
|
|
1549
|
+
onTouchMove: handleTouchMove,
|
|
1550
|
+
onTouchEnd: handleTouchEnd,
|
|
1551
|
+
style: {
|
|
1552
|
+
position: "fixed",
|
|
1553
|
+
bottom: 0,
|
|
1554
|
+
left: 0,
|
|
1555
|
+
right: 0,
|
|
1556
|
+
backgroundColor: "#011B29",
|
|
1557
|
+
borderTopLeftRadius: "24px",
|
|
1558
|
+
borderTopRightRadius: "24px",
|
|
1559
|
+
padding: "0 20px 28px",
|
|
1560
|
+
maxHeight: "85vh",
|
|
1561
|
+
overflow: "auto",
|
|
1562
|
+
boxShadow: "0 -8px 40px rgba(0,0,0,0.5)",
|
|
1563
|
+
transform: `translateY(${dragY}px)`,
|
|
1564
|
+
transition: isDragging ? "none" : "transform 0.3s cubic-bezier(0.4,0,0.2,1)",
|
|
1565
|
+
animation: isDragging ? "none" : "walletModalSlideUp 0.35s cubic-bezier(0.4,0,0.2,1)"
|
|
1566
|
+
},
|
|
1567
|
+
children: [
|
|
1568
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "center", padding: "12px 0 16px", cursor: "grab", touchAction: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "36px", height: "4px", borderRadius: "2px", backgroundColor: "rgba(255,255,255,0.12)" } }) }),
|
|
1569
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1570
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: { color: "#fff", fontSize: "18px", fontWeight: 600, margin: 0, letterSpacing: "-0.01em" }, children: "Connect Wallet" }),
|
|
1571
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: closeModal, style: closeBtn, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) })
|
|
1572
|
+
] }),
|
|
1573
|
+
renderContent()
|
|
1574
|
+
]
|
|
1575
|
+
}
|
|
1576
|
+
),
|
|
1577
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
1578
|
+
@keyframes walletModalSlideUp {
|
|
1579
|
+
from { transform: translateY(100%); }
|
|
1580
|
+
to { transform: translateY(0); }
|
|
1581
|
+
}
|
|
1582
|
+
@keyframes walletModalPulse {
|
|
1583
|
+
0%, 100% { opacity: 1; }
|
|
1584
|
+
50% { opacity: 0.3; }
|
|
1585
|
+
}
|
|
1586
|
+
` })
|
|
1587
|
+
] });
|
|
1588
|
+
}
|
|
1589
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "fixed", inset: 0, zIndex: 9999 }, children: [
|
|
1590
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1532
1591
|
"div",
|
|
1533
1592
|
{
|
|
1534
1593
|
style: {
|
|
1535
|
-
position: "
|
|
1594
|
+
position: "absolute",
|
|
1536
1595
|
inset: 0,
|
|
1537
|
-
zIndex: 9999,
|
|
1538
1596
|
backgroundColor: "rgba(0,0,0,0.6)",
|
|
1539
1597
|
backdropFilter: "blur(8px)",
|
|
1540
1598
|
WebkitBackdropFilter: "blur(8px)"
|
|
1541
1599
|
},
|
|
1542
|
-
onClick:
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1600
|
+
onClick: closeModal
|
|
1601
|
+
}
|
|
1602
|
+
),
|
|
1603
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
1604
|
+
position: "fixed",
|
|
1605
|
+
inset: 0,
|
|
1606
|
+
display: "flex",
|
|
1607
|
+
alignItems: "center",
|
|
1608
|
+
justifyContent: "center",
|
|
1609
|
+
pointerEvents: "none"
|
|
1610
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1611
|
+
"div",
|
|
1612
|
+
{
|
|
1613
|
+
style: {
|
|
1614
|
+
pointerEvents: "auto",
|
|
1615
|
+
backgroundColor: "#011B29",
|
|
1616
|
+
borderRadius: "20px",
|
|
1617
|
+
padding: "24px",
|
|
1618
|
+
width: "100%",
|
|
1619
|
+
maxWidth: "400px",
|
|
1620
|
+
margin: "16px",
|
|
1621
|
+
boxShadow: "0 25px 60px -12px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05)",
|
|
1622
|
+
maxHeight: "90vh",
|
|
1623
|
+
overflow: "auto",
|
|
1624
|
+
animation: "walletModalFadeIn 0.25s cubic-bezier(0.4,0,0.2,1)"
|
|
1547
1625
|
},
|
|
1548
1626
|
children: [
|
|
1549
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1550
|
-
"
|
|
1551
|
-
{
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
onTouchEnd: handleTouchEnd,
|
|
1555
|
-
onClick: stop,
|
|
1556
|
-
style: {
|
|
1557
|
-
position: "fixed",
|
|
1558
|
-
bottom: 0,
|
|
1559
|
-
left: 0,
|
|
1560
|
-
right: 0,
|
|
1561
|
-
backgroundColor: "#011B29",
|
|
1562
|
-
borderTopLeftRadius: "24px",
|
|
1563
|
-
borderTopRightRadius: "24px",
|
|
1564
|
-
padding: "0 20px 28px",
|
|
1565
|
-
maxHeight: "85vh",
|
|
1566
|
-
overflow: "auto",
|
|
1567
|
-
boxShadow: "0 -8px 40px rgba(0,0,0,0.5)",
|
|
1568
|
-
transform: `translateY(${dragY}px)`,
|
|
1569
|
-
transition: isDragging ? "none" : "transform 0.3s cubic-bezier(0.4,0,0.2,1)",
|
|
1570
|
-
animation: isDragging ? "none" : "walletModalSlideUp 0.35s cubic-bezier(0.4,0,0.2,1)"
|
|
1571
|
-
},
|
|
1572
|
-
children: [
|
|
1573
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "center", padding: "12px 0 16px", cursor: "grab", touchAction: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "36px", height: "4px", borderRadius: "2px", backgroundColor: "rgba(255,255,255,0.12)" } }) }),
|
|
1574
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1575
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: { color: "#fff", fontSize: "18px", fontWeight: 600, margin: 0, letterSpacing: "-0.01em" }, children: "Connect Wallet" }),
|
|
1576
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: (e) => {
|
|
1577
|
-
stop(e);
|
|
1578
|
-
closeModal();
|
|
1579
|
-
}, style: closeBtn, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) })
|
|
1580
|
-
] }),
|
|
1581
|
-
renderContent()
|
|
1582
|
-
]
|
|
1583
|
-
}
|
|
1584
|
-
),
|
|
1585
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
1586
|
-
@keyframes walletModalSlideUp {
|
|
1587
|
-
from { transform: translateY(100%); }
|
|
1588
|
-
to { transform: translateY(0); }
|
|
1589
|
-
}
|
|
1590
|
-
@keyframes walletModalPulse {
|
|
1591
|
-
0%, 100% { opacity: 1; }
|
|
1592
|
-
50% { opacity: 0.3; }
|
|
1593
|
-
}
|
|
1594
|
-
` })
|
|
1627
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1628
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: { color: "#fff", fontSize: "18px", fontWeight: 600, margin: 0, letterSpacing: "-0.01em" }, children: "Connect Wallet" }),
|
|
1629
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: closeModal, style: closeBtn, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) })
|
|
1630
|
+
] }),
|
|
1631
|
+
renderContent()
|
|
1595
1632
|
]
|
|
1596
1633
|
}
|
|
1597
|
-
)
|
|
1598
|
-
|
|
1599
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1600
|
-
"div",
|
|
1601
|
-
{
|
|
1602
|
-
style: {
|
|
1603
|
-
position: "fixed",
|
|
1604
|
-
inset: 0,
|
|
1605
|
-
zIndex: 9999,
|
|
1606
|
-
display: "flex",
|
|
1607
|
-
alignItems: "center",
|
|
1608
|
-
justifyContent: "center",
|
|
1609
|
-
backgroundColor: "rgba(0,0,0,0.6)",
|
|
1610
|
-
backdropFilter: "blur(8px)",
|
|
1611
|
-
WebkitBackdropFilter: "blur(8px)"
|
|
1612
|
-
},
|
|
1613
|
-
onClick: (e) => {
|
|
1614
|
-
if (e.target === e.currentTarget) closeModal();
|
|
1615
|
-
},
|
|
1616
|
-
onPointerDown: (e) => {
|
|
1617
|
-
if (e.target !== e.currentTarget) e.stopPropagation();
|
|
1618
|
-
},
|
|
1619
|
-
children: [
|
|
1620
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1621
|
-
"div",
|
|
1622
|
-
{
|
|
1623
|
-
onClick: stop,
|
|
1624
|
-
style: {
|
|
1625
|
-
backgroundColor: "#011B29",
|
|
1626
|
-
borderRadius: "20px",
|
|
1627
|
-
padding: "24px",
|
|
1628
|
-
width: "100%",
|
|
1629
|
-
maxWidth: "400px",
|
|
1630
|
-
margin: "16px",
|
|
1631
|
-
boxShadow: "0 25px 60px -12px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05)",
|
|
1632
|
-
maxHeight: "90vh",
|
|
1633
|
-
overflow: "auto",
|
|
1634
|
-
animation: "walletModalFadeIn 0.25s cubic-bezier(0.4,0,0.2,1)"
|
|
1635
|
-
},
|
|
1636
|
-
children: [
|
|
1637
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1638
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: { color: "#fff", fontSize: "18px", fontWeight: 600, margin: 0, letterSpacing: "-0.01em" }, children: "Connect Wallet" }),
|
|
1639
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: (e) => {
|
|
1640
|
-
stop(e);
|
|
1641
|
-
closeModal();
|
|
1642
|
-
}, style: closeBtn, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) })
|
|
1643
|
-
] }),
|
|
1644
|
-
renderContent()
|
|
1645
|
-
]
|
|
1646
|
-
}
|
|
1647
|
-
),
|
|
1648
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
1634
|
+
) }),
|
|
1635
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
1649
1636
|
@keyframes walletModalFadeIn {
|
|
1650
1637
|
from { opacity: 0; transform: scale(0.97) translateY(8px); }
|
|
1651
1638
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
@@ -1655,9 +1642,7 @@ function WalletModal({ scanConnectRelay, dispatch }) {
|
|
|
1655
1642
|
50% { opacity: 0.3; }
|
|
1656
1643
|
}
|
|
1657
1644
|
` })
|
|
1658
|
-
|
|
1659
|
-
}
|
|
1660
|
-
);
|
|
1645
|
+
] });
|
|
1661
1646
|
}
|
|
1662
1647
|
function ConnectButton({
|
|
1663
1648
|
connectLabel = "Connect Wallet",
|