@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/dist/index.d.ts CHANGED
@@ -7,8 +7,8 @@ import { HyperliquidTwapCreateRequest, HyperliquidTwapModifyRequest, Hyperliquid
7
7
  import { TelegramClient } from 'hypurr-grpc/ts/hypurr/telegram/telegram_service.client';
8
8
  import { HyperliquidWalletTwapSession, HyperliquidWalletScaleSession } from 'hypurr-grpc/ts/hypurr/tools';
9
9
  export { HyperliquidWalletScaleSession, HyperliquidWalletTwapSession } from 'hypurr-grpc/ts/hypurr/tools';
10
- import { TelegramChatWalletPack } from 'hypurr-grpc/ts/hypurr/user';
11
- export { TelegramChatWalletPack } from 'hypurr-grpc/ts/hypurr/user';
10
+ import { TelegramUserAddressBookEntry, TelegramChatWalletPack } from 'hypurr-grpc/ts/hypurr/user';
11
+ export { TelegramChatWalletPack, TelegramUserAddressBookEntry } from 'hypurr-grpc/ts/hypurr/user';
12
12
  import { HyperliquidWallet } from 'hypurr-grpc/ts/hypurr/wallet';
13
13
  export { HyperliquidWallet } from 'hypurr-grpc/ts/hypurr/wallet';
14
14
  import { AbstractViemLocalAccount } from '@hfunlabs/hyperliquid/signing';
@@ -53,6 +53,8 @@ interface HypurrUser {
53
53
  telegramId?: string;
54
54
  hfunScore?: number;
55
55
  reputationScore?: number;
56
+ /** Saved address-book entries (Telegram users only). */
57
+ addressBook?: TelegramUserAddressBookEntry[];
56
58
  }
57
59
  interface StoredAgent {
58
60
  privateKey: `0x${string}`;
package/dist/index.js CHANGED
@@ -698,7 +698,8 @@ function HypurrConnectProvider({
698
698
  authMethod: "telegram",
699
699
  telegramId: String(tgUser.telegramId),
700
700
  hfunScore: tgUser?.reputation?.hfunScore,
701
- reputationScore: tgUser?.reputation?.reputationScore
701
+ reputationScore: tgUser?.reputation?.reputationScore,
702
+ addressBook: tgUser.addressBook
702
703
  };
703
704
  }
704
705
  if (eoaAddress && authMethod === "eoa") {
@@ -4996,27 +4997,6 @@ var formatCompactAddress = (addr) => {
4996
4997
  if (!addr) return "";
4997
4998
  return `${addr.slice(0, 4)}...${addr.slice(-2)}`;
4998
4999
  };
4999
- function getWalletTypeMeta2(wallet) {
5000
- if (wallet.isAgent) {
5001
- return {
5002
- label: "Agent wallet",
5003
- color: "#38bdf8",
5004
- icon: /* @__PURE__ */ jsx12(Bot, { size: 12 })
5005
- };
5006
- }
5007
- if (wallet.isReadOnly) {
5008
- return {
5009
- label: "Read-only wallet",
5010
- color: "#a78bfa",
5011
- icon: /* @__PURE__ */ jsx12(Eye, { size: 12 })
5012
- };
5013
- }
5014
- return {
5015
- label: "Private-key wallet",
5016
- color: "#34d399",
5017
- icon: /* @__PURE__ */ jsx12(KeyRound, { size: 12 })
5018
- };
5019
- }
5020
5000
  var rootStyle = {
5021
5001
  position: "absolute",
5022
5002
  right: 0,
@@ -5029,6 +5009,13 @@ var rootStyle = {
5029
5009
  transformOrigin: "top right",
5030
5010
  overflow: "hidden"
5031
5011
  };
5012
+ var SCROLLBAR_CLASS = "hpc-wallet-scroll";
5013
+ var scrollbarCss = `
5014
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar { width: 6px; height: 6px; }
5015
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar-track { background: #0b0e11; }
5016
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
5017
+ .${SCROLLBAR_CLASS}::-webkit-scrollbar-thumb:hover { background: #4b5563; }
5018
+ `;
5032
5019
  var sectionBorder = "1px solid rgb(var(--line))";
5033
5020
  var sectionHeaderStyle = {
5034
5021
  padding: "8px 16px",
@@ -5115,7 +5102,6 @@ function WalletSelectorDropdown({
5115
5102
  depth,
5116
5103
  isSelected,
5117
5104
  label,
5118
- walletType: getWalletTypeMeta2(wallet),
5119
5105
  compactAddress,
5120
5106
  onSelect: () => {
5121
5107
  selectWallet(wallet.id);
@@ -5146,6 +5132,7 @@ function WalletSelectorDropdown({
5146
5132
  exit: { opacity: 0, scale: 0.95 },
5147
5133
  transition: { duration: 0.15, ease: "easeOut" },
5148
5134
  children: [
5135
+ /* @__PURE__ */ jsx12("style", { children: scrollbarCss }),
5149
5136
  /* @__PURE__ */ jsxs11(
5150
5137
  "button",
5151
5138
  {
@@ -5305,10 +5292,13 @@ function WalletSelectorDropdown({
5305
5292
  /* @__PURE__ */ jsx12(
5306
5293
  "div",
5307
5294
  {
5295
+ className: SCROLLBAR_CLASS,
5308
5296
  style: {
5309
5297
  maxHeight: 256,
5310
5298
  overflowY: "auto",
5311
- paddingBottom: 4
5299
+ paddingBottom: 4,
5300
+ scrollbarWidth: "thin",
5301
+ scrollbarColor: "#374151 #0b0e11"
5312
5302
  },
5313
5303
  children: walletListEntries.map((entry) => {
5314
5304
  if (entry.type === "wallet") {
@@ -5482,7 +5472,6 @@ function WalletRow2({
5482
5472
  depth,
5483
5473
  isSelected,
5484
5474
  label,
5485
- walletType,
5486
5475
  compactAddress,
5487
5476
  onSelect,
5488
5477
  onShowPortfolio,
@@ -5524,7 +5513,7 @@ function WalletRow2({
5524
5513
  if (actions) actions.style.opacity = "0";
5525
5514
  },
5526
5515
  children: [
5527
- /* @__PURE__ */ jsxs11(
5516
+ /* @__PURE__ */ jsx12(
5528
5517
  "button",
5529
5518
  {
5530
5519
  onClick: onSelect,
@@ -5541,64 +5530,47 @@ function WalletRow2({
5541
5530
  cursor: "pointer",
5542
5531
  padding: 0
5543
5532
  },
5544
- children: [
5533
+ children: label ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
5545
5534
  /* @__PURE__ */ jsx12(
5546
5535
  "span",
5547
5536
  {
5548
- title: walletType.label,
5549
- "aria-label": walletType.label,
5550
5537
  style: {
5551
- display: "inline-flex",
5552
- alignItems: "center",
5553
- justifyContent: "center",
5554
- flexShrink: 0,
5555
- color: isAgentExpired ? walletTextColor : walletType.color
5538
+ overflow: "hidden",
5539
+ textOverflow: "ellipsis",
5540
+ whiteSpace: "nowrap",
5541
+ color: isAgentExpired ? walletTextColor : isSelected ? "rgb(var(--content))" : void 0,
5542
+ fontWeight: isSelected ? 500 : void 0
5556
5543
  },
5557
- children: walletType.icon
5544
+ children: label
5558
5545
  }
5559
5546
  ),
5560
- label ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
5561
- /* @__PURE__ */ jsx12(
5562
- "span",
5563
- {
5564
- style: {
5565
- overflow: "hidden",
5566
- textOverflow: "ellipsis",
5567
- whiteSpace: "nowrap",
5568
- color: isAgentExpired ? walletTextColor : isSelected ? "rgb(var(--content))" : void 0,
5569
- fontWeight: isSelected ? 500 : void 0
5570
- },
5571
- children: label
5572
- }
5573
- ),
5574
- /* @__PURE__ */ jsxs11(
5575
- "span",
5576
- {
5577
- style: {
5578
- fontSize: 12,
5579
- fontWeight: 400,
5580
- flexShrink: 0,
5581
- color: mutedTextColor
5582
- },
5583
- children: [
5584
- "(",
5585
- compactAddress,
5586
- ")"
5587
- ]
5588
- }
5589
- )
5590
- ] }) : /* @__PURE__ */ jsx12(
5547
+ /* @__PURE__ */ jsxs11(
5591
5548
  "span",
5592
5549
  {
5593
5550
  style: {
5594
5551
  fontSize: 12,
5595
- color: isAgentExpired ? walletTextColor : isSelected ? "rgb(var(--content))" : "rgb(var(--content-muted))",
5596
- fontWeight: isSelected ? 500 : void 0
5552
+ fontWeight: 400,
5553
+ flexShrink: 0,
5554
+ color: mutedTextColor
5597
5555
  },
5598
- children: compactAddress
5556
+ children: [
5557
+ "(",
5558
+ compactAddress,
5559
+ ")"
5560
+ ]
5599
5561
  }
5600
5562
  )
5601
- ]
5563
+ ] }) : /* @__PURE__ */ jsx12(
5564
+ "span",
5565
+ {
5566
+ style: {
5567
+ fontSize: 12,
5568
+ color: isAgentExpired ? walletTextColor : isSelected ? "rgb(var(--content))" : "rgb(var(--content-muted))",
5569
+ fontWeight: isSelected ? 500 : void 0
5570
+ },
5571
+ children: compactAddress
5572
+ }
5573
+ )
5602
5574
  }
5603
5575
  ),
5604
5576
  agentExpiryTitle && /* @__PURE__ */ jsx12(