@b3dotfun/sdk 0.0.42 → 0.0.43-alpha.1

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 (121) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +1 -0
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +11 -4
  3. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +43 -3
  4. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +1 -0
  5. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
  6. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
  7. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +5 -3
  8. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +12 -0
  9. package/dist/cjs/anyspend/types/api.d.ts +2 -10
  10. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  11. package/dist/cjs/global-account/react/components/index.d.ts +8 -7
  12. package/dist/cjs/global-account/react/components/index.js +29 -23
  13. package/dist/cjs/global-account/react/components/ui/dropdown-menu.d.ts +27 -0
  14. package/dist/cjs/global-account/react/components/ui/dropdown-menu.js +100 -0
  15. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +5 -1
  16. package/dist/cjs/shared/constants/currency.d.ts +1 -0
  17. package/dist/cjs/shared/constants/currency.js +5 -0
  18. package/dist/cjs/shared/constants/index.d.ts +1 -0
  19. package/dist/cjs/shared/constants/index.js +15 -0
  20. package/dist/cjs/shared/react/components/CurrencySelector.d.ts +7 -0
  21. package/dist/cjs/shared/react/components/CurrencySelector.js +14 -0
  22. package/dist/cjs/shared/react/components/FormattedCurrency.d.ts +12 -0
  23. package/dist/cjs/shared/react/components/FormattedCurrency.js +60 -0
  24. package/dist/cjs/shared/react/components/index.d.ts +2 -0
  25. package/dist/cjs/shared/react/components/index.js +18 -0
  26. package/dist/cjs/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts +1 -0
  27. package/dist/cjs/shared/react/hooks/__tests__/useCurrencyConversion.test.js +245 -0
  28. package/dist/cjs/shared/react/hooks/index.d.ts +1 -0
  29. package/dist/cjs/shared/react/hooks/index.js +1 -0
  30. package/dist/cjs/shared/react/hooks/useCurrencyConversion.d.ts +35 -0
  31. package/dist/cjs/shared/react/hooks/useCurrencyConversion.js +200 -0
  32. package/dist/cjs/shared/react/index.d.ts +2 -0
  33. package/dist/cjs/shared/react/index.js +2 -0
  34. package/dist/cjs/shared/react/stores/currencyModalStore.d.ts +7 -0
  35. package/dist/cjs/shared/react/stores/currencyModalStore.js +9 -0
  36. package/dist/cjs/shared/react/stores/currencyStore.d.ts +51 -0
  37. package/dist/cjs/shared/react/stores/currencyStore.js +57 -0
  38. package/dist/cjs/shared/react/stores/index.d.ts +2 -0
  39. package/dist/cjs/shared/react/stores/index.js +18 -0
  40. package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -0
  41. package/dist/esm/anyspend/react/components/AnySpend.js +11 -4
  42. package/dist/esm/anyspend/react/components/AnySpendCustom.js +10 -3
  43. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +1 -0
  44. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
  45. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
  46. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +5 -3
  47. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +12 -0
  48. package/dist/esm/anyspend/types/api.d.ts +2 -10
  49. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  50. package/dist/esm/global-account/react/components/index.d.ts +8 -7
  51. package/dist/esm/global-account/react/components/index.js +8 -7
  52. package/dist/esm/global-account/react/components/ui/dropdown-menu.d.ts +27 -0
  53. package/dist/esm/global-account/react/components/ui/dropdown-menu.js +60 -0
  54. package/dist/esm/global-account/react/stores/useModalStore.d.ts +5 -1
  55. package/dist/esm/shared/constants/currency.d.ts +1 -0
  56. package/dist/esm/shared/constants/currency.js +2 -0
  57. package/dist/esm/shared/constants/index.d.ts +1 -0
  58. package/dist/esm/shared/constants/index.js +1 -0
  59. package/dist/esm/shared/react/components/CurrencySelector.d.ts +7 -0
  60. package/dist/esm/shared/react/components/CurrencySelector.js +11 -0
  61. package/dist/esm/shared/react/components/FormattedCurrency.d.ts +12 -0
  62. package/dist/esm/shared/react/components/FormattedCurrency.js +57 -0
  63. package/dist/esm/shared/react/components/index.d.ts +2 -0
  64. package/dist/esm/shared/react/components/index.js +2 -0
  65. package/dist/esm/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts +1 -0
  66. package/dist/esm/shared/react/hooks/__tests__/useCurrencyConversion.test.js +243 -0
  67. package/dist/esm/shared/react/hooks/index.d.ts +1 -0
  68. package/dist/esm/shared/react/hooks/index.js +1 -0
  69. package/dist/esm/shared/react/hooks/useCurrencyConversion.d.ts +35 -0
  70. package/dist/esm/shared/react/hooks/useCurrencyConversion.js +197 -0
  71. package/dist/esm/shared/react/index.d.ts +2 -0
  72. package/dist/esm/shared/react/index.js +2 -0
  73. package/dist/esm/shared/react/stores/currencyModalStore.d.ts +7 -0
  74. package/dist/esm/shared/react/stores/currencyModalStore.js +6 -0
  75. package/dist/esm/shared/react/stores/currencyStore.d.ts +51 -0
  76. package/dist/esm/shared/react/stores/currencyStore.js +54 -0
  77. package/dist/esm/shared/react/stores/index.d.ts +2 -0
  78. package/dist/esm/shared/react/stores/index.js +2 -0
  79. package/dist/styles/index.css +1 -1
  80. package/dist/types/anyspend/react/components/AnySpend.d.ts +1 -0
  81. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +1 -0
  82. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
  83. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +12 -0
  84. package/dist/types/anyspend/types/api.d.ts +2 -10
  85. package/dist/types/global-account/react/components/index.d.ts +8 -7
  86. package/dist/types/global-account/react/components/ui/dropdown-menu.d.ts +27 -0
  87. package/dist/types/global-account/react/stores/useModalStore.d.ts +5 -1
  88. package/dist/types/shared/constants/currency.d.ts +1 -0
  89. package/dist/types/shared/constants/index.d.ts +1 -0
  90. package/dist/types/shared/react/components/CurrencySelector.d.ts +7 -0
  91. package/dist/types/shared/react/components/FormattedCurrency.d.ts +12 -0
  92. package/dist/types/shared/react/components/index.d.ts +2 -0
  93. package/dist/types/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts +1 -0
  94. package/dist/types/shared/react/hooks/index.d.ts +1 -0
  95. package/dist/types/shared/react/hooks/useCurrencyConversion.d.ts +35 -0
  96. package/dist/types/shared/react/index.d.ts +2 -0
  97. package/dist/types/shared/react/stores/currencyModalStore.d.ts +7 -0
  98. package/dist/types/shared/react/stores/currencyStore.d.ts +51 -0
  99. package/dist/types/shared/react/stores/index.d.ts +2 -0
  100. package/package.json +29 -3
  101. package/src/anyspend/react/components/AnySpend.tsx +15 -2
  102. package/src/anyspend/react/components/AnySpendCustom.tsx +11 -2
  103. package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
  104. package/src/anyspend/react/components/common/PanelOnramp.tsx +19 -15
  105. package/src/anyspend/types/api.ts +2 -10
  106. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -7
  107. package/src/global-account/react/components/index.ts +19 -12
  108. package/src/global-account/react/components/ui/dropdown-menu.tsx +132 -0
  109. package/src/global-account/react/stores/useModalStore.ts +5 -1
  110. package/src/shared/constants/currency.ts +2 -0
  111. package/src/shared/constants/index.ts +2 -0
  112. package/src/shared/react/components/CurrencySelector.tsx +71 -0
  113. package/src/shared/react/components/FormattedCurrency.tsx +106 -0
  114. package/src/shared/react/components/index.ts +2 -0
  115. package/src/shared/react/hooks/__tests__/useCurrencyConversion.test.ts +308 -0
  116. package/src/shared/react/hooks/index.ts +1 -0
  117. package/src/shared/react/hooks/useCurrencyConversion.ts +211 -0
  118. package/src/shared/react/index.ts +2 -0
  119. package/src/shared/react/stores/currencyModalStore.ts +13 -0
  120. package/src/shared/react/stores/currencyStore.ts +82 -0
  121. package/src/shared/react/stores/index.ts +2 -0
