@funkit/connect 1.2.6 → 1.3.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/components/Box/Box.d.ts +3 -3
  3. package/dist/components/CloseButton/CloseButton.d.ts +1 -1
  4. package/dist/components/FunButton/FunIconButton.d.ts +7 -7
  5. package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +1 -1
  6. package/dist/components/FunNotification/FunCheckoutNotification.d.ts +1 -1
  7. package/dist/components/FunTransactionSummary/FunTxSummaryHistory.d.ts +1 -1
  8. package/dist/components/FunkitProvider/AppContext.d.ts +3 -3
  9. package/dist/components/FunkitProvider/CoolModeContext.d.ts +0 -1
  10. package/dist/components/FunkitProvider/FunkitCheckoutContext.d.ts +2 -7
  11. package/dist/components/FunkitProvider/FunkitConfigContext.d.ts +1 -1
  12. package/dist/components/FunkitProvider/FunkitSandboxContext.d.ts +0 -1
  13. package/dist/components/FunkitProvider/FunkitWeb2Provider.d.ts +2 -15
  14. package/dist/components/FunkitProvider/GeneralWalletProvider.d.ts +8 -8
  15. package/dist/components/FunkitProvider/ShowRecentTransactionsContext.d.ts +0 -1
  16. package/dist/components/FunkitProvider/provideFunkitConnectChains.d.ts +1 -1
  17. package/dist/components/FunkitProvider/useCoolMode.d.ts +0 -1
  18. package/dist/components/InfoButton/InfoButton.d.ts +1 -1
  19. package/dist/config/getDefaultConfig.d.ts +510 -510
  20. package/dist/consts/funkit.d.ts +30 -9
  21. package/dist/css/atoms.d.ts +0 -1
  22. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +10 -10
  23. package/dist/hooks/useCheckoutStateBooleans.d.ts +1 -1
  24. package/dist/index.css +3 -3
  25. package/dist/index.d.ts +1 -2
  26. package/dist/index.js +547 -191
  27. package/dist/themes/baseTheme.d.ts +1 -1
  28. package/dist/utils/checkout.d.ts +25 -25
  29. package/dist/utils/flags/config.d.ts +24 -0
  30. package/dist/utils/flags/endpoint.d.ts +22 -0
  31. package/dist/utils/flags/hash.d.ts +13 -0
  32. package/dist/utils/flags/impl.d.ts +26 -0
  33. package/dist/utils/flags/index.d.ts +9 -0
  34. package/dist/utils/flags/types.d.ts +39 -0
  35. package/dist/utils/funLogger.d.ts +7 -1
  36. package/dist/utils/memoize.d.ts +3 -0
  37. package/dist/utils/mesh.d.ts +0 -1
  38. package/dist/wallets/computeWalletConnectMetaData.d.ts +1 -1
  39. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  40. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/chunk-2DWBVWFI.js +87 -0
  43. package/dist/wallets/walletConnectors/chunk-32KBKKGT.js +182 -0
  44. package/dist/wallets/walletConnectors/chunk-3CLNL7LR.js +73 -0
  45. package/dist/wallets/walletConnectors/chunk-5L2OLU3J.js +102 -0
  46. package/dist/wallets/walletConnectors/chunk-7GGRZNT3.js +96 -0
  47. package/dist/wallets/walletConnectors/chunk-7YDZTPO4.js +100 -0
  48. package/dist/wallets/walletConnectors/chunk-BCXBFAL4.js +98 -0
  49. package/dist/wallets/walletConnectors/chunk-CMXZK5RR.js +94 -0
  50. package/dist/wallets/walletConnectors/chunk-F4EJ42XO.js +105 -0
  51. package/dist/wallets/walletConnectors/chunk-FL2VIO76.js +71 -0
  52. package/dist/wallets/walletConnectors/chunk-IIJOJ6AD.js +102 -0
  53. package/dist/wallets/walletConnectors/chunk-KZFAL4RZ.js +27 -0
  54. package/dist/wallets/walletConnectors/chunk-LJRV5JY7.js +95 -0
  55. package/dist/wallets/walletConnectors/chunk-M4SPCKW4.js +66 -0
  56. package/dist/wallets/walletConnectors/chunk-MSRKKVDE.js +98 -0
  57. package/dist/wallets/walletConnectors/chunk-NK3DYIAB.js +92 -0
  58. package/dist/wallets/walletConnectors/chunk-OMKARG6Y.js +94 -0
  59. package/dist/wallets/walletConnectors/chunk-R5GNFRXW.js +96 -0
  60. package/dist/wallets/walletConnectors/chunk-XB2GFXBL.js +107 -0
  61. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  62. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  63. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  64. package/dist/wallets/walletConnectors/dawnWallet/dawnWallet.js +2 -2
  65. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  66. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  67. package/dist/wallets/walletConnectors/funkitConnectWallet/funkitConnectWallet.js +4 -5
  68. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  69. package/dist/wallets/walletConnectors/index.js +72 -72
  70. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  71. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  72. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  73. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  74. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  75. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  76. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  77. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  78. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  79. package/package.json +11 -7
