@pollar/react 0.12.1-rc.19 → 0.12.1-rc.22
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/dist/index.css +41 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +76 -52
- package/dist/index.d.ts +76 -52
- package/dist/index.js +144 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +145 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1311,7 +1311,7 @@ var PollarModalFooter = ({ language: languageProp }) => {
|
|
|
1311
1311
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: LOGO_POLLAR_WORDMARK_ON_DARK, alt: "Pollar", className: "pollar-footer-logo pollar-logo-on-dark" }),
|
|
1312
1312
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pollar-footer-version", children: [
|
|
1313
1313
|
"v",
|
|
1314
|
-
"0.12.1-rc.
|
|
1314
|
+
"0.12.1-rc.22"
|
|
1315
1315
|
] })
|
|
1316
1316
|
] });
|
|
1317
1317
|
};
|
|
@@ -3712,7 +3712,7 @@ var KYC_COPY = {
|
|
|
3712
3712
|
formHere: "The identity verification form will appear here.",
|
|
3713
3713
|
opensHere: "Identity verification will open here.",
|
|
3714
3714
|
opensInBrowser: "Verification opens in your browser. Finish the steps there, then come back here to check your status.",
|
|
3715
|
-
finished: "
|
|
3715
|
+
finished: "This moves on by itself when the verification finishes. Done already? Check your status.",
|
|
3716
3716
|
checkStatus: "Check status",
|
|
3717
3717
|
checking: "Checking verification status\u2026",
|
|
3718
3718
|
approved: "Approved",
|
|
@@ -3777,7 +3777,7 @@ var KYC_COPY = {
|
|
|
3777
3777
|
formHere: "El formulario de verificaci\xF3n de identidad aparecer\xE1 aqu\xED.",
|
|
3778
3778
|
opensHere: "La verificaci\xF3n de identidad se abrir\xE1 aqu\xED.",
|
|
3779
3779
|
opensInBrowser: "La verificaci\xF3n se abre en tu navegador. Termina los pasos all\xED y luego vuelve aqu\xED para consultar tu estado.",
|
|
3780
|
-
finished: "\
|
|
3780
|
+
finished: "Esto avanza solo cuando termine la verificaci\xF3n. \xBFYa terminaste? Consulta tu estado.",
|
|
3781
3781
|
checkStatus: "Consultar estado",
|
|
3782
3782
|
checking: "Consultando el estado de la verificaci\xF3n\u2026",
|
|
3783
3783
|
approved: "Aprobado",
|
|
@@ -3842,7 +3842,7 @@ var KYC_COPY = {
|
|
|
3842
3842
|
formHere: "O formul\xE1rio de verifica\xE7\xE3o de identidade vai aparecer aqui.",
|
|
3843
3843
|
opensHere: "A verifica\xE7\xE3o de identidade vai abrir aqui.",
|
|
3844
3844
|
opensInBrowser: "A verifica\xE7\xE3o abre no seu navegador. Conclua as etapas l\xE1 e depois volte aqui para consultar seu status.",
|
|
3845
|
-
finished: "
|
|
3845
|
+
finished: "Isto avan\xE7a sozinho quando a verifica\xE7\xE3o terminar. J\xE1 concluiu? Consulte seu status.",
|
|
3846
3846
|
checkStatus: "Consultar status",
|
|
3847
3847
|
checking: "Consultando o status da verifica\xE7\xE3o\u2026",
|
|
3848
3848
|
approved: "Aprovada",
|
|
@@ -3917,7 +3917,8 @@ function KycModalTemplate({
|
|
|
3917
3917
|
onStartAgain,
|
|
3918
3918
|
onRefresh,
|
|
3919
3919
|
onClose,
|
|
3920
|
-
language = deviceLanguage()
|
|
3920
|
+
language = deviceLanguage(),
|
|
3921
|
+
inline = false
|
|
3921
3922
|
}) {
|
|
3922
3923
|
const copy = KYC_COPY[language];
|
|
3923
3924
|
const cssVars = buildModalCssVars(theme, accentColor, styleOverrides, "hero");
|
|
@@ -3925,9 +3926,9 @@ function KycModalTemplate({
|
|
|
3925
3926
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3926
3927
|
"div",
|
|
3927
3928
|
{
|
|
3928
|
-
className: `pollar-modal-card pollar-kyc-modal ${step === "verifying" ? "pollar-kyc-modal--verifying" : ""}`,
|
|
3929
|
-
role: "dialog",
|
|
3930
|
-
"aria-modal":
|
|
3929
|
+
className: `pollar-modal-card pollar-kyc-modal ${step === "verifying" ? "pollar-kyc-modal--verifying" : ""} ${inline ? "pollar-modal-card--inline" : ""}`,
|
|
3930
|
+
role: inline ? "region" : "dialog",
|
|
3931
|
+
"aria-modal": inline ? void 0 : true,
|
|
3931
3932
|
"aria-label": copy.title,
|
|
3932
3933
|
style: cssVars,
|
|
3933
3934
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -3975,7 +3976,7 @@ function KycModalTemplate({
|
|
|
3975
3976
|
)
|
|
3976
3977
|
}
|
|
3977
3978
|
),
|
|
3978
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": copy.close, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
|
|
3979
|
+
!inline && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": copy.close, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
|
|
3979
3980
|
] })
|
|
3980
3981
|
] }),
|
|
3981
3982
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pollar-kyc-error", role: "alert", children: error }),
|
|
@@ -4021,7 +4022,7 @@ function KycModalTemplate({
|
|
|
4021
4022
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-kyc-footer", children: [
|
|
4022
4023
|
/* @__PURE__ */ jsxRuntime.jsx("p", { children: copy.finished }),
|
|
4023
4024
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-modal-actions", children: [
|
|
4024
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onClose, children: copy.close }),
|
|
4025
|
+
!inline && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onClose, children: copy.close }),
|
|
4025
4026
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-primary", onClick: onDoneVerifying, children: copy.checkStatus })
|
|
4026
4027
|
] })
|
|
4027
4028
|
] })
|
|
@@ -4053,7 +4054,7 @@ function KycModalTemplate({
|
|
|
4053
4054
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-modal-actions", children: [
|
|
4054
4055
|
kycStatus === "expired" && onStartAgain && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onStartAgain, disabled: busy, children: copy.startAgain }),
|
|
4055
4056
|
kycStatus !== "approved" && kycStatus !== "rejected" && kycStatus !== "expired" && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onDoneVerifying, children: copy.checkAgain }),
|
|
4056
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-primary", onClick: onClose, children: copy.close })
|
|
4057
|
+
!inline && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-primary", onClick: onClose, children: copy.close })
|
|
4057
4058
|
] })
|
|
4058
4059
|
] }),
|
|
4059
4060
|
/* @__PURE__ */ jsxRuntime.jsx(PollarModalFooter, { language })
|
|
@@ -4061,6 +4062,17 @@ function KycModalTemplate({
|
|
|
4061
4062
|
}
|
|
4062
4063
|
);
|
|
4063
4064
|
}
|
|
4065
|
+
function ModalFrame({
|
|
4066
|
+
inline,
|
|
4067
|
+
overlayStyle,
|
|
4068
|
+
onClose,
|
|
4069
|
+
children
|
|
4070
|
+
}) {
|
|
4071
|
+
if (inline) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pollar-inline-frame", children });
|
|
4072
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { ...overlayStyle && { style: overlayStyle }, onClick: onClose, children });
|
|
4073
|
+
}
|
|
4074
|
+
var WATCH_INTERVAL_MS = 4e3;
|
|
4075
|
+
var WATCH_WINDOW_MS = 30 * 6e4;
|
|
4064
4076
|
function newIdempotencyKey() {
|
|
4065
4077
|
const c = globalThis.crypto;
|
|
4066
4078
|
if (c && typeof c.randomUUID === "function") return c.randomUUID();
|
|
@@ -4074,7 +4086,8 @@ function KycModal({
|
|
|
4074
4086
|
corridorId,
|
|
4075
4087
|
cardProviderId,
|
|
4076
4088
|
providerId,
|
|
4077
|
-
language: languageProp
|
|
4089
|
+
language: languageProp,
|
|
4090
|
+
inline = false
|
|
4078
4091
|
}) {
|
|
4079
4092
|
const { getClient, styles } = usePollar();
|
|
4080
4093
|
const language = useModalLanguage(languageProp);
|
|
@@ -4182,6 +4195,30 @@ function KycModal({
|
|
|
4182
4195
|
void handleSelectProvider({ id: providerId, name: copy.title, flow: "iframe", levels: [level] }, false);
|
|
4183
4196
|
});
|
|
4184
4197
|
}, [loadProviders, providerId]);
|
|
4198
|
+
const finishRef = react.useRef(finishWith);
|
|
4199
|
+
finishRef.current = finishWith;
|
|
4200
|
+
react.useEffect(() => {
|
|
4201
|
+
if (step !== "verifying" || !selectedProvider) return;
|
|
4202
|
+
const optionId = selectedProvider.id;
|
|
4203
|
+
const until = Date.now() + WATCH_WINDOW_MS;
|
|
4204
|
+
let stopped = false;
|
|
4205
|
+
let timer;
|
|
4206
|
+
const tick = async () => {
|
|
4207
|
+
if (stopped || Date.now() > until) return;
|
|
4208
|
+
const read = await readStatus(optionId).catch(() => null);
|
|
4209
|
+
if (stopped) return;
|
|
4210
|
+
if (read && core.isKycSettled(read)) {
|
|
4211
|
+
finishRef.current(read);
|
|
4212
|
+
return;
|
|
4213
|
+
}
|
|
4214
|
+
timer = setTimeout(() => void tick(), WATCH_INTERVAL_MS);
|
|
4215
|
+
};
|
|
4216
|
+
timer = setTimeout(() => void tick(), WATCH_INTERVAL_MS);
|
|
4217
|
+
return () => {
|
|
4218
|
+
stopped = true;
|
|
4219
|
+
if (timer) clearTimeout(timer);
|
|
4220
|
+
};
|
|
4221
|
+
}, [step, selectedProvider]);
|
|
4185
4222
|
async function handleDoneVerifying() {
|
|
4186
4223
|
if (!selectedProvider) return;
|
|
4187
4224
|
setError(null);
|
|
@@ -4208,7 +4245,7 @@ function KycModal({
|
|
|
4208
4245
|
if (selectedProvider) void handleSelectProvider(selectedProvider);
|
|
4209
4246
|
else setStep("select_provider");
|
|
4210
4247
|
}
|
|
4211
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4248
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModalFrame, { inline, overlayStyle, onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4212
4249
|
KycModalTemplate,
|
|
4213
4250
|
{
|
|
4214
4251
|
theme,
|
|
@@ -4230,7 +4267,8 @@ function KycModal({
|
|
|
4230
4267
|
onStartAgain: handleStartAgain,
|
|
4231
4268
|
onRefresh: () => void loadProviders(),
|
|
4232
4269
|
onClose,
|
|
4233
|
-
language
|
|
4270
|
+
language,
|
|
4271
|
+
inline
|
|
4234
4272
|
}
|
|
4235
4273
|
) });
|
|
4236
4274
|
}
|
|
@@ -4311,7 +4349,8 @@ function RequirementFormModal({
|
|
|
4311
4349
|
progress,
|
|
4312
4350
|
onClose,
|
|
4313
4351
|
onSubmitted,
|
|
4314
|
-
language: languageProp
|
|
4352
|
+
language: languageProp,
|
|
4353
|
+
inline = false
|
|
4315
4354
|
}) {
|
|
4316
4355
|
const { getClient, styles } = usePollar();
|
|
4317
4356
|
const client = getClient();
|
|
@@ -4377,12 +4416,12 @@ function RequirementFormModal({
|
|
|
4377
4416
|
if (mounted.current) setSubmitting(false);
|
|
4378
4417
|
}
|
|
4379
4418
|
}
|
|
4380
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4419
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModalFrame, { inline, overlayStyle, onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4381
4420
|
"div",
|
|
4382
4421
|
{
|
|
4383
|
-
className:
|
|
4384
|
-
role: "dialog",
|
|
4385
|
-
"aria-modal":
|
|
4422
|
+
className: `pollar-modal-card pollar-form-modal ${inline ? "pollar-modal-card--inline" : ""}`,
|
|
4423
|
+
role: inline ? "region" : "dialog",
|
|
4424
|
+
"aria-modal": inline ? void 0 : true,
|
|
4386
4425
|
"aria-label": form?.name ?? copy.title,
|
|
4387
4426
|
style: cssVars,
|
|
4388
4427
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -4392,7 +4431,7 @@ function RequirementFormModal({
|
|
|
4392
4431
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "pollar-modal-title", children: form?.name ?? copy.title }),
|
|
4393
4432
|
progress && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pollar-form-subtitle", children: copy.step.replace("{n}", String(progress.position)).replace("{total}", String(progress.total)) })
|
|
4394
4433
|
] }),
|
|
4395
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": copy.close, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
|
|
4434
|
+
!inline && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": copy.close, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
|
|
4396
4435
|
] }),
|
|
4397
4436
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pollar-form-error", role: "alert", children: error }),
|
|
4398
4437
|
!form && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-loading-block", children: [
|
|
@@ -4451,7 +4490,7 @@ function RequirementFormModal({
|
|
|
4451
4490
|
] }, field.key);
|
|
4452
4491
|
}),
|
|
4453
4492
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-modal-actions", children: [
|
|
4454
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onClose, disabled: submitting, children: copy.close }),
|
|
4493
|
+
!inline && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onClose, disabled: submitting, children: copy.close }),
|
|
4455
4494
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", className: "pollar-btn-primary", disabled: submitting, children: submitting ? copy.submitting : copy.submit })
|
|
4456
4495
|
] })
|
|
4457
4496
|
]
|
|
@@ -4462,7 +4501,7 @@ function RequirementFormModal({
|
|
|
4462
4501
|
}
|
|
4463
4502
|
) });
|
|
4464
4503
|
}
|
|
4465
|
-
function AppKycFlow({ onClose, country, level, onApproved }) {
|
|
4504
|
+
function AppKycFlow({ onClose, country, level, onApproved, inline = false }) {
|
|
4466
4505
|
const { getClient } = usePollar();
|
|
4467
4506
|
const client = getClient();
|
|
4468
4507
|
const [state, setState] = react.useState({ kind: "loading" });
|
|
@@ -4498,6 +4537,7 @@ function AppKycFlow({ onClose, country, level, onApproved }) {
|
|
|
4498
4537
|
firstRead.current = false;
|
|
4499
4538
|
if (requirements.next) return setState({ kind: "step", step: requirements.next });
|
|
4500
4539
|
onApproved?.();
|
|
4540
|
+
if (inline) return setState({ kind: "complete" });
|
|
4501
4541
|
const providerId = first ? await approvedOption(requirements.steps) : null;
|
|
4502
4542
|
if (!mounted.current) return;
|
|
4503
4543
|
if (providerId) setState({ kind: "done", providerId });
|
|
@@ -4511,12 +4551,13 @@ function AppKycFlow({ onClose, country, level, onApproved }) {
|
|
|
4511
4551
|
react.useEffect(() => {
|
|
4512
4552
|
void load();
|
|
4513
4553
|
}, [load]);
|
|
4514
|
-
if (state.kind === "loading") return null;
|
|
4554
|
+
if (state.kind === "loading" || state.kind === "complete") return null;
|
|
4515
4555
|
if (state.kind === "options") {
|
|
4516
4556
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4517
4557
|
KycModal,
|
|
4518
4558
|
{
|
|
4519
4559
|
onClose,
|
|
4560
|
+
inline,
|
|
4520
4561
|
...country !== void 0 && { country },
|
|
4521
4562
|
...level !== void 0 && { level },
|
|
4522
4563
|
...onApproved !== void 0 && { onApproved }
|
|
@@ -4524,7 +4565,7 @@ function AppKycFlow({ onClose, country, level, onApproved }) {
|
|
|
4524
4565
|
);
|
|
4525
4566
|
}
|
|
4526
4567
|
if (state.kind === "done") {
|
|
4527
|
-
return /* @__PURE__ */ jsxRuntime.jsx(KycModal, { onClose, providerId: state.providerId, ...country !== void 0 && { country } });
|
|
4568
|
+
return /* @__PURE__ */ jsxRuntime.jsx(KycModal, { onClose, inline, providerId: state.providerId, ...country !== void 0 && { country } });
|
|
4528
4569
|
}
|
|
4529
4570
|
const { step } = state;
|
|
4530
4571
|
const progress = { position: step.completed + 1, total: step.total };
|
|
@@ -4534,6 +4575,7 @@ function AppKycFlow({ onClose, country, level, onApproved }) {
|
|
|
4534
4575
|
{
|
|
4535
4576
|
formId: step.optionId,
|
|
4536
4577
|
progress,
|
|
4578
|
+
inline,
|
|
4537
4579
|
onClose,
|
|
4538
4580
|
onSubmitted: () => void load()
|
|
4539
4581
|
},
|
|
@@ -4544,10 +4586,12 @@ function AppKycFlow({ onClose, country, level, onApproved }) {
|
|
|
4544
4586
|
KycModal,
|
|
4545
4587
|
{
|
|
4546
4588
|
providerId: step.optionId,
|
|
4589
|
+
inline,
|
|
4547
4590
|
...country !== void 0 && { country },
|
|
4548
4591
|
...level !== void 0 && { level },
|
|
4549
4592
|
onApproved: () => {
|
|
4550
4593
|
kycStepDone.current = true;
|
|
4594
|
+
if (inline) void load();
|
|
4551
4595
|
},
|
|
4552
4596
|
onClose: () => {
|
|
4553
4597
|
if (kycStepDone.current) void load();
|
|
@@ -6086,6 +6130,7 @@ function RampWidgetTemplate({
|
|
|
6086
6130
|
onRequote,
|
|
6087
6131
|
onSetUpRecovery,
|
|
6088
6132
|
recoveryMissing = null,
|
|
6133
|
+
support = null,
|
|
6089
6134
|
checkingPayment = false,
|
|
6090
6135
|
onCheckPayment,
|
|
6091
6136
|
pollTrouble = false,
|
|
@@ -6567,7 +6612,7 @@ function RampWidgetTemplate({
|
|
|
6567
6612
|
step === "status" && order && view && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-ramp-payment", children: [
|
|
6568
6613
|
/* @__PURE__ */ jsxRuntime.jsx("ol", { className: "pollar-ramp-legs", "aria-label": copy.progress, children: order.legs.map((leg) => {
|
|
6569
6614
|
const status = core.rampLegStatus(leg);
|
|
6570
|
-
const note = core.rampLegNote(leg, language);
|
|
6615
|
+
const note = (status === "failed" && leg.failure ? core.rampFailureReason(leg.failure, language) : null) ?? core.rampLegNote(leg, language);
|
|
6571
6616
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "pollar-ramp-leg", "data-status": status, children: [
|
|
6572
6617
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pollar-ramp-leg-dot", "aria-hidden": true }),
|
|
6573
6618
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pollar-ramp-leg-title", children: core.rampLegTitle(leg, language) }),
|
|
@@ -6598,6 +6643,7 @@ function RampWidgetTemplate({
|
|
|
6598
6643
|
order.failure && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-ramp-payment-field", children: [
|
|
6599
6644
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pollar-ramp-payment-label", children: copy.whatToDo }),
|
|
6600
6645
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "pollar-ramp-payment-note", children: core.rampOrderResolutionText(order, language) }),
|
|
6646
|
+
core.rampFailureNeedsSupport(order.failure) && /* @__PURE__ */ jsxRuntime.jsx(SupportContact, { support, orderId: order.id, language }),
|
|
6601
6647
|
stopped && !settled && waitsOnRecovery && recoveryMissing !== false && onSetUpRecovery && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onSetUpRecovery, children: copy.setUpRecovery }),
|
|
6602
6648
|
stopped && !settled && waitsOnRecovery && recoveryMissing === true && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pollar-ramp-payment-note", children: copy.recoveryNote }),
|
|
6603
6649
|
stopped && !settled && asksNewQuote && onRequote && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-btn-primary", onClick: onRequote, children: copy.newQuote }),
|
|
@@ -6701,6 +6747,26 @@ function RampWidgetTemplate({
|
|
|
6701
6747
|
/* @__PURE__ */ jsxRuntime.jsx(PollarModalFooter, {})
|
|
6702
6748
|
] });
|
|
6703
6749
|
}
|
|
6750
|
+
function SupportContact({
|
|
6751
|
+
support,
|
|
6752
|
+
orderId,
|
|
6753
|
+
language
|
|
6754
|
+
}) {
|
|
6755
|
+
const copy = core.rampSupportCopy(language);
|
|
6756
|
+
const url = support?.url && /^https:\/\//i.test(support.url) ? support.url : null;
|
|
6757
|
+
const email = support?.email && /^[^\s@]+@[^\s@]+$/.test(support.email) ? support.email : null;
|
|
6758
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-ramp-support", children: [
|
|
6759
|
+
(url || email) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-ramp-support-links", children: [
|
|
6760
|
+
url && /* @__PURE__ */ jsxRuntime.jsx("a", { className: "pollar-btn-secondary", href: url, target: "_blank", rel: "noopener noreferrer", children: copy.action }),
|
|
6761
|
+
email && /* @__PURE__ */ jsxRuntime.jsx("a", { className: "pollar-ramp-support-email", href: `mailto:${email}?subject=${encodeURIComponent(orderId)}`, children: email })
|
|
6762
|
+
] }),
|
|
6763
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-ramp-support-order", children: [
|
|
6764
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: copy.orderId }),
|
|
6765
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: orderId }),
|
|
6766
|
+
/* @__PURE__ */ jsxRuntime.jsx(CopyButton, { value: orderId, language })
|
|
6767
|
+
] })
|
|
6768
|
+
] });
|
|
6769
|
+
}
|
|
6704
6770
|
|
|
6705
6771
|
// src/components/registry-check-modal/registry-copy.ts
|
|
6706
6772
|
var REGISTRY_COPY = {
|
|
@@ -7952,6 +8018,7 @@ function RampWidget({ onClose, language: languageProp, initial }) {
|
|
|
7952
8018
|
onRequote: () => void handleRequote(),
|
|
7953
8019
|
onSetUpRecovery: openRecoveryModal,
|
|
7954
8020
|
recoveryMissing: recovery === null ? null : recoveryLocked,
|
|
8021
|
+
support: client.getSupportContact(),
|
|
7955
8022
|
pollTrouble,
|
|
7956
8023
|
checkingPayment: paymentCheckUntil !== null,
|
|
7957
8024
|
onCheckPayment: () => void handleCheckPayment(),
|
|
@@ -9721,6 +9788,7 @@ function SwapModalTemplate({
|
|
|
9721
9788
|
usdcAcross = false,
|
|
9722
9789
|
settlement = null,
|
|
9723
9790
|
confirmation = null,
|
|
9791
|
+
review = null,
|
|
9724
9792
|
network,
|
|
9725
9793
|
provider,
|
|
9726
9794
|
providers,
|
|
@@ -9773,7 +9841,7 @@ function SwapModalTemplate({
|
|
|
9773
9841
|
}
|
|
9774
9842
|
] : []
|
|
9775
9843
|
] : [];
|
|
9776
|
-
const txReview = step === "tx" ? txStatusReview({ transaction, explorerUrl, confirmation, network, extraRows: settlementRows, language }) : null;
|
|
9844
|
+
const txReview = step === "tx" ? txStatusReview({ transaction, review, explorerUrl, confirmation, network, extraRows: settlementRows, language }) : null;
|
|
9777
9845
|
const [customOpen, setCustomOpen] = react.useState(false);
|
|
9778
9846
|
const [customCode, setCustomCode] = react.useState("");
|
|
9779
9847
|
const [customIssuer, setCustomIssuer] = react.useState("");
|
|
@@ -10115,6 +10183,7 @@ function SwapModalTemplate({
|
|
|
10115
10183
|
onRetry,
|
|
10116
10184
|
onDone,
|
|
10117
10185
|
confirmation,
|
|
10186
|
+
review,
|
|
10118
10187
|
network,
|
|
10119
10188
|
extraRows: settlementRows,
|
|
10120
10189
|
...settlement ? { outcomeNote: { text: settlement.text, failed: settlement.kind === "failed" } } : {}
|
|
@@ -10214,6 +10283,7 @@ function SwapModal({ onClose, initial }) {
|
|
|
10214
10283
|
const [formError, setFormError] = react.useState("");
|
|
10215
10284
|
const [showXdr, setShowXdr] = react.useState(false);
|
|
10216
10285
|
const [copied, setCopied] = react.useState(false);
|
|
10286
|
+
const [sentSolana, setSentSolana] = react.useState(null);
|
|
10217
10287
|
const copyTimerRef = react.useRef(null);
|
|
10218
10288
|
const slippageBps = 50;
|
|
10219
10289
|
react.useEffect(() => {
|
|
@@ -10535,6 +10605,34 @@ function SwapModal({ onClose, initial }) {
|
|
|
10535
10605
|
const buildData = "buildData" in transaction ? transaction.buildData : null;
|
|
10536
10606
|
const explorerNetwork = buildData?.summary.network?.toLowerCase().includes("testnet") ? "testnet" : buildData ? "public" : network === "testnet" ? "testnet" : "public";
|
|
10537
10607
|
const explorerUrl = !hash ? null : chain === "SOLANA" ? `https://solscan.io/tx/${hash}${network === "testnet" ? "?cluster=devnet" : ""}` : `https://stellar.expert/explorer/${explorerNetwork}/tx/${hash}`;
|
|
10608
|
+
const solanaReview = react.useMemo(() => {
|
|
10609
|
+
if (!sentSolana) return null;
|
|
10610
|
+
const { quote: sent, sell, buy } = sentSolana;
|
|
10611
|
+
const toward = sent.destinationChain && sent.destinationChain !== "SOLANA" ? sent.destinationChain : void 0;
|
|
10612
|
+
return reviewFromRequest(
|
|
10613
|
+
{
|
|
10614
|
+
chain: "SOLANA",
|
|
10615
|
+
network,
|
|
10616
|
+
operation: "swap",
|
|
10617
|
+
details: {
|
|
10618
|
+
provider: sent.provider,
|
|
10619
|
+
inputMint: sent.inputMint,
|
|
10620
|
+
outputMint: sent.outputMint,
|
|
10621
|
+
inAmount: sent.inAmount,
|
|
10622
|
+
outAmount: sent.outAmount,
|
|
10623
|
+
minOut: sent.minOut,
|
|
10624
|
+
...toward && { destinationChain: toward },
|
|
10625
|
+
inputSymbol: sell.code,
|
|
10626
|
+
outputSymbol: buy.code,
|
|
10627
|
+
...sell.decimals !== void 0 && { inputDecimals: sell.decimals },
|
|
10628
|
+
...(sent.outputDecimals ?? buy.decimals) !== void 0 && { outputDecimals: sent.outputDecimals ?? buy.decimals }
|
|
10629
|
+
},
|
|
10630
|
+
fallbackTitle: CONFIRM_COPY[language].operations.swap ?? copy.title
|
|
10631
|
+
},
|
|
10632
|
+
TX_REVIEW_COPY[language]
|
|
10633
|
+
);
|
|
10634
|
+
}, [sentSolana, network, language, copy.title]);
|
|
10635
|
+
const stepReview = solanaReview && !buildData && !confirmation ? solanaReview : null;
|
|
10538
10636
|
const settlementView = (() => {
|
|
10539
10637
|
if (!settlement || transaction.step !== "success") return null;
|
|
10540
10638
|
const chainName = settlement.chain === "POLYGON" ? "Polygon" : "Solana";
|
|
@@ -10587,6 +10685,7 @@ function SwapModal({ onClose, initial }) {
|
|
|
10587
10685
|
const key = newSwapKey();
|
|
10588
10686
|
const toward = solanaQuote.destinationChain;
|
|
10589
10687
|
setSettlement(toward && toward !== "SOLANA" ? { key, chain: toward, value: null } : null);
|
|
10688
|
+
setSentSolana({ quote: solanaQuote, sell: selectedSell, buy: selectedBuy });
|
|
10590
10689
|
setStep("tx");
|
|
10591
10690
|
await swapSolana(solanaQuote, { slippageBps, idempotencyKey: key });
|
|
10592
10691
|
return;
|
|
@@ -10595,6 +10694,7 @@ function SwapModal({ onClose, initial }) {
|
|
|
10595
10694
|
setFormError(copy.noRouteForPair);
|
|
10596
10695
|
return;
|
|
10597
10696
|
}
|
|
10697
|
+
setSentSolana(null);
|
|
10598
10698
|
setStep("tx");
|
|
10599
10699
|
await swap(quote);
|
|
10600
10700
|
}
|
|
@@ -10605,6 +10705,7 @@ function SwapModal({ onClose, initial }) {
|
|
|
10605
10705
|
const key = newSwapKey();
|
|
10606
10706
|
const toward = solanaQuote.destinationChain;
|
|
10607
10707
|
setSettlement(toward && toward !== "SOLANA" ? { key, chain: toward, value: null } : null);
|
|
10708
|
+
if (selectedSell && selectedBuy) setSentSolana({ quote: solanaQuote, sell: selectedSell, buy: selectedBuy });
|
|
10608
10709
|
await swapSolana(solanaQuote, { slippageBps, idempotencyKey: key });
|
|
10609
10710
|
return;
|
|
10610
10711
|
}
|
|
@@ -10634,6 +10735,7 @@ function SwapModal({ onClose, initial }) {
|
|
|
10634
10735
|
}
|
|
10635
10736
|
function handleBack() {
|
|
10636
10737
|
setSettlement(null);
|
|
10738
|
+
setSentSolana(null);
|
|
10637
10739
|
setStep("form");
|
|
10638
10740
|
setShowXdr(false);
|
|
10639
10741
|
setCopied(false);
|
|
@@ -10658,6 +10760,7 @@ function SwapModal({ onClose, initial }) {
|
|
|
10658
10760
|
usdcAcross,
|
|
10659
10761
|
settlement: settlementView,
|
|
10660
10762
|
confirmation,
|
|
10763
|
+
review: stepReview,
|
|
10661
10764
|
network,
|
|
10662
10765
|
provider,
|
|
10663
10766
|
providers,
|
|
@@ -17330,6 +17433,20 @@ function WalletButton() {
|
|
|
17330
17433
|
}
|
|
17331
17434
|
);
|
|
17332
17435
|
}
|
|
17436
|
+
var stay = () => {
|
|
17437
|
+
};
|
|
17438
|
+
function KycFlow({ onApproved, country, level }) {
|
|
17439
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17440
|
+
AppKycFlow,
|
|
17441
|
+
{
|
|
17442
|
+
inline: true,
|
|
17443
|
+
onClose: stay,
|
|
17444
|
+
...onApproved !== void 0 && { onApproved },
|
|
17445
|
+
...country !== void 0 && { country },
|
|
17446
|
+
...level !== void 0 && { level }
|
|
17447
|
+
}
|
|
17448
|
+
);
|
|
17449
|
+
}
|
|
17333
17450
|
|
|
17334
17451
|
exports.BridgeModal = BridgeModal;
|
|
17335
17452
|
exports.BridgeModalTemplate = BridgeModalTemplate;
|
|
@@ -17344,6 +17461,7 @@ exports.DistributionRulesModalTemplate = DistributionRulesModalTemplate;
|
|
|
17344
17461
|
exports.EarnModal = EarnModal;
|
|
17345
17462
|
exports.EnabledAssetsModal = EnabledAssetsModal;
|
|
17346
17463
|
exports.EnabledAssetsModalTemplate = EnabledAssetsModalTemplate;
|
|
17464
|
+
exports.KycFlow = KycFlow;
|
|
17347
17465
|
exports.KycModal = KycModal;
|
|
17348
17466
|
exports.KycModalTemplate = KycModalTemplate;
|
|
17349
17467
|
exports.KycStatus = KycStatus;
|