@hfunlabs/hypurr-connect 0.1.18 → 0.1.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hfunlabs/hypurr-connect",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@10.10.0",
6
6
  "main": "./dist/index.js",
@@ -593,6 +593,7 @@ export function HypurrConnectProvider({
593
593
  telegramId: String(tgUser.telegramId),
594
594
  hfunScore: tgUser?.reputation?.hfunScore,
595
595
  reputationScore: tgUser?.reputation?.reputationScore,
596
+ addressBook: tgUser.addressBook,
596
597
  };
597
598
  }
598
599
  if (eoaAddress && authMethod === "eoa") {
@@ -18,12 +18,9 @@ import { useIsMobile } from "./useIsMobile";
18
18
  import { UserProfileModal, type SlippageOption } from "./UserProfileModal";
19
19
  import { getAgentExpiryTitle } from "./agentWallet";
20
20
  import {
21
- Bot,
22
21
  Copy,
23
22
  Crown,
24
- Eye,
25
23
  Folder,
26
- KeyRound,
27
24
  LayoutDashboard,
28
25
  LogOut,
29
26
  Plus,
@@ -202,36 +199,6 @@ const formatCompactAddress = (addr: string | undefined) => {
202
199
  return `${addr.slice(0, 4)}...${addr.slice(-2)}`;
203
200
  };
204
201
 
205
- type WalletTypeMeta = {
206
- label: string;
207
- color: string;
208
- icon: ReactNode;
209
- };
210
-
211
- function getWalletTypeMeta(wallet: DropdownWallet): WalletTypeMeta {
212
- if (wallet.isAgent) {
213
- return {
214
- label: "Agent wallet",
215
- color: "#38bdf8",
216
- icon: <Bot size={12} />,
217
- };
218
- }
219
-
220
- if (wallet.isReadOnly) {
221
- return {
222
- label: "Read-only wallet",
223
- color: "#a78bfa",
224
- icon: <Eye size={12} />,
225
- };
226
- }
227
-
228
- return {
229
- label: "Private-key wallet",
230
- color: "#34d399",
231
- icon: <KeyRound size={12} />,
232
- };
233
- }
234
-
235
202
  const rootStyle: CSSProperties = {
236
203
  position: "absolute",
237
204
  right: 0,
@@ -245,6 +212,17 @@ const rootStyle: CSSProperties = {
245
212
  overflow: "hidden",
246
213
  };
247
214
 
215
+ // Scoped scrollbar styling so the dropdown looks the same on every host site
216
+ // (matches alpha-trade). Inline styles can't target ::-webkit-scrollbar, so
217
+ // inject a scoped <style>; Firefox uses the standard props on the element.
218
+ const SCROLLBAR_CLASS = "hpc-wallet-scroll";
219
+ const scrollbarCss = `
220
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar { width: 6px; height: 6px; }
221
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar-track { background: #0b0e11; }
222
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
223
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar-thumb:hover { background: #4b5563; }
224
+ `;
225
+
248
226
  const sectionBorder = "1px solid rgb(var(--line))";
249
227
 
250
228
  const sectionHeaderStyle: CSSProperties = {
@@ -341,7 +319,6 @@ export function WalletSelectorDropdown({
341
319
  depth={depth}
342
320
  isSelected={isSelected}
343
321
  label={label}
344
- walletType={getWalletTypeMeta(wallet)}
345
322
  compactAddress={compactAddress}
346
323
  onSelect={() => {
347
324
  selectWallet(wallet.id);
@@ -381,6 +358,7 @@ export function WalletSelectorDropdown({
381
358
  exit={{ opacity: 0, scale: 0.95 }}
382
359
  transition={{ duration: 0.15, ease: "easeOut" }}
383
360
  >
361
+ <style>{scrollbarCss}</style>
384
362
  {/* Profile header */}
385
363
  <button
386
364
  onClick={openProfile}
@@ -537,10 +515,13 @@ export function WalletSelectorDropdown({
537
515
  <div style={{ borderBottom: sectionBorder }}>
538
516
  <div style={sectionHeaderStyle}>Wallets</div>
539
517
  <div
518
+ className={SCROLLBAR_CLASS}
540
519
  style={{
541
520
  maxHeight: 256,
542
521
  overflowY: "auto",
543
522
  paddingBottom: 4,
523
+ scrollbarWidth: "thin",
524
+ scrollbarColor: "#374151 #0b0e11",
544
525
  }}
545
526
  >
546
527
  {walletListEntries.map((entry) => {
@@ -716,7 +697,6 @@ function WalletRow({
716
697
  depth,
717
698
  isSelected,
718
699
  label,
719
- walletType,
720
700
  compactAddress,
721
701
  onSelect,
722
702
  onShowPortfolio,
@@ -728,7 +708,6 @@ function WalletRow({
728
708
  depth: number;
729
709
  isSelected: boolean;
730
710
  label: string | null;
731
- walletType: WalletTypeMeta;
732
711
  compactAddress: string;
733
712
  onSelect: () => void;
734
713
  onShowPortfolio?: () => void;
@@ -794,19 +773,6 @@ function WalletRow({
794
773
  padding: 0,
795
774
  }}
796
775
  >
797
- <span
798
- title={walletType.label}
799
- aria-label={walletType.label}
800
- style={{
801
- display: "inline-flex",
802
- alignItems: "center",
803
- justifyContent: "center",
804
- flexShrink: 0,
805
- color: isAgentExpired ? walletTextColor : walletType.color,
806
- }}
807
- >
808
- {walletType.icon}
809
- </span>
810
776
  {label ? (
811
777
  <>
812
778
  <span
package/src/index.ts CHANGED
@@ -56,7 +56,10 @@ export type {
56
56
 
57
57
  // Re-export wallet types from hypurr-grpc so consumers don't need the dependency
58
58
  export type { HyperliquidWallet } from "hypurr-grpc/ts/hypurr/wallet";
59
- export type { TelegramChatWalletPack } from "hypurr-grpc/ts/hypurr/user";
59
+ export type {
60
+ TelegramChatWalletPack,
61
+ TelegramUserAddressBookEntry,
62
+ } from "hypurr-grpc/ts/hypurr/user";
60
63
  export type {
61
64
  HyperliquidWalletScaleSession,
62
65
  HyperliquidWalletTwapSession,
package/src/types.ts CHANGED
@@ -11,7 +11,10 @@ import type {
11
11
  HyperliquidWalletScaleSession,
12
12
  HyperliquidWalletTwapSession,
13
13
  } from "hypurr-grpc/ts/hypurr/tools";
14
- import type { TelegramChatWalletPack } from "hypurr-grpc/ts/hypurr/user";
14
+ import type {
15
+ TelegramChatWalletPack,
16
+ TelegramUserAddressBookEntry,
17
+ } from "hypurr-grpc/ts/hypurr/user";
15
18
  import type { HyperliquidWallet } from "hypurr-grpc/ts/hypurr/wallet";
16
19
 
17
20
  // ─── Config ──────────────────────────────────────────────────────
@@ -63,6 +66,8 @@ export interface HypurrUser {
63
66
  telegramId?: string;
64
67
  hfunScore?: number;
65
68
  reputationScore?: number;
69
+ /** Saved address-book entries (Telegram users only). */
70
+ addressBook?: TelegramUserAddressBookEntry[];
66
71
  }
67
72
 
68
73
  // ─── Agent (EOA flow) ────────────────────────────────────────────