@directcryptopay/sdk 0.2.2 → 0.2.3

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 (228) hide show
  1. package/dist/ExchangeController-CPMQq6Q-.js +217 -0
  2. package/dist/HelpersUtil-DfMFC7Bf.js +120 -0
  3. package/dist/NavigationUtil-kj9LEOOd.js +8 -0
  4. package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
  5. package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
  6. package/dist/PhArrowDown-C9AkNvLs.js +73 -0
  7. package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
  8. package/dist/PhArrowRight-DM1tna0G.js +73 -0
  9. package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
  10. package/dist/PhArrowUp-DmktzOWy.js +73 -0
  11. package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
  12. package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
  13. package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
  14. package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
  15. package/dist/PhBank-4_9QzqIB.js +73 -0
  16. package/dist/PhBrowser-B-JSznId.js +73 -0
  17. package/dist/PhCaretDown-vV5oHMNi.js +73 -0
  18. package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
  19. package/dist/PhCaretRight-CqQN4TT3.js +73 -0
  20. package/dist/PhCaretUp-Df7UCAHy.js +73 -0
  21. package/dist/PhCheck-gtpfK4ed.js +73 -0
  22. package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
  23. package/dist/PhClock-SDCW-NmF.js +73 -0
  24. package/dist/PhCompass-B7hgtdx-.js +73 -0
  25. package/dist/PhCopy-BcnhyXCy.js +73 -0
  26. package/dist/PhCreditCard-BJjByVgu.js +73 -0
  27. package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
  28. package/dist/PhDesktop-B3VKPuJx.js +73 -0
  29. package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
  30. package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
  31. package/dist/PhEnvelope-67uzHbI9.js +73 -0
  32. package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
  33. package/dist/PhGlobe-TMm_6qGk.js +73 -0
  34. package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
  35. package/dist/PhImage-gY96WtHR.js +73 -0
  36. package/dist/PhInfo-DRQM_ZDP.js +73 -0
  37. package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
  38. package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
  39. package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
  40. package/dist/PhPlus-BfTsQnUz.js +73 -0
  41. package/dist/PhPower-CxYUGOWn.js +73 -0
  42. package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
  43. package/dist/PhQrCode-BuJ97NYJ.js +73 -0
  44. package/dist/PhQuestion-kJoP8Mja.js +73 -0
  45. package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
  46. package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
  47. package/dist/PhSignOut-jk97OSVt.js +73 -0
  48. package/dist/PhSpinner-CiYOhwMg.js +73 -0
  49. package/dist/PhTrash-pxerMqzd.js +73 -0
  50. package/dist/PhUser-BMg0VV4A.js +73 -0
  51. package/dist/PhVault-DYQvx5A-.js +73 -0
  52. package/dist/PhWarning-NLC5Mj87.js +73 -0
  53. package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
  54. package/dist/PhX-Bx4wpwm3.js +73 -0
  55. package/dist/SwapController-Cti0Cyxa.js +457 -0
  56. package/dist/{ccip-BIGqktC1.js → ccip-CKZd2XJ7.js} +4 -4
  57. package/dist/data-capture-7D5CL385.js +490 -0
  58. package/dist/dcp-sdk.umd.js +7400 -6589
  59. package/dist/email-AmK0INbZ.js +344 -0
  60. package/dist/embedded-wallet-Pn0I_XLn.js +820 -0
  61. package/dist/features-x8XNprEe.js +274 -0
  62. package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-B50-z0AA.js} +6 -6
  63. package/dist/if-defined-CdZSZ6UL.js +10 -0
  64. package/dist/index-4ewUtPPp.js +7981 -0
  65. package/dist/{index-D6h-qfpt.js → index-51l86yqx.js} +5 -5
  66. package/dist/index-B6K56LF_.js +85 -0
  67. package/dist/index-BAmv9PxJ.js +257 -0
  68. package/dist/index-BEswjY9r.js +117 -0
  69. package/dist/index-BSKRq56S.js +355 -0
  70. package/dist/index-BaygXQxx.js +172 -0
  71. package/dist/index-BcPxaHr5.js +118 -0
  72. package/dist/index-Bjt7nGaJ.js +199 -0
  73. package/dist/{index-D5r0iSq4.js → index-BkTSyAJb.js} +1 -1
  74. package/dist/index-Bmnl7l2U.js +555 -0
  75. package/dist/index-BvPvouSq.js +56 -0
  76. package/dist/index-C-6iznUO.js +174 -0
  77. package/dist/index-C4M5s_AM.js +228 -0
  78. package/dist/index-CEqcN8QP.js +1175 -0
  79. package/dist/{index-CPTcEPbD.js → index-CM3YaYca.js} +296 -298
  80. package/dist/{index-f3LXSfM5.js → index-CclBLA5r.js} +56 -142
  81. package/dist/index-ChTxJOiF.js +46 -0
  82. package/dist/index-CmAv0Tzr.js +86 -0
  83. package/dist/index-CmvoKY4x.js +125 -0
  84. package/dist/{index-BdSIrl-R.js → index-D7PmdQ9B.js} +578 -570
  85. package/dist/{index-DobBVPe4.js → index-D7k2Pc4e.js} +481 -236
  86. package/dist/index-D7lmgqUR.js +153 -0
  87. package/dist/index-DG_-qYze.js +107 -0
  88. package/dist/{index-Dy4NyE6l.js → index-DHot9Fdb.js} +7 -7
  89. package/dist/index-DV2LrPtU.js +123 -0
  90. package/dist/index-DYBaJQ2W.js +65 -0
  91. package/dist/{index-BJ7cbG3N.js → index-D_8VUmn1.js} +36688 -40208
  92. package/dist/index-D_gLn3rT.js +100 -0
  93. package/dist/index-DqcVUSC9.js +62 -0
  94. package/dist/index-I7VDqINw.js +128 -0
  95. package/dist/index-Oz72I9VP.js +209 -0
  96. package/dist/index-UclsHkJ0.js +118 -0
  97. package/dist/index-X8zir_1j.js +110 -0
  98. package/dist/index-XvlWKGCu.js +1281 -0
  99. package/dist/index-dO97xPlt.js +171 -0
  100. package/dist/{index-5mp7WkhV.js → index-uBeF6OAB.js} +2 -2
  101. package/dist/index-zeA_RiCV.js +159 -0
  102. package/dist/index.js +1 -1
  103. package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-BUZHGdjw.js} +1 -1
  104. package/dist/onramp-CdnBuF0r.js +855 -0
  105. package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CcyTNGr4.js} +2312 -2313
  106. package/dist/pay-with-exchange-CSM6WCOV.js +525 -0
  107. package/dist/property-Bd8U3_QP.js +618 -0
  108. package/dist/receive-DooMu4Dx.js +232 -0
  109. package/dist/ref-CpgjXAw7.js +107 -0
  110. package/dist/send-3T7CyYic.js +1166 -0
  111. package/dist/socials-Dt-iHL17.js +620 -0
  112. package/dist/swaps-CjA9Es42.js +1760 -0
  113. package/dist/{transactions-DujFkB-M.js → transactions-nRm9DVzn.js} +10 -10
  114. package/dist/w3m-modal-NV25AXhM.js +1706 -0
  115. package/package.json +3 -3
  116. package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
  117. package/dist/add-sji6scSD.js +0 -19
  118. package/dist/all-wallets-B4H-890E.js +0 -10
  119. package/dist/app-store-Z433s97G.js +0 -21
  120. package/dist/apple-b8Lxj7nb.js +0 -22
  121. package/dist/arrow-bottom-M9oWWo_9.js +0 -12
  122. package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
  123. package/dist/arrow-left-Dw8AKfwf.js +0 -12
  124. package/dist/arrow-right-DwLQZSC_.js +0 -12
  125. package/dist/arrow-top-zhUjkBe1.js +0 -12
  126. package/dist/bank-CbQdnILK.js +0 -18
  127. package/dist/browser-xAqNwt7z.js +0 -18
  128. package/dist/card-Dr1QBmWp.js +0 -18
  129. package/dist/checkmark-BhT1dTgG.js +0 -15
  130. package/dist/checkmark-bold-CPB29wqQ.js +0 -12
  131. package/dist/chevron-bottom-BhNyx2II.js +0 -12
  132. package/dist/chevron-left-CGuEjQlY.js +0 -12
  133. package/dist/chevron-right-CvIRRsqZ.js +0 -12
  134. package/dist/chevron-top-RSzCqjBd.js +0 -12
  135. package/dist/chrome-store-Cs8dAgs0.js +0 -65
  136. package/dist/clock-fhZO5otC.js +0 -12
  137. package/dist/close-BPuztrdR.js +0 -12
  138. package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
  139. package/dist/compass-WMc5huk0.js +0 -12
  140. package/dist/copy-DVAeT17y.js +0 -19
  141. package/dist/cursor-BJ4YLXfy.js +0 -7
  142. package/dist/cursor-transparent-DN2fLQN4.js +0 -16
  143. package/dist/desktop-6avxisBw.js +0 -13
  144. package/dist/disconnect-AReVI8Gk.js +0 -12
  145. package/dist/discord-CxrI30BZ.js +0 -21
  146. package/dist/email-B8dIIaay.js +0 -696
  147. package/dist/embedded-wallet-C_5hF7rM.js +0 -468
  148. package/dist/etherscan-BnAy8cIF.js +0 -10
  149. package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
  150. package/dist/extension-F0LIhvcf.js +0 -12
  151. package/dist/external-link-CP6phyaM.js +0 -12
  152. package/dist/facebook-BtQ-Io2y.js +0 -30
  153. package/dist/farcaster-BmaN1ugd.js +0 -16
  154. package/dist/filters-DpEwoOmy.js +0 -12
  155. package/dist/github-q7qO9V-b.js +0 -22
  156. package/dist/google-DH_ZE8bW.js +0 -22
  157. package/dist/help-circle-BAQVmKas.js +0 -16
  158. package/dist/id-Cj68Zwgo.js +0 -16
  159. package/dist/if-defined-CNte9B3N.js +0 -744
  160. package/dist/image-BKJDw6N-.js +0 -8
  161. package/dist/index-7toZMdtG.js +0 -573
  162. package/dist/index-B1uKzdvN.js +0 -170
  163. package/dist/index-BHFZVF-b.js +0 -257
  164. package/dist/index-BKwa5JSA.js +0 -559
  165. package/dist/index-BP4B9VUt.js +0 -54
  166. package/dist/index-BVdzXHpO.js +0 -181
  167. package/dist/index-BYND0GJ9.js +0 -146
  168. package/dist/index-BaJ0zEbh.js +0 -97
  169. package/dist/index-Bh0MPFwP.js +0 -58
  170. package/dist/index-Bsh7_qTp.js +0 -511
  171. package/dist/index-BwnXTNNg.js +0 -199
  172. package/dist/index-C0kPDbg_.js +0 -77
  173. package/dist/index-CKikVKe2.js +0 -75
  174. package/dist/index-ChVh0Hkp.js +0 -243
  175. package/dist/index-Cle_NnnS.js +0 -305
  176. package/dist/index-CmWdvIFT.js +0 -51
  177. package/dist/index-D2AMA8Bu.js +0 -65
  178. package/dist/index-DAUM8CO4.js +0 -65
  179. package/dist/index-DGjZW6uR.js +0 -78
  180. package/dist/index-DQe94z7X.js +0 -265
  181. package/dist/index-DTo6w99t.js +0 -7864
  182. package/dist/index-DYdXjap2.js +0 -320
  183. package/dist/index-DceCxNV5.js +0 -181
  184. package/dist/index-Uw9cSw0q.js +0 -294
  185. package/dist/index-qiuyrukh.js +0 -45
  186. package/dist/index-zddvaohA.js +0 -78
  187. package/dist/info-RfPsmroW.js +0 -7
  188. package/dist/info-circle-DFKHB_ZN.js +0 -16
  189. package/dist/lightbulb-B-Bykj9X.js +0 -7
  190. package/dist/mail-mBAgGuw5.js +0 -12
  191. package/dist/mobile-Dhh3ndkf.js +0 -13
  192. package/dist/more-D1h7UTvg.js +0 -15
  193. package/dist/network-placeholder-Dqynvc-t.js +0 -18
  194. package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
  195. package/dist/off-BmG3cHTX.js +0 -12
  196. package/dist/onramp-C401Aenb.js +0 -1279
  197. package/dist/play-store-4q1fzL_P.js +0 -36
  198. package/dist/plus-603Gs3yG.js +0 -17
  199. package/dist/qr-code-Dgwhf6M1.js +0 -10
  200. package/dist/receive-CYXbbEUR.js +0 -186
  201. package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
  202. package/dist/ref-DpmKRWBK.js +0 -41
  203. package/dist/refresh-BMZFu0mu.js +0 -12
  204. package/dist/reown-logo-BXph7ThY.js +0 -16
  205. package/dist/search-Cm_V42Y_.js +0 -12
  206. package/dist/secp256k1-C0iX1TUr.js +0 -1510
  207. package/dist/secp256k1-DOQBqE4Z.js +0 -1302
  208. package/dist/send-BSMYxDuP.js +0 -19
  209. package/dist/send-C8EeIzRB.js +0 -1038
  210. package/dist/socials-DQrHQajs.js +0 -574
  211. package/dist/swapHorizontal-98rnJewS.js +0 -12
  212. package/dist/swapHorizontalBold-C299FjEt.js +0 -12
  213. package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
  214. package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
  215. package/dist/swapVertical-DSL75l8L.js +0 -12
  216. package/dist/swaps-BuTNp65Y.js +0 -1637
  217. package/dist/telegram-cJP7hgUb.js +0 -20
  218. package/dist/three-dots-DHnEh28O.js +0 -9
  219. package/dist/twitch-CR2iGcBo.js +0 -22
  220. package/dist/twitterIcon-E5TAQjOn.js +0 -10
  221. package/dist/verify-DEukUJp0.js +0 -12
  222. package/dist/verify-filled-BXsx1i_p.js +0 -12
  223. package/dist/w3m-modal-Bm7BqVng.js +0 -1037
  224. package/dist/wallet-CzyyvdrT.js +0 -12
  225. package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
  226. package/dist/walletconnect-BSYogWiE.js +0 -36
  227. package/dist/warning-circle-Cgp2BW3m.js +0 -16
  228. package/dist/x-BJinLpTw.js +0 -16