@@ -12,6 +12,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
12
12
  errorDetails: string | null;
13
13
  createdAt: number;
14
14
  expiredAt: number;
15
+ filledAt: number | null;
15
16
  creatorAddress: string | null;
16
17
  partnerId: string | null;
17
18
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -34,6 +35,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
34
35
  errorDetails: string | null;
35
36
  createdAt: number;
36
37
  expiredAt: number;
38
+ filledAt: number | null;
37
39
  creatorAddress: string | null;
38
40
  partnerId: string | null;
39
41
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -56,6 +58,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
56
58
  errorDetails: string | null;
57
59
  createdAt: number;
58
60
  expiredAt: number;
61
+ filledAt: number | null;
59
62
  creatorAddress: string | null;
60
63
  partnerId: string | null;
61
64
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -78,6 +81,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
78
81
  errorDetails: string | null;
79
82
  createdAt: number;
80
83
  expiredAt: number;
84
+ filledAt: number | null;
81
85
  creatorAddress: string | null;
82
86
  partnerId: string | null;
83
87
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -100,6 +104,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
100
104
  errorDetails: string | null;
101
105
  createdAt: number;
102
106
  expiredAt: number;
107
+ filledAt: number | null;
103
108
  creatorAddress: string | null;
104
109
  partnerId: string | null;
