@rhinestone/deposit-modal 0.20.0 → 0.20.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 +3 -0
- package/dist/{BankOnrampStep-NPGXAA7U.cjs → BankOnrampStep-3SNUX6V2.cjs} +11 -11
- package/dist/{BankOnrampStep-JG32OCM2.mjs → BankOnrampStep-4D24HVHV.mjs} +4 -4
- package/dist/{DepositModalReown-ALVWADG7.cjs → DepositModalReown-7EHOJTFW.cjs} +16 -16
- package/dist/{DepositModalReown-3FGTPER6.mjs → DepositModalReown-SYQ2SCHC.mjs} +3 -3
- package/dist/WithdrawModal-LLJLEYXZ.cjs +12 -0
- package/dist/{WithdrawModal-LL4Z5WZP.mjs → WithdrawModal-LXDIT4UV.mjs} +3 -3
- package/dist/{chunk-BTEG2VNZ.cjs → chunk-CIVFT5KR.cjs} +58 -58
- package/dist/{chunk-EKFXUF5A.cjs → chunk-D3R3O4CY.cjs} +1 -1
- package/dist/{chunk-6CTJFR3T.mjs → chunk-EJDBIWNH.mjs} +1 -1
- package/dist/{chunk-247GJH57.mjs → chunk-FW7ZMXQS.mjs} +444 -477
- package/dist/{chunk-PYRXOP2Y.cjs → chunk-IPHKBBUV.cjs} +2 -2
- package/dist/{chunk-HP7S7AD6.mjs → chunk-IPKT3FU6.mjs} +1 -1
- package/dist/{chunk-5QUWEFD4.mjs → chunk-JPX4MEHV.mjs} +1 -1
- package/dist/{chunk-CXRH5MKO.cjs → chunk-KXSU24RU.cjs} +354 -275
- package/dist/{chunk-OPT5EW6L.cjs → chunk-LVMNNMOZ.cjs} +2 -2
- package/dist/{chunk-FMUSY563.cjs → chunk-O5OW4S7L.cjs} +3 -3
- package/dist/{chunk-32ERBFMO.mjs → chunk-OZPMRTW3.mjs} +93 -14
- package/dist/{chunk-Z4RBTNKX.cjs → chunk-PVFEZ3UG.cjs} +596 -629
- package/dist/{chunk-XBJCZYBX.mjs → chunk-YQCRXJIL.mjs} +1 -1
- package/dist/{chunk-B2LZQIGB.mjs → chunk-ZOJMB5TZ.mjs} +1 -1
- package/dist/compliance.cjs +4 -4
- package/dist/compliance.mjs +3 -3
- 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 +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/onramp.cjs +4 -4
- package/dist/onramp.mjs +3 -3
- package/dist/{types-CixUBhrM.d.cts → types-BEEMfNi2.d.cts} +4 -2
- package/dist/{types-BxSrazbq.d.ts → types-DQDUqzsZ.d.ts} +4 -2
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
- package/dist/WithdrawModal-5YWFJSYY.cjs +0 -12
package/README.md
CHANGED
|
@@ -317,6 +317,9 @@ The flow: user picks a fiat option → modal registers a Rhinestone smart accoun
|
|
|
317
317
|
> request carries no `Authorization` header, and never key-forward the list
|
|
318
318
|
> `GET /onramp/orders`. [`deposit-widget-proxy`](https://github.com/rhinestonewtf/deposit-widget-proxy)
|
|
319
319
|
> does this from #38. Keep the `/onramp/swapped/*` routes for older modal versions.
|
|
320
|
+
> Forward `GET /onramp/providers` with the key too: the modal offers only the
|
|
321
|
+
> onramps your project has (Cash and exchange rows, bank details). Without it,
|
|
322
|
+
> every row your props enable is offered, as before.
|
|
320
323
|
|
|
321
324
|
Host CSP must allow Swapped's domains:
|
|
322
325
|
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
var _chunkG264OM23cjs = require('./chunk-G264OM23.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkIPHKBBUVcjs = require('./chunk-IPHKBBUV.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkO5OW4S7Lcjs = require('./chunk-O5OW4S7L.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
require('./chunk-
|
|
18
|
+
var _chunkLVMNNMOZcjs = require('./chunk-LVMNNMOZ.cjs');
|
|
19
|
+
require('./chunk-D3R3O4CY.cjs');
|
|
20
20
|
|
|
21
21
|
// src/components/steps/BankOnrampStep.tsx
|
|
22
22
|
var _react = require('react');
|
|
@@ -145,7 +145,7 @@ function BankOnrampStep({
|
|
|
145
145
|
[backendUrl, getSessionRef, smartAccount]
|
|
146
146
|
);
|
|
147
147
|
const service = _react.useMemo.call(void 0,
|
|
148
|
-
() =>
|
|
148
|
+
() => _chunkIPHKBBUVcjs.createOnrampService.call(void 0, sessionOptions),
|
|
149
149
|
[sessionOptions]
|
|
150
150
|
);
|
|
151
151
|
const [availableForHistory, setAvailableForHistory] = _react.useState.call(void 0, false);
|
|
@@ -175,7 +175,7 @@ function BankOnrampStep({
|
|
|
175
175
|
[]
|
|
176
176
|
);
|
|
177
177
|
const startVerification = _react.useCallback.call(void 0, async () => {
|
|
178
|
-
const session = await
|
|
178
|
+
const session = await _chunkO5OW4S7Lcjs.startComplianceVerification.call(void 0, sessionOptions);
|
|
179
179
|
if (session.status === "failed") return "declined";
|
|
180
180
|
if (!session.nextAction) return "reviewing";
|
|
181
181
|
if (!isTrustedNoahHostedUrl(session.nextAction.url)) return "reviewing";
|
|
@@ -191,7 +191,7 @@ function BankOnrampStep({
|
|
|
191
191
|
return "action_required";
|
|
192
192
|
}, [openExternally, sessionOptions]);
|
|
193
193
|
const ensureVerified = _react.useCallback.call(void 0, async () => {
|
|
194
|
-
const current = await
|
|
194
|
+
const current = await _chunkO5OW4S7Lcjs.getComplianceStatus.call(void 0, sessionOptions);
|
|
195
195
|
if (current.status === "approved") return "approved";
|
|
196
196
|
if (current.status === "declined") return "declined";
|
|
197
197
|
return startVerification();
|
|
@@ -203,7 +203,7 @@ function BankOnrampStep({
|
|
|
203
203
|
setNoOptions(false);
|
|
204
204
|
try {
|
|
205
205
|
const discover = () => service.getOptions().catch((error2) => {
|
|
206
|
-
if (error2 instanceof
|
|
206
|
+
if (error2 instanceof _chunkLVMNNMOZcjs.ScopedRequestError && error2.status === 404 && onUnavailable) {
|
|
207
207
|
if (isCurrentRequest(generation)) onUnavailable();
|
|
208
208
|
return null;
|
|
209
209
|
}
|
|
@@ -270,7 +270,7 @@ function BankOnrampStep({
|
|
|
270
270
|
setBankDetails(details);
|
|
271
271
|
} catch (error2) {
|
|
272
272
|
if (!isCurrentRequest(generation)) return;
|
|
273
|
-
const pending = error2 instanceof
|
|
273
|
+
const pending = error2 instanceof _chunkLVMNNMOZcjs.ScopedRequestError && error2.status === 409;
|
|
274
274
|
const message = pending ? PENDING_ERROR : SAFE_ERROR;
|
|
275
275
|
setError(message);
|
|
276
276
|
_optionalChain([onError, 'optionalCall', _4 => _4(
|
|
@@ -304,7 +304,7 @@ function BankOnrampStep({
|
|
|
304
304
|
await openDetails(nextAccount);
|
|
305
305
|
} catch (error2) {
|
|
306
306
|
if (!isCurrentRequest(generation)) return;
|
|
307
|
-
if (error2 instanceof
|
|
307
|
+
if (error2 instanceof _chunkLVMNNMOZcjs.ScopedRequestError && error2.status === 409 && error2.code === "VERIFICATION_REQUIRED" && !verificationResumedRef.current) {
|
|
308
308
|
verificationResumedRef.current = true;
|
|
309
309
|
try {
|
|
310
310
|
const verification = await startVerification();
|
|
@@ -340,7 +340,7 @@ function BankOnrampStep({
|
|
|
340
340
|
const timer = setInterval(() => {
|
|
341
341
|
void (async () => {
|
|
342
342
|
try {
|
|
343
|
-
const status = await
|
|
343
|
+
const status = await _chunkO5OW4S7Lcjs.getComplianceStatus.call(void 0, sessionOptions);
|
|
344
344
|
if (!active) return;
|
|
345
345
|
if (status.status === "approved") {
|
|
346
346
|
setHostedUrl(null);
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
} from "./chunk-YY4ZOAH5.mjs";
|
|
9
9
|
import {
|
|
10
10
|
createOnrampService
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EJDBIWNH.mjs";
|
|
12
12
|
import {
|
|
13
13
|
getComplianceStatus,
|
|
14
14
|
startComplianceVerification
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JPX4MEHV.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ScopedRequestError
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-YQCRXJIL.mjs";
|
|
19
|
+
import "./chunk-ZOJMB5TZ.mjs";
|
|
20
20
|
|
|
21
21
|
// src/components/steps/BankOnrampStep.tsx
|
|
22
22
|
import { useCallback, useEffect, useMemo, useRef, useState as useState2 } from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkPVFEZ3UGcjs = require('./chunk-PVFEZ3UG.cjs');
|
|
5
5
|
require('./chunk-FVJKUTHF.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,13 +11,13 @@ require('./chunk-FVJKUTHF.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkKXSU24RUcjs = require('./chunk-KXSU24RU.cjs');
|
|
15
15
|
require('./chunk-G264OM23.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
|
|
20
|
-
require('./chunk-
|
|
20
|
+
require('./chunk-D3R3O4CY.cjs');
|
|
21
21
|
|
|
22
22
|
// src/DepositModalReown.tsx
|
|
23
23
|
var _react = require('react');
|
|
@@ -45,7 +45,7 @@ var {
|
|
|
45
45
|
unichain,
|
|
46
46
|
katana,
|
|
47
47
|
hyperEvm
|
|
48
|
-
} =
|
|
48
|
+
} = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, )[1];
|
|
49
49
|
var APPKIT_NETWORK_BY_ID = {
|
|
50
50
|
[mainnet.id]: mainnet,
|
|
51
51
|
[optimism.id]: optimism,
|
|
@@ -77,7 +77,7 @@ function getAppKitNetwork(chainId) {
|
|
|
77
77
|
|
|
78
78
|
// src/core/reown-theme.ts
|
|
79
79
|
function mapTheme(theme) {
|
|
80
|
-
const themeMode =
|
|
80
|
+
const themeMode = _chunkKXSU24RUcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
|
|
81
81
|
const themeVariables = {
|
|
82
82
|
"--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
|
|
83
83
|
};
|
|
@@ -94,7 +94,7 @@ function setAppKitTheme(appKit, theme) {
|
|
|
94
94
|
|
|
95
95
|
// src/core/reown.tsx
|
|
96
96
|
var _jsxruntime = require('react/jsx-runtime');
|
|
97
|
-
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] =
|
|
97
|
+
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, );
|
|
98
98
|
var {
|
|
99
99
|
createAppKit,
|
|
100
100
|
useAppKit,
|
|
@@ -110,14 +110,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
|
|
|
110
110
|
const transports = {};
|
|
111
111
|
for (const network of networks) {
|
|
112
112
|
const id = Number(network.id);
|
|
113
|
-
transports[id] = _viem.http.call(void 0,
|
|
113
|
+
transports[id] = _viem.http.call(void 0, _chunkKXSU24RUcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
114
114
|
}
|
|
115
115
|
return transports;
|
|
116
116
|
}
|
|
117
117
|
function getEvmRpcFingerprint(rpcUrls, networks) {
|
|
118
118
|
return networks.map((network) => {
|
|
119
119
|
const id = Number(network.id);
|
|
120
|
-
return `${id}=${_nullishCoalesce(
|
|
120
|
+
return `${id}=${_nullishCoalesce(_chunkKXSU24RUcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
121
121
|
}).join("|");
|
|
122
122
|
}
|
|
123
123
|
var cachedAdapter = null;
|
|
@@ -188,7 +188,7 @@ function ReownWalletProvider({
|
|
|
188
188
|
backendUrl,
|
|
189
189
|
children
|
|
190
190
|
}) {
|
|
191
|
-
const rpcUrls =
|
|
191
|
+
const rpcUrls = _chunkKXSU24RUcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
192
192
|
const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
|
|
193
193
|
const overrides = _react.useMemo.call(void 0, () => {
|
|
194
194
|
if (!rpcUrls) return void 0;
|
|
@@ -200,14 +200,14 @@ function ReownWalletProvider({
|
|
|
200
200
|
return out;
|
|
201
201
|
}, [rpcUrls]);
|
|
202
202
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
203
|
-
const primed =
|
|
203
|
+
const primed = _chunkKXSU24RUcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
204
204
|
return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
|
|
205
205
|
});
|
|
206
206
|
_react.useEffect.call(void 0, () => {
|
|
207
207
|
let active = true;
|
|
208
|
-
const primed =
|
|
208
|
+
const primed = _chunkKXSU24RUcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
209
209
|
setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
|
|
210
|
-
|
|
210
|
+
_chunkKXSU24RUcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
|
|
211
211
|
if (active) setState({ ready: true, chains });
|
|
212
212
|
});
|
|
213
213
|
return () => {
|
|
@@ -216,7 +216,7 @@ function ReownWalletProvider({
|
|
|
216
216
|
}, [backendUrl, overrides]);
|
|
217
217
|
_react.useEffect.call(void 0, () => {
|
|
218
218
|
setAppKitTheme(appKitReact.modal, theme);
|
|
219
|
-
return
|
|
219
|
+
return _chunkKXSU24RUcjs.followSystemAppearance.call(void 0,
|
|
220
220
|
_optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
|
|
221
221
|
() => setAppKitTheme(appKitReact.modal, theme)
|
|
222
222
|
);
|
|
@@ -280,7 +280,7 @@ function useReownWalletSession() {
|
|
|
280
280
|
await switchChainAsync({ chainId });
|
|
281
281
|
}
|
|
282
282
|
} catch (err) {
|
|
283
|
-
if (
|
|
283
|
+
if (_chunkKXSU24RUcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
284
284
|
throw new Error(
|
|
285
285
|
`Switch to ${chainDisplayName(chainId)} in your wallet to continue`
|
|
286
286
|
);
|
|
@@ -293,7 +293,7 @@ function useReownWalletSession() {
|
|
|
293
293
|
|
|
294
294
|
// src/DepositModalReown.tsx
|
|
295
295
|
|
|
296
|
-
var [appKitReact2, , , , solanaAdapterReact] =
|
|
296
|
+
var [appKitReact2, , , , solanaAdapterReact] = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, );
|
|
297
297
|
var { useAppKitProvider } = appKitReact2;
|
|
298
298
|
var { useAppKitConnection } = solanaAdapterReact;
|
|
299
299
|
function DepositModalWithReown(props) {
|
|
@@ -315,7 +315,7 @@ function DepositModalWithReown(props) {
|
|
|
315
315
|
reown.disconnect();
|
|
316
316
|
}, [reown.disconnect]);
|
|
317
317
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
318
|
-
|
|
318
|
+
_chunkPVFEZ3UGcjs.DepositModalInner,
|
|
319
319
|
{
|
|
320
320
|
...props,
|
|
321
321
|
walletSession: reownWithSolana,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner,
|
|
3
3
|
getReownDependencies
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FW7ZMXQS.mjs";
|
|
5
5
|
import "./chunk-2FOPO4N5.mjs";
|
|
6
6
|
import {
|
|
7
7
|
followSystemAppearance,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
resolveThemeMode,
|
|
12
12
|
rpcUrlFor,
|
|
13
13
|
useStableRpcUrls
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OZPMRTW3.mjs";
|
|
15
15
|
import "./chunk-YY4ZOAH5.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SUPPORTED_CHAIN_IDS,
|
|
18
18
|
getChainName
|
|
19
19
|
} from "./chunk-E7IMWVMN.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-ZOJMB5TZ.mjs";
|
|
21
21
|
|
|
22
22
|
// src/DepositModalReown.tsx
|
|
23
23
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkCIVFT5KRcjs = require('./chunk-CIVFT5KR.cjs');
|
|
5
|
+
require('./chunk-KXSU24RU.cjs');
|
|
6
|
+
require('./chunk-G264OM23.cjs');
|
|
7
|
+
require('./chunk-FKJ6EJHH.cjs');
|
|
8
|
+
require('./chunk-D3R3O4CY.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.WithdrawModal = _chunkCIVFT5KRcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkCIVFT5KRcjs.buildWithdrawAnalyticsSessionProperties;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModal,
|
|
3
3
|
buildWithdrawAnalyticsSessionProperties
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-IPKT3FU6.mjs";
|
|
5
|
+
import "./chunk-OZPMRTW3.mjs";
|
|
6
6
|
import "./chunk-YY4ZOAH5.mjs";
|
|
7
7
|
import "./chunk-E7IMWVMN.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-ZOJMB5TZ.mjs";
|
|
9
9
|
export {
|
|
10
10
|
WithdrawModal,
|
|
11
11
|
buildWithdrawAnalyticsSessionProperties
|