@rhinestone/deposit-modal 0.0.0-dev-20261008145713 → 0.0.0-dev-20261012160128
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 +4 -2
- package/dist/{BankOnrampStep-LD466MNG.mjs → BankOnrampStep-VW7PX52F.mjs} +20 -16
- package/dist/{BankOnrampStep-YPZDPVRR.cjs → BankOnrampStep-ZBFVOYBT.cjs} +27 -23
- package/dist/{DepositModalReown-IBGFE5KW.cjs → DepositModalReown-4ROA5FJZ.cjs} +17 -17
- package/dist/{DepositModalReown-Y4PKTX7K.mjs → DepositModalReown-MJPPXUNY.mjs} +4 -4
- package/dist/{WithdrawModal-M2UFAGDE.mjs → WithdrawModal-4YYXB3V6.mjs} +3 -3
- package/dist/WithdrawModal-HBWCKY3J.cjs +12 -0
- package/dist/{chunk-TROPQVAI.cjs → chunk-2GZMNVST.cjs} +3 -3
- package/dist/{chunk-UG3CTKQP.cjs → chunk-AJI7562L.cjs} +2 -2
- package/dist/{chunk-UJHKZJSA.cjs → chunk-AZB6I4UY.cjs} +2 -2
- package/dist/{chunk-J53TFX7B.cjs → chunk-C3RT34BC.cjs} +1 -1
- package/dist/{chunk-PBWAX2D6.cjs → chunk-FG3QTLTE.cjs} +32 -32
- package/dist/{chunk-G2F7F6PA.mjs → chunk-KVWS746L.mjs} +1 -1
- package/dist/{chunk-KWESDWCE.mjs → chunk-P3N3HVET.mjs} +4 -4
- package/dist/{chunk-BSPL4YXG.cjs → chunk-PRFNTBR3.cjs} +243 -243
- package/dist/{chunk-DAOI7BWJ.mjs → chunk-PWRYZF65.mjs} +1 -1
- package/dist/{chunk-TMNWIFZW.mjs → chunk-SHRUU2UJ.mjs} +1 -1
- package/dist/{chunk-LO6CU5BV.mjs → chunk-SNTVJ7UA.mjs} +1 -1
- package/dist/{chunk-BFBQ2KEA.mjs → chunk-T4IFPD3I.mjs} +1 -1
- package/dist/{chunk-OAPIV7ME.cjs → chunk-UMI44QNP.cjs} +58 -58
- package/dist/{chunk-LK575X7O.mjs → chunk-WB7GLSN7.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 +5 -5
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +4 -4
- package/dist/embed.cjs +15 -15
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +5 -5
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +5 -5
- package/dist/onramp.cjs +4 -4
- package/dist/onramp.mjs +3 -3
- package/dist/server.cjs +4 -2
- package/dist/server.mjs +4 -2
- package/dist/{types-BrxDZNEr.d.cts → types-4aP9KET-.d.cts} +2 -0
- package/dist/{types-DCUB4DY8.d.ts → types-Cp46a5ln.d.ts} +2 -0
- 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 +1 -1
- package/dist/WithdrawModal-LMKGVKXW.cjs +0 -12
package/README.md
CHANGED
|
@@ -394,7 +394,8 @@ chain. No on-chain link is shown for a fiat-only or sub-fee transfer.
|
|
|
394
394
|
const response = await fetch("/api/customer-session", {
|
|
395
395
|
method: "POST",
|
|
396
396
|
credentials: "same-origin",
|
|
397
|
-
// Forward `options`: History's `resumeOnly`
|
|
397
|
+
// Forward `options`: History's `resumeOnly` and a withdrawal's `bind: false`
|
|
398
|
+
// keep it from binding the account.
|
|
398
399
|
body: JSON.stringify({ smartAccount, ...options }),
|
|
399
400
|
});
|
|
400
401
|
// Keep the refusal's code, so the modal can explain it.
|
|
@@ -410,7 +411,8 @@ chain. No on-chain link is shown for a fiat-only or sub-fee transfer.
|
|
|
410
411
|
|
|
411
412
|
`getCustomerSession` must call your authenticated server endpoint, which mints a
|
|
412
413
|
short-lived customer session with `createCustomerSessionHandler`, which reads
|
|
413
|
-
`resumeOnly` from the request body
|
|
414
|
+
`resumeOnly` and `bind` from the request body: `resumeOnly` is forwarded, and
|
|
415
|
+
`bind: false` drops the smart account so a withdrawal never binds one. It is called
|
|
414
416
|
for every request; do not put the Rhinestone API key in the browser. Bank
|
|
415
417
|
transfer through virtual accounts requires it: without `getCustomerSession`,
|
|
416
418
|
`virtualAccountOnramp` is ignored (with one console warning). Card and exchange
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
} from "./chunk-YY4ZOAH5.mjs";
|
|
9
9
|
import {
|
|
10
10
|
createOnrampService
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SNTVJ7UA.mjs";
|
|
12
12
|
import "./chunk-PP4QE32S.mjs";
|
|
13
13
|
import {
|
|
14
14
|
getComplianceStatus,
|
|
15
15
|
startComplianceVerification
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KVWS746L.mjs";
|
|
17
17
|
import {
|
|
18
18
|
ScopedRequestError
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-SHRUU2UJ.mjs";
|
|
20
|
+
import "./chunk-T4IFPD3I.mjs";
|
|
21
21
|
|
|
22
22
|
// src/components/steps/BankOnrampStep.tsx
|
|
23
23
|
import { useCallback, useEffect, useMemo, useRef, useState as useState2 } from "react";
|
|
@@ -143,6 +143,9 @@ function BankOnrampStep({
|
|
|
143
143
|
onJourney
|
|
144
144
|
}) {
|
|
145
145
|
const getSessionRef = useLatestRef(getCustomerSession);
|
|
146
|
+
const onErrorRef = useLatestRef(onError);
|
|
147
|
+
const onUnavailableRef = useLatestRef(onUnavailable);
|
|
148
|
+
const openExternallyRef = useLatestRef(openExternally);
|
|
146
149
|
const sessionOptions = useMemo(
|
|
147
150
|
() => ({
|
|
148
151
|
backendUrl,
|
|
@@ -184,8 +187,9 @@ function BankOnrampStep({
|
|
|
184
187
|
if (session.status === "failed") return "declined";
|
|
185
188
|
if (!session.nextAction) return "reviewing";
|
|
186
189
|
if (!isTrustedNoahHostedUrl(session.nextAction.url)) return "reviewing";
|
|
187
|
-
|
|
188
|
-
|
|
190
|
+
const openExternally2 = openExternallyRef.current;
|
|
191
|
+
if (openExternally2) {
|
|
192
|
+
await openExternally2(session.nextAction.url);
|
|
189
193
|
setExternalOpened(true);
|
|
190
194
|
return "action_required";
|
|
191
195
|
}
|
|
@@ -194,7 +198,7 @@ function BankOnrampStep({
|
|
|
194
198
|
setVerificationExpired(false);
|
|
195
199
|
setIframeLoaded(false);
|
|
196
200
|
return "action_required";
|
|
197
|
-
}, [
|
|
201
|
+
}, [openExternallyRef, sessionOptions]);
|
|
198
202
|
const ensureVerified = useCallback(async () => {
|
|
199
203
|
const current = await getComplianceStatus(sessionOptions);
|
|
200
204
|
if (current.status === "approved") return "approved";
|
|
@@ -208,8 +212,8 @@ function BankOnrampStep({
|
|
|
208
212
|
setNoOptions(false);
|
|
209
213
|
try {
|
|
210
214
|
const discover = () => service.getOptions().catch((error2) => {
|
|
211
|
-
if (error2 instanceof ScopedRequestError && error2.status === 404 &&
|
|
212
|
-
if (isCurrentRequest(generation))
|
|
215
|
+
if (error2 instanceof ScopedRequestError && error2.status === 404 && onUnavailableRef.current) {
|
|
216
|
+
if (isCurrentRequest(generation)) onUnavailableRef.current?.();
|
|
213
217
|
return null;
|
|
214
218
|
}
|
|
215
219
|
throw error2;
|
|
@@ -245,15 +249,15 @@ function BankOnrampStep({
|
|
|
245
249
|
const code = error2?.code;
|
|
246
250
|
if (typeof code === "string" && SESSION_REFUSALS.has(code)) {
|
|
247
251
|
setError(ACCOUNT_ERROR);
|
|
248
|
-
|
|
252
|
+
onErrorRef.current?.(ACCOUNT_ERROR, "BANK_ONRAMP_SESSION_REFUSED");
|
|
249
253
|
return;
|
|
250
254
|
}
|
|
251
255
|
setError(OPTIONS_ERROR);
|
|
252
|
-
|
|
256
|
+
onErrorRef.current?.(OPTIONS_ERROR, "BANK_ONRAMP_OPTIONS_FAILED");
|
|
253
257
|
} finally {
|
|
254
258
|
if (isCurrentRequest(generation)) setLoading(false);
|
|
255
259
|
}
|
|
256
|
-
}, [ensureVerified, isCurrentRequest,
|
|
260
|
+
}, [ensureVerified, isCurrentRequest, onErrorRef, onUnavailableRef, service]);
|
|
257
261
|
useEffect(() => {
|
|
258
262
|
setSelectedAccount(null);
|
|
259
263
|
setBankDetails(null);
|
|
@@ -283,7 +287,7 @@ function BankOnrampStep({
|
|
|
283
287
|
const pending = error2 instanceof ScopedRequestError && error2.status === 409;
|
|
284
288
|
const message = pending ? PENDING_ERROR : SAFE_ERROR;
|
|
285
289
|
setError(message);
|
|
286
|
-
|
|
290
|
+
onErrorRef.current?.(
|
|
287
291
|
message,
|
|
288
292
|
pending ? "BANK_ONRAMP_DETAILS_PENDING" : "BANK_ONRAMP_DETAILS_FAILED"
|
|
289
293
|
);
|
|
@@ -291,7 +295,7 @@ function BankOnrampStep({
|
|
|
291
295
|
if (isCurrentRequest(generation)) setLoading(false);
|
|
292
296
|
}
|
|
293
297
|
},
|
|
294
|
-
[isCurrentRequest,
|
|
298
|
+
[isCurrentRequest, onErrorRef, service]
|
|
295
299
|
);
|
|
296
300
|
const selectOption = useCallback(
|
|
297
301
|
async (option, account) => {
|
|
@@ -327,11 +331,11 @@ function BankOnrampStep({
|
|
|
327
331
|
}
|
|
328
332
|
}
|
|
329
333
|
setError(SAFE_ERROR);
|
|
330
|
-
|
|
334
|
+
onErrorRef.current?.(SAFE_ERROR, "BANK_ONRAMP_SETUP_FAILED");
|
|
331
335
|
setLoading(false);
|
|
332
336
|
}
|
|
333
337
|
},
|
|
334
|
-
[isCurrentRequest,
|
|
338
|
+
[isCurrentRequest, onErrorRef, openDetails, service, startVerification]
|
|
335
339
|
);
|
|
336
340
|
const selectOptionRef = useLatestRef(selectOption);
|
|
337
341
|
useEffect(() => {
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
var _chunkG264OM23cjs = require('./chunk-G264OM23.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkAJI7562Lcjs = require('./chunk-AJI7562L.cjs');
|
|
12
12
|
require('./chunk-ADEWTBSN.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunk2GZMNVSTcjs = require('./chunk-2GZMNVST.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
20
|
-
require('./chunk-
|
|
19
|
+
var _chunkAZB6I4UYcjs = require('./chunk-AZB6I4UY.cjs');
|
|
20
|
+
require('./chunk-C3RT34BC.cjs');
|
|
21
21
|
|
|
22
22
|
// src/components/steps/BankOnrampStep.tsx
|
|
23
23
|
var _react = require('react');
|
|
@@ -143,6 +143,9 @@ function BankOnrampStep({
|
|
|
143
143
|
onJourney
|
|
144
144
|
}) {
|
|
145
145
|
const getSessionRef = _chunkG264OM23cjs.useLatestRef.call(void 0, getCustomerSession);
|
|
146
|
+
const onErrorRef = _chunkG264OM23cjs.useLatestRef.call(void 0, onError);
|
|
147
|
+
const onUnavailableRef = _chunkG264OM23cjs.useLatestRef.call(void 0, onUnavailable);
|
|
148
|
+
const openExternallyRef = _chunkG264OM23cjs.useLatestRef.call(void 0, openExternally);
|
|
146
149
|
const sessionOptions = _react.useMemo.call(void 0,
|
|
147
150
|
() => ({
|
|
148
151
|
backendUrl,
|
|
@@ -151,7 +154,7 @@ function BankOnrampStep({
|
|
|
151
154
|
[backendUrl, getSessionRef, smartAccount]
|
|
152
155
|
);
|
|
153
156
|
const service = _react.useMemo.call(void 0,
|
|
154
|
-
() =>
|
|
157
|
+
() => _chunkAJI7562Lcjs.createOnrampService.call(void 0, sessionOptions),
|
|
155
158
|
[sessionOptions]
|
|
156
159
|
);
|
|
157
160
|
_react.useEffect.call(void 0, () => {
|
|
@@ -180,12 +183,13 @@ function BankOnrampStep({
|
|
|
180
183
|
[]
|
|
181
184
|
);
|
|
182
185
|
const startVerification = _react.useCallback.call(void 0, async () => {
|
|
183
|
-
const session = await
|
|
186
|
+
const session = await _chunk2GZMNVSTcjs.startComplianceVerification.call(void 0, sessionOptions);
|
|
184
187
|
if (session.status === "failed") return "declined";
|
|
185
188
|
if (!session.nextAction) return "reviewing";
|
|
186
189
|
if (!isTrustedNoahHostedUrl(session.nextAction.url)) return "reviewing";
|
|
187
|
-
|
|
188
|
-
|
|
190
|
+
const openExternally2 = openExternallyRef.current;
|
|
191
|
+
if (openExternally2) {
|
|
192
|
+
await openExternally2(session.nextAction.url);
|
|
189
193
|
setExternalOpened(true);
|
|
190
194
|
return "action_required";
|
|
191
195
|
}
|
|
@@ -194,9 +198,9 @@ function BankOnrampStep({
|
|
|
194
198
|
setVerificationExpired(false);
|
|
195
199
|
setIframeLoaded(false);
|
|
196
200
|
return "action_required";
|
|
197
|
-
}, [
|
|
201
|
+
}, [openExternallyRef, sessionOptions]);
|
|
198
202
|
const ensureVerified = _react.useCallback.call(void 0, async () => {
|
|
199
|
-
const current = await
|
|
203
|
+
const current = await _chunk2GZMNVSTcjs.getComplianceStatus.call(void 0, sessionOptions);
|
|
200
204
|
if (current.status === "approved") return "approved";
|
|
201
205
|
if (current.status === "declined") return "declined";
|
|
202
206
|
return startVerification();
|
|
@@ -208,8 +212,8 @@ function BankOnrampStep({
|
|
|
208
212
|
setNoOptions(false);
|
|
209
213
|
try {
|
|
210
214
|
const discover = () => service.getOptions().catch((error2) => {
|
|
211
|
-
if (error2 instanceof
|
|
212
|
-
if (isCurrentRequest(generation))
|
|
215
|
+
if (error2 instanceof _chunkAZB6I4UYcjs.ScopedRequestError && error2.status === 404 && onUnavailableRef.current) {
|
|
216
|
+
if (isCurrentRequest(generation)) _optionalChain([onUnavailableRef, 'access', _3 => _3.current, 'optionalCall', _4 => _4()]);
|
|
213
217
|
return null;
|
|
214
218
|
}
|
|
215
219
|
throw error2;
|
|
@@ -242,18 +246,18 @@ function BankOnrampStep({
|
|
|
242
246
|
);
|
|
243
247
|
} catch (error2) {
|
|
244
248
|
if (!isCurrentRequest(generation)) return;
|
|
245
|
-
const code = _optionalChain([error2, 'optionalAccess',
|
|
249
|
+
const code = _optionalChain([error2, 'optionalAccess', _5 => _5.code]);
|
|
246
250
|
if (typeof code === "string" && SESSION_REFUSALS.has(code)) {
|
|
247
251
|
setError(ACCOUNT_ERROR);
|
|
248
|
-
_optionalChain([
|
|
252
|
+
_optionalChain([onErrorRef, 'access', _6 => _6.current, 'optionalCall', _7 => _7(ACCOUNT_ERROR, "BANK_ONRAMP_SESSION_REFUSED")]);
|
|
249
253
|
return;
|
|
250
254
|
}
|
|
251
255
|
setError(OPTIONS_ERROR);
|
|
252
|
-
_optionalChain([
|
|
256
|
+
_optionalChain([onErrorRef, 'access', _8 => _8.current, 'optionalCall', _9 => _9(OPTIONS_ERROR, "BANK_ONRAMP_OPTIONS_FAILED")]);
|
|
253
257
|
} finally {
|
|
254
258
|
if (isCurrentRequest(generation)) setLoading(false);
|
|
255
259
|
}
|
|
256
|
-
}, [ensureVerified, isCurrentRequest,
|
|
260
|
+
}, [ensureVerified, isCurrentRequest, onErrorRef, onUnavailableRef, service]);
|
|
257
261
|
_react.useEffect.call(void 0, () => {
|
|
258
262
|
setSelectedAccount(null);
|
|
259
263
|
setBankDetails(null);
|
|
@@ -280,10 +284,10 @@ function BankOnrampStep({
|
|
|
280
284
|
setBankDetails(details);
|
|
281
285
|
} catch (error2) {
|
|
282
286
|
if (!isCurrentRequest(generation)) return;
|
|
283
|
-
const pending = error2 instanceof
|
|
287
|
+
const pending = error2 instanceof _chunkAZB6I4UYcjs.ScopedRequestError && error2.status === 409;
|
|
284
288
|
const message = pending ? PENDING_ERROR : SAFE_ERROR;
|
|
285
289
|
setError(message);
|
|
286
|
-
_optionalChain([
|
|
290
|
+
_optionalChain([onErrorRef, 'access', _10 => _10.current, 'optionalCall', _11 => _11(
|
|
287
291
|
message,
|
|
288
292
|
pending ? "BANK_ONRAMP_DETAILS_PENDING" : "BANK_ONRAMP_DETAILS_FAILED"
|
|
289
293
|
)]);
|
|
@@ -291,7 +295,7 @@ function BankOnrampStep({
|
|
|
291
295
|
if (isCurrentRequest(generation)) setLoading(false);
|
|
292
296
|
}
|
|
293
297
|
},
|
|
294
|
-
[isCurrentRequest,
|
|
298
|
+
[isCurrentRequest, onErrorRef, service]
|
|
295
299
|
);
|
|
296
300
|
const selectOption = _react.useCallback.call(void 0,
|
|
297
301
|
async (option, account) => {
|
|
@@ -314,7 +318,7 @@ function BankOnrampStep({
|
|
|
314
318
|
await openDetails(nextAccount);
|
|
315
319
|
} catch (error2) {
|
|
316
320
|
if (!isCurrentRequest(generation)) return;
|
|
317
|
-
if (error2 instanceof
|
|
321
|
+
if (error2 instanceof _chunkAZB6I4UYcjs.ScopedRequestError && error2.status === 409 && error2.code === "VERIFICATION_REQUIRED" && !verificationResumedRef.current) {
|
|
318
322
|
verificationResumedRef.current = true;
|
|
319
323
|
try {
|
|
320
324
|
const verification = await startVerification();
|
|
@@ -327,11 +331,11 @@ function BankOnrampStep({
|
|
|
327
331
|
}
|
|
328
332
|
}
|
|
329
333
|
setError(SAFE_ERROR);
|
|
330
|
-
_optionalChain([
|
|
334
|
+
_optionalChain([onErrorRef, 'access', _12 => _12.current, 'optionalCall', _13 => _13(SAFE_ERROR, "BANK_ONRAMP_SETUP_FAILED")]);
|
|
331
335
|
setLoading(false);
|
|
332
336
|
}
|
|
333
337
|
},
|
|
334
|
-
[isCurrentRequest,
|
|
338
|
+
[isCurrentRequest, onErrorRef, openDetails, service, startVerification]
|
|
335
339
|
);
|
|
336
340
|
const selectOptionRef = _chunkG264OM23cjs.useLatestRef.call(void 0, selectOption);
|
|
337
341
|
_react.useEffect.call(void 0, () => {
|
|
@@ -350,7 +354,7 @@ function BankOnrampStep({
|
|
|
350
354
|
const timer = setInterval(() => {
|
|
351
355
|
void (async () => {
|
|
352
356
|
try {
|
|
353
|
-
const status = await
|
|
357
|
+
const status = await _chunk2GZMNVSTcjs.getComplianceStatus.call(void 0, sessionOptions);
|
|
354
358
|
if (!active) return;
|
|
355
359
|
if (status.status === "approved") {
|
|
356
360
|
setHostedUrl(null);
|
|
@@ -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 _chunkPRFNTBR3cjs = require('./chunk-PRFNTBR3.cjs');
|
|
5
5
|
require('./chunk-FVJKUTHF.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,15 +11,15 @@ require('./chunk-FVJKUTHF.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkFG3QTLTEcjs = require('./chunk-FG3QTLTE.cjs');
|
|
15
15
|
require('./chunk-G264OM23.cjs');
|
|
16
16
|
require('./chunk-ADEWTBSN.cjs');
|
|
17
|
-
require('./chunk-
|
|
17
|
+
require('./chunk-AZB6I4UY.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
|
|
22
|
-
require('./chunk-
|
|
22
|
+
require('./chunk-C3RT34BC.cjs');
|
|
23
23
|
|
|
24
24
|
// src/DepositModalReown.tsx
|
|
25
25
|
var _react = require('react');
|
|
@@ -47,7 +47,7 @@ var {
|
|
|
47
47
|
unichain,
|
|
48
48
|
katana,
|
|
49
49
|
hyperEvm
|
|
50
|
-
} =
|
|
50
|
+
} = _chunkPRFNTBR3cjs.getReownDependencies.call(void 0, )[1];
|
|
51
51
|
var APPKIT_NETWORK_BY_ID = {
|
|
52
52
|
[mainnet.id]: mainnet,
|
|
53
53
|
[optimism.id]: optimism,
|
|
@@ -79,7 +79,7 @@ function getAppKitNetwork(chainId) {
|
|
|
79
79
|
|
|
80
80
|
// src/core/reown-theme.ts
|
|
81
81
|
function mapTheme(theme) {
|
|
82
|
-
const themeMode =
|
|
82
|
+
const themeMode = _chunkFG3QTLTEcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
|
|
83
83
|
const themeVariables = {
|
|
84
84
|
"--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
|
|
85
85
|
};
|
|
@@ -96,7 +96,7 @@ function setAppKitTheme(appKit, theme) {
|
|
|
96
96
|
|
|
97
97
|
// src/core/reown.tsx
|
|
98
98
|
var _jsxruntime = require('react/jsx-runtime');
|
|
99
|
-
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] =
|
|
99
|
+
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkPRFNTBR3cjs.getReownDependencies.call(void 0, );
|
|
100
100
|
var {
|
|
101
101
|
createAppKit,
|
|
102
102
|
useAppKit,
|
|
@@ -112,14 +112,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
|
|
|
112
112
|
const transports = {};
|
|
113
113
|
for (const network of networks) {
|
|
114
114
|
const id = Number(network.id);
|
|
115
|
-
transports[id] = _viem.http.call(void 0,
|
|
115
|
+
transports[id] = _viem.http.call(void 0, _chunkFG3QTLTEcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
116
116
|
}
|
|
117
117
|
return transports;
|
|
118
118
|
}
|
|
119
119
|
function getEvmRpcFingerprint(rpcUrls, networks) {
|
|
120
120
|
return networks.map((network) => {
|
|
121
121
|
const id = Number(network.id);
|
|
122
|
-
return `${id}=${_nullishCoalesce(
|
|
122
|
+
return `${id}=${_nullishCoalesce(_chunkFG3QTLTEcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
123
123
|
}).join("|");
|
|
124
124
|
}
|
|
125
125
|
var cachedAdapter = null;
|
|
@@ -190,7 +190,7 @@ function ReownWalletProvider({
|
|
|
190
190
|
backendUrl,
|
|
191
191
|
children
|
|
192
192
|
}) {
|
|
193
|
-
const rpcUrls =
|
|
193
|
+
const rpcUrls = _chunkFG3QTLTEcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
194
194
|
const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
|
|
195
195
|
const overrides = _react.useMemo.call(void 0, () => {
|
|
196
196
|
if (!rpcUrls) return void 0;
|
|
@@ -202,14 +202,14 @@ function ReownWalletProvider({
|
|
|
202
202
|
return out;
|
|
203
203
|
}, [rpcUrls]);
|
|
204
204
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
205
|
-
const primed =
|
|
205
|
+
const primed = _chunkFG3QTLTEcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
206
206
|
return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
|
|
207
207
|
});
|
|
208
208
|
_react.useEffect.call(void 0, () => {
|
|
209
209
|
let active = true;
|
|
210
|
-
const primed =
|
|
210
|
+
const primed = _chunkFG3QTLTEcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
211
211
|
setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
|
|
212
|
-
|
|
212
|
+
_chunkFG3QTLTEcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
|
|
213
213
|
if (active) setState({ ready: true, chains });
|
|
214
214
|
});
|
|
215
215
|
return () => {
|
|
@@ -218,7 +218,7 @@ function ReownWalletProvider({
|
|
|
218
218
|
}, [backendUrl, overrides]);
|
|
219
219
|
_react.useEffect.call(void 0, () => {
|
|
220
220
|
setAppKitTheme(appKitReact.modal, theme);
|
|
221
|
-
return
|
|
221
|
+
return _chunkFG3QTLTEcjs.followSystemAppearance.call(void 0,
|
|
222
222
|
_optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
|
|
223
223
|
() => setAppKitTheme(appKitReact.modal, theme)
|
|
224
224
|
);
|
|
@@ -282,7 +282,7 @@ function useReownWalletSession() {
|
|
|
282
282
|
await switchChainAsync({ chainId });
|
|
283
283
|
}
|
|
284
284
|
} catch (err) {
|
|
285
|
-
if (
|
|
285
|
+
if (_chunkFG3QTLTEcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
286
286
|
throw new Error(
|
|
287
287
|
`Switch to ${chainDisplayName(chainId)} in your wallet to continue`
|
|
288
288
|
);
|
|
@@ -295,7 +295,7 @@ function useReownWalletSession() {
|
|
|
295
295
|
|
|
296
296
|
// src/DepositModalReown.tsx
|
|
297
297
|
|
|
298
|
-
var [appKitReact2, , , , solanaAdapterReact] =
|
|
298
|
+
var [appKitReact2, , , , solanaAdapterReact] = _chunkPRFNTBR3cjs.getReownDependencies.call(void 0, );
|
|
299
299
|
var { useAppKitProvider } = appKitReact2;
|
|
300
300
|
var { useAppKitConnection } = solanaAdapterReact;
|
|
301
301
|
function DepositModalWithReown(props) {
|
|
@@ -317,7 +317,7 @@ function DepositModalWithReown(props) {
|
|
|
317
317
|
reown.disconnect();
|
|
318
318
|
}, [reown.disconnect]);
|
|
319
319
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
320
|
-
|
|
320
|
+
_chunkPRFNTBR3cjs.DepositModalInner,
|
|
321
321
|
{
|
|
322
322
|
...props,
|
|
323
323
|
walletSession: reownWithSolana,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner,
|
|
3
3
|
getReownDependencies
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-P3N3HVET.mjs";
|
|
5
5
|
import "./chunk-2FOPO4N5.mjs";
|
|
6
6
|
import {
|
|
7
7
|
followSystemAppearance,
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
resolveThemeMode,
|
|
12
12
|
rpcUrlFor,
|
|
13
13
|
useStableRpcUrls
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PWRYZF65.mjs";
|
|
15
15
|
import "./chunk-YY4ZOAH5.mjs";
|
|
16
16
|
import "./chunk-PP4QE32S.mjs";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-SHRUU2UJ.mjs";
|
|
18
18
|
import {
|
|
19
19
|
SUPPORTED_CHAIN_IDS,
|
|
20
20
|
getChainName
|
|
21
21
|
} from "./chunk-E7IMWVMN.mjs";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-T4IFPD3I.mjs";
|
|
23
23
|
|
|
24
24
|
// src/DepositModalReown.tsx
|
|
25
25
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModal,
|
|
3
3
|
buildWithdrawAnalyticsSessionProperties
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-WB7GLSN7.mjs";
|
|
5
|
+
import "./chunk-PWRYZF65.mjs";
|
|
6
6
|
import "./chunk-YY4ZOAH5.mjs";
|
|
7
7
|
import "./chunk-E7IMWVMN.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-T4IFPD3I.mjs";
|
|
9
9
|
export {
|
|
10
10
|
WithdrawModal,
|
|
11
11
|
buildWithdrawAnalyticsSessionProperties
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkUMI44QNPcjs = require('./chunk-UMI44QNP.cjs');
|
|
5
|
+
require('./chunk-FG3QTLTE.cjs');
|
|
6
|
+
require('./chunk-G264OM23.cjs');
|
|
7
|
+
require('./chunk-FKJ6EJHH.cjs');
|
|
8
|
+
require('./chunk-C3RT34BC.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.WithdrawModal = _chunkUMI44QNPcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkUMI44QNPcjs.buildWithdrawAnalyticsSessionProperties;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkAZB6I4UYcjs = require('./chunk-AZB6I4UY.cjs');
|
|
4
4
|
|
|
5
5
|
// src/core/compliance-service.ts
|
|
6
6
|
function getComplianceStatus(options) {
|
|
7
|
-
return
|
|
7
|
+
return _chunkAZB6I4UYcjs.createBearerTransport.call(void 0, options)("/compliance/status");
|
|
8
8
|
}
|
|
9
9
|
function startComplianceVerification(options) {
|
|
10
|
-
return
|
|
10
|
+
return _chunkAZB6I4UYcjs.createBearerTransport.call(void 0, options)(
|
|
11
11
|
"/compliance/verification",
|
|
12
12
|
{}
|
|
13
13
|
);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkADEWTBSNcjs = require('./chunk-ADEWTBSN.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkAZB6I4UYcjs = require('./chunk-AZB6I4UY.cjs');
|
|
8
8
|
|
|
9
9
|
// src/core/onramp-service.ts
|
|
10
10
|
var RAIL_TYPES = ["BankAch", "BankFedwire", "BankSwift", "BankSepa"];
|
|
@@ -65,7 +65,7 @@ function projectBankDetails(input) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
function createOnrampService(options) {
|
|
68
|
-
const request =
|
|
68
|
+
const request = _chunkAZB6I4UYcjs.createBearerTransport.call(void 0, options);
|
|
69
69
|
return {
|
|
70
70
|
// Named fields only, never a spread: this client is Noah's, whatever a
|
|
71
71
|
// caller passes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
|
3
|
+
var _chunkC3RT34BCcjs = require('./chunk-C3RT34BC.cjs');
|
|
4
4
|
|
|
5
5
|
// src/core/bearer-transport.ts
|
|
6
6
|
var ScopedRequestError = class extends Error {
|
|
@@ -23,7 +23,7 @@ function createBearerTransport(options) {
|
|
|
23
23
|
const response = await fetch(`${base}${path}`, {
|
|
24
24
|
method: body === void 0 ? "GET" : "POST",
|
|
25
25
|
headers: {
|
|
26
|
-
...
|
|
26
|
+
..._chunkC3RT34BCcjs.serviceHeaders.call(void 0, ),
|
|
27
27
|
Authorization: `Bearer ${session.token}`
|
|
28
28
|
},
|
|
29
29
|
body: body === void 0 ? void 0 : JSON.stringify(body),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/core/version.ts
|
|
2
|
-
var MODAL_VERSION = "0.0.0-dev-
|
|
2
|
+
var MODAL_VERSION = "0.0.0-dev-20261012160128";
|
|
3
3
|
var SERVICE_HEADERS = {
|
|
4
4
|
"Content-Type": "application/json",
|
|
5
5
|
"x-deposit-modal-version": MODAL_VERSION
|