@hot-labs/kit 1.1.3 → 1.2.0-alpha.1

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 (327) hide show
  1. package/README.md +9 -2
  2. package/package.json +4 -8
  3. package/src/HotConnector.ts +31 -24
  4. package/src/OmniConnector.ts +9 -10
  5. package/src/OmniWallet.ts +25 -24
  6. package/src/core/Intents.ts +151 -224
  7. package/src/core/api.ts +4 -44
  8. package/src/core/bridge.ts +2 -3
  9. package/src/core/index.ts +1 -1
  10. package/src/{near/rpc.ts → core/nearRpc.ts} +12 -7
  11. package/src/core/types.ts +0 -21
  12. package/src/core/utils.ts +1 -17
  13. package/src/cosmos/connector.ts +26 -22
  14. package/src/cosmos/wallet.ts +8 -3
  15. package/src/evm/connector.ts +0 -5
  16. package/src/evm/wallet.ts +6 -9
  17. package/src/exchange.ts +30 -24
  18. package/src/hot-wallet/google.ts +5 -12
  19. package/src/hot-wallet/proxy.ts +2 -2
  20. package/src/index.ts +0 -2
  21. package/src/near/connector.ts +2 -2
  22. package/src/near/wallet.ts +9 -4
  23. package/src/solana/connector.ts +8 -9
  24. package/src/solana/injected/solana-wallet.ts +6 -6
  25. package/src/solana/{WalletStandard.ts → protocol.ts} +4 -2
  26. package/src/solana/wallet.ts +20 -11
  27. package/src/stellar/connector.ts +6 -1
  28. package/src/stellar/wallet.ts +17 -17
  29. package/src/ton/connector.ts +5 -1
  30. package/src/ton/wallet.ts +3 -3
  31. package/src/ui/Popup.tsx +4 -12
  32. package/src/ui/connect/AuthPopup.tsx +1 -2
  33. package/src/ui/connect/ConnectWallet.tsx +6 -12
  34. package/src/ui/icons/arrow-right.tsx +2 -2
  35. package/src/ui/icons/close.tsx +1 -1
  36. package/src/ui/icons/exchange.tsx +4 -4
  37. package/src/ui/icons/logout.tsx +6 -6
  38. package/src/ui/icons/pending.tsx +4 -2
  39. package/src/ui/icons/qr.tsx +2 -1
  40. package/src/ui/icons/search.tsx +4 -4
  41. package/src/ui/icons/switch.tsx +4 -4
  42. package/src/ui/icons/wallet.tsx +4 -2
  43. package/src/ui/payment/Bridge.tsx +6 -25
  44. package/src/ui/payment/Payment.tsx +46 -244
  45. package/src/ui/payment/Profile.tsx +8 -10
  46. package/src/ui/payment/SelectToken.tsx +1 -1
  47. package/src/ui/payment/TokenCard.tsx +18 -22
  48. package/src/ui/router.tsx +16 -56
  49. package/src/ui/styles.ts +0 -2
  50. package/build/HotConnector.d.ts +0 -105
  51. package/build/HotConnector.js +0 -303
  52. package/build/HotConnector.js.map +0 -1
  53. package/build/OmniConnector.d.ts +0 -90
  54. package/build/OmniConnector.js +0 -121
  55. package/build/OmniConnector.js.map +0 -1
  56. package/build/OmniWallet.d.ts +0 -35
  57. package/build/OmniWallet.js +0 -56
  58. package/build/OmniWallet.js.map +0 -1
  59. package/build/activity.d.ts +0 -18
  60. package/build/activity.js +0 -87
  61. package/build/activity.js.map +0 -1
  62. package/build/core/Intents.d.ts +0 -100
  63. package/build/core/Intents.js +0 -474
  64. package/build/core/Intents.js.map +0 -1
  65. package/build/core/api.d.ts +0 -54
  66. package/build/core/api.js +0 -99
  67. package/build/core/api.js.map +0 -1
  68. package/build/core/bridge.d.ts +0 -3
  69. package/build/core/bridge.js +0 -36
  70. package/build/core/bridge.js.map +0 -1
  71. package/build/core/chains.d.ts +0 -115
  72. package/build/core/chains.js +0 -381
  73. package/build/core/chains.js.map +0 -1
  74. package/build/core/defaultTokens.d.ts +0 -17
  75. package/build/core/defaultTokens.js +0 -1079
  76. package/build/core/defaultTokens.js.map +0 -1
  77. package/build/core/events.d.ts +0 -42
  78. package/build/core/events.js +0 -64
  79. package/build/core/events.js.map +0 -1
  80. package/build/core/index.d.ts +0 -10
  81. package/build/core/index.js +0 -11
  82. package/build/core/index.js.map +0 -1
  83. package/build/core/recipient.d.ts +0 -10
  84. package/build/core/recipient.js +0 -40
  85. package/build/core/recipient.js.map +0 -1
  86. package/build/core/telemetry.d.ts +0 -13
  87. package/build/core/telemetry.js +0 -27
  88. package/build/core/telemetry.js.map +0 -1
  89. package/build/core/token.d.ts +0 -36
  90. package/build/core/token.js +0 -103
  91. package/build/core/token.js.map +0 -1
  92. package/build/core/tokens.d.ts +0 -14
  93. package/build/core/tokens.js +0 -59
  94. package/build/core/tokens.js.map +0 -1
  95. package/build/core/types.d.ts +0 -60
  96. package/build/core/types.js +0 -2
  97. package/build/core/types.js.map +0 -1
  98. package/build/core/utils.d.ts +0 -25
  99. package/build/core/utils.js +0 -170
  100. package/build/core/utils.js.map +0 -1
  101. package/build/cosmos/connector.d.ts +0 -36
  102. package/build/cosmos/connector.js +0 -211
  103. package/build/cosmos/connector.js.map +0 -1
  104. package/build/cosmos/helpers.d.ts +0 -2
  105. package/build/cosmos/helpers.js +0 -29
  106. package/build/cosmos/helpers.js.map +0 -1
  107. package/build/cosmos/index.d.ts +0 -6
  108. package/build/cosmos/index.js +0 -5
  109. package/build/cosmos/index.js.map +0 -1
  110. package/build/cosmos/wallet.d.ts +0 -26
  111. package/build/cosmos/wallet.js +0 -51
  112. package/build/cosmos/wallet.js.map +0 -1
  113. package/build/defaults.d.ts +0 -1
  114. package/build/defaults.js +0 -7
  115. package/build/defaults.js.map +0 -1
  116. package/build/evm/abi.d.ts +0 -17
  117. package/build/evm/abi.js +0 -38
  118. package/build/evm/abi.js.map +0 -1
  119. package/build/evm/connector.d.ts +0 -29
  120. package/build/evm/connector.js +0 -118
  121. package/build/evm/connector.js.map +0 -1
  122. package/build/evm/index.d.ts +0 -6
  123. package/build/evm/index.js +0 -5
  124. package/build/evm/index.js.map +0 -1
  125. package/build/evm/injected.d.ts +0 -1
  126. package/build/evm/injected.js +0 -33
  127. package/build/evm/injected.js.map +0 -1
  128. package/build/evm/wallet.d.ts +0 -42
  129. package/build/evm/wallet.js +0 -130
  130. package/build/evm/wallet.js.map +0 -1
  131. package/build/exchange.d.ts +0 -68
  132. package/build/exchange.js +0 -384
  133. package/build/exchange.js.map +0 -1
  134. package/build/hot-wallet/google.d.ts +0 -25
  135. package/build/hot-wallet/google.js +0 -117
  136. package/build/hot-wallet/google.js.map +0 -1
  137. package/build/hot-wallet/iframe.d.ts +0 -36
  138. package/build/hot-wallet/iframe.js +0 -140
  139. package/build/hot-wallet/iframe.js.map +0 -1
  140. package/build/hot-wallet/index.d.ts +0 -5
  141. package/build/hot-wallet/index.js +0 -4
  142. package/build/hot-wallet/index.js.map +0 -1
  143. package/build/hot-wallet/proxy.d.ts +0 -8
  144. package/build/hot-wallet/proxy.js +0 -45
  145. package/build/hot-wallet/proxy.js.map +0 -1
  146. package/build/index.d.ts +0 -6
  147. package/build/index.js +0 -7
  148. package/build/index.js.map +0 -1
  149. package/build/near/connector.d.ts +0 -18
  150. package/build/near/connector.js +0 -58
  151. package/build/near/connector.js.map +0 -1
  152. package/build/near/index.d.ts +0 -7
  153. package/build/near/index.js +0 -5
  154. package/build/near/index.js.map +0 -1
  155. package/build/near/rpc.d.ts +0 -23
  156. package/build/near/rpc.js +0 -162
  157. package/build/near/rpc.js.map +0 -1
  158. package/build/near/wallet.d.ts +0 -53
  159. package/build/near/wallet.js +0 -190
  160. package/build/near/wallet.js.map +0 -1
  161. package/build/solana/WalletStandard.d.ts +0 -25
  162. package/build/solana/WalletStandard.js +0 -56
  163. package/build/solana/WalletStandard.js.map +0 -1
  164. package/build/solana/connector.d.ts +0 -30
  165. package/build/solana/connector.js +0 -139
  166. package/build/solana/connector.js.map +0 -1
  167. package/build/solana/index.d.ts +0 -6
  168. package/build/solana/index.js +0 -5
  169. package/build/solana/index.js.map +0 -1
  170. package/build/solana/injected/account.d.ts +0 -11
  171. package/build/solana/injected/account.js +0 -41
  172. package/build/solana/injected/account.js.map +0 -1
  173. package/build/solana/injected/index.d.ts +0 -1
  174. package/build/solana/injected/index.js +0 -82
  175. package/build/solana/injected/index.js.map +0 -1
  176. package/build/solana/injected/register.d.ts +0 -2
  177. package/build/solana/injected/register.js +0 -41
  178. package/build/solana/injected/register.js.map +0 -1
  179. package/build/solana/injected/solana-wallet.d.ts +0 -34
  180. package/build/solana/injected/solana-wallet.js +0 -223
  181. package/build/solana/injected/solana-wallet.js.map +0 -1
  182. package/build/solana/injected/utils.d.ts +0 -32
  183. package/build/solana/injected/utils.js +0 -36
  184. package/build/solana/injected/utils.js.map +0 -1
  185. package/build/solana/wallet.d.ts +0 -40
  186. package/build/solana/wallet.js +0 -181
  187. package/build/solana/wallet.js.map +0 -1
  188. package/build/solana/walletStandartList.d.ts +0 -102
  189. package/build/solana/walletStandartList.js +0 -150
  190. package/build/solana/walletStandartList.js.map +0 -1
  191. package/build/stellar/connector.d.ts +0 -29
  192. package/build/stellar/connector.js +0 -64
  193. package/build/stellar/connector.js.map +0 -1
  194. package/build/stellar/freigher.d.ts +0 -46
  195. package/build/stellar/freigher.js +0 -110
  196. package/build/stellar/freigher.js.map +0 -1
  197. package/build/stellar/hotWallet.d.ts +0 -33
  198. package/build/stellar/hotWallet.js +0 -28
  199. package/build/stellar/hotWallet.js.map +0 -1
  200. package/build/stellar/index.d.ts +0 -6
  201. package/build/stellar/index.js +0 -5
  202. package/build/stellar/index.js.map +0 -1
  203. package/build/stellar/wallet.d.ts +0 -67
  204. package/build/stellar/wallet.js +0 -212
  205. package/build/stellar/wallet.js.map +0 -1
  206. package/build/storage.d.ts +0 -10
  207. package/build/storage.js +0 -12
  208. package/build/storage.js.map +0 -1
  209. package/build/ton/connector.d.ts +0 -24
  210. package/build/ton/connector.js +0 -111
  211. package/build/ton/connector.js.map +0 -1
  212. package/build/ton/index.d.ts +0 -7
  213. package/build/ton/index.js +0 -5
  214. package/build/ton/index.js.map +0 -1
  215. package/build/ton/injected.d.ts +0 -1
  216. package/build/ton/injected.js +0 -49
  217. package/build/ton/injected.js.map +0 -1
  218. package/build/ton/utils.d.ts +0 -45
  219. package/build/ton/utils.js +0 -63
  220. package/build/ton/utils.js.map +0 -1
  221. package/build/ton/wallet.d.ts +0 -54
  222. package/build/ton/wallet.js +0 -138
  223. package/build/ton/wallet.js.map +0 -1
  224. package/build/tron/connector.d.ts +0 -51
  225. package/build/tron/connector.js +0 -65
  226. package/build/tron/connector.js.map +0 -1
  227. package/build/tron/index.d.ts +0 -6
  228. package/build/tron/index.js +0 -5
  229. package/build/tron/index.js.map +0 -1
  230. package/build/tron/wallet.d.ts +0 -52
  231. package/build/tron/wallet.js +0 -122
  232. package/build/tron/wallet.js.map +0 -1
  233. package/build/ui/Popup.d.ts +0 -12
  234. package/build/ui/Popup.js +0 -43
  235. package/build/ui/Popup.js.map +0 -1
  236. package/build/ui/Toast.d.ts +0 -4
  237. package/build/ui/Toast.js +0 -33
  238. package/build/ui/Toast.js.map +0 -1
  239. package/build/ui/connect/AuthPopup.d.ts +0 -2
  240. package/build/ui/connect/AuthPopup.js +0 -48
  241. package/build/ui/connect/AuthPopup.js.map +0 -1
  242. package/build/ui/connect/ConnectWallet.d.ts +0 -14
  243. package/build/ui/connect/ConnectWallet.js +0 -22
  244. package/build/ui/connect/ConnectWallet.js.map +0 -1
  245. package/build/ui/connect/LogoutPopup.d.ts +0 -10
  246. package/build/ui/connect/LogoutPopup.js +0 -8
  247. package/build/ui/connect/LogoutPopup.js.map +0 -1
  248. package/build/ui/connect/PrimaryWallet.d.ts +0 -6
  249. package/build/ui/connect/PrimaryWallet.js +0 -18
  250. package/build/ui/connect/PrimaryWallet.js.map +0 -1
  251. package/build/ui/connect/WCPopup.d.ts +0 -13
  252. package/build/ui/connect/WCPopup.js +0 -81
  253. package/build/ui/connect/WCPopup.js.map +0 -1
  254. package/build/ui/connect/WCRequest.d.ts +0 -9
  255. package/build/ui/connect/WCRequest.js +0 -13
  256. package/build/ui/connect/WCRequest.js.map +0 -1
  257. package/build/ui/connect/WalletPicker.d.ts +0 -11
  258. package/build/ui/connect/WalletPicker.js +0 -48
  259. package/build/ui/connect/WalletPicker.js.map +0 -1
  260. package/build/ui/icons/arrow-right.d.ts +0 -1
  261. package/build/ui/icons/arrow-right.js +0 -5
  262. package/build/ui/icons/arrow-right.js.map +0 -1
  263. package/build/ui/icons/close.d.ts +0 -1
  264. package/build/ui/icons/close.js +0 -5
  265. package/build/ui/icons/close.js.map +0 -1
  266. package/build/ui/icons/exchange.d.ts +0 -6
  267. package/build/ui/icons/exchange.js +0 -6
  268. package/build/ui/icons/exchange.js.map +0 -1
  269. package/build/ui/icons/logout.d.ts +0 -1
  270. package/build/ui/icons/logout.js +0 -3
  271. package/build/ui/icons/logout.js.map +0 -1
  272. package/build/ui/icons/pending.d.ts +0 -1
  273. package/build/ui/icons/pending.js +0 -5
  274. package/build/ui/icons/pending.js.map +0 -1
  275. package/build/ui/icons/qr.d.ts +0 -1
  276. package/build/ui/icons/qr.js +0 -5
  277. package/build/ui/icons/qr.js.map +0 -1
  278. package/build/ui/icons/search.d.ts +0 -1
  279. package/build/ui/icons/search.js +0 -5
  280. package/build/ui/icons/search.js.map +0 -1
  281. package/build/ui/icons/switch.d.ts +0 -1
  282. package/build/ui/icons/switch.js +0 -5
  283. package/build/ui/icons/switch.js.map +0 -1
  284. package/build/ui/icons/wallet.d.ts +0 -1
  285. package/build/ui/icons/wallet.js +0 -5
  286. package/build/ui/icons/wallet.js.map +0 -1
  287. package/build/ui/payment/Bridge.d.ts +0 -29
  288. package/build/ui/payment/Bridge.js +0 -373
  289. package/build/ui/payment/Bridge.js.map +0 -1
  290. package/build/ui/payment/DepositQR.d.ts +0 -9
  291. package/build/ui/payment/DepositQR.js +0 -56
  292. package/build/ui/payment/DepositQR.js.map +0 -1
  293. package/build/ui/payment/Payment.d.ts +0 -23
  294. package/build/ui/payment/Payment.js +0 -139
  295. package/build/ui/payment/Payment.js.map +0 -1
  296. package/build/ui/payment/Profile.d.ts +0 -8
  297. package/build/ui/payment/Profile.js +0 -110
  298. package/build/ui/payment/Profile.js.map +0 -1
  299. package/build/ui/payment/SelectRecipient.d.ts +0 -14
  300. package/build/ui/payment/SelectRecipient.js +0 -68
  301. package/build/ui/payment/SelectRecipient.js.map +0 -1
  302. package/build/ui/payment/SelectSender.d.ts +0 -13
  303. package/build/ui/payment/SelectSender.js +0 -23
  304. package/build/ui/payment/SelectSender.js.map +0 -1
  305. package/build/ui/payment/SelectToken.d.ts +0 -13
  306. package/build/ui/payment/SelectToken.js +0 -92
  307. package/build/ui/payment/SelectToken.js.map +0 -1
  308. package/build/ui/payment/Stepper.d.ts +0 -13
  309. package/build/ui/payment/Stepper.js +0 -22
  310. package/build/ui/payment/Stepper.js.map +0 -1
  311. package/build/ui/payment/TokenCard.d.ts +0 -25
  312. package/build/ui/payment/TokenCard.js +0 -63
  313. package/build/ui/payment/TokenCard.js.map +0 -1
  314. package/build/ui/router.d.ts +0 -51
  315. package/build/ui/router.js +0 -68
  316. package/build/ui/router.js.map +0 -1
  317. package/build/ui/styles.d.ts +0 -13
  318. package/build/ui/styles.js +0 -290
  319. package/build/ui/styles.js.map +0 -1
  320. package/src/core/telemetry.ts +0 -28
  321. package/src/tron/connector.ts +0 -89
  322. package/src/tron/index.ts +0 -7
  323. package/src/tron/wallet.ts +0 -146
  324. package/src/ui/Toast.tsx +0 -45
  325. package/src/ui/connect/PrimaryWallet.tsx +0 -65
  326. package/src/ui/payment/Stepper.tsx +0 -50
  327. /package/src/solana/{walletStandartList.ts → wallets.ts} +0 -0
