@hot-labs/kit 1.5.3 → 1.6.0

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 (214) hide show
  1. package/.github/workflows/release.yml +1 -1
  2. package/README.md +5 -5
  3. package/build/HotBridgeWithdrawal.d.ts +10 -0
  4. package/build/HotBridgeWithdrawal.js +80 -0
  5. package/build/HotBridgeWithdrawal.js.map +1 -0
  6. package/build/{HotConnector.d.ts → HotKit.d.ts} +9 -5
  7. package/build/{HotConnector.js → HotKit.js} +14 -11
  8. package/build/HotKit.js.map +1 -0
  9. package/build/activity.d.ts +8 -12
  10. package/build/activity.js +16 -67
  11. package/build/activity.js.map +1 -1
  12. package/build/core/Intents.d.ts +6 -9
  13. package/build/core/Intents.js +28 -29
  14. package/build/core/Intents.js.map +1 -1
  15. package/build/core/OmniConnector.d.ts +3 -3
  16. package/build/core/OmniConnector.js +13 -13
  17. package/build/core/OmniConnector.js.map +1 -1
  18. package/build/core/OmniWallet.d.ts +3 -2
  19. package/build/core/OmniWallet.js +5 -5
  20. package/build/core/OmniWallet.js.map +1 -1
  21. package/build/core/chains.d.ts +2 -1
  22. package/build/core/chains.js +2 -1
  23. package/build/core/chains.js.map +1 -1
  24. package/build/core/exchange.d.ts +6 -9
  25. package/build/core/exchange.js +19 -81
  26. package/build/core/exchange.js.map +1 -1
  27. package/build/core/pendings.d.ts +32 -0
  28. package/build/core/pendings.js +143 -0
  29. package/build/core/pendings.js.map +1 -0
  30. package/build/core/telemetry.d.ts +3 -3
  31. package/build/core/telemetry.js +4 -4
  32. package/build/core/telemetry.js.map +1 -1
  33. package/build/cosmos/connector.d.ts +2 -2
  34. package/build/cosmos/connector.js +2 -2
  35. package/build/cosmos/connector.js.map +1 -1
  36. package/build/cosmos/index.d.ts +2 -2
  37. package/build/cosmos/index.js +1 -1
  38. package/build/cosmos/index.js.map +1 -1
  39. package/build/defaults.d.ts +1 -1
  40. package/build/evm/connector.d.ts +4 -4
  41. package/build/evm/connector.js +2 -2
  42. package/build/evm/connector.js.map +1 -1
  43. package/build/evm/index.d.ts +2 -2
  44. package/build/evm/index.js +1 -1
  45. package/build/evm/index.js.map +1 -1
  46. package/build/hocraft/connector.d.ts +3 -3
  47. package/build/hocraft/connector.js +7 -7
  48. package/build/hocraft/connector.js.map +1 -1
  49. package/build/hocraft/index.d.ts +2 -2
  50. package/build/hocraft/index.js +1 -1
  51. package/build/hocraft/index.js.map +1 -1
  52. package/build/hot-wallet/google.d.ts +2 -2
  53. package/build/hot-wallet/google.js +5 -5
  54. package/build/hot-wallet/google.js.map +1 -1
  55. package/build/hot-wallet/index.d.ts +2 -2
  56. package/build/hot-wallet/index.js +1 -1
  57. package/build/hot-wallet/index.js.map +1 -1
  58. package/build/index.d.ts +3 -2
  59. package/build/index.js +4 -2
  60. package/build/index.js.map +1 -1
  61. package/build/near/connector.d.ts +3 -3
  62. package/build/near/connector.js +4 -4
  63. package/build/near/connector.js.map +1 -1
  64. package/build/near/index.d.ts +2 -2
  65. package/build/near/index.js +1 -1
  66. package/build/near/index.js.map +1 -1
  67. package/build/solana/connector.d.ts +4 -4
  68. package/build/solana/connector.js +2 -2
  69. package/build/solana/connector.js.map +1 -1
  70. package/build/solana/index.d.ts +2 -2
  71. package/build/solana/index.js +1 -1
  72. package/build/solana/index.js.map +1 -1
  73. package/build/stellar/connector.d.ts +2 -2
  74. package/build/stellar/connector.js +3 -3
  75. package/build/stellar/connector.js.map +1 -1
  76. package/build/stellar/index.d.ts +2 -2
  77. package/build/stellar/index.js +1 -1
  78. package/build/stellar/index.js.map +1 -1
  79. package/build/storage.d.ts +10 -0
  80. package/build/storage.js +56 -0
  81. package/build/storage.js.map +1 -1
  82. package/build/ton/connector.d.ts +2 -2
  83. package/build/ton/connector.js +3 -3
  84. package/build/ton/connector.js.map +1 -1
  85. package/build/ton/index.d.ts +2 -2
  86. package/build/ton/index.js +1 -1
  87. package/build/ton/index.js.map +1 -1
  88. package/build/tron/connector.d.ts +2 -2
  89. package/build/tron/connector.js +2 -2
  90. package/build/tron/connector.js.map +1 -1
  91. package/build/tron/index.d.ts +2 -2
  92. package/build/tron/index.js +1 -1
  93. package/build/tron/index.js.map +1 -1
  94. package/build/ui/Popup.d.ts +2 -1
  95. package/build/ui/Popup.js +3 -3
  96. package/build/ui/Popup.js.map +1 -1
  97. package/build/ui/bridge/Bridge.d.ts +11 -3
  98. package/build/ui/bridge/Bridge.js +45 -47
  99. package/build/ui/bridge/Bridge.js.map +1 -1
  100. package/build/ui/bridge/SelectRecipient.d.ts +3 -3
  101. package/build/ui/bridge/SelectRecipient.js +2 -2
  102. package/build/ui/bridge/SelectSender.d.ts +3 -3
  103. package/build/ui/bridge/SelectSender.js +5 -5
  104. package/build/ui/bridge/SelectSender.js.map +1 -1
  105. package/build/ui/bridge/SelectToken.d.ts +3 -3
  106. package/build/ui/bridge/SelectToken.js +12 -12
  107. package/build/ui/bridge/TokenCard.d.ts +10 -8
  108. package/build/ui/bridge/TokenCard.js +3 -3
  109. package/build/ui/bridge/TokenCard.js.map +1 -1
  110. package/build/ui/connect/AuthPopup.d.ts +8 -1
  111. package/build/ui/connect/AuthPopup.js +2 -20
  112. package/build/ui/connect/AuthPopup.js.map +1 -1
  113. package/build/ui/connect/ConnectWallet.d.ts +3 -3
  114. package/build/ui/connect/ConnectWallet.js +3 -3
  115. package/build/ui/connect/PrimaryWallet.d.ts +3 -3
  116. package/build/ui/connect/PrimaryWallet.js +2 -2
  117. package/build/ui/connect/PrimaryWallet.js.map +1 -1
  118. package/build/ui/connect/WalletPicker.d.ts +1 -1
  119. package/build/ui/connect/WalletPicker.js +1 -0
  120. package/build/ui/connect/WalletPicker.js.map +1 -1
  121. package/build/ui/icons/copy.d.ts +1 -0
  122. package/build/ui/icons/copy.js +5 -0
  123. package/build/ui/icons/copy.js.map +1 -0
  124. package/build/ui/icons/warning.d.ts +1 -0
  125. package/build/ui/icons/warning.js +5 -0
  126. package/build/ui/icons/warning.js.map +1 -0
  127. package/build/ui/index.d.ts +12 -0
  128. package/build/ui/index.js +12 -0
  129. package/build/ui/index.js.map +1 -0
  130. package/build/ui/profile/DepositFlow.d.ts +8 -0
  131. package/build/ui/profile/DepositFlow.js +13 -0
  132. package/build/ui/profile/DepositFlow.js.map +1 -0
  133. package/build/ui/profile/DepositQR.d.ts +4 -2
  134. package/build/ui/profile/DepositQR.js +51 -22
  135. package/build/ui/profile/DepositQR.js.map +1 -1
  136. package/build/ui/profile/Payment.d.ts +6 -9
  137. package/build/ui/profile/Payment.js +36 -28
  138. package/build/ui/profile/Payment.js.map +1 -1
  139. package/build/ui/profile/Profile.d.ts +3 -3
  140. package/build/ui/profile/Profile.js +17 -52
  141. package/build/ui/profile/Profile.js.map +1 -1
  142. package/build/ui/router.d.ts +14 -15
  143. package/build/ui/router.js +37 -16
  144. package/build/ui/router.js.map +1 -1
  145. package/build/ui/styles.js +3 -0
  146. package/build/ui/styles.js.map +1 -1
  147. package/build/ui/toast/index.d.ts +42 -0
  148. package/build/ui/toast/index.js +165 -0
  149. package/build/ui/toast/index.js.map +1 -0
  150. package/build/ui/uikit/button.js +1 -1
  151. package/build/ui/uikit/checkbox.d.ts +8 -0
  152. package/build/ui/uikit/checkbox.js +39 -0
  153. package/build/ui/uikit/checkbox.js.map +1 -0
  154. package/build/ui/uikit/text.js +27 -27
  155. package/package.json +3 -2
  156. package/src/HotBridgeWithdrawal.ts +80 -0
  157. package/src/{HotConnector.ts → HotKit.ts} +17 -13
  158. package/src/activity.ts +22 -69
  159. package/src/core/Intents.ts +22 -36
  160. package/src/core/OmniConnector.ts +12 -12
  161. package/src/core/OmniWallet.ts +6 -6
  162. package/src/core/chains.ts +2 -1
  163. package/src/core/exchange.ts +22 -80
  164. package/src/core/pendings.ts +151 -0
  165. package/src/core/telemetry.ts +3 -3
  166. package/src/cosmos/connector.ts +3 -3
  167. package/src/cosmos/index.ts +3 -3
  168. package/src/evm/connector.ts +3 -3
  169. package/src/evm/index.ts +2 -2
  170. package/src/hocraft/connector.ts +6 -6
  171. package/src/hocraft/index.ts +2 -2
  172. package/src/hot-wallet/google.ts +6 -6
  173. package/src/hot-wallet/index.ts +2 -2
  174. package/src/index.ts +5 -2
  175. package/src/near/connector.ts +3 -3
  176. package/src/near/index.ts +2 -2
  177. package/src/solana/connector.ts +3 -3
  178. package/src/solana/index.ts +2 -2
  179. package/src/stellar/connector.ts +4 -4
  180. package/src/stellar/index.ts +2 -2
  181. package/src/storage.ts +69 -0
  182. package/src/ton/connector.ts +4 -4
  183. package/src/ton/index.ts +2 -2
  184. package/src/tron/connector.ts +3 -3
  185. package/src/tron/index.ts +2 -2
  186. package/src/ui/Popup.tsx +4 -3
  187. package/src/ui/bridge/Bridge.tsx +64 -61
  188. package/src/ui/bridge/SelectRecipient.tsx +4 -4
  189. package/src/ui/bridge/SelectSender.tsx +8 -8
  190. package/src/ui/bridge/SelectToken.tsx +14 -14
  191. package/src/ui/bridge/TokenCard.tsx +31 -24
  192. package/src/ui/connect/AuthPopup.tsx +1 -24
  193. package/src/ui/connect/ConnectWallet.tsx +5 -5
  194. package/src/ui/connect/PrimaryWallet.tsx +3 -3
  195. package/src/ui/connect/WalletPicker.tsx +6 -0
  196. package/src/ui/icons/copy.tsx +8 -0
  197. package/src/ui/icons/warning.tsx +10 -0
  198. package/src/ui/index.ts +14 -0
  199. package/src/ui/profile/DepositFlow.tsx +27 -0
  200. package/src/ui/profile/DepositQR.tsx +83 -46
  201. package/src/ui/profile/Payment.tsx +67 -37
  202. package/src/ui/profile/Profile.tsx +39 -68
  203. package/src/ui/router.tsx +48 -21
  204. package/src/ui/styles.ts +3 -0
  205. package/src/ui/toast/index.tsx +238 -0
  206. package/src/ui/uikit/button.tsx +1 -1
  207. package/src/ui/uikit/checkbox.tsx +60 -0
  208. package/src/ui/uikit/text.tsx +27 -27
  209. package/build/HotConnector.js.map +0 -1
  210. package/build/ui/uikit/Toast.d.ts +0 -4
  211. package/build/ui/uikit/Toast.js +0 -33
  212. package/build/ui/uikit/Toast.js.map +0 -1
  213. package/src/ui/uikit/Toast.tsx +0 -45
  214. package/vite.config.ts +0 -17
