astra-modal-test 1.0.10 → 1.0.12

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.
Files changed (171) hide show
  1. package/README.md +206 -134
  2. package/dist/{SwapController-DyormRqe.js → SwapController-mYFErPzx.js} +1 -1
  3. package/dist/{add-C1zIRxeS.js → add-CXtFvysR.js} +1 -1
  4. package/dist/{all-wallets-5a2U9fLw.js → all-wallets-B9fFXw5x.js} +1 -1
  5. package/dist/{app-store-2IKrZeLe.js → app-store-BXf1yvR8.js} +1 -1
  6. package/dist/{apple-DH9ESSKX.js → apple-DtcOcX1n.js} +1 -1
  7. package/dist/{arrow-bottom-BxAPS43J.js → arrow-bottom-BXeLKqSV.js} +1 -1
  8. package/dist/{arrow-bottom-circle-Cy5Gjca4.js → arrow-bottom-circle-BVUU200N.js} +1 -1
  9. package/dist/{arrow-left-CBX7JaHB.js → arrow-left-LguJPyNR.js} +1 -1
  10. package/dist/{arrow-right-G72bt1-M.js → arrow-right-D9kKZzGG.js} +1 -1
  11. package/dist/{arrow-top-DCkQG0Dq.js → arrow-top-C5JcaCqz.js} +1 -1
  12. package/dist/{bank-FNxAUs8r.js → bank-DgbCzr0A.js} +1 -1
  13. package/dist/{bin-B-c2CIPW.js → bin-ykHym2bC.js} +1 -1
  14. package/dist/{bitcoin-jk4NLDu1.js → bitcoin-B8jzy_uV.js} +1 -1
  15. package/dist/{browser-D6w0J78l.js → browser-Bk8u8PAA.js} +1 -1
  16. package/dist/{card-BLWRKU-r.js → card-DcwQMUca.js} +1 -1
  17. package/dist/ccip-CwJvuExU.js +239 -0
  18. package/dist/{checkmark-C1pTfaGr.js → checkmark-D3aEYZ8B.js} +1 -1
  19. package/dist/{checkmark-bold-UzogCu8g.js → checkmark-bold-5H7N-CDG.js} +1 -1
  20. package/dist/{chevron-bottom-w_rMAO7x.js → chevron-bottom-BA3C4MR1.js} +1 -1
  21. package/dist/{chevron-left-DGNJGxiP.js → chevron-left-BX18UWKM.js} +1 -1
  22. package/dist/{chevron-right-VFQCvCyG.js → chevron-right-DG7ovxTe.js} +1 -1
  23. package/dist/{chevron-top-DVhFmsKp.js → chevron-top-DHfev7lV.js} +1 -1
  24. package/dist/{chrome-store-BkYX3All.js → chrome-store-BSVzpGdu.js} +1 -1
  25. package/dist/{circle-B1A3j4eP.js → circle-SYFB9f2-.js} +1 -1
  26. package/dist/{clock-BKr-VHDU.js → clock-Cygqlf1g.js} +1 -1
  27. package/dist/{close-BEacRQ8Q.js → close-B43cuuko.js} +1 -1
  28. package/dist/{coinPlaceholder-0ZwtMAHl.js → coinPlaceholder-BHdR6bKb.js} +1 -1
  29. package/dist/{compass-pulK-BFi.js → compass-7S6b6wyA.js} +1 -1
  30. package/dist/{copy-MWCQE0T4.js → copy-CT53bEwd.js} +1 -1
  31. package/dist/{cursor-transparent-Co_5p0du.js → cursor-transparent-LmjzjsFm.js} +1 -1
  32. package/dist/{cursor-C2GVfUuM.js → cursor-vtqRnrF7.js} +1 -1
  33. package/dist/{desktop-C91EoSqM.js → desktop-Doa7TQsq.js} +1 -1
  34. package/dist/{disconnect-BWg1-rml.js → disconnect-C5G6Ncu_.js} +1 -1
  35. package/dist/{discord-Bi0Bfa_e.js → discord-DX7Cl3Ko.js} +1 -1
  36. package/dist/{email-U2WCRPFh.js → email-CyHWh9wL.js} +1 -1
  37. package/dist/{embedded-wallet-B6P0kU9A.js → embedded-wallet-BZQImi7s.js} +8 -8
  38. package/dist/{ethereum-BeZyayQW.js → ethereum-Bwvtk5-_.js} +1 -1
  39. package/dist/{etherscan-BQTsufjv.js → etherscan-CyVRICvw.js} +1 -1
  40. package/dist/{exclamation-triangle-JT-YKNXX.js → exclamation-triangle-BDbPL3nL.js} +1 -1
  41. package/dist/{extension-TnYLHoFA.js → extension-Cx3t2k-R.js} +1 -1
  42. package/dist/{external-link-Dhgai9sc.js → external-link-DZCYpOZI.js} +1 -1
  43. package/dist/{facebook-C6XFGRDw.js → facebook-BEnPrhG3.js} +1 -1
  44. package/dist/{farcaster-CvYbxZQq.js → farcaster-DyBPLb_k.js} +1 -1
  45. package/dist/{filters-DwVRjAav.js → filters-CTwxivn_.js} +1 -1
  46. package/dist/{github-BVZSx-z9.js → github-kzQb61pT.js} +1 -1
  47. package/dist/{google-NbJiQLc5.js → google-DSC-rYNu.js} +1 -1
  48. package/dist/{help-circle-Cum2UOMJ.js → help-circle-C5XfimVx.js} +1 -1
  49. package/dist/{id-kRR6YgVc.js → id-B9fQOT4E.js} +1 -1
  50. package/dist/{image-BWUCRAmp.js → image-1CCj36XM.js} +1 -1
  51. package/dist/{index-RFYbqmu0.js → index-Bjik7E9u.js} +1 -1
  52. package/dist/{index-DQ5AZLMt.js → index-C1fgrzi0.js} +16 -16
  53. package/dist/{index-BZZHE-1t.js → index-CyeGBcX0.js} +1 -1
  54. package/dist/{index-Dq0LIBEh.js → index-DKEMW9N8.js} +25 -25
  55. package/dist/{index-2vYoun4O.js → index-LucuShOc.js} +45292 -56275
  56. package/dist/{info-Br-SBtj3.js → info-Begf9tO0.js} +1 -1
  57. package/dist/{info-circle-Ew4RoR_Q.js → info-circle-Bo1H2OXh.js} +1 -1
  58. package/dist/{lightbulb-BRBVOE_b.js → lightbulb-C-SU_z2I.js} +1 -1
  59. package/dist/{mail-Dzi4AncY.js → mail-CXsYiNAT.js} +1 -1
  60. package/dist/{mobile-BGGxQ5be.js → mobile-C7bUjgog.js} +1 -1
  61. package/dist/{more-BmNaKbYJ.js → more-29BC-wmy.js} +1 -1
  62. package/dist/{network-placeholder-EMiMf4q1.js → network-placeholder-B-x3-6jN.js} +1 -1
  63. package/dist/{nftPlaceholder-CvSqy3Sd.js → nftPlaceholder-pM-Hmswq.js} +1 -1
  64. package/dist/nodeflow-sdk.es.js +15 -0
  65. package/dist/{off-DF9uz0Nc.js → off-DEa_uc7_.js} +1 -1
  66. package/dist/{onramp-cKzTmKku.js → onramp-ZXqyloYt.js} +10 -10
  67. package/dist/{play-store-CGxW4MgL.js → play-store-WgSEpEI1.js} +1 -1
  68. package/dist/{plus-CQ6wWkN0.js → plus-u4UZhYAg.js} +1 -1
  69. package/dist/{qr-code-VBqx9nAF.js → qr-code-DxZGxoPE.js} +1 -1
  70. package/dist/{receive-CVzkHmKR.js → receive-Ct_mQWzk.js} +1 -1
  71. package/dist/{recycle-horizontal-Oq1YtvUx.js → recycle-horizontal-BWVpmHJc.js} +1 -1
  72. package/dist/{refresh-BDlGAzmY.js → refresh-gi4TfgEU.js} +1 -1
  73. package/dist/{reown-logo-BlIpXIlG.js → reown-logo-Bg731n4w.js} +1 -1
  74. package/dist/{search-DfmCmp0m.js → search-BQv7DVJG.js} +1 -1
  75. package/dist/{send-BXudz514.js → send-BzmnFT2p.js} +1 -1
  76. package/dist/{send-Cz0L5LmE.js → send-CyxKtrQ9.js} +17 -17
  77. package/dist/{socials-CDOh8MRf.js → socials-vziOn4zi.js} +5 -5
  78. package/dist/{solana-CbiyOE-8.js → solana-Dz48awbr.js} +1 -1
  79. package/dist/{swapHorizontal-DyU1TH_e.js → swapHorizontal-Cwe1PoMp.js} +1 -1
  80. package/dist/{swapHorizontalBold-CGXW7Ocj.js → swapHorizontalBold-Dxu58sRG.js} +1 -1
  81. package/dist/{swapHorizontalMedium-2KTcj67d.js → swapHorizontalMedium-DOZZthlB.js} +1 -1
  82. package/dist/{swapHorizontalRoundedBold-TxFtmmda.js → swapHorizontalRoundedBold-BkIZQXnD.js} +1 -1
  83. package/dist/{swapVertical-BKD6lxM3.js → swapVertical-LSq66ctC.js} +1 -1
  84. package/dist/{swaps-BuGsEQaI.js → swaps-C2EO6dQA.js} +9 -9
  85. package/dist/{telegram-CAsl9DeG.js → telegram-ITq9s69Y.js} +1 -1
  86. package/dist/{three-dots-BoE2aHZi.js → three-dots-JH3A1TFR.js} +1 -1
  87. package/dist/{transactions-C1NtsnD6.js → transactions-DpMVZVap.js} +1 -1
  88. package/dist/{twitch-CvkZZxgT.js → twitch-BKs5FlDf.js} +1 -1
  89. package/dist/{twitterIcon-CrhnOl_O.js → twitterIcon-CCXEj_Nv.js} +1 -1
  90. package/dist/{ui-BJcuThPA.js → ui-D5ULRvGt.js} +6 -6
  91. package/dist/{user-BZRWUXG7.js → user-CBgAUjZv.js} +1 -1
  92. package/dist/{verify-y9F4DcJ4.js → verify-BPlPPkhG.js} +1 -1
  93. package/dist/{verify-filled-X_8-BhMk.js → verify-filled-qTRg0OWM.js} +1 -1
  94. package/dist/{w3m-modal-BX--v1Nc.js → w3m-modal-DSdDfy32.js} +27 -27
  95. package/dist/{wallet-CIaVVkjQ.js → wallet-BuDEi_8z.js} +1 -1
  96. package/dist/{wallet-placeholder-Cq1ofde1.js → wallet-placeholder-D4DKTuB_.js} +1 -1
  97. package/dist/{walletconnect-CINzSCJ3.js → walletconnect-Dt3q5XFc.js} +1 -1
  98. package/dist/{warning-circle-BvBNhMKH.js → warning-circle-B8Fkc0_4.js} +1 -1
  99. package/dist/{x-xHY7JehW.js → x-Cm_V3zUI.js} +1 -1
  100. package/dist/{x-mark-DEmnBt6u.js → x-mark-BVvwdxda.js} +1 -1
  101. package/package.json +11 -10
  102. package/.github/workflows/code-quality.yml +0 -43
  103. package/.github/workflows/publish.yml +0 -64
  104. package/dist/astra-sdk.es.js +0 -9
  105. package/dist/ccip-DkYvh7hg.js +0 -149
  106. package/dist/clsx.m-DCYaa4RU.js +0 -20
  107. package/dist/index-BDE-2VTp.js +0 -315
  108. package/dist/index-BjLIiJQa.js +0 -21034
  109. package/dist/index-CIr4zlVp.js +0 -386
  110. package/dist/index-ChxXyuZj.js +0 -572
  111. package/dist/index-D-T7kk3G.js +0 -15911
  112. package/dist/index-DSX3HrTS.js +0 -10785
  113. package/dist/secp256k1-CsKSDHNi.js +0 -1257
  114. package/eslint.config.mjs +0 -41
  115. package/index.html +0 -13
  116. package/public/font/ClashDisplay-Variable.ttf +0 -0
  117. package/public/font/ClashDisplay-Variable.woff +0 -0
  118. package/public/font/ClashDisplay-Variable.woff2 +0 -0
  119. package/public/vite.svg +0 -1
  120. package/src/App.css +0 -170
  121. package/src/apis/lspApi.js +0 -82
  122. package/src/apis/request.js +0 -59
  123. package/src/assets/arrow-right.svg +0 -3
  124. package/src/assets/astr.svg +0 -13
  125. package/src/assets/bridge-loading.png +0 -0
  126. package/src/assets/ln.png +0 -0
  127. package/src/assets/network/Arbitrum.png +0 -0
  128. package/src/assets/network/Polygon.png +0 -0
  129. package/src/assets/network/Solana.png +0 -0
  130. package/src/assets/network/base.png +0 -0
  131. package/src/assets/network/botanix.png +0 -0
  132. package/src/assets/network/bsc.svg +0 -13
  133. package/src/assets/network/eth.png +0 -0
  134. package/src/assets/network/lighting.png +0 -0
  135. package/src/assets/network/ligtning.svg +0 -22
  136. package/src/assets/network/solona.png +0 -0
  137. package/src/assets/pay.png +0 -0
  138. package/src/assets/powerby.svg +0 -14
  139. package/src/assets/react.svg +0 -1
  140. package/src/assets/success.svg +0 -3
  141. package/src/assets/tip.svg +0 -5
  142. package/src/assets/tokens/sol.png +0 -0
  143. package/src/assets/tokens/usdc.png +0 -0
  144. package/src/assets/tokens/usdt.png +0 -0
  145. package/src/comps/AstraImage.jsx +0 -37
  146. package/src/comps/AstraModal.jsx +0 -202
  147. package/src/comps/AstraModalLogo.jsx +0 -29
  148. package/src/comps/AstraNetwork.jsx +0 -261
  149. package/src/comps/CheckErc20Button.jsx +0 -28
  150. package/src/comps/CommonStyle.jsx +0 -4
  151. package/src/comps/ConnectButton.jsx +0 -19
  152. package/src/comps/EllipsisMiddle.jsx +0 -42
  153. package/src/comps/ResultModal.jsx +0 -312
  154. package/src/comps/ToLightning.jsx +0 -653
  155. package/src/comps/ToToken.jsx +0 -550
  156. package/src/constants/index.js +0 -21
  157. package/src/font/ClashDisplay-Variable.ttf +0 -0
  158. package/src/font/ClashDisplay-Variable.woff +0 -0
  159. package/src/font/ClashDisplay-Variable.woff2 +0 -0
  160. package/src/hooks/useContract.js +0 -179
  161. package/src/hooks/useGetMinAndMax.js +0 -48
  162. package/src/hooks/useLspApi.js +0 -70
  163. package/src/hooks/useParseInvoice.js +0 -95
  164. package/src/index.css +0 -69
  165. package/src/index.jsx +0 -161
  166. package/src/lib/bolt11.min.js +0 -1
  167. package/src/main.jsx +0 -75
  168. package/src/store/index.js +0 -25
  169. package/src/theme.js +0 -108
  170. package/src/utils/index.js +0 -267
  171. package/vite.config.js +0 -50
@@ -1,315 +0,0 @@
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-2vYoun4O.js";
2
- import { ae as O } from "./index-2vYoun4O.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-DSX3HrTS.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-D-T7kk3G.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-CIr4zlVp.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-BjLIiJQa.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
- };