@funkit/connect 5.5.1 → 5.5.2

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,13 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 5.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - af756c7: fix: same asset badge heurisics
8
+ - Updated dependencies [9cc9c7f]
9
+ - @funkit/fun-relay@0.1.7
10
+
3
11
  ## 5.5.1
4
12
 
5
13
  ### Patch Changes
@@ -12,13 +12,15 @@ interface AssetUsableToPayParms {
12
12
  config: FunkitCheckoutConfig;
13
13
  payerAddress: string;
14
14
  paymentMethod: PaymentMethod;
15
+ targetChainId: string;
16
+ targetTokenAddress: string;
15
17
  assetChainId: string;
16
18
  assetTokenAddress: string;
17
19
  assetUsdAmount: number | null;
18
20
  loginType: LoginType;
19
21
  isAllowedForCheckout: boolean;
20
22
  }
21
- export declare const isAssetUsableToPayForCheckout: ({ apiKey, config, payerAddress, paymentMethod, assetChainId, assetTokenAddress, assetUsdAmount, loginType, isAllowedForCheckout, }: AssetUsableToPayParms) => {
23
+ export declare const isAssetUsableToPayForCheckout: ({ apiKey, config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, loginType, isAllowedForCheckout, }: AssetUsableToPayParms) => {
22
24
  isUsable: boolean;
23
25
  reason: string;
24
26
  };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import {
3
- lightTheme
4
- } from "./chunk-RN4I4Y57.js";
5
2
  import {
6
3
  darkTheme
7
4
  } from "./chunk-ICCAQZHZ.js";
5
+ import {
6
+ lightTheme
7
+ } from "./chunk-RN4I4Y57.js";
8
8
  import {
9
9
  systemFontStack
10
10
  } from "./chunk-R2UFCJL7.js";
@@ -3403,7 +3403,22 @@ var flagConfig = {
3403
3403
  default_value: JSON.stringify({
3404
3404
  listRefresh: 30 * 1e3,
3405
3405
  itemRefresh: 5 * 1e3
3406
- })
3406
+ }),
3407
+ overrides: [
3408
+ {
3409
+ if_any: [
3410
+ {
3411
+ key: "apiKey",
3412
+ type: "isAnyOf",
3413
+ values: [KATANA_API_KEY2]
3414
+ }
3415
+ ],
3416
+ value: JSON.stringify({
3417
+ listRefresh: 5 * 1e3,
3418
+ itemRefresh: 2 * 1e3
3419
+ })
3420
+ }
3421
+ ]
3407
3422
  },