@@ -7,7 +7,7 @@ import { ArrowRightIcon } from "../icons/arrow-right";
7
7
  import ExchangeIcon from "../icons/exchange";
8
8
  import RefreshIcon from "../icons/refresh";
9
9
 
10
- import { HotConnector } from "../../HotConnector";
10
+ import { HotKit } from "../../HotKit";
11
11
  import { chains, Network, WalletType } from "../../core/chains";
12
12
  import { BridgeReview } from "../../core/exchange";
13
13
  import { OmniWallet } from "../../core/OmniWallet";
@@ -17,12 +17,12 @@ import { tokens } from "../../core/tokens";
17
17
  import { Token } from "../../core/token";
18
18
 
19
19
  import { ActionButton, Button } from "../uikit/button";
20
- import { PLarge, PMedium, PSmall, PTiny } from "../uikit/text";
20
+ import { H5, PLarge, PSmall, PTiny } from "../uikit/text";
21
21
  import { Skeleton } from "../uikit/loader";
22
22
  import { ImageView } from "../uikit/image";
23
23
 
24
24
  import Popup from "../Popup";
25
- import { openSelectRecipient, openSelectSender, openSelectTokenPopup, openWalletPicker } from "../router";
25
+ import { openConnector, openSelectRecipient, openSelectSender, openSelectTokenPopup } from "../router";
26
26
  import DepositQR from "../profile/DepositQR";
