@funkit/connect 6.0.7 → 6.1.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 6.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0804213: Add configurable transaction digest display for fee breakdown summary with chain-dependent formatting
8
+
9
+ ### Patch Changes
10
+
11
+ - f25fb68: feat(connect): transaction flow updates
12
+ - 2a960b7: do not fetch userip if apikey is not available
13
+
3
14
  ## 6.0.7
4
15
 
5
16
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import {
3
- darkTheme
4
- } from "./chunk-WDHT73AM.js";
5
2
  import {
6
3
  lightTheme
7
4
  } from "./chunk-ZDHRMKMT.js";
5
+ import {
6
+ darkTheme
7
+ } from "./chunk-WDHT73AM.js";
8
8
  import {
9
9
  systemFontStack
10
10
  } from "./chunk-7HKC2KCK.js";
@@ -3290,6 +3290,7 @@ function useFunkitUserIp() {
3290
3290
  throw error;
3291
3291
  }
3292
3292
  },
3293
+ enabled: !!moonpayApiKey,
3293
3294
  // no need to refetch as aggressively
3294
3295
  refetchOnMount: false,
3295
3296
  refetchOnReconnect: true,
@@ -5872,7 +5873,8 @@ function StatusIcon({
5872
5873
  {
5873
5874
  animate: { height: backgroundSize, width: backgroundSize },
5874
5875
  className: slots.container,
5875
- initial: animateEntrance ? { height: iconSize, width: iconSize } : false
5876
+ initial: animateEntrance ? { height: iconSize, width: iconSize } : false,
5877
+ transition: { duration: 0.2 }
5876
5878
  },
5877
5879
  /* @__PURE__ */ React44.createElement("div", { className: slots.background[variant] }),
5878
5880
  /* @__PURE__ */ React44.createElement(
@@ -5998,7 +6000,7 @@ var DEPOSIT_TEXT_CONFIG_STEPS = {
5998
6000
  },
5999
6001
  2: {
6000
6002
  title: "Depositing into your account...",
6001
- description: "It will take around one minute to finalize."
6003
+ description: "It will take a few seconds to finalize."
6002
6004
  }
6003
6005
  };
6004
6006
  var WITHDRAWAL_TEXT_CONFIG_STEPS = {
@@ -6013,7 +6015,7 @@ var STEP_SPINNER_SIZE_BIG_SCALE = 1;
6013
6015
  var STEP_SPINNER_SIZE_SMALL_SCALE = 28 / 30;
6014
6016
  var STEP_SPINNER_STROKE_WIDTH = 2;
6015
6017
  var STEP_SPINNER_GROWTH_MARGIN = 5;
6016
- var STEP_SPINNER_SPIN_DURATION_MS = 1e3;
6018
+ var STEP_SPINNER_SPIN_DURATION_MS = 700;
6017
6019
  var STEP_SPINNER_ARC_SPAN_DEGREES = 60;
6018
6020
  var STEP_SPINNER_MORPH_DEGREES = 45;
6019
6021
  var STEP_SPINNER_MORPH_MAX_OFFSET = 4;
@@ -6178,6 +6180,46 @@ function TransactionStatus({
6178
6180
  },
6179
6181
  [animate, stopSpinning]
6180
6182
  );
6183
+ const animateCircleToSuccess = useCallback10(
6184
+ async (step2) => {
6185
+ const durationMs = 300;
6186
+ const checkmarkDelayMs = 50;
6187
+ const duration = durationMs / 1e3;
6188
+ const checkmarkDelay = checkmarkDelayMs / 1e3;
6189
+ await Promise.all([
6190
+ // Change the spinner outline to solid green
6191
+ animate(
6192
+ `.framer-step-circle-${step2}-spinner-circle`,
6193
+ { opacity: 1, stroke: SUCCESS_COLOR, strokeDasharray: 0 },
6194
+ { duration }
6195
+ ),
6196
+ // Hide the spinner arc
6197
+ animate(
6198
+ `.framer-step-circle-${step2}-spinner-arc`,
6199
+ { opacity: 0 },
6200
+ { duration }
6201
+ ),
6202
+ // Hide the step number
6203
+ animate(
6204
+ `.framer-step-circle-${step2}-label`,
6205
+ { opacity: 0, filter: "blur(4px)" },
6206
+ { duration }
6207
+ ),
6208
+ // Draw the checkmark (after a short delay)
6209
+ animate(
6210
+ `.framer-step-circle-${step2}-checkmark`,
6211
+ { opacity: 1, pathLength: 1 },
6212
+ { delay: checkmarkDelay, duration: duration - checkmarkDelay }
6213
+ )
6214
+ ]);
6215
+ animate(
6216
+ `.framer-step-circle-${step2}-spinner`,
6217
+ { rotate: [0, 0] },
6218
+ { duration: 0.1 }
6219
+ );
6220
+ },
6221
+ [animate]
6222
+ );
6181
6223
  useEffect9(() => {
6182
6224
  if (initialStatus === "progress") {
6183
6225
  startSpinning(initialStep);
@@ -6192,46 +6234,18 @@ function TransactionStatus({
6192
6234
  setCurrentStatus(status);
6193
6235
  } else if (status === "success") {
6194
6236
  async function doFancySuccessAnimation() {
6195
- await Promise.all(
6196
- // For all steps...
6197
- STEPS.flatMap((step2) => [
6198
- // Change the spinner outline to solid green
6199
- animate(
6200
- `.framer-step-circle-${step2}-spinner-circle`,
6201
- { opacity: 1, stroke: SUCCESS_COLOR, strokeDasharray: 0 },
6202
- { duration: 0.3 }
6203
- ),
6204
- // Hide the spinner arc
6205
- animate(
6206
- `.framer-step-circle-${step2}-spinner-arc`,
6207
- { opacity: 0 },
6208
- { duration: 0.3 }
6209
- ),
6210
- // Hide the step number
6211
- animate(
6212
- `.framer-step-circle-${step2}-label`,
6213
- { opacity: 0 },
6214
- { duration: 0.3 }
6215
- ),
6216
- // Draw the checkmark
6217
- animate(
6218
- `.framer-step-circle-${step2}-checkmark`,
6219
- { opacity: 1, pathLength: 1 },
6220
- { duration: 0.3 }
6221
- )
6222
- ])
6223
- );
6237
+ await Promise.all(STEPS.map(animateCircleToSuccess));
6224
6238
  stopSpinning();
6225
6239
  animate(
6226
6240
  ".framer-step-circle-dots",
6227
6241
  { opacity: 0 },
6228
- { delay: 0.2, duration: 0.3 }
6242
+ { delay: 0.1, duration: 0.3, ease: "easeIn" }
6229
6243
  );
6230
6244
  for (const step2 of STEPS) {
6231
6245
  animate(
6232
6246
  `.framer-step-circle-${step2}`,
6233
6247
  { filter: "blur(3px)", x: step2 > 1 ? -36 : 36 },
6234
- { delay: 0.2, duration: 0.3, ease: "easeIn" }
6248
+ { delay: 0.1, duration: 0.3, ease: "easeIn" }
6235
6249
  );
6236
6250
  }
6237
6251
  await Promise.all(
@@ -6241,13 +6255,13 @@ function TransactionStatus({
6241
6255
  animate(
6242
6256
  `.framer-step-circle-${step2}`,
6243
6257
  { scale: STEP_SPINNER_SIZE_SMALL_SCALE },
6244
- { duration: 0.3 }
6258
+ { duration: 0.2 }
6245
6259
  ),
6246
6260
  // Make sure spinner arc really stays hidden
6247
6261
  animate(
6248
6262
  `.framer-step-circle-${step2}-spinner-arc`,
6249
6263
  { opacity: 0 },
6250
- { duration: 0.3 }
6264
+ { duration: 0.2 }
6251
6265
  ),
6252
6266
  // Morph circle towards the center
6253
6267
  animate(
@@ -6266,7 +6280,7 @@ function TransactionStatus({
6266
6280
  )
6267
6281
  ]
6268
6282
  },
6269
- { duration: 0.3 }
6283
+ { duration: 0.2 }
6270
6284
  )
6271
6285
  ])
6272
6286
  );
@@ -6283,7 +6297,7 @@ function TransactionStatus({
6283
6297
  animate(
6284
6298
  `.framer-step-circle-${step2}-spinner-circle`,
6285
6299
  { fill: SUCCESS_COLOR, opacity: 0.5 },
6286
- { duration: 0.5 }
6300
+ { duration: 0.3 }
6287
6301
  ),
6288
6302
  // Morph back to circle
6289
6303
  animate(
@@ -6295,7 +6309,7 @@ function TransactionStatus({
6295
6309
  step2 > 1 ? "left" : "right"
6296
6310
  )
6297
6311
  },
6298
- { delay: 0.2, duration: 0.3 }
6312
+ { delay: 0.2, duration: 0.1 }
6299
6313
  )
6300
6314
  ])
6301
6315
  );
@@ -6305,32 +6319,7 @@ function TransactionStatus({
6305
6319
  doFancySuccessAnimation();
6306
6320
  } else if (step > currentStep) {
6307
6321
  async function doFancyNextStepAnimation(nextStep) {
6308
- await Promise.all([
6309
- // Change the spinner outline to solid green
6310
- animate(
6311
- `.framer-step-circle-${currentStep}-spinner-circle`,
6312
- { opacity: 1, stroke: SUCCESS_COLOR, strokeDasharray: 0 },
6313
- { duration: 0.3 }
6314
- ),
6315
- // Hide the spinner arc
6316
- animate(
6317
- `.framer-step-circle-${currentStep}-spinner-arc`,
6318
- { opacity: 0 },
6319
- { duration: 0.3 }
6320
- ),
6321
- // Hide the step number
6322
- animate(
6323
- `.framer-step-circle-${currentStep}-label`,
6324
- { opacity: 0 },
6325
- { duration: 0.3 }
6326
- ),
6327
- // Draw the checkmark
6328
- animate(
6329
- `.framer-step-circle-${currentStep}-checkmark`,
6330
- { opacity: 1, pathLength: 1 },
6331
- { duration: 0.3 }
6332
- )
6333
- ]);
6322
+ await animateCircleToSuccess(currentStep);
6334
6323
  stopSpinning();
6335
6324
  animate(
6336
6325
  `.framer-step-circle-${currentStep}-spinner-circle`,
@@ -6436,6 +6425,7 @@ function TransactionStatus({
6436
6425
  }
6437
6426
  }, [
6438
6427
  animate,
6428
+ animateCircleToSuccess,
6439
6429
  currentStatus,
6440
6430
  currentStep,
6441
6431
  isDelayed2,
@@ -6456,6 +6446,7 @@ function TransactionStatus({
6456
6446
  display: "flex",
6457
6447
  flexDirection: "column",
6458
6448
  gap: "24",
6449
+ paddingTop: "4",
6459
6450
  ref: scope
6460
6451
  },
6461
6452
  currentStatus === "success" ? /* @__PURE__ */ React45.createElement(
@@ -10170,6 +10161,7 @@ import React90, { useEffect as useEffect23, useMemo as useMemo11, useState as us
10170
10161
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6 } from "@funkit/chains";
10171
10162
  import clsx14 from "clsx";
10172
10163
  import { motion as motion6, useAnimationControls } from "motion/react";
10164
+ import { mainnet as mainnet5 } from "viem/chains";
10173
10165
 
10174
10166
  // src/domains/relay.ts
10175
10167
  var KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT = 0.5;
@@ -10342,10 +10334,30 @@ function makeRateComponent(exchangeRate, relayQuoteMetadata) {
10342
10334
  };
10343
10335
  return exchangeRateComponent;
10344
10336
  }
10345
- function renderRelayFee(relayQuoteMetadata, fees, totalUsd) {
10337
+ function computeDigest(relayQuoteMetadata, uiCustomizations, totalPriceImpactPercent, gasUsd) {
10338
+ const showTransactionDigest = uiCustomizations?.confirmationScreen?.showTransactionDigest ?? "none";
10339
+ if (showTransactionDigest === "none") {
10340
+ return {
10341
+ isMainnet: false,
10342
+ value: void 0
10343
+ };
10344
+ }
10345
+ const details = relayQuoteMetadata.relayQuote.details;
10346
+ const isMainnet = details?.currencyIn?.currency?.chainId === mainnet5.id || details?.currencyOut?.currency?.chainId === mainnet5.id;
10347
+ const percent = formatPercent(totalPriceImpactPercent);
10348
+ return {
10349
+ isMainnet: true,
10350
+ value: isMainnet ? `${formatCurrencyAndStringify2(gasUsd)} \u2022 ${percent}` : percent
10351
+ };
10352
+ }
10353
+ function renderRelayFee({
10354
+ relayQuoteMetadata,
10355
+ fees,
10356
+ totalUsd,
10357
+ uiCustomizations
10358
+ }) {
10346
10359
  const {
10347
10360
  gasUsd,
10348
- totalImpactUsd,
10349
10361
  swapImpactUsd,
10350
10362
  swapImpact,
10351
10363
  appFeeUsd,
@@ -10363,9 +10375,16 @@ function renderRelayFee(relayQuoteMetadata, fees, totalUsd) {
10363
10375
  exchangeRate,
10364
10376
  relayQuoteMetadata
10365
10377
  );
10378
+ const { isMainnet, value: collapsedValue } = computeDigest(
10379
+ relayQuoteMetadata,
10380
+ uiCustomizations,
10381
+ totalPriceImpactPercent,
10382
+ totalNetworkCostUsd
10383
+ );
10366
10384
  return {
10367
10385
  collapsed: {
10368
- value: formatCurrencyAndStringify2(totalImpactUsd + gasUsd)
10386
+ value: collapsedValue ?? "",
10387
+ valueIcon: isMainnet ? /* @__PURE__ */ React90.createElement(GasIcon, null) : void 0
10369
10388
  },
10370
10389
  expanded: [
10371
10390
  ...exchangeRateComponent ? [exchangeRateComponent] : [],
@@ -10467,9 +10486,19 @@ function renderRelayFee(relayQuoteMetadata, fees, totalUsd) {
10467
10486
  ]
10468
10487
  };
10469
10488
  }
10470
- var extractFeeItems = (fees, totalUsd, relayQuoteMetadata) => {
10489
+ var extractFeeItems = ({
10490
+ fees,
10491
+ totalUsd,
10492
+ relayQuoteMetadata,
10493
+ uiCustomizations
10494
+ }) => {
10471
10495
  if (relayQuoteMetadata) {
10472
- return renderRelayFee(relayQuoteMetadata, fees, totalUsd);
10496
+ return renderRelayFee({
10497
+ relayQuoteMetadata,
10498
+ fees,
10499
+ totalUsd,
10500
+ uiCustomizations
10501
+ });
10473
10502
  }
10474
10503
  const marketMakerFee = {
10475
10504
  label: "Market maker gas costs",
@@ -10550,6 +10579,7 @@ function PaymentFeesSummary({
10550
10579
  setIsExpanded(false);
10551
10580
  }
10552
10581
  }, [valuesNotAvailable, isExpanded]);
10582
+ const { uiCustomizations } = useFunkitConfig();
10553
10583
  const { collapsed: collapsedItem, expanded: expandedItems } = useMemo11(() => {
10554
10584
  const fees = quote?.finalFeesBreakdown ?? fallbackFees;
10555
10585
  if (!fees) {
@@ -10557,8 +10587,13 @@ function PaymentFeesSummary({
10557
10587
  }
10558
10588
  const totalUsd = Number(quote?.finalTotalUsd ?? "0");
10559
10589
  const relayQuoteMetadata = quote?.baseQuote?.metadata;
10560
- return extractFeeItems(fees, totalUsd, relayQuoteMetadata);
10561
- }, [quote, fallbackFees]);
10590
+ return extractFeeItems({
10591
+ fees,
10592
+ totalUsd,
10593
+ relayQuoteMetadata,
10594
+ uiCustomizations
10595
+ });
10596
+ }, [quote, fallbackFees, uiCustomizations]);
10562
10597
  const isExpandable = expandedItems.length > 0 && !isLoading && !valuesNotAvailable;
10563
10598
  return /* @__PURE__ */ React90.createElement(Box, null, /* @__PURE__ */ React90.createElement(
10564
10599
  Box,
@@ -17494,14 +17529,14 @@ import { useAccount as useAccount5, useSendTransaction, useWriteContract } from
17494
17529
 
17495
17530
  // src/utils/isMainnetUsdt.ts
17496
17531
  import { isTokenEquivalent as isTokenEquivalent4 } from "@funkit/utils";
17497
- import { mainnet as mainnet5 } from "viem/chains";
17532
+ import { mainnet as mainnet6 } from "viem/chains";
17498
17533
  var USDT_MAINNET_ADDRESS = "0xdAC17F958D2ee523a2206206994597C13D831ec7";
17499
17534
  function isMainnetUsdt(chainId, address) {
17500
17535
  return isTokenEquivalent4({
17501
17536
  firstTokenAddress: address,
17502
17537
  firstTokenChainId: chainId.toString(),
17503
17538
  secondTokenAddress: USDT_MAINNET_ADDRESS,
17504
- secondTokenChainId: mainnet5.id.toString()
17539
+ secondTokenChainId: mainnet6.id.toString()
17505
17540
  });
17506
17541
  }
17507
17542
 
@@ -20999,7 +21034,7 @@ import React167, { useEffect as useEffect38 } from "react";
20999
21034
  // src/domains/wallet.ts
21000
21035
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO15 } from "@funkit/chains";
21001
21036
  import { isNotNullish as isNotNullish7 } from "@funkit/utils";
21002
- import { mainnet as mainnet6, polygon as polygon6 } from "viem/chains";
21037
+ import { mainnet as mainnet7, polygon as polygon6 } from "viem/chains";
21003
21038
  var ASSETS_LOW_VALUE_THRESHOLD2 = 0.1;
21004
21039
 
21005
21040
  // src/hooks/usePaymentSources.ts
@@ -22395,7 +22430,7 @@ import {
22395
22430
  } from "@funkit/chains";
22396
22431
  import { getTokenAddressBySymbolAndChainId as getTokenAddressBySymbolAndChainId2 } from "@funkit/core";
22397
22432
  import { useCallback as useCallback31, useState as useState46 } from "react";
22398
- import { mainnet as mainnet7, mantle, zkSync as zkSync2 } from "viem/chains";
22433
+ import { mainnet as mainnet8, mantle, zkSync as zkSync2 } from "viem/chains";
22399
22434
  var pickSourceAssetForCard = async (checkoutItem, userIpInfo) => {
22400
22435
  if (!checkoutItem?.initSettings.config.targetChain) {
22401
22436
  throw new Error("pickSourceAssetForCard: Missing targetChain");
@@ -22419,7 +22454,7 @@ var pickSourceAssetForCard = async (checkoutItem, userIpInfo) => {
22419
22454
  sourceTokenAddress = NATIVE_TOKEN;
22420
22455
  sourceTokenChainId = moonpayChainId;
22421
22456
  } else {
22422
- sourceTokenChainId = isNyOrTxOrVi ? mainnet7.id.toString() : moonpayChainId;
22457
+ sourceTokenChainId = isNyOrTxOrVi ? mainnet8.id.toString() : moonpayChainId;
22423
22458
  if (isTargetAssetEthOrWeth) {
22424
22459
  sourceTokenTicker = "ETH" /* ETH */;
22425
22460
  sourceTokenAddress = NATIVE_TOKEN;
@@ -23440,7 +23475,7 @@ var TransferTokenDetails = ({
23440
23475
  import { solanaChain as solanaChain4 } from "@funkit/chains";
23441
23476
  import { FlagKey as FlagKey25 } from "@funkit/utils";
23442
23477
  import { useMemo as useMemo29 } from "react";
23443
- import { mainnet as mainnet8, polygon as polygon7 } from "viem/chains";
23478
+ import { mainnet as mainnet9, polygon as polygon7 } from "viem/chains";
23444
23479
  var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
23445
23480
  const { checkoutItem } = useCheckoutContext();
23446
23481
  const enableUniversal = useFlag(
@@ -23491,7 +23526,7 @@ var useMinTransferLimits = () => {
23491
23526
  };
23492
23527
  var useMinTransferValue = (selectedChainId) => {
23493
23528
  const limits = useMinTransferLimits();
23494
- const limit = selectedChainId === mainnet8.id ? limits.mainnet : limits.nonMainnet;
23529
+ const limit = selectedChainId === mainnet9.id ? limits.mainnet : limits.nonMainnet;
23495
23530
  return Math.ceil(limit);
23496
23531
  };
23497
23532
  var useMinTransferValues = (chainIds) => {
@@ -23499,7 +23534,7 @@ var useMinTransferValues = (chainIds) => {
23499
23534
  return useMemo29(() => {
23500
23535
  return chainIds.reduce(
23501
23536
  (acc, id) => {
23502
- const limit = id === mainnet8.id ? limits.mainnet : limits.nonMainnet;
23537
+ const limit = id === mainnet9.id ? limits.mainnet : limits.nonMainnet;
23503
23538
  acc[id] = Math.ceil(limit);
23504
23539
  return acc;
23505
23540
  },
@@ -31310,7 +31345,7 @@ function setFunkitConnectVersion({ version }) {
31310
31345
  localStorage.setItem(storageKey5, version);
31311
31346
  }
31312
31347
  function getCurrentSdkVersion() {
31313
- return "6.0.7";
31348
+ return "6.1.0";
31314
31349
  }
31315
31350
  function useFingerprint() {
31316
31351
  const fingerprint = useCallback50(() => {
@@ -37,6 +37,11 @@ export interface FunkitUiCustomizationsConfig {
37
37
  destinationConfig?: FunkitUiDestinationConfig;
38
38
  /** when source and destination are the same address, show destination as payment method instead of source */
39
39
  preferDestinationWhenSame?: boolean;
40
+ /** whether and how to show transaction fee's digest.
41
+ * 'none': show nothing
42
+ * 'chainDependent': show price impact and additionally show gas as well for eth-mainnet
43
+ * */
44
+ showTransactionDigest?: 'none' | 'chainDependent';
40
45
  };
41
46
  inputAmountScreen?: {
42
47
  /** Whether to allow entering an amount of tokens, rather than only USD - defaults to true */
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-DNSG5Q7V.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-23WIEY36.js";
9
+
10
+ // src/wallets/walletConnectors/clvWallet/clvWallet.ts
11
+ var clvWallet = ({
12
+ projectId,
13
+ walletConnectParameters
14
+ }) => {
15
+ const isCLVInjected = hasInjectedProvider({ namespace: "clover" });
16
+ const shouldUseWalletConnect = !isCLVInjected;
17
+ return {
18
+ id: "clv",
19
+ name: "CLV",
20
+ iconUrl: async () => (await import("./clvWallet-VVMLP7BK.js")).default,
21
+ iconBackground: "#fff",
22
+ iconAccent: "#BDFDE2",
23
+ installed: isCLVInjected,
24
+ downloadUrls: {
25
+ chrome: "https://chrome.google.com/webstore/detail/clv-wallet/nhnkbkgjikgcigadomkphalanndcapjk",
26
+ ios: "https://apps.apple.com/app/clover-wallet/id1570072858",
27
+ mobile: "https://apps.apple.com/app/clover-wallet/id1570072858",
28
+ qrCode: "https://clv.org/"
29
+ },
30
+ extension: {
31
+ instructions: {
32
+ learnMoreUrl: "https://clv.org/",
33
+ steps: [
34
+ {
35
+ description: "wallet_connectors.clv.extension.step1.description",
36
+ step: "install",
37
+ title: "wallet_connectors.clv.extension.step1.title"
38
+ },
39
+ {
40
+ description: "wallet_connectors.clv.extension.step2.description",
41
+ step: "create",
42
+ title: "wallet_connectors.clv.extension.step2.title"
43
+ },
44
+ {
45
+ description: "wallet_connectors.clv.extension.step3.description",
46
+ step: "refresh",
47
+ title: "wallet_connectors.clv.extension.step3.title"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ mobile: {
53
+ getUri: shouldUseWalletConnect ? (uri) => uri : void 0
54
+ },
55
+ qrCode: shouldUseWalletConnect ? {
56
+ getUri: (uri) => uri,
57
+ instructions: {
58
+ learnMoreUrl: "https://clv.org/",
59
+ steps: [
60
+ {
61
+ description: "wallet_connectors.clv.qr_code.step1.description",
62
+ step: "install",
63
+ title: "wallet_connectors.clv.qr_code.step1.title"
64
+ },
65
+ {
66
+ description: "wallet_connectors.clv.qr_code.step2.description",
67
+ step: "create",
68
+ title: "wallet_connectors.clv.qr_code.step2.title"
69
+ },
70
+ {
71
+ description: "wallet_connectors.clv.qr_code.step3.description",
72
+ step: "scan",
73
+ title: "wallet_connectors.clv.qr_code.step3.title"
74
+ }
75
+ ]
76
+ }
77
+ } : void 0,
78
+ createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
79
+ projectId,
80
+ walletConnectParameters
81
+ }) : getInjectedConnector({ namespace: "clover" })
82
+ };
83
+ };
84
+
85
+ export {
86
+ clvWallet
87
+ };
@@ -0,0 +1,70 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-DNSG5Q7V.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-23WIEY36.js";
9
+
10
+ // src/wallets/walletConnectors/rainbowWallet/rainbowWallet.ts
11
+ import { isAndroid, isIOS } from "@funkit/utils";
12
+ var rainbowWallet = ({
13
+ projectId,
14
+ walletConnectParameters
15
+ }) => {
16
+ const isRainbowInjected = hasInjectedProvider({ flag: "isRainbow" });
17
+ const shouldUseWalletConnect = !isRainbowInjected;
18
+ const getUri = (uri) => {
19
+ return isAndroid() ? uri : isIOS() ? `rainbow://wc?uri=${encodeURIComponent(uri)}&connector=rainbowkit` : `https://rnbwapp.com/wc?uri=${encodeURIComponent(
20
+ uri
21
+ )}&connector=rainbowkit`;
22
+ };
23
+ return {
24
+ id: "rainbow",
25
+ name: "Rainbow",
26
+ rdns: "me.rainbow",
27
+ iconUrl: async () => (await import("./rainbowWallet-MFJQCICF.js")).default,
28
+ iconBackground: "#0c2f78",
29
+ installed: !shouldUseWalletConnect ? isRainbowInjected : void 0,
30
+ downloadUrls: {
31
+ android: "https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",
32
+ ios: "https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",
33
+ mobile: "https://rainbow.download?utm_source=rainbowkit",
34
+ qrCode: "https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",
35
+ browserExtension: "https://rainbow.me/extension?utm_source=rainbowkit"
36
+ },
37
+ mobile: { getUri: shouldUseWalletConnect ? getUri : void 0 },
38
+ qrCode: shouldUseWalletConnect ? {
39
+ getUri,
40
+ instructions: {
41
+ learnMoreUrl: "https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",
42
+ steps: [
43
+ {
44
+ description: "wallet_connectors.rainbow.qr_code.step1.description",
45
+ step: "install",
46
+ title: "wallet_connectors.rainbow.qr_code.step1.title"
47
+ },
48
+ {
49
+ description: "wallet_connectors.rainbow.qr_code.step2.description",
50
+ step: "create",
51
+ title: "wallet_connectors.rainbow.qr_code.step2.title"
52
+ },
53
+ {
54
+ description: "wallet_connectors.rainbow.qr_code.step3.description",
55
+ step: "scan",
56
+ title: "wallet_connectors.rainbow.qr_code.step3.title"
57
+ }
58
+ ]
59
+ }
60
+ } : void 0,
61
+ createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
62
+ projectId,
63
+ walletConnectParameters
64
+ }) : getInjectedConnector({ flag: "isRainbow" })
65
+ };
66
+ };
67
+
68
+ export {
69
+ rainbowWallet
70
+ };