@funkit/connect 0.1.13 → 0.1.15

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 (30) hide show
  1. package/dist/{chunk-UOUEGWLS.js → chunk-47OHV4T2.js} +2 -2
  2. package/dist/{chunk-Q73FKLU4.js → chunk-C2QHNJBG.js} +2 -2
  3. package/dist/{chunk-BQU2NRO5.js → chunk-IDQLTS4C.js} +231 -98
  4. package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +1 -1
  5. package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.d.ts +2 -1
  6. package/dist/components/FunkitProvider/FunkitCheckoutContext.d.ts +8 -4
  7. package/dist/components/FunkitProvider/ModalContext.d.ts +1 -1
  8. package/dist/components/index.js +3 -3
  9. package/dist/hooks/useCheckoutType.d.ts +5 -0
  10. package/dist/hooks/useFunListeners.d.ts +2 -1
  11. package/dist/index.js +3 -3
  12. package/dist/themes/darkTheme.js +1 -1
  13. package/dist/themes/lightTheme.js +1 -1
  14. package/dist/utils/checkout.d.ts +1 -0
  15. package/dist/wallets/walletConnectors/index.js +41 -41
  16. package/package.json +4 -4
  17. package/dist/wallets/walletConnectors/chunk-2XHTO74O.js +0 -226
  18. package/dist/wallets/walletConnectors/chunk-4WS4ZSRN.js +0 -84
  19. package/dist/wallets/walletConnectors/chunk-BDKAIAQA.js +0 -71
  20. package/dist/wallets/walletConnectors/chunk-DBMFZSXN.js +0 -52
  21. package/dist/wallets/walletConnectors/chunk-FTTYELWN.js +0 -71
  22. package/dist/wallets/walletConnectors/chunk-JJICTRJY.js +0 -114
  23. package/dist/wallets/walletConnectors/chunk-KUXG7P5Q.js +0 -102
  24. package/dist/wallets/walletConnectors/chunk-LBSWP7R6.js +0 -81
  25. package/dist/wallets/walletConnectors/chunk-MDDT3PSR.js +0 -110
  26. package/dist/wallets/walletConnectors/chunk-Q6N2YWW4.js +0 -112
  27. package/dist/wallets/walletConnectors/chunk-RL5OHS6R.js +0 -113
  28. package/dist/wallets/walletConnectors/chunk-TORM2ZGA.js +0 -117
  29. package/dist/wallets/walletConnectors/chunk-VAR774R5.js +0 -105
  30. package/dist/wallets/walletConnectors/chunk-X6A7D2EA.js +0 -71
@@ -1,7 +1,7 @@
1
1
  import { CheckoutHistoryItem } from '@funkit/core';
2
2
  import React from 'react';
3
3
  /**
4
- * Processing info about a checkout history item (already created in backed)
4
+ * Processing info about a checkout history item (already created in backend)
5
5
  */
