@rhinestone/deposit-modal 0.3.0-alpha.11 → 0.3.0-alpha.13
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 +59 -0
- package/dist/{DepositModalReown-KXFF6ZXY.cjs → DepositModalReown-CXPRZRXL.cjs} +6 -6
- package/dist/{DepositModalReown-UNFGBOIJ.mjs → DepositModalReown-HBAWSK6K.mjs} +3 -3
- package/dist/{WithdrawModalReown-QEQPCSWT.mjs → WithdrawModalReown-EEWQRENY.mjs} +3 -3
- package/dist/{WithdrawModalReown-Z5JVENP6.cjs → WithdrawModalReown-T3TPJIME.cjs} +6 -6
- package/dist/{chunk-WVE3JN3C.mjs → chunk-6K4JHM2D.mjs} +343 -50
- package/dist/{chunk-YI63OMXN.cjs → chunk-6RCOF3XU.cjs} +57 -57
- package/dist/{chunk-2TWQGPPB.cjs → chunk-DZNXG5JK.cjs} +372 -79
- package/dist/{chunk-7MZNQ4C2.mjs → chunk-EC63ZHY4.mjs} +2 -2
- package/dist/{chunk-V63GWJHB.mjs → chunk-HZBO2SIZ.mjs} +1503 -366
- package/dist/{chunk-FGVSNARE.cjs → chunk-PWV2UJP3.cjs} +2 -2
- package/dist/{chunk-Y4CESMTH.cjs → chunk-SEOQ66FW.cjs} +1420 -283
- package/dist/{chunk-QXIJLRKC.mjs → chunk-YB3JPWJW.mjs} +1 -1
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/styles.css +547 -12
- package/dist/{types-D6wrO4Ow.d.cts → types-C8i2ebY1.d.cts} +25 -0
- package/dist/{types-D6wrO4Ow.d.ts → types-C8i2ebY1.d.ts} +25 -0
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -53,6 +53,65 @@ export function DepositButton({ walletClient, publicClient, address }) {
|
|
|
53
53
|
|
|
54
54
|
`WithdrawModal` lives at `@rhinestone/deposit-modal/withdraw` and takes the same shape (`onLifecycle` + `onError`).
|
|
55
55
|
|
|
56
|
+
## Fiat on-ramp (Swapped)
|
|
57
|
+
|
|
58
|
+
Pass `enableFiatOnramp` to expose Swapped's iframe as a funding option alongside Transfer Crypto:
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
<DepositModal
|
|
62
|
+
enableFiatOnramp
|
|
63
|
+
// Optionally render one row per Swapped payment method instead of a generic
|
|
64
|
+
// "Pay with Card" row. Slugs come from Swapped's GET /api/v1/merchant/get_payment_methods.
|
|
65
|
+
fiatOnrampMethods={[
|
|
66
|
+
{ method: "creditcard", label: "Pay with Card", icon: "card" },
|
|
67
|
+
{ method: "applepay", label: "Apple Pay", icon: "apple" },
|
|
68
|
+
{ method: "bank-transfer", label: "Bank Transfer", icon: "bank" },
|
|
69
|
+
]}
|
|
70
|
+
// Hide the Transfer Crypto QR row if you only want fiat options:
|
|
71
|
+
// enableQrTransfer={false}
|
|
72
|
+
// ...
|
|
73
|
+
/>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The flow: user picks a fiat option → modal registers a Rhinestone smart account → backend mints a server-signed Swapped iframe URL → user completes purchase → Swapped sends crypto on-chain to the smart account → the existing on-chain detection fires `onLifecycle({ type: "complete" })`.
|
|
77
|
+
|
|
78
|
+
**Destination guarantees.** The user picks the fiat amount inside Swapped's widget, but the destination is fixed server-side: every order receives **USDC on Base** delivered to the **registered Rhinestone smart account**. The frontend cannot override these; the backend signs the Swapped URL with `currencyCode=USDC_BASE` and `walletAddress=<smartAccount>`.
|
|
79
|
+
|
|
80
|
+
**Fees.** Rhinestone does not charge a markup by default. The client (dapp) controls the user-facing experience via the orchestrator's sponsorship config:
|
|
81
|
+
- **Sponsored** (client has a funded sponsor pool for the source chain): user receives 1:1 — the on-ramped amount lands on the target chain exactly.
|
|
82
|
+
- **Unsponsored**: the bridging cost is deducted from the on-ramped amount and shown as a "Bridging cost" line on the success screen.
|
|
83
|
+
|
|
84
|
+
Host CSP must allow Swapped's domains:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
frame-src https://widget.swapped.com https://sandbox.swapped.com https://connect.swapped.com;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Submerchant attribution.** Swapped orders are tagged with a `submerchant` for multi-tenant reporting. This is derived automatically server-side from the embedding page's domain (the request `Origin` header) — no configuration is required. In local development the domain resolves to `localhost`.
|
|
91
|
+
|
|
92
|
+
| Prop | Type | Default | Description |
|
|
93
|
+
| -------------------- | ----------------------------- | ------- | ----------- |
|
|
94
|
+
| `enableFiatOnramp` | `boolean` | `false` | Show fiat on-ramp option(s). Requires `dappAddress` and backend Swapped keys. |
|
|
95
|
+
| `enableQrTransfer` | `boolean` | `true` | Show the Transfer Crypto / QR row. Set false for fiat-only. |
|
|
96
|
+
| `fiatOnrampMethods` | `FiatPaymentMethodOption[]` | — | One row per method, each preselects Swapped's payment method via the `method` URL param. |
|
|
97
|
+
|
|
98
|
+
## Fund from Exchange (Swapped Connect)
|
|
99
|
+
|
|
100
|
+
Pass `enableExchangeConnect` to expose a "Fund from Exchange" row alongside the existing options. Clicking it opens an exchange picker backed by `/onramp/swapped/connect-exchanges`; after the user picks an exchange, the modal embeds Swapped's Connect iframe for that selected `connection`, signs in, and Swapped pulls the crypto on-chain to the smart account.
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
<DepositModal
|
|
104
|
+
enableExchangeConnect
|
|
105
|
+
// ...
|
|
106
|
+
/>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Flow: user picks Fund from Exchange → backend returns supported exchanges + logos from Swapped using a 24-hour cache → user picks an exchange → modal registers a Rhinestone smart account → backend mints a server-signed Swapped Connect URL with the selected `connection` → user authenticates with their CEX inside the iframe → Swapped pushes crypto on-chain → existing on-chain detection fires `onLifecycle({ type: "complete" })`.
|
|
110
|
+
|
|
111
|
+
| Prop | Type | Default | Description |
|
|
112
|
+
| ------------------------ | --------- | ------- | ----------- |
|
|
113
|
+
| `enableExchangeConnect` | `boolean` | `false` | Show the "Fund from Exchange" row. Requires `dappAddress` and backend Swapped keys. Can be combined with `enableFiatOnramp`. |
|
|
114
|
+
|
|
56
115
|
## License
|
|
57
116
|
|
|
58
117
|
MIT
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSEOQ66FWcjs = require('./chunk-SEOQ66FW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkPWV2UJP3cjs = require('./chunk-PWV2UJP3.cjs');
|
|
8
|
+
require('./chunk-DZNXG5JK.cjs');
|
|
9
9
|
require('./chunk-7JIDIX27.cjs');
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
@@ -14,7 +14,7 @@ var _react3 = require('@reown/appkit/react');
|
|
|
14
14
|
var _react5 = require('@reown/appkit-adapter-solana/react');
|
|
15
15
|
var _jsxruntime = require('react/jsx-runtime');
|
|
16
16
|
function DepositModalWithReown(props) {
|
|
17
|
-
const reown =
|
|
17
|
+
const reown = _chunkPWV2UJP3cjs.useReownWallet.call(void 0, );
|
|
18
18
|
const enableSolana = _nullishCoalesce(props.enableSolana, () => ( true));
|
|
19
19
|
const { walletProvider: solanaWalletProvider } = _react3.useAppKitProvider.call(void 0,
|
|
20
20
|
enableSolana ? "solana" : "eip155"
|
|
@@ -35,7 +35,7 @@ function DepositModalWithReown(props) {
|
|
|
35
35
|
reown.disconnect();
|
|
36
36
|
}, [reown.disconnect]);
|
|
37
37
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
38
|
-
|
|
38
|
+
_chunkSEOQ66FWcjs.DepositModalInner,
|
|
39
39
|
{
|
|
40
40
|
...props,
|
|
41
41
|
reownWallet: reownWithSolana,
|
|
@@ -46,7 +46,7 @@ function DepositModalWithReown(props) {
|
|
|
46
46
|
}
|
|
47
47
|
function DepositModalReown(props) {
|
|
48
48
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
49
|
-
|
|
49
|
+
_chunkPWV2UJP3cjs.ReownWalletProvider,
|
|
50
50
|
{
|
|
51
51
|
projectId: props.reownAppId,
|
|
52
52
|
theme: props.theme,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HZBO2SIZ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-YB3JPWJW.mjs";
|
|
8
|
+
import "./chunk-6K4JHM2D.mjs";
|
|
9
9
|
import "./chunk-SZIYS42B.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EC63ZHY4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-YB3JPWJW.mjs";
|
|
8
|
+
import "./chunk-6K4JHM2D.mjs";
|
|
9
9
|
import "./chunk-SZIYS42B.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6RCOF3XUcjs = require('./chunk-6RCOF3XU.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkPWV2UJP3cjs = require('./chunk-PWV2UJP3.cjs');
|
|
8
|
+
require('./chunk-DZNXG5JK.cjs');
|
|
9
9
|
require('./chunk-7JIDIX27.cjs');
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
13
13
|
var _jsxruntime = require('react/jsx-runtime');
|
|
14
14
|
function WithdrawModalWithReown(props) {
|
|
15
|
-
const reown =
|
|
15
|
+
const reown = _chunkPWV2UJP3cjs.useReownWallet.call(void 0, );
|
|
16
16
|
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
|
|
|
20
20
|
reown.disconnect();
|
|
21
21
|
}, [reown.disconnect]);
|
|
22
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
-
|
|
23
|
+
_chunk6RCOF3XUcjs.WithdrawModalInner,
|
|
24
24
|
{
|
|
25
25
|
...props,
|
|
26
26
|
reownWallet: reown,
|
|
@@ -30,7 +30,7 @@ function WithdrawModalWithReown(props) {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
function WithdrawModalReown(props) {
|
|
33
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
33
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPWV2UJP3cjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|