@hot-labs/kit 1.6.2 → 1.6.4
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/core/exchange.d.ts +1 -1
- package/build/core/exchange.js +4 -8
- package/build/core/exchange.js.map +1 -1
- package/build/core/recipient.d.ts +2 -0
- package/build/core/recipient.js +7 -0
- package/build/core/recipient.js.map +1 -1
- package/build/cosmos/connector.d.ts +8 -5
- package/build/cosmos/connector.js +26 -7
- package/build/cosmos/connector.js.map +1 -1
- package/build/ui/bridge/Bridge.js +22 -4
- package/build/ui/bridge/Bridge.js.map +1 -1
- package/build/ui/bridge/SelectSender.d.ts +4 -1
- package/build/ui/bridge/SelectSender.js +36 -7
- package/build/ui/bridge/SelectSender.js.map +1 -1
- package/build/ui/bridge/TokenAmountCard.d.ts +2 -4
- package/build/ui/bridge/TokenAmountCard.js +3 -8
- package/build/ui/bridge/TokenAmountCard.js.map +1 -1
- package/build/ui/icons/hex.d.ts +1 -0
- package/build/ui/icons/hex.js +5 -0
- package/build/ui/icons/hex.js.map +1 -0
- package/build/ui/profile/DepositFlow.js +40 -10
- package/build/ui/profile/DepositFlow.js.map +1 -1
- package/build/ui/profile/Payment.js +4 -3
- package/build/ui/profile/Payment.js.map +1 -1
- package/build/ui/profile/Profile.js +11 -11
- package/build/ui/profile/Profile.js.map +1 -1
- package/build/ui/router.d.ts +2 -0
- package/build/ui/router.js.map +1 -1
- package/package.json +1 -1
- package/src/core/exchange.ts +5 -5
- package/src/core/recipient.ts +9 -0
- package/src/cosmos/connector.ts +32 -10
- package/src/ui/bridge/Bridge.tsx +26 -6
- package/src/ui/bridge/SelectSender.tsx +64 -18
- package/src/ui/bridge/TokenAmountCard.tsx +17 -27
- package/src/ui/icons/hex.tsx +18 -0
- package/src/ui/profile/DepositFlow.tsx +65 -14
- package/src/ui/profile/Payment.tsx +4 -4
- package/src/ui/profile/Profile.tsx +81 -83
- package/src/ui/router.tsx +1 -1
|
@@ -69,98 +69,96 @@ export const Profile = observer(({ kit, widget, onClose, onExchange, onDeposit }
|
|
|
69
69
|
|
|
70
70
|
return (
|
|
71
71
|
<Popup onClose={onClose} style={{ gap: 16 }} widget={widget}>
|
|
72
|
-
<div style={{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<LogoutIcon />
|
|
81
|
-
</WalletCard>
|
|
82
|
-
));
|
|
83
|
-
})}
|
|
84
|
-
|
|
85
|
-
{connectors.some((t) => t.wallets.length === 0) && (
|
|
86
|
-
<WalletCard
|
|
87
|
-
style={{ paddingRight: 12 }}
|
|
88
|
-
onClick={() =>
|
|
89
|
-
openConnector(kit)
|
|
90
|
-
.then((wallet) => onClose?.(wallet))
|
|
91
|
-
.catch(() => onClose?.())
|
|
92
|
-
}
|
|
93
|
-
>
|
|
94
|
-
<PlusIcon />
|
|
95
|
-
Add wallet
|
|
72
|
+
<div style={{ display: "flex", flexWrap: "wrap", width: "100%", gap: 8 }}>
|
|
73
|
+
{connectors.flatMap((connector) => {
|
|
74
|
+
return connector.wallets.map((wallet) => (
|
|
75
|
+
<WalletCard key={wallet.type} onClick={() => connector.disconnect()}>
|
|
76
|
+
<ImageView src={connector.icon} alt={connector.name} size={20} />
|
|
77
|
+
{connector.icon !== wallet.icon && <ImageView style={{ position: "absolute", bottom: 4, left: 20 }} src={wallet.icon} alt={connector.name} size={12} />}
|
|
78
|
+
<div>{formatter.truncateAddress(wallet.address, 8)}</div>
|
|
79
|
+
<LogoutIcon />
|
|
96
80
|
</WalletCard>
|
|
97
|
-
)
|
|
98
|
-
|
|
81
|
+
));
|
|
82
|
+
})}
|
|
83
|
+
|
|
84
|
+
{connectors.some((t) => t.wallets.length === 0) && (
|
|
85
|
+
<WalletCard
|
|
86
|
+
style={{ paddingRight: 12 }}
|
|
87
|
+
onClick={() =>
|
|
88
|
+
openConnector(kit)
|
|
89
|
+
.then((wallet) => onClose?.(wallet))
|
|
90
|
+
.catch(() => onClose?.())
|
|
91
|
+
}
|
|
92
|
+
>
|
|
93
|
+
<PlusIcon />
|
|
94
|
+
Add wallet
|
|
95
|
+
</WalletCard>
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<Card>
|
|
100
|
+
<PSmall>YOUR BALANCE</PSmall>
|
|
101
|
+
<BalanceCard>${formatter.amount(totalBalance)}</BalanceCard>
|
|
99
102
|
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
+
<div style={{ width: "100%", display: "flex", gap: 12, marginTop: 12, flexWrap: "wrap" }}>
|
|
104
|
+
<ActionButton onClick={() => (onClose?.(), onExchange ? onExchange() : openBridge(kit, { title: "Exchange" }))}>
|
|
105
|
+
<ExchangeIcon />
|
|
106
|
+
Exchange
|
|
107
|
+
</ActionButton>
|
|
103
108
|
|
|
104
|
-
|
|
105
|
-
<ActionButton onClick={() => (
|
|
106
|
-
<
|
|
107
|
-
|
|
109
|
+
{socialConnector != null && (
|
|
110
|
+
<ActionButton onClick={() => socialConnector.openWallet()}>
|
|
111
|
+
<ImageView src={socialConnector.icon} alt={socialConnector.name} size={20} />
|
|
112
|
+
Open wallet
|
|
108
113
|
</ActionButton>
|
|
114
|
+
)}
|
|
109
115
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<PMedium style={{ textAlign: "left" }}>{activity.title}</PMedium>
|
|
140
|
-
<PSmall style={{ textAlign: "left" }}>{activity.subtitle}</PSmall>
|
|
116
|
+
<ActionButton onClick={() => (onClose?.(), onDeposit ? onDeposit() : kit.router.openDepositFlow(kit))}>Deposit</ActionButton>
|
|
117
|
+
</div>
|
|
118
|
+
</Card>
|
|
119
|
+
|
|
120
|
+
<SegmentedControl
|
|
121
|
+
value={selectedTab}
|
|
122
|
+
onChange={(value) => setSelectedTab(value as "pendings" | "withdraw" | "portfolio")}
|
|
123
|
+
options={[
|
|
124
|
+
{ label: "Portfolio", value: "portfolio", background: "#141414", badge: nonOmniTokens.length.toString() },
|
|
125
|
+
{ label: "HEX Balance", value: "withdraw", background: "#141414", badge: omniTokens.length.toString() },
|
|
126
|
+
{ label: "Activity", value: "pendings", background: "#141414", badge: kit.activity.activityList.length.toString() },
|
|
127
|
+
]}
|
|
128
|
+
/>
|
|
129
|
+
|
|
130
|
+
{selectedTab === "pendings" && (
|
|
131
|
+
<TokenCards>
|
|
132
|
+
{kit.activity.activityList.map((activity) => {
|
|
133
|
+
return (
|
|
134
|
+
<Card key={activity.id} onClick={() => activity.action()} style={{ flexDirection: "row", gap: 12 }}>
|
|
135
|
+
{activity.preview instanceof Token && <TokenIcon token={activity.preview} />}
|
|
136
|
+
|
|
137
|
+
<div>
|
|
138
|
+
<PMedium style={{ textAlign: "left" }}>{activity.title}</PMedium>
|
|
139
|
+
<PSmall style={{ textAlign: "left" }}>{activity.subtitle}</PSmall>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
{activity.status === "pending" && (
|
|
143
|
+
<div style={{ marginLeft: "auto", width: 40, height: 40, display: "flex", alignItems: "center", justifyContent: "center" }}>
|
|
144
|
+
<Loader />
|
|
141
145
|
</div>
|
|
146
|
+
)}
|
|
142
147
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
)}
|
|
154
|
-
</Card>
|
|
155
|
-
);
|
|
156
|
-
})}
|
|
157
|
-
</TokenCards>
|
|
158
|
-
)}
|
|
148
|
+
{activity.actionText && !activity.actionLoading && (
|
|
149
|
+
<div style={{ marginLeft: "auto", padding: "8px 12px", borderRadius: 16, background: "#1a1a1a", color: "#fff" }}>
|
|
150
|
+
<PSmall style={{ color: "#d6d6d6" }}>{activity.actionText}</PSmall>
|
|
151
|
+
</div>
|
|
152
|
+
)}
|
|
153
|
+
</Card>
|
|
154
|
+
);
|
|
155
|
+
})}
|
|
156
|
+
</TokenCards>
|
|
157
|
+
)}
|
|
159
158
|
|
|
160
|
-
|
|
159
|
+
{selectedTab === "withdraw" && <TokenCards>{omniTokens.map((t) => t.component)}</TokenCards>}
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
</div>
|
|
161
|
+
{selectedTab === "portfolio" && <TokenCards>{nonOmniTokens.map((t) => t.component)}</TokenCards>}
|
|
164
162
|
</Popup>
|
|
165
163
|
);
|
|
166
164
|
});
|
package/src/ui/router.tsx
CHANGED
|
@@ -162,7 +162,7 @@ export const openWalletPicker = (connector: OmniConnector, onSelect?: (wallet: O
|
|
|
162
162
|
});
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
export const openSelectSender = (props: { kit: HotKit; type: WalletType; disableQR?: boolean; onSelect: (wallet?: OmniWallet | "qr") => void }) => {
|
|
165
|
+
export const openSelectSender = (props: { kit: HotKit; type: WalletType; disableQR?: boolean; depositFlow?: boolean; onSelect: (wallet?: OmniWallet | "qr") => void; onDeposit?: () => void }) => {
|
|
166
166
|
present((close) => <SelectSender {...props} onClose={close} />);
|
|
167
167
|
};
|
|
168
168
|
|