@@ -1,277 +1,79 @@
1
1
  import { observer } from "mobx-react-lite";
2
- import { useEffect, useState } from "react";
2
+ import { useEffect } from "react";
3
3
 
4
- import { WalletIcon } from "../icons/wallet";
5
- import { PopupButton, PopupOption, PopupOptionInfo } from "../styles";
6
- import { Commitment, Intents } from "../../core";
4
+ import { HotConnector } from "../../HotConnector";
5
+ import { openBridge, openConnector } from "../router";
7
6
  import { Recipient } from "../../core/recipient";
8
- import { Token } from "../../core/token";
9
-
10
7
  import { BridgeReview } from "../../exchange";
11
- import { openConnector } from "../router";
12
-
13
8
  import { OmniWallet } from "../../OmniWallet";
14
- import { HotConnector } from "../../HotConnector";
9
+ import { Network } from "../../core/chains";
10
+ import { Token } from "../../core/token";
15
11
  import Popup from "../Popup";
16
12
 
17
13
  import { TokenCard } from "./TokenCard";
18
- import { HorizontalStepper } from "./Stepper";
19
- import { Loader } from "./Profile";
14
+ import { PopupOption, PopupOptionInfo } from "../styles";
15
+ import { WalletIcon } from "../icons/wallet";
20
16
 
