@rhinestone/deposit-modal 0.0.0-dev-20260730162231 → 0.0.0-dev-20260730163642
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 +42 -26
- package/dist/{DepositModalReown-B6SUS32X.mjs → DepositModalReown-TFNAB6C6.mjs} +5 -5
- package/dist/{DepositModalReown-JXORGWM6.cjs → DepositModalReown-TPCIDLWE.cjs} +9 -9
- package/dist/{chunk-CW2XPYHI.cjs → chunk-2Q3FD6ER.cjs} +65 -65
- package/dist/{chunk-DCWJQUYU.cjs → chunk-3SZRLOKL.cjs} +3 -3
- package/dist/{chunk-SN7FVQT7.mjs → chunk-4FRPUAL6.mjs} +1 -1
- package/dist/{chunk-7H3URH7Y.cjs → chunk-5ONI6P6L.cjs} +258 -258
- package/dist/{chunk-BIQ67JYS.mjs → chunk-GBCWBRJC.mjs} +4 -4
- package/dist/{chunk-FPQUF4VU.mjs → chunk-GOWOKIEK.mjs} +2 -2
- package/dist/{chunk-FBSOVQXC.mjs → chunk-LZR5ZU2E.mjs} +1 -1
- package/dist/{chunk-O75XVNZU.cjs → chunk-N6OPGCBY.cjs} +57 -57
- package/dist/{chunk-TLSVC7AS.mjs → chunk-SB2AMKRD.mjs} +3 -3
- package/dist/{chunk-6A6TQYC5.mjs → chunk-UHRLZESO.mjs} +1 -1
- package/dist/{chunk-CWHMVCIT.cjs → chunk-UYINQEEF.cjs} +1 -1
- package/dist/{chunk-LVB23D72.cjs → chunk-Y6Z2X3TN.cjs} +52 -52
- package/dist/{chunk-JCX6D7EL.mjs → chunk-ZGJ6OYGU.mjs} +1 -1
- package/dist/{chunk-O6J3YLHR.cjs → chunk-ZOOFNUIZ.cjs} +21 -21
- package/dist/claim.cjs +5 -5
- package/dist/claim.mjs +4 -4
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +7 -7
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,10 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
React modal for cross-chain deposits and withdrawals via Rhinestone smart accounts.
|
|
4
4
|
|
|
5
|
+
**[Documentation](https://docs.rhinestone.dev/deposits/widget/quickstart)** ·
|
|
6
|
+
[Deposit modal](https://docs.rhinestone.dev/deposits/widget/deposit-modal) ·
|
|
7
|
+
[Withdraw modal](https://docs.rhinestone.dev/deposits/widget/withdraw-modal) ·
|
|
8
|
+
[Claim modal](https://docs.rhinestone.dev/deposits/widget/claim-modal) ·
|
|
9
|
+
[Backend proxy](https://docs.rhinestone.dev/deposits/widget/backend) ·
|
|
10
|
+
[Migration guide](https://docs.rhinestone.dev/deposits/widget/migration)
|
|
11
|
+
|
|
12
|
+
This README covers the common integrations. The full props reference lives in the
|
|
13
|
+
docs.
|
|
14
|
+
|
|
5
15
|
## Install
|
|
6
16
|
|
|
7
17
|
```bash
|
|
8
|
-
npm install @rhinestone/deposit-modal viem
|
|
18
|
+
npm install @rhinestone/deposit-modal viem wagmi @tanstack/react-query
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Add Reown only if you want the modal to connect the wallet itself — these are
|
|
22
|
+
optional peers, so skip them when you pass your own `walletClient` or run a flow
|
|
23
|
+
with no wallet:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @reown/appkit @reown/appkit-adapter-wagmi
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For Solana sources or destinations:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @reown/appkit-adapter-solana @solana/web3.js @solana/spl-token
|
|
9
33
|
```
|
|
10
34
|
|
|
11
35
|
### Content Security Policy
|
|
@@ -130,18 +154,8 @@ funds has no user key and cannot sign for its own refund. But the deposit's
|
|
|
130
154
|
holds. So that is what authorizes the recovery.
|
|
131
155
|
|
|
132
156
|
`signRecovery` is handed the exact typed data to sign plus the `signer` address the
|
|
133
|
-
processor will verify against, and returns a signature
|
|
134
|
-
|
|
135
|
-
```tsx
|
|
136
|
-
<ClaimModal
|
|
137
|
-
isOpen={isOpen}
|
|
138
|
-
onClose={() => setIsOpen(false)}
|
|
139
|
-
backendUrl={process.env.NEXT_PUBLIC_DEPOSIT_PROXY_URL}
|
|
140
|
-
signRecovery={({ typedData }) => wallet.signTypedData(typedData)}
|
|
141
|
-
/>
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
Return whatever that address's own verifier accepts:
|
|
157
|
+
processor will verify against, and returns a signature. Return whatever that
|
|
158
|
+
address's own verifier accepts:
|
|
145
159
|
|
|
146
160
|
| recipient is | return |
|
|
147
161
|
|---|---|
|
|
@@ -158,6 +172,11 @@ straight from the browser through your `deposit-widget-proxy`, which adds only t
|
|
|
158
172
|
project API key — and that key cannot move funds through this route without a valid
|
|
159
173
|
signature, so there is no privilege for a page to borrow.
|
|
160
174
|
|
|
175
|
+
**Your proxy must forward `POST /deposits/recover`**, alongside the `GET /deposits`
|
|
176
|
+
used for the lookup. Both are in the
|
|
177
|
+
[reference proxy](https://docs.rhinestone.dev/deposits/widget/backend); a proxy
|
|
178
|
+
missing the recover route 404s the claim rather than degrading.
|
|
179
|
+
|
|
161
180
|
Two properties fall out of signing that are worth knowing:
|
|
162
181
|
|
|
163
182
|
- **The destination is inside the signed struct.** The processor cannot pay anywhere
|
|
@@ -191,9 +210,9 @@ export const POST = createRefundHandler({
|
|
|
191
210
|
```
|
|
192
211
|
|
|
193
212
|
The modal does not drive this path — you'd build that UI yourself, or route the user
|
|
194
|
-
to support.
|
|
195
|
-
|
|
196
|
-
|
|
213
|
+
to support. Do **not** proxy `POST /deposits/refund`: unlike recover it carries no
|
|
214
|
+
proof of who is asking, so forwarding it with your API key attached would let anyone
|
|
215
|
+
return any of your recoverable deposits to an address they chose.
|
|
197
216
|
|
|
198
217
|
## Fiat on-ramp (Swapped)
|
|
199
218
|
|
|
@@ -263,19 +282,16 @@ Flow: user picks Fund from Exchange → backend returns supported exchanges + lo
|
|
|
263
282
|
| ------------------------ | --------- | ------- | ----------- |
|
|
264
283
|
| `enableExchangeConnect` | `boolean` | `false` | Show the "Fund from Exchange" row. Requires backend Swapped keys. Needs no wallet. Can be combined with `enableFiatOnramp`. |
|
|
265
284
|
|
|
266
|
-
##
|
|
267
|
-
|
|
268
|
-
Releases are driven by [changesets](https://github.com/changesets/changesets) and two GitHub Actions workflows (`.github/workflows/`).
|
|
285
|
+
## Upgrading
|
|
269
286
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
287
|
+
Upgrading from 0.8.x is a breaking change on both modals. See
|
|
288
|
+
[`MIGRATION.md`](./MIGRATION.md), or the same guide
|
|
289
|
+
[in the docs](https://docs.rhinestone.dev/deposits/widget/migration).
|
|
273
290
|
|
|
274
|
-
|
|
291
|
+
## Contributing
|
|
275
292
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
- A `release` branch and a `ship` label.
|
|
293
|
+
Local setup, the release process and where the docs live are in
|
|
294
|
+
[`CONTRIBUTING.md`](./CONTRIBUTING.md).
|
|
279
295
|
|
|
280
296
|
## License
|
|
281
297
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-GBCWBRJC.mjs";
|
|
4
|
+
import "./chunk-ZGJ6OYGU.mjs";
|
|
5
|
+
import "./chunk-LZR5ZU2E.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isUnsupportedChainSwitchError,
|
|
8
8
|
rpcUrlFor
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-UHRLZESO.mjs";
|
|
10
|
+
import "./chunk-4FRPUAL6.mjs";
|
|
11
11
|
import "./chunk-ILT2PITN.mjs";
|
|
12
12
|
import {
|
|
13
13
|
SUPPORTED_CHAINS,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunk5ONI6P6Lcjs = require('./chunk-5ONI6P6L.cjs');
|
|
4
|
+
require('./chunk-2Q3FD6ER.cjs');
|
|
5
|
+
require('./chunk-3SZRLOKL.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
9
|
+
var _chunkZOOFNUIZcjs = require('./chunk-ZOOFNUIZ.cjs');
|
|
10
|
+
require('./chunk-UYINQEEF.cjs');
|
|
11
11
|
require('./chunk-YEBXUUH3.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -88,14 +88,14 @@ function buildTransports(rpcUrls) {
|
|
|
88
88
|
const transports = {};
|
|
89
89
|
for (const network of EVM_NETWORKS) {
|
|
90
90
|
const id = Number(network.id);
|
|
91
|
-
transports[id] = _viem.http.call(void 0,
|
|
91
|
+
transports[id] = _viem.http.call(void 0, _chunkZOOFNUIZcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
92
92
|
}
|
|
93
93
|
return transports;
|
|
94
94
|
}
|
|
95
95
|
function getEvmRpcFingerprint(rpcUrls) {
|
|
96
96
|
return EVM_NETWORKS.map((network) => {
|
|
97
97
|
const id = Number(network.id);
|
|
98
|
-
return `${id}=${_nullishCoalesce(
|
|
98
|
+
return `${id}=${_nullishCoalesce(_chunkZOOFNUIZcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
99
99
|
}).join("|");
|
|
100
100
|
}
|
|
101
101
|
var cachedAdapter = null;
|
|
@@ -189,7 +189,7 @@ function useReownWallet() {
|
|
|
189
189
|
await switchChainAsync({ chainId });
|
|
190
190
|
}
|
|
191
191
|
} catch (err) {
|
|
192
|
-
if (
|
|
192
|
+
if (_chunkZOOFNUIZcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
193
193
|
throw new Error(
|
|
194
194
|
`Switch to ${_chunkH577RJN5cjs.getChainName.call(void 0, chainId)} in your wallet to continue`
|
|
195
195
|
);
|
|
@@ -223,7 +223,7 @@ function DepositModalWithReown(props) {
|
|
|
223
223
|
reown.disconnect();
|
|
224
224
|
}, [reown.disconnect]);
|
|
225
225
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
226
|
-
|
|
226
|
+
_chunk5ONI6P6Lcjs.DepositModalInner,
|
|
227
227
|
{
|
|
228
228
|
...props,
|
|
229
229
|
reownWallet: reownWithSolana,
|