@hot-labs/kit 1.4.0 → 1.4.2

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 (49) hide show
  1. package/build/HotConnector.js +3 -2
  2. package/build/HotConnector.js.map +1 -1
  3. package/build/core/address.d.ts +25 -0
  4. package/build/core/address.js +162 -0
  5. package/build/core/address.js.map +1 -0
  6. package/build/core/chains.d.ts +1 -1
  7. package/build/core/chains.js +1 -1
  8. package/build/core/chains.js.map +1 -1
  9. package/build/core/recipient.d.ts +1 -0
  10. package/build/core/recipient.js +6 -0
  11. package/build/core/recipient.js.map +1 -1
  12. package/build/core/token.d.ts +1 -1
  13. package/build/core/token.js +3 -1
  14. package/build/core/token.js.map +1 -1
  15. package/build/cosmos/connector.d.ts +7 -2
  16. package/build/cosmos/connector.js +42 -11
  17. package/build/cosmos/connector.js.map +1 -1
  18. package/build/near/connector.js +14 -6
  19. package/build/near/connector.js.map +1 -1
  20. package/build/ton/connector.js +1 -1
  21. package/build/ton/connector.js.map +1 -1
  22. package/build/ui/bridge/Bridge.js +8 -9
  23. package/build/ui/bridge/Bridge.js.map +1 -1
  24. package/build/ui/bridge/SelectRecipient.js +4 -3
  25. package/build/ui/bridge/SelectRecipient.js.map +1 -1
  26. package/build/ui/bridge/SelectToken.js +2 -2
  27. package/build/ui/bridge/SelectToken.js.map +1 -1
  28. package/build/ui/connect/WalletPicker.js +29 -26
  29. package/build/ui/connect/WalletPicker.js.map +1 -1
  30. package/build/ui/profile/Payment.js +3 -3
  31. package/build/ui/profile/Payment.js.map +1 -1
  32. package/build/ui/uikit/button.d.ts +3 -1
  33. package/build/ui/uikit/button.js +20 -1
  34. package/build/ui/uikit/button.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/HotConnector.ts +3 -2
  37. package/src/core/address.ts +155 -0
  38. package/src/core/chains.ts +1 -1
  39. package/src/core/recipient.ts +7 -0
  40. package/src/core/token.ts +2 -1
  41. package/src/cosmos/connector.ts +44 -11
  42. package/src/near/connector.ts +12 -5
  43. package/src/ton/connector.ts +1 -1
  44. package/src/ui/bridge/Bridge.tsx +11 -13
  45. package/src/ui/bridge/SelectRecipient.tsx +16 -9
  46. package/src/ui/bridge/SelectToken.tsx +2 -2
  47. package/src/ui/connect/WalletPicker.tsx +45 -35
  48. package/src/ui/profile/Payment.tsx +3 -3
  49. package/src/ui/uikit/button.tsx +22 -2
@@ -66,7 +66,7 @@ export const Payment = observer(({ connector, intents, title = "Payment", allowe
66
66
  } | null>(needAmount === 0n ? { step: "transfer" } : null);
67
67
 
68
68
  const paymentTitle = title || `Pay ${payableToken.readable(needAmount)} ${payableToken.symbol}`;
69
- const showPrepaidToken = payableToken.float(prepaidAmount) * payableToken.usd >= 0.01;
69
+ const showPrepaidToken = payableToken.float(prepaidAmount) >= 0.001;
70
70
 
71
71
  const selectToken = async (from: Token, wallet?: OmniWallet) => {
72
72
  if (!wallet) return;
@@ -74,7 +74,7 @@ export const Payment = observer(({ connector, intents, title = "Payment", allowe
74
74
  try {
75
75
  setFlow({ token: from, wallet, review: undefined, step: "sign" });
76
76
  const insurance = (needAmount * BigInt(Math.floor(PAY_SLIPPAGE * 1000))) / BigInt(1000);
77
- const extra = connector.exchange.isDirectDeposit(from, payableToken) ? insurance : 0n;
77
+ const extra = connector.exchange.isDirectDeposit(from, payableToken) ? 0n : insurance;
78
78
  const review = await connector.exchange.reviewSwap({
79
79
  recipient: intents.signer!,
80
80
  amount: needAmount + extra,
@@ -271,7 +271,7 @@ export const Payment = observer(({ connector, intents, title = "Payment", allowe
271
271
  if (excludedTokens != null && excludedTokens?.includes(token.id)) return null;
272
272
 
273
273
  // same token as need and enough balance is direct deposit
274
- if (token.originalChain === payableToken.originalChain && token.originalAddress === payableToken.originalAddress && availableBalance >= payableToken.float(needAmount)) {
274
+ if (token.originalId === payableToken.originalId && availableBalance >= payableToken.float(needAmount)) {
275
275
  return <TokenCard key={token.id} token={token} onSelect={selectToken} hot={connector} wallet={wallet} />;
276
276
  }
277
277
 
@@ -1,6 +1,6 @@
1
- import styled from "styled-components";
1
+ import styled, { css } from "styled-components";
2
2
 
3
- export const ActionButton = styled.button`
3
+ export const ActionButton = styled.button<{ $stroke?: boolean }>`
4
4
  display: flex;
5
5
  padding: 0 24px;
6
6
  border-radius: 12px;
@@ -11,6 +11,7 @@ export const ActionButton = styled.button`
11
11
  transition: background 0.2s ease-in-out;
12
12
  height: 48px;
13
13
  min-height: 48px;
14
+ max-height: 48px;
14
15
  align-items: center;
15
16
  justify-content: center;
16
17
  flex-shrink: 0;
@@ -36,6 +37,25 @@ export const ActionButton = styled.button`
36
37
  color: #828282;
37
38
  cursor: not-allowed;
38
39
  }
40
+
41
+ ${(p) =>
42
+ p.$stroke &&
43
+ css`
44
+ background: transparent;
45
+ border: 1px solid #d2d2d2;
46
+ color: #fff;
47
+
48
+ &:hover {
49
+ background: rgba(255, 255, 255, 0.1);
50
+ border: 1px solid #fff;
51
+ }
52
+
53
+ &:disabled {
54
+ background: transparent;
55
+ border: 1px solid #3e3e3e;
56
+ color: #828282;
57
+ }
58
+ `}
39
59
  `;
40
60
 
41
61
  export const Button = styled.button`