27
27
  import { TokenIcon } from "./TokenCard";
28
28
 
@@ -32,10 +32,19 @@ const animations = {
32
32
  loading: "https://hex.exchange/loading.json",
33
33
  };
34
34
 
35
+ export interface ProcessingState {
36
+ status: "qr" | "processing" | "success" | "error";
37
+ resolve?: (value: BridgeReview) => void;
38
+ reject?: (error: Error) => void;
39
+ message?: string;
40
+ review: BridgeReview;
41
+ }
42
+
35
43
  export interface BridgeProps {
36
- hot: HotConnector;
44
+ kit: HotKit;
37
45
  widget?: boolean;
38
46
  onClose: () => void;
47
+ onStateUpdate?: (state: ProcessingState | null) => void;
39
48
  onProcess: (task: Promise<BridgeReview>) => void;
40
49
  onSelectPair?: (from: Token, to: Token) => void;
41
50
  setup?: {
@@ -54,12 +63,12 @@ export interface BridgeProps {
54
63
 
55
64
  const FIXED = 6;
56
65
 
57
- export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSelectPair }: BridgeProps) => {
58
- const [isFiat, setIsFiat] = useState(false);
66
+ export const Bridge = observer(({ kit, widget, setup, onClose, onProcess, onStateUpdate, onSelectPair }: BridgeProps) => {
59
67
  const [type, setType] = useState<"exactIn" | "exactOut">(setup?.type || "exactIn");
60
68
  const [from, setFrom] = useState<Token>(setup?.from || tokens.list.find((t) => t.id === localStorage.getItem("bridge:from")) || tokens.list.find((t) => t.symbol === "NEAR")!);
61
69
  const [to, setTo] = useState<Token>(setup?.to || tokens.list.find((t) => t.id === localStorage.getItem("bridge:to")) || tokens.list.find((t) => t.symbol === "USDT")!);
62
70
  const [value, setValue] = useState<string>(setup?.amount?.toFixed(6) ?? "");
71
+ const [isFiat, setIsFiat] = useState(false);
63
72
 
64
73
  const [review, setReview] = useState<BridgeReview | null>(null);
65
74
  const [isError, setIsError] = useState<string | null>(null);
@@ -71,13 +80,11 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
71
80
  fetch(animations.failed);
72
81
  });
73
82
 
74
- const [processing, setProcessing] = useState<{
75
- status: "qr" | "processing" | "success" | "error";
76
- resolve?: (value: BridgeReview) => void;
77
- reject?: (error: Error) => void;
78
- message: string;
79
- review: BridgeReview;
80
- } | null>(null);
83
+ const [processing, setProcessing] = useState<ProcessingState | null>(null);
84
+
85
+ useEffect(() => {
86
+ onStateUpdate?.(processing);
87
+ }, [processing]);
81
88
 
82
89
  useEffect(() => {
83
90
  onSelectPair?.(from, to);
@@ -85,19 +92,19 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
85
92
 
86
93
  const [sender, setSender] = useState<OmniWallet | "qr" | undefined>(() => {
87
94
  if (setup?.sender) return setup.sender;
88
- if (from.type === WalletType.OMNI) return hot.priorityWallet;
89
- return hot.wallets.find((w) => w.type === from.type);
95
+ if (from.type === WalletType.OMNI) return kit.priorityWallet;
96
+ return kit.wallets.find((w) => w.type === from.type);
90
97
  });
91
98
 
92
99
  useEffect(() => {
93
- if (from.type === WalletType.OMNI) setSender(hot.priorityWallet);
94
- if (to.type === WalletType.OMNI) setRecipient(Recipient.fromWallet(hot.priorityWallet!));
95
- }, [hot.priorityWallet]);
100
+ if (from.type === WalletType.OMNI) setSender(kit.priorityWallet);
101
+ if (to.type === WalletType.OMNI) setRecipient(Recipient.fromWallet(kit.priorityWallet!));
102
+ }, [kit.priorityWallet]);
96
103
 
97
104
  const [recipient, setRecipient] = useState<Recipient | undefined>(() => {
98
105
  if (setup?.recipient) return setup.recipient;
99
- if (to.type === WalletType.OMNI) return Recipient.fromWallet(hot.priorityWallet!);
100
- return Recipient.fromWallet(hot.wallets.find((w) => w.type === to.type)!);
106
+ if (to.type === WalletType.OMNI) return Recipient.fromWallet(kit.priorityWallet!);
107
+ return Recipient.fromWallet(kit.wallets.find((w) => w.type === to.type)!);
101
108
  });
102
109
 
103
110
  const initialSender = useRef<OmniWallet | "qr" | undefined>(sender);
@@ -110,7 +117,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
110
117
  const showAmountFrom = type === "exactOut" ? +from.float(review?.amountIn ?? 0).toFixed(FIXED) : formatter.fromInput(value);
111
118
  const showAmountTo = type === "exactIn" ? +to.float(review?.amountOut ?? 0).toFixed(FIXED) : formatter.fromInput(value);
112
119
 
113
- const availableBalance = sender !== "qr" ? +Math.max(0, from.float(hot.balance(sender, from)) - from.reserve).toFixed(FIXED) : 0;
120
+ const availableBalance = sender !== "qr" ? +Math.max(0, from.float(kit.balance(sender, from)) - from.reserve).toFixed(FIXED) : 0;
114
121
 
115
122
  let title = "Exchange";
116
123
  if (from.chain === Network.HotCraft || from.chain === Network.Omni) title = `Withdraw ${from.symbol}`;
@@ -124,15 +131,15 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
124
131
 
125
132
  useEffect(() => {
126
133
  if (initialSender.current == null) {
127
- if (from.type === WalletType.OMNI) setSender(hot.priorityWallet);
128
- else setSender(hot.wallets.find((w) => w.type === from.type));
134
+ if (from.type === WalletType.OMNI) setSender(kit.priorityWallet);
135
+ else setSender(kit.wallets.find((w) => w.type === from.type));
129
136
  }
130
137
 
131
138
  if (initialRecipient.current == null) {
132
- if (to.type === WalletType.OMNI) setRecipient(Recipient.fromWallet(hot.priorityWallet));
133
- else setRecipient(Recipient.fromWallet(hot.wallets.find((w) => w.type === to.type)));
139
+ if (to.type === WalletType.OMNI) setRecipient(Recipient.fromWallet(kit.priorityWallet));
140
+ else setRecipient(Recipient.fromWallet(kit.wallets.find((w) => w.type === to.type)));
134
141
  }
135
- }, [to, from, hot.wallets, hot.priorityWallet]);
142
+ }, [to, from, kit.wallets, kit.priorityWallet]);
136
143
 