6
6
  export declare function FunCheckoutHistoryDetail({ checkoutHistoryInfo, }: {
7
7
  checkoutHistoryInfo: CheckoutHistoryItem;
@@ -3,6 +3,7 @@ interface FunCheckoutHistoryModalProps {
3
3
  open: boolean;
4
4
  onClose: () => void;
5
5
  depositAddress: string;
6
+ isCheckoutSpecialCrFlow: boolean;
6
7
  }
7
- export declare function FunCheckoutHistoryModal({ onClose, open, depositAddress, }: FunCheckoutHistoryModalProps): React.JSX.Element;
8
+ export declare function FunCheckoutHistoryModal({ onClose, open, depositAddress, isCheckoutSpecialCrFlow, }: FunCheckoutHistoryModalProps): React.JSX.Element;
8
9
  export {};
@@ -61,15 +61,19 @@ export type FunkitCheckoutResult = {
61
61
  interface useFunkitCheckoutProps {
62
62
  /** @required the checkout config object **/
63
63
  config: FunkitCheckoutConfig;
64
+ /** @optional fires when the checkout modal is opened **/
65
+ onOpen?: () => void;
66
+ /** @optional fires when the checkout modal is closed **/
67
+ onClose?: () => void;
64
68
  /** @optional fires when checkout config is done validating **/
65
69
  onValidation?: (result: FunkitCheckoutValidationResult) => void;
66
70
  /** @optional fires when a checkout quote is received **/
67
71
  onEstimation?: (result: FunkitCheckoutQuoteResult) => void;
68
72
  /** @optional fires when a checkout if confirmed with the funkit server **/
69
73
  onConfirmation?: () => void;
70
- /** @optional fires if the checkout fails at any point */
74
+ /** @optional fires if the checkout fails at any point **/
71
75
  onError?: (result: FunkitCheckoutResult) => void;
72
- /** @optional fires if the checkout fails at any point */
76
+ /** @optional fires if the checkout fails at any point **/
73
77
  onSuccess?: (result: FunkitCheckoutResult) => void;
74
78
  }
75
79
  /**
@@ -118,7 +122,7 @@ export declare const useFunkitPreCheckoutInternal: (checkoutId: string | null) =
118
122
  /**
119
123
  * Internal hook to handle post-checkout, PER-BACKEND-CHECKOUT ITEM.
120
124
  */
121
- export declare const useFunkitPostCheckoutInternal: (depositAddress: Address) => {
125
+ export declare const useFunkitPostCheckoutInternal: (depositAddress: Address, isCheckoutSpecialCrFlow: boolean) => {
122
126
  isLoading: boolean;
123
127
  checkoutHistoryInfo: CheckoutHistoryItem | undefined;
124
128
  };
@@ -130,7 +134,7 @@ export declare const useFunkitAllPostCheckoutsInternal: () => {
130
134
  checkoutHistoryStateMap: CheckoutHistoryStateMap;
131
135
  isCheckoutHistoryInited: boolean;
132
136
  isRefreshingCheckoutHistory: boolean;
133
- startCheckoutHistoryListener: () => void;
137
+ startCheckoutHistoryListener: (recipientAddr?: Address | undefined) => void;
134
138
  stopCheckoutHistoryListener: () => void;
135
139
  };
136
140
  /**
@@ -28,7 +28,7 @@ export declare function useFunCheckoutModal(): {
28
28
  };
29
29
  export declare function useFunCheckoutHistoryModal(): {
30
30
  funCheckoutHistoryModalOpen: boolean;
31
- openFunCheckoutHistoryModal: ((depositAddress: string) => void) | undefined;
31
+ openFunCheckoutHistoryModal: ((depositAddress: string, isCheckoutSpecialCrFlow: boolean) => void) | undefined;
32
32
  };
33
33
  export declare function useFunDevTestModal(): {
34
34
  funDevTestModalOpen: boolean;
@@ -4,9 +4,9 @@ import {
4
4
  FunkitProvider,
5
5
  NATIVE_TOKEN,
6
6
  useFunkitCheckout
7
- } from "../chunk-BQU2NRO5.js";
8
- import "../chunk-UOUEGWLS.js";
9
- import "../chunk-Q73FKLU4.js";
7
+ } from "../chunk-IDQLTS4C.js";
8
+ import "../chunk-47OHV4T2.js";
9
+ import "../chunk-C2QHNJBG.js";
10
10
  import "../chunk-VP4CAK4A.js";
11
11
  export {
12
12
  ConnectButton,
@@ -0,0 +1,5 @@
1
+ import { FunkitActiveCheckoutItem } from '../components/FunkitProvider/FunkitCheckoutContext';
2
+ export declare function useCheckoutType(checkoutItem: FunkitActiveCheckoutItem | null): {
3
+ isCheckoutCrFlow: any;
4
+ isCheckoutSpecialCrFlow: any;
5
+ };
@@ -1,7 +1,8 @@
1
+ import { Address } from 'viem';
1
2
  /**
2
3
  * Handles the starting and stopping of checkout history listeners based on the calling component's mount/unmount status
3
4
  */
4
- export declare function useCheckoutHistoryListener(activate?: boolean): void;
5
+ export declare function useCheckoutHistoryListener(activate?: boolean, recipientAddr?: Address | undefined): void;
5
6
  /**
6
7
  * Handles the starting and stopping of asset listeners based on the calling component's mount/unmount status
7
8
  */
package/dist/index.js CHANGED
@@ -31,13 +31,13 @@ import {
31
31
  useFunCheckoutModal,
32
32
  useFunkitCheckout,
33
33
  useWalletConnectors
34
- } from "./chunk-BQU2NRO5.js";
34
+ } from "./chunk-IDQLTS4C.js";
35
35
  import {
36
36
  darkTheme
37
- } from "./chunk-UOUEGWLS.js";
37
+ } from "./chunk-47OHV4T2.js";
38
38
  import {
39
39
  lightTheme
40
- } from "./chunk-Q73FKLU4.js";
40
+ } from "./chunk-C2QHNJBG.js";
41
41
  import "./chunk-VP4CAK4A.js";
42
42
 
43
43
  // src/components/ConnectOptions/MobileOptions.tsx
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-UOUEGWLS.js";
4
+ } from "../chunk-47OHV4T2.js";
5
5
  import "../chunk-VP4CAK4A.js";