21
17
  interface PaymentProps {
22
- intents: Intents;
23
- title?: string;
24
- allowedTokens?: string[];
25
- prepaidAmount: bigint;
26
- payableToken: Token;
27
- needAmount: bigint;
28
18
  connector: HotConnector;
29
- onReject: (message: string) => void;
30
- onConfirm: (args: { depositQoute?: BridgeReview; processing?: () => Promise<BridgeReview> }) => Promise<void>;
31
- close: () => void;
19
+ token: Token;
20
+ amount: bigint;
21
+ recipient?: Recipient;
22
+ onClose: () => void;
23
+ onProcess: (task: Promise<BridgeReview>) => void;
32
24
  }
33
25
 
34
- const animations = {
35
- success: "https://hex.exchange/success.json",
36
- failed: "https://hex.exchange/error.json",
37
- loading: "https://hex.exchange/loading.json",
38
- };
39
-
40
- const PAY_SLIPPAGE = 0.002;
41
-
42
- const serializeError = (error: any) => {
43
- try {
44
- if (error instanceof Error) return error.message;
45
- if (typeof error === "object" && Object.keys(error).length > 0) return JSON.stringify(error);
46
- if (typeof error === "string" || typeof error === "number") return error.toString();
47
- return "";
48
- } catch (error) {
49
- return "Unknown error";
50
- }
51
- };
52
-
53
- export const Payment = observer(({ connector, intents, title = "Payment", allowedTokens, prepaidAmount, payableToken, needAmount, onReject, onConfirm, close }: PaymentProps) => {
54
- useState(() => {
55
- fetch(animations.loading);
56
- fetch(animations.success);
57
- fetch(animations.failed);
58
- });
59
-
60
- useEffect(() => {
61
- if (connector.wallets.length !== 0) return;
62
- openConnector(connector);
63
- }, [connector.wallets.length]);
64
-
65
- const [flow, setFlow] = useState<{
66
- token?: Token;
67
- wallet?: OmniWallet;
68
- commitment?: Commitment;
69
- review?: BridgeReview;
70
- success?: { depositQoute?: BridgeReview; processing?: () => Promise<BridgeReview> };
71
- step?: "selectToken" | "sign" | "transfer" | "success" | "error" | "loading";
72
- loading?: boolean;
73
- error?: any;
74
- } | null>(needAmount === 0n ? { step: "transfer" } : null);
75
-
76
- const paymentTitle = title || `Pay ${payableToken.readable(needAmount)} ${payableToken.symbol}`;
77
-
26
+ export const Payment = observer(({ connector, recipient, token: need, amount: needAmount, onProcess, onClose }: PaymentProps) => {
27
+ const title = `Need ${need.readable(needAmount)} ${need.symbol}`;
78
28
  const selectToken = async (from: Token, wallet?: OmniWallet) => {
79
- if (!wallet) return;
80
-
81
- try {
82
- setFlow({ token: from, wallet, review: undefined, step: "sign" });
83
- const review = await connector.exchange.reviewSwap({
84
- recipient: Recipient.fromWallet(intents.signer)!,
85
- amount: needAmount + (needAmount * BigInt(Math.floor(PAY_SLIPPAGE * 1000))) / BigInt(1000),
86
- slippage: PAY_SLIPPAGE,
29
+ onProcess(
30
+ openBridge(connector, {
87
31
  sender: wallet,
88
- refund: wallet,
32
+ autoClose: true,
89
33
  type: "exactOut",
90
- to: payableToken,
91
- from,
92
- });
93
-
94
- setFlow({ token: from, wallet, review, step: "sign" });
95
- } catch {
96
- setFlow({ token: from, wallet, error: true, step: "sign" });
97
- }
98
- };
99
-
100
- const signStep = async () => {
101
- try {
102
- setFlow((t) => (t ? { ...t, step: "sign", loading: true } : null));
103
- await intents.sign();
104
- setFlow((t) => (t ? { ...t, step: "transfer", loading: false } : null));
105
- } catch (error) {
106
- console.error(error);
107
- setFlow((t) => (t ? { ...t, step: "error", loading: false, error } : null));
108
- throw error;
109
- }
110
- };
111
-
112
- const confirmPaymentStep = async () => {
113
- try {
114
- setFlow((t) => (t ? { ...t, step: "loading" } : null));
115
-
116
- if (flow?.review == null) {
117
- await intents.sign();
118
- await onConfirm({});
119
- setFlow({ loading: false, step: "success" });
120
- setTimeout(() => close(), 2000);
121
- return;
122
- }
123
-
124
- const result = await connector.exchange.makeSwap(flow.review, { log: () => {} });
125
- await onConfirm({ depositQoute: result.review, processing: result.processing });
126
- setFlow({ loading: false, step: "success" });
127
- setTimeout(() => close(), 2000);
128
- } catch (error) {
129
- console.error(error);
130
- setFlow((t) => (t ? { ...t, step: "error", loading: false, error } : null));
131
- throw error;
132
- }
133
- };
134
-
135
- if (flow?.step === "success") {
136
- return (
137
- <Popup header={<p>{paymentTitle}</p>}>
138
- <div style={{ width: "100%", height: 400, display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column" }}>
139
- {/* @ts-expect-error: dotlottie-wc is not typed */}
140
- <dotlottie-wc key="success" src={animations.success} speed="1" style={{ width: 300, height: 300 }} mode="forward" loop autoplay></dotlottie-wc>
141
- <p style={{ fontSize: 24, marginTop: -32, fontWeight: "bold" }}>Transaction successful</p>
142
- </div>
143
- <PopupButton style={{ marginTop: "auto" }} onClick={() => close()}>
144
- Continue
145
- </PopupButton>
146
- </Popup>
34
+ recipient: recipient || Recipient.fromWallet(connector.priorityWallet!),
35
+ readonlyTo: recipient ? true : false,
36
+ amount: need.float(needAmount),
37
+ readonlyAmount: true,
38
+ title: title,
39
+ from: from,
40
+ to: need,
41
+ })
147
42
  );
148
- }
149
-
150
- if (flow?.step === "loading") {
151
- return (
152
- <Popup header={<p>{paymentTitle}</p>}>
153
- <div style={{ width: "100%", height: 400, display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column" }}>
154
- {/* @ts-expect-error: dotlottie-wc is not typed */}
155
- <dotlottie-wc key="loading" src={animations.loading} speed="1" style={{ marginTop: -64, width: 300, height: 300 }} mode="forward" loop autoplay></dotlottie-wc>
156
- <p style={{ fontSize: 24, marginTop: -16, fontWeight: "bold" }}>Transaction processing</p>
157
- </div>
158
- </Popup>
159
- );
160
- }
161
-
162
- if (flow?.step === "error") {
163
- return (
164
- <Popup header={<p>{paymentTitle}</p>}>
165
- <div style={{ width: "100%", height: 400, gap: 8, display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column" }}>
166
- {/* @ts-expect-error: dotlottie-wc is not typed */}
167
- <dotlottie-wc key="error" src={animations.failed} speed="1" style={{ width: 300, height: 300 }} mode="forward" loop autoplay></dotlottie-wc>
168
- <p style={{ fontSize: 24, marginTop: -32, fontWeight: "bold" }}>Transaction failed</p>
169
- <p style={{ fontSize: 14, width: "80%", textAlign: "center", overflowY: "auto", lineBreak: "anywhere" }}>{serializeError(flow.error)}</p>
170
- </div>
171
- <PopupButton onClick={() => onReject(serializeError(flow.error))}>Close</PopupButton>
172
- </Popup>
173
- );
174
- }
175
-
176
- if (flow?.step === "transfer") {
177
- return (
178
- <Popup onClose={() => onReject("closed")} header={<p>{paymentTitle}</p>}>
179
- <HorizontalStepper steps={[{ label: "Select" }, { label: "Review" }, { label: "Confirm" }]} currentStep={2} />
180
-
181
- {prepaidAmount > 0n && <TokenCard token={payableToken} hot={connector} wallet={intents.signer} amount={prepaidAmount} />}
182
-
183
- {flow.token != null && (
184
- <TokenCard //
185
- hot={connector}
186
- token={flow.token}
187
- wallet={flow.wallet}
188
- amount={flow.review == null ? needAmount : flow.review?.amountIn ?? 0n}
189
- />
190
- )}
191
-
192
- <PopupButton style={{ marginTop: 24 }} onClick={confirmPaymentStep}>
193
- {flow?.loading ? "Confirming..." : "Confirm transaction"}
194
- </PopupButton>
195
- </Popup>
196
- );
197
- }
198
-
199
- if (flow?.step === "sign") {
200
- const rightControl = <div style={{ paddingRight: 4, marginLeft: "auto", alignItems: "flex-end" }}>{flow.error ? <ErrorIcon /> : <Loader />}</div>;
201
-
202
- return (
203
- <Popup onClose={() => onReject("closed")} header={<p>{title}</p>}>
204
- <HorizontalStepper steps={[{ label: "Select" }, { label: "Review" }, { label: "Confirm" }]} currentStep={1} />
205
-
206
- {prepaidAmount > 0n && <TokenCard token={payableToken} hot={connector} wallet={intents.signer} amount={prepaidAmount} />}
207
-
208
- {flow.token != null && (
209
- <TokenCard //
210
- hot={connector}
211
- token={flow.token}
212
- wallet={flow.wallet}
213
- rightControl={flow.review ? undefined : rightControl}
214
- amount={flow.review == null ? needAmount : flow.review?.amountIn ?? 0n}
215
- />
216
- )}
217
-
218
- {flow.error ? (
219
- <PopupButton style={{ marginTop: 24 }} onClick={() => setFlow(null)}>
220
- Select another token
221
- </PopupButton>
222
- ) : (
223
- <PopupButton style={{ marginTop: 24 }} disabled={!flow?.review} onClick={signStep}>
224
- {flow?.loading ? "Signing..." : flow?.review ? "Sign review" : "Quoting..."}
225
- </PopupButton>
226
- )}
227
- </Popup>
228
- );
229
- }
230
-
231
- const recommendedTokens = connector.walletsTokens.filter((t) => t.token.symbol === "USDT" || t.token.symbol === "USDC");
232
- const otherTokens = connector.walletsTokens.filter((t) => t.token.symbol !== "USDT" && t.token.symbol !== "USDC");
233
-
234
- const renderToken = (token: Token, wallet: OmniWallet, balance: bigint) => {
235
- if (token.id === payableToken.id) return null;
236
- const availableBalance = token.float(balance) - token.reserve;
43
+ };
237
44
 
238
- // Allow only tokens in the allowedTokens list
239
- if (allowedTokens != null && !allowedTokens?.includes(token.omniAddress)) return null;
45
+ useEffect(() => {
46
+ if (connector.wallets.length !== 0) return;
47
+ openConnector(connector);
48
+ }, [connector.wallets.length, connector]);
240
49
 
241
- // same token as need and enough balance is direct deposit
242
- if (token.originalChain === payableToken.originalChain && token.originalAddress === payableToken.originalAddress && availableBalance >= payableToken.float(needAmount)) {
243
- return <TokenCard key={token.id} token={token} onSelect={selectToken} hot={connector} wallet={wallet} />;
244
- }
50
+ return (
51
+ <Popup onClose={onClose} header={<p>{title}</p>}>
52
+ {connector.walletsTokens.map(({ token, wallet, balance }) => {
53
+ if (token.id === need.id) return null;
54
+ const availableBalance = token.float(balance) - token.reserve;
245
55
 
246
- if (availableBalance * token.usd <= payableToken.usd * payableToken.float(needAmount) * (1 + PAY_SLIPPAGE)) return null;
247
- return <TokenCard key={token.id} token={token} onSelect={selectToken} hot={connector} wallet={wallet} />;
248
- };
56
+ if (need.originalChain === Network.Gonka || need.originalChain === Network.Juno) {
57
+ if (token.id === need.id) return null;
58
+ if (token.originalAddress !== need.originalAddress) return null;
249
59
 
250
- return (
251
- <Popup onClose={() => onReject("closed")} header={<p>{title}</p>}>
252
- <HorizontalStepper steps={[{ label: "Select" }, { label: "Review" }, { label: "Confirm" }]} currentStep={0} />
60
+ if (availableBalance < need.float(needAmount)) return null;
61
+ return <TokenCard key={token.id} token={token} onSelect={selectToken} hot={connector} wallet={wallet} />;
62
+ }
253
63
 
254
- {recommendedTokens.map(({ token, wallet, balance }) => renderToken(token, wallet, balance))}
255
- {otherTokens.map(({ token, wallet, balance }) => renderToken(token, wallet, balance))}
64
+ if (availableBalance * token.usd <= need.usd * need.float(needAmount)) return null;
65
+ return <TokenCard key={token.id} token={token} onSelect={selectToken} hot={connector} wallet={wallet} />;
66
+ })}
256
67
 
257
68
  <PopupOption onClick={() => openConnector(connector)}>
258
69
  <div style={{ width: 44, height: 44, borderRadius: 16, background: "#000", display: "flex", alignItems: "center", justifyContent: "center" }}>
259
70
  <WalletIcon />
260
71
  </div>
261
72
  <PopupOptionInfo>
262
- <p>Don't find the right token?</p>
263
- <span className="wallet-address">Connect another wallet</span>
73
+ <p>Connect wallet</p>
74
+ <span className="wallet-address">To more pay options</span>
264
75
  </PopupOptionInfo>
265
76
  </PopupOption>
266
77
  </Popup>
267
78
  );
268
79
  });
269
-
270
- const ErrorIcon = () => {
271
- return (
272
- <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" aria-label="Failed" style={{ display: "block", margin: "0 auto" }}>
273
- <circle cx="14" cy="14" r="13" stroke="#E74C3C" strokeWidth="2" />
274
- <path d="M9 9l10 10M19 9l-10 10" stroke="#E74C3C" strokeWidth="2.5" strokeLinecap="round" />
275
- </svg>
276
- );
277
- };
@@ -1,6 +1,6 @@
1
1
  import { observer } from "mobx-react-lite";
2
2
  import styled from "styled-components";
3
- import { useEffect } from "react";
3
+ import { useEffect, useState } from "react";
4
4
 
5
5
  import { LogoutIcon } from "../icons/logout";
6
6
  import { openBridge, openConnector } from "../router";
@@ -72,15 +72,13 @@ export const Profile = observer(({ hot, onClose }: { hot: HotConnector; onClose:
72
72
  return (
73
73
  <Popup onClose={onClose}>
74
74
  <div style={{ display: "flex", flexWrap: "wrap", width: "100%", gap: 8 }}>
75
- {hot.connectors.map((connector) =>
76
- connector.wallets.map((wallet) => (
77
- <WalletCard onClick={() => connector.disconnect()}>
78
- <ImageView src={wallet.icon} alt={connector.name} size={20} />
79
- <div>{formatter.truncateAddress(wallet.address, 8)}</div>
80
- <LogoutIcon width={20} height={20} />
81
- </WalletCard>
82
- ))
83
- )}
75
+ {hot.wallets.map((wallet) => (
76
+ <WalletCard onClick={() => wallet.disconnect()}>
77
+ <ImageView src={wallet.icon} alt={wallet.connector.name} size={20} />
78
+ <div>{formatter.truncateAddress(wallet.address, 8)}</div>
79
+ <LogoutIcon width={20} height={20} />
80
+ </WalletCard>
81
+ ))}
84
82
 
85
83
  {hot.wallets.length < 6 && (
86
84
  <WalletCard style={{ paddingLeft: 12, paddingRight: 12 }} onClick={() => openConnector(hot)}>
@@ -7,11 +7,11 @@ import { Token } from "../../core/token";
7
7
  import { HotConnector } from "../../HotConnector";
8
8
  import { OmniWallet } from "../../OmniWallet";
9
9
  import { Network, OmniToken } from "../../core/chains";
10
- import { tokens } from "../../core/tokens";
11
10
  import { PopupOption } from "../styles";
12
11
  import Popup from "../Popup";
13
12
 
14
13
  import { TokenCard, ImageView } from "./TokenCard";
14
+ import { tokens } from "../../core/tokens";
15
15
 
16
16
  interface SelectTokenPopupProps {
17
17
  hot: HotConnector;
@@ -58,35 +58,31 @@ export const TokenIcon = observer(({ token, wallet }: { token: Token; wallet?: O
58
58
  <div style={{ position: "relative", width: 40, height: 40 }}>
59
59
  <ImageView src={token.icon} alt={token.symbol} size={40} />
60
60
  <ImageView src={token.chainIcon} alt={token.symbol} size={14} style={{ position: "absolute", bottom: 0, right: 0 }} />
61
- {token.chain === -4 && wallet?.type && <ImageView src={wallet.icon} alt={chains.getByType(wallet.type)?.[0]?.name || ""} size={14} style={{ position: "absolute", bottom: 0, left: 0 }} />}
61
+ {token.chain === -4 && wallet?.type && <ImageView src={wallet.icon} alt={chains.get(wallet.type)?.name || ""} size={14} style={{ position: "absolute", bottom: 0, left: 0 }} />}
62
62
  </div>
63
63
  );
64
64
  });
65
65
 
66
- export const TokenCard = observer(
67
- ({ token, onSelect, amount, hot, wallet, rightControl }: { rightControl?: React.ReactNode; token: Token; onSelect?: (token: Token, wallet?: OmniWallet) => void; amount?: bigint; hot: HotConnector; wallet?: OmniWallet }) => {
68
- const balance = amount || hot.balance(wallet, token);
69
- const symbol = token.chain === -4 && !token.isMainOmni ? `${token.symbol} (${token.originalChainSymbol})` : token.symbol;
66
+ export const TokenCard = observer(({ token, onSelect, hot, wallet }: { token: Token; onSelect: (token: Token, wallet?: OmniWallet) => void; hot: HotConnector; wallet?: OmniWallet }) => {
67
+ const balance = hot.balance(wallet, token);
68
+ const symbol = token.chain === -4 && !token.isMainOmni ? `${token.originalChainSymbol}_${token.symbol}` : token.symbol;
70
69
 
71
- return (
72
- <PopupOption key={token.id} onClick={() => onSelect?.(token, wallet)}>
73
- <TokenIcon token={token} wallet={wallet} />
70
+ return (
71
+ <PopupOption key={token.id} onClick={() => onSelect(token, wallet)}>
72
+ <TokenIcon token={token} wallet={wallet} />
74
73
 
75
- <TokenWrap style={{ marginTop: -2, textAlign: "left" }}>
76
- <p style={{ textAlign: "left", fontSize: 20, fontWeight: "bold" }}>{symbol}</p>
77
- <p style={{ textAlign: "left", fontSize: 14, color: "#c6c6c6" }}>${formatter.amount(token.usd)}</p>
78
- </TokenWrap>
74
+ <TokenWrap style={{ marginTop: -2, textAlign: "left" }}>
75
+ <p style={{ textAlign: "left", fontSize: 20, fontWeight: "bold" }}>{symbol}</p>
76
+ <p style={{ textAlign: "left", fontSize: 14, color: "#c6c6c6" }}>${formatter.amount(token.usd)}</p>
77
+ </TokenWrap>
79
78
 
80
- {rightControl || (
81
- <TokenWrap style={{ paddingRight: 4, marginLeft: "auto", alignItems: "flex-end" }}>
82
- <p style={{ textAlign: "right", fontSize: 20 }}>{token.readable(balance)}</p>
83
- <p style={{ textAlign: "right", fontSize: 14, color: "#c6c6c6" }}>${token.readable(balance, token.usd)}</p>
84
- </TokenWrap>
85
- )}
86
- </PopupOption>
87
- );
88
- }
89
- );
79
+ <TokenWrap style={{ paddingRight: 4, marginLeft: "auto", alignItems: "flex-end" }}>
80
+ <p style={{ textAlign: "right", fontSize: 20 }}>{token.readable(balance)}</p>
81
+ <p style={{ textAlign: "right", fontSize: 14, color: "#c6c6c6" }}>${token.readable(balance, token.usd)}</p>
82
+ </TokenWrap>
83
+ </PopupOption>
84
+ );
85
+ });
90
86
 
91
87
  const TokenWrap = styled.div`
92
88
  display: flex;
package/src/ui/router.tsx CHANGED
@@ -1,62 +1,34 @@
1
1
  import { HotConnector } from "../HotConnector";
2
2
  import { OmniConnector } from "../OmniConnector";
3
- import { OmniWallet } from "../OmniWallet";
4
-
5
3
  import { BridgeReview } from "../exchange";
4
+ import { Token } from "../core/token";
5
+ import { OmniWallet } from "../OmniWallet";
6
6
  import { WalletType } from "../core/chains";
7
7
  import { Recipient } from "../core/recipient";
8
- import { Intents } from "../core/Intents";
9
- import { Token } from "../core/token";
10
8
 
11
9
  import { present } from "./Popup";
12
- import { SelectTokenPopup } from "./payment/SelectToken";
13
- import { SelectRecipient } from "./payment/SelectRecipient";
14
- import { SelectSender } from "./payment/SelectSender";
15
- import { BridgeProps } from "./payment/Bridge";
16
10
  import { Payment } from "./payment/Payment";
17
- import { Profile } from "./payment/Profile";
18
- import { Bridge } from "./payment/Bridge";
19
-
20
- import ConnectPrimaryWallet from "./connect/PrimaryWallet";
21
11
  import { LogoutPopup } from "./connect/LogoutPopup";
12
+ import { Bridge } from "./payment/Bridge";
13
+ import { Profile } from "./payment/Profile";
14
+ import { SelectTokenPopup } from "./payment/SelectToken";
22
15
  import { WalletPicker } from "./connect/WalletPicker";
16
+ import { BridgeProps } from "./payment/Bridge";
23
17
  import { Connector } from "./connect/ConnectWallet";
18
+ import { SelectSender } from "./payment/SelectSender";
19
+ import { SelectRecipient } from "./payment/SelectRecipient";
24
20
  import { WCRequest } from "./connect/WCRequest";
25
- import Toast from "./Toast";
26
21
 
27
- export const openPayment = (
28
- connector: HotConnector,
29
- {
30
- intents,
31
- title,
32
- allowedTokens,
33
- prepaidAmount,
34
- payableToken,
35
- needAmount,
36
- onConfirm,
37
- }: {
38
- intents: Intents;
39
- title?: string;
40
- allowedTokens?: string[];
41
- prepaidAmount: bigint;
42
- payableToken: Token;
43
- needAmount: bigint;
44
- onConfirm: (args: { depositQoute?: BridgeReview; processing?: () => Promise<BridgeReview> }) => Promise<void>;
45
- }
46
- ) => {
47
- return new Promise<void>((resolve, reject) => {
22
+ export const openPayment = (connector: HotConnector, token: Token, amount: bigint, recipient?: Recipient) => {
23
+ return new Promise<Promise<BridgeReview>>((resolve, reject) => {
48
24
  present((close) => (
49
25
  <Payment //
50
- title={title}
51
- intents={intents}
26
+ onClose={() => (close(), reject(new Error("User rejected")))}
27
+ onProcess={(task) => (close(), resolve(task))}
52
28
  connector={connector}
53
- needAmount={needAmount}
54
- prepaidAmount={prepaidAmount}
55
- allowedTokens={allowedTokens}
56
- payableToken={payableToken}
57
- close={() => (close(), resolve())}
58
- onReject={() => (close(), reject(new Error("User rejected")))}
59
- onConfirm={onConfirm}
29
+ token={token}
30
+ amount={amount}
31
+ recipient={recipient}
60
32
  />
61
33
  ));
62
34
  });
@@ -90,15 +62,7 @@ export const openBridge = (hot: HotConnector, setup?: BridgeProps["setup"]) => {
90
62
  };
91
63
 
92
64
  export const openConnector = (hot: HotConnector) => {
93
- return new Promise<void>((resolve) => {
94
- present((close) => <Connector hot={hot} onClose={() => (resolve(), close())} />);
95
- });
96
- };
97
-
98
- export const openConnectPrimaryWallet = (hot: HotConnector) => {
99
- return new Promise<void>((resolve) => {
100
- present((close) => <ConnectPrimaryWallet hot={hot} onClose={() => (close(), resolve())} />);
101
- });
65
+ present((close) => <Connector hot={hot} onClose={close} />);
102
66
  };
103
67
 
104
68
  export const openProfile = (hot: HotConnector) => {
@@ -126,7 +90,3 @@ export const openWCRequest = <T,>(args: { task: () => Promise<T>; deeplink?: str
126
90
  present((close) => <WCRequest deeplink={args.deeplink} name={args.name} icon={args.icon} onClose={close} task={taskPromise} />);
127
91
  return taskPromise;
128
92
  };
129
-
130
- export const openToast = (message: string) => {
131
- return present(() => <Toast message={message} />);
132
- };
package/src/ui/styles.ts CHANGED
@@ -195,7 +195,6 @@ export const PopupOption = styled.button`
195
195
  outline: none;
196
196
  border: none;
197
197
  background: transparent;
198
- width: 100%;
199
198
  gap: 12px;
200
199
 
201
200
  img {
@@ -265,7 +264,6 @@ export const PopupButton = styled.button`
265
264
 
266
265
  export const PopupRoot = styled.div`
267
266
  height: 100%;
268
- width: 100%;
269
267
 
270
268
  h1,
271
269
  h2,
@@ -1,105 +0,0 @@
1
- import { ChainConfig, WalletType } from "./core/chains";
2
- import { HotBridge } from "./core/bridge";
3
- import { OmniToken } from "./core/chains";
4
- import { Intents } from "./core/Intents";
5
- import { Telemetry } from "./core/telemetry";
6
- import { Token } from "./core/token";
7
- import type CosmosWallet from "./cosmos/wallet";
8
- import type NearWallet from "./near/wallet";
9
- import type EvmWallet from "./evm/wallet";
10
- import type SolanaWallet from "./solana/wallet";
11
- import type StellarWallet from "./stellar/wallet";
12
- import type TonWallet from "./ton/wallet";
13
- import { OmniConnector } from "./OmniConnector";
14
- import { OmniWallet } from "./OmniWallet";
15
- import { Exchange } from "./exchange";
16
- import { Activity } from "./activity";
17
- interface HotConnectorOptions {
18
- apiKey: string;
19
- chains?: Record<number, ChainConfig>;
20
- connectors?: ((wibe3: HotConnector) => Promise<OmniConnector>)[];
21
- walletConnect?: {
22
- projectId?: string;
23
- metadata?: {
24
- name: string;
25
- description: string;
26
- url: string;
27
- icons: string[];
28
- };
29
- };
30
- }
31
- export declare class HotConnector {
32
- connectors: OmniConnector[];
33
- balances: Record<string, Record<string, bigint>>;
34
- telemetry: Telemetry;
35
- activity: Activity;
36
- hotBridge: HotBridge;
37
- exchange: Exchange;
38
- private events;
39
- settings: {
40
- webWallet: string;
41
- projectId?: string;
42
- metadata?: {
43
- name: string;
44
- description: string;
45
- url: string;
46
- icons: string[];
47
- };
48
- };
49
- constructor(options?: HotConnectorOptions);
50
- setOmniChainBranding(branding: {
51
- name: string;
52
- icon: string;
53
- }): void;
54
- getWalletConnector(type: WalletType): OmniConnector | null;
55
- omni(token: OmniToken): Token;
56
- get tokens(): Token[];
57
- get priorityWallet(): StellarWallet | NearWallet | EvmWallet | SolanaWallet | TonWallet | undefined;
58
- get wallets(): OmniWallet[];
59
- get walletsTokens(): {
60
- token: Token;
61
- wallet: OmniWallet;
62
- balance: bigint;
63
- }[];
64
- get nearRpc(): import("./near/rpc").NearRpc;
65
- get near(): NearWallet | null;
66
- get evm(): EvmWallet | null;
67
- get solana(): SolanaWallet | null;
68
- get stellar(): StellarWallet | null;
69
- get ton(): TonWallet | null;
70
- get cosmos(): CosmosWallet | null;
71
- isCosmosWallet(wallet?: OmniWallet): wallet is CosmosWallet;
72
- isEvmWallet(wallet?: OmniWallet): wallet is EvmWallet;
73
- isSolanaWallet(wallet?: OmniWallet): wallet is SolanaWallet;
74
- isStellarWallet(wallet?: OmniWallet): wallet is StellarWallet;
75
- isTonWallet(wallet?: OmniWallet): wallet is TonWallet;
76
- isNearWallet(wallet?: OmniWallet): wallet is NearWallet;
77
- getChainBalances(chain: number): number;
78
- balance(wallet?: OmniWallet, token?: Token): bigint;
79
- omniBalance(token: OmniToken): {
80
- token: Token;
81
- onchain: bigint;
82
- omni: bigint;
83
- total: number;
84
- };
85
- fetchToken(token: Token, wallet: OmniWallet): Promise<bigint>;
86
- fetchOmniTokens(wallet: OmniWallet): Promise<void>;
87
- fetchTokens(wallet: OmniWallet): Promise<void>;
88
- intentsBuilder(wallet?: OmniWallet): Intents;
89
- onConnect(handler: (payload: {
90
- wallet: OmniWallet;
91
- connector: OmniConnector;
92
- }) => void): () => void;
93
- onDisconnect(handler: (payload: {
94
- wallet: OmniWallet;
95
- connector: OmniConnector;
96
- }) => void): () => void;
97
- withdraw(token: OmniToken, amount?: number, settings?: {
98
- sender?: OmniWallet;
99
- }): Promise<import("./exchange").BridgeReview>;
100
- deposit(token: OmniToken, amount?: number): Promise<import("./exchange").BridgeReview>;
101
- openBridge(): Promise<void>;
102
- connect(type?: WalletType): Promise<void>;
103
- disconnect(wallet: WalletType | OmniWallet): Promise<void>;
104
- }
105
- export {};