3408
3423
  [FlagKey.TokenTransferNewTokens]: {
3409
3424
  type: "string",
@@ -4301,13 +4316,14 @@ var isAssetUsableToPayForCheckout = ({
4301
4316
  config,
4302
4317
  payerAddress,
4303
4318
  paymentMethod,
4319
+ targetChainId,
4320
+ targetTokenAddress,
4304
4321
  assetChainId,
4305
4322
  assetTokenAddress,
4306
4323
  assetUsdAmount,
4307
4324
  loginType,
4308
4325
  isAllowedForCheckout
4309
4326
  }) => {
4310
- const targetChainId = config.targetChain;
4311
4327
  const finalCheckoutRecipient = getCheckoutRecipient({
4312
4328
  config,
4313
4329
  walletAddress: payerAddress
@@ -4315,7 +4331,7 @@ var isAssetUsableToPayForCheckout = ({
4315
4331
  const isSameAsPurchasingToken = !isCheckoutPostActionRequired(config) && // however, if the recipient address is different from the payer address (via account balance payment), it is possible to transfer money
4316
4332
  paymentMethod === "balance" /* ACCOUNT_BALANCE */ && finalCheckoutRecipient.toLowerCase() === payerAddress.toLowerCase() && isTokenEquivalent2({
4317
4333
  firstTokenChainId: targetChainId,
4318
- firstTokenAddress: config.targetAsset,
4334
+ firstTokenAddress: targetTokenAddress,
4319
4335
  secondTokenChainId: assetChainId,
4320
4336
  secondTokenAddress: assetTokenAddress
4321
4337
  });
@@ -9802,6 +9818,8 @@ function useUsableWalletAssetsForCheckout() {
9802
9818
  config: checkoutItem.initSettings.config,
9803
9819
  payerAddress: walletAddress,
9804
9820
  paymentMethod: "balance" /* ACCOUNT_BALANCE */,
9821
+ targetChainId: checkoutItem.initSettings.config.targetChain,
9822
+ targetTokenAddress: checkoutItem.initSettings.config.targetAsset,
9805
9823
  assetChainId: asset.chainId,
9806
9824
  assetTokenAddress: asset.contractAddress,
9807
9825
  assetUsdAmount: asset.totalUsdValue,
@@ -20662,7 +20680,8 @@ var isKnownAsset2 = (asset) => asset.usdAmount !== null;
20662
20680
  function useEnrichedAccountHoldings({
20663
20681
  paymentMethodInfo,
20664
20682
  checkoutConfig,
20665
- accountHoldings
20683
+ accountHoldings,
20684
+ targetAssetInfo
20666
20685
  }) {
20667
20686
  const { apiKey } = useFunkitConfig();
20668
20687
  const { isAllowed, isLoading } = useAllowedAssets();
@@ -20673,6 +20692,8 @@ function useEnrichedAccountHoldings({
20673
20692
  const usableForCheckout = isAssetUsableToPayForCheckout({
20674
20693
  apiKey,
20675
20694
  config: checkoutConfig,
20695
+ targetTokenAddress: targetAssetInfo.tokenAddress,
20696
+ targetChainId: targetAssetInfo.tokenChainId,
20676
20697
  paymentMethod: paymentMethodInfo.paymentMethod,
20677
20698
  payerAddress: walletAddress,
20678
20699
  assetChainId: asset.pickedChainId,
@@ -20696,7 +20717,8 @@ function useEnrichedAccountHoldings({
20696
20717
  isAllowed,
20697
20718
  loginType,
20698
20719
  paymentMethodInfo.paymentMethod,
20699
- walletAddress
20720
+ walletAddress,
20721
+ targetAssetInfo
20700
20722
  ]);
20701
20723
  return { enrichedAccountHoldings, isLoading };
20702
20724
  }
@@ -20768,7 +20790,13 @@ function MeshOrAccountSelectAsset({
20768
20790
  const isTargetAssetSelectable = withTargetAssetSection && candidates;
20769
20791
  const defaultTargetAsset = isTargetAssetSelectable ? candidates.find(
20770
20792
  (token) => token.tokenSymbol === checkoutConfig?.targetAssetTicker
20771
- ) ?? candidates.find((token) => token.isDefault) ?? candidates[0] : void 0;
20793
+ ) ?? candidates.find((token) => token.isDefault) ?? candidates[0] : {
20794
+ tokenAddress: checkoutItem?.initSettings.config.targetAsset || "0x",
20795
+ tokenChainId: checkoutItem?.initSettings.config.targetChain || "",
20796
+ tokenSymbol: checkoutItem?.initSettings.config.targetAssetTicker || "",
20797
+ iconSrc: checkoutItem?.initSettings.config.iconSrc || "",
20798
+ targetAssetMinAmount: 0
20799
+ };
20772
20800
  const [selectedTargetAsset, setSelectedTargetAsset] = useState42(defaultTargetAsset);
20773
20801
  const defaultTokenSymbols = useMemo33(() => {
20774
20802
  if (!checkoutConfig) {
@@ -20785,7 +20813,8 @@ function MeshOrAccountSelectAsset({
20785
20813
  const { enrichedAccountHoldings, isLoading: isLoadingEnrichedHoldings } = useEnrichedAccountHoldings({
20786
20814
  accountHoldings,
20787
20815
  paymentMethodInfo,
20788
- checkoutConfig
20816
+ checkoutConfig,
20817
+ targetAssetInfo: selectedTargetAsset
20789
20818
  });
20790
20819
  const assetOptions = useAssetOptions({
20791
20820
  enrichedAccountHoldings,
@@ -29981,7 +30010,7 @@ function setFunkitConnectVersion({ version }) {
29981
30010
  localStorage.setItem(storageKey5, version);
29982
30011
  }
29983
30012
  function getCurrentSdkVersion() {
29984
- return "5.5.1";
30013
+ return "5.5.2";
29985
30014
  }
29986
30015
  function useFingerprint() {
29987
30016
  const fingerprint = useCallback49(() => {
@@ -156,6 +156,14 @@ export declare const flagConfig: {
156
156
  checkout_notifications_refresh_interval: {
157
157
  type: "string";
158
158
  default_value: string;
159
+ overrides: {
160
+ if_any: {
161
+ key: "apiKey";
162
+ type: "isAnyOf";
163
+ values: string[];
164
+ }[];
165
+ value: string;
166
+ }[];
159
167
  };
160
168
  token_transfer_new_tokens: {
161
169
  type: "string";
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
- zerionWallet
4
- } from "./chunk-AXWP3GD4.js";
3
+ walletConnectWallet
4
+ } from "./chunk-NP5QGWNL.js";
5
5
  import {
6
- tahoWallet
7
- } from "./chunk-6P2EMPZI.js";
6
+ zealWallet
7
+ } from "./chunk-JROWU5BP.js";
8
8
  import {
9
- xdefiWallet
10
- } from "./chunk-NO7XMBB5.js";
9
+ zerionWallet
10
+ } from "./chunk-AXWP3GD4.js";
11
11
  import {
12
12
  subWallet
13
13
  } from "./chunk-AD2KIJB6.js";
@@ -15,59 +15,59 @@ import {
15
15
  talismanWallet
16
16
  } from "./chunk-ABFSXBE6.js";
17
17
  import {
18
- tokenaryWallet
19
- } from "./chunk-SLOIIJGP.js";
18
+ tahoWallet
19
+ } from "./chunk-6P2EMPZI.js";
20
20
  import {
21
21
  tokenPocketWallet
22
22
  } from "./chunk-IDKVN5CF.js";
23
+ import {
24
+ tokenaryWallet
25
+ } from "./chunk-SLOIIJGP.js";
23
26
  import {
24
27
  trustWallet
25
28
  } from "./chunk-ISIBREBO.js";
29
+ import {
30
+ xdefiWallet
31
+ } from "./chunk-NO7XMBB5.js";
26
32
  import {
27
33
  uniswapWallet
28
34
  } from "./chunk-LH7BMNFZ.js";
29
35
  import {
30
- walletConnectWallet
31
- } from "./chunk-NP5QGWNL.js";
36
+ phantomWallet
37
+ } from "./chunk-ZSVTX6EK.js";
32
38
  import {
33
- zealWallet
34
- } from "./chunk-JROWU5BP.js";
39
+ rabbyWallet
40
+ } from "./chunk-BVX4XGNP.js";
35
41
  import {
36
42
  rainbowWallet
37
43
  } from "./chunk-2UCNRD7H.js";
38
- import {
39
- rabbyWallet
40
- } from "./chunk-BVX4XGNP.js";
41
44
  import {
42
45
  ramperWallet
43
46
  } from "./chunk-PIUNLQJG.js";
44
- import {
45
- roninWallet
46
- } from "./chunk-63YLN6R5.js";
47
47
  import {
48
48
  safeWallet
49
49
  } from "./chunk-BQQQL6UD.js";
50
50
  import {
51
- omniWallet
52
- } from "./chunk-7CUY5G6R.js";
53
- import {
54
- safeheronWallet
55
- } from "./chunk-R6RWZRFF.js";
51
+ roninWallet
52
+ } from "./chunk-63YLN6R5.js";
56
53
  import {
57
54
  safepalWallet
58
55
  } from "./chunk-MSFKSQBY.js";
56
+ import {
57
+ safeheronWallet
58
+ } from "./chunk-R6RWZRFF.js";
59
59
  import {
60
60
  ledgerWallet
61
61
  } from "./chunk-BRBKM4PW.js";
62
62
  import {
63
63
  mewWallet
64
64
  } from "./chunk-V57WLZEE.js";
65
- import {
66
- oktoWallet
67
- } from "./chunk-ADIXAKUL.js";
68
65
  import {
69
66
  metaMaskWallet
70
67
  } from "./chunk-G73C6P5P.js";
68
+ import {
69
+ oktoWallet
70
+ } from "./chunk-ADIXAKUL.js";
71
71
  import {
72
72
  okxWallet
73
73
  } from "./chunk-4WEHDI4Y.js";
@@ -78,11 +78,14 @@ import {
78
78
  oneKeyWallet
79
79
  } from "./chunk-4AD7VI2P.js";
80
80
  import {
81
- phantomWallet
82
- } from "./chunk-ZSVTX6EK.js";
81
+ omniWallet
82
+ } from "./chunk-7CUY5G6R.js";
83
83
  import {
84
- bitgetWallet
85
- } from "./chunk-A5APNTGL.js";
84
+ foxWallet
85
+ } from "./chunk-LMZMXEXL.js";
86
+ import {
87
+ frameWallet
88
+ } from "./chunk-ZMYVTWDF.js";
86
89
  import {
87
90
  frontierWallet
88
91
  } from "./chunk-3S2U24BJ.js";
@@ -93,38 +96,35 @@ import {
93
96
  gateWallet
94
97
  } from "./chunk-GSOYKKIS.js";
95
98
  import {
96
- desigWallet
97
- } from "./chunk-CTU6JCOK.js";
99
+ kresusWallet
100
+ } from "./chunk-MJXPRJZT.js";
98
101
  import {
99
102
  injectedWallet
100
103
  } from "./chunk-VCVVV2K7.js";
101
104
  import {
102
- enkryptWallet
103
- } from "./chunk-SJTXS4ZW.js";
104
- import {
105
- kresusWallet
106
- } from "./chunk-MJXPRJZT.js";
105
+ bloomWallet
106
+ } from "./chunk-S27IADFU.js";
107
107
  import {
108
108
  coin98Wallet
109
109
  } from "./chunk-DTRYS3MO.js";
110
+ import {
111
+ clvWallet
112
+ } from "./chunk-KR6JBW5E.js";
110
113
  import {
111
114
  coinbaseWallet
112
115
  } from "./chunk-H4IRCEZN.js";
113
116
  import {
114
- bloomWallet
115
- } from "./chunk-S27IADFU.js";
117
+ dawnWallet
118
+ } from "./chunk-LN7OD5EC.js";
119
+ import {
120
+ desigWallet
121
+ } from "./chunk-CTU6JCOK.js";
116
122
  import {
117
123
  coreWallet
118
124
  } from "./chunk-HBA36GW3.js";
119
125
  import {
120
- foxWallet
121
- } from "./chunk-LMZMXEXL.js";
122
- import {
123
- frameWallet
124
- } from "./chunk-ZMYVTWDF.js";
125
- import {
126
- dawnWallet
127
- } from "./chunk-LN7OD5EC.js";
126
+ enkryptWallet
127
+ } from "./chunk-SJTXS4ZW.js";
128
128
  import {
129
129
  argentWallet
130
130
  } from "./chunk-WSQ2YJO2.js";
@@ -132,21 +132,21 @@ import {
132
132
  bifrostWallet
133
133
  } from "./chunk-W6N74MS3.js";
134
134
  import {
135
- bitverseWallet
136
- } from "./chunk-3HZRRP4Y.js";
135
+ bitgetWallet
136
+ } from "./chunk-A5APNTGL.js";
137
137
  import {
138
138
  bitskiWallet
139
139
  } from "./chunk-P74YPRF6.js";
140
140
  import {
141
- braveWallet
142
- } from "./chunk-PB254NQ4.js";
141
+ bitverseWallet
142
+ } from "./chunk-3HZRRP4Y.js";
143
143
  import {
144
144
  bybitWallet
145
145
  } from "./chunk-6ONTSPEY.js";
146
- import {
147
- clvWallet
148
- } from "./chunk-KR6JBW5E.js";
149
146
  import "./chunk-23WIEY36.js";
147
+ import {
148
+ braveWallet
149
+ } from "./chunk-PB254NQ4.js";
150
150
  import "./chunk-WRA2DVJ7.js";
151
151
  export {
152
152
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "5.5.1",
3
+ "version": "5.5.2",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -93,10 +93,10 @@
93
93
  "use-debounce": "^10.0.5",
94
94
  "uuid": "^9.0.1",
95
95
  "@funkit/api-base": "1.9.1",
96
+ "@funkit/chains": "0.3.1",
96
97
  "@funkit/core": "2.3.23",
97
- "@funkit/fun-relay": "0.1.6",
98
+ "@funkit/fun-relay": "0.1.7",
98
99
  "@funkit/utils": "1.1.1",
99
- "@funkit/chains": "0.3.1",
100
100
  "@funkit/wagmi-tools": "3.0.45"
101
101
  },
102
102
  "repository": {
@@ -1,92 +0,0 @@
1
- "use client";
2
- import {
3
- getInjectedConnector,
4
- hasInjectedProvider
5
- } from "./chunk-WRA2DVJ7.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-23WIEY36.js";
9
-
10
- // src/wallets/walletConnectors/roninWallet/roninWallet.ts
11
- var roninWallet = ({
12
- projectId,
13
- walletConnectParameters
14
- }) => {
15
- const isRoninInjected = hasInjectedProvider({
16
- namespace: "ronin.provider"
17
- });
18
- return {
19
- id: "ronin",
20
- name: "Ronin Wallet",
21
- iconUrl: async () => (await import("./roninWallet-SAB5ESVK.js")).default,
22
- iconBackground: "#ffffff",
23
- rdns: "com.roninchain.wallet",
24
- installed: isRoninInjected || void 0,
25
- downloadUrls: {
26
- android: "https://play.google.com/store/apps/details?id=com.skymavis.genesis",
27
- ios: "https://apps.apple.com/us/app/ronin-wallet/id1592675001",
28
- mobile: "https://wallet.roninchain.com",
29
- chrome: "https://chrome.google.com/webstore/detail/ronin-wallet/fnjhmkhhmkbjkkabndcnnogagogbneec",
30
- edge: "https://microsoftedge.microsoft.com/addons/detail/ronin-wallet/kjmoohlgokccodicjjfebfomlbljgfhk",
31
- firefox: "https://addons.mozilla.org/firefox/addon/ronin-wallet",
32
- browserExtension: "https://wallet.roninchain.com/",
33
- qrCode: "https://wallet.roninchain.com/"
34
- },
35
- mobile: {
36
- getUri: (uri) => `roninwallet://wc?uri=${encodeURIComponent(uri)}`
37
- },
38
- qrCode: {
39
- getUri: (uri) => uri,
40
- instructions: {
41
- learnMoreUrl: "https://wallet.roninchain.com/",
42
- steps: [
43
- {
44
- description: "wallet_connectors.ronin.qr_code.step1.description",
45
- step: "install",
46
- title: "wallet_connectors.ronin.qr_code.step1.title"
47
- },
48
- {
49
- description: "wallet_connectors.ronin.qr_code.step2.description",
50
- step: "create",
51
- title: "wallet_connectors.ronin.qr_code.step2.title"
52
- },
53
- {
54
- description: "wallet_connectors.ronin.qr_code.step3.description",
55
- step: "scan",
56
- title: "wallet_connectors.ronin.qr_code.step3.title"
57
- }
58
- ]
59
- }
60
- },
61
- extension: {
62
- instructions: {
63
- learnMoreUrl: "https://wallet.roninchain.com/",
64
- steps: [
65
- {
66
- description: "wallet_connectors.ronin.extension.step1.description",
67
- step: "install",
68
- title: "wallet_connectors.ronin.extension.step1.title"
69
- },
70
- {
71
- description: "wallet_connectors.ronin.extension.step2.description",
72
- step: "create",
73
- title: "wallet_connectors.ronin.extension.step2.title"
74
- },
75
- {
76
- description: "wallet_connectors.ronin.extension.step3.description",
77
- step: "refresh",
78
- title: "wallet_connectors.ronin.extension.step3.title"
79
- }
80
- ]
81
- }
82
- },
83
- createConnector: isRoninInjected ? getInjectedConnector({ namespace: "ronin.provider" }) : getWalletConnectConnector({
84
- projectId,
85
- walletConnectParameters
86
- })
87
- };
88
- };
89
-
90
- export {
91
- roninWallet
92
- };
@@ -1,92 +0,0 @@
1
- "use client";
2
- import {
3
- getInjectedConnector,
4
- hasInjectedProvider
5
- } from "./chunk-WRA2DVJ7.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-23WIEY36.js";
9
-
10
- // src/wallets/walletConnectors/gateWallet/gateWallet.ts
11
- import { isAndroid } from "@funkit/utils";
12
- var gateWallet = ({
13
- projectId,
14
- walletConnectParameters
15
- }) => {
16
- const isGateInjected = hasInjectedProvider({ namespace: "gatewallet" });
17
- const shouldUseWalletConnect = !isGateInjected;
18
- return {
19
- id: "gate",
20
- name: "Gate Wallet",
21
- rdns: "io.gate.wallet",
22
- iconUrl: async () => (await import("./gateWallet-CJNGQQCV.js")).default,
23
- iconAccent: "#fff",
24
- iconBackground: "#fff",
25
- downloadUrls: {
26
- android: "https://play.google.com/store/apps/details?id=com.gateio.gateio",
27
- ios: "https://apps.apple.com/us/app/gate-io-buy-bitcoin-crypto/id1294998195",
28
- mobile: "https://www.gate.io/mobileapp",
29
- qrCode: "https://www.gate.io/web3",
30
- chrome: "https://chromewebstore.google.com/detail/gate-wallet/cpmkedoipcpimgecpmgpldfpohjplkpp",
31
- browserExtension: "https://www.gate.io/web3"
32
- },
33
- mobile: {
34
- getUri: shouldUseWalletConnect ? (uri) => {
35
- return isAndroid() ? uri : `gtweb3wallet://wc?uri=${encodeURIComponent(uri)}`;
36
- } : void 0
37
- },
38
- qrCode: shouldUseWalletConnect ? {
39
- getUri: (uri) => uri,
40
- instructions: {
41
- learnMoreUrl: "https://www.gate.io/learn",
42
- steps: [
43
- {
44
- description: "wallet_connectors.gate.qr_code.step1.description",
45
- step: "install",
46
- title: "wallet_connectors.gate.qr_code.step1.title"
47
- },
48
- {
49
- description: "wallet_connectors.gate.qr_code.step2.description",
50
- step: "create",
51
- title: "wallet_connectors.gate.qr_code.step2.title"
52
- },
53
- {
54
- description: "wallet_connectors.gate.qr_code.step3.description",
55
- step: "scan",
56
- title: "wallet_connectors.gate.qr_code.step3.title"
57
- }
58
- ]
59
- }
60
- } : void 0,
61
- extension: {
62
- instructions: {
63
- learnMoreUrl: "https://www.gate.io/learn",
64
- steps: [
65
- {
66
- description: "wallet_connectors.gate.extension.step1.description",
67
- step: "install",
68
- title: "wallet_connectors.gate.extension.step1.title"
69
- },
70
- {
71
- description: "wallet_connectors.gate.extension.step2.description",
72
- step: "create",
73
- title: "wallet_connectors.gate.extension.step2.title"
74
- },
75
- {
76
- description: "wallet_connectors.gate.extension.step3.description",
77
- step: "refresh",
78
- title: "wallet_connectors.gate.extension.step3.title"
79
- }
80
- ]
81
- }
82
- },
83
- createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
84
- projectId,
85
- walletConnectParameters
86
- }) : getInjectedConnector({ namespace: "gatewallet" })
87
- };
88
- };
89
-
90
- export {
91
- gateWallet
92
- };
@@ -1,94 +0,0 @@
1
- "use client";
2
- import {
3
- getInjectedConnector,
4
- hasInjectedProvider
5
- } from "./chunk-WRA2DVJ7.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-23WIEY36.js";
9
-
10
- // src/wallets/walletConnectors/okxWallet/okxWallet.ts
11
- import { isAndroid } from "@funkit/utils";
12
- var okxWallet = ({
13
- projectId,
14
- walletConnectParameters
15
- }) => {
16
- const isOKXInjected = hasInjectedProvider({ namespace: "okxwallet" });
17
- const shouldUseWalletConnect = !isOKXInjected;
18
- return {
19
- id: "okx",
20
- name: "OKX Wallet",
21
- rdns: "com.okex.wallet",
22
- iconUrl: async () => (await import("./okxWallet-GJMKZIND.js")).default,
23
- iconAccent: "#000",
24
- iconBackground: "#000",
25
- downloadUrls: {
26
- android: "https://play.google.com/store/apps/details?id=com.okinc.okex.gp",
27
- ios: "https://itunes.apple.com/app/id1327268470?mt=8",
28
- mobile: "https://okx.com/download",
29
- qrCode: "https://okx.com/download",
30
- chrome: "https://chrome.google.com/webstore/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",
31
- edge: "https://microsoftedge.microsoft.com/addons/detail/okx-wallet/pbpjkcldjiffchgbbndmhojiacbgflha",
32
- firefox: "https://addons.mozilla.org/firefox/addon/okexwallet/",
33
- browserExtension: "https://okx.com/download"
34
- },
35
- mobile: {
36
- getUri: shouldUseWalletConnect ? (uri) => {
37
- return isAndroid() ? uri : `okex://main/wc?uri=${encodeURIComponent(uri)}`;
38
- } : void 0
39
- },
40
- qrCode: shouldUseWalletConnect ? {
41
- getUri: (uri) => uri,
42
- instructions: {
43
- learnMoreUrl: "https://okx.com/web3/",
44
- steps: [
45
- {
46
- description: "wallet_connectors.okx.qr_code.step1.description",
47
- step: "install",
48
- title: "wallet_connectors.okx.qr_code.step1.title"
49
- },
50
- {
51
- description: "wallet_connectors.okx.qr_code.step2.description",
52
- step: "create",
53
- title: "wallet_connectors.okx.qr_code.step2.title"
54
- },
55
- {
56
- description: "wallet_connectors.okx.qr_code.step3.description",
57
- step: "scan",
58
- title: "wallet_connectors.okx.qr_code.step3.title"
59
- }
60
- ]
61
- }
62
- } : void 0,
63
- extension: {
64
- instructions: {
65
- learnMoreUrl: "https://okx.com/web3/",
66
- steps: [
67
- {
68
- description: "wallet_connectors.okx.extension.step1.description",
69
- step: "install",
70
- title: "wallet_connectors.okx.extension.step1.title"
71
- },
72
- {
73
- description: "wallet_connectors.okx.extension.step2.description",
74
- step: "create",
75
- title: "wallet_connectors.okx.extension.step2.title"
76
- },
77
- {
78
- description: "wallet_connectors.okx.extension.step3.description",
79
- step: "refresh",
80
- title: "wallet_connectors.okx.extension.step3.title"
81
- }
82
- ]
83
- }
84
- },
85
- createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
86
- projectId,
87
- walletConnectParameters
88
- }) : getInjectedConnector({ namespace: "okxwallet" })
89
- };
90
- };
91
-
92
- export {
93
- okxWallet
94
- };