6
6
  export {
7
7
  darkTheme
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-Q73FKLU4.js";
4
+ } from "../chunk-C2QHNJBG.js";
5
5
  import "../chunk-VP4CAK4A.js";
6
6
  export {
7
7
  lightTheme
@@ -99,6 +99,7 @@ export interface CheckoutHistoryStateMap {
99
99
  export declare function categorizeCheckoutHistories(checkoutHistoryList: CheckoutHistoryItem[]): {
100
100
  stateMap: CheckoutHistoryStateMap;
101
101
  depositAddrMap: CheckoutHistoryDepositAddrMap;
102
+ currentDepositAddrMap: CheckoutHistoryDepositAddrMap;
102
103
  };
103
104
  export declare function getCheckoutStateStepNumber(state: CheckoutState): 0 | 1 | 3 | 2;
104
105
  export declare function formatTokenAmountForMoonpay(amount: number): string;
@@ -1,16 +1,25 @@
1
1
  "use client";
2
2
  import {
3
- rainbowWallet
4
- } from "./chunk-IEAKLGB6.js";
3
+ zerionWallet
4
+ } from "./chunk-77KYAV4P.js";
5
5
  import {
6
- trustWallet
7
- } from "./chunk-YWKKNHO3.js";
6
+ subWallet
7
+ } from "./chunk-PTF3JKWO.js";
8
+ import {
9
+ safepalWallet
10
+ } from "./chunk-TZR3P22N.js";
11
+ import {
12
+ talismanWallet
13
+ } from "./chunk-5UETJ33B.js";
8
14
  import {
9
15
  tokenPocketWallet
10
16
  } from "./chunk-3XLDPS4Y.js";
11
17
  import {
12
18
  uniswapWallet
13
19
  } from "./chunk-APZ6YBCA.js";
20
+ import {
21
+ trustWallet
22
+ } from "./chunk-YWKKNHO3.js";
14
23
  import {
15
24
  walletConnectWallet
16
25
  } from "./chunk-XXTDCRCW.js";
@@ -21,42 +30,41 @@ import {
21
30
  zealWallet
22
31
  } from "./chunk-QBKHMTGI.js";
23
32
  import {
24
- zerionWallet
25
- } from "./chunk-77KYAV4P.js";
26
- import {
27
- coinbaseWallet
28
- } from "./chunk-WFTAXMQP.js";
29
- import "./chunk-UZ5XLPAW.js";
33
+ oktoWallet
34
+ } from "./chunk-VW5SMBMG.js";
30
35
  import {
31
- imTokenWallet
32
- } from "./chunk-7EOFWORX.js";
36
+ oneKeyWallet
37
+ } from "./chunk-6CW3SAA3.js";
33
38
  import {
34
- injectedWallet
35
- } from "./chunk-U32TVZ7G.js";
39
+ phantomWallet
40
+ } from "./chunk-KUZFZL2D.js";
36
41
  import {
37
- oktoWallet
38
- } from "./chunk-VW5SMBMG.js";
42
+ rabbyWallet
43
+ } from "./chunk-TNC2B7LX.js";
39
44
  import {
40
- safeheronWallet
41
- } from "./chunk-7WTKIVCW.js";
45
+ rainbowWallet
46
+ } from "./chunk-IEAKLGB6.js";
42
47
  import {
43
48
  safeWallet
44
49
  } from "./chunk-BNTZHUB6.js";
45
50
  import {
46
- safepalWallet
47
- } from "./chunk-TZR3P22N.js";
48
- import {
49
- subWallet
50
- } from "./chunk-PTF3JKWO.js";
51
+ safeheronWallet
52
+ } from "./chunk-7WTKIVCW.js";
51
53
  import {
52
54
  tahoWallet
53
55
  } from "./chunk-OOGGCCFQ.js";
54
- import {
55
- talismanWallet
56
- } from "./chunk-5UETJ33B.js";
57
56
  import {
58
57
  frontierWallet
59
58
  } from "./chunk-4EKX7Z25.js";
