@multiversx/sdk-dapp-liquidity 2.3.0-alpha.2 → 2.3.0-alpha.4

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.
@@ -1,12 +1,12 @@
1
- import { defineChain as c, mainnet as U, bsc as w, bscTestnet as N } from "@reown/appkit/networks";
1
+ import { defineChain as c, mainnet as w, bsc as N, bscTestnet as h } from "@reown/appkit/networks";
2
2
  import { createAppKit as C } from "@reown/appkit/react";
3
3
  import { WagmiAdapter as E } from "@reown/appkit-adapter-wagmi";
4
- import * as h from "viem/chains";
5
- import { isMobileInjectedDappBrowser as g } from "./isMobileInjectedDappBrowser.mjs";
6
- import { MVX_CHAIN_IDS as k } from "../../constants/index.mjs";
7
- import { InMemoryStore as b } from "../../store/inMemoryStore.mjs";
8
- import { SuiAdapter as y } from "../adapters/SuiAdapter.mjs";
9
- const _ = c({
4
+ import * as g from "viem/chains";
5
+ import { isMobileInjectedDappBrowser as k } from "./isMobileInjectedDappBrowser.mjs";
6
+ import { MVX_CHAIN_IDS as b } from "../../constants/index.mjs";
7
+ import { InMemoryStore as y } from "../../store/inMemoryStore.mjs";
8
+ import { SuiAdapter as _ } from "../adapters/SuiAdapter.mjs";
9
+ const D = c({
10
10
  id: "mainnet",
11
11
  name: "SUI Mainnet",
12
12
  nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
@@ -18,7 +18,7 @@ const _ = c({
18
18
  },
19
19
  chainNamespace: "sui",
20
20
  caipNetworkId: "sui:mainnet"
21
- }), D = c({
21
+ }), R = c({
22
22
  id: "testnet",
23
23
  name: "SUI Testnet",
24
24
  nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
@@ -48,29 +48,29 @@ const _ = c({
48
48
  },
49
49
  chainNamespace: "sui",
50
50
  caipNetworkId: "sui:devnet"
51
- }), v = {
52
- mainnet: _,
53
- testnet: D,
51
+ }), S = {
52
+ mainnet: D,
53
+ testnet: R,
54
54
  devnet: T
55
55
  };
56
- var R = /* @__PURE__ */ ((e) => (e.SIGN_TRANSACTION = "sui_signTransaction", e.SIGN_AND_EXECUTE_TRANSACTION = "sui_signAndExecuteTransaction", e.SIGN_PERSONAL_MESSAGE = "sui_signPersonalMessage", e))(R || {});
57
- async function K(e) {
58
- var p, m, l, I, f;
59
- const n = b.getInstance();
60
- n.setItem("apiURL", e.apiURL), n.setItem("bridgeURL", e.bridgeURL), n.setItem("mvxApiURL", e.mvxApiURL), n.setItem("mvxExplorerAddress", e.mvxExplorerAddress), n.setItem("mvxChainId", e.mvxChainId);
61
- const S = { ...h }, x = Object.values(S).filter(
62
- (t) => e.acceptedChainIDs.includes(t.id.toString()) && !k.includes(t.id.toString())
56
+ var j = /* @__PURE__ */ ((e) => (e.SIGN_TRANSACTION = "sui_signTransaction", e.SIGN_AND_EXECUTE_TRANSACTION = "sui_signAndExecuteTransaction", e.SIGN_PERSONAL_MESSAGE = "sui_signPersonalMessage", e))(j || {});
57
+ async function W(e) {
58
+ var l, m, p, I, f;
59
+ const i = y.getInstance();
60
+ i.setItem("apiURL", e.apiURL), i.setItem("bridgeURL", e.bridgeURL), i.setItem("mvxApiURL", e.mvxApiURL), i.setItem("mvxExplorerAddress", e.mvxExplorerAddress), i.setItem("mvxChainId", e.mvxChainId);
61
+ const v = { ...g }, x = Object.values(v).filter(
62
+ (t) => e.acceptedChainIDs.includes(t.id.toString()) && !b.includes(t.id.toString())
63
63
  ).map((t) => t), o = [
64
- U,
65
64
  w,
66
65
  N,
66
+ h,
67
67
  ...x
68
68
  ], r = [...o];
69
69
  if (e.suiEnvironment) {
70
- const t = v[e.suiEnvironment];
70
+ const t = S[e.suiEnvironment];
71
71
  r.push(t);
72
72
  }
73
- const a = !!e.disableInjectedDiscoveryInMobileDapp && g(), d = new E({
73
+ const a = !!e.disableInjectedDiscoveryInMobileDapp && k(), A = a || !!e.disableSuiAutoReconnect, d = new E({
74
74
  ...e.adapterConfig,
75
75
  ssr: e.adapterConfig.ssr ?? !0,
76
76
  projectId: e.appKitOptions.projectId,
@@ -78,10 +78,10 @@ async function K(e) {
78
78
  ...a ? { multiInjectedProviderDiscovery: !1 } : {}
79
79
  }), u = [d];
80
80
  if (e.suiEnvironment) {
81
- const t = v[e.suiEnvironment], i = t.caipNetworkId ?? `sui:${t.id}`;
81
+ const t = S[e.suiEnvironment], n = t.caipNetworkId ?? `sui:${t.id}`;
82
82
  u.push(
83
- new y({
84
- explicitCaipChains: [i],
83
+ new _({
84
+ explicitCaipChains: [n],
85
85
  expectedSuiAddress: e.expectedSuiAddress
86
86
  })
87
87
  );
@@ -90,13 +90,13 @@ async function K(e) {
90
90
  ...e.appKitOptions,
91
91
  adapters: u,
92
92
  networks: [r[0], ...r.slice(1)],
93
- ...a ? { enableEIP6963: !1 } : {}
93
+ ...a ? { enableEIP6963: !1, enableInjected: !1 } : {}
94
94
  });
95
- if (await s.ready(), e.suiEnvironment) {
96
- const t = await s.getUniversalProvider(), i = (m = (p = t == null ? void 0 : t.session) == null ? void 0 : p.namespaces) == null ? void 0 : m.sui;
97
- if ((l = i == null ? void 0 : i.accounts) != null && l.length && !s.getCaipAddress("sui")) {
98
- const A = (I = i.accounts[0]) == null ? void 0 : I.split(":").pop();
99
- (!e.expectedSuiAddress || A === e.expectedSuiAddress) && await ((f = s.syncWalletConnectAccount) == null ? void 0 : f.call(s));
95
+ if (await s.ready(), e.suiEnvironment && !A) {
96
+ const t = await s.getUniversalProvider(), n = (m = (l = t == null ? void 0 : t.session) == null ? void 0 : l.namespaces) == null ? void 0 : m.sui;
97
+ if ((p = n == null ? void 0 : n.accounts) != null && p.length && !s.getCaipAddress("sui")) {
98
+ const U = (I = n.accounts[0]) == null ? void 0 : I.split(":").pop();
99
+ (!e.expectedSuiAddress || U === e.expectedSuiAddress) && await ((f = s.syncWalletConnectAccount) == null ? void 0 : f.call(s));
100
100
  }
101
101
  }
102
102
  return {
@@ -108,6 +108,6 @@ async function K(e) {
108
108
  };
109
109
  }
110
110
  export {
111
- R as SuiMethods,
112
- K as init
111
+ j as SuiMethods,
112
+ W as init
113
113
  };