@xswap-link/sdk 0.2.4 → 0.2.6

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 (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.css +244 -267
  3. package/dist/index.d.mts +19 -12
  4. package/dist/index.d.ts +19 -12
  5. package/dist/index.js +588 -432
  6. package/dist/index.mjs +539 -383
  7. package/package.json +1 -1
  8. package/src/components/Alert/index.tsx +1 -1
  9. package/src/components/Skeleton/index.tsx +3 -1
  10. package/src/components/TxConfigForm/BalanceComponent.tsx +1 -1
  11. package/src/components/TxConfigForm/Button.tsx +1 -1
  12. package/src/components/TxConfigForm/ChainListElement.tsx +2 -2
  13. package/src/components/TxConfigForm/Description.tsx +2 -2
  14. package/src/components/TxConfigForm/ErrorField.tsx +4 -2
  15. package/src/components/TxConfigForm/FeesDetails.tsx +35 -31
  16. package/src/components/TxConfigForm/Form.tsx +23 -7
  17. package/src/components/TxConfigForm/History.tsx +36 -9
  18. package/src/components/TxConfigForm/HistoryCard.tsx +33 -40
  19. package/src/components/TxConfigForm/PoweredBy.tsx +2 -2
  20. package/src/components/TxConfigForm/Settings.tsx +33 -27
  21. package/src/components/TxConfigForm/Summary.tsx +33 -20
  22. package/src/components/TxConfigForm/SwapPanel.tsx +12 -12
  23. package/src/components/TxConfigForm/TokenPicker.tsx +36 -34
  24. package/src/components/TxConfigForm/TopBar.tsx +8 -8
  25. package/src/components/TxConfigForm/UsdPrice.tsx +2 -2
  26. package/src/components/TxConfigForm/index.tsx +11 -6
  27. package/src/components/TxStatusButton/index.tsx +47 -35
  28. package/src/components/UnknownTokenLogo/UnknownTokenLogo.tsx +14 -0
  29. package/src/components/global.css +7 -5
  30. package/src/components/icons/CircularProgressIcon.tsx +1 -1
  31. package/src/config/init.tsx +19 -18
  32. package/src/index.ts +9 -1
  33. package/src/models/TokenData.ts +1 -1
  34. package/src/models/TransactionHistory.ts +12 -8
  35. package/src/models/payloads/GetRoutePayload.ts +1 -0
  36. package/src/models/payloads/GetSwapTxPayload.ts +1 -0
  37. package/src/services/api.ts +9 -0
  38. package/src/services/blockchain.ts +49 -0
  39. package/src/services/index.ts +1 -0
  40. package/src/services/integrations/monitoring.ts +34 -14
  41. package/src/services/integrations/transactions.ts +8 -3
  42. package/src/utils/strings.ts +4 -0
  43. package/tailwind.config.js +1 -0
@@ -30,42 +30,46 @@ export const Settings: FC<Props> = ({
30
30
  }, [slippageActivePresetIndex, usingSlippageInput]);
31
31
 
32
32
  return (
33
- <div className="absolute w-[310px] right-0 top-[46px] z-10 bg-black border border-solid border-[rgba(54,129,198,1)] p-4 rounded-xl">
34
- <div className="flex flex-col gap-4 justify-between">
35
- <div className="flex justify-between">
36
- <div className="text-base">Settings</div>
33
+ <div className="xpay-absolute xpay-w-[310px] xpay-right-0 xpay-top-[46px] xpay-z-10 xpay-bg-black xpay-border xpay-border-solid xpay-border-[rgba(54,129,198,1)] xpay-p-4 xpay-rounded-xl">
34
+ <div className="xpay-flex xpay-flex-col xpay-gap-4 xpay-justify-between">
35
+ <div className="xpay-flex xpay-justify-between">
36
+ <div className="xpay-text-base">Settings</div>
37
37
  <div
38
- className="cursor-pointer"
38
+ className="xpay-cursor-pointer"
39
39
  onClick={() => setSettingsShown(false)}
40
40
  >
41
41
  <CloseIcon />
42
42
  </div>
43
43
  </div>
44
44
  <div>
45
- <div className="flex gap-2 items-center">
46
- <div className="text-sm text-[rgba(255,255,255,0.6)]">
45
+ <div className="xpay-flex xpay-gap-2 xpay-items-center">
46
+ <div className="xpay-text-sm xpay-text-[rgba(255,255,255,0.6)]">
47
47
  Express delivery
48
48
  </div>
49
49
  <div>
50
50
  <span
51
- className="inline-flex w-14 h-9 p-3 relative align-middle box-border overflow-hidden cursor-pointer"
51
+ className="xpay-inline-flex xpay-w-14 xpay-h-9 xpay-p-3 xpay-relative xpay-align-middle xpay-box-border xpay-overflow-hidden xpay-cursor-pointer"
52
52
  onClick={() => {
53
53
  setExpressChecked((x) => !x);
54
54
  }}
55
55
  >
56
- <span className="h-full, w-full rounded-lg bg-[rgba(255,255,255,0.3)]"></span>
56
+ <span className="xpay-h-full, xpay-w-full xpay-rounded-lg xpay-bg-[rgba(255,255,255,0.3)]"></span>
57
57
  <span
58
- className={`transition-all w-5 h-5 rounded-full absolute translate-y-[-4px]
59
- ${expressChecked ? "translate-x-[12px] bg-x_blue" : "bg-white"} `}
58
+ className={`xpay-transition-all xpay-w-5 xpay-h-5 xpay-rounded-full xpay-absolute xpay-translate-y-[-4px]
59
+ ${
60
+ expressChecked
61
+ ? "xpay-translate-x-[12px] xpay-bg-x_blue"
62
+ : "xpay-bg-white"
63
+ } `}
60
64
  ></span>
61
65
  </span>
62
66
  </div>
63
67
  </div>
64
- <div className="flex gap-4">
65
- <div className="min-w-[26px] min-h-[26px] text-[#ffa726]">
68
+ <div className="xpay-flex xpay-gap-4">
69
+ <div className="xpay-min-w-[26px] xpay-min-h-[26px] xpay-text-[#ffa726]">
66
70
  <InfoIcon />
67
71
  </div>
68
- <div className="text-xs text-left">
72
+ <div className="xpay-text-xs xpay-text-left">
69
73
  Express delivery is a special feature of XSwap that reduces
70
74
  transaction time across chains to around 30 seconds. It is
71
75
  currently available for swaps below a value of $ 1000 USD.
@@ -73,20 +77,22 @@ export const Settings: FC<Props> = ({
73
77
  </div>
74
78
  </div>
75
79
 
76
- <div className="flex flex-col gap-2 ">
77
- <div className=" text-[rgba(255,255,255,0.6)] text-sm">Slippage</div>
78
- <div className="flex gap-2">
79
- <div className="flex items-center bg-[rgba(15,15,15,1)] p-1 globalBorder rounded-xl">
80
+ <div className="xpay-flex xpay-flex-col xpay-gap-2">
81
+ <div className="xpay-text-[rgba(255,255,255,0.6)] xpay-text-sm">
82
+ Slippage
83
+ </div>
84
+ <div className="xpay-flex xpay-gap-2">
85
+ <div className="xpay-flex xpay-items-center xpay-bg-[rgba(15,15,15,1)] p-1 xpay-global-border xpay-rounded-xl">
80
86
  {SLIPPAGE_PRESETS.map((preset, index) => (
81
87
  <div
82
88
  key={index}
83
- className={`transition-all cursor-pointer block rounded-lg p-2 border-none text-sm leading-[10px] ${
89
+ className={`xpay-transition-all xpay-cursor-pointer xpay-block xpay-rounded-lg xpay-p-2 xpay-border-none xpay-text-sm xpay-leading-[10px] ${
84
90
  index === slippageActivePresetIndex && !usingSlippageInput
85
- ? "text-white"
86
- : "text-[rgba(255,255,255,0.2)]"
91
+ ? "xpay-text-white"
92
+ : "xpay-text-[rgba(255,255,255,0.2)]"
87
93
  } ${
88
94
  index === slippageActivePresetIndex && !usingSlippageInput
89
- ? "bg-gradient-to-r from-[#3681c6] to-[#2b4a9d]"
95
+ ? "xpay-bg-gradient-to-r xpay-from-[#3681c6] xpay-to-[#2b4a9d]"
90
96
  : ""
91
97
  }`}
92
98
  onClick={() => {
@@ -98,9 +104,9 @@ export const Settings: FC<Props> = ({
98
104
  </div>
99
105
  ))}
100
106
  </div>
101
- <div className="bg-[rgba(39,39,39,1)] p-2 border border-solid border-[rgba(82,82,82,1)] rounded-xl text-white flex items-center">
107
+ <div className="xpay-bg-[rgba(39,39,39,1)] xpay-p-2 xpay-border xpay-border-solid xpay-border-[rgba(82,82,82,1)] xpay-rounded-xl xpay-text-white xpay-flex xpay-items-center">
102
108
  <input
103
- className="text-white border-none bg-[rgba(39,39,39,1)] w-10 placeholder:text-[rgba(255,255,255,0.2)] focus:outline-none text-sm leading-none"
109
+ className="xpay-text-white xpay-border-none xpay-bg-[rgba(39,39,39,1)] xpay-w-10 placeholder:xpay-text-[rgba(255,255,255,0.2)] focus:xpay-outline-none xpay-text-sm xpay-leading-none"
104
110
  placeholder="1.5"
105
111
  value={usingSlippageInput ? slippage : ""}
106
112
  onChange={(e) => {
@@ -118,11 +124,11 @@ export const Settings: FC<Props> = ({
118
124
  <PercentageIcon />
119
125
  </div>
120
126
  </div>
121
- <div className="flex gap-4">
122
- <div className="min-w-[26px] min-h-[26px] text-[#ffa726]">
127
+ <div className="xpay-flex xpay-gap-4">
128
+ <div className="xpay-min-w-[26px] xpay-min-h-[26px] xpay-text-[#ffa726]">
123
129
  <InfoIcon />
124
130
  </div>
125
- <div className="text-xs text-left">
131
+ <div className="xpay-text-xs xpay-text-left">
126
132
  Slippage is the price variation you are willing to accept in the
127
133
  event that the price of the trade changes while it is processing.
128
134
  <br /> <br />
@@ -1,10 +1,11 @@
1
- import React, { FC, useEffect, useMemo, useState } from "react";
1
+ import { FC, useEffect, useMemo, useState } from "react";
2
2
  import { weiToHumanReadable } from "@src/utils";
3
3
  import { Chain, Route, Token, TokenPrices } from "@src/models";
4
4
  import { ArrowDownIcon } from "../icons";
5
5
  import { UsdPrice } from "@src/components/TxConfigForm/UsdPrice";
6
6
  import { getPrices } from "@src/services";
7
7
  import { Skeleton } from "@src/components";
8
+ import { UnknownTokenLogo } from "../UnknownTokenLogo/UnknownTokenLogo";
8
9
 
9
10
  interface Props {
10
11
  isGettingRoute: boolean;
@@ -40,33 +41,45 @@ export const Summary: FC<Props> = ({
40
41
  }, [dstChain]);
41
42
 
42
43
  return (
43
- <div className="flex flex-col globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 relative">
44
- <div className="flex justify-between">
45
- <div className="flex flex-col gap-1">
46
- <p className="text-[rgba(255,255,255,0.6)] text-sm">You receive</p>
44
+ <div className="xpay-flex xpay-flex-col xpay-global-border xpay-rounded-lg xpay-bg-[rgba(15,15,15,1)] xpay-p-4 xpay-relative">
45
+ <div className="xpay-flex xpay-justify-between">
46
+ <div className="xpay-flex xpay-flex-col xpay-gap-1">
47
+ <p className="xpay-text-[rgba(255,255,255,0.6)] xpay-text-sm">
48
+ You receive
49
+ </p>
47
50
  {isGettingRoute ? (
48
51
  <Skeleton
49
- width="w-[100px]"
50
- height="h-[36px]"
51
- other="sm:w-[190px]"
52
+ width="xpay-w-[100px]"
53
+ height="xpay-h-[36px]"
54
+ other="sm:xpay-w-[190px]"
52
55
  />
53
56
  ) : (
54
- <div className="flex gap-2 items-center text-white text-xl sm:text-3xl">
57
+ <div className="xpay-flex xpay-gap-2 xpay-items-center xpay-text-white xpay-text-xl sm:xpay-text-3xl">
55
58
  {amountReadable}
56
59
  </div>
57
60
  )}
58
61
  </div>
59
- <div className="flex flex-col items-end gap-1 text-sm">
60
- <div className="flex justify-center items-center gap-1">
61
- <div className="w-4 sm:w-6 h-4 sm:h-6">
62
- <img src={dstToken?.image} alt={dstToken?.name} />
62
+ <div className="xpay-flex xpay-flex-col xpay-items-end xpay-gap-1 xpay-text-sm">
63
+ <div className="xpay-flex xpay-justify-center xpay-items-center xpay-gap-1">
64
+ <div className="xpay-w-5 xpay-h-5">
65
+ {dstToken?.image ? (
66
+ <img
67
+ className="xpay-w-5 xpay-h-5"
68
+ src={dstToken?.image}
69
+ alt={dstToken?.name}
70
+ />
71
+ ) : (
72
+ <UnknownTokenLogo tokenName={"?"} />
73
+ )}
63
74
  </div>
64
- <p className="text-base sm:text-xl">{dstToken?.symbol}</p>
75
+ <p className="xpay-text-base sm:xpay-text-xl">{dstToken?.name}</p>
65
76
  </div>
66
- <div className="flex justify-center items-center gap-1">
67
- <p className="text-[rgba(255,255,255,0.6)] text-right">on </p>
68
- <div className="flex items-center gap-1 text-white">
69
- <div className="w-4 h-4">
77
+ <div className="xpay-flex xpay-justify-center xpay-items-center xpay-gap-1">
78
+ <p className="xpay-text-[rgba(255,255,255,0.6)] xpay-text-right">
79
+ on{" "}
80
+ </p>
81
+ <div className="xpay-flex xpay-items-center xpay-gap-1 xpay-text-white">
82
+ <div className="xpay-w-4 xpay-h-4">
70
83
  <img src={dstChain?.image} alt={dstChain?.name} />
71
84
  </div>
72
85
  <div>{dstChain?.displayName}</div>
@@ -81,8 +94,8 @@ export const Summary: FC<Props> = ({
81
94
  loading={isGettingRoute}
82
95
  type="dst"
83
96
  />
84
- <div className="absolute right-[50%] top-0 translate-x-1/2 translate-y-[-60%] globalBorder rounded-xl p-[5px] bg-[rgba(15,15,15,1)]">
85
- <div className=" flex items-center justify-center rounded-lg w-8 h-8 bg-gradient-to-l from-[rgba(54,129,198,1)] to-[rgba(43,74,157,1)] ">
97
+ <div className="xpay-absolute xpay-right-[50%] xpay-top-0 xpay-translate-x-1/2 xpay-translate-y-[-60%] xpay-global-border xpay-rounded-xl p-[5px] xpay-bg-[rgba(15,15,15,1)]">
98
+ <div className="xpay-flex xpay-items-center xpay-justify-center xpay-rounded-lg xpay-w-8 xpay-h-8 xpay-bg-gradient-to-l xpay-from-[rgba(54,129,198,1)] xpay-to-[rgba(43,74,157,1)] ">
86
99
  <ArrowDownIcon />
87
100
  </div>
88
101
  </div>
@@ -63,7 +63,7 @@ export const SwapPanel: FC<Props> = ({
63
63
  weiToHumanReadable({
64
64
  amount: balances[srcToken.address]?.toString() || "0",
65
65
  decimals: srcToken.decimals,
66
- precisionFractionalPlaces: 4,
66
+ precisionFractionalPlaces: srcToken.decimals,
67
67
  }),
68
68
  );
69
69
  };
@@ -83,14 +83,14 @@ export const SwapPanel: FC<Props> = ({
83
83
  );
84
84
 
85
85
  return (
86
- <div className="flex justify-between globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4">
87
- <div className="flex flex-col justify-between gap-2 overflow-hidden w-1/2">
88
- <div className="flex flex-col gap-1">
89
- <p className="text-white opacity-60 text-xs sm:text-sm font-medium">
86
+ <div className="xpay-flex xpay-justify-between xpay-global-border xpay-rounded-lg xpay-bg-[rgba(15,15,15,1)] xpay-p-4">
87
+ <div className="xpay-flex xpay-flex-col xpay-justify-between xpay-gap-2 xpay-overflow-hidden xpay-w-1/2">
88
+ <div className="xpay-flex xpay-flex-col xpay-gap-1">
89
+ <p className="xpay-text-white xpay-opacity-60 xpay-text-xs sm:xpay-text-sm xpay-font-medium">
90
90
  You pay
91
91
  </p>
92
92
  <input
93
- className="p-0 border-none outline-none bg-transparent text-2xl overflow-ellipsis"
93
+ className="xpay-p-0 xpay-border-none xpay-outline-none xpay-bg-transparent xpay-text-2xl xpay-overflow-ellipsis"
94
94
  value={amount}
95
95
  onChange={(e) => {
96
96
  if (e.target.value === ".") return;
@@ -105,7 +105,7 @@ export const SwapPanel: FC<Props> = ({
105
105
  placeholder="0"
106
106
  />
107
107
  </div>
108
- <div className="flex items-center text-sm text-[rgba(255,255,255,0.6)]">
108
+ <div className="xpay-flex xpay-items-center xpay-text-sm xpay-text-[rgba(255,255,255,0.6)]">
109
109
  <UsdPrice
110
110
  prices={prices}
111
111
  token={srcToken}
@@ -116,9 +116,9 @@ export const SwapPanel: FC<Props> = ({
116
116
  />
117
117
  </div>
118
118
  </div>
119
- <div className="flex flex-col relative items-end gap-2.5 w-1/2 text-xs">
119
+ <div className="xpay-flex xpay-flex-col xpay-relative xpay-items-end xpay-gap-2.5 xpay-w-1/2 xpay-text-xs">
120
120
  <div
121
- className="flex gap-2 items-center p-2 max-w-full cursor-pointer bg-black text-white globalBorder rounded-3xl whitespace-nowrap"
121
+ className="xpay-flex xpay-gap-2 xpay-items-center xpay-p-2 xpay-max-w-full xpay-cursor-pointer xpay-bg-black xpay-text-white xpay-global-border xpay-rounded-3xl xpay-whitespace-nowrap"
122
122
  onClick={() => {
123
123
  setTokenListShown((state) => !state);
124
124
  }}
@@ -145,7 +145,7 @@ export const SwapPanel: FC<Props> = ({
145
145
  )}
146
146
  <div
147
147
  onClick={handleMaxClick}
148
- className="flex gap-1 items-center font-medium text-white opacity-60 py-0.5 cursor-pointer"
148
+ className="xpay-flex xpay-gap-1 xpay-items-center xpay-font-medium xpay-text-white xpay-opacity-60 xpay-py-0.5 xpay-cursor-pointer"
149
149
  >
150
150
  {signer && (
151
151
  <BalanceComponent balances={balances} srcToken={srcToken} />
@@ -153,7 +153,7 @@ export const SwapPanel: FC<Props> = ({
153
153
  </div>
154
154
  <div
155
155
  ref={buttonRef}
156
- className="bg-black globalBorder rounded-2xl whitespace-nowrap flex items-center p-2 cursor-pointer gap-2"
156
+ className="xpay-bg-black xpay-global-border xpay-rounded-2xl xpay-whitespace-nowrap xpay-flex xpay-items-center xpay-p-2 xpay-cursor-pointer xpay-gap-2"
157
157
  onClick={() => setChainListShown((prev) => !prev)}
158
158
  >
159
159
  <img
@@ -169,7 +169,7 @@ export const SwapPanel: FC<Props> = ({
169
169
  {chainListShown && (
170
170
  <ul
171
171
  ref={listRef}
172
- className="bg-black globalBorder rounded-lg whitespace-nowrap z-1 right-0 top-10 px-2 max-w-full max-h-[40vh] overflow-auto absolute text-sm z-20"
172
+ className="xpay-bg-black xpay-global-border xpay-rounded-lg xpay-whitespace-nowrap xpay-z-1 xpay-right-0 xpay-top-10 xpay-px-2 xpay-max-w-full xpay-max-h-[40vh] xpay-overflow-auto xpay-absolute xpay-text-sm xpay-z-20"
173
173
  >
174
174
  {chainListOptions.map((chain, index) => (
175
175
  <ChainListElement
@@ -24,8 +24,6 @@ export const TokenPicker: FC<Props> = ({
24
24
  }) => {
25
25
  const [searchValue, setSearchValue] = useState("");
26
26
 
27
- const modalRoot = document.querySelector("#xswap-modal");
28
-
29
27
  const onBackdropClick = (e: MouseEvent<HTMLDivElement>) => {
30
28
  e.stopPropagation();
31
29
  e.nativeEvent.stopImmediatePropagation();
@@ -57,40 +55,42 @@ export const TokenPicker: FC<Props> = ({
57
55
  );
58
56
  }, [searchValue, tokens]);
59
57
 
60
- return modalRoot
58
+ const xpayRoot = document.querySelector("#xpay-root");
59
+
60
+ return xpayRoot
61
61
  ? createPortal(
62
62
  <div
63
63
  onClick={onBackdropClick}
64
- className="box-border fixed h-full w-full z-[999] top-0 left-0 bg-[rgba(0,0,0,0.8)] flex items-center justify-center p-5"
64
+ className="xpay-box-border xpay-fixed xpay-h-full xpay-w-full xpay-z-[999] xpay-top-0 xpay-left-0 xpay-bg-[rgba(0,0,0,0.8)] xpay-flex xpay-items-center xpay-justify-center xpay-p-5"
65
65
  >
66
- <div className="relative bg-black rounded-3xl p-6 max-h-[70%] flex flex-col text-base text-white w-[452px] h-[70%] border border-solid border-[rgba(255,255,255,0.2)]">
66
+ <div className="xpay-relative xpay-bg-black xpay-rounded-3xl xpay-p-6 xpay-max-h-[70%] xpay-flex xpay-flex-col xpay-text-base xpay-text-white xpay-w-[452px] xpay-h-[70%] xpay-border xpay-border-solid xpay-border-[rgba(255,255,255,0.2)]">
67
67
  <div
68
68
  onClick={onCloseClick}
69
- className="absolute top-4 right-4 cursor-pointer"
69
+ className="xpay-absolute xpay-top-4 xpay-right-4 xpay-cursor-pointer"
70
70
  >
71
71
  <CloseIcon />
72
72
  </div>
73
- <p className="text-base mb-4">Pick a token</p>
74
- <div className="flex items-center border border-solid border-[rgba(255,255,255,0.1)] rounded-lg py-0 px-3 gap-2 bg-[rgba(15,15,15,1)]">
75
- <div className="w-6 h-6">
73
+ <p className="xpay-text-base xpay-mb-4">Pick a token</p>
74
+ <div className="xpay-flex xpay-items-center xpay-border xpay-border-solid xpay-border-[rgba(255,255,255,0.1)] xpay-rounded-lg xpay-py-0 xpay-px-3 xpay-gap-2 xpay-bg-[rgba(15,15,15,1)]">
75
+ <div className="xpay-w-6 xpay-h-6">
76
76
  <SearchIcon />
77
77
  </div>
78
78
  <input
79
79
  placeholder="Search name or paste address"
80
80
  value={searchValue}
81
81
  onChange={(e) => setSearchValue(e.target.value)}
82
- className="relative h-[41px] leading-[41px] font-normal z-[1] w-full text-white bg-transparent border-none outline-none placeholder:text-sm"
82
+ className="xpay-relative xpay-h-[41px] xpay-leading-[41px] xpay-font-normal xpay-z-[1] xpay-w-full xpay-text-white xpay-bg-transparent xpay-border-none xpay-outline-none placeholder:xpay-text-sm"
83
83
  />
84
84
  </div>
85
- <div className="my-4 mx-0 flex flex-wrap gap-3">
85
+ <div className="xpay-my-4 xpay-mx-0 xpay-flex xpay-flex-wrap xpay-gap-3">
86
86
  {tokens
87
87
  ?.filter((token) => token?.quickPick)
88
88
  .map((token) => (
89
89
  <div
90
90
  key={token.address}
91
- className={`flex gap-2 py-1 px-2 items-center bg-[rgb(15,15,15)] rounded-2xl border border-solid border-[rgba(255,255,255,0.1)] hover:bg-[rgb(25,25,25)] hover:cursor-pointer ${
91
+ className={`xpay-flex xpay-gap-2 xpay-py-1 xpay-px-2 xpay-items-center xpay-bg-[rgb(15,15,15)] xpay-rounded-2xl xpay-border xpay-border-solid xpay-border-[rgba(255,255,255,0.1)] hover:xpay-bg-[rgb(25,25,25)] hover:xpay-cursor-pointer ${
92
92
  token.address === selectedToken?.address
93
- ? "bg-[rgb(35, 35, 35)]"
93
+ ? "xpay-bg-[rgb(35, 35, 35)]"
94
94
  : ""
95
95
  }`}
96
96
  onClick={() => {
@@ -98,20 +98,24 @@ export const TokenPicker: FC<Props> = ({
98
98
  onCloseClick();
99
99
  }}
100
100
  >
101
- <img src={token.image} alt={token.name} className="w-5" />
102
- <div className="text-sm">{token.symbol}</div>
101
+ <img
102
+ src={token.image}
103
+ alt={token.name}
104
+ className="xpay-w-5"
105
+ />
106
+ <div className="xpay-text-sm">{token.symbol}</div>
103
107
  </div>
104
108
  ))}
105
109
  </div>
106
- <div className="h-[2px] my-0 mx-[-24px] w-[100%+48px] px-12 bg-[rgba(255,255,255,0.1)]" />
107
- <div className="overflow-y-scroll h-full mx-[-24px] w-[100%+48px] flex flex-col">
110
+ <div className="xpay-h-[2px] xpay-my-0 xpay-mx-[-24px] xpay-w-[100%+48px] xpay-px-12 xpay-bg-[rgba(255,255,255,0.1)]" />
111
+ <div className="xpay-overflow-y-scroll xpay-h-full xpay-mx-[-24px] xpay-w-[100%+48px] xpay-flex xpay-flex-col">
108
112
  {filteredTokens && filteredTokens.length > 0 ? (
109
113
  filteredTokens.map((token, index) => (
110
114
  <div
111
115
  key={`${index}_${token.address}`}
112
- className={`flex gap-3 py-2 px-[24px] w-full items-center hover:bg-[rgb(25,25,25)] hover:cursor-pointer ${
116
+ className={`xpay-flex xpay-gap-3 xpay-py-2 xpay-px-[24px] xpay-w-full xpay-items-center hover:xpay-bg-[rgb(25,25,25)] hover:xpay-cursor-pointer ${
113
117
  token.address === selectedToken?.address
114
- ? "bg-[rgb(35,35,35)]"
118
+ ? "xpay-bg-[rgb(35,35,35)]"
115
119
  : ""
116
120
  }`}
117
121
  onClick={() => {
@@ -120,22 +124,18 @@ export const TokenPicker: FC<Props> = ({
120
124
  }}
121
125
  >
122
126
  {token.image ? (
123
- <img
124
- src={token.image}
125
- alt={token.name}
126
- className="token-picker__all__logo"
127
- />
127
+ <img src={token.image} alt={token.name} />
128
128
  ) : (
129
- <div className="flex items-center justify-center w-9 h-9 text-[15px] ml-1 rounded-full bg-[#272e40] text-[#e0e7fa]">
129
+ <div className="xpay-flex xpay-items-center xpay-justify-center xpay-w-9 xpay-h-9 xpay-text-[15px] xpay-ml-1 xpay-rounded-full xpay-bg-[#272e40] xpay-text-[#e0e7fa]">
130
130
  {token?.symbol.substring(0, 1)}
131
131
  </div>
132
132
  )}
133
- <div className="flex justify-between items-center gap-1 overflow-hidden grow">
134
- <div className="flex flex-col leading-[16px]">
135
- <div className="overflow-hidden whitespace-nowrap text-ellipsis text-[15px]">
133
+ <div className="xpay-flex xpay-justify-between xpay-items-center xpay-gap-1 xpay-overflow-hidden xpay-grow">
134
+ <div className="xpay-flex xpay-flex-col xpay-leading-[16px]">
135
+ <div className="xpay-overflow-hidden xpay-whitespace-nowrap xpay-text-ellipsis xpay-text-[15px]">
136
136
  {token.name}
137
137
  </div>
138
- <div className="text-[#888] text-[11px]">
138
+ <div className="xpay-text-[#888] xpay-text-[11px]">
139
139
  {token.symbol}
140
140
  </div>
141
141
  </div>
@@ -144,7 +144,7 @@ export const TokenPicker: FC<Props> = ({
144
144
  {balances &&
145
145
  balances[token.address] &&
146
146
  token.decimals ? (
147
- <div className="text-xs">
147
+ <div className="xpay-text-xs">
148
148
  {weiToHumanReadable({
149
149
  amount:
150
150
  balances[token.address]?.toString() || "0",
@@ -153,7 +153,7 @@ export const TokenPicker: FC<Props> = ({
153
153
  })}
154
154
  </div>
155
155
  ) : (
156
- <Skeleton width="w-12" height="h-3" />
156
+ <Skeleton width="xpay-w-12" height="xpay-h-3" />
157
157
  )}
158
158
  </>
159
159
  )}
@@ -161,14 +161,16 @@ export const TokenPicker: FC<Props> = ({
161
161
  </div>
162
162
  ))
163
163
  ) : (
164
- <div className="mt-4 flex justify-center">
165
- <p className="text-sm text-white">No tokens found.</p>
164
+ <div className="xpay-mt-4 xpay-flex xpay-justify-center">
165
+ <p className="xpay-text-sm xpay-text-white">
166
+ No tokens found.
167
+ </p>
166
168
  </div>
167
169
  )}
168
170
  </div>
169
171
  </div>
170
172
  </div>,
171
- modalRoot,
173
+ xpayRoot,
172
174
  )
173
175
  : null;
174
176
  };
@@ -18,30 +18,30 @@ export const TopBar: FC<Props> = ({
18
18
  onClose,
19
19
  }) => {
20
20
  return (
21
- <div className="flex w-full justify-between items-center mx-auto p-2">
22
- <div className="rounded-lg text-[rgba(255,255,255,0.6)] text-xs sm:text-base whitespace-nowrap">
21
+ <div className="xpay-flex xpay-w-full xpay-justify-between xpay-items-center xpay-mx-auto xpay-p-2">
22
+ <div className="xpay-rounded-lg xpay-text-[rgba(255,255,255,0.6)] xpay-text-xs sm:xpay-text-base xpay-whitespace-nowrap">
23
23
  {signer
24
24
  ? `Connected wallet: ${shortAddress(signer)}`
25
25
  : `Wallet disconnected`}
26
26
  </div>
27
- <div className="flex gap-2 justify-center items-center">
27
+ <div className="xpay-flex xpay-gap-2 xpay-justify-center xpay-items-center">
28
28
  {!historyTabShown && (
29
29
  <div
30
30
  onClick={() => setSettingsShown(true)}
31
- className="flex items-center text-xs gap-1 cursor-pointer"
31
+ className="xpay-flex xpay-items-center xpay-text-xs xpay-gap-1 xpay-cursor-pointer"
32
32
  >
33
- <div className="w-7 h-7 rounded-full bg-gradient-to-r from-x_blue_light to-x_blue_dark flex items-center justify-center">
33
+ <div className="xpay-w-7 xpay-h-7 xpay-rounded-full xpay-bg-gradient-to-r xpay-from-x_blue_light xpay-to-x_blue_dark xpay-flex xpay-items-center xpay-justify-center">
34
34
  <SettingsIcon />
35
35
  </div>
36
36
  </div>
37
37
  )}
38
38
  <div
39
39
  onClick={() => setHistoryTabShown((x) => !x)}
40
- className="flex items-center text-sm gap-1 cursor-pointer"
40
+ className="xpay-flex xpay-items-center xpay-text-sm xpay-gap-1 xpay-cursor-pointer"
41
41
  >
42
42
  {!historyTabShown ? (
43
43
  <>
44
- <div className="w-7 h-7 rounded-full bg-gradient-to-r from-x_blue_light to-x_blue_dark flex items-center justify-center">
44
+ <div className="xpay-w-7 xpay-h-7 xpay-rounded-full xpay-bg-gradient-to-r xpay-from-x_blue_light xpay-to-x_blue_dark xpay-flex xpay-items-center xpay-justify-center">
45
45
  <HistoryIcon />
46
46
  </div>
47
47
  </>
@@ -49,7 +49,7 @@ export const TopBar: FC<Props> = ({
49
49
  <div>Back</div>
50
50
  )}
51
51
  </div>
52
- <div className="cursor-pointer text-white" onClick={onClose}>
52
+ <div className="xpay-cursor-pointer xpay-text-white" onClick={onClose}>
53
53
  <CloseIcon />
54
54
  </div>
55
55
  </div>
@@ -37,9 +37,9 @@ export const UsdPrice: FC<Props> = ({
37
37
  }, [token, prices, amount]);
38
38
 
39
39
  return (
40
- <div className="opacity-60 py-4">
40
+ <div className="xpay-opacity-60 xpay-py-4">
41
41
  {loading ? (
42
- <Skeleton width="w-12" height="h-4" />
42
+ <Skeleton width="xpay-w-12" height="xpay-h-4" />
43
43
  ) : token ? (
44
44
  prices && prices[token.address] ? (
45
45
  <div>{`$${usdPrice}`}</div>
@@ -2,12 +2,13 @@ import "@src/global.css";
2
2
  import { MouseEvent, useMemo } from "react";
3
3
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
4
  import { WagmiProvider } from "wagmi";
5
- import { getWagmiConfig, waitForInitialization, xswapRoot } from "@src/config";
5
+ import { getWagmiConfig, waitForInitialization, xpayRoot } from "@src/config";
6
6
  import { Chain, ContractCall, Route } from "@src/models";
7
7
  import { PoweredBy } from "@src/components/TxConfigForm/PoweredBy";
8
8
  import { Form } from "./Form";
9
9
 
10
10
  export type TxConfigFormProps = {
11
+ integratorId: string;
11
12
  dstChainId: string;
12
13
  dstTokenAddr: string;
13
14
  customContractCalls: ContractCall[];
@@ -16,6 +17,7 @@ export type TxConfigFormProps = {
16
17
  };
17
18
 
18
19
  const TxConfigForm = ({
20
+ integratorId,
19
21
  dstChainId,
20
22
  dstTokenAddr,
21
23
  customContractCalls,
@@ -45,11 +47,12 @@ const TxConfigForm = ({
45
47
  <WagmiProvider config={wagmiConfig}>
46
48
  <QueryClientProvider client={queryClient}>
47
49
  <div
48
- className="top-0 left-0 right-0 bottom-0 bg-[rgba(0,0,0,0.8)] fixed flex items-center justify-center z-10"
50
+ className="xpay-top-0 xpay-left-0 xpay-right-0 xpay-bottom-0 xpay-bg-[rgba(0,0,0,0.8)] xpay-fixed xpay-flex xpay-items-center xpay-justify-center xpay-z-10"
49
51
  onClick={onBackdropClick}
50
52
  >
51
- <div className="relative bg-black rounded-3xl overflow-auto text-white border-2 border-solid border-[rgba(255,255,255,0.1)]">
53
+ <div className="xpay-relative xpay-bg-black xpay-rounded-3xl xpay-overflow-auto xpay-text-white xpay-border-2 xpay-border-solid xpay-border-[rgba(255,255,255,0.1)]">
52
54
  <Form
55
+ integratorId={integratorId}
53
56
  dstChainId={dstChainId}
54
57
  dstTokenAddr={dstTokenAddr}
55
58
  customContractCalls={customContractCalls}
@@ -67,6 +70,7 @@ const TxConfigForm = ({
67
70
  };
68
71
 
69
72
  export const openTxConfigForm = async ({
73
+ integratorId,
70
74
  dstChainId,
71
75
  dstTokenAddr,
72
76
  customContractCalls,
@@ -76,8 +80,9 @@ export const openTxConfigForm = async ({
76
80
  try {
77
81
  return await new Promise(async (resolve) => {
78
82
  await waitForInitialization();
79
- xswapRoot.render(
83
+ xpayRoot.render(
80
84
  <TxConfigForm
85
+ integratorId={integratorId}
81
86
  dstChainId={dstChainId}
82
87
  dstTokenAddr={dstTokenAddr}
83
88
  customContractCalls={customContractCalls}
@@ -85,10 +90,10 @@ export const openTxConfigForm = async ({
85
90
  supportedChains={supportedChains}
86
91
  onSubmit={(route) => {
87
92
  resolve(route);
88
- xswapRoot.render("");
93
+ xpayRoot.render("");
89
94
  }}
90
95
  onClose={() => {
91
- xswapRoot.render("");
96
+ xpayRoot.render("");
92
97
  }}
93
98
  />,
94
99
  );