59
+ import {
60
+ imTokenWallet
61
+ } from "./chunk-7EOFWORX.js";
62
+ import {
63
+ injectedWallet
64
+ } from "./chunk-U32TVZ7G.js";
65
+ import {
66
+ ledgerWallet
67
+ } from "./chunk-GLB4HFDR.js";
60
68
  import {
61
69
  metaMaskWallet
62
70
  } from "./chunk-MOWIPEYK.js";
@@ -69,18 +77,13 @@ import {
69
77
  import {
70
78
  omniWallet
71
79
  } from "./chunk-NEDPCNTA.js";
72
- import {
73
- oneKeyWallet
74
- } from "./chunk-6CW3SAA3.js";
75
- import {
76
- phantomWallet
77
- } from "./chunk-KUZFZL2D.js";
78
- import {
79
- rabbyWallet
80
- } from "./chunk-TNC2B7LX.js";
81
80
  import {
82
81
  coin98Wallet
83
82
  } from "./chunk-LVMQKSKW.js";
83
+ import {
84
+ coinbaseWallet
85
+ } from "./chunk-WFTAXMQP.js";
86
+ import "./chunk-UZ5XLPAW.js";
84
87
  import {
85
88
  coreWallet
86
89
  } from "./chunk-T3RIVRAX.js";
@@ -99,9 +102,6 @@ import {
99
102
  import {
100
103
  frameWallet
101
104
  } from "./chunk-MBFEMLUU.js";
102
- import {
103
- ledgerWallet
104
- } from "./chunk-GLB4HFDR.js";
105
105
  import {
106
106
  argentWallet
107
107
  } from "./chunk-LEWQ7DQV.js";
@@ -113,6 +113,9 @@ import {
113
113
  bitgetWallet
114
114
  } from "./chunk-6FQF7H7H.js";
115
115
  import "./chunk-ZOLACFTK.js";
116
+ import {
117
+ bitskiWallet
118
+ } from "./chunk-FL3REGA5.js";
116
119
  import {
117
120
  braveWallet
118
121
  } from "./chunk-INSQDNCE.js";
@@ -120,9 +123,6 @@ import {
120
123
  clvWallet
121
124
  } from "./chunk-EHO4MJZJ.js";
122
125
  import "./chunk-6T5K52ZY.js";
123
- import {
124
- bitskiWallet
125
- } from "./chunk-FL3REGA5.js";
126
126
  export {
127
127
  argentWallet,
128
128
  bifrostWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -84,9 +84,9 @@
84
84
  "wagmi": "~1.4.6"
85
85
  },
86
86
  "dependencies": {
87
- "@front-finance/link": "^1.1.9",
88
- "@funkit/core": "^0.10.9",
89
- "@funkit/wagmi-tools": "^0.1.8",
87
+ "@meshconnect/web-link-sdk": "^2.0.1",
88
+ "@funkit/core": "^0.10.11",
89
+ "@funkit/wagmi-tools": "^0.1.10",
90
90
  "@moonpay/moonpay-react": "^1.4.1",
91
91
  "@privy-io/js-sdk-core": "^0.11.0",
92
92
  "@types/uuid": "^9.0.1",
@@ -1,226 +0,0 @@
1
- "use client";
2
- import {
3
- getWalletConnectConnector,
4
- getWalletConnectUri
5
- } from "./chunk-6T5K52ZY.js";
6
- import {
7
- isAndroid,
8
- isIOS
9
- } from "./chunk-ZOLACFTK.js";
10
-
11
- // src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
12
- import { MetaMaskConnector } from "wagmi/connectors/metaMask";
13
- function isMetaMask(ethereum) {
14
- if (!ethereum?.isMetaMask) {
15
- return false;
16
- }
17
- if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state) {
18
- return false;
19
- }
20
- if (ethereum.isApexWallet) {
21
- return false;
22
- }
23
- if (ethereum.isAvalanche) {
24
- return false;
25
- }
26
- if (ethereum.isBackpack) {
27
- return false;
28
- }
29
- if (ethereum.isBifrost) {
30
- return false;
31
- }
32
- if (ethereum.isBitKeep) {
33
- return false;
34
- }
35
- if (ethereum.isBitski) {
36
- return false;
37
- }
38
- if (ethereum.isBlockWallet) {
39
- return false;
40
- }
41
- if (ethereum.isCoinbaseWallet) {
42
- return false;
43
- }
44
- if (ethereum.isDawn) {
45
- return false;
46
- }
47
- if (ethereum.isEnkrypt) {
48
- return false;
49
- }
50
- if (ethereum.isExodus) {
51
- return false;
52
- }
53
- if (ethereum.isFrame) {
54
- return false;
55
- }
56
- if (ethereum.isFrontier) {
57
- return false;
58
- }
59
- if (ethereum.isGamestop) {
60
- return false;
61
- }
62
- if (ethereum.isHyperPay) {
63
- return false;
64
- }
65
- if (ethereum.isImToken) {
66
- return false;
67
- }
68
- if (ethereum.isKuCoinWallet) {
69
- return false;
70
- }
71
- if (ethereum.isMathWallet) {
72
- return false;
73
- }
74
- if (ethereum.isOkxWallet || ethereum.isOKExWallet) {
75
- return false;
76
- }
77
- if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet) {
78
- return false;
79
- }
80
- if (ethereum.isOpera) {
81
- return false;
82
- }
83
- if (ethereum.isPhantom) {
84
- return false;
85
- }
86
- if (ethereum.isPortal) {
87
- return false;
88
- }
89
- if (ethereum.isRabby) {
90
- return false;
91
- }
92
- if (ethereum.isRainbow) {
93
- return false;
94
- }
95
- if (ethereum.isStatus) {
96
- return false;
97
- }
98
- if (ethereum.isTalisman) {
99
- return false;
100
- }
101
- if (ethereum.isTally) {
102
- return false;
103
- }
104
- if (ethereum.isTokenPocket) {
105
- return false;
106
- }
107
- if (ethereum.isTokenary) {
108
- return false;
109
- }
110
- if (ethereum.isTrust || ethereum.isTrustWallet) {
111
- return false;
112
- }
113
- if (ethereum.isXDEFI) {
114
- return false;
115
- }
116
- if (ethereum.isZeal) {
117
- return false;
118
- }
119
- if (ethereum.isZerion) {
120
- return false;
121
- }
122
- return true;
123
- }
124
- var metaMaskWallet = ({
125
- chains,
126
- projectId,
127
- walletConnectOptions,
128
- walletConnectVersion = "2",
129
- ...options
130
- }) => {
131
- const providers = typeof window !== "undefined" && window.ethereum?.providers;
132
- const isMetaMaskInjected = typeof window !== "undefined" && typeof window.ethereum !== "undefined" && (window.ethereum.providers?.some(isMetaMask) || window.ethereum.isMetaMask);
133
- const shouldUseWalletConnect = !isMetaMaskInjected;
134
- return {
135
- id: "metaMask",
136
- name: "MetaMask",
137
- iconUrl: async () => (await import("./metaMaskWallet-ORHUNQRP.js")).default,
138
- iconAccent: "#f6851a",
139
- iconBackground: "#fff",
140
- installed: !shouldUseWalletConnect ? isMetaMaskInjected : void 0,
141
- downloadUrls: {
142
- android: "https://play.google.com/store/apps/details?id=io.metamask",
143
- ios: "https://apps.apple.com/us/app/metamask/id1438144202",
144
- mobile: "https://metamask.io/download",
145
- qrCode: "https://metamask.io/download",
146
- chrome: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
147
- edge: "https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",
148
- firefox: "https://addons.mozilla.org/firefox/addon/ether-metamask",
149
- opera: "https://addons.opera.com/extensions/details/metamask-10",
150
- browserExtension: "https://metamask.io/download"
151
- },
152
- createConnector: () => {
153
- const connector = shouldUseWalletConnect ? getWalletConnectConnector({
154
- projectId,
155
- chains,
156
- version: walletConnectVersion,
157
- options: walletConnectOptions
158
- }) : new MetaMaskConnector({
159
- chains,
160
- options: {
161
- getProvider: () => providers ? providers.find(isMetaMask) : typeof window !== "undefined" ? window.ethereum : void 0,
162
- ...options
163
- }
164
- });
165
- const getUri = async () => {
166
- const uri = await getWalletConnectUri(connector, walletConnectVersion);
167
- return isAndroid() ? uri : isIOS() ? `metamask://wc?uri=${encodeURIComponent(uri)}` : `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}`;
168
- };
169
- return {
170
- connector,
171
- mobile: {
172
- getUri: shouldUseWalletConnect ? getUri : void 0
173
- },
174
- qrCode: shouldUseWalletConnect ? {
175
- getUri,
176
- instructions: {
177
- learnMoreUrl: "https://metamask.io/faqs/",
178
- steps: [
179
- {
180
- description: "wallet_connectors.metamask.qr_code.step1.description",
181
- step: "install",
182
- title: "wallet_connectors.metamask.qr_code.step1.title"
183
- },
184
- {
185
- description: "wallet_connectors.metamask.qr_code.step2.description",
186
- step: "create",
187
- title: "wallet_connectors.metamask.qr_code.step2.title"
188
- },
189
- {
190
- description: "wallet_connectors.metamask.qr_code.step3.description",
191
- step: "refresh",
192
- title: "wallet_connectors.metamask.qr_code.step3.title"
193
- }
194
- ]
195
- }
196
- } : void 0,
197
- extension: {
198
- instructions: {
199
- learnMoreUrl: "https://metamask.io/faqs/",
200
- steps: [
201
- {
202
- description: "wallet_connectors.metamask.extension.step1.description",
203
- step: "install",
204
- title: "wallet_connectors.metamask.extension.step1.title"
205
- },
206
- {
207
- description: "wallet_connectors.metamask.extension.step2.description",
208
- step: "create",
209
- title: "wallet_connectors.metamask.extension.step2.title"
210
- },
211
- {
212
- description: "wallet_connectors.metamask.extension.step3.description",
213
- step: "refresh",
214
- title: "wallet_connectors.metamask.extension.step3.title"
215
- }
216
- ]
217
- }
218
- }
219
- };
220
- }
221
- };
222
- };
223
-
224
- export {
225
- metaMaskWallet
226
- };
@@ -1,84 +0,0 @@
1
- "use client";
2
- import {
3
- getWalletConnectConnector,
4
- getWalletConnectUri
5
- } from "./chunk-6T5K52ZY.js";
6
- import {
7
- getInjectedConnector,
8
- hasInjectedProvider
9
- } from "./chunk-UZ5XLPAW.js";
10
- import {
11
- isAndroid,
12
- isIOS
13
- } from "./chunk-ZOLACFTK.js";
14
-
15
- // src/wallets/walletConnectors/rainbowWallet/rainbowWallet.ts
16
- var rainbowWallet = ({
17
- chains,
18
- projectId,
19
- walletConnectOptions,
20
- walletConnectVersion = "2",
21
- ...options
22
- }) => {
23
- const isRainbowInjected = hasInjectedProvider("isRainbow");
24
- const shouldUseWalletConnect = !isRainbowInjected;
25
- return {
26
- id: "rainbow",
27
- name: "Rainbow",
28
- iconUrl: async () => (await import("./rainbowWallet-GGU64QEI.js")).default,
29
- iconBackground: "#0c2f78",
30
- installed: !shouldUseWalletConnect ? isRainbowInjected : void 0,
31
- downloadUrls: {
32
- android: "https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",
33
- ios: "https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",
34
- mobile: "https://rainbow.download?utm_source=rainbowkit",
35
- qrCode: "https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",
36
- browserExtension: "https://rainbow.me/extension?utm_source=rainbowkit"
37
- },
38
- createConnector: () => {
39
- const connector = shouldUseWalletConnect ? getWalletConnectConnector({
40
- projectId,
41
- chains,
42
- version: walletConnectVersion,
43
- options: walletConnectOptions
44
- }) : getInjectedConnector({ flag: "isRainbow", chains, options });
45
- const getUri = async () => {
46
- const uri = await getWalletConnectUri(connector, walletConnectVersion);
47
- return isAndroid() ? uri : isIOS() ? `rainbow://wc?uri=${encodeURIComponent(uri)}&connector=rainbowkit` : `https://rnbwapp.com/wc?uri=${encodeURIComponent(
48
- uri
49
- )}&connector=rainbowkit`;
50
- };
51
- return {
52
- connector,
53
- mobile: { getUri: shouldUseWalletConnect ? getUri : void 0 },
54
- qrCode: shouldUseWalletConnect ? {
55
- getUri,
56
- instructions: {
57
- learnMoreUrl: "https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",
58
- steps: [
59
- {
60
- description: "wallet_connectors.rainbow.qr_code.step1.description",
61
- step: "install",
62
- title: "wallet_connectors.rainbow.qr_code.step1.title"
63
- },
64
- {
65
- description: "wallet_connectors.rainbow.qr_code.step2.description",
66
- step: "create",
67
- title: "wallet_connectors.rainbow.qr_code.step2.title"
68
- },
69
- {
70
- description: "wallet_connectors.rainbow.qr_code.step3.description",
71
- step: "scan",
72
- title: "wallet_connectors.rainbow.qr_code.step3.title"
73
- }
74
- ]
75
- }
76
- } : void 0
77
- };
78
- }
79
- };
80
- };
81
-
82
- export {
83
- rainbowWallet
84
- };