@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.
Files changed (40) hide show
  1. package/build/core/exchange.d.ts +1 -1
  2. package/build/core/exchange.js +4 -8
  3. package/build/core/exchange.js.map +1 -1
  4. package/build/core/recipient.d.ts +2 -0
  5. package/build/core/recipient.js +7 -0
  6. package/build/core/recipient.js.map +1 -1
  7. package/build/cosmos/connector.d.ts +8 -5
  8. package/build/cosmos/connector.js +26 -7
  9. package/build/cosmos/connector.js.map +1 -1
  10. package/build/ui/bridge/Bridge.js +22 -4
  11. package/build/ui/bridge/Bridge.js.map +1 -1
  12. package/build/ui/bridge/SelectSender.d.ts +4 -1
  13. package/build/ui/bridge/SelectSender.js +36 -7
  14. package/build/ui/bridge/SelectSender.js.map +1 -1
  15. package/build/ui/bridge/TokenAmountCard.d.ts +2 -4
  16. package/build/ui/bridge/TokenAmountCard.js +3 -8
  17. package/build/ui/bridge/TokenAmountCard.js.map +1 -1
  18. package/build/ui/icons/hex.d.ts +1 -0
  19. package/build/ui/icons/hex.js +5 -0
  20. package/build/ui/icons/hex.js.map +1 -0
  21. package/build/ui/profile/DepositFlow.js +40 -10
  22. package/build/ui/profile/DepositFlow.js.map +1 -1
  23. package/build/ui/profile/Payment.js +4 -3
  24. package/build/ui/profile/Payment.js.map +1 -1
  25. package/build/ui/profile/Profile.js +11 -11
  26. package/build/ui/profile/Profile.js.map +1 -1
  27. package/build/ui/router.d.ts +2 -0
  28. package/build/ui/router.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/core/exchange.ts +5 -5
  31. package/src/core/recipient.ts +9 -0
  32. package/src/cosmos/connector.ts +32 -10
  33. package/src/ui/bridge/Bridge.tsx +26 -6
  34. package/src/ui/bridge/SelectSender.tsx +64 -18
  35. package/src/ui/bridge/TokenAmountCard.tsx +17 -27
  36. package/src/ui/icons/hex.tsx +18 -0
  37. package/src/ui/profile/DepositFlow.tsx +65 -14
  38. package/src/ui/profile/Payment.tsx +4 -4
  39. package/src/ui/profile/Profile.tsx +81 -83
  40. 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={{ flex: 1, display: "flex", flexDirection: "column", gap: 12 }}>
73
- <div style={{ display: "flex", flexWrap: "wrap", width: "100%", gap: 8 }}>
74
- {connectors.flatMap((connector) => {
75
- return connector.wallets.map((wallet) => (
76
- <WalletCard key={wallet.type} onClick={() => connector.disconnect()}>
77
- <ImageView src={connector.icon} alt={connector.name} size={20} />
78
- {connector.icon !== wallet.icon && <ImageView style={{ position: "absolute", bottom: 4, left: 20 }} src={wallet.icon} alt={connector.name} size={12} />}
79
- <div>{formatter.truncateAddress(wallet.address, 8)}</div>
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
- </div>
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
- <Card>
101
- <PSmall>YOUR BALANCE</PSmall>
102
- <BalanceCard>${formatter.amount(totalBalance)}</BalanceCard>
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
- <div style={{ width: "100%", display: "flex", gap: 12, marginTop: 12, flexWrap: "wrap" }}>
105
- <ActionButton onClick={() => (onClose?.(), onExchange ? onExchange() : openBridge(kit, { title: "Exchange" }))}>
106
- <ExchangeIcon />
107
- Exchange
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
- {socialConnector != null && (
111
- <ActionButton onClick={() => socialConnector.openWallet()}>
112
- <ImageView src={socialConnector.icon} alt={socialConnector.name} size={20} />
113
- Open wallet
114
- </ActionButton>
115
- )}
116
-
117
- <ActionButton onClick={() => (onClose?.(), onDeposit ? onDeposit() : kit.router.openDepositFlow(kit))}>Deposit</ActionButton>
118
- </div>
119
- </Card>
120
-
121
- <SegmentedControl
122
- value={selectedTab}
123
- onChange={(value) => setSelectedTab(value as "pendings" | "withdraw" | "portfolio")}
124
- options={[
125
- { label: "Portfolio", value: "portfolio", background: "#141414", badge: nonOmniTokens.length.toString() },
126
- { label: "HEX Balance", value: "withdraw", background: "#141414", badge: omniTokens.length.toString() },
127
- { label: "Activity", value: "pendings", background: "#141414", badge: kit.activity.activityList.length.toString() },
128
- ]}
129
- />
130
-
131
- {selectedTab === "pendings" && (
132
- <TokenCards>
133
- {kit.activity.activityList.map((activity) => {
134
- return (
135
- <Card key={activity.id} onClick={() => activity.action()} style={{ flexDirection: "row", gap: 12 }}>
136
- {activity.preview instanceof Token && <TokenIcon token={activity.preview} />}
137
-
138
- <div>
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
- {activity.status === "pending" && (
144
- <div style={{ marginLeft: "auto", width: 40, height: 40, display: "flex", alignItems: "center", justifyContent: "center" }}>
145
- <Loader />
146
- </div>
147
- )}
148
-
149
- {activity.actionText && !activity.actionLoading && (
150
- <div style={{ marginLeft: "auto", padding: "8px 12px", borderRadius: 16, background: "#1a1a1a", color: "#fff" }}>
151
- <PSmall style={{ color: "#d6d6d6" }}>{activity.actionText}</PSmall>
152
- </div>
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
- {selectedTab === "withdraw" && <TokenCards>{omniTokens.map((t) => t.component)}</TokenCards>}
159
+ {selectedTab === "withdraw" && <TokenCards>{omniTokens.map((t) => t.component)}</TokenCards>}
161
160
 
162
- {selectedTab === "portfolio" && <TokenCards>{nonOmniTokens.map((t) => t.component)}</TokenCards>}
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