137
144
  const reviewId = useRef(uuid4());
138
145
  const throwError = (message: string) => {
@@ -151,6 +158,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
151
158
  }, 3000);
152
159
  };
153
160
 
161
+ const refundWallet = sender !== "qr" ? sender : kit.priorityWallet;
154
162
  const reviewSwap = useCallback(() => {
155
163
  reviewId.current = uuid4();
156
164
  const currentReviewId = reviewId.current;
@@ -158,15 +166,13 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
158
166
  setReview(null);
159
167
  setIsError(null);
160
168
 
161
- const refund = sender !== "qr" ? sender : hot.priorityWallet;
162
169
  if (valueInTokens <= 0) return throwError("Enter amount");
163
-
164
170
  const debounceTimer = setTimeout(async () => {
165
171
  try {
166
172
  if (currentReviewId !== reviewId.current) return;
167
173
  const amount = type === "exactIn" ? from.int(valueInTokens) : to.int(valueInTokens);
168
- const recipientWallet = hot.wallets.find((w) => w.address === recipient?.address && w.type === recipient?.type) || recipient;
169
- const review = await hot.exchange.reviewSwap({ recipient: recipientWallet, slippage: 0.005, sender, refund, amount, type, from, to });
174
+ const recipientWallet = kit.wallets.find((w) => w.address === recipient?.address && w.type === recipient?.type) || recipient;
175
+ const review = await kit.exchange.reviewSwap({ recipient: recipientWallet, slippage: 0.005, sender, refund: refundWallet, amount, type, from, to });
170
176
  if (currentReviewId !== reviewId.current) return;
171
177
 
172
178
  if (amount > 0) {
@@ -187,7 +193,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
187
193
  }, 500);
188
194
 
189
195
  return () => clearTimeout(debounceTimer);
190
- }, [valueInTokens, type, from, to, sender, hot.exchange, recipient, hot.priorityWallet]);
196
+ }, [valueInTokens, type, from, to, sender, kit.exchange, recipient, kit.priorityWallet]);
191
197
 