@@ -16,7 +16,7 @@ interface BaseThemeOptions {
16
16
  fontStack?: FontStack;
17
17
  overlayBlur?: Blurs;
18
18
  }
19
- export declare const baseTheme: ({ borderRadius, fontStack, fontSizing, customFontFamily, customFontWeights, overlayBlur, }: BaseThemeOptions) => Pick<ThemeVars, 'radii' | 'fonts' | 'fontWeight' | 'fontSize' | 'blurs'>;
19
+ export declare const baseTheme: ({ borderRadius, fontStack, fontSizing, customFontFamily, customFontWeights, overlayBlur, }: BaseThemeOptions) => Pick<ThemeVars, "radii" | "fonts" | "fontWeight" | "fontSize" | "blurs">;
20
20
  export interface AccentColor {
21
21
  accentColor: string;
22
22
  accentColorForeground: string;
@@ -1,5 +1,5 @@
1
- import { CheckoutHistoryItem, CheckoutState } from '@funkit/core';
2
- import { Hex } from 'viem';
1
+ import { CheckoutHistoryItem, CheckoutState } from '@funkit/api-base';
2
+ import { Address, Hex } from 'viem';
3
3
  import { UseConfigReturnType } from 'wagmi';
4
4
  import { FunkitCheckoutConfig } from '../components/FunkitProvider/FunkitCheckoutContext';
5
5
  export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
@@ -40,21 +40,21 @@ export declare function getFunkitEnvForDirectExecution({ chainId, }: {
40
40
  }): {
41
41
  chain: string;
42
42
  gasSponsor: {
43
- sponsorAddress?: `0x${string}` | undefined;
44
- token?: string | undefined;
45
- usePermit?: boolean | undefined;
46
- useCheckoutSponsor?: boolean | undefined;
43
+ sponsorAddress?: Address;
44
+ token?: string;
45
+ usePermit?: boolean;
46
+ useCheckoutSponsor?: boolean;
47
47
  };
48
- apiKey?: string | undefined;
48
+ apiKey?: string;
49
49
  fee?: {
50
- token?: string | undefined;
51
- amount?: number | undefined;
52
- gasPercent?: number | undefined;
53
- recipient: `0x${string}`;
54
- } | undefined;
55
- skipDBAction?: boolean | undefined;
56
- nonce?: bigint | undefined;
57
- bypassInit?: boolean | undefined;
50
+ token?: string;
51
+ amount?: number;
52
+ gasPercent?: number;
53
+ recipient: Address;
54
+ };
55
+ skipDBAction?: boolean;
56
+ nonce?: bigint;
57
+ bypassInit?: boolean;
58
58
  };
