@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.
- package/package.json +1 -1
- package/reactjs/components/BridgeForm/Deposit.js +1 -1
- package/reactjs/components/BridgeForm/Deposit.mjs +119 -114
- package/reactjs/components/BridgeForm/Transfer.js +1 -1
- package/reactjs/components/BridgeForm/Transfer.mjs +42 -40
- package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -1
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +51 -51
- package/reactjs/init/init.d.ts +1 -0
- package/reactjs/init/init.js +1 -1
- package/reactjs/init/init.mjs +32 -32
package/reactjs/init/init.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineChain as c, mainnet as
|
|
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
|
|
5
|
-
import { isMobileInjectedDappBrowser as
|
|
6
|
-
import { MVX_CHAIN_IDS as
|
|
7
|
-
import { InMemoryStore as
|
|
8
|
-
import { SuiAdapter as
|
|
9
|
-
const
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
52
|
-
mainnet:
|
|
53
|
-
testnet:
|
|
51
|
+
}), S = {
|
|
52
|
+
mainnet: D,
|
|
53
|
+
testnet: R,
|
|
54
54
|
devnet: T
|
|
55
55
|
};
|
|
56
|
-
var
|
|
57
|
-
async function
|
|
58
|
-
var
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
(t) => e.acceptedChainIDs.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 =
|
|
70
|
+
const t = S[e.suiEnvironment];
|
|
71
71
|
r.push(t);
|
|
72
72
|
}
|
|
73
|
-
const a = !!e.disableInjectedDiscoveryInMobileDapp &&
|
|
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 =
|
|
81
|
+
const t = S[e.suiEnvironment], n = t.caipNetworkId ?? `sui:${t.id}`;
|
|
82
82
|
u.push(
|
|
83
|
-
new
|
|
84
|
-
explicitCaipChains: [
|
|
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(),
|
|
97
|
-
if ((
|
|
98
|
-
const
|
|
99
|
-
(!e.expectedSuiAddress ||
|
|
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
|
-
|
|
112
|
-
|
|
111
|
+
j as SuiMethods,
|
|
112
|
+
W as init
|
|
113
113
|
};
|