@kimafinance/kima-transaction-widget 1.5.29 → 1.5.30

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.cjs CHANGED
@@ -12351,6 +12351,7 @@ var FiatWidget = ({ submitCallback }) => {
12351
12351
  const sourceChain = (0, import_react_redux53.useSelector)(selectSourceChain);
12352
12352
  const { transactionValues } = (0, import_react_redux53.useSelector)(selectServiceFee);
12353
12353
  const ccTransactionIdSeedRef = (0, import_react66.useRef)((0, import_uuid.v4)());
12354
+ const identificationUuidRef = (0, import_react66.useRef)((0, import_uuid.v4)());
12354
12355
  const ccTransactionSubmittedRef = (0, import_react66.useRef)(false);
12355
12356
  const { data: envOptions, isLoading: isEnvLoading } = useGetEnvOptions({
12356
12357
  kimaBackendUrl: backendUrl
@@ -12372,13 +12373,32 @@ var FiatWidget = ({ submitCallback }) => {
12372
12373
  );
12373
12374
  const [isLoading, setIsLoading] = (0, import_react66.useState)(true);
12374
12375
  const baseUrl = (0, import_react66.useMemo)(
12375
- () => `https://widget${networkOption === "testnet" /* testnet */ ? "-sandbox" : ""}.depa.finance`,
12376
+ () => networkOption === "testnet" /* testnet */ ? "https://widget2-sandbox.depa.wtf" : "https://widget.depa.finance",
12376
12377
  [networkOption]
12377
12378
  );
12378
12379
  const scenario = (0, import_react66.useMemo)(
12379
12380
  () => sourceChain.shortName === "CC" ? "direct_card_payment" : "direct_bank_payment",
12380
12381
  [sourceChain]
12381
12382
  );
12383
+ const iframeSrc = (0, import_react66.useMemo)(() => {
12384
+ const searchParams = new URLSearchParams({
12385
+ partner: partnerId ?? "",
12386
+ amount: allowanceAmount,
12387
+ currency: sourceCurrency,
12388
+ trx_uuid: data?.transactionId ?? "",
12389
+ identification_uuid: identificationUuidRef.current,
12390
+ scenario,
12391
+ postmessage: "true"
12392
+ });
12393
+ return `${baseUrl}/widgets/kyc?${searchParams.toString()}`;
12394
+ }, [
12395
+ allowanceAmount,
12396
+ baseUrl,
12397
+ data?.transactionId,
12398
+ partnerId,
12399
+ scenario,
12400
+ sourceCurrency
12401
+ ]);
12382
12402
  (0, import_react66.useEffect)(() => {
12383
12403
  const handleMessage = (event) => {
12384
12404
  if (event.origin !== baseUrl) {
@@ -12418,7 +12438,7 @@ var FiatWidget = ({ submitCallback }) => {
12418
12438
  {
12419
12439
  width: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
12420
12440
  height: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
12421
- src: `${baseUrl}/widgets/kyc?partner=${partnerId}&amount=${allowanceAmount}&currency=${sourceCurrency}&trx_uuid=${data?.transactionId}&scenario=${scenario}&postmessage=true`,
12441
+ src: iframeSrc,
12422
12442
  loading: "lazy",
12423
12443
  title: "Credit Card Widget",
12424
12444
  allow: "camera; clipboard-write",