59
59
  /**
60
60
  * Generates an env config for checkout estimation
@@ -68,19 +68,19 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
68
68
  gasSponsor: {
69
69
  useCheckoutSponsor: boolean;
70
70
  sponsorAddress: any;
71
- token?: string | undefined;
72
- usePermit?: boolean | undefined;
71
+ token?: string;
72
+ usePermit?: boolean;
73
73
  };
74
74
  bypassInit: boolean;
75
- apiKey?: string | undefined;
75
+ apiKey?: string;
76
76
  fee?: {
77
- token?: string | undefined;
78
- amount?: number | undefined;
79
- gasPercent?: number | undefined;
80
- recipient: `0x${string}`;
81
- } | undefined;
82
- skipDBAction?: boolean | undefined;
83
- nonce?: bigint | undefined;
77
+ token?: string;
78
+ amount?: number;
79
+ gasPercent?: number;
80
+ recipient: Address;
81
+ };
82
+ skipDBAction?: boolean;
83
+ nonce?: bigint;
84
84
  };
85
85
  /**
86
86
  * Decorates a list of token strings with their chainId-specific tokenAddress and pickedChainId
@@ -0,0 +1,24 @@
1
+ import type { BooleanFlagConfig, StringFlagConfig } from './types';
2
+ /**
3
+ * Remember that these values show up in our logs
4
+ * Make sure the enum values are unique
5
+ * Once we ship a feature flag, we can't change the key.
6
+ */
7
+ export declare enum FlagKey {
8
+ /** Shows "or continue with" label on FunSignInStep */
9
+ ConnectSignInShowSocialLabel = "connect_sign_in_show_social_label",
10
+ /** Custom text for the select payment method button */
11
+ SelectPaymentMethodText = "select_payment_method_text",
12
+ /**
13
+ * Changing the copy for each of three payment methods:
14
+ * - “Cross-Chain Swap” → Wallet
15
+ * - “Debit or Credit” → Card
16
+ * - “Brokerage or Exchange” → Exchange
17
+ */
18
+ PaymentMethodCopyV1 = "payment_method_copy_v1"
19
+ }
20
+ export declare const flagConfig: {
21
+ [FlagKey.ConnectSignInShowSocialLabel]: BooleanFlagConfig;
22
+ [FlagKey.SelectPaymentMethodText]: StringFlagConfig;
23
+ [FlagKey.PaymentMethodCopyV1]: BooleanFlagConfig;
24
+ };
@@ -0,0 +1,22 @@
1
+ import type { AbstractFlags } from './types';
2
+ export declare const FLAG_ENDPOINT_HOST = "sdk-cdn.fun.xyz";
3
+ export declare const FLAG_PROD_ENDPOINT_PATH = "flags/v0/config.json";
4
+ export declare const FLAG_DEV_ENDPOINT_PATH = "flags/dev/config.json";
5
+ export declare const FLAG_PROD_ENDPOINT = "https://sdk-cdn.fun.xyz/flags/v0/config.json";
6
+ export type EndpointData<F extends AbstractFlags> = {
7
+ __meta__: {
8
+ build_time: string;
9
+ git_branch: string;
10
+ git_sha: string;
11
+ npm_version: string;
12
+ };
13
+ flags: F;
14
+ };
15
+ interface Env {
16
+ GIT_COMMIT_TIME: string;
17
+ GIT_BRANCH: string;
18
+ GIT_SHA: string;
19
+ npm_package_version: string;
20
+ }
21
+ export declare const generateEndpointJson: <F extends AbstractFlags>(env: Env, flags: F) => EndpointData<F>;
22
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ cyrb53 (c) 2018 bryc (github.com/bryc)
3
+ License: Public domain (or MIT if needed). Attribution appreciated.
4
+ A fast and simple 53-bit string hash function with decent collision resistance.
5
+ Largely inspired by MurmurHash2/3, but with a focus on speed/simplicity.
6
+ */
7
+ export declare const cyrb53: (str: string, seed?: number) => number;
8
+ /**
9
+ * Be careful changing this function, it will affect the rollout percentage.
10
+ * This hash function was picked because it's simple and fast and only needs
11
+ * to split across 100 buckets.
12
+ */
13
+ export declare const hashPct: (flag_key: string, value: string, pct: number) => boolean;
@@ -0,0 +1,26 @@
1
+ import type { AbstractFlags, BooleanFlagConfig, NumberFlagConfig, StringFlagConfig } from './types';
2
+ export interface UserContext {
3
+ apiKey: string;
4
+ userId?: string;
5
+ }
6
+ type FilterKeysBy<T, D> = {
7
+ [K in keyof D]: D[K] extends T ? K : never;
8
+ }[keyof D];
9
+ export declare class FeatureFlag<T extends AbstractFlags> {
10
+ private _config;
11
+ fetchFlagConfig: () => Promise<T>;
12
+ static createForTesting<T extends AbstractFlags>(flags: T, fetchFlagConfig: <T>() => Promise<T>): FeatureFlag<T>;
13
+ constructor(_config: T, fetchFlagConfig?: () => Promise<T>);
14
+ private flagConfig;
15
+ private userContext;
16
+ private derivedFlags;
17
+ private isUsingOnlineConfig;
18
+ init(userContext: UserContext): Promise<void>;
19
+ private deriveAllFlags;
20
+ private deriveFlag;
21
+ private evalCondition;
22
+ getBool(flagKey: FilterKeysBy<BooleanFlagConfig, T>, fallback: boolean): boolean;
23
+ getNumber(flagKey: FilterKeysBy<NumberFlagConfig, T>, fallback: number): number;
24
+ getString(flagKey: FilterKeysBy<StringFlagConfig, T>, fallback: string): string;
25
+ }
26
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FlagKey } from './config';
2
+ import { FeatureFlag } from './impl';
3
+ export { FlagKey };
4
+ declare const singleton: FeatureFlag<{
5
+ connect_sign_in_show_social_label: import("./types").BooleanFlagConfig;
6
+ select_payment_method_text: import("./types").StringFlagConfig;
7
+ payment_method_copy_v1: import("./types").BooleanFlagConfig;
8
+ }>;
9
+ export declare const flags: Pick<typeof singleton, "init" | "getBool" | "getNumber" | "getString">;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * These are the data types that a feature flag can return.
3
+ * Note: they need to be values that can be expressed in JSON
4
+ */
5
+ export type FlagConfig = BooleanFlagConfig | NumberFlagConfig | StringFlagConfig;
6
+ export interface BooleanFlagConfig {
7
+ type: 'boolean';
8
+ default_value: boolean;
9
+ overrides?: Override<boolean>[];
10
+ }
11
+ export interface NumberFlagConfig {
12
+ type: 'number';
13
+ default_value: number;
14
+ overrides?: Override<number>[];
15
+ }
16
+ export interface StringFlagConfig {
17
+ type: 'string';
18
+ default_value: string;
19
+ overrides?: Override<string>[];
20
+ }
21
+ export type InferFlagType<F extends FlagConfig> = F['type'] extends 'number' ? number : F['type'] extends 'string' ? string : F['type'] extends 'boolean' ? boolean : never;
22
+ type Override<T> = {
23
+ /** non-empty list of conditions, any condition will cause the value to match */
24
+ if_any: Condition[];
25
+ value: T;
26
+ };
27
+ export type Condition = {
28
+ type: 'pctRollout';
29
+ key: 'userId' | 'apiKey';
30
+ /** whole number from 0 - 100 inclusive */
31
+ pct: number;
32
+ } | {
33
+ type: 'isAnyOf';
34
+ key: 'userId' | 'apiKey';
35
+ /** non-empty list of API keys */
36
+ values: string[];
37
+ };
38
+ export type AbstractFlags = Record<string, FlagConfig>;
39
+ export {};
@@ -2,6 +2,9 @@ declare class FunLogger {
2
2
  protected apiKey: string | null;
3
3
  protected isDebugMode: boolean;
4
4
  protected userId: string | null;
5
+ protected userAddress: string | null;
6
+ protected userName: string | null;
7
+ protected userLoginType: string | null;
5
8
  protected sdkVersion: string | null;
6
9
  constructor();
7
10
  private getFunLogEnv;
@@ -20,7 +23,10 @@ declare class FunLogger {
20
23
  error(title: string, error: Error, data?: object): void;
21
24
  configure(apiKey: string | null, isDebug: boolean, sdkVersion: string): void;
22
25
  getUserId(): string | null;
23
- setUserId(userId: string): void;
26
+ getUserAddress(): string | null;
27
+ getUserName(): string | null;
28
+ getUserLoginType(): string | null;
29
+ setUserInfo(userId: string, userAddress: string, userName: string, userLoginType: string): void;
24
30
  }
25
31
  declare const logger: FunLogger;
26
32
  export { logger };
@@ -0,0 +1,3 @@
1
+ export declare const memoize: <F extends (...args: any[]) => any>(fn: F) => F & {
2
+ cache: Map<string, ReturnType<F>>;
3
+ };
@@ -1,5 +1,4 @@
1
1
  export declare const FUNKIT_MESH_CLIENT_ID = "8132aff4-56c9-4b1d-85b4-08dbdcc6199d";
2
- export declare const MESH_DEFAULT_USER_ID = "meshconnectkit";
3
2
  export declare enum MeshExchanges {
4
3
  Robinhood = "Robinhood",
5
4
  ETrade = "ETrade",
@@ -5,5 +5,5 @@ interface ComputeMetaDataParameters {
5
5
  appUrl?: string;
6
6
  appIcon?: string;
7
7
  }
8
- export declare const computeWalletConnectMetaData: ({ appName, appDescription, appUrl, appIcon, }: ComputeMetaDataParameters) => FunkitConnectWalletConnectParameters['metadata'];
8
+ export declare const computeWalletConnectMetaData: ({ appName, appDescription, appUrl, appIcon, }: ComputeMetaDataParameters) => FunkitConnectWalletConnectParameters["metadata"];
9
9
  export {};
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  bifrostWallet
4
- } from "../chunk-AFONKDII.js";
4
+ } from "../chunk-FL2VIO76.js";
5
+ import "../chunk-F3VCNZXS.js";
5
6
  import "../chunk-ZOLACFTK.js";
