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.
Files changed (154) hide show
  1. package/.github/workflows/code-quality.yml +43 -0
  2. package/.github/workflows/publish.yml +64 -0
  3. package/README.md +204 -0
  4. package/dist/SwapController-CsNqEWIM.js +447 -0
  5. package/dist/add-Dm_oSEbv.js +19 -0
  6. package/dist/all-wallets-DfLlzQJ3.js +10 -0
  7. package/dist/app-store-BMdJkp6P.js +21 -0
  8. package/dist/apple-BetlVMKw.js +22 -0
  9. package/dist/arrow-bottom-BddPptxy.js +12 -0
  10. package/dist/arrow-bottom-circle-CvdJJniv.js +15 -0
  11. package/dist/arrow-left-Bbq-z1nQ.js +12 -0
  12. package/dist/arrow-right-Bu4_SVLC.js +12 -0
  13. package/dist/arrow-top-CynlXB-M.js +12 -0
  14. package/dist/astra-sdk.es.js +4 -4
  15. package/dist/bank-B9QscNnS.js +18 -0
  16. package/dist/bin-v-tshf8_.js +8 -0
  17. package/dist/bitcoin-C01gkYyN.js +17 -0
  18. package/dist/browser-9uNaCY31.js +18 -0
  19. package/dist/card-hKR9lRzU.js +18 -0
  20. package/dist/{ccip-oZOrZYR9.js → ccip-CUCziAPw.js} +52 -49
  21. package/dist/checkmark-D1M40aM5.js +15 -0
  22. package/dist/checkmark-bold-1_UGl24m.js +12 -0
  23. package/dist/chevron-bottom-BleoRNRL.js +12 -0
  24. package/dist/chevron-left-C9JMU-3B.js +12 -0
  25. package/dist/chevron-right-Daue4WBx.js +12 -0
  26. package/dist/chevron-top-yuXekbUC.js +12 -0
  27. package/dist/chrome-store-BsUFRR7F.js +65 -0
  28. package/dist/circle-BCxdhM5X.js +8 -0
  29. package/dist/clock-7a-DWZQa.js +12 -0
  30. package/dist/close-DMQYuJ0z.js +12 -0
  31. package/dist/clsx.m-DCYaa4RU.js +20 -0
  32. package/dist/coinPlaceholder-DjQ-HnSH.js +12 -0
  33. package/dist/compass-AMecXNVm.js +12 -0
  34. package/dist/copy-CgIPGYbU.js +19 -0
  35. package/dist/cursor-DpYbTNcO.js +7 -0
  36. package/dist/cursor-transparent-C8iPJkn8.js +16 -0
  37. package/dist/desktop-BWVQVGng.js +13 -0
  38. package/dist/disconnect-C6IQRrtF.js +12 -0
  39. package/dist/discord-gH3i-QsC.js +21 -0
  40. package/dist/email-BxYwJC5T.js +10 -0
  41. package/dist/embedded-wallet-DCcVNgkc.js +464 -0
  42. package/dist/ethereum-CGWsmZaC.js +14 -0
  43. package/dist/etherscan-D4EFsAJ4.js +10 -0
  44. package/dist/exclamation-triangle-DNwQ1Xq6.js +8 -0
  45. package/dist/extension-DxQPsN2z.js +12 -0
  46. package/dist/external-link-BeEzrdgR.js +12 -0
  47. package/dist/facebook-B2Ix8_d3.js +30 -0
  48. package/dist/farcaster-BB83p8dC.js +16 -0
  49. package/dist/filters-PzdIomB1.js +12 -0
  50. package/dist/github-gcp1rxX0.js +22 -0
  51. package/dist/google-Qv9lTZcz.js +22 -0
  52. package/dist/help-circle-BLXTMjzX.js +16 -0
  53. package/dist/id-BHg2CRhj.js +16 -0
  54. package/dist/image-DWi1V30x.js +8 -0
  55. package/dist/index-4lbsZ6RQ.js +33 -0
  56. package/dist/index-64U3D9_n.js +21034 -0
  57. package/dist/index-CRU49I0g.js +15911 -0
  58. package/dist/index-ChxXyuZj.js +572 -0
  59. package/dist/index-ClS956E1.js +74511 -0
  60. package/dist/index-Cs4fWw01.js +386 -0
  61. package/dist/index-DfWqgW4h.js +709 -0
  62. package/dist/index-VYNI76FM.js +315 -0
  63. package/dist/index-qfkTLN90.js +10785 -0
  64. package/dist/index-r2ztgVN2.js +1060 -0
  65. package/dist/index-wvh7Yd5J.js +70 -0
  66. package/dist/info-Bl5tmiBJ.js +7 -0
  67. package/dist/info-circle-D2uYywg-.js +16 -0
  68. package/dist/lightbulb-HvXH2AVF.js +7 -0
  69. package/dist/mail-DXOPfnog.js +12 -0
  70. package/dist/mobile-Dd0Gj4vZ.js +13 -0
  71. package/dist/more-DYcnClbB.js +15 -0
  72. package/dist/network-placeholder-CfRZGQfi.js +18 -0
  73. package/dist/nftPlaceholder-DHmFkY55.js +12 -0
  74. package/dist/off-CG2Y30qN.js +8 -0
  75. package/dist/onramp-DoAMTeNm.js +917 -0
  76. package/dist/play-store-B5EYBQto.js +36 -0
  77. package/dist/plus-DPo25_zL.js +17 -0
  78. package/dist/qr-code-BRTO19PL.js +10 -0
  79. package/dist/receive-BvclNdV_.js +179 -0
  80. package/dist/recycle-horizontal-ng_b2eJV.js +13 -0
  81. package/dist/refresh-3kiwRV0w.js +12 -0
  82. package/dist/reown-logo-_9cuIfJD.js +16 -0
  83. package/dist/search-CoJvIxpi.js +12 -0
  84. package/dist/secp256k1-wZyK2iIX.js +1257 -0
  85. package/dist/send-BVKGSR-Z.js +19 -0
  86. package/dist/send-Bkj5YtHe.js +1039 -0
  87. package/dist/socials-DL42HlL5.js +589 -0
  88. package/dist/solana-BjP-_Ioa.js +17 -0
  89. package/dist/swapHorizontal-Do3uBbum.js +12 -0
  90. package/dist/swapHorizontalBold-D7N75BE-.js +12 -0
  91. package/dist/swapHorizontalMedium-BahEVO2x.js +20 -0
  92. package/dist/swapHorizontalRoundedBold-D6Hoi132.js +12 -0
  93. package/dist/swapVertical-P-fnrADh.js +12 -0
  94. package/dist/swaps-DZgbVJZ2.js +1713 -0
  95. package/dist/telegram-DmaL2iB8.js +20 -0
  96. package/dist/three-dots-oXyAsUA6.js +9 -0
  97. package/dist/transactions-BjB5yZN7.js +35 -0
  98. package/dist/twitch-0UGrMr2K.js +22 -0
  99. package/dist/twitterIcon-B97KAbaJ.js +10 -0
  100. package/dist/ui-r6nnVhBA.js +812 -0
  101. package/dist/user-BG1yp56Q.js +7 -0
  102. package/dist/verify-CgzkMSuV.js +12 -0
  103. package/dist/verify-filled-D-TRpWtN.js +12 -0
  104. package/dist/w3m-modal-Drsibcs0.js +1041 -0
  105. package/dist/wallet-CAHsZdfj.js +12 -0
  106. package/dist/wallet-placeholder-agbbreqw.js +18 -0
  107. package/dist/walletconnect-Yd8iXqY9.js +36 -0
  108. package/dist/warning-circle-C0hqC6h_.js +16 -0
  109. package/dist/x-mark-D9_ai2sI.js +7 -0
  110. package/dist/x-z6v1Jegg.js +16 -0
  111. package/eslint.config.mjs +1 -1
  112. package/package.json +14 -13
  113. package/src/apis/lspApi.js +47 -24
  114. package/src/assets/ln.png +0 -0
  115. package/src/assets/network/Arbitrum.png +0 -0
  116. package/src/assets/network/Polygon.png +0 -0
  117. package/src/assets/network/Solana.png +0 -0
  118. package/src/assets/network/botanix.png +0 -0
  119. package/src/assets/network/bsc.svg +13 -0
  120. package/src/assets/pay.png +0 -0
  121. package/src/assets/tokens/usdc.png +0 -0
  122. package/src/assets/tokens/usdt.png +0 -0
  123. package/src/comps/AstraImage.jsx +17 -3
  124. package/src/comps/AstraModal.jsx +22 -16
  125. package/src/comps/AstraModalLogo.jsx +9 -9
  126. package/src/comps/AstraNetwork.jsx +174 -45
  127. package/src/comps/CheckErc20Button.jsx +1 -1
  128. package/src/comps/CommonStyle.jsx +4 -0
  129. package/src/comps/ConnectButton.jsx +16 -33
  130. package/src/comps/ResultModal.jsx +45 -39
  131. package/src/comps/ToLightning.jsx +207 -80
  132. package/src/comps/ToToken.jsx +278 -217
  133. package/src/constants/index.js +20 -4
  134. package/src/hooks/useContract.js +164 -125
  135. package/src/hooks/useGetMinAndMax.js +48 -0
  136. package/src/hooks/useLspApi.js +56 -39
  137. package/src/hooks/useParseInvoice.js +82 -72
  138. package/src/index.jsx +43 -10
  139. package/src/main.jsx +36 -5
  140. package/src/utils/index.js +136 -24
  141. package/vite.config.js +7 -1
  142. package/dist/astra-sdk.umd.js +0 -12578
  143. package/dist/hooks.module-BBZfodGH.js +0 -506
  144. package/dist/index-BKKAfRrw.js +0 -87520
  145. package/dist/index-C2MAIRET.js +0 -2929
  146. package/dist/index-CsRxokSv.js +0 -445
  147. package/dist/index-DQ6iiHxJ.js +0 -13720
  148. package/dist/index-SJhlkSif.js +0 -133
  149. package/dist/w3m-modal-CYJpmgnf.js +0 -267
  150. package/src/constants/contracts/abi/bridge.js +0 -1281
  151. package/src/constants/contracts/abi/index.js +0 -3
  152. package/src/constants/contracts/abi/usdt.js +0 -130
  153. package/src/constants/contracts/abi/watcher.js +0 -437
  154. 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
+ };