@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.
- package/build/HotConnector.js +3 -2
- package/build/HotConnector.js.map +1 -1
- package/build/core/address.d.ts +25 -0
- package/build/core/address.js +162 -0
- package/build/core/address.js.map +1 -0
- package/build/core/chains.d.ts +1 -1
- package/build/core/chains.js +1 -1
- package/build/core/chains.js.map +1 -1
- package/build/core/recipient.d.ts +1 -0
- package/build/core/recipient.js +6 -0
- package/build/core/recipient.js.map +1 -1
- package/build/core/token.d.ts +1 -1
- package/build/core/token.js +3 -1
- package/build/core/token.js.map +1 -1
- package/build/cosmos/connector.d.ts +7 -2
- package/build/cosmos/connector.js +42 -11
- package/build/cosmos/connector.js.map +1 -1
- package/build/near/connector.js +14 -6
- package/build/near/connector.js.map +1 -1
- package/build/ton/connector.js +1 -1
- package/build/ton/connector.js.map +1 -1
- package/build/ui/bridge/Bridge.js +8 -9
- package/build/ui/bridge/Bridge.js.map +1 -1
- package/build/ui/bridge/SelectRecipient.js +4 -3
- package/build/ui/bridge/SelectRecipient.js.map +1 -1
- package/build/ui/bridge/SelectToken.js +2 -2
- package/build/ui/bridge/SelectToken.js.map +1 -1
- package/build/ui/connect/WalletPicker.js +29 -26
- package/build/ui/connect/WalletPicker.js.map +1 -1
- package/build/ui/profile/Payment.js +3 -3
- package/build/ui/profile/Payment.js.map +1 -1
- package/build/ui/uikit/button.d.ts +3 -1
- package/build/ui/uikit/button.js +20 -1
- package/build/ui/uikit/button.js.map +1 -1
- package/package.json +1 -1
- package/src/HotConnector.ts +3 -2
- package/src/core/address.ts +155 -0
- package/src/core/chains.ts +1 -1
- package/src/core/recipient.ts +7 -0
- package/src/core/token.ts +2 -1
- package/src/cosmos/connector.ts +44 -11
- package/src/near/connector.ts +12 -5
- package/src/ton/connector.ts +1 -1
- package/src/ui/bridge/Bridge.tsx +11 -13
- package/src/ui/bridge/SelectRecipient.tsx +16 -9
- package/src/ui/bridge/SelectToken.tsx +2 -2
- package/src/ui/connect/WalletPicker.tsx +45 -35
- package/src/ui/profile/Payment.tsx +3 -3
- 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)
|
|
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) ?
|
|
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.
|
|
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
|
|
package/src/ui/uikit/button.tsx
CHANGED
|
@@ -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`
|