6
7
  import "../chunk-ZDU3JFGR.js";
7
- import "../chunk-F3VCNZXS.js";
8
8
  export {
9
9
  bifrostWallet
10
10
  };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  bitgetWallet
4
- } from "../chunk-OUQ3ZF2W.js";
4
+ } from "../chunk-7YDZTPO4.js";
5
+ import "../chunk-F3VCNZXS.js";
5
6
  import "../chunk-ZOLACFTK.js";
6
7
  import "../chunk-ZDU3JFGR.js";
7
- import "../chunk-F3VCNZXS.js";
8
8
  export {
9
9
  bitgetWallet
10
10
  };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bybitWallet
4
- } from "../chunk-ZBQT5PV6.js";
5
- import "../chunk-ZDU3JFGR.js";
4
+ } from "../chunk-BCXBFAL4.js";
6
5
  import "../chunk-F3VCNZXS.js";
6
+ import "../chunk-ZDU3JFGR.js";
7
7
  export {
8
8
  bybitWallet
9
9
  };
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-F3VCNZXS.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-ZDU3JFGR.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-RM4V57ZB.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,182 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-F3VCNZXS.js";
6
+ import {
7
+ isAndroid,
8
+ isIOS
9
+ } from "./chunk-ZOLACFTK.js";
10
+ import {
11
+ getWalletConnectConnector
12
+ } from "./chunk-ZDU3JFGR.js";
13
+
14
+ // src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
15
+ function isMetaMask(ethereum) {
16
+ if (!(ethereum == null ? void 0 : ethereum.isMetaMask))
17
+ return false;
18
+ if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state)
19
+ return false;
20
+ if (ethereum.isApexWallet)
21
+ return false;
22
+ if (ethereum.isAvalanche)
23
+ return false;
24
+ if (ethereum.isBackpack)
25
+ return false;
26
+ if (ethereum.isBifrost)
27
+ return false;
28
+ if (ethereum.isBitKeep)
29
+ return false;
30
+ if (ethereum.isBitski)
31
+ return false;
32
+ if (ethereum.isBlockWallet)
33
+ return false;
34
+ if (ethereum.isCoinbaseWallet)
35
+ return false;
36
+ if (ethereum.isDawn)
37
+ return false;
38
+ if (ethereum.isEnkrypt)
39
+ return false;
40
+ if (ethereum.isExodus)
41
+ return false;
42
+ if (ethereum.isFrame)
43
+ return false;
44
+ if (ethereum.isFrontier)
45
+ return false;
46
+ if (ethereum.isGamestop)
47
+ return false;
48
+ if (ethereum.isHyperPay)
49
+ return false;
50
+ if (ethereum.isImToken)
51
+ return false;
52
+ if (ethereum.isKuCoinWallet)
53
+ return false;
54
+ if (ethereum.isMathWallet)
55
+ return false;
56
+ if (ethereum.isNestWallet)
57
+ return false;
58
+ if (ethereum.isOkxWallet || ethereum.isOKExWallet)
59
+ return false;
60
+ if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
61
+ return false;
62
+ if (ethereum.isOpera)
63
+ return false;
64
+ if (ethereum.isPhantom)
65
+ return false;
66
+ if (ethereum.isPortal)
67
+ return false;
68
+ if (ethereum.isRabby)
69
+ return false;
70
+ if (ethereum.isRainbow)
71
+ return false;
72
+ if (ethereum.isStatus)
73
+ return false;
74
+ if (ethereum.isTalisman)
75
+ return false;
76
+ if (ethereum.isTally)
77
+ return false;
78
+ if (ethereum.isTokenPocket)
79
+ return false;
80
+ if (ethereum.isTokenary)
81
+ return false;
82
+ if (ethereum.isTrust || ethereum.isTrustWallet)
83
+ return false;
84
+ if (ethereum.isXDEFI)
85
+ return false;
86
+ if (ethereum.isZeal)
87
+ return false;
88
+ if (ethereum.isZerion)
89
+ return false;
90
+ return true;
91
+ }
92
+ var metaMaskWallet = ({
93
+ projectId,
94
+ walletConnectParameters
95
+ }) => {
96
+ var _a, _b, _c;
97
+ const isMetaMaskInjected = hasInjectedProvider({ flag: "isMetaMask" });
98
+ const shouldUseWalletConnect = !isMetaMaskInjected;
99
+ const getUri = (uri) => {
100
+ return isAndroid() ? uri : isIOS() ? `metamask://wc?uri=${encodeURIComponent(uri)}` : `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}`;
101
+ };
102
+ return {
103
+ id: "metaMask",
104
+ name: "MetaMask",
105
+ rdns: "io.metamask",
106
+ iconUrl: async () => (await import("./metaMaskWallet-ORHUNQRP.js")).default,
107
+ iconAccent: "#f6851a",
108
+ iconBackground: "#fff",
109
+ installed: !shouldUseWalletConnect ? isMetaMaskInjected : void 0,
110
+ downloadUrls: {
111
+ android: "https://play.google.com/store/apps/details?id=io.metamask",
112
+ ios: "https://apps.apple.com/us/app/metamask/id1438144202",
113
+ mobile: "https://metamask.io/download",
114
+ qrCode: "https://metamask.io/download",
115
+ chrome: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
116
+ edge: "https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",
117
+ firefox: "https://addons.mozilla.org/firefox/addon/ether-metamask",
118
+ opera: "https://addons.opera.com/extensions/details/metamask-10",
119
+ browserExtension: "https://metamask.io/download"
120
+ },
121
+ mobile: {
122
+ getUri: shouldUseWalletConnect ? getUri : void 0
123
+ },
124
+ qrCode: shouldUseWalletConnect ? {
125
+ getUri,
126
+ instructions: {
127
+ learnMoreUrl: "https://metamask.io/faqs/",
128
+ steps: [
129
+ {
130
+ description: "wallet_connectors.metamask.qr_code.step1.description",
131
+ step: "install",
132
+ title: "wallet_connectors.metamask.qr_code.step1.title"
133
+ },
134
+ {
135
+ description: "wallet_connectors.metamask.qr_code.step2.description",
136
+ step: "create",
137
+ title: "wallet_connectors.metamask.qr_code.step2.title"
138
+ },
139
+ {
140
+ description: "wallet_connectors.metamask.qr_code.step3.description",
141
+ step: "refresh",
142
+ title: "wallet_connectors.metamask.qr_code.step3.title"
143
+ }
144
+ ]
145
+ }
146
+ } : void 0,
147
+ extension: {
148
+ instructions: {
149
+ learnMoreUrl: "https://metamask.io/faqs/",
150
+ steps: [
151
+ {
152
+ description: "wallet_connectors.metamask.extension.step1.description",
153
+ step: "install",
154
+ title: "wallet_connectors.metamask.extension.step1.title"
155
+ },
156
+ {
157
+ description: "wallet_connectors.metamask.extension.step2.description",
158
+ step: "create",
159
+ title: "wallet_connectors.metamask.extension.step2.title"
160
+ },
161
+ {
162
+ description: "wallet_connectors.metamask.extension.step3.description",
163
+ step: "refresh",
164
+ title: "wallet_connectors.metamask.extension.step3.title"
165
+ }
166
+ ]
167
+ }
168
+ },
169
+ createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
170
+ projectId,
171
+ walletConnectParameters
172
+ }) : getInjectedConnector({
173
+ target: typeof window !== "undefined" ? (_c = (_b = (_a = window.ethereum) == null ? void 0 : _a.providers) == null ? void 0 : _b.find(
174
+ isMetaMask
175
+ )) != null ? _c : window.ethereum : void 0
176
+ })
177
+ };
178
+ };
179
+
180
+ export {
181
+ metaMaskWallet
182
+ };
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-F3VCNZXS.js";
6
+ import {
7
+ isAndroid,
8
+ isIOS
9
+ } from "./chunk-ZOLACFTK.js";
10
+ import {
11
+ getWalletConnectConnector
12
+ } from "./chunk-ZDU3JFGR.js";
13
+
14
+ // src/wallets/walletConnectors/rainbowWallet/rainbowWallet.ts
15
+ var rainbowWallet = ({
16
+ projectId,
17
+ walletConnectParameters
18
+ }) => {
19
+ const isRainbowInjected = hasInjectedProvider({ flag: "isRainbow" });
20
+ const shouldUseWalletConnect = !isRainbowInjected;
21
+ const getUri = (uri) => {
22
+ return isAndroid() ? uri : isIOS() ? `rainbow://wc?uri=${encodeURIComponent(uri)}&connector=rainbowkit` : `https://rnbwapp.com/wc?uri=${encodeURIComponent(
23
+ uri
24
+ )}&connector=rainbowkit`;
25
+ };
26
+ return {
27
+ id: "rainbow",
28
+ name: "Rainbow",
29
+ rdns: "me.rainbow",
30
+ iconUrl: async () => (await import("./rainbowWallet-GGU64QEI.js")).default,
31
+ iconBackground: "#0c2f78",
32
+ installed: !shouldUseWalletConnect ? isRainbowInjected : void 0,
33
+ downloadUrls: {
34
+ android: "https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",
35
+ ios: "https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",
36
+ mobile: "https://rainbow.download?utm_source=rainbowkit",
37
+ qrCode: "https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",
38
+ browserExtension: "https://rainbow.me/extension?utm_source=rainbowkit"
39
+ },
40
+ mobile: { getUri: shouldUseWalletConnect ? getUri : void 0 },
41
+ qrCode: shouldUseWalletConnect ? {
42
+ getUri,
43
+ instructions: {
44
+ learnMoreUrl: "https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",
45
+ steps: [
46
+ {
47
+ description: "wallet_connectors.rainbow.qr_code.step1.description",
48
+ step: "install",
49
+ title: "wallet_connectors.rainbow.qr_code.step1.title"
50
+ },
51
+ {
52
+ description: "wallet_connectors.rainbow.qr_code.step2.description",
53
+ step: "create",
54
+ title: "wallet_connectors.rainbow.qr_code.step2.title"
55
+ },
56
+ {
57
+ description: "wallet_connectors.rainbow.qr_code.step3.description",
58
+ step: "scan",
59
+ title: "wallet_connectors.rainbow.qr_code.step3.title"
60
+ }
61
+ ]
62
+ }
63
+ } : void 0,
64
+ createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
65
+ projectId,
66
+ walletConnectParameters
67
+ }) : getInjectedConnector({ flag: "isRainbow" })
68
+ };
69
+ };
70
+
71
+ export {
72
+ rainbowWallet
73
+ };