192
198
  useEffect(() => {
193
199
  reviewSwap();
@@ -196,21 +202,17 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
196
202
  const process = async (review: BridgeReview) => {
197
203
  try {
198
204
  const log = (message: string) => setProcessing({ status: "processing", message, review });
199
- hot.exchange.bridge.logger = { log, warn: console.warn };
205
+ kit.exchange.bridge.logger = { log, warn: console.warn };
200
206
  log("Signing transaction");
201
207
 
202
208
  review.logger = { log };
203
- const result = await hot.exchange.makeSwap(review);
204
- let resultReview = result.review;
209
+ const pending = await kit.exchange.makeSwap(review);
205
210
 
206
- if (result.processing) {
207
- log("Waiting for transaction to be confirmed");
208
- resultReview = await result.processing();
209
- }
211
+ setProcessing({ status: "success", review: pending.review });
212
+ kit.activity.addBridgePending(pending);
210
213
 
211
- setProcessing({ status: "success", message: "Transaction signed", review: resultReview });
212
214
  if (setup?.autoClose) onClose();
213
- return resultReview;
215
+ return pending.review;
214
216
  } catch (e) {
215
217
  setProcessing({ status: "error", message: e?.toString?.() ?? "Unknown error", review });
216
218
  throw e;
@@ -245,6 +247,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
245
247
  return (
246
248
  <Popup widget={widget} onClose={onClose} header={<p>{title}</p>} mobileFullscreen={setup?.mobileFullscreen}>
247
249
  <DepositQR //
250
+ kit={kit}
248
251
  review={processing.review}
249
252
  onConfirm={() => onProcess(process(processing.review))}
250
253
  onCancel={cancelReview}
@@ -259,7 +262,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
259
262
  <div style={{ width: "100%", height: 400, display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column" }}>
260
263
  {/* @ts-expect-error: dotlottie-wc is not typed */}
261
264
  <dotlottie-wc key="loading" src={animations.loading} speed="1" style={{ width: 300, height: 300 }} mode="forward" loop autoplay></dotlottie-wc>
262
- <p style={{ marginTop: -32, fontSize: 16 }}>{processing.message}</p>
265
+ <H5 style={{ marginTop: -32 }}>{processing.message}</H5>
263
266
  </div>
264
267
  </Popup>
265
268
  );
@@ -271,7 +274,8 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
271
274
  <div style={{ width: "100%", height: 400, display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column" }}>
272
275
  {/* @ts-expect-error: dotlottie-wc is not typed */}
273
276
  <dotlottie-wc key="success" src={animations.success} speed="1" style={{ width: 300, height: 300 }} mode="forward" loop autoplay></dotlottie-wc>
274
- <p style={{ fontSize: 24, marginTop: -32, fontWeight: "bold" }}>{title} successful</p>
277
+ <H5 style={{ marginTop: -32 }}>{title} in progress</H5>
278
+ <PSmall style={{ marginTop: 8 }}>You can track your transaction in the activity</PSmall>
275
279
  </div>
276
280
  <ActionButton style={{ marginTop: "auto" }} onClick={() => (cancelReview(), onClose())}>
277
281
  Continue
@@ -286,19 +290,22 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
286
290
  <div style={{ width: "100%", height: 400, marginBottom: 8, gap: 8, display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column" }}>
287
291
  {/* @ts-expect-error: dotlottie-wc is not typed */}
288
292
  <dotlottie-wc key="error" src={animations.failed} speed="1" style={{ width: 300, height: 300 }} mode="forward" loop autoplay></dotlottie-wc>
289
- <p style={{ fontSize: 24, marginTop: -32, fontWeight: "bold" }}>{title} failed</p>
293
+ <H5 style={{ marginTop: -32 }}>{title} failed</H5>
290
294
  <TextField>{processing.message}</TextField>
291
295
  </div>
292
296
 
293
- <ActionButton onClick={() => (cancelReview(), onClose())}>Continue</ActionButton>
297
+ <ActionButton style={{ marginTop: "auto" }} onClick={() => (cancelReview(), onClose())}>
298
+ Continue
299
+ </ActionButton>
294
300
  </Popup>
295
301
  );
296
302
  }
297
303
 
298
304
  const button = () => {
305
+ if (refundWallet == null) return <ActionButton onClick={() => openConnector(kit)}>Sign in to HEX</ActionButton>;
299
306
  if (sender == null) return <ActionButton disabled>Confirm</ActionButton>;
300
307
  if (recipient == null) return <ActionButton disabled>Confirm</ActionButton>;
301
- if (sender !== "qr" && +from.float(hot.balance(sender, from)).toFixed(FIXED) < +amountFrom.toFixed(FIXED)) return <ActionButton disabled>Insufficient balance</ActionButton>;
308
+ if (sender !== "qr" && +from.float(kit.balance(sender, from)).toFixed(FIXED) < +amountFrom.toFixed(FIXED)) return <ActionButton disabled>Insufficient balance</ActionButton>;
302
309
  return (
303
310
  <ActionButton style={{ width: "100%", marginTop: 40 }} disabled={isReviewing || isError != null} onClick={handleConfirm}>
304
311
  {isReviewing ? "Quoting..." : isError != null ? isError : "Confirm"}
@@ -311,7 +318,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
311
318
  <div style={{ display: "flex", flexDirection: "column", gap: 4, width: "100%", height: "100%" }}>
312
319
  <Card style={{ borderRadius: "20px 20px 2px 2px" }}>
313
320
  <CardHeader>
314
- <ChainButton onClick={() => openSelectTokenPopup({ hot, onSelect: (token, wallet) => (setFrom(token), setSender(wallet)) })}>
321
+ <ChainButton onClick={() => openSelectTokenPopup({ kit, onSelect: (token, wallet) => (setFrom(token), setSender(wallet)) })}>
315
322
  <PSmall>From</PSmall>
316
323
  <ImageView src={chains.get(from.chain)?.logo || ""} alt={from.symbol} size={16} />
317
324
  <PSmall>{chains.get(from.chain)?.name}</PSmall>
@@ -320,13 +327,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
320
327
 
321
328
  <div style={{ display: "flex", alignItems: "center", gap: 8 }}>
322
329
  <PSmall>Sender:</PSmall>
323
-
324
- <BadgeButton
325
- onClick={() => {
326
- if (from.type === WalletType.OMNI) openSelectSender({ hot, type: from.type, onSelect: (sender) => setSender(sender) });
327
- else openWalletPicker(hot.getWalletConnector(from.type)!, (wallet) => setSender(wallet));
328
- }}
329
- >
330
+ <BadgeButton onClick={() => openSelectSender({ kit, type: from.type, onSelect: (sender) => setSender(sender) })}>
330
331
  <PSmall>{sender == null ? "Select" : sender !== "qr" ? formatter.truncateAddress(sender.address, 8) : "QR"}</PSmall>
331
332
  <Tooltip id="sender-tooltip">
332
333
  <PSmall>Select sender wallet</PSmall>
@@ -343,7 +344,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
343
344
  openSelectTokenPopup({
344
345
  onSelect: (token, wallet) => (setFrom(token), setSender(wallet)),
345
346
  initialChain: from.chain,
346
- hot,
347
+ kit,
347
348
  })
348
349
  }
349
350
  />
@@ -372,7 +373,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
372
373
  {sender !== "qr" && (
373
374
  <AvailableBalance>
374
375
  <PSmall>Balance: ${from.readable(availableBalance, from.usd)}</PSmall>
375
- <Button onClick={() => sender && hot.fetchToken(from, sender)}>
376
+ <Button onClick={() => sender && kit.fetchToken(from, sender)}>
376
377
  <RefreshIcon color="#fff" />
377
378
  </Button>
378
379
  </AvailableBalance>
@@ -403,7 +404,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
403
404
  {sender !== "qr" && (
404
405
  <AvailableBalance>
405
406
  <PSmall>Balance: {`${from.readable(availableBalance)} ${from.symbol}`}</PSmall>
406
- <Button style={{ marginTop: 2 }} onClick={() => sender && hot.fetchToken(from, sender)}>
407
+ <Button style={{ marginTop: 2 }} onClick={() => sender && kit.fetchToken(from, sender)}>
407
408
  <RefreshIcon color="#fff" />
408
409
  </Button>
409
410
  </AvailableBalance>
@@ -433,7 +434,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
433
434
  onClick={() => {
434
435
  setFrom(to);
435
436
  setTo(from);
436
- setSender(hot.wallets.find((w) => w.address === recipient?.address));
437
+ setSender(kit.wallets.find((w) => w.address === recipient?.address));
437
438
  setRecipient(sender === "qr" ? undefined : sender ? Recipient.fromWallet(sender) : undefined);
438
439
  setType(type === "exactIn" ? "exactOut" : "exactIn");
439
440
  setValue("");
@@ -445,7 +446,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
445
446
 
446
447
  <Card style={{ borderRadius: "2px 2px 20px 20px" }}>
447
448
  <CardHeader>
448
- <ChainButton onClick={() => openSelectTokenPopup({ hot, onSelect: (token, wallet) => (setTo(token), setRecipient(wallet)) })}>
449
+ <ChainButton onClick={() => openSelectTokenPopup({ kit, onSelect: (token, wallet) => (setTo(token), setRecipient(wallet)) })}>
449
450
  <PSmall>To</PSmall>
450
451
  <ImageView src={chains.get(to.chain)?.logo || ""} alt={to.symbol} size={16} />
451
452
  <PSmall>{chains.get(to.chain)?.name}</PSmall>
@@ -454,7 +455,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
454
455
 
455
456
  <div style={{ display: "flex", alignItems: "center", gap: 8 }}>
456
457
  <PSmall>Recipient:</PSmall>
457
- <BadgeButton onClick={() => openSelectRecipient({ hot, chain: to.chain, onSelect: (recipient) => setRecipient(recipient) })}>
458
+ <BadgeButton onClick={() => openSelectRecipient({ kit, chain: to.chain, onSelect: (recipient) => setRecipient(recipient) })}>
458
459
  <PSmall>{recipient == null ? "Select" : formatter.truncateAddress(recipient.address, 8)}</PSmall>
459
460
  <Tooltip id="recipient-tooltip">
460
461
  <PSmall>Select recipient wallet</PSmall>
@@ -469,7 +470,7 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
469
470
  token={to}
470
471
  onSelect={() =>
471
472
  openSelectTokenPopup({
472
- hot,
473
+ kit,
473
474
  initialChain: to.chain,
474
475
  onSelect: (token, wallet) => {
475
476
  setRecipient(wallet ? Recipient.fromWallet(wallet) : undefined);
@@ -521,7 +522,9 @@ const TokenPreview = ({ style, token, onSelect }: { style?: React.CSSProperties;
521
522
  };
522
523
 
523
524
  const TextField = styled(PTiny)`
524
- width: 100%;
525
+ max-width: 100%;
526
+ min-width: 300px;
527
+ min-height: 64px;
525
528
  overflow: auto;
526
529
  max-height: 200px;
527
530
  background: #2c2c2c;
@@ -12,19 +12,19 @@ import { PSmall } from "../uikit/text";
12
12
  import { ImageView } from "../uikit/image";
13
13
  import { ConnectorType, OmniConnector } from "../../core/OmniConnector";
14
14
  import { PopupOption, PopupOptionInfo } from "../styles";
15
- import { HotConnector } from "../../HotConnector";
15
+ import { HotKit } from "../../HotKit";
16
16
  import { openWalletPicker } from "../router";
17
17
  import Popup from "../Popup";
18
18
 
19
19
  interface SelectRecipientProps {
20
20
  chain: number;
21
- hot: HotConnector;
21
+ kit: HotKit;
22
22
  recipient?: Recipient;
23
23
  onSelect: (recipient?: Recipient) => void;
24
24
  onClose: () => void;
25
25
  }
26
26
 
27
- export const SelectRecipient = observer(({ recipient, hot, chain, onSelect, onClose }: SelectRecipientProps) => {
27
+ export const SelectRecipient = observer(({ recipient, kit, chain, onSelect, onClose }: SelectRecipientProps) => {
28
28
  const [customAddress, setCustomAddress] = useState<string>(recipient?.address || "");
29
29
  const type = chains.get(chain)?.type;
30
30
 
@@ -35,7 +35,7 @@ export const SelectRecipient = observer(({ recipient, hot, chain, onSelect, onCl
35
35
  </Popup>
36
36
  );
37
37
 
38
- const connectors = hot.connectors.filter((t) => t.walletTypes.includes(type) && t.type !== ConnectorType.SOCIAL);
38
+ const connectors = kit.connectors.filter((t) => t.walletTypes.includes(type) && t.type !== ConnectorType.SOCIAL);
39
39
  const isError = !Recipient.isValidAddress(chain, customAddress) && customAddress.length > 0;
40
40
 
41
41
  const selectCustom = async () => {
@@ -2,27 +2,27 @@ import { observer } from "mobx-react-lite";
2
2
 
3
3
  import { QRIcon } from "../icons/qr";
4
4
  import { ArrowRightIcon } from "../icons/arrow-right";
5
+ import { ImageView } from "../uikit/image";
6
+
7
+ import { HotKit } from "../../HotKit";
5
8
  import { PopupOption, PopupOptionInfo } from "../styles";
9
+ import { openWalletPicker } from "../router";
10
+ import Popup from "../Popup";
6
11
 
7
12
  import { ConnectorType, OmniConnector } from "../../core/OmniConnector";
8
- import { HotConnector } from "../../HotConnector";
9
13
  import { OmniWallet } from "../../core/OmniWallet";
10
- import { ImageView } from "../uikit/image";
11
-
12
14
  import { WalletType } from "../../core/chains";
13
15
  import { formatter } from "../../core/utils";
14
- import { openWalletPicker } from "../router";
15
- import Popup from "../Popup";
16
16
 
17
17
  interface SelectSenderProps {
18
18
  type: WalletType;
19
- hot: HotConnector;
19
+ kit: HotKit;
20
20
  onClose: () => void;
21
21
  onSelect: (wallet?: OmniWallet | "qr") => void;
22
22
  }
23
23
 
24
- export const SelectSender = observer(({ hot, type, onSelect, onClose }: SelectSenderProps) => {
25
- const connectors = hot.connectors.filter((t) => t.walletTypes.includes(type) && t.type !== ConnectorType.SOCIAL);
24
+ export const SelectSender = observer(({ kit, type, onSelect, onClose }: SelectSenderProps) => {
25
+ const connectors = kit.connectors.filter((t) => t.walletTypes.includes(type) && t.type !== ConnectorType.SOCIAL);
26
26
  const noExternal = type === WalletType.OMNI || type === WalletType.COSMOS;
27
27
 
28
28
  const selectWallet = async (t: OmniConnector) => {
@@ -2,7 +2,7 @@ import { useState } from "react";
2
2
  import { observer } from "mobx-react-lite";
3
3
  import styled from "styled-components";
4
4
 
5
- import { HotConnector } from "../../HotConnector";
5
+ import { HotKit } from "../../HotKit";
6
6
  import { OmniWallet } from "../../core/OmniWallet";
7
7
 
8
8
  import { Network, OmniToken } from "../../core/chains";
@@ -16,13 +16,13 @@ import { ImageView } from "../uikit/image";
16
16
  import { TokenCard } from "./TokenCard";
17
17
 
18
18
  interface SelectTokenPopupProps {
19
- hot: HotConnector;
19
+ kit: HotKit;
20
20
  initialChain?: number;
21
21
  onClose: () => void;
22
22
  onSelect: (token: Token, wallet?: OmniWallet) => void;
23
23
  }
24
24
 
25
- export const SelectTokenPopup = observer(({ hot, initialChain, onClose, onSelect }: SelectTokenPopupProps) => {
25
+ export const SelectTokenPopup = observer(({ kit, initialChain, onClose, onSelect }: SelectTokenPopupProps) => {
26
26
  const [chain, setChain] = useState<number | null>(initialChain || null);
27
27
  const [search, setSearch] = useState<string>("");
28
28
 
@@ -37,8 +37,8 @@ export const SelectTokenPopup = observer(({ hot, initialChain, onClose, onSelect
37
37
  balance: 0,
38
38
  };
39
39
 
40
- hot.wallets.forEach((wallet) => {
41
- const balance = hot.balance(wallet, token);
40
+ kit.wallets.forEach((wallet) => {
41
+ const balance = kit.balance(wallet, token);
42
42
  chains[token.chain].balance += token.float(balance) * token.usd;
43
43
  });
44
44
  });
@@ -75,15 +75,15 @@ export const SelectTokenPopup = observer(({ hot, initialChain, onClose, onSelect
75
75
  {tokens.list
76
76
  .filter((token) => token.chain === chain && token.symbol.toLowerCase().includes(search.toLowerCase()))
77
77
  .sort((a, b) => {
78
- const wallet = hot.wallets.find((w) => w.type === a.type)!;
79
- const aBalance = a.float(hot.balance(wallet, a)) * a.usd;
80
- const bBalance = b.float(hot.balance(wallet, b)) * b.usd;
78
+ const wallet = kit.wallets.find((w) => w.type === a.type)!;
79
+ const aBalance = a.float(kit.balance(wallet, a)) * a.usd;
80
+ const bBalance = b.float(kit.balance(wallet, b)) * b.usd;
81
81
  return bBalance - aBalance;
82
82
  })
83
83
  .map((token) => {
84
- const wallet = hot.wallets.find((w) => w.type === token.type);
84
+ const wallet = kit.wallets.find((w) => w.type === token.type);
85
85
  if (search && !token.symbol.toLowerCase().includes(search.toLowerCase())) return;
86
- return <TokenCard key={token.id} token={token} onSelect={onSelect} hot={hot} wallet={wallet} />;
86
+ return <TokenCard key={token.id} token={token} onSelect={onSelect} kit={kit} wallet={wallet} />;
87
87
  })}
88
88
  </Popup>
89
89
  );
@@ -93,7 +93,7 @@ export const SelectTokenPopup = observer(({ hot, initialChain, onClose, onSelect
93
93
  return (
94
94
  <Popup onClose={onClose} header={<p>Select token</p>}>
95
95
  <SearchInput type="text" placeholder="Search token" onChange={(e) => setSearch(e.target.value)} />
96
- {hot.walletsTokens
96
+ {kit.walletsTokens
97
97
  .filter(({ token, balance }) => {
98
98
  if (token.chain !== Network.Omni) return false;
99
99
  if (token.float(balance) < 0.0001) return false;
@@ -107,13 +107,13 @@ export const SelectTokenPopup = observer(({ hot, initialChain, onClose, onSelect
107
107
  return bBalance - aBalance;
108
108
  })
109
109
  .map(({ token, wallet }) => (
110
- <TokenCard key={token.id} token={token} onSelect={onSelect} hot={hot} wallet={wallet} />
110
+ <TokenCard key={token.id} token={token} onSelect={onSelect} kit={kit} wallet={wallet} />
111
111
  ))}
112
112
 
113
113
  {Object.values(OmniToken)
114
- .filter((token) => !used.has(token) && hot.omni(token).symbol.toLowerCase().includes(search.toLowerCase()))
114
+ .filter((token) => !used.has(token) && kit.omni(token).symbol.toLowerCase().includes(search.toLowerCase()))
115
115
  .map((token) => (
116
- <TokenCard key={token} token={hot.omni(token)} onSelect={onSelect} hot={hot} wallet={hot.priorityWallet} />
116
+ <TokenCard key={token} token={kit.omni(token)} onSelect={onSelect} kit={kit} wallet={kit.priorityWallet} />
117
117
  ))}
118
118
  </Popup>
119
119
  );
@@ -5,44 +5,51 @@ import { chains } from "../../core/chains";
5
5
  import { formatter } from "../../core/utils";
6
6
  import { Token } from "../../core/token";
7
7
 
8
- import { HotConnector } from "../../HotConnector";
8
+ import { HotKit } from "../../HotKit";
9
9
  import { OmniWallet } from "../../core/OmniWallet";
10
10
  import { ImageView } from "../uikit/image";
11
11
 
12
- export const TokenIcon = observer(({ token, wallet, withoutChain, size = 40 }: { token: Token; wallet?: OmniWallet; withoutChain?: boolean; size?: number }) => {
12
+ export const TokenIcon = observer(({ token, wallet, withoutChain, size = 40 }: { token: Token; wallet?: OmniWallet | "qr"; withoutChain?: boolean; size?: number }) => {
13
13
  return (
14
14
  <div style={{ position: "relative", width: size, height: size, flexShrink: 0 }}>
15
15
  <ImageView src={token.icon} alt={token.symbol} size={size} />
16
16
  {!withoutChain && <ImageView src={token.chainIcon} alt={token.symbol} size={size / 2 - 6} style={{ position: "absolute", bottom: 0, right: 0 }} />}
17
- {token.isOmni && wallet?.type && <ImageView src={wallet.icon} alt={chains.getByType(wallet.type)?.[0]?.name || ""} size={size / 2 - 6} style={{ position: "absolute", bottom: 0, left: 0 }} />}
17
+ {token.isOmni && wallet !== "qr" && wallet?.type && <ImageView src={wallet.icon} alt={chains.getByType(wallet.type)?.[0]?.name || ""} size={size / 2 - 6} style={{ position: "absolute", bottom: 0, left: 0 }} />}
18
18
  </div>
19
19
  );
20
20
  });
21
21
 
22
- export const TokenCard = observer(
23
- ({ token, onSelect, amount, hot, wallet, rightControl }: { rightControl?: React.ReactNode; token: Token; onSelect?: (token: Token, wallet?: OmniWallet) => void; amount?: bigint; hot: HotConnector; wallet?: OmniWallet }) => {
24
- const balance = amount || hot.balance(wallet, token);
25
- const symbol = token.isOmni && !token.isMainOmni ? `${token.symbol} (${token.originalChainSymbol})` : token.symbol;
22
+ interface TokenCardProps<T extends OmniWallet | "qr"> {
23
+ token: Token;
24
+ onSelect?: (token: Token, wallet?: T) => void;
25
+ amount?: bigint;
26
+ kit: HotKit;
27
+ wallet?: T;
28
+ rightControl?: React.ReactNode;
29
+ }
26
30
 
27
- return (
28
- <Card key={token.id} onClick={() => onSelect?.(token, wallet)}>
29
- <TokenIcon token={token} wallet={wallet} />
31
+ export const TokenCard = observer(<T extends OmniWallet | "qr">({ token, onSelect, amount, kit, wallet, rightControl }: TokenCardProps<T>) => {
32
+ const balance = amount || (wallet === "qr" ? 0n : kit.balance(wallet, token));
33
+ const symbol = token.isOmni && !token.isMainOmni ? `${token.symbol} (${token.originalChainSymbol})` : token.symbol;
30
34
 
31
- <TokenWrap>
32
- <Text style={{ textAlign: "left" }}>{symbol}</Text>
33
- <PSmall style={{ textAlign: "left" }}>${formatter.amount(token.usd)}</PSmall>
34
- </TokenWrap>
35
+ return (
36
+ <Card key={token.id} onClick={() => onSelect?.(token, wallet)}>
37
+ <TokenIcon token={token} wallet={wallet} />
35
38
 
36
- {rightControl || (
37
- <TokenWrap style={{ textAlign: "right", paddingRight: 4, marginLeft: "auto", alignItems: "flex-end" }}>
38
- <Text>{token.readable(balance)}</Text>
39
- <PSmall>${token.readable(balance, token.usd)}</PSmall>
40
- </TokenWrap>
41
- )}
42
- </Card>
43
- );
44
- }
45
- );
39
+ <TokenWrap>
40
+ <Text style={{ textAlign: "left" }}>{symbol}</Text>
41
+ <PSmall style={{ textAlign: "left" }}>${formatter.amount(token.usd)}</PSmall>
42
+ </TokenWrap>
43
+
44
+ {rightControl || (
45
+ <TokenWrap style={{ textAlign: "right", paddingRight: 4, marginLeft: "auto", alignItems: "flex-end" }}>
46
+ <Text>{token.readable(balance)}</Text>
47
+ <PSmall>${token.readable(balance, token.usd)}</PSmall>
48
+ </TokenWrap>
49
+ )}
50
+ </Card>
51
+ );
52
+ });
46
53
 
47
54
  const Card = styled.div`
48
55
  display: flex;
@@ -19,7 +19,7 @@ const Loader: React.FC = () => {
19
19
  );
20
20
  };
21
21
 
22
- const AuthIntentPopupComponent: React.FC<AuthIntentPopupProps> = ({ onApprove, onReject }) => {
22
+ export const AuthPopup: React.FC<AuthIntentPopupProps> = ({ onApprove, onReject }) => {
23
23
  const [loading, setLoading] = useState(false);
24
24
 
25
25
  const handleApprove = async () => {
@@ -53,26 +53,3 @@ const AuthIntentPopupComponent: React.FC<AuthIntentPopupProps> = ({ onApprove, o
53
53
  </Popup>
54
54
  );
55
55
  };
56
-
57
- export const openAuthPopup = <T,>(wallet: OmniWallet, then: () => Promise<T>) => {
58
- return new Promise<T>((resolve, reject) => {
59
- present((close) => {
60
- return (
61
- <AuthIntentPopupComponent
62
- wallet={wallet}
63
- onReject={() => (close(), reject())}
64
- onApprove={async () => {
65
- try {
66
- const result = await then();
67
- resolve(result);
68
- } catch (e) {
69
- reject(e);
70
- } finally {
71
- close();
72
- }
73
- }}
74
- />
75
- );
76
- });
77
- });
78
- };
@@ -1,7 +1,7 @@
1
1
  import { observer } from "mobx-react-lite";
2
2
 
3
3
  import { OmniWallet } from "../../core/OmniWallet";
4
- import { HotConnector } from "../../HotConnector";
4
+ import { HotKit } from "../../HotKit";
5
5
  import { ConnectorType, OmniConnector } from "../../core/OmniConnector";
6
6
 
7
7
  import { formatter } from "../../core/utils";
@@ -14,16 +14,16 @@ import { ImageView } from "../uikit/image";
14
14
  import Popup from "../Popup";
15
15
 
16
16
  interface MultichainPopupProps {
17
- hot: HotConnector;
17
+ kit: HotKit;
18
18
  onClose: (wallet?: OmniWallet) => void;
19
19
  title?: string;
20
20
  walletType?: WalletType;
21
21
  widget?: boolean;
22
22
  }
23
23
 
24
- export const Connector = observer(({ hot, onClose, title, walletType, widget }: MultichainPopupProps) => {
25
- const onechain = hot.connectors.filter((t) => t.type === ConnectorType.WALLET && (walletType == null || t.walletTypes.includes(walletType as WalletType)) && t.options.length > 0);
26
- const social = hot.connectors.filter((t) => t.type === ConnectorType.SOCIAL && (walletType == null || t.walletTypes.includes(walletType as WalletType)));
24
+ export const Connector = observer(({ kit, onClose, title, walletType, widget }: MultichainPopupProps) => {
25
+ const onechain = kit.connectors.filter((t) => t.type === ConnectorType.WALLET && (walletType == null || t.walletTypes.includes(walletType as WalletType)) && t.options.length > 0);
26
+ const social = kit.connectors.filter((t) => t.type === ConnectorType.SOCIAL && (walletType == null || t.walletTypes.includes(walletType as WalletType)));
27
27
 
28
28
  const selectConnector = async (t: OmniConnector) => {
29
29
  if (t.wallets[0]) return t.disconnect();