@@ -1,13 +1,16 @@
1
- import { di as Y, dJ as _, d1 as R, cY as h, dd as U, d6 as f, dK as $, cU as W, d8 as A, cZ as I, cX as E, cJ as O, dL as S, cS as P, cV as B, cW as H, cE as M, cF as G, cG as d, c$ as F } from "./index-BJ7cbG3N.js";
2
- import { o as C, r as w, c as V } from "./if-defined-CNte9B3N.js";
3
- import "./index-Uw9cSw0q.js";
4
- import "./index-DYdXjap2.js";
5
- import "./index-D2AMA8Bu.js";
6
- import "./index-CmWdvIFT.js";
7
- import "./index-DceCxNV5.js";
8
- import "./index-BaJ0zEbh.js";
9
- import "./index-qiuyrukh.js";
10
- import "./index-DAUM8CO4.js";
1
+ import { cM as $, dz as b, cG as C, cE as p, d2 as g, dA as B, d1 as w, dB as j, cC as q, cF as _, cH as T, d0 as L, df as x, cR as z, cS as X, c_ as F, cX as W, cY as m, di as J, d8 as M, dh as Z } from "./index-D_8VUmn1.js";
2
+ import { r as h, c as H } from "./index-CEqcN8QP.js";
3
+ import { o as Y } from "./if-defined-CdZSZ6UL.js";
4
+ import "./index-Oz72I9VP.js";
5
+ import "./index-BaygXQxx.js";
6
+ import "./index-BEswjY9r.js";
7
+ import "./index-I7VDqINw.js";
8
+ import "./index-BcPxaHr5.js";
9
+ import "./index-CmAv0Tzr.js";
10
+ import "./index-CmvoKY4x.js";
11
+ import "./index-ChTxJOiF.js";
12
+ import "./index-DV2LrPtU.js";
13
+ import "./index-DYBaJQ2W.js";
11
14
  const o = {
12
15
  INVALID_PAYMENT_CONFIG: "INVALID_PAYMENT_CONFIG",
13
16
  INVALID_RECIPIENT: "INVALID_RECIPIENT",
@@ -21,7 +24,7 @@ const o = {
21
24
  ASSET_NOT_SUPPORTED: "ASSET_NOT_SUPPORTED",
22
25
  UNABLE_TO_GET_PAY_URL: "UNABLE_TO_GET_PAY_URL",
23
26
  UNABLE_TO_GET_BUY_STATUS: "UNABLE_TO_GET_BUY_STATUS"
24
- }, g = {
27
+ }, N = {
25
28
  [o.INVALID_PAYMENT_CONFIG]: "Invalid payment configuration",
26
29
  [o.INVALID_RECIPIENT]: "Invalid recipient address",
27
30
  [o.INVALID_ASSET]: "Invalid asset specified",
@@ -37,44 +40,49 @@ const o = {
37
40
  };
38
41
  class c extends Error {
39
42
  get message() {
40
- return g[this.code];
43
+ return N[this.code];
41
44
  }
42
45
  constructor(e, s) {
43
- super(g[e]), this.name = "AppKitPayError", this.code = e, this.details = s, Error.captureStackTrace && Error.captureStackTrace(this, c);
46
+ super(N[e]), this.name = "AppKitPayError", this.code = e, this.details = s, Error.captureStackTrace && Error.captureStackTrace(this, c);
44
47
  }
45
48
  }
46
- const j = "https://rpc.walletconnect.org/v1/json-rpc";
47
- class K extends Error {
49
+ const Q = "https://rpc.walletconnect.org/v1/json-rpc";
50
+ class ee extends Error {
48
51
  }
49
- function z() {
50
- const t = Y.getSnapshot().projectId;
51
- return `${j}?projectId=${t}`;
52
+ function te() {
53
+ const t = $.getSnapshot().projectId;
54
+ return `${Q}?projectId=${t}`;
52
55
  }
53
- async function k(t, e) {
54
- const s = z(), i = await (await fetch(s, {
56
+ async function O(t, e) {
57
+ const s = te(), { sdkType: a, sdkVersion: r, projectId: i } = $.getSnapshot(), u = {
58
+ jsonrpc: "2.0",
59
+ id: 1,
60
+ method: t,
61
+ params: {
62
+ ...e || {},
63
+ st: a,
64
+ sv: r,
65
+ projectId: i
66
+ }
67
+ }, A = await (await fetch(s, {
55
68
  method: "POST",
56
- body: JSON.stringify({
57
- jsonrpc: "2.0",
58
- id: 1,
59
- method: t,
60
- params: e
61
- }),
69
+ body: JSON.stringify(u),
62
70
  headers: { "Content-Type": "application/json" }
63
71
  })).json();
64
- if (i.error)
65
- throw new K(i.error.message);
66
- return i;
72
+ if (A.error)
73
+ throw new ee(A.error.message);
74
+ return A;
67
75
  }
68
- async function L(t) {
69
- return (await k("reown_getExchanges", t)).result;
76
+ async function G(t) {
77
+ return (await O("reown_getExchanges", t)).result;
70
78
  }
71
- async function q(t) {
72
- return (await k("reown_getExchangePayUrl", t)).result;
79
+ async function ne(t) {
80
+ return (await O("reown_getExchangePayUrl", t)).result;
73
81
  }
74
- async function X(t) {
75
- return (await k("reown_getExchangeBuyStatus", t)).result;
82
+ async function se(t) {
83
+ return (await O("reown_getExchangeBuyStatus", t)).result;
76
84
  }
77
- const J = ["eip155"], Z = {
85
+ const ae = ["eip155", "solana"], re = {
78
86
  eip155: {
79
87
  native: { assetNamespace: "slip44", assetReference: "60" },
80
88
  defaultTokenNamespace: "erc20"
@@ -84,45 +92,45 @@ const J = ["eip155"], Z = {
84
92
  defaultTokenNamespace: "token"
85
93
  }
86
94
  };
87
- function b(t, e) {
88
- const { chainNamespace: s, chainId: a } = _.parseCaipNetworkId(t), r = Z[s];
95
+ function R(t, e) {
96
+ const { chainNamespace: s, chainId: a } = b.parseCaipNetworkId(t), r = re[s];
89
97
  if (!r)
90
98
  throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${s}`);
91
99
  let i = r.native.assetNamespace, u = r.native.assetReference;
92
100
  return e !== "native" && (i = r.defaultTokenNamespace, u = e), `${`${s}:${a}`}/${i}:${u}`;
93
101
  }
94
- function Q(t) {
95
- const { chainNamespace: e } = _.parseCaipNetworkId(t);
96
- return J.includes(e);
102
+ function ie(t) {
103
+ const { chainNamespace: e } = b.parseCaipNetworkId(t);
104
+ return ae.includes(e);
97
105
  }
98
- async function ee(t) {
99
- const { paymentAssetNetwork: e, activeCaipNetwork: s, approvedCaipNetworkIds: a, requestedCaipNetworks: r } = t, u = R.sortRequestedNetworks(a, r).find((T) => T.caipNetworkId === e);
106
+ async function oe(t) {
107
+ const { paymentAssetNetwork: e, activeCaipNetwork: s, approvedCaipNetworkIds: a, requestedCaipNetworks: r } = t, u = C.sortRequestedNetworks(a, r).find((P) => P.caipNetworkId === e);
100
108
  if (!u)
101
109
  throw new c(o.INVALID_PAYMENT_CONFIG);
102
110
  if (u.caipNetworkId === s.caipNetworkId)
103
111
  return;
104
- const p = h.getNetworkProp("supportsAllNetworks", u.chainNamespace);
105
- if (!((a == null ? void 0 : a.includes(u.caipNetworkId)) || p))
112
+ const d = p.getNetworkProp("supportsAllNetworks", u.chainNamespace);
113
+ if (!((a == null ? void 0 : a.includes(u.caipNetworkId)) || d))
106
114
  throw new c(o.INVALID_PAYMENT_CONFIG);
107
115
  try {
108
- await h.switchActiveNetwork(u);
109
- } catch (T) {
110
- throw new c(o.GENERIC_PAYMENT_ERROR, T);
116
+ await p.switchActiveNetwork(u);
117
+ } catch (P) {
118
+ throw new c(o.GENERIC_PAYMENT_ERROR, P);
111
119
  }
112
120
  }
113
- async function te(t, e, s) {
114
- var p;
115
- if (e !== U.CHAIN.EVM)
121
+ async function ce(t, e, s) {
122
+ var d;
123
+ if (e !== g.CHAIN.EVM)
116
124
  throw new c(o.INVALID_CHAIN_NAMESPACE);
117
125
  if (!s.fromAddress)
118
126
  throw new c(o.INVALID_PAYMENT_CONFIG, "fromAddress is required for native EVM payments.");
119
127
  const a = typeof s.amount == "string" ? parseFloat(s.amount) : s.amount;
120
128
  if (isNaN(a))
121
129
  throw new c(o.INVALID_PAYMENT_CONFIG);
122
- const r = ((p = t.metadata) == null ? void 0 : p.decimals) ?? 18, i = f.parseUnits(a.toString(), r);
130
+ const r = ((d = t.metadata) == null ? void 0 : d.decimals) ?? 18, i = w.parseUnits(a.toString(), r);
123
131
  if (typeof i != "bigint")
124
132
  throw new c(o.GENERIC_PAYMENT_ERROR);
125
- return await f.sendTransaction({
133
+ return await w.sendTransaction({
126
134
  chainNamespace: e,
127
135
  to: s.recipient,
128
136
  address: s.fromAddress,
@@ -130,22 +138,46 @@ async function te(t, e, s) {
130
138
  data: "0x"
131
139
  }) ?? void 0;
132
140
  }
133
- async function ne(t, e) {
141
+ async function ue(t, e) {
134
142
  if (!e.fromAddress)
135
143
  throw new c(o.INVALID_PAYMENT_CONFIG, "fromAddress is required for ERC20 EVM payments.");
136
- const s = t.asset, a = e.recipient, r = Number(t.metadata.decimals), i = f.parseUnits(e.amount.toString(), r);
144
+ const s = t.asset, a = e.recipient, r = Number(t.metadata.decimals), i = w.parseUnits(e.amount.toString(), r);
137
145
  if (i === void 0)
138
146
  throw new c(o.GENERIC_PAYMENT_ERROR);
139
- return await f.writeContract({
147
+ return await w.writeContract({
140
148
  fromAddress: e.fromAddress,
141
149
  tokenAddress: s,
142
150
  args: [a, i],
143
151
  method: "transfer",
144
- abi: $.getERC20Abi(s),
145
- chainNamespace: U.CHAIN.EVM
152
+ abi: j.getERC20Abi(s),
153
+ chainNamespace: g.CHAIN.EVM
146
154
  }) ?? void 0;
147
155
  }
148
- const D = 0, v = "unknown", n = W({
156
+ async function le(t, e) {
157
+ if (t !== g.CHAIN.SOLANA)
158
+ throw new c(o.INVALID_CHAIN_NAMESPACE);
159
+ if (!e.fromAddress)
160
+ throw new c(o.INVALID_PAYMENT_CONFIG, "fromAddress is required for Solana payments.");
161
+ const s = typeof e.amount == "string" ? parseFloat(e.amount) : e.amount;
162
+ if (isNaN(s) || s <= 0)
163
+ throw new c(o.INVALID_PAYMENT_CONFIG, "Invalid payment amount.");
164
+ try {
165
+ if (!B.getProvider(t))
166
+ throw new c(o.GENERIC_PAYMENT_ERROR, "No Solana provider available.");
167
+ const r = await w.sendTransaction({
168
+ chainNamespace: g.CHAIN.SOLANA,
169
+ to: e.recipient,
170
+ value: s,
171
+ tokenMint: e.tokenMint
172
+ });
173
+ if (!r)
174
+ throw new c(o.GENERIC_PAYMENT_ERROR, "Transaction failed.");
175
+ return r;
176
+ } catch (a) {
177
+ throw a instanceof c ? a : new c(o.GENERIC_PAYMENT_ERROR, `Solana payment failed: ${a}`);
178
+ }
179
+ }
180
+ const V = 0, v = "unknown", n = q({
149
181
  paymentAsset: {
150
182
  network: "eip155:1",
151
183
  asset: "0x0",
@@ -171,13 +203,13 @@ const D = 0, v = "unknown", n = W({
171
203
  }), l = {
172
204
  state: n,
173
205
  subscribe(t) {
174
- return H(n, () => t(n));
206
+ return X(n, () => t(n));
175
207
  },
176
208
  subscribeKey(t, e) {
177
- return B(n, t, e);
209
+ return z(n, t, e);
178
210
  },
179
211
  async handleOpenPay(t) {
180
- this.resetState(), this.setPaymentConfig(t), this.subscribeEvents(), this.initializeAnalytics(), n.isConfigured = !0, A.sendEvent({
212
+ this.resetState(), this.setPaymentConfig(t), this.subscribeEvents(), this.initializeAnalytics(), n.isConfigured = !0, _.sendEvent({
181
213
  type: "track",
182
214
  event: "PAY_MODAL_OPEN",
183
215
  properties: {
@@ -189,7 +221,7 @@ const D = 0, v = "unknown", n = W({
189
221
  amount: n.amount
190
222
  }
191
223
  }
192
- }), await P.open({
224
+ }), await x.open({
193
225
  view: "Pay"
194
226
  });
195
227
  },
@@ -218,14 +250,14 @@ const D = 0, v = "unknown", n = W({
218
250
  async fetchExchanges() {
219
251
  try {
220
252
  n.isLoading = !0;
221
- const t = await L({
222
- page: D,
223
- asset: b(n.paymentAsset.network, n.paymentAsset.asset),
253
+ const t = await G({
254
+ page: V,
255
+ asset: R(n.paymentAsset.network, n.paymentAsset.asset),
224
256
  amount: n.amount.toString()
225
257
  });
226
258
  n.exchanges = t.exchanges.slice(0, 2);
227
259
  } catch {
228
- throw I.showError(g.UNABLE_TO_GET_EXCHANGES), new c(o.UNABLE_TO_GET_EXCHANGES);
260
+ throw T.showError(N.UNABLE_TO_GET_EXCHANGES), new c(o.UNABLE_TO_GET_EXCHANGES);
229
261
  } finally {
230
262
  n.isLoading = !1;
231
263
  }
@@ -233,9 +265,9 @@ const D = 0, v = "unknown", n = W({
233
265
  async getAvailableExchanges(t) {
234
266
  var e;
235
267
  try {
236
- const s = t != null && t.asset && (t != null && t.network) ? b(t.network, t.asset) : void 0;
237
- return await L({
238
- page: (t == null ? void 0 : t.page) ?? D,
268
+ const s = t != null && t.asset && (t != null && t.network) ? R(t.network, t.asset) : void 0;
269
+ return await G({
270
+ page: (t == null ? void 0 : t.page) ?? V,
239
271
  asset: s,
240
272
  amount: (e = t == null ? void 0 : t.amount) == null ? void 0 : e.toString()
241
273
  });
@@ -245,16 +277,17 @@ const D = 0, v = "unknown", n = W({
245
277
  },
246
278
  async getPayUrl(t, e, s = !1) {
247
279
  try {
248
- const a = Number(e.amount), r = await q({
280
+ const a = Number(e.amount), r = await ne({
249
281
  exchangeId: t,
250
- asset: b(e.network, e.asset),
282
+ asset: R(e.network, e.asset),
251
283
  amount: a.toString(),
252
284
  recipient: `${e.network}:${e.recipient}`
253
285
  });
254
- return A.sendEvent({
286
+ return _.sendEvent({
255
287
  type: "track",
256
288
  event: "PAY_EXCHANGE_SELECTED",
257
289
  properties: {
290
+ source: "pay",
258
291
  exchange: {
259
292
  id: t
260
293
  },
@@ -270,10 +303,11 @@ const D = 0, v = "unknown", n = W({
270
303
  },
271
304
  headless: s
272
305
  }
273
- }), s && (this.initiatePayment(), A.sendEvent({
306
+ }), s && (this.initiatePayment(), _.sendEvent({
274
307
  type: "track",
275
308
  event: "PAY_INITIATED",
276
309
  properties: {
310
+ source: "pay",
277
311
  paymentId: n.paymentId || v,
278
312
  configuration: {
279
313
  network: e.network,
@@ -297,17 +331,19 @@ const D = 0, v = "unknown", n = W({
297
331
  if (!a)
298
332
  throw new c(o.UNABLE_TO_GET_PAY_URL);
299
333
  const i = t.openInNewTab ?? !0 ? "_blank" : "_self";
300
- return R.openHref(a.url, i), a;
334
+ return C.openHref(a.url, i), a;
301
335
  } catch (a) {
302
- throw a instanceof c ? n.error = a.message : n.error = g.GENERIC_PAYMENT_ERROR, new c(o.UNABLE_TO_GET_PAY_URL);
336
+ throw a instanceof c ? n.error = a.message : n.error = N.GENERIC_PAYMENT_ERROR, new c(o.UNABLE_TO_GET_PAY_URL);
303
337
  }
304
338
  },
305
339
  subscribeEvents() {
306
- n.isConfigured || (S.subscribeProviders(async (t) => {
307
- const e = h.state.activeChain;
308
- S.getProvider(e) && await this.handlePayment();
309
- }), E.subscribeKey("caipAddress", async (t) => {
310
- t && await this.handlePayment();
340
+ n.isConfigured || (w.subscribeKey("connections", (t) => {
341
+ t.size > 0 && this.handlePayment();
342
+ }), p.subscribeChainProp("accountState", (t) => {
343
+ const e = w.hasAnyConnection(g.CONNECTOR_ID.WALLET_CONNECT);
344
+ t != null && t.caipAddress && (e ? setTimeout(() => {
345
+ this.handlePayment();
346
+ }, 100) : this.handlePayment());
311
347
  }));
312
348
  },
313
349
  async handlePayment() {
@@ -315,41 +351,49 @@ const D = 0, v = "unknown", n = W({
315
351
  type: "wallet",
316
352
  status: "IN_PROGRESS"
317
353
  };
318
- const t = E.state.caipAddress;
354
+ const t = p.getActiveCaipAddress();
319
355
  if (!t)
320
356
  return;
321
- const { chainId: e, address: s } = _.parseCaipAddress(t), a = h.state.activeChain;
322
- if (!s || !e || !a || !S.getProvider(a))
357
+ const { chainId: e, address: s } = b.parseCaipAddress(t), a = p.state.activeChain;
358
+ if (!s || !e || !a || !B.getProvider(a))
323
359
  return;
324
- const i = h.state.activeCaipNetwork;
360
+ const i = p.state.activeCaipNetwork;
325
361
  if (i && !n.isPaymentInProgress)
326
362
  try {
327
363
  this.initiatePayment();
328
- const u = h.getAllRequestedCaipNetworks(), p = h.getAllApprovedCaipNetworkIds();
329
- switch (await ee({
364
+ const u = p.getAllRequestedCaipNetworks(), d = p.getAllApprovedCaipNetworkIds();
365
+ switch (await oe({
330
366
  paymentAssetNetwork: n.paymentAsset.network,
331
367
  activeCaipNetwork: i,
332
- approvedCaipNetworkIds: p,
368
+ approvedCaipNetworkIds: d,
333
369
  requestedCaipNetworks: u
334
- }), await P.open({
370
+ }), await x.open({
335
371
  view: "PayLoading"
336
372
  }), a) {
337
- case U.CHAIN.EVM:
338
- n.paymentAsset.asset === "native" && (n.currentPayment.result = await te(n.paymentAsset, a, {
373
+ case g.CHAIN.EVM:
374
+ n.paymentAsset.asset === "native" && (n.currentPayment.result = await ce(n.paymentAsset, a, {
339
375
  recipient: n.recipient,
340
376
  amount: n.amount,
341
377
  fromAddress: s
342
- })), n.paymentAsset.asset.startsWith("0x") && (n.currentPayment.result = await ne(n.paymentAsset, {
378
+ })), n.paymentAsset.asset.startsWith("0x") && (n.currentPayment.result = await ue(n.paymentAsset, {
343
379
  recipient: n.recipient,
344
380
  amount: n.amount,
345
381
  fromAddress: s
346
382
  })), n.currentPayment.status = "SUCCESS";
347
383
  break;
384
+ case g.CHAIN.SOLANA:
385
+ n.currentPayment.result = await le(a, {
386
+ recipient: n.recipient,
387
+ amount: n.amount,
388
+ fromAddress: s,
389
+ tokenMint: n.paymentAsset.asset === "native" ? void 0 : n.paymentAsset.asset
390
+ }), n.currentPayment.status = "SUCCESS";
391
+ break;
348
392
  default:
349
393
  throw new c(o.INVALID_CHAIN_NAMESPACE);
350
394
  }
351
395
  } catch (u) {
352
- u instanceof c ? n.error = u.message : n.error = g.GENERIC_PAYMENT_ERROR, n.currentPayment.status = "FAILED", I.showError(n.error);
396
+ u instanceof c ? n.error = u.message : n.error = N.GENERIC_PAYMENT_ERROR, n.currentPayment.status = "FAILED", T.showError(n.error);
353
397
  } finally {
354
398
  n.isPaymentInProgress = !1;
355
399
  }
@@ -369,14 +413,14 @@ const D = 0, v = "unknown", n = W({
369
413
  throw new c(o.INVALID_AMOUNT);
370
414
  },
371
415
  handlePayWithWallet() {
372
- const t = E.state.caipAddress;
416
+ const t = p.getActiveCaipAddress();
373
417
  if (!t) {
374
- O.push("Connect");
418
+ L.push("Connect");
375
419
  return;
376
420
  }
377
- const { chainId: e, address: s } = _.parseCaipAddress(t), a = h.state.activeChain;
421
+ const { chainId: e, address: s } = b.parseCaipAddress(t), a = p.state.activeChain;
378
422
  if (!s || !e || !a) {
379
- O.push("Connect");
423
+ L.push("Connect");
380
424
  return;
381
425
  }
382
426
  this.handlePayment();
@@ -400,17 +444,19 @@ const D = 0, v = "unknown", n = W({
400
444
  openInNewTab: n.openInNewTab
401
445
  };
402
446
  } catch (e) {
403
- return e instanceof c ? n.error = e.message : n.error = g.GENERIC_PAYMENT_ERROR, n.isPaymentInProgress = !1, I.showError(n.error), null;
447
+ return e instanceof c ? n.error = e.message : n.error = N.GENERIC_PAYMENT_ERROR, n.isPaymentInProgress = !1, T.showError(n.error), null;
404
448
  }
405
449
  },
406
450
  async getBuyStatus(t, e) {
407
451
  var s, a;
408
452
  try {
409
- const r = await X({ sessionId: e, exchangeId: t });
410
- return (r.status === "SUCCESS" || r.status === "FAILED") && A.sendEvent({
453
+ const r = await se({ sessionId: e, exchangeId: t });
454
+ return (r.status === "SUCCESS" || r.status === "FAILED") && _.sendEvent({
411
455
  type: "track",
412
456
  event: r.status === "SUCCESS" ? "PAY_SUCCESS" : "PAY_ERROR",
413
457
  properties: {
458
+ message: r.status === "FAILED" ? C.parseError(n.error) : void 0,
459
+ source: "pay",
414
460
  paymentId: n.paymentId || v,
415
461
  configuration: {
416
462
  network: n.paymentAsset.network,
@@ -450,10 +496,12 @@ const D = 0, v = "unknown", n = W({
450
496
  SUCCESS: "PAY_SUCCESS",
451
497
  FAILED: "PAY_ERROR"
452
498
  }[n.currentPayment.status];
453
- A.sendEvent({
499
+ _.sendEvent({
454
500
  type: "track",
455
501
  event: s,
456
502
  properties: {
503
+ message: n.currentPayment.status === "FAILED" ? C.parseError(n.error) : void 0,
504
+ source: "pay",
457
505
  paymentId: n.paymentId || v,
458
506
  configuration: {
459
507
  network: n.paymentAsset.network,
@@ -472,19 +520,19 @@ const D = 0, v = "unknown", n = W({
472
520
  }
473
521
  }));
474
522
  }
475
- }, se = M`
523
+ }, de = F`
476
524
  wui-separator {
477
- margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
478
- calc(var(--wui-spacing-m) * -1);
479
- width: calc(100% + var(--wui-spacing-s) * 2);
525
+ margin: var(--apkt-spacing-3) calc(var(--apkt-spacing-3) * -1) var(--apkt-spacing-2)
526
+ calc(var(--apkt-spacing-3) * -1);
527
+ width: calc(100% + var(--apkt-spacing-3) * 2);
480
528
  }
481
529
 
482
530
  .token-display {
483
- padding: var(--wui-spacing-s) var(--wui-spacing-m);
484
- border-radius: var(--wui-border-radius-s);
485
- background-color: var(--wui-color-bg-125);
486
- margin-top: var(--wui-spacing-s);
487
- margin-bottom: var(--wui-spacing-s);
531
+ padding: var(--apkt-spacing-3) var(--apkt-spacing-3);
532
+ border-radius: var(--apkt-borderRadius-5);
533
+ background-color: var(--apkt-tokens-theme-backgroundPrimary);
534
+ margin-top: var(--apkt-spacing-3);
535
+ margin-bottom: var(--apkt-spacing-3);
488
536
  }
489
537
 
490
538
  .token-display wui-text {
@@ -492,29 +540,33 @@ const D = 0, v = "unknown", n = W({
492
540
  }
493
541
 
494
542
  wui-loading-spinner {
495
- padding: var(--wui-spacing-xs);
543
+ padding: var(--apkt-spacing-2);
496
544
  }
497
545
  `;
498
- var y = function(t, e, s, a) {
546
+ var E = function(t, e, s, a) {
499
547
  var r = arguments.length, i = r < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, s) : a, u;
500
548
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, a);
501
- else for (var p = t.length - 1; p >= 0; p--) (u = t[p]) && (i = (r < 3 ? u(i) : r > 3 ? u(e, s, i) : u(e, s)) || i);
549
+ else for (var d = t.length - 1; d >= 0; d--) (u = t[d]) && (i = (r < 3 ? u(i) : r > 3 ? u(e, s, i) : u(e, s)) || i);
502
550
  return r > 3 && i && Object.defineProperty(e, s, i), i;
503
551
  };
504
- let m = class extends G {
552
+ let y = class extends W {
505
553
  constructor() {
506
- super(), this.unsubscribe = [], this.amount = "", this.tokenSymbol = "", this.networkName = "", this.exchanges = l.state.exchanges, this.isLoading = l.state.isLoading, this.loadingExchangeId = null, this.connectedWalletInfo = E.state.connectedWalletInfo, this.initializePaymentDetails(), this.unsubscribe.push(l.subscribeKey("exchanges", (e) => this.exchanges = e)), this.unsubscribe.push(l.subscribeKey("isLoading", (e) => this.isLoading = e)), this.unsubscribe.push(E.subscribe((e) => this.connectedWalletInfo = e.connectedWalletInfo)), l.fetchExchanges();
554
+ var e;
555
+ super(), this.unsubscribe = [], this.amount = "", this.tokenSymbol = "", this.networkName = "", this.exchanges = l.state.exchanges, this.isLoading = l.state.isLoading, this.loadingExchangeId = null, this.connectedWalletInfo = (e = p.getAccountData()) == null ? void 0 : e.connectedWalletInfo, this.initializePaymentDetails(), this.unsubscribe.push(l.subscribeKey("exchanges", (s) => this.exchanges = s)), this.unsubscribe.push(l.subscribeKey("isLoading", (s) => this.isLoading = s)), this.unsubscribe.push(p.subscribeChainProp("accountState", (s) => {
556
+ this.connectedWalletInfo = s == null ? void 0 : s.connectedWalletInfo;
557
+ })), l.fetchExchanges();
507
558
  }
508
559
  get isWalletConnected() {
509
- return E.state.status === "connected";
560
+ const e = p.getAccountData();
561
+ return (e == null ? void 0 : e.status) === "connected";
510
562
  }
511
563
  render() {
512
- return d`
564
+ return m`
513
565
  <wui-flex flexDirection="column">
514
- <wui-flex flexDirection="column" .padding=${["0", "l", "l", "l"]} gap="s">
566
+ <wui-flex flexDirection="column" .padding=${["0", "4", "4", "4"]} gap="3">
515
567
  ${this.renderPaymentHeader()}
516
568
 
517
- <wui-flex flexDirection="column" gap="s">
569
+ <wui-flex flexDirection="column" gap="3">
518
570
  ${this.renderPayWithWallet()} ${this.renderExchangeOptions()}
519
571
  </wui-flex>
520
572
  </wui-flex>
@@ -526,27 +578,29 @@ let m = class extends G {
526
578
  this.networkName = e.network, this.tokenSymbol = e.metadata.symbol, this.amount = l.state.amount.toString();
527
579
  }
528
580
  renderPayWithWallet() {
529
- return Q(this.networkName) ? d`<wui-flex flexDirection="column" gap="s">
581
+ return ie(this.networkName) ? m`<wui-flex flexDirection="column" gap="3">
530
582
  ${this.isWalletConnected ? this.renderConnectedView() : this.renderDisconnectedView()}
531
583
  </wui-flex>
532
- <wui-separator text="or"></wui-separator>` : d``;
584
+ <wui-separator text="or"></wui-separator>` : m``;
533
585
  }
534
586
  renderPaymentHeader() {
535
587
  let e = this.networkName;
536
588
  if (this.networkName) {
537
- const a = h.getAllRequestedCaipNetworks().find((r) => r.caipNetworkId === this.networkName);
589
+ const a = p.getAllRequestedCaipNetworks().find((r) => r.caipNetworkId === this.networkName);
538
590
  a && (e = a.name);
539
591
  }
540
- return d`
592
+ return m`
541
593
  <wui-flex flexDirection="column" alignItems="center">
542
- <wui-flex alignItems="center" gap="xs">
543
- <wui-text variant="large-700" color="fg-100">${this.amount || "0.0000"}</wui-text>
544
- <wui-flex class="token-display" alignItems="center" gap="xxs">
545
- <wui-text variant="paragraph-600" color="fg-100">
594
+ <wui-flex alignItems="center" gap="2">
595
+ <wui-text variant="h1-regular" color="primary">${this.amount || "0.0000"}</wui-text>
596
+ <wui-flex class="token-display" alignItems="center" gap="1">
597
+ <wui-text variant="md-medium" color="primary">
546
598
  ${this.tokenSymbol || "Unknown Asset"}
547
599
  </wui-text>
548
- ${e ? d`
549
- <wui-text variant="small-500" color="fg-200"> on ${e} </wui-text>
600
+ ${e ? m`
601
+ <wui-text variant="sm-medium" color="secondary">
602
+ on ${e}
603
+ </wui-text>
550
604
  ` : ""}
551
605
  </wui-flex>
552
606
  </wui-flex>
@@ -554,68 +608,62 @@ let m = class extends G {
554
608
  `;
555
609
  }
556
610
  renderConnectedView() {
557
- var s, a, r;
611
+ var s, a;
558
612
  const e = ((s = this.connectedWalletInfo) == null ? void 0 : s.name) || "connected wallet";
559
- return d`
613
+ return m`
560
614
  <wui-list-item
561
615
  @click=${this.onWalletPayment}
562
616
  ?chevron=${!0}
617
+ ?fullSize=${!0}
618
+ ?rounded=${!0}
563
619
  data-testid="wallet-payment-option"
620
+ imageSrc=${Y((a = this.connectedWalletInfo) == null ? void 0 : a.icon)}
564
621
  >
565
- <wui-flex alignItems="center" gap="s">
566
- <wui-wallet-image
567
- size="sm"
568
- imageSrc=${C((a = this.connectedWalletInfo) == null ? void 0 : a.icon)}
569
- name=${C((r = this.connectedWalletInfo) == null ? void 0 : r.name)}
570
- ></wui-wallet-image>
571
- <wui-text variant="paragraph-500" color="inherit">Pay with ${e}</wui-text>
572
- </wui-flex>
622
+ <wui-text variant="lg-regular" color="primary">Pay with ${e}</wui-text>
573
623
  </wui-list-item>
574
624
 
575
625
  <wui-list-item
576
- variant="icon"
577
- iconVariant="overlay"
578
- icon="disconnect"
626
+ icon="power"
627
+ ?rounded=${!0}
628
+ iconColor="error"
579
629
  @click=${this.onDisconnect}
580
630
  data-testid="disconnect-button"
581
631
  ?chevron=${!1}
582
632
  >
583
- <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
633
+ <wui-text variant="lg-regular" color="secondary">Disconnect</wui-text>
584
634
  </wui-list-item>
585
635
  `;
586
636
  }
587
637
  renderDisconnectedView() {
588
- return d`<wui-list-item
638
+ return m`<wui-list-item
589
639
  variant="icon"
590
640
  iconVariant="overlay"
591
- icon="walletPlaceholder"
641
+ icon="wallet"
642
+ ?rounded=${!0}
592
643
  @click=${this.onWalletPayment}
593
644
  ?chevron=${!0}
594
645
  data-testid="wallet-payment-option"
595
646
  >
596
- <wui-text variant="paragraph-500" color="inherit">Pay from wallet</wui-text>
647
+ <wui-text variant="lg-regular" color="primary">Pay from wallet</wui-text>
597
648
  </wui-list-item>`;
598
649
  }
599
650
  renderExchangeOptions() {
600
- return this.isLoading ? d`<wui-flex justifyContent="center" alignItems="center">
651
+ return this.isLoading ? m`<wui-flex justifyContent="center" alignItems="center">
601
652
  <wui-spinner size="md"></wui-spinner>
602
- </wui-flex>` : this.exchanges.length === 0 ? d`<wui-flex justifyContent="center" alignItems="center">
603
- <wui-text variant="paragraph-500" color="fg-100">No exchanges available</wui-text>
604
- </wui-flex>` : this.exchanges.map((e) => d`
653
+ </wui-flex>` : this.exchanges.length === 0 ? m`<wui-flex justifyContent="center" alignItems="center">
654
+ <wui-text variant="md-medium" color="primary">No exchanges available</wui-text>
655
+ </wui-flex>` : this.exchanges.map((e) => m`
605
656
  <wui-list-item
606
657
  @click=${() => this.onExchangePayment(e.id)}
607
658
  data-testid="exchange-option-${e.id}"
608
659
  ?chevron=${!0}
609
660
  ?disabled=${this.loadingExchangeId !== null}
661
+ ?loading=${this.loadingExchangeId === e.id}
662
+ imageSrc=${Y(e.imageUrl)}
610
663
  >
611
- <wui-flex alignItems="center" gap="s">
612
- ${this.loadingExchangeId === e.id ? d`<wui-loading-spinner color="accent-100" size="md"></wui-loading-spinner>` : d`<wui-wallet-image
613
- size="sm"
614
- imageSrc=${C(e.imageUrl)}
615
- name=${e.name}
616
- ></wui-wallet-image>`}
617
- <wui-text flexGrow="1" variant="paragraph-500" color="inherit"
618
- >Pay with ${e.name} <wui-spinner size="sm" color="fg-200"></wui-spinner
664
+ <wui-flex alignItems="center" gap="3">
665
+ <wui-text flexGrow="1" variant="md-medium" color="primary"
666
+ >Pay with ${e.name} <wui-spinner size="sm" color="secondary"></wui-spinner
619
667
  ></wui-text>
620
668
  </wui-flex>
621
669
  </wui-list-item>
@@ -628,11 +676,11 @@ let m = class extends G {
628
676
  try {
629
677
  this.loadingExchangeId = e;
630
678
  const s = await l.handlePayWithExchange(e);
631
- s && (await P.open({
679
+ s && (await x.open({
632
680
  view: "PayLoading"
633
- }), R.openHref(s.url, s.openInNewTab ? "_blank" : "_self"));
681
+ }), C.openHref(s.url, s.openInNewTab ? "_blank" : "_self"));
634
682
  } catch (s) {
635
- console.error("Failed to pay with exchange", s), I.showError("Failed to pay with exchange");
683
+ console.error("Failed to pay with exchange", s), T.showError("Failed to pay with exchange");
636
684
  } finally {
637
685
  this.loadingExchangeId = null;
638
686
  }
@@ -640,55 +688,63 @@ let m = class extends G {
640
688
  async onDisconnect(e) {
641
689
  e.stopPropagation();
642
690
  try {
643
- await f.disconnect(), P.close();
691
+ await w.disconnect();
644
692
  } catch {
645
- console.error("Failed to disconnect"), I.showError("Failed to disconnect");
693
+ console.error("Failed to disconnect"), T.showError("Failed to disconnect");
646
694
  }
647
695
  }
648
696
  disconnectedCallback() {
649
697
  this.unsubscribe.forEach((e) => e());
650
698
  }
651
699
  };
652
- m.styles = se;
653
- y([
654
- w()
655
- ], m.prototype, "amount", void 0);
656
- y([
657
- w()
658
- ], m.prototype, "tokenSymbol", void 0);
659
- y([
660
- w()
661
- ], m.prototype, "networkName", void 0);
662
- y([
663
- w()
664
- ], m.prototype, "exchanges", void 0);
665
- y([
666
- w()
667
- ], m.prototype, "isLoading", void 0);
668
- y([
669
- w()
670
- ], m.prototype, "loadingExchangeId", void 0);
671
- y([
672
- w()
673
- ], m.prototype, "connectedWalletInfo", void 0);
674
- m = y([
675
- V("w3m-pay-view")
676
- ], m);
677
- const ae = M`
700
+ y.styles = de;
701
+ E([
702
+ h()
703
+ ], y.prototype, "amount", void 0);
704
+ E([
705
+ h()
706
+ ], y.prototype, "tokenSymbol", void 0);
707
+ E([
708
+ h()
709
+ ], y.prototype, "networkName", void 0);
710
+ E([
711
+ h()
712
+ ], y.prototype, "exchanges", void 0);
713
+ E([
714
+ h()
715
+ ], y.prototype, "isLoading", void 0);
716
+ E([
717
+ h()
718
+ ], y.prototype, "loadingExchangeId", void 0);
719
+ E([
720
+ h()
721
+ ], y.prototype, "connectedWalletInfo", void 0);
722
+ y = E([
723
+ H("w3m-pay-view")
724
+ ], y);
725
+ const pe = F`
678
726
  :host {
679
727
  display: block;
680
728
  height: 100%;
681
729
  width: 100%;
682
730
  }
731
+
732
+ wui-flex:first-child:not(:only-child) {
733
+ position: relative;
734
+ }
735
+
736
+ wui-loading-thumbnail {
737
+ position: absolute;
738
+ }
683
739
  `;
684
- var x = function(t, e, s, a) {
740
+ var U = function(t, e, s, a) {
685
741
  var r = arguments.length, i = r < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, s) : a, u;
686
742
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, a);
687
- else for (var p = t.length - 1; p >= 0; p--) (u = t[p]) && (i = (r < 3 ? u(i) : r > 3 ? u(e, s, i) : u(e, s)) || i);
743
+ else for (var d = t.length - 1; d >= 0; d--) (u = t[d]) && (i = (r < 3 ? u(i) : r > 3 ? u(e, s, i) : u(e, s)) || i);
688
744
  return r > 3 && i && Object.defineProperty(e, s, i), i;
689
745
  };
690
- const re = 4e3;
691
- let N = class extends G {
746
+ const me = 4e3;
747
+ let I = class extends W {
692
748
  constructor() {
693
749
  super(), this.loadingMessage = "", this.subMessage = "", this.paymentState = "in-progress", this.paymentState = l.state.isPaymentInProgress ? "in-progress" : "completed", this.updateMessages(), this.setupSubscription(), this.setupExchangeSubscription();
694
750
  }
@@ -696,19 +752,19 @@ let N = class extends G {
696
752
  clearInterval(this.exchangeSubscription);
697
753
  }
698
754
  render() {
699
- return d`
755
+ return m`
700
756
  <wui-flex
701
757
  flexDirection="column"
702
758
  alignItems="center"
703
- .padding=${["xl", "xl", "xl", "xl"]}
704
- gap="xl"
759
+ .padding=${["7", "5", "5", "5"]}
760
+ gap="9"
705
761
  >
706
762
  <wui-flex justifyContent="center" alignItems="center"> ${this.getStateIcon()} </wui-flex>
707
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
708
- <wui-text align="center" variant="paragraph-500" color="fg-100">
763
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
764
+ <wui-text align="center" variant="lg-medium" color="primary">
709
765
  ${this.loadingMessage}
710
766
  </wui-text>
711
- <wui-text align="center" variant="small-400" color="fg-200">
767
+ <wui-text align="center" variant="lg-regular" color="secondary">
712
768
  ${this.subMessage}
713
769
  </wui-text>
714
770
  </wui-flex>
@@ -747,59 +803,148 @@ let N = class extends G {
747
803
  var r, i, u;
748
804
  const s = (r = l.state.currentPayment) == null ? void 0 : r.exchangeId, a = (i = l.state.currentPayment) == null ? void 0 : i.sessionId;
749
805
  s && a && (await l.updateBuyStatus(s, a), ((u = l.state.currentPayment) == null ? void 0 : u.status) === "SUCCESS" && clearInterval(this.exchangeSubscription));
750
- }, re));
806
+ }, me));
751
807
  }
752
808
  setupSubscription() {
753
809
  l.subscribeKey("isPaymentInProgress", (e) => {
754
810
  var s;
755
811
  !e && this.paymentState === "in-progress" && (l.state.error || !((s = l.state.currentPayment) != null && s.result) ? this.paymentState = "error" : this.paymentState = "completed", this.updateMessages(), setTimeout(() => {
756
- f.state.status !== "disconnected" && P.close();
812
+ w.state.status !== "disconnected" && x.close();
757
813
  }, 3e3));
758
814
  }), l.subscribeKey("error", (e) => {
759
815
  e && this.paymentState === "in-progress" && (this.paymentState = "error", this.updateMessages());
760
816
  });
761
817
  }
762
818
  loaderTemplate() {
763
- const e = F.state.themeVariables["--w3m-border-radius-master"], s = e ? parseInt(e.replace("px", ""), 10) : 4;
764
- return d`<wui-loading-thumbnail radius=${s * 9}></wui-loading-thumbnail>`;
819
+ const e = J.state.themeVariables["--w3m-border-radius-master"], s = e ? parseInt(e.replace("px", ""), 10) : 4, a = this.getPaymentIcon();
820
+ return m`
821
+ <wui-flex justifyContent="center" alignItems="center" style="position: relative;">
822
+ ${a ? m`<wui-wallet-image size="lg" imageSrc=${a}></wui-wallet-image>` : null}
823
+ <wui-loading-thumbnail radius=${s * 9}></wui-loading-thumbnail>
824
+ </wui-flex>
825
+ `;
826
+ }
827
+ getPaymentIcon() {
828
+ var s, a;
829
+ const e = l.state.currentPayment;
830
+ if (e) {
831
+ if (e.type === "exchange") {
832
+ const r = e.exchangeId;
833
+ if (r) {
834
+ const i = l.getExchangeById(r);
835
+ return i == null ? void 0 : i.imageUrl;
836
+ }
837
+ }
838
+ if (e.type === "wallet") {
839
+ const r = (a = (s = p.getAccountData()) == null ? void 0 : s.connectedWalletInfo) == null ? void 0 : a.icon;
840
+ if (r)
841
+ return r;
842
+ const i = p.state.activeChain;
843
+ if (!i)
844
+ return;
845
+ const u = M.getConnectorId(i);
846
+ if (!u)
847
+ return;
848
+ const d = M.getConnectorById(u);
849
+ return d ? Z.getConnectorImage(d) : void 0;
850
+ }
851
+ }
765
852
  }
766
853
  successTemplate() {
767
- return d`<wui-icon size="xl" color="success-100" name="checkmark"></wui-icon>`;
854
+ return m`<wui-icon size="xl" color="success" name="checkmark"></wui-icon>`;
768
855
  }
769
856
  errorTemplate() {
770
- return d`<wui-icon size="xl" color="error-100" name="close"></wui-icon>`;
857
+ return m`<wui-icon size="xl" color="error" name="close"></wui-icon>`;
771
858
  }
772
859
  };
773
- N.styles = ae;
774
- x([
775
- w()
776
- ], N.prototype, "loadingMessage", void 0);
777
- x([
778
- w()
779
- ], N.prototype, "subMessage", void 0);
780
- x([
781
- w()
782
- ], N.prototype, "paymentState", void 0);
783
- N = x([
784
- V("w3m-pay-loading-view")
785
- ], N);
786
- async function fe(t) {
860
+ I.styles = pe;
861
+ U([
862
+ h()
863
+ ], I.prototype, "loadingMessage", void 0);
864
+ U([
865
+ h()
866
+ ], I.prototype, "subMessage", void 0);
867
+ U([
868
+ h()
869
+ ], I.prototype, "paymentState", void 0);
870
+ I = U([
871
+ H("w3m-pay-loading-view")
872
+ ], I);
873
+ const ye = 3e5;
874
+ async function he(t) {
787
875
  return l.handleOpenPay(t);
788
876
  }
789
- function Ne() {
877
+ async function Re(t, e = ye) {
878
+ if (e <= 0)
879
+ throw new c(o.INVALID_PAYMENT_CONFIG, "Timeout must be greater than 0");
880
+ try {
881
+ await he(t);
882
+ } catch (s) {
883
+ throw s instanceof c ? s : new c(o.UNABLE_TO_INITIATE_PAYMENT, s.message);
884
+ }
885
+ return new Promise((s, a) => {
886
+ let r = !1;
887
+ const i = setTimeout(() => {
888
+ r || (r = !0, S(), a(new c(o.GENERIC_PAYMENT_ERROR, "Payment timeout")));
889
+ }, e);
890
+ function u() {
891
+ if (r)
892
+ return;
893
+ const f = l.state.currentPayment, k = l.state.error, K = l.state.isPaymentInProgress;
894
+ if ((f == null ? void 0 : f.status) === "SUCCESS") {
895
+ r = !0, S(), clearTimeout(i), s({
896
+ success: !0,
897
+ result: f.result
898
+ });
899
+ return;
900
+ }
901
+ if ((f == null ? void 0 : f.status) === "FAILED") {
902
+ r = !0, S(), clearTimeout(i), s({
903
+ success: !1,
904
+ error: k || "Payment failed"
905
+ });
906
+ return;
907
+ }
908
+ k && !K && !f && (r = !0, S(), clearTimeout(i), s({
909
+ success: !1,
910
+ error: k
911
+ }));
912
+ }
913
+ const d = D("currentPayment", u), A = D("error", u), P = D("isPaymentInProgress", u), S = we([
914
+ d,
915
+ A,
916
+ P
917
+ ]);
918
+ u();
919
+ });
920
+ }
921
+ function ve() {
790
922
  return l.getExchanges();
791
923
  }
792
- function Ae() {
924
+ function De() {
793
925
  var t;
794
926
  return (t = l.state.currentPayment) == null ? void 0 : t.result;
795
927
  }
796
- function Ie() {
928
+ function Oe() {
797
929
  return l.state.error;
798
930
  }
799
- function Pe() {
931
+ function Le() {
800
932
  return l.state.isPaymentInProgress;
801
933
  }
802
- const _e = {
934
+ function D(t, e) {
935
+ return l.subscribeKey(t, e);
936
+ }
937
+ function we(t) {
938
+ return () => {
939
+ t.forEach((e) => {
940
+ try {
941
+ e();
942
+ } catch {
943
+ }
944
+ });
945
+ };
946
+ }
947
+ const Me = {
803
948
  network: "eip155:8453",
804
949
  asset: "native",
805
950
  metadata: {
@@ -807,7 +952,7 @@ const _e = {
807
952
  symbol: "ETH",
808
953
  decimals: 18
809
954
  }
810
- }, xe = {
955
+ }, Ye = {
811
956
  network: "eip155:8453",
812
957
  asset: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
813
958
  metadata: {
@@ -815,7 +960,7 @@ const _e = {
815
960
  symbol: "USDC",
816
961
  decimals: 6
817
962
  }
818
- }, Te = {
963
+ }, Ge = {
819
964
  network: "eip155:84532",
820
965
  asset: "native",
821
966
  metadata: {
@@ -823,16 +968,116 @@ const _e = {
823
968
  symbol: "ETH",
824
969
  decimals: 18
825
970
  }
971
+ }, Ve = {
972
+ network: "eip155:1",
973
+ asset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
974
+ metadata: {
975
+ name: "USD Coin",
976
+ symbol: "USDC",
977
+ decimals: 6
978
+ }
979
+ }, $e = {
980
+ network: "eip155:10",
981
+ asset: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
982
+ metadata: {
983
+ name: "USD Coin",
984
+ symbol: "USDC",
985
+ decimals: 6
986
+ }
987
+ }, Be = {
988
+ network: "eip155:42161",
989
+ asset: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
990
+ metadata: {
991
+ name: "USD Coin",
992
+ symbol: "USDC",
993
+ decimals: 6
994
+ }
995
+ }, Fe = {
996
+ network: "eip155:137",
997
+ asset: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
998
+ metadata: {
999
+ name: "USD Coin",
1000
+ symbol: "USDC",
1001
+ decimals: 6
1002
+ }
1003
+ }, We = {
1004
+ network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
1005
+ asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
1006
+ metadata: {
1007
+ name: "USD Coin",
1008
+ symbol: "USDC",
1009
+ decimals: 6
1010
+ }
1011
+ }, He = {
1012
+ network: "eip155:1",
1013
+ asset: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1014
+ metadata: {
1015
+ name: "Tether USD",
1016
+ symbol: "USDT",
1017
+ decimals: 6
1018
+ }
1019
+ }, Ke = {
1020
+ network: "eip155:10",
1021
+ asset: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
1022
+ metadata: {
1023
+ name: "Tether USD",
1024
+ symbol: "USDT",
1025
+ decimals: 6
1026
+ }
1027
+ }, je = {
1028
+ network: "eip155:42161",
1029
+ asset: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
1030
+ metadata: {
1031
+ name: "Tether USD",
1032
+ symbol: "USDT",
1033
+ decimals: 6
1034
+ }
1035
+ }, qe = {
1036
+ network: "eip155:137",
1037
+ asset: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
1038
+ metadata: {
1039
+ name: "Tether USD",
1040
+ symbol: "USDT",
1041
+ decimals: 6
1042
+ }
1043
+ }, ze = {
1044
+ network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
1045
+ asset: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
1046
+ metadata: {
1047
+ name: "Tether USD",
1048
+ symbol: "USDT",
1049
+ decimals: 6
1050
+ }
1051
+ }, Xe = {
1052
+ network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
1053
+ asset: "native",
1054
+ metadata: {
1055
+ name: "Solana",
1056
+ symbol: "SOL",
1057
+ decimals: 9
1058
+ }
826
1059
  };
827
1060
  export {
828
- N as W3mPayLoadingView,
829
- m as W3mPayView,
830
- _e as baseETH,
831
- Te as baseSepoliaETH,
832
- xe as baseUSDC,
833
- Ne as getExchanges,
834
- Pe as getIsPaymentInProgress,
835
- Ie as getPayError,
836
- Ae as getPayResult,
837
- fe as openPay
1061
+ I as W3mPayLoadingView,
1062
+ y as W3mPayView,
1063
+ Be as arbitrumUSDC,
1064
+ je as arbitrumUSDT,
1065
+ Me as baseETH,
1066
+ Ge as baseSepoliaETH,
1067
+ Ye as baseUSDC,
1068
+ Ve as ethereumUSDC,
1069
+ He as ethereumUSDT,
1070
+ ve as getExchanges,
1071
+ Le as getIsPaymentInProgress,
1072
+ Oe as getPayError,
1073
+ De as getPayResult,
1074
+ he as openPay,
1075
+ $e as optimismUSDC,
1076
+ Ke as optimismUSDT,
1077
+ Re as pay,
1078
+ Fe as polygonUSDC,
1079
+ qe as polygonUSDT,
1080
+ Xe as solanaSOL,
1081
+ We as solanaUSDC,
1082
+ ze as solanaUSDT
838
1083
  };