astra-modal-test 1.0.5 → 1.0.7
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/.github/workflows/code-quality.yml +43 -0
- package/.github/workflows/publish.yml +64 -0
- package/README.md +204 -0
- package/dist/SwapController-CsNqEWIM.js +447 -0
- package/dist/add-Dm_oSEbv.js +19 -0
- package/dist/all-wallets-DfLlzQJ3.js +10 -0
- package/dist/app-store-BMdJkp6P.js +21 -0
- package/dist/apple-BetlVMKw.js +22 -0
- package/dist/arrow-bottom-BddPptxy.js +12 -0
- package/dist/arrow-bottom-circle-CvdJJniv.js +15 -0
- package/dist/arrow-left-Bbq-z1nQ.js +12 -0
- package/dist/arrow-right-Bu4_SVLC.js +12 -0
- package/dist/arrow-top-CynlXB-M.js +12 -0
- package/dist/astra-sdk.es.js +4 -4
- package/dist/bank-B9QscNnS.js +18 -0
- package/dist/bin-v-tshf8_.js +8 -0
- package/dist/bitcoin-C01gkYyN.js +17 -0
- package/dist/browser-9uNaCY31.js +18 -0
- package/dist/card-hKR9lRzU.js +18 -0
- package/dist/{ccip-oZOrZYR9.js → ccip-CUCziAPw.js} +52 -49
- package/dist/checkmark-D1M40aM5.js +15 -0
- package/dist/checkmark-bold-1_UGl24m.js +12 -0
- package/dist/chevron-bottom-BleoRNRL.js +12 -0
- package/dist/chevron-left-C9JMU-3B.js +12 -0
- package/dist/chevron-right-Daue4WBx.js +12 -0
- package/dist/chevron-top-yuXekbUC.js +12 -0
- package/dist/chrome-store-BsUFRR7F.js +65 -0
- package/dist/circle-BCxdhM5X.js +8 -0
- package/dist/clock-7a-DWZQa.js +12 -0
- package/dist/close-DMQYuJ0z.js +12 -0
- package/dist/clsx.m-DCYaa4RU.js +20 -0
- package/dist/coinPlaceholder-DjQ-HnSH.js +12 -0
- package/dist/compass-AMecXNVm.js +12 -0
- package/dist/copy-CgIPGYbU.js +19 -0
- package/dist/cursor-DpYbTNcO.js +7 -0
- package/dist/cursor-transparent-C8iPJkn8.js +16 -0
- package/dist/desktop-BWVQVGng.js +13 -0
- package/dist/disconnect-C6IQRrtF.js +12 -0
- package/dist/discord-gH3i-QsC.js +21 -0
- package/dist/email-BxYwJC5T.js +10 -0
- package/dist/embedded-wallet-DCcVNgkc.js +464 -0
- package/dist/ethereum-CGWsmZaC.js +14 -0
- package/dist/etherscan-D4EFsAJ4.js +10 -0
- package/dist/exclamation-triangle-DNwQ1Xq6.js +8 -0
- package/dist/extension-DxQPsN2z.js +12 -0
- package/dist/external-link-BeEzrdgR.js +12 -0
- package/dist/facebook-B2Ix8_d3.js +30 -0
- package/dist/farcaster-BB83p8dC.js +16 -0
- package/dist/filters-PzdIomB1.js +12 -0
- package/dist/github-gcp1rxX0.js +22 -0
- package/dist/google-Qv9lTZcz.js +22 -0
- package/dist/help-circle-BLXTMjzX.js +16 -0
- package/dist/id-BHg2CRhj.js +16 -0
- package/dist/image-DWi1V30x.js +8 -0
- package/dist/index-4lbsZ6RQ.js +33 -0
- package/dist/index-64U3D9_n.js +21034 -0
- package/dist/index-CRU49I0g.js +15911 -0
- package/dist/index-ChxXyuZj.js +572 -0
- package/dist/index-ClS956E1.js +74511 -0
- package/dist/index-Cs4fWw01.js +386 -0
- package/dist/index-DfWqgW4h.js +709 -0
- package/dist/index-VYNI76FM.js +315 -0
- package/dist/index-qfkTLN90.js +10785 -0
- package/dist/index-r2ztgVN2.js +1060 -0
- package/dist/index-wvh7Yd5J.js +70 -0
- package/dist/info-Bl5tmiBJ.js +7 -0
- package/dist/info-circle-D2uYywg-.js +16 -0
- package/dist/lightbulb-HvXH2AVF.js +7 -0
- package/dist/mail-DXOPfnog.js +12 -0
- package/dist/mobile-Dd0Gj4vZ.js +13 -0
- package/dist/more-DYcnClbB.js +15 -0
- package/dist/network-placeholder-CfRZGQfi.js +18 -0
- package/dist/nftPlaceholder-DHmFkY55.js +12 -0
- package/dist/off-CG2Y30qN.js +8 -0
- package/dist/onramp-DoAMTeNm.js +917 -0
- package/dist/play-store-B5EYBQto.js +36 -0
- package/dist/plus-DPo25_zL.js +17 -0
- package/dist/qr-code-BRTO19PL.js +10 -0
- package/dist/receive-BvclNdV_.js +179 -0
- package/dist/recycle-horizontal-ng_b2eJV.js +13 -0
- package/dist/refresh-3kiwRV0w.js +12 -0
- package/dist/reown-logo-_9cuIfJD.js +16 -0
- package/dist/search-CoJvIxpi.js +12 -0
- package/dist/secp256k1-wZyK2iIX.js +1257 -0
- package/dist/send-BVKGSR-Z.js +19 -0
- package/dist/send-Bkj5YtHe.js +1039 -0
- package/dist/socials-DL42HlL5.js +589 -0
- package/dist/solana-BjP-_Ioa.js +17 -0
- package/dist/swapHorizontal-Do3uBbum.js +12 -0
- package/dist/swapHorizontalBold-D7N75BE-.js +12 -0
- package/dist/swapHorizontalMedium-BahEVO2x.js +20 -0
- package/dist/swapHorizontalRoundedBold-D6Hoi132.js +12 -0
- package/dist/swapVertical-P-fnrADh.js +12 -0
- package/dist/swaps-DZgbVJZ2.js +1713 -0
- package/dist/telegram-DmaL2iB8.js +20 -0
- package/dist/three-dots-oXyAsUA6.js +9 -0
- package/dist/transactions-BjB5yZN7.js +35 -0
- package/dist/twitch-0UGrMr2K.js +22 -0
- package/dist/twitterIcon-B97KAbaJ.js +10 -0
- package/dist/ui-r6nnVhBA.js +812 -0
- package/dist/user-BG1yp56Q.js +7 -0
- package/dist/verify-CgzkMSuV.js +12 -0
- package/dist/verify-filled-D-TRpWtN.js +12 -0
- package/dist/w3m-modal-Drsibcs0.js +1041 -0
- package/dist/wallet-CAHsZdfj.js +12 -0
- package/dist/wallet-placeholder-agbbreqw.js +18 -0
- package/dist/walletconnect-Yd8iXqY9.js +36 -0
- package/dist/warning-circle-C0hqC6h_.js +16 -0
- package/dist/x-mark-D9_ai2sI.js +7 -0
- package/dist/x-z6v1Jegg.js +16 -0
- package/eslint.config.mjs +1 -1
- package/package.json +14 -13
- package/src/apis/lspApi.js +47 -24
- package/src/assets/ln.png +0 -0
- package/src/assets/network/Arbitrum.png +0 -0
- package/src/assets/network/Polygon.png +0 -0
- package/src/assets/network/Solana.png +0 -0
- package/src/assets/network/botanix.png +0 -0
- package/src/assets/network/bsc.svg +13 -0
- package/src/assets/pay.png +0 -0
- package/src/assets/tokens/usdc.png +0 -0
- package/src/assets/tokens/usdt.png +0 -0
- package/src/comps/AstraImage.jsx +17 -3
- package/src/comps/AstraModal.jsx +22 -16
- package/src/comps/AstraModalLogo.jsx +9 -9
- package/src/comps/AstraNetwork.jsx +174 -45
- package/src/comps/CheckErc20Button.jsx +1 -1
- package/src/comps/CommonStyle.jsx +4 -0
- package/src/comps/ConnectButton.jsx +16 -33
- package/src/comps/ResultModal.jsx +45 -39
- package/src/comps/ToLightning.jsx +207 -80
- package/src/comps/ToToken.jsx +278 -217
- package/src/constants/index.js +20 -4
- package/src/hooks/useContract.js +164 -125
- package/src/hooks/useGetMinAndMax.js +48 -0
- package/src/hooks/useLspApi.js +56 -39
- package/src/hooks/useParseInvoice.js +82 -72
- package/src/index.jsx +43 -10
- package/src/main.jsx +36 -5
- package/src/utils/index.js +136 -24
- package/vite.config.js +7 -1
- package/dist/astra-sdk.umd.js +0 -12578
- package/dist/hooks.module-BBZfodGH.js +0 -506
- package/dist/index-BKKAfRrw.js +0 -87520
- package/dist/index-C2MAIRET.js +0 -2929
- package/dist/index-CsRxokSv.js +0 -445
- package/dist/index-DQ6iiHxJ.js +0 -13720
- package/dist/index-SJhlkSif.js +0 -133
- package/dist/w3m-modal-CYJpmgnf.js +0 -267
- package/src/constants/contracts/abi/bridge.js +0 -1281
- package/src/constants/contracts/abi/index.js +0 -3
- package/src/constants/contracts/abi/usdt.js +0 -130
- package/src/constants/contracts/abi/watcher.js +0 -437
- package/src/constants/contracts/index.js +0 -37
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { a6 as k, a7 as y, a8 as A, a9 as x, aa as U, ab as b, ac as I, ad as S } from "./index-ClS956E1.js";
|
|
2
|
+
import { ae as O } from "./index-ClS956E1.js";
|
|
3
|
+
q.type = "coinbaseWallet";
|
|
4
|
+
function q(d = {}) {
|
|
5
|
+
return d.version === "3" || d.headlessMode ? N(d) : L(d);
|
|
6
|
+
}
|
|
7
|
+
function L(d) {
|
|
8
|
+
let p, l, a, r;
|
|
9
|
+
return k((o) => ({
|
|
10
|
+
id: "coinbaseWalletSDK",
|
|
11
|
+
name: "Coinbase Wallet",
|
|
12
|
+
rdns: "com.coinbase.wallet",
|
|
13
|
+
type: q.type,
|
|
14
|
+
async connect({ chainId: t, ...i } = {}) {
|
|
15
|
+
try {
|
|
16
|
+
const n = await this.getProvider(), e = (await n.request({
|
|
17
|
+
method: "eth_requestAccounts",
|
|
18
|
+
params: "instantOnboarding" in i && i.instantOnboarding ? [{ onboarding: "instant" }] : []
|
|
19
|
+
})).map((s) => y(s));
|
|
20
|
+
l || (l = this.onAccountsChanged.bind(this), n.on("accountsChanged", l)), a || (a = this.onChainChanged.bind(this), n.on("chainChanged", a)), r || (r = this.onDisconnect.bind(this), n.on("disconnect", r));
|
|
21
|
+
let c = await this.getChainId();
|
|
22
|
+
if (t && c !== t) {
|
|
23
|
+
const s = await this.switchChain({ chainId: t }).catch((f) => {
|
|
24
|
+
if (f.code === b.code)
|
|
25
|
+
throw f;
|
|
26
|
+
return { id: c };
|
|
27
|
+
});
|
|
28
|
+
c = (s == null ? void 0 : s.id) ?? c;
|
|
29
|
+
}
|
|
30
|
+
return { accounts: e, chainId: c };
|
|
31
|
+
} catch (n) {
|
|
32
|
+
throw /(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(n.message) ? new b(n) : n;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async disconnect() {
|
|
36
|
+
var i;
|
|
37
|
+
const t = await this.getProvider();
|
|
38
|
+
l && (t.removeListener("accountsChanged", l), l = void 0), a && (t.removeListener("chainChanged", a), a = void 0), r && (t.removeListener("disconnect", r), r = void 0), t.disconnect(), (i = t.close) == null || i.call(t);
|
|
39
|
+
},
|
|
40
|
+
async getAccounts() {
|
|
41
|
+
return (await (await this.getProvider()).request({
|
|
42
|
+
method: "eth_accounts"
|
|
43
|
+
})).map((i) => y(i));
|
|
44
|
+
},
|
|
45
|
+
async getChainId() {
|
|
46
|
+
const i = await (await this.getProvider()).request({
|
|
47
|
+
method: "eth_chainId"
|
|
48
|
+
});
|
|
49
|
+
return Number(i);
|
|
50
|
+
},
|
|
51
|
+
async getProvider() {
|
|
52
|
+
if (!p) {
|
|
53
|
+
const t = (() => {
|
|
54
|
+
var e;
|
|
55
|
+
return typeof d.preference == "string" ? { options: d.preference } : {
|
|
56
|
+
...d.preference,
|
|
57
|
+
options: ((e = d.preference) == null ? void 0 : e.options) ?? "all"
|
|
58
|
+
};
|
|
59
|
+
})(), { createCoinbaseWalletSDK: i } = await import("./index-qfkTLN90.js");
|
|
60
|
+
p = i({
|
|
61
|
+
...d,
|
|
62
|
+
appChainIds: o.chains.map((e) => e.id),
|
|
63
|
+
preference: t
|
|
64
|
+
}).getProvider();
|
|
65
|
+
}
|
|
66
|
+
return p;
|
|
67
|
+
},
|
|
68
|
+
async isAuthorized() {
|
|
69
|
+
try {
|
|
70
|
+
return !!(await this.getAccounts()).length;
|
|
71
|
+
} catch {
|
|
72
|
+
return !1;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
async switchChain({ addEthereumChainParameter: t, chainId: i }) {
|
|
76
|
+
var c, s, f, w;
|
|
77
|
+
const n = o.chains.find((u) => u.id === i);
|
|
78
|
+
if (!n)
|
|
79
|
+
throw new A(new x());
|
|
80
|
+
const e = await this.getProvider();
|
|
81
|
+
try {
|
|
82
|
+
return await e.request({
|
|
83
|
+
method: "wallet_switchEthereumChain",
|
|
84
|
+
params: [{ chainId: U(n.id) }]
|
|
85
|
+
}), n;
|
|
86
|
+
} catch (u) {
|
|
87
|
+
if (u.code === 4902)
|
|
88
|
+
try {
|
|
89
|
+
let h;
|
|
90
|
+
t != null && t.blockExplorerUrls ? h = t.blockExplorerUrls : h = (c = n.blockExplorers) != null && c.default.url ? [(s = n.blockExplorers) == null ? void 0 : s.default.url] : [];
|
|
91
|
+
let v;
|
|
92
|
+
(f = t == null ? void 0 : t.rpcUrls) != null && f.length ? v = t.rpcUrls : v = [((w = n.rpcUrls.default) == null ? void 0 : w.http[0]) ?? ""];
|
|
93
|
+
const g = {
|
|
94
|
+
blockExplorerUrls: h,
|
|
95
|
+
chainId: U(i),
|
|
96
|
+
chainName: (t == null ? void 0 : t.chainName) ?? n.name,
|
|
97
|
+
iconUrls: t == null ? void 0 : t.iconUrls,
|
|
98
|
+
nativeCurrency: (t == null ? void 0 : t.nativeCurrency) ?? n.nativeCurrency,
|
|
99
|
+
rpcUrls: v
|
|
100
|
+
};
|
|
101
|
+
return await e.request({
|
|
102
|
+
method: "wallet_addEthereumChain",
|
|
103
|
+
params: [g]
|
|
104
|
+
}), n;
|
|
105
|
+
} catch (h) {
|
|
106
|
+
throw new b(h);
|
|
107
|
+
}
|
|
108
|
+
throw new A(u);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
onAccountsChanged(t) {
|
|
112
|
+
t.length === 0 ? this.onDisconnect() : o.emitter.emit("change", {
|
|
113
|
+
accounts: t.map((i) => y(i))
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
onChainChanged(t) {
|
|
117
|
+
const i = Number(t);
|
|
118
|
+
o.emitter.emit("change", { chainId: i });
|
|
119
|
+
},
|
|
120
|
+
async onDisconnect(t) {
|
|
121
|
+
o.emitter.emit("disconnect");
|
|
122
|
+
const i = await this.getProvider();
|
|
123
|
+
l && (i.removeListener("accountsChanged", l), l = void 0), a && (i.removeListener("chainChanged", a), a = void 0), r && (i.removeListener("disconnect", r), r = void 0);
|
|
124
|
+
}
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
function N(d) {
|
|
128
|
+
let l, a, r, o, t;
|
|
129
|
+
return k((i) => ({
|
|
130
|
+
id: "coinbaseWalletSDK",
|
|
131
|
+
name: "Coinbase Wallet",
|
|
132
|
+
rdns: "com.coinbase.wallet",
|
|
133
|
+
type: q.type,
|
|
134
|
+
async connect({ chainId: n } = {}) {
|
|
135
|
+
try {
|
|
136
|
+
const e = await this.getProvider(), c = (await e.request({
|
|
137
|
+
method: "eth_requestAccounts"
|
|
138
|
+
})).map((f) => y(f));
|
|
139
|
+
r || (r = this.onAccountsChanged.bind(this), e.on("accountsChanged", r)), o || (o = this.onChainChanged.bind(this), e.on("chainChanged", o)), t || (t = this.onDisconnect.bind(this), e.on("disconnect", t));
|
|
140
|
+
let s = await this.getChainId();
|
|
141
|
+
if (n && s !== n) {
|
|
142
|
+
const f = await this.switchChain({ chainId: n }).catch((w) => {
|
|
143
|
+
if (w.code === b.code)
|
|
144
|
+
throw w;
|
|
145
|
+
return { id: s };
|
|
146
|
+
});
|
|
147
|
+
s = (f == null ? void 0 : f.id) ?? s;
|
|
148
|
+
}
|
|
149
|
+
return { accounts: c, chainId: s };
|
|
150
|
+
} catch (e) {
|
|
151
|
+
throw /(user closed modal|accounts received is empty|user denied account)/i.test(e.message) ? new b(e) : e;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
async disconnect() {
|
|
155
|
+
const n = await this.getProvider();
|
|
156
|
+
r && (n.removeListener("accountsChanged", r), r = void 0), o && (n.removeListener("chainChanged", o), o = void 0), t && (n.removeListener("disconnect", t), t = void 0), n.disconnect(), n.close();
|
|
157
|
+
},
|
|
158
|
+
async getAccounts() {
|
|
159
|
+
return (await (await this.getProvider()).request({
|
|
160
|
+
method: "eth_accounts"
|
|
161
|
+
})).map((e) => y(e));
|
|
162
|
+
},
|
|
163
|
+
async getChainId() {
|
|
164
|
+
const e = await (await this.getProvider()).request({
|
|
165
|
+
method: "eth_chainId"
|
|
166
|
+
});
|
|
167
|
+
return Number(e);
|
|
168
|
+
},
|
|
169
|
+
async getProvider() {
|
|
170
|
+
var n;
|
|
171
|
+
if (!a) {
|
|
172
|
+
const e = await (async () => {
|
|
173
|
+
const { default: u } = await import("./index-CRU49I0g.js").then((h) => h.i);
|
|
174
|
+
return typeof u != "function" && typeof u.default == "function" ? u.default : u;
|
|
175
|
+
})();
|
|
176
|
+
l = new e({ ...d, reloadOnDisconnect: !1 });
|
|
177
|
+
const c = (n = l.walletExtension) == null ? void 0 : n.getChainId(), s = i.chains.find((u) => d.chainId ? u.id === d.chainId : u.id === c) || i.chains[0], f = d.chainId || (s == null ? void 0 : s.id), w = d.jsonRpcUrl || (s == null ? void 0 : s.rpcUrls.default.http[0]);
|
|
178
|
+
a = l.makeWeb3Provider(w, f);
|
|
179
|
+
}
|
|
180
|
+
return a;
|
|
181
|
+
},
|
|
182
|
+
async isAuthorized() {
|
|
183
|
+
try {
|
|
184
|
+
return !!(await this.getAccounts()).length;
|
|
185
|
+
} catch {
|
|
186
|
+
return !1;
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
async switchChain({ addEthereumChainParameter: n, chainId: e }) {
|
|
190
|
+
var f, w, u, h;
|
|
191
|
+
const c = i.chains.find((v) => v.id === e);
|
|
192
|
+
if (!c)
|
|
193
|
+
throw new A(new x());
|
|
194
|
+
const s = await this.getProvider();
|
|
195
|
+
try {
|
|
196
|
+
return await s.request({
|
|
197
|
+
method: "wallet_switchEthereumChain",
|
|
198
|
+
params: [{ chainId: U(c.id) }]
|
|
199
|
+
}), c;
|
|
200
|
+
} catch (v) {
|
|
201
|
+
if (v.code === 4902)
|
|
202
|
+
try {
|
|
203
|
+
let g;
|
|
204
|
+
n != null && n.blockExplorerUrls ? g = n.blockExplorerUrls : g = (f = c.blockExplorers) != null && f.default.url ? [(w = c.blockExplorers) == null ? void 0 : w.default.url] : [];
|
|
205
|
+
let D;
|
|
206
|
+
(u = n == null ? void 0 : n.rpcUrls) != null && u.length ? D = n.rpcUrls : D = [((h = c.rpcUrls.default) == null ? void 0 : h.http[0]) ?? ""];
|
|
207
|
+
const _ = {
|
|
208
|
+
blockExplorerUrls: g,
|
|
209
|
+
chainId: U(e),
|
|
210
|
+
chainName: (n == null ? void 0 : n.chainName) ?? c.name,
|
|
211
|
+
iconUrls: n == null ? void 0 : n.iconUrls,
|
|
212
|
+
nativeCurrency: (n == null ? void 0 : n.nativeCurrency) ?? c.nativeCurrency,
|
|
213
|
+
rpcUrls: D
|
|
214
|
+
};
|
|
215
|
+
return await s.request({
|
|
216
|
+
method: "wallet_addEthereumChain",
|
|
217
|
+
params: [_]
|
|
218
|
+
}), c;
|
|
219
|
+
} catch (g) {
|
|
220
|
+
throw new b(g);
|
|
221
|
+
}
|
|
222
|
+
throw new A(v);
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
onAccountsChanged(n) {
|
|
226
|
+
n.length === 0 ? this.onDisconnect() : i.emitter.emit("change", {
|
|
227
|
+
accounts: n.map((e) => y(e))
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
onChainChanged(n) {
|
|
231
|
+
const e = Number(n);
|
|
232
|
+
i.emitter.emit("change", { chainId: e });
|
|
233
|
+
},
|
|
234
|
+
async onDisconnect(n) {
|
|
235
|
+
i.emitter.emit("disconnect");
|
|
236
|
+
const e = await this.getProvider();
|
|
237
|
+
r && (e.removeListener("accountsChanged", r), r = void 0), o && (e.removeListener("chainChanged", o), o = void 0), t && (e.removeListener("disconnect", t), t = void 0);
|
|
238
|
+
}
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
C.type = "safe";
|
|
242
|
+
function C(d = {}) {
|
|
243
|
+
const { shimDisconnect: p = !1 } = d;
|
|
244
|
+
let l, a;
|
|
245
|
+
return k((r) => ({
|
|
246
|
+
id: "safe",
|
|
247
|
+
name: "Safe",
|
|
248
|
+
type: C.type,
|
|
249
|
+
async connect() {
|
|
250
|
+
var n;
|
|
251
|
+
const o = await this.getProvider();
|
|
252
|
+
if (!o)
|
|
253
|
+
throw new I();
|
|
254
|
+
const t = await this.getAccounts(), i = await this.getChainId();
|
|
255
|
+
return a || (a = this.onDisconnect.bind(this), o.on("disconnect", a)), p && await ((n = r.storage) == null ? void 0 : n.removeItem("safe.disconnected")), { accounts: t, chainId: i };
|
|
256
|
+
},
|
|
257
|
+
async disconnect() {
|
|
258
|
+
var t;
|
|
259
|
+
const o = await this.getProvider();
|
|
260
|
+
if (!o)
|
|
261
|
+
throw new I();
|
|
262
|
+
a && (o.removeListener("disconnect", a), a = void 0), p && await ((t = r.storage) == null ? void 0 : t.setItem("safe.disconnected", !0));
|
|
263
|
+
},
|
|
264
|
+
async getAccounts() {
|
|
265
|
+
const o = await this.getProvider();
|
|
266
|
+
if (!o)
|
|
267
|
+
throw new I();
|
|
268
|
+
return (await o.request({ method: "eth_accounts" })).map(y);
|
|
269
|
+
},
|
|
270
|
+
async getProvider() {
|
|
271
|
+
if (typeof window < "u" && (window == null ? void 0 : window.parent) !== window) {
|
|
272
|
+
if (!l) {
|
|
273
|
+
const { default: t } = await import("./index-Cs4fWw01.js"), i = new t(d), n = await S(() => i.safe.getInfo(), {
|
|
274
|
+
timeout: d.unstable_getInfoTimeout ?? 10
|
|
275
|
+
});
|
|
276
|
+
if (!n)
|
|
277
|
+
throw new Error("Could not load Safe information");
|
|
278
|
+
const e = await (async () => {
|
|
279
|
+
const c = await import("./index-64U3D9_n.js").then((s) => s.i);
|
|
280
|
+
return typeof c.SafeAppProvider != "function" && typeof c.default.SafeAppProvider == "function" ? c.default.SafeAppProvider : c.SafeAppProvider;
|
|
281
|
+
})();
|
|
282
|
+
l = new e(n, i);
|
|
283
|
+
}
|
|
284
|
+
return l;
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
async getChainId() {
|
|
288
|
+
const o = await this.getProvider();
|
|
289
|
+
if (!o)
|
|
290
|
+
throw new I();
|
|
291
|
+
return Number(o.chainId);
|
|
292
|
+
},
|
|
293
|
+
async isAuthorized() {
|
|
294
|
+
var o;
|
|
295
|
+
try {
|
|
296
|
+
return p && // If shim exists in storage, connector is disconnected
|
|
297
|
+
await ((o = r.storage) == null ? void 0 : o.getItem("safe.disconnected")) ? !1 : !!(await this.getAccounts()).length;
|
|
298
|
+
} catch {
|
|
299
|
+
return !1;
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
onAccountsChanged() {
|
|
303
|
+
},
|
|
304
|
+
onChainChanged() {
|
|
305
|
+
},
|
|
306
|
+
onDisconnect() {
|
|
307
|
+
r.emitter.emit("disconnect");
|
|
308
|
+
}
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
export {
|
|
312
|
+
q as coinbaseWallet,
|
|
313
|
+
O as injected,
|
|
314
|
+
C as safe
|
|
315
|
+
};
|