105
110
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -122,6 +127,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
122
127
  errorDetails: string | null;
123
128
  createdAt: number;
124
129
  expiredAt: number;
130
+ filledAt: number | null;
125
131
  creatorAddress: string | null;
126
132
  partnerId: string | null;
127
133
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -147,6 +153,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
147
153
  errorDetails: string | null;
148
154
  createdAt: number;
149
155
  expiredAt: number;
156
+ filledAt: number | null;
150
157
  creatorAddress: string | null;
151
158
  partnerId: string | null;
152
159
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -169,6 +176,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
169
176
  errorDetails: string | null;
170
177
  createdAt: number;
171
178
  expiredAt: number;
179
+ filledAt: number | null;
172
180
  creatorAddress: string | null;
173
181
  partnerId: string | null;
174
182
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -191,6 +199,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
191
199
  errorDetails: string | null;
192
200
  createdAt: number;
193
201
  expiredAt: number;
202
+ filledAt: number | null;
194
203
  creatorAddress: string | null;
195
204
  partnerId: string | null;
196
205
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -213,6 +222,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
213
222
  errorDetails: string | null;
214
223
  createdAt: number;
215
224
  expiredAt: number;
225
+ filledAt: number | null;
216
226
  creatorAddress: string | null;
217
227
  partnerId: string | null;
218
228
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -235,6 +245,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
235
245
  errorDetails: string | null;
236
246
  createdAt: number;
237
247
  expiredAt: number;
248
+ filledAt: number | null;
238
249
  creatorAddress: string | null;
239
250
  partnerId: string | null;
240
251
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -257,6 +268,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
257
268
  errorDetails: string | null;
258
269
  createdAt: number;
259
270
  expiredAt: number;
271
+ filledAt: number | null;
260
272
  creatorAddress: string | null;
261
273
  partnerId: string | null;
262
274
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -1117,11 +1117,6 @@ export interface components {
1117
1117
  * @example 990000
1118
1118
  */
1119
1119
  actualDstAmount: string | null;
1120
- /**
1121
- * @description Amount in after fee
1122
- * @example 990000
1123
- */
1124
- amountInAfterFee: string | null;
1125
1120
  };
1126
1121
  /** @description HypeDuel-specific payload */
1127
1122
  HypeDuelPayload: {
@@ -1135,11 +1130,6 @@ export interface components {
1135
1130
  * @example 990000
1136
1131
  */
1137
1132
  actualDstAmount: string | null;
1138
- /**
1139
- * @description Amount in after fee
1140
- * @example 990000
1141
- */
1142
- amountInAfterFee: string | null;
1143
1133
  };
1144
1134
  /** @description Custom execution payload */
1145
1135
  CustomPayload: {
@@ -1307,6 +1297,8 @@ export interface components {
1307
1297
  * @example 1752506694679
1308
1298
  */
1309
1299
  expiredAt: number;
1300
+ /** @description Timestamp when the order was filled/executed */
1301
+ filledAt: number | null;
1310
1302
  /**
1311
1303
  * @description Optional creator address
1312
1304
  * @example 0xb34facb90a200251318e8841c05102366f2158cf
@@ -39,7 +39,7 @@ export function SignIn(props) {
39
39
  // TODO: Figure out why setting anchor on mobile causes z-index issues where it appears under elements
40
40
  anchor: isMobile ? "top end" : undefined, children: _jsxs("div", { className: "bg-b3-react-background", children: [connectedEOAWallet ? (_jsxs("div", { className: cn("border-b3-react-subtle bg-b3-react-background flex cursor-pointer items-center justify-between rounded-xl p-3"), onClick: () => handleSetActiveAccount(connectedEOAWallet?.id), children: [_jsxs("div", { className: "flex items-center", children: [_jsx("img", { className: "bg-b3-react-primary h-16 w-16 rounded-full opacity-100", src: eoaWalletIcon, alt: connectedEOAWallet?.id }), _jsxs("div", { className: "ml-4 grow", children: [ensName && _jsx("div", { children: ensName }), _jsx("div", { children: truncateAddress(globalAddress) }), _jsx("div", { children: walletInfo?.name })] })] }), isActiveEOAWallet && _jsx(Icon, { className: "fill-b3-react-primary", name: "check" })] })) : (connectedSmartWallet && (_jsxs("div", { className: cn("mb-2 flex cursor-pointer items-center justify-between rounded-xl p-3", isActiveSmartWallet
41
41
  ? "bg-b3-react-background"
42
- : "bg-b3-react-background hover:bg-b3-react-background"), onClick: () => handleSetActiveAccount(connectedSmartWallet?.id), children: [_jsxs("div", { className: "flex items-center", children: [_jsx("img", { className: "bg-b3-react-primary h-16 w-16 rounded-full opacity-100", src: smartWalletIcon, alt: connectedSmartWallet?.id }), _jsxs("div", { className: "grow pl-4", children: [ensName && _jsx("div", { children: ensName }), _jsx("div", { children: truncateAddress(globalAddress) }), _jsx("div", { children: "Smart wallet" })] })] }), isActiveSmartWallet && _jsx(Icon, { className: "fill-b3-react-primary", name: "check" })] }))), _jsx("div", { className: "ml-3", children: _jsx(ManageAccountButton, { ...props, className: "w-[calc(100%-12px)]" }) }), _jsx("button", { className: "mb-2 w-full space-y-1", onClick: onDisconnect, children: _jsxs("div", { className: "hover:bg-b3-react-background group flex h-12 items-center rounded-xl px-4 transition-colors", children: [_jsx(Icon, { className: "fill-b3-react-background group-hover:fill-b3-react-primary mr-4 shrink-0 transition-colors", name: "logout" }), _jsx("div", { className: "text-b3-react-background group-hover:text-b3-react-primary mr-auto transition-colors", children: "Disconnect" })] }) })] }) }) })] })) : (_jsx(SignInWithB3, { closeAfterLogin: true, onLoginSuccess: async (globalAccount) => {
42
+ : "bg-b3-react-background hover:bg-b3-react-background"), onClick: () => handleSetActiveAccount(connectedSmartWallet?.id), children: [_jsxs("div", { className: "flex items-center", children: [_jsx("img", { className: "bg-b3-react-primary h-16 w-16 rounded-full opacity-100", src: smartWalletIcon, alt: connectedSmartWallet?.id }), _jsxs("div", { className: "grow pl-4", children: [ensName && _jsx("div", { children: ensName }), _jsx("div", { children: truncateAddress(globalAddress) }), _jsx("div", { children: "Smart wallet" })] })] }), isActiveSmartWallet && _jsx(Icon, { className: "fill-b3-react-primary", name: "check" })] }))), _jsx("div", { className: "ml-3", children: _jsx(ManageAccountButton, { ...props, className: "w-[calc(100%-12px)]" }) }), _jsx("button", { className: "mb-2 w-full space-y-1", onClick: onDisconnect, children: _jsxs("div", { className: "hover:bg-b3-react-background group flex h-12 items-center rounded-xl px-4 transition-colors", children: [_jsx(Icon, { className: "fill-b3-react-primary mr-4 shrink-0 transition-colors", name: "logout" }), _jsx("div", { className: "text-b3-react-primary mr-auto transition-colors", children: "Disconnect" })] }) })] }) }) })] })) : (_jsx(SignInWithB3, { closeAfterLogin: true, onLoginSuccess: async (globalAccount) => {
43
43
  console.log("User authenticated with Global Account!", globalAccount);
44
44
  }, ...props })) }) }));
45
45
  }
@@ -4,12 +4,12 @@ export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
4
4
  export { B3Context, type B3ContextType } from "./B3Provider/types";
5
5
  export { useB3 } from "./B3Provider/useB3";
6
6
  export { StyleRoot } from "./StyleRoot";
7
- export { SignInWithB3 } from "./SignInWithB3/SignInWithB3";
8
- export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
9
- export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
10
7
  export { AuthButton } from "./SignInWithB3/components/AuthButton";
11
8
  export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
12
9
  export { WalletRow } from "./SignInWithB3/components/WalletRow";
10
+ export { SignInWithB3 } from "./SignInWithB3/SignInWithB3";
11
+ export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
12
+ export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
13
13
  export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
14
14
  export { getConnectOptionsFromStrategy, isWalletType, type AllowedStrategy } from "./SignInWithB3/utils/signInUtils";
15
15
  export { ManageAccount } from "./ManageAccount/ManageAccount";
@@ -24,21 +24,22 @@ export { ClientOnly } from "./custom/ClientOnly";
24
24
  export { CopyToClipboard } from "./custom/CopyToClipboard";
25
25
  export { StaggeredFadeLoader } from "./custom/StaggeredFadeLoader";
26
26
  export { WalletConnectorIcon } from "./custom/WalletConnectorIcon";
27
- export { Loading } from "./ui/Loading";
28
- export { ShinyButton } from "./ui/ShinyButton";
29
- export { TabTrigger, Tabs, TabsContent, TabsList, TabsTransitionWrapper } from "./ui/TabSystem";
30
- export { TabTrigger as TabTriggerPrimitive, TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, } from "./ui/Tabs";
31
27
  export { Badge, badgeVariants } from "./ui/badge";
32
28
  export { Button, buttonVariants } from "./ui/button";
33
29
  export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "./ui/command";
34
30
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./ui/dialog";
35
31
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, } from "./ui/drawer";
32
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "./ui/dropdown-menu";
36
33
  export { GlareCard } from "./ui/glare-card";
37
34
  export { GlareCardRounded } from "./ui/glare-card-rounded";
38
35
  export { Input } from "./ui/input";
36
+ export { Loading } from "./ui/Loading";
39
37
  export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
40
38
  export { ScrollArea, ScrollBar } from "./ui/scroll-area";
39
+ export { ShinyButton } from "./ui/ShinyButton";
41
40
  export { Skeleton } from "./ui/skeleton";
41
+ export { TabTrigger as TabTriggerPrimitive, TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, } from "./ui/Tabs";
42
+ export { TabTrigger, Tabs, TabsContent, TabsList, TabsTransitionWrapper } from "./ui/TabSystem";
42
43
  export { TextLoop } from "./ui/text-loop";
43
44
  export { TextShimmer } from "./ui/text-shimmer";
44
45
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
@@ -6,12 +6,12 @@ export { B3Context } from "./B3Provider/types.js";
6
6
  export { useB3 } from "./B3Provider/useB3.js";
7
7
  export { StyleRoot } from "./StyleRoot.js";
8
8
  // SignInWithB3 Components
9
- export { SignInWithB3 } from "./SignInWithB3/SignInWithB3.js";
10
- export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow.js";
11
- export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy.js";
12
9
  export { AuthButton } from "./SignInWithB3/components/AuthButton.js";
13
10
  export { PermissionItem } from "./SignInWithB3/components/PermissionItem.js";
14
11
  export { WalletRow } from "./SignInWithB3/components/WalletRow.js";
12
+ export { SignInWithB3 } from "./SignInWithB3/SignInWithB3.js";
13
+ export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow.js";
14
+ export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy.js";
15
15
  export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep.js";
16
16
  export { getConnectOptionsFromStrategy, isWalletType } from "./SignInWithB3/utils/signInUtils.js";
17
17
  // ManageAccount Components
@@ -34,21 +34,22 @@ export { CopyToClipboard } from "./custom/CopyToClipboard.js";
34
34
  export { StaggeredFadeLoader } from "./custom/StaggeredFadeLoader.js";
35
35
  export { WalletConnectorIcon } from "./custom/WalletConnectorIcon.js";
36
36
  // UI Components
37
- export { Loading } from "./ui/Loading.js";
38
- export { ShinyButton } from "./ui/ShinyButton.js";
39
- export { TabTrigger, Tabs, TabsContent, TabsList, TabsTransitionWrapper } from "./ui/TabSystem.js";
40
- export { TabTrigger as TabTriggerPrimitive, TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, } from "./ui/Tabs.js";
41
37
  export { Badge, badgeVariants } from "./ui/badge.js";
42
38
  export { Button, buttonVariants } from "./ui/button.js";
43
39
  export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "./ui/command.js";
44
40
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./ui/dialog.js";
45
41
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, } from "./ui/drawer.js";
42
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "./ui/dropdown-menu.js";
46
43
  export { GlareCard } from "./ui/glare-card.js";
47
44
  export { GlareCardRounded } from "./ui/glare-card-rounded.js";
48
45
  export { Input } from "./ui/input.js";
46
+ export { Loading } from "./ui/Loading.js";
49
47
  export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover.js";
50
48
  export { ScrollArea, ScrollBar } from "./ui/scroll-area.js";
49
+ export { ShinyButton } from "./ui/ShinyButton.js";
51
50
  export { Skeleton } from "./ui/skeleton.js";
51
+ export { TabTrigger as TabTriggerPrimitive, TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, } from "./ui/Tabs.js";
52
+ export { TabTrigger, Tabs, TabsContent, TabsList, TabsTransitionWrapper } from "./ui/TabSystem.js";
52
53
  export { TextLoop } from "./ui/text-loop.js";
53
54
  export { TextShimmer } from "./ui/text-shimmer.js";
54
55
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip.js";
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ interface DropdownMenuProps {
3
+ children: React.ReactNode;
4
+ }
5
+ interface DropdownMenuContentProps {
6
+ children: React.ReactNode;
7
+ align?: "start" | "center" | "end";
8
+ className?: string;
9
+ }
10
+ interface DropdownMenuItemProps {
11
+ children: React.ReactNode;
12
+ onClick?: () => void;
13
+ className?: string;
14
+ }
15
+ interface DropdownMenuSeparatorProps {
16
+ className?: string;
17
+ }
18
+ interface DropdownMenuTriggerProps {
19
+ children: React.ReactNode;
20
+ asChild?: boolean;
21
+ }
22
+ export declare function DropdownMenu({ children }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function DropdownMenuTrigger({ children, asChild }: DropdownMenuTriggerProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function DropdownMenuContent({ children, align, className }: DropdownMenuContentProps): import("react/jsx-runtime").JSX.Element | null;
25
+ export declare function DropdownMenuItem({ children, onClick, className }: DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function DropdownMenuSeparator({ className }: DropdownMenuSeparatorProps): import("react/jsx-runtime").JSX.Element;
27
+ export {};
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "../../../../shared/utils/index.js";
4
+ import * as React from "react";
5
+ const DropdownMenuContext = React.createContext({
6
+ isOpen: false,
7
+ setIsOpen: () => { },
8
+ });
9
+ export function DropdownMenu({ children }) {
10
+ const [isOpen, setIsOpen] = React.useState(false);
11
+ React.useEffect(() => {
12
+ const handleClickOutside = (event) => {
13
+ const target = event.target;
14
+ if (!target.closest("[data-dropdown-menu]")) {
15
+ setIsOpen(false);
16
+ }
17
+ };
18
+ if (isOpen) {
19
+ document.addEventListener("click", handleClickOutside);
20
+ return () => document.removeEventListener("click", handleClickOutside);
21
+ }
22
+ }, [isOpen]);
23
+ return (_jsx(DropdownMenuContext.Provider, { value: { isOpen, setIsOpen }, children: _jsx("div", { className: "relative", "data-dropdown-menu": true, children: children }) }));
24
+ }
25
+ export function DropdownMenuTrigger({ children, asChild }) {
26
+ const { isOpen, setIsOpen } = React.useContext(DropdownMenuContext);
27
+ const handleClick = () => {
28
+ setIsOpen(!isOpen);
29
+ };
30
+ if (asChild) {
31
+ if (React.isValidElement(children)) {
32
+ return React.cloneElement(children, {
33
+ onClick: handleClick,
34
+ });
35
+ }
36
+ }
37
+ return _jsx("button", { onClick: handleClick, children: children });
38
+ }
39
+ export function DropdownMenuContent({ children, align = "start", className }) {
40
+ const { isOpen } = React.useContext(DropdownMenuContext);
41
+ if (!isOpen)
42
+ return null;
43
+ const alignmentClasses = {
44
+ start: "left-0",
45
+ center: "left-1/2 -translate-x-1/2",
46
+ end: "right-0",
47
+ };
48
+ return (_jsx("div", { className: cn("bg-popover text-popover-foreground absolute top-full z-50 mt-1 min-w-32 overflow-hidden rounded-md border p-1 shadow-md", "border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800", alignmentClasses[align], className), children: children }));
49
+ }
50
+ export function DropdownMenuItem({ children, onClick, className }) {
51
+ const { setIsOpen } = React.useContext(DropdownMenuContext);
52
+ const handleClick = () => {
53
+ onClick?.();
54
+ setIsOpen(false);
55
+ };
56
+ return (_jsx("div", { className: cn("hover:bg-accent hover:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50", "hover:bg-gray-100 dark:hover:bg-gray-700", className), onClick: handleClick, children: children }));
57
+ }
58
+ export function DropdownMenuSeparator({ className }) {
59
+ return _jsx("div", { className: cn("bg-muted -mx-1 my-1 h-px", "bg-gray-200 dark:bg-gray-600", className) });
60
+ }
@@ -117,11 +117,13 @@ export interface AnySpendModalProps extends BaseModalProps {
117
117
  /** Whether to hide the transaction history button */
118
118
  hideTransactionHistoryButton?: boolean;
119
119
  /** Callback function called when the transaction is successful */
120
- onSuccess?: () => void;
120
+ onSuccess?: (txHash?: string) => void;
121
121
  /** Token address of the destination token to buy (enables buy mode) */
122
122
  destinationTokenAddress?: string;
123
123
  /** Chain ID where the destination token exists (enables buy mode) */
124
124
  destinationTokenChainId?: number;
125
+ /** Custom USD input values for quick amount buttons in fiat onramp */
126
+ customUsdInputValues?: string[];
125
127
  }
126
128
  /**
127
129
  * Props for the AnySpend NFT modal
@@ -290,6 +292,8 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
290
292
  mainFooter?: React.ReactNode;
291
293
  /** Callback function called when the deposit is successful */
292
294
  onSuccess?: (amount?: string) => void;
295
+ /** Custom USD input values for quick amount buttons in fiat onramp */
296
+ customUsdInputValues?: string[];
293
297
  }
294
298
  export interface AvatarEditorModalProps extends BaseModalProps {
295
299
  /** Modal type identifier */
@@ -0,0 +1 @@
1
+ export declare const B3_COIN_IMAGE_URL = "https://cdn.b3.fun/b3-coin-3d.png";
@@ -0,0 +1,2 @@
1
+ // B3 Token image URL
2
+ export const B3_COIN_IMAGE_URL = "https://cdn.b3.fun/b3-coin-3d.png";
@@ -1,3 +1,4 @@
1
+ export * from "./currency";
1
2
  export declare const siteURL = "https://basement.fun";
2
3
  export declare const b3CoinIcon = "https://cdn.b3.fun/b3-coin-3d.png";
3
4
  export declare const ecosystemWalletId: `ecosystem.${string}`;
@@ -1,3 +1,4 @@
1
+ export * from "./currency.js";
1
2
  export const siteURL = "https://basement.fun";
2
3
  export const b3CoinIcon = "https://cdn.b3.fun/b3-coin-3d.png";
3
4
  export const ecosystemWalletId = (process.env.NEXT_PUBLIC_THIRDWEB_ECOSYSTEM_ID ||
@@ -0,0 +1,7 @@
1
+ interface CurrencySelectorProps {
2
+ labelClassName?: string;
3
+ buttonVariant?: "dark" | "primary" | "ghost" | "gold";
4
+ label?: string;
5
+ }
6
+ export declare function CurrencySelector({ labelClassName, buttonVariant, label }: CurrencySelectorProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../../shared/utils/index.js";
4
+ import { Button } from "../../../global-account/react/components/ui/button.js";
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "../../../global-account/react/components/ui/dropdown-menu.js";
6
+ import { CURRENCY_NAMES, CURRENCY_SYMBOLS, useCurrencyStore } from "../stores/currencyStore.js";
7
+ const currencies = ["B3", "ETH", "SOL", "USD", "EUR", "GBP", "KRW", "JPY", "CAD", "AUD"];
8
+ export function CurrencySelector({ labelClassName, buttonVariant = "dark", label }) {
9
+ const { selectedCurrency, setSelectedCurrency } = useCurrencyStore();
10
+ return (_jsx("div", { className: "flex items-center gap-2", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("div", { className: "flex items-center gap-3", children: [label && (_jsx("span", { className: cn("text-foreground text-sm font-medium leading-none tracking-tight sm:text-base", labelClassName), children: label })), _jsxs(Button, { variant: buttonVariant, className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium", children: CURRENCY_NAMES[selectedCurrency] }), _jsx("svg", { className: "h-4 w-4", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }) })] })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "z-[100] min-w-[200px]", children: currencies.map(currency => (_jsxs("div", { children: [_jsxs(DropdownMenuItem, { onClick: () => setSelectedCurrency(currency), className: `flex cursor-pointer items-center justify-between gap-3 px-3 py-2.5 transition-colors ${selectedCurrency === currency ? "bg-accent" : "hover:bg-accent/50"}`, children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: CURRENCY_NAMES[currency] }), _jsx("span", { className: "text-muted-foreground text-xs font-medium", children: CURRENCY_SYMBOLS[currency] })] }), currency === "SOL" && _jsx(DropdownMenuSeparator, { className: "bg-border my-1" }, "separator")] }, currency))) })] }) }));
11
+ }
@@ -0,0 +1,12 @@
1
+ interface FormattedCurrencyProps {
2
+ amount: number;
3
+ showChange?: boolean;
4
+ showColor?: boolean;
5
+ className?: string;
6
+ subB3Icon?: boolean;
7
+ clickable?: boolean;
8
+ decimals?: number;
9
+ currency?: string;
10
+ }
11
+ export declare function FormattedCurrency({ amount, showChange, showColor, className, subB3Icon, clickable, decimals, currency, }: FormattedCurrencyProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { B3_COIN_IMAGE_URL } from "../../../shared/constants/currency.js";
4
+ import { cn } from "../../../shared/utils/index.js";
5
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../../../global-account/react/components/ui/tooltip.js";
6
+ import { useCurrencyConversion } from "../hooks/useCurrencyConversion.js";
7
+ import { useCurrencyModalStore } from "../stores/currencyModalStore.js";
8
+ export function FormattedCurrency({ amount, showChange = false, showColor = false, className, subB3Icon = true, clickable = true, decimals, currency, }) {
9
+ const { formatCurrencyValue, formatTooltipValue, selectedCurrency, baseCurrency } = useCurrencyConversion();
10
+ const { openModal } = useCurrencyModalStore();
11
+ // Use passed currency or fall back to selected currency
12
+ const activeCurrency = currency || selectedCurrency;
13
+ const isPositive = amount >= 0;
14
+ // Get the formatted value (using absolute value for negative numbers when showing change)
15
+ const baseAmount = showChange ? Math.abs(amount) : amount;
16
+ // Use centralized formatting from hook with optional overrides
17
+ const formattedValue = formatCurrencyValue(baseAmount, {
18
+ decimals,
19
+ currency,
20
+ });
21
+ // Generate tooltip using the centralized hook function
22
+ const baseTooltipValue = formatTooltipValue(amount, currency);
23
+ // Add change indicator if needed
24
+ const tooltipValue = showChange ? `${isPositive ? "+" : "-"}${baseTooltipValue}` : baseTooltipValue;
25
+ // Determine color class
26
+ let colorClass = "";
27
+ if (showColor) {
28
+ if (isPositive) {
29
+ colorClass = "text-green-400";
30
+ }
31
+ else {
32
+ colorClass = "text-red-400";
33
+ }
34
+ }
35
+ // Add change indicator
36
+ let displayValue = formattedValue;
37
+ if (showChange) {
38
+ if (isPositive) {
39
+ displayValue = `+${formattedValue}`;
40
+ }
41
+ else {
42
+ displayValue = `-${formattedValue}`;
43
+ }
44
+ }
45
+ const handleClick = () => {
46
+ if (clickable) {
47
+ openModal();
48
+ }
49
+ };
50
+ return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("span", { onClick: handleClick, className: cn("inline-flex items-center gap-1 whitespace-nowrap", colorClass, className, clickable && "cursor-pointer transition-opacity hover:opacity-80"), children: [subB3Icon &&
51
+ (currency === baseCurrency || (!currency && activeCurrency === baseCurrency)) &&
52
+ baseCurrency === "B3"
53
+ ? displayValue.split(" ")[0]
54
+ : displayValue, subB3Icon &&
55
+ (currency === baseCurrency || (!currency && activeCurrency === baseCurrency)) &&
56
+ baseCurrency === "B3" && (_jsx("img", { src: B3_COIN_IMAGE_URL, className: "inline-block h-4 w-4 align-middle", alt: "B3 coin" }))] }) }), _jsx(TooltipContent, { children: tooltipValue })] }));
57
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./CurrencySelector";
2
+ export * from "./FormattedCurrency";
@@ -0,0 +1,2 @@
1
+ export * from "./CurrencySelector.js";
2
+ export * from "./FormattedCurrency.js";