@funkit/connect 0.1.0 → 0.1.1

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.
@@ -4,7 +4,7 @@ import {
4
4
  FunkitProvider,
5
5
  NATIVE_TOKEN,
6
6
  useFunkitCheckout
7
- } from "../chunk-MEODMBUO.js";
7
+ } from "../chunk-OUW7RX4L.js";
8
8
  import "../chunk-DGHNGOF2.js";
9
9
  import "../chunk-VP4CAK4A.js";
10
10
  export {
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  useFunkitCheckout,
40
40
  useTransactionStore,
41
41
  useWalletConnectors
42
- } from "./chunk-MEODMBUO.js";
42
+ } from "./chunk-OUW7RX4L.js";
43
43
  import "./chunk-DGHNGOF2.js";
44
44
  import "./chunk-VP4CAK4A.js";
45
45
 
@@ -0,0 +1,117 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-UZ5XLPAW.js";
6
+ import {
7
+ getWalletConnectConnector,
8
+ getWalletConnectUri
9
+ } from "./chunk-4ACOCJJZ.js";
10
+ import {
11
+ isMobile
12
+ } from "./chunk-ZOLACFTK.js";
13
+
14
+ // src/wallets/walletConnectors/trustWallet/trustWallet.ts
15
+ var trustWallet = ({
16
+ chains,
17
+ projectId,
18
+ walletConnectOptions,
19
+ walletConnectVersion = "2",
20
+ ...options
21
+ }) => {
22
+ const isTrustWalletInjected = isMobile() ? hasInjectedProvider("isTrust") : hasInjectedProvider("isTrustWallet");
23
+ const shouldUseWalletConnect = !isTrustWalletInjected;
24
+ return {
25
+ id: "trust",
26
+ name: "Trust Wallet",
27
+ iconUrl: async () => (await import("./trustWallet-XIQD5AVI.js")).default,
28
+ installed: isTrustWalletInjected || void 0,
29
+ iconAccent: "#3375BB",
30
+ iconBackground: "#fff",
31
+ downloadUrls: {
32
+ android: "https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",
33
+ ios: "https://apps.apple.com/us/app/trust-crypto-bitcoin-wallet/id1288339409",
34
+ mobile: "https://trustwallet.com/download",
35
+ qrCode: "https://trustwallet.com/download",
36
+ chrome: "https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph",
37
+ browserExtension: "https://trustwallet.com/browser-extension"
38
+ },
39
+ createConnector: () => {
40
+ const getUriMobile = async () => {
41
+ const uri = await getWalletConnectUri(connector, walletConnectVersion);
42
+ return `trust://wc?uri=${encodeURIComponent(uri)}`;
43
+ };
44
+ const getUriQR = async () => {
45
+ const uri = await getWalletConnectUri(connector, walletConnectVersion);
46
+ return uri;
47
+ };
48
+ const connector = shouldUseWalletConnect ? getWalletConnectConnector({
49
+ projectId,
50
+ chains,
51
+ version: walletConnectVersion,
52
+ options: walletConnectOptions
53
+ }) : isMobile() ? getInjectedConnector({ flag: "isTrust", chains, options }) : getInjectedConnector({ flag: "isTrustWallet", chains, options });
54
+ const mobileConnector = {
55
+ getUri: shouldUseWalletConnect ? getUriMobile : void 0
56
+ };
57
+ let qrConnector = void 0;
58
+ if (shouldUseWalletConnect) {
59
+ qrConnector = {
60
+ getUri: getUriQR,
61
+ instructions: {
62
+ learnMoreUrl: "https://trustwallet.com/",
63
+ steps: [
64
+ {
65
+ description: "wallet_connectors.trust.qr_code.step1.description",
66
+ step: "install",
67
+ title: "wallet_connectors.trust.qr_code.step1.title"
68
+ },
69
+ {
70
+ description: "wallet_connectors.trust.qr_code.step2.description",
71
+ step: "create",
72
+ title: "wallet_connectors.trust.qr_code.step2.title"
73
+ },
74
+ {
75
+ description: "wallet_connectors.trust.qr_code.step3.description",
76
+ step: "scan",
77
+ title: "wallet_connectors.trust.qr_code.step3.title"
78
+ }
79
+ ]
80
+ }
81
+ };
82
+ }
83
+ const extensionConnector = {
84
+ instructions: {
85
+ learnMoreUrl: "https://trustwallet.com/browser-extension",
86
+ steps: [
87
+ {
88
+ description: "wallet_connectors.trust.extension.step1.description",
89
+ step: "install",
90
+ title: "wallet_connectors.trust.extension.step1.title"
91
+ },
92
+ {
93
+ description: "wallet_connectors.trust.extension.step2.description",
94
+ step: "create",
95
+ title: "wallet_connectors.trust.extension.step2.title"
96
+ },
97
+ {
98
+ description: "wallet_connectors.trust.extension.step3.description",
99
+ step: "refresh",
100
+ title: "wallet_connectors.trust.extension.step3.title"
101
+ }
102
+ ]
103
+ }
104
+ };
105
+ return {
106
+ connector,
107
+ mobile: mobileConnector,
108
+ qrCode: qrConnector,
109
+ extension: extensionConnector
110
+ };
111
+ }
112
+ };
113
+ };
114
+
115
+ export {
116
+ trustWallet
117
+ };
@@ -0,0 +1,84 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-UZ5XLPAW.js";
6
+ import {
7
+ getWalletConnectConnector,
8
+ getWalletConnectUri
9
+ } from "./chunk-4ACOCJJZ.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
+ };
@@ -3,14 +3,17 @@ import {
3
3
  zerionWallet
4
4
  } from "./chunk-BZWTTESU.js";
5
5
  import {
6
- talismanWallet
7
- } from "./chunk-5UETJ33B.js";
6
+ zealWallet
7
+ } from "./chunk-QBKHMTGI.js";
8
8
  import {
9
9
  subWallet
10
10
  } from "./chunk-JU27WJ7W.js";
11
11
  import {
12
12
  tahoWallet
13
13
  } from "./chunk-OOGGCCFQ.js";
14
+ import {
15
+ talismanWallet
16
+ } from "./chunk-5UETJ33B.js";
14
17
  import {
15
18
  tokenPocketWallet
16
19
  } from "./chunk-HHEZNZRR.js";
@@ -27,20 +30,14 @@ import {
27
30
  xdefiWallet
28
31
  } from "./chunk-5ZLRNFDM.js";
29
32
  import {
30
- zealWallet
31
- } from "./chunk-QBKHMTGI.js";
33
+ oneKeyWallet
34
+ } from "./chunk-6CW3SAA3.js";
32
35
  import {
33
36
  omniWallet
34
37
  } from "./chunk-HKBLG5YG.js";
35
38
  import {
36
39
  phantomWallet
37
40
  } from "./chunk-KUZFZL2D.js";
38
- import {
39
- oneKeyWallet
40
- } from "./chunk-6CW3SAA3.js";
41
- import {
42
- rainbowWallet
43
- } from "./chunk-TTTMI2Z2.js";
44
41
  import {
45
42
  rabbyWallet
46
43
  } from "./chunk-TNC2B7LX.js";
@@ -50,6 +47,9 @@ import {
50
47
  import {
51
48
  safepalWallet
52
49
  } from "./chunk-RMJYZWKN.js";
50
+ import {
51
+ rainbowWallet
52
+ } from "./chunk-TTTMI2Z2.js";
53
53
  import {
54
54
  safeheronWallet
55
55
  } from "./chunk-7WTKIVCW.js";
@@ -62,15 +62,12 @@ import {
62
62
  import {
63
63
  injectedWallet
64
64
  } from "./chunk-U32TVZ7G.js";
65
- import {
66
- ledgerWallet
67
- } from "./chunk-WPGD3FGN.js";
68
65
  import {
69
66
  metaMaskWallet
70
67
  } from "./chunk-UM7QXLQE.js";
71
68
  import {
72
- mewWallet
73
- } from "./chunk-BZFEDZQJ.js";
69
+ ledgerWallet
70
+ } from "./chunk-WPGD3FGN.js";
74
71
  import {
75
72
  oktoWallet
76
73
  } from "./chunk-TFHNF64Z.js";
@@ -78,18 +75,21 @@ import {
78
75
  okxWallet
79
76
  } from "./chunk-EINKDQQW.js";
80
77
  import {
81
- coin98Wallet
82
- } from "./chunk-PVTJW4KE.js";
78
+ mewWallet
79
+ } from "./chunk-BZFEDZQJ.js";
80
+ import {
81
+ braveWallet
82
+ } from "./chunk-INSQDNCE.js";
83
83
  import {
84
84
  coinbaseWallet
85
85
  } from "./chunk-WFTAXMQP.js";
86
86
  import "./chunk-UZ5XLPAW.js";
87
- import {
88
- coreWallet
89
- } from "./chunk-K342MEBF.js";
90
87
  import {
91
88
  dawnWallet
92
89
  } from "./chunk-QJNS6IE4.js";
90
+ import {
91
+ coreWallet
92
+ } from "./chunk-K342MEBF.js";
93
93
  import {
94
94
  desigWallet
95
95
  } from "./chunk-SXUVHZCG.js";
@@ -106,22 +106,22 @@ import {
106
106
  argentWallet
107
107
  } from "./chunk-32KC4FTG.js";
108
108
  import {
109
- bifrostWallet
110
- } from "./chunk-M4KIVTE3.js";
109
+ bitskiWallet
110
+ } from "./chunk-FL3REGA5.js";
111
111
  import {
112
112
  bitKeepWallet,
113
113
  bitgetWallet
114
114
  } from "./chunk-DTCZLIMY.js";
115
- import "./chunk-ZOLACFTK.js";
116
115
  import {
117
- bitskiWallet
118
- } from "./chunk-FL3REGA5.js";
119
- import {
120
- braveWallet
121
- } from "./chunk-INSQDNCE.js";
116
+ bifrostWallet
117
+ } from "./chunk-M4KIVTE3.js";
118
+ import "./chunk-ZOLACFTK.js";
122
119
  import {
123
120
  clvWallet
124
121
  } from "./chunk-C3X4W5P4.js";
122
+ import {
123
+ coin98Wallet
124
+ } from "./chunk-PVTJW4KE.js";
125
125
  import "./chunk-4ACOCJJZ.js";
126
126
  export {
127
127
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -51,7 +51,7 @@
51
51
  "wagmi": "~1.0.1 || ~1.1.0 || ~1.2.0 || ~1.3.0 || ~1.4.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@funkit/eslint-config": "workspace:^",
54
+ "@funkit/eslint-config": "^1.1.0",
55
55
  "@testing-library/jest-dom": "^6.1.3",
56
56
  "@testing-library/react": "^14.0.0",
57
57
  "@testing-library/user-event": "^14.4.3",
@@ -82,8 +82,8 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@front-finance/link": "^1.1.9",
85
- "@funkit/core": "workspace:^",
86
- "@funkit/wagmi-tools": "workspace:^",
85
+ "@funkit/core": "^0.10.0",
86
+ "@funkit/wagmi-tools": "^0.1.0",
87
87
  "@moonpay/moonpay-react": "^1.4.1",
88
88
  "@privy-io/js-sdk-core": "^0.7.0",
89
89
  "@types/uuid": "^9.0.1",