UNPKG

@brahmafi/cards-sdk

Version:

Official SDK for integrating Swype payment and credit services

1,166 lines (1,146 loc) 439 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var index_exports = {}; __export(index_exports, { KycModal: () => KycModal, ManageCardModal: () => ManageCardModal, createCardAction: () => createCardAction, delegateAmount: () => delegateAmount, delegateCard: () => delegateCard, generateAuthSign: () => generateAuthSign, getEulerCardPreview: () => getEulerCardPreview, getEulerHealthFactor: () => getEulerHealthFactor, getEulerTotalAsset: () => getEulerTotalAsset, getPendingTransactionBalance: () => getPendingTransactionBalance, initializeSwypeSDK: () => initializeSwypeSDK, updateCardProvider: () => updateCardProvider, useCardData: () => useCardData, useCreditData: () => useCreditData, useGetTransactions: () => useGetTransactions, useKycStore: () => useKycStore }); module.exports = __toCommonJS(index_exports); // src/widgets/kyc/KycModal.tsx var import_react3 = require("react"); // src/components/Modal.tsx var import_framer_motion = require("framer-motion"); // src/components/SDKWrapper.tsx var import_jsx_runtime = require("react/jsx-runtime"); function SDKWrapper({ children, className = "" }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `swype-sdk-root ${className}`, children }); } // src/components/Modal.tsx var import_jsx_runtime2 = require("react/jsx-runtime"); function Modal({ title, children, onClose, onOutsideClick, overlayOpacity = "bg-black bg-opacity-100", topDistance = "pt-[100px]", open = true, padding // Accept the padding prop }) { const childrenPadding = padding ?? "px-4 sm:px-6 py-4 sm:py-6"; return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SDKWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_framer_motion.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_framer_motion.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 }, className: `fixed inset-0 z-50 flex items-start justify-center ${topDistance} ${overlayOpacity} px-4 sm:px-0`, onClick: onOutsideClick, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)( import_framer_motion.motion.div, { initial: { scale: 0.95, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.95, opacity: 0 }, transition: { duration: 0.2 }, className: "relative max-h-[90vh] w-full max-w-lg p-0 flex flex-col", onClick: (e) => e.stopPropagation(), children: [ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center justify-between pb-[14px]", children: [ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "text-base sm:text-lg font-semibold text-[#E6E8ED]", children: title }), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( "button", { onClick: onClose, "aria-label": "Close modal", className: "text-gray-400 hover:text-white text-xl sm:text-2xl px-2", children: "\xD7" } ) ] }), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( "div", { style: { maxHeight: "70vh" }, className: "border border-[#292930] rounded-[9px] bg-[#0D0D10] shadow-lg flex flex-col overflow-y-auto [&::-webkit-scrollbar]:w-1.5 sm:[&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-[#292930] [&::-webkit-scrollbar-track]:border-0 [&::-webkit-scrollbar-thumb]:bg-[#808080] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:border-0", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${childrenPadding} relative`, children }) } ) ] } ) } ) }) }); } // src/stores/cardStatusStore.ts var import_zustand4 = require("zustand"); // src/stores/sdkConfigStore.ts var import_zustand3 = require("zustand"); // src/api/api.ts var import_axios2 = __toESM(require("axios")); // src/api/httpClient.ts var import_axios = __toESM(require("axios")); // src/api/auth.ts var authState = { signature: null, deadline: null }; function createCardOperationTypedData(eoa, cardId, timestamp, action, chainId) { return { types: { EIP712Domain: [ { name: "name", type: "string" }, { name: "version", type: "string" }, { name: "chainId", type: "uint256" } ], CardOperation: [ { name: "eoa", type: "address" }, { name: "cardId", type: "string" }, { name: "action", type: "string" }, { name: "timestamp", type: "uint256" } ] }, primaryType: "CardOperation", domain: { name: "BrahmaCards", version: "1", chainId }, message: { eoa, cardId, action, timestamp } }; } var createLoginTypedData = (eoaAddress, chainId, timestamp) => ({ types: { EIP712Domain: [ { name: "name", type: "string" }, { name: "version", type: "string" }, { name: "chainId", type: "uint256" } ], LoginRequest: [ { name: "eoa", type: "address" }, { name: "message", type: "string" }, { name: "timestamp", type: "uint256" }, { name: "action", type: "string" } ] }, primaryType: "LoginRequest", domain: { name: "BrahmaCards", version: "1", chainId }, message: { eoa: eoaAddress, message: "I'm a BrahmaCards user", timestamp, action: "login" } }); var generateCardOperationSign = async (eoa, chainId, cardId, action, timestamp, signTypedData) => { const typedData = createCardOperationTypedData( eoa, cardId, timestamp, action, chainId ); const signature = await signTypedData(typedData); console.log({ typedData, signature, type: typeof signature }); return { signature }; }; var generateAuthSignature = async (eoaAddress, chainId, signTypedData) => { const deadline = Math.floor(Date.now() / 1e3); const typedData = createLoginTypedData(eoaAddress, chainId, deadline); const signature = await signTypedData(typedData); console.log({ typedData, deadline, signature, type: typeof signature }); return { signature, deadline }; }; var generateAuthSign = async (eoaAddress, chainId, signTypedData) => { return generateAuthSignature(eoaAddress, chainId, signTypedData); }; async function initializeAuth(eoaAddress, authSignature) { try { authState = { signature: authSignature.signature, deadline: authSignature.deadline }; console.log("SwypeSDK auth initialized"); } catch (error) { console.error("Failed to initialize SwypeSDK auth:", error); throw error; } } var ensureValidAuth = async () => { const { eoaAddress, isInitialized } = useSDKConfigStore.getState(); if (!isInitialized || !eoaAddress) { throw new Error("SwypeSDK not initialized. Call initializeSwypeSDK first."); } const currentTime = Math.floor(Date.now() / 1e3); if (!authState.signature || !authState.deadline) { throw new Error( "Authentication expired. Please re-initialize the SDK with a new signature." ); } }; var getAuthState = () => { return { ...authState }; }; var clearAuth = () => { authState = { signature: null, deadline: null }; }; // src/api/httpClient.ts function getApiClient() { const { eoaAddress, apiKey, chainID, baseUrl, apiPath, isInitialized } = useSDKConfigStore.getState(); if (!isInitialized || !apiKey) { throw new Error("SwypeSDK not initialized. Call initializeSwypeSDK first."); } const authState2 = getAuthState(); if (!authState2.signature || !authState2.deadline) { throw new Error( "SwypeSDK auth not ready. Authentication signature missing." ); } const fullBaseURL = `${baseUrl}${apiPath}`; const authJson = { timestamp: authState2.deadline, sig: authState2.signature, userAddr: eoaAddress, chainID }; const encodedAuth = btoa(JSON.stringify(authJson)); const client = import_axios.default.create({ baseURL: fullBaseURL, headers: { "Content-Type": "application/json", "x-api-key": apiKey, Authorization: `Bearer ${encodedAuth}`, "ngrok-skip-browser-warning": "true" // Skip ngrok browser warning } }); client.interceptors.request.use( async (config) => { await ensureValidAuth(); const freshAuthState = getAuthState(); if (freshAuthState.signature && freshAuthState.deadline) { config.headers.set("Authorization", `Bearer ${encodedAuth}`); config.headers.set("x-api-key", apiKey); config.headers.set("ngrok-skip-browser-warning", "true"); } return config; }, (error) => { return Promise.reject(error); } ); client.interceptors.response.use( (response) => response, (error) => { if (error.response) { console.error("API Error Response:", { status: error.response.status, data: error.response.data }); if (error.response.status === 401 || error.response.status === 403) { clearAuth(); } } return Promise.reject(error); } ); return client; } // src/api/utils.ts var import_node_forge = __toESM(require("node-forge")); var import_uuid = require("uuid"); var formatUnits = (value, decimals) => { const divisor = BigInt(10 ** decimals); const quotient = value / divisor; const remainder = value % divisor; const formattedRemainder = remainder.toString().padStart(decimals, "0"); return `${quotient.toString()}.${formattedRemainder}`; }; var formatAvailableLimit = (availableLimit, creditType) => { const decimals = creditType === "aave-v3" || creditType === "hypurrFi" ? 6 : 18; const formatted = Number(formatUnits(BigInt(availableLimit), decimals)); return Number(formatted.toFixed(4)); }; function mapEulerMetadataToSuppliedAssets(metadata) { if (!Array.isArray(metadata?.vaults)) return metadata; const suppliedAssets = metadata.vaults.map((vault) => { const formattedAsset = Number(formatUnits(BigInt(vault.assets || 0), 18)); console.log({ formattedAsset }); return { UsageAsCollateralEnabledOnUser: true, // Assume true for Euler amount: formattedAsset, amountUSD: 0, // No USD value provided, set to 0 or calculate if possible collateralAmountBase: String(formattedAsset), collateralAmountBig: formattedAsset, supplyRate: 0, // Not provided by Euler, set to 0 or fetch if available underlyingAsset: vault.vault || "" }; }); const suppliedValue = suppliedAssets.reduce( (sum, asset) => sum + asset.amountUSD, 0 ); return { ...metadata, suppliedAssets, suppliedValue }; } function encryptPinWithSessionKey(pin, sessionKey) { const hexLength = pin.length.toString(16); const formattedPin = `2${hexLength}${pin}${"F".repeat(14 - pin.length)}`; const ivBytes = import_node_forge.default.random.getBytesSync(16); const encodedIV = import_node_forge.default.util.encode64(ivBytes); const keyBytes = import_node_forge.default.util.hexToBytes(sessionKey); const cipher = import_node_forge.default.cipher.createCipher("AES-GCM", keyBytes); cipher.start({ iv: ivBytes }); cipher.update(import_node_forge.default.util.createBuffer(formattedPin)); cipher.finish(); const encrypted = cipher.output.getBytes() + cipher.mode.tag.getBytes(); const encodedEncrypted = import_node_forge.default.util.encode64(encrypted); return { iv: encodedIV, data: encodedEncrypted }; } var generateUUID = (options) => { return (0, import_uuid.v4)(options); }; function getCardSolverConfig(creditType) { if (creditType === "aave-v3") { return { borrowTokenAddress: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" }; } else if (creditType === "hypurrFi") { return { borrowTokenAddress: "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb" }; } else { return { borrowVaultAddress: "0x0A1a3b5f2041F33522C4efc754a7D096f880eE16" }; } } // src/api/api.ts var getCardStatus = async (eoaAddress) => { try { const client = getApiClient(); const response = await client.get(`/cards/user/status`); return response.data; } catch (error) { if (import_axios2.default.isAxiosError(error) && error.response?.status === 404) { return { data: "userNotExisting" }; } throw error; } }; var getUserCards = async (eoaAddress) => { try { const client = getApiClient(); const response = await client.get(`/cards/user`); return response.data; } catch (err) { console.error("[getUserCards]", err); return { data: null }; } }; var getCreditInformation = async (creditAddress, solverType) => { try { const client = getApiClient(); const response = await client.post( `/cards/credit`, { solverType, config: solverType === "aave-v3" ? { borrowTokenAddress: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" } : solverType === "hypurrFi" ? { borrowTokenAddress: "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb" } : { borrowVaultAddress: "0x0A1a3b5f2041F33522C4efc754a7D096f880eE16" } } ); if (response.data?.data && typeof response.data.data.availableLimit === "number") { response.data.data.availableLimit = formatAvailableLimit( response.data.data.availableLimit, solverType ); response.data.data.amountDelegated = formatAvailableLimit( response.data.data.amountDelegated, solverType ); } if (solverType === "euler" && response.data?.data?.metadata) { response.data.data.metadata = mapEulerMetadataToSuppliedAssets( response.data.data.metadata ); } return response.data; } catch (error) { console.error("[getCreditInformation]", error); return { data: null }; } }; var getSumSubAccessToken = async (userId, ipAddress) => { try { const client = getApiClient(); const response = await client.post( "/cards/sumsub/token", { userId, ipAddress } ); return response.data.data; } catch (error) { console.error("[error at getSumSubAccessToken]", error); return void 0; } }; var getCreditDelegationTxData = async (requestData) => { const eoa = requestData.from; const payload = { creditType: requestData.creditType, creditLimit: requestData.creditLimit, userParams: requestData?.userParams }; const client = getApiClient(); const response = await client.post( `/cards/credit/delegate`, payload ); return response.data; }; var updateCard = async (requestData) => { const { apiKey, baseUrl, apiPath } = useSDKConfigStore.getState(); try { const client = import_axios2.default.create({ baseURL: `${baseUrl}${apiPath}`, headers: { "Content-Type": "application/json", "x-api-key": apiKey, Authorization: `Bearer ${requestData.auth}`, sessionID: generateUUID() } }); const response = await client.patch(`/cards/creditprovider`, { creditProviderAddress: requestData.creditProviderAddress, chainId: requestData.chainId, creditType: requestData.creditType, cardSolverConfig: getCardSolverConfig(requestData.creditType) }); if (response.status === 200) { return { success: true }; } return { success: false, message: response.data?.message || "Failed to update card" }; } catch (error) { console.error("[updateCard]", error); return { success: false, message: error?.response?.data?.data?.error || error?.message || "Failed to update card" }; } }; var createCard = async (userEoa, chainID, creditType, auth) => { const { apiKey, baseUrl, apiPath } = useSDKConfigStore.getState(); const client = import_axios2.default.create({ baseURL: `${baseUrl}${apiPath}`, headers: { "Content-Type": "application/json", "x-api-key": apiKey, Authorization: `Bearer ${auth}`, sessionID: generateUUID() } }); const response = await client.post(`/cards/create`, { creditProviderAddress: userEoa, chainID, creditType, cardSolverConfig: getCardSolverConfig(creditType) }); return response.data; }; var freezeCard = async (eoa, cardID, chainID, signature, timestamp, freeze, action) => { const { apiKey, baseUrl, apiPath } = useSDKConfigStore.getState(); const authJson = { cardID, action, version: "1", timestamp, chainID, sig: signature, userAddr: eoa }; const encodedAuth = btoa(JSON.stringify(authJson)); const client = import_axios2.default.create({ baseURL: `${baseUrl}${apiPath}`, headers: { "Content-Type": "application/json", "x-api-key": apiKey, Authorization: `Bearer ${encodedAuth}`, sessionID: generateUUID() } }); try { const response = await client.patch(`/cards/status`, { cardID, freeze }); if (response.status === 200) { return { success: true }; } return { success: false, message: response.data?.message || "Failed to freeze card" }; } catch (error) { console.error("[freezeCard]", error); return { success: false, message: error?.response?.data?.data?.error || error?.message || "Failed to freeze card" }; } }; var updatePin = async (eoa, cardID, chainID, sessionID, signature, timestamp, iv, data, action) => { const { apiKey, baseUrl, apiPath } = useSDKConfigStore.getState(); const authJson = { cardID, action, version: "1", timestamp, chainID, sig: signature, userAddr: eoa }; const encodedAuth = btoa(JSON.stringify(authJson)); const client = import_axios2.default.create({ baseURL: `${baseUrl}${apiPath}`, headers: { "Content-Type": "application/json", "x-api-key": apiKey, Authorization: `Bearer ${encodedAuth}`, sessionID } }); try { const response = await client.patch( `/cards/pin`, { pin: { encryptedPin: { data, iv } } } ); if (response.status === 200) { return { success: true }; } return { success: false, message: response.data?.message || "Failed to update PIN" }; } catch (error) { console.error("[updatePin]", error); return { success: false, message: error?.response?.data?.data?.error || error?.message || "Failed to update PIN" }; } }; var getCardSecrets = async (eoa, cardID, chainID, sessionID, signature, timestamp, action) => { const { apiKey, baseUrl, apiPath } = useSDKConfigStore.getState(); const authJson = { cardID, action, version: "1", timestamp, chainID, sig: signature, userAddr: eoa }; const encodedAuth = btoa(JSON.stringify(authJson)); const client = import_axios2.default.create({ baseURL: `${baseUrl}${apiPath}`, headers: { "Content-Type": "application/json", "x-api-key": apiKey, Authorization: `Bearer ${encodedAuth}`, sessionID } }); try { const response = await client.get(`/cards/secrets`); if (response.status === 200 && response.data?.data) { return response.data.data; } throw new Error("Unexpected response format while fetching card secrets."); } catch (error) { console.error("[getCardSecrets] Error fetching card secrets:", error); const errorMessage = error?.response?.data?.data?.error || error?.response?.data?.message || error?.message || "Failed to fetch card secrets"; throw new Error(errorMessage); } }; var getCardLimit = async (cardID) => { const client = getApiClient(); try { const response = await client.get(`/cards/limit/${cardID}`); if (response.status === 200 && response.data?.data) { return response.data.data; } throw new Error("Unexpected response format while fetching card limits."); } catch (error) { console.error("[getCardLimit] Error fetching card limits:", error); const errorMessage = error?.response?.data?.data?.error || error?.response?.data?.message || error?.message || "Failed to fetch card limits"; throw new Error(errorMessage); } }; var updateLimit = async (eoa, cardID, chainID, signature, timestamp, limit, action) => { const { apiKey, baseUrl, apiPath } = useSDKConfigStore.getState(); const authJson = { cardID, action, version: "1", timestamp, chainID, sig: signature, userAddr: eoa }; const encodedAuth = btoa(JSON.stringify(authJson)); const client = import_axios2.default.create({ baseURL: `${baseUrl}${apiPath}`, headers: { "Content-Type": "application/json", "x-api-key": apiKey, Authorization: `Bearer ${encodedAuth}` } }); try { const response = await client.patch( `/cards/limits`, { limit, frequency: "per24HourPeriod" } ); if (response.status === 200) { return { success: true }; } return { success: false, message: response.data?.message || "Failed to update limit" }; } catch (error) { console.error("[updateLimit]", error); return { success: false, message: error?.response?.data?.data?.error || error?.message || "Failed to update limit" }; } }; var getCardPublicKey = async () => { const client = getApiClient(); const response = await client.get("/cards/pubkey"); return response.data; }; var getTransactions = async (userAddress, cardID, limit, cursor) => { try { const client = getApiClient(); const response = await client.get( `cards/transactions/${cardID}`, { params: { limit, cursor } } ); return response.data; } catch (error) { console.error("[getTransactions]", error); return { data: { transactions: [], pagination: { limit: limit || 50, has_next: false } } }; } }; var getOnchainTransactionDetails = async (transactionID) => { try { const client = getApiClient(); const response = await client.get( `cards/transactions/${transactionID}/onchain` ); return response.data; } catch (error) { console.error("[getOnchainTransactionDetails]", error); return { data: [] }; } }; var getUserIsUs = async () => { try { const client = getApiClient(); const response = await client.get(`cards/user/is_us`); return response.data; } catch (error) { console.error("[getUserIsUs]", error); return { data: false }; } }; var getEulerCardPreview = async (vaults, creditType = "euler") => { try { const client = getApiClient(); const response = await client.post(`/cards/credit/${creditType}/preview`, { vaults, borrowVaultAddress: "0x0A1a3b5f2041F33522C4efc754a7D096f880eE16" }); return response.data; } catch (error) { console.error("[getEulerCardPreview]", error); return { data: { credit: "0", collateral: "0" } }; } }; var getEulerHealthFactor = async () => { try { const client = getApiClient(); const response = await client.get( `/cards/euler/hf?borrowVaultAddress=0x0A1a3b5f2041F33522C4efc754a7D096f880eE16` ); return response.data; } catch (error) { console.error("[getEulerHealthFactor]", error); return { data: { healthFactor: "0" } }; } }; var getPendingTransactionBalance = async (cardID) => { try { const client = getApiClient(); const response = await client.get(`/cards/transactions/balances/pending/${cardID}`); return response.data; } catch (error) { console.error("[getPendingTransactionBalances]", error); return { data: { status: "error", balances: { usd: 0 } } }; } }; var getEulerTotalAsset = async (chainID) => { try { const client = getApiClient(); const response = await client.get( `/cards/euler/assets/${chainID}` ); return response.data; } catch (error) { console.error("[getEulerTotalAsset]", error); return { data: { totalAssetsUSD: 0 } }; } }; // src/stores/creditStore.ts var import_zustand = require("zustand"); var useCreditStore = (0, import_zustand.create)((set, get) => ({ creditInfo: { aave: null, euler: null, hypurrFi: null }, isLoading: false, error: null, // Internal methods for SDK use only (prefixed with _) _setCreditInfo: (type, info) => set((state) => ({ creditInfo: { ...state.creditInfo, [type]: info } })), _setLoading: (loading) => set({ isLoading: loading }), _setError: (error) => set({ error }), _reset: () => set({ creditInfo: { card: null, aave: null, euler: null }, isLoading: false, error: null }), // New function to refresh positions for specified credit types _refreshPositions: async (creditTypes) => { const { eoaAddress, isInitialized } = useSDKConfigStore.getState(); if (!isInitialized || !eoaAddress) { console.error( "\u274C SDK: Cannot refresh positions - SDK not initialized or no EOA address" ); return; } console.log("\u{1F504} SDK: Refreshing positions for:", creditTypes); set({ error: null }); try { const fetchPromises = creditTypes.map( (creditType) => getCreditInformation( eoaAddress, creditType === "aave" ? "aave-v3" : creditType ) ); const responses = await Promise.all(fetchPromises); responses.forEach((response, index) => { const creditType = creditTypes[index]; get()._setCreditInfo( creditType === "aave-v3" ? "aave" : creditType, response ); }); console.log("\u2705 SDK: Successfully refreshed positions for:", creditTypes); } catch (error) { console.error("\u274C SDK: Error refreshing positions:", error); const errorMessage = error instanceof Error ? error.message : "Failed to refresh positions"; set({ error: errorMessage }); } } })); // src/stores/transactionsStore.ts var import_zustand2 = require("zustand"); var useTransactionsStore = (0, import_zustand2.create)((set) => ({ transactions: [], pagination: null, isLoading: false, loadingNextPage: false, initialFetchDone: false, error: null, pendingTxnAmount: 0, // Internal methods for SDK use only (prefixed with _) _setTransactions: (transactions) => set({ transactions }), _appendTransactions: (newTransactions) => set((state) => ({ transactions: [...state.transactions, ...newTransactions] })), _setPagination: (pagination) => set({ pagination }), _setLoading: (loading) => set({ isLoading: loading }), _setLoadingNextPage: (loading) => set({ loadingNextPage: loading }), _setInitialFetchDone: (done) => set({ initialFetchDone: done }), _setError: (error) => set({ error }), _setPendingTxnAmount: (amount) => set({ pendingTxnAmount: amount }), _reset: () => set({ transactions: [], pagination: null, isLoading: false, loadingNextPage: false, initialFetchDone: false, error: null }) })); // src/core/dataFetcher.ts var BASE_CHAIN_ID = 8453; var HYPER_EVM_CHAIN_ID = 999; var DataFetcher = class _DataFetcher { static instance; hasFetched = false; static getInstance() { if (!_DataFetcher.instance) { _DataFetcher.instance = new _DataFetcher(); } return _DataFetcher.instance; } async fetchAllData() { const { eoaAddress, chainID, isInitialized } = useSDKConfigStore.getState(); if (!isInitialized || !eoaAddress || !chainID || this.hasFetched) { return; } if (![BASE_CHAIN_ID, HYPER_EVM_CHAIN_ID].includes(chainID)) { throw new Error( `Unsupported chain ID: ${chainID}. Supported chain IDs are ${BASE_CHAIN_ID} and ${HYPER_EVM_CHAIN_ID}.` ); } console.log("\u{1F680} SDK: Starting data fetch for:", eoaAddress); const cardStore = useCardStatusStore.getState(); const creditStore = useCreditStore.getState(); cardStore._setLoading(true); creditStore._setLoading(true); try { const [cardStatusResponse, userCardsResponse] = await Promise.all([ getCardStatus(eoaAddress), getUserCards(eoaAddress) ]); let aaveCreditResponse = null; let eulerCreditResponse = null; let hypurrFiCreditResponse = null; if (chainID === BASE_CHAIN_ID) { [aaveCreditResponse, eulerCreditResponse] = await Promise.all([ getCreditInformation(eoaAddress, "aave-v3"), getCreditInformation(eoaAddress, "euler") ]); } else if (chainID === HYPER_EVM_CHAIN_ID) { hypurrFiCreditResponse = await getCreditInformation( eoaAddress, "hypurrFi" ); } const userCard = userCardsResponse.data?.[0] || null; cardStore._setCardStatus(cardStatusResponse.data, userCard); if (aaveCreditResponse) { creditStore._setCreditInfo("aave", aaveCreditResponse); } if (eulerCreditResponse) { creditStore._setCreditInfo("euler", eulerCreditResponse); } if (hypurrFiCreditResponse) { creditStore._setCreditInfo("hypurrFi", hypurrFiCreditResponse); } this.hasFetched = true; console.log("\u2705 SDK: Successfully fetched all data for:", eoaAddress); } catch (error) { console.error("\u274C SDK: Error fetching data:", error); const errorMessage = error instanceof Error ? error.message : "Failed to fetch data"; cardStore._setError(errorMessage); creditStore._setError(errorMessage); } finally { cardStore._setLoading(false); creditStore._setLoading(false); } } // Public method to trigger data fetching after authentication async fetchDataAfterAuth() { this.hasFetched = false; await this.fetchAllData(); } reset() { this.hasFetched = false; useCardStatusStore.getState()._reset(); useCreditStore.getState()._reset(); useTransactionsStore.getState()._reset(); } }; var dataFetcher = DataFetcher.getInstance(); // src/stores/sdkConfigStore.ts var useSDKConfigStore = (0, import_zustand3.create)((set, get) => ({ eoaAddress: null, chainID: null, apiKey: null, baseUrl: null, apiPath: null, isInitialized: false, setConfig: (config) => { get().reset(); set({ eoaAddress: config.eoaAddress, apiKey: config.apiKey, chainID: config.chainID, baseUrl: config.baseUrl || "https://dev.console.fi", apiPath: config.apiPath || "/v1/vendor", isInitialized: true }); }, reset: () => { set({ eoaAddress: null, apiKey: null, baseUrl: null, apiPath: null, isInitialized: false }); dataFetcher.reset(); } })); // src/stores/cardStatusStore.ts var isCardDelegatedToCurrentEOA = (userCard) => { if (!userCard) return false; const { eoaAddress } = useSDKConfigStore.getState(); if (!eoaAddress) return false; return userCard.creditProviderAddress.toLowerCase() === eoaAddress.toLowerCase(); }; var useCardStatusStore = (0, import_zustand4.create)((set) => ({ status: null, userCard: null, isLoading: false, error: null, isUserCardDelegated: false, // Internal methods for SDK use only (prefixed with _) _setCardStatus: (status, userCard) => { const isCardDelegated = isCardDelegatedToCurrentEOA(userCard); set({ status, userCard, isUserCardDelegated: isCardDelegated }); }, _setLoading: (loading) => set({ isLoading: loading }), _setUserStatus: (status) => set({ status }), _setError: (error) => set({ error }), _reset: () => set({ status: null, userCard: null, isUserCardDelegated: false, isLoading: false, error: null }), _setUserCard: (userCard) => { const isCardDelegated = isCardDelegatedToCurrentEOA(userCard); set({ userCard, isUserCardDelegated: isCardDelegated }); }, _refreshCardStatus: async () => { const { eoaAddress } = useSDKConfigStore.getState(); if (!eoaAddress) { console.error("[_refreshCardStatus]: No EOA address found"); return; } const statusResponse = await getCardStatus(eoaAddress); if (statusResponse && statusResponse.data) { set({ status: statusResponse.data }); } } })); // src/stores/useKycStore.ts var import_zustand5 = require("zustand"); var useKycStore = (0, import_zustand5.create)((set) => ({ acceptedRainTerms: false, isKycModalOpen: false, isSumsubProfileVerified: false, setAcceptedRainTerms: (accepted) => set({ acceptedRainTerms: accepted }), setKycModalOpen: (open) => set({ isKycModalOpen: open }), setIsSumsubProfileVerified: (verified) => set({ isSumsubProfileVerified: verified }) })); // src/components/icons/PendingSvg.tsx var import_jsx_runtime3 = require("react/jsx-runtime"); function PendingSvg() { return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)( "svg", { width: "448", height: "231", viewBox: "0 0 448 231", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("g", { "clip-path": "url(#clip0_58212_73084)", children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { width: "448", height: "231", fill: "url(#paint0_linear_58212_73084)" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { width: "448", height: "231", fill: "black" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "ellipse", { cx: "224.5", cy: "160.5", rx: "236.5", ry: "137.5", fill: "url(#paint1_radial_58212_73084)", "fill-opacity": "0.2", stroke: "url(#paint2_linear_58212_73084)", "stroke-opacity": "0.2" } ), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "path", { d: "M243 66.2H202.5V139.8H256.5V80H243V66.2ZM202.5 57H247.5L265.5 75.4V139.8C265.5 142.24 264.552 144.58 262.864 146.305C261.176 148.031 258.887 149 256.5 149H202.5C200.113 149 197.824 148.031 196.136 146.305C194.448 144.58 193.5 142.24 193.5 139.8V66.2C193.5 63.76 194.448 61.42 196.136 59.6946C197.824 57.9693 200.113 57 202.5 57ZM211.5 98.4H247.5V107.6H211.5V98.4ZM211.5 116.8H247.5V126H211.5V116.8Z", fill: "url(#paint3_radial_58212_73084)", stroke: "url(#paint4_linear_58212_73084)", "stroke-opacity": "0.8" } ), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "258", cy: "135", r: "28", fill: "black" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M258 158C261.02 158 264.011 157.405 266.802 156.249C269.592 155.093 272.128 153.399 274.263 151.263C276.399 149.128 278.093 146.592 279.249 143.802C280.405 141.011 281 138.02 281 135C281 131.98 280.405 128.989 279.249 126.198C278.093 123.408 276.399 120.872 274.263 118.737C272.128 116.601 269.592 114.907 266.802 113.751C264.011 112.595 261.02 112 258 112C251.9 112 246.05 114.423 241.737 118.737C237.423 123.05 235 128.9 235 135C235 141.1 237.423 146.95 241.737 151.263C246.05 155.577 251.9 158 258 158ZM257.407 144.302L270.185 128.969L266.26 125.698L255.271 138.882L249.585 133.193L245.971 136.807L253.638 144.473L255.616 146.451L257.407 144.302Z", fill: "url(#paint5_radial_58212_73084)", stroke: "url(#paint6_linear_58212_73084)", "stroke-opacity": "0.8" } ), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "path", { d: "M71.12 185.7H73.64L77.28 197.4H77.3L80.94 185.7H83.46L78.58 200H76L71.12 185.7ZM87.7309 198.58C89.4709 198.58 90.1709 197.5 90.3509 196.88H92.4509C91.9309 198.82 90.4109 200.3 87.7909 200.3C84.6109 200.3 82.6709 198.1 82.6709 194.9C82.6709 191.58 84.6109 189.5 87.6909 189.5C90.9909 189.5 92.6109 191.8 92.6109 195.44H84.7709C84.7709 197.16 85.8709 198.58 87.7309 198.58ZM87.6909 191.16C85.9909 191.16 84.7709 192.3 84.7709 193.88H90.5109C90.5109 192.3 89.3909 191.16 87.6909 191.16ZM98.9108 189.54C99.2708 189.54 99.5308 189.56 99.8308 189.6V191.58H99.7908C97.7708 191.24 96.1508 192.6 96.1508 194.78V200H94.0508V189.78H96.1508V191.7H96.1908C96.7308 190.42 97.5708 189.54 98.9108 189.54ZM102.36 188.06C101.78 188.06 101.18 187.66 101.18 186.94C101.18 186.22 101.78 185.84 102.36 185.84C102.98 185.84 103.56 186.22 103.56 186.94C103.56 187.66 102.98 188.06 102.36 188.06ZM101.32 189.78H103.42V200H101.32V189.78ZM110.375 187.42C109.015 187.36 108.495 187.5 108.495 188.66V189.78H110.375V191.5H108.495V200H106.375V191.5H104.915V189.78H106.375V188.48C106.375 186.32 107.295 185.56 108.975 185.56C109.495 185.56 109.955 185.62 110.375 185.7V187.42ZM112.946 188.06C112.366 188.06 111.766 187.66 111.766 186.94C111.766 186.22 112.366 185.84 112.946 185.84C113.566 185.84 114.146 186.22 114.146 186.94C114.146 187.66 113.566 188.06 112.946 188.06ZM111.906 189.78H114.006V200H111.906V189.78ZM123.181 193.52C123.101 192.48 122.441 191.22 120.641 191.22C118.581 191.22 117.701 192.98 117.701 194.9C117.701 196.82 118.561 198.58 120.641 198.58C122.441 198.58 123.101 197.34 123.181 196.2H125.281C125.121 198.56 123.301 200.3 120.641 200.3C117.581 200.3 115.601 198.1 115.601 194.9C115.601 191.7 117.581 189.5 120.621 189.5C123.281 189.5 125.021 191.2 125.281 193.52H123.181ZM133.043 192.46C133.043 191.72 132.603 191.16 131.203 191.16C129.523 191.16 128.903 191.68 128.803 193H126.763C126.863 191.04 128.123 189.5 131.203 189.5C133.463 189.5 135.143 190.36 135.143 193.08V197.94C135.143 198.66 135.303 199.04 136.123 198.96V199.96C135.643 200.14 135.303 200.18 134.903 200.18C133.783 200.18 133.263 199.78 133.063 198.78H133.023C132.383 199.68 131.223 200.3 129.643 200.3C127.563 200.3 126.283 199.1 126.283 197.38C126.283 195.14 127.943 194.44 130.503 193.94C132.083 193.64 133.043 193.44 133.043 192.46ZM130.103 198.64C131.843 198.64 133.043 197.78 133.043 196.12V194.58C132.703 194.82 131.883 195.06 130.903 195.26C129.163 195.64 128.403 196.14 128.403 197.18C128.403 198.12 128.963 198.64 130.103 198.64ZM142.036 191.5H140.116V197.04C140.116 198.2 140.676 198.34 142.036 198.26V199.98C141.616 200.08 141.156 200.14 140.596 200.14C138.916 200.14 137.996 199.38 137.996 197.22V191.5H136.516V189.78H137.996V186.56H140.116V189.78H142.036V191.5ZM144.743 188.06C144.163 188.06 143.563 187.66 143.563 186.94C143.563 186.22 144.163 185.84 144.743 185.84C145.363 185.84 145.943 186.22 145.943 186.94C145.943 187.66 145.363 188.06 144.743 188.06ZM143.703 189.78H145.803V200H143.703V189.78ZM152.538 200.3C149.338 200.3 147.398 198.08 147.398 194.9C147.398 191.72 149.338 189.5 152.538 189.5C155.738 189.5 157.678 191.72 157.678 194.9C157.678 198.08 155.738 200.3 152.538 200.3ZM152.538 198.58C154.538 198.58 155.578 197 155.578 194.9C155.578 192.78 154.538 191.22 152.538 191.22C150.538 191.22 149.498 192.78 149.498 194.9C149.498 197 150.538 198.58 152.538 198.58ZM164.629 189.5C166.529 189.5 168.029 190.6 168.029 192.94V200H165.909V193.54C165.909 192.16 165.329 191.28 163.889 191.28C162.269 191.28 161.229 192.26 161.229 193.78V200H159.129V189.78H161.229V191.1H161.269C161.809 190.3 162.869 189.5 164.629 189.5ZM179.398 191.48C182.458 192.26 184.778 192.92 184.778 196.12C184.778 198.4 183.058 200.3 179.458 200.3C175.958 200.3 173.298 198.48 173.158 195.24H175.538C175.658 197.06 176.898 198.26 179.458 198.26C181.578 198.26 182.398 197.32 182.398 196.22C182.398 194.52 181.178 194.2 178.358 193.5C176.118 192.94 173.698 192.08 173.698 189.36C173.698 186.82 175.658 185.4 178.778 185.4C181.918 185.4 184.198 187.04 184.398 189.98H182.018C181.798 188.32 180.758 187.44 178.778 187.44C177.078 187.44 176.058 188.08 176.058 189.14C176.058 190.7 177.398 190.98 179.398 191.48ZM193.134 189.78H195.234V200H193.134V198.68H193.094C192.554 199.48 191.494 200.28 189.734 200.28C187.834 200.28 186.334 199.18 186.334 196.84V189.78H188.454V196.24C188.454 197.62 189.034 198.5 190.474 198.5C192.094 198.5 193.134 197.52 193.134 196V189.78ZM202.494 189.5C205.114 189.5 207.054 191.54 207.054 194.9C207.054 198.26 205.114 200.3 202.494 200.3C200.914 200.3 199.914 199.52 199.374 198.82H199.334V200H197.234V185.7H199.334V191.02H199.374C199.914 190.24 200.914 189.5 202.494 189.5ZM202.134 198.58C203.974 198.58 204.954 196.9 204.954 194.9C204.954 192.9 203.974 191.22 202.134 191.22C200.414 191.22 199.354 192.62 199.354 194.9C199.354 197.16 200.414 198.58 202.134 198.58ZM219.803 189.5C221.863 189.5 222.923 190.74 222.923 192.94V200H220.803V193.54C220.803 192.16 220.523 191.28 219.083 191.28C217.663 191.28 216.783 192.26 216.783 193.78V200H214.663V193.54C214.663 192.16 214.383 191.28 212.923 191.28C211.523 191.28 210.623 192.26 210.623 193.78V200H208.523V189.78H210.623V191.1H210.663C211.203 190.3 212.163 189.5 213.703 189.5C215.143 189.5 216.003 190.16 216.423 191.26H216.463C217.223 190.28 218.223 189.5 219.803 189.5ZM226.051 188.06C225.471 188.06 224.871 187.66 224.871 186.94C224.871 186.22 225.471 185.84 226.051 185.84C226.671 185.84 227.251 186.22 227.251 186.94C227.251 187.66 226.671 188.06 226.051 188.06ZM225.011 189.78H227.111V200H225.011V189.78ZM234.126 191.5H232.206V197.04C232.206 198.2 232.766 198.34 234.126 198.26V199.98C233.706 200.08 233.246 200.14 232.686 200.14C231.006 200.14 230.086 199.38 230.086 197.22V191.5H228.606V189.78H230.086V186.56H232.206V189.78H234.126V191.5ZM240.298 191.5H238.378V197.04C238.378 198.2 238.938 198.34 240.298 198.26V199.98C239.878 200.08 239.418 200.14 238.858 200.14C237.178 200.14 236.258 199.38 236.258 197.22V191.5H234.778V189.78H236.258V186.56H238.378V189.78H240.298V191.5ZM246.247 198.58C247.987 198.58 248.687 197.5 248.867 196.88H250.967C250.447 198.82 248.927 200.3 246.307 200.3C243.127 200.3 241.187 198.1 241.187 194.9C241.187 191.58 243.127 189.5 246.207 189.5C249.507 189.5 251.127 191.8 251.127 195.44H243.287C243.287 197.16 244.387 198.58 246.247 198.58ZM246.207 191.16C244.507 191.16 243.287 192.3 243.287 193.88H249.027C249.027 192.3 247.907 191.16 246.207 191.16ZM259.746 185.7H261.846V200H259.746V198.82H259.706C259.166 199.52 258.166 200.3 256.586 200.3C253.966 200.3 252.026 198.26 252.026 194.9C252.026 191.54 253.966 189.5 256.586 189.5C258.166 189.5 259.166 190.24 259.706 191.02H259.746V185.7ZM256.946 198.58C258.666 198.58 259.726 197.16 259.726 194.9C259.726 192.62 258.666 191.22 256.946 191.22C255.106 191.22 254.126 192.9 254.126 194.9C254.126 196.9 255.106 198.58 256.946 198.58ZM273.304 191.48C276.364 192.26 278.684 192.92 278.684 196.12C278.684 198.4 276.964 200.3 273.364 200.3C269.864 200.3 267.204 198.48 267.064 195.24H269.444C269.564 197.06 270.804 198.26 273.364 198.26C275.484 198.26 276.304 197.32 276.304 196.22C276.304 194.52 275.084 194.2 272.264 193.5C270.024 192.94 267.604 192.08 267.604 189.36C267.604 186.82 269.564 185.4 272.684 185.4C275.824 185.4 278.104 187.04 278.304 189.98H275.924C275.704 188.32 274.664 187.44 272.684 187.44C270.984 187.44 269.964 188.08 269.964 189.14C269.964 190.7 271.304 190.98 273.304 191.48ZM287.04 189.78H289.14V200H287.04V198.68H287C286.46 199.48 285.4 200.28 283.64 200.28C281.74 200.28 280.24 199.18 280.24 196.84V189.78H282.36V196.24C282.36 197.62 282.94 198.5 284.38 198.5C286 198.5 287.04 197.52 287.04 196V189.78ZM298.181 193.52C298.101 192.48 297.441 191.22 295.641 191.22C293.581 191.22 292.701 192.98 292.701 194.9C292.701 196.82 293.561 198.58 295.641 198.58C297.441 198.58 298.101 197.34 298.181 196.2H300.281C300.121 198.56 298.301 200.3 295.641 200.3C292.581 200.3 290.601 198.1 290.601 194.9C290.601 191.7 292.581 189.5 295.621 189.5C298.281 189.5 300.021 191.2 300.281 193.52H298.181ZM308.708 193.52C308.628 192.48 307.968 191.22 306.168 191.22C304.108 191.22 303.228 192.98 303.228 194.9C303.228 196.82 304.088 198.58 306.168 198.58C307.968 198.58 308.628 197.34 308.708 196.2H310.808C310.648 198.56 308.828 200.3 306.168 200.3C303.108 200.3 301.128 198.1 301.128 194.9C301.128 191.7 303.108 189.5 306.148 189.5C308.808 189.5 310.548 191.2 310.808 193.52H308.708ZM316.715 198.58C318.455 198.58 319.155 197.5 319.335 196.88H321.435C320.915 198.82 319.395 200.3 316.775 200.3C313.595 200.3 311.655 198.1 311.655 194.9C311.655 191.58 313.595 189.5 316.675 189.5C319.975 189.5 321.595 191.8 321.595 195.44H313.755C313.755 197.16 314.855 198.58 316.715 198.58ZM316.675 191.16C314.975 191.16 313.755 192.3 313.755 193.88H319.495C319.495 192.3 318.375 191.16 316.675 191.16ZM327.455 193.82C329.335 194.26 331.375 194.68 331.375 197.12C331.375 199.08 329.695 200.3 327.215 200.3C323.915 200.3 322.495 198.76 322.395 196.6H324.435C324.535 197.7 325.015 198.64 327.175 198.64C328.635 198.64 329.255 197.92 329.255 197.28C329.255 196 328.035 195.9 326.535 195.54C324.915 195.16 322.715 194.84 322.715 192.52C322.715 190.84 324.195 189.5 326.755 189.5C329.535 189.5 330.855 191 330.995 192.78H328.955C328.815 191.98 328.415 191.16 326.775 191.16C325.515 191.16 324.835 191.64 324.835 192.36C324.835 193.4 325.975 193.48 327.455 193.82ZM337.24 193.82C339.12 194.26 341.16 194.68 341.16 197.12C341.16 199.08 339.48 200.3 337 200.3C333.7 200.3 332.28 198.76 332.18 196.6H334.22C334.32 197.7 334.8 198.64 336.96 198.64C338.42 198.64 339.04 197.92 339.04 197.28C339.04 196 337.82 195.9 336.32 195.54C334.7 195.16 332.5 194.84 332.5 192.52C332.5 190.84 333.98 189.5 336.54 189.5C339.32 189.5 340.64 191 340.78 192.78H338.74C338.6 191.98 338.2 191.16 336.56 191.16C335.3 191.16 334.62 191.64 334.62 192.36C334.62 193.4 335.76 193.48 337.24 193.82ZM347.191 187.42C345.831 187.36 345.311 187.5 345.311 188.66V189.78H347.191V191.5H345.311V200H343.191V191.5H341.731V189.78H343.191V188.48C343.191 186.32 344.111 185.56 345.791 185.56C346.311 185.56 346.771 185.62 347.191 185.7V187.42ZM355.302 189.78H357.402V200H355.302V198.68H355.262C354.722 199.48 353.662 200.28 351.902 200.28C350.002 200.28 348.502 199.18 348.502 196.84V189.78H350.622V196.24C350.622 197.62 351.202 198.5 352.642 198.5C354.262 198.5 355.302 197.52 355.302 196V189.78ZM359.442 185.7H361.562V200H359.442V185.7ZM363.485 185.7H365.605V200H363.485V185.7ZM376.665 189.78L372.585 200.64C372.005 202.22 371.345 203.48 369.385 203.48C368.785 203.48 368.285 203.38 367.885 203.28V201.68H368.065C368.945 201.8 369.605 201.74 370.065 201.18C370.445 200.72 370.725 199.92 370.345 198.96L366.645 189.78H368.905L371.765 197.6H371.805L374.425 189.78H376.665Z", fill: "#66DB94" } ) ] }), /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("defs", { children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)( "linearGradient", { id: "paint0_linear_58212_73084", x1: "717.034", y1: "117.142", x2: "-243.853", y2: "143.296", gradientUnits: "userSpaceOnUse", children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { "stop-color": "#F8F29C" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { offset: "0.165", "stop-color": "#F6DB2A" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { offset: "0.333", "stop-color": "#F4A435" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { offset: "0.55", "stop-color": "#E85A46" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { offset: "0.699", "stop-color": "#B93483" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { offset: "0.867", "stop-color": "#502B6E" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { offset: "1", "stop-color": "#2A2136" }) ] } ), /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)( "radialGradient", { id: "paint1_radial_58212_73084", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(224.5 23) rotate(88.4754) scale(131.547 308.387)", children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("stop", { "stop-color": "#66DB94" }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx