@b3dotfun/sdk 0.0.58 → 0.0.59-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 (63) hide show
  1. package/dist/cjs/anyspend/abis/upsideStaking.d.ts +1 -1030
  2. package/dist/cjs/anyspend/abis/upsideStaking.js +2 -570
  3. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
  4. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +8 -18
  5. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -0
  6. package/dist/cjs/anyspend/utils/accountStore.d.ts +7 -0
  7. package/dist/cjs/anyspend/utils/accountStore.js +8 -0
  8. package/dist/cjs/anyspend/utils/index.d.ts +1 -0
  9. package/dist/cjs/anyspend/utils/index.js +1 -0
  10. package/dist/cjs/global-account/react/components/B3DynamicModal.js +17 -0
  11. package/dist/cjs/global-account/react/hooks/useWagmiConfig.d.ts +441 -1
  12. package/dist/cjs/global-account/react/hooks/useWagmiConfig.js +2 -0
  13. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -2
  14. package/dist/cjs/shared/react/components/CurrencySelector.js +8 -3
  15. package/dist/cjs/shared/react/components/FormattedCurrency.d.ts +3 -3
  16. package/dist/cjs/shared/react/components/FormattedCurrency.js +31 -26
  17. package/dist/cjs/shared/react/hooks/useCurrencyConversion.d.ts +8 -5
  18. package/dist/cjs/shared/react/hooks/useCurrencyConversion.js +153 -94
  19. package/dist/cjs/shared/react/stores/currencyStore.d.ts +83 -8
  20. package/dist/cjs/shared/react/stores/currencyStore.js +147 -5
  21. package/dist/esm/anyspend/abis/upsideStaking.d.ts +1 -1030
  22. package/dist/esm/anyspend/abis/upsideStaking.js +1 -569
  23. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
  24. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +9 -19
  25. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +5 -1
  26. package/dist/esm/anyspend/utils/accountStore.d.ts +7 -0
  27. package/dist/esm/anyspend/utils/accountStore.js +5 -0
  28. package/dist/esm/anyspend/utils/index.d.ts +1 -0
  29. package/dist/esm/anyspend/utils/index.js +1 -0
  30. package/dist/esm/global-account/react/components/B3DynamicModal.js +17 -0
  31. package/dist/esm/global-account/react/hooks/useWagmiConfig.d.ts +441 -1
  32. package/dist/esm/global-account/react/hooks/useWagmiConfig.js +2 -0
  33. package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -2
  34. package/dist/esm/shared/react/components/CurrencySelector.js +10 -5
  35. package/dist/esm/shared/react/components/FormattedCurrency.d.ts +3 -3
  36. package/dist/esm/shared/react/components/FormattedCurrency.js +31 -26
  37. package/dist/esm/shared/react/hooks/useCurrencyConversion.d.ts +8 -5
  38. package/dist/esm/shared/react/hooks/useCurrencyConversion.js +154 -95
  39. package/dist/esm/shared/react/stores/currencyStore.d.ts +83 -8
  40. package/dist/esm/shared/react/stores/currencyStore.js +143 -5
  41. package/dist/types/anyspend/abis/upsideStaking.d.ts +1 -1030
  42. package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
  43. package/dist/types/anyspend/utils/accountStore.d.ts +7 -0
  44. package/dist/types/anyspend/utils/index.d.ts +1 -0
  45. package/dist/types/global-account/react/hooks/useWagmiConfig.d.ts +441 -1
  46. package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -2
  47. package/dist/types/shared/react/components/FormattedCurrency.d.ts +3 -3
  48. package/dist/types/shared/react/hooks/useCurrencyConversion.d.ts +8 -5
  49. package/dist/types/shared/react/stores/currencyStore.d.ts +83 -8
  50. package/package.json +4 -3
  51. package/src/anyspend/abis/upsideStaking.ts +1 -570
  52. package/src/anyspend/react/components/AnySpendStakeUpside.tsx +8 -19
  53. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +6 -2
  54. package/src/anyspend/utils/accountStore.ts +12 -0
  55. package/src/anyspend/utils/index.ts +1 -0
  56. package/src/global-account/react/components/B3DynamicModal.tsx +20 -0
  57. package/src/global-account/react/hooks/useWagmiConfig.tsx +2 -0
  58. package/src/global-account/react/stores/useModalStore.ts +0 -2
  59. package/src/shared/react/components/CurrencySelector.tsx +36 -5
  60. package/src/shared/react/components/FormattedCurrency.tsx +36 -30
  61. package/src/shared/react/hooks/__tests__/useCurrencyConversion.test.ts +14 -14
  62. package/src/shared/react/hooks/useCurrencyConversion.ts +163 -96
  63. package/src/shared/react/stores/currencyStore.ts +216 -10
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useGlobalWalletState = void 0;
4
+ const zustand_1 = require("zustand");
5
+ exports.useGlobalWalletState = (0, zustand_1.create)(set => ({
6
+ globalAccountWallet: undefined,
7
+ setGlobalAccountWallet: account => set({ globalAccountWallet: account }),
8
+ }));
@@ -1,3 +1,4 @@
1
+ export * from "./accountStore";
1
2
  export * from "./address";
2
3
  export * from "./chain";
3
4
  export * from "./format";
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./accountStore"), exports);
17
18
  __exportStar(require("./address"), exports);
18
19
  __exportStar(require("./chain"), exports);
19
20
  __exportStar(require("./format"), exports);
@@ -5,9 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("../../../anyspend/react");
6
6
  const AnyspendDepositHype_1 = require("../../../anyspend/react/components/AnyspendDepositHype");
7
7
  const AnySpendStakeUpside_1 = require("../../../anyspend/react/components/AnySpendStakeUpside");
8
+ const utils_1 = require("../../../anyspend/utils");
8
9
  const react_2 = require("../../../global-account/react");
9
10
  const cn_1 = require("../../../shared/utils/cn");
10
11
  const debug_1 = require("../../../shared/utils/debug");
12
+ const react_3 = require("react");
11
13
  const AvatarEditor_1 = require("./AvatarEditor/AvatarEditor");
12
14
  const useB3_1 = require("./B3Provider/useB3");
13
15
  const LinkAccount_1 = require("./LinkAccount/LinkAccount");
@@ -16,11 +18,26 @@ const RequestPermissions_1 = require("./RequestPermissions/RequestPermissions");
16
18
  const SignInWithB3Flow_1 = require("./SignInWithB3/SignInWithB3Flow");
17
19
  const dialog_1 = require("./ui/dialog");
18
20
  const drawer_1 = require("./ui/drawer");
21
+ const react_4 = require("thirdweb/react");
19
22
  const debug = (0, debug_1.debugB3React)("B3DynamicModal");
20
23
  function B3DynamicModal() {
21
24
  const { isOpen, setB3ModalOpen, contentType, history, navigateBack } = (0, react_2.useModalStore)();
22
25
  const { theme } = (0, useB3_1.useB3)();
23
26
  const isMobile = (0, react_2.useIsMobile)();
27
+ const prevIsOpenRef = (0, react_3.useRef)(isOpen);
28
+ const globalAccountWallet = (0, utils_1.useGlobalWalletState)(state => state.globalAccountWallet);
29
+ const setGlobalAccountWallet = (0, utils_1.useGlobalWalletState)(state => state.setGlobalAccountWallet);
30
+ const setActiveWallet = (0, react_4.useSetActiveWallet)();
31
+ // anyspend cleanup global account chnages by setting account back
32
+ (0, react_3.useEffect)(() => {
33
+ if (prevIsOpenRef.current && !isOpen) {
34
+ if (globalAccountWallet) {
35
+ setActiveWallet(globalAccountWallet);
36
+ setGlobalAccountWallet(undefined);
37
+ }
38
+ }
39
+ prevIsOpenRef.current = isOpen;
40
+ }, [isOpen, globalAccountWallet, setActiveWallet, setGlobalAccountWallet]);
24
41
  // Define arrays for different modal type groups
25
42
  const fullWidthTypes = [
26
43
  "anySpend",
@@ -10,4 +10,444 @@ export declare function useWagmiConfig(partnerId: string, rpcUrls?: Record<numbe
10
10
  }>;
11
11
  }, {
12
12
  "thirdweb:lastChainId": number;
13
- }>]>;
13
+ }>, import("wagmi").CreateConnectorFn<{
14
+ request: import("ox/_types/core/Provider").RequestFn<{
15
+ Request: {
16
+ method: "eth_accounts";
17
+ params?: undefined;
18
+ };
19
+ ReturnType: readonly import("ox/_types/core/Address").Address[];
20
+ } | {
21
+ Request: {
22
+ method: "eth_blobBaseFee";
23
+ params?: undefined;
24
+ };
25
+ ReturnType: import("ox/_types/core/Hex").Hex;
26
+ } | {
27
+ Request: {
28
+ method: "eth_blockNumber";
29
+ params?: undefined;
30
+ };
31
+ ReturnType: import("ox/_types/core/Hex").Hex;
32
+ } | {
33
+ Request: {
34
+ method: "eth_call";
35
+ params: [transaction: import("ox/_types/core/TransactionRequest").Rpc] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier, stateOverride: unknown];
36
+ };
37
+ ReturnType: import("ox/_types/core/Hex").Hex;
38
+ } | {
39
+ Request: {
40
+ method: "eth_chainId";
41
+ params?: undefined;
42
+ };
43
+ ReturnType: import("ox/_types/core/Hex").Hex;
44
+ } | {
45
+ Request: {
46
+ method: "eth_coinbase";
47
+ params?: undefined;
48
+ };
49
+ ReturnType: import("ox/_types/core/Address").Address;
50
+ } | {
51
+ Request: {
52
+ method: "eth_estimateGas";
53
+ params: [transaction: import("ox/_types/core/TransactionRequest").Rpc] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier, stateOverride: unknown];
54
+ };
55
+ ReturnType: import("ox/_types/core/Hex").Hex;
56
+ } | {
57
+ Request: {
58
+ method: "eth_feeHistory";
59
+ params: [blockCount: import("ox/_types/core/Hex").Hex, newestBlock: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag, rewardPercentiles: number[] | undefined];
60
+ };
61
+ ReturnType: import("ox/_types/core/Fee").FeeHistoryRpc;
62
+ } | {
63
+ Request: {
64
+ method: "eth_gasPrice";
65
+ params?: undefined;
66
+ };
67
+ ReturnType: import("ox/_types/core/Hex").Hex;
68
+ } | {
69
+ Request: {
70
+ method: "eth_getBalance";
71
+ params: [address: import("ox/_types/core/Address").Address, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
72
+ };
73
+ ReturnType: import("ox/_types/core/Hex").Hex;
74
+ } | {
75
+ Request: {
76
+ method: "eth_getBlockByHash";
77
+ params: [hash: import("ox/_types/core/Hex").Hex, includeTransactionObjects: boolean];
78
+ };
79
+ ReturnType: import("ox/_types/core/Block").Rpc | null;
80
+ } | {
81
+ Request: {
82
+ method: "eth_getBlockByNumber";
83
+ params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag, includeTransactionObjects: boolean];
84
+ };
85
+ ReturnType: import("ox/_types/core/Block").Rpc | null;
86
+ } | {
87
+ Request: {
88
+ method: "eth_getBlockTransactionCountByHash";
89
+ params: [hash: import("ox/_types/core/Hex").Hex];
90
+ };
91
+ ReturnType: import("ox/_types/core/Hex").Hex;
92
+ } | {
93
+ Request: {
94
+ method: "eth_getBlockTransactionCountByNumber";
95
+ params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag];
96
+ };
97
+ ReturnType: import("ox/_types/core/Hex").Hex;
98
+ } | {
99
+ Request: {
100
+ method: "eth_getCode";
101
+ params: [address: import("ox/_types/core/Address").Address, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
102
+ };
103
+ ReturnType: import("ox/_types/core/Hex").Hex;
104
+ } | {
105
+ Request: {
106
+ method: "eth_getFilterChanges";
107
+ params: [filterId: import("ox/_types/core/Hex").Hex];
108
+ };
109
+ ReturnType: readonly import("ox/_types/core/Log").Rpc[] | readonly import("ox/_types/core/Hex").Hex[];
110
+ } | {
111
+ Request: {
112
+ method: "eth_getFilterLogs";
113
+ params: [filterId: import("ox/_types/core/Hex").Hex];
114
+ };
115
+ ReturnType: readonly import("ox/_types/core/Log").Rpc[];
116
+ } | {
117
+ Request: {
118
+ method: "eth_getLogs";
119
+ params: [filter: import("ox/_types/core/Filter").Rpc];
120
+ };
121
+ ReturnType: readonly import("ox/_types/core/Log").Rpc[];
122
+ } | {
123
+ Request: {
124
+ method: "eth_getProof";
125
+ params: [address: import("ox/_types/core/Address").Address, storageKeys: import("ox/_types/core/Hex").Hex[], block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
126
+ };
127
+ ReturnType: import("ox/_types/core/AccountProof").Rpc;
128
+ } | {
129
+ Request: {
130
+ method: "eth_getStorageAt";
131
+ params: [address: import("ox/_types/core/Address").Address, index: import("ox/_types/core/Hex").Hex, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
132
+ };
133
+ ReturnType: import("ox/_types/core/Hex").Hex;
134
+ } | {
135
+ Request: {
136
+ method: "eth_getTransactionByBlockHashAndIndex";
137
+ params: [hash: import("ox/_types/core/Hex").Hex, index: import("ox/_types/core/Hex").Hex];
138
+ };
139
+ ReturnType: import("ox/_types/core/Transaction").Rpc | null;
140
+ } | {
141
+ Request: {
142
+ method: "eth_getTransactionByBlockNumberAndIndex";
143
+ params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag, index: import("ox/_types/core/Hex").Hex];
144
+ };
145
+ ReturnType: import("ox/_types/core/Transaction").Rpc | null;
146
+ } | {
147
+ Request: {
148
+ method: "eth_getTransactionByHash";
149
+ params: [hash: import("ox/_types/core/Hex").Hex];
150
+ };
151
+ ReturnType: import("ox/_types/core/Transaction").Rpc | null;
152
+ } | {
153
+ Request: {
154
+ method: "eth_getTransactionCount";
155
+ params: [address: import("ox/_types/core/Address").Address, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
156
+ };
157
+ ReturnType: import("ox/_types/core/Hex").Hex;
158
+ } | {
159
+ Request: {
160
+ method: "eth_getTransactionReceipt";
161
+ params: [hash: import("ox/_types/core/Hex").Hex];
162
+ };
163
+ ReturnType: import("ox/_types/core/TransactionReceipt").Rpc | null;
164
+ } | {
165
+ Request: {
166
+ method: "eth_getUncleCountByBlockHash";
167
+ params: [hash: import("ox/_types/core/Hex").Hex];
168
+ };
169
+ ReturnType: import("ox/_types/core/Hex").Hex;
170
+ } | {
171
+ Request: {
172
+ method: "eth_getUncleCountByBlockNumber";
173
+ params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag];
174
+ };
175
+ ReturnType: import("ox/_types/core/Hex").Hex;
176
+ } | {
177
+ Request: {
178
+ method: "eth_maxPriorityFeePerGas";
179
+ params?: undefined;
180
+ };
181
+ ReturnType: import("ox/_types/core/Hex").Hex;
182
+ } | {
183
+ Request: {
184
+ method: "eth_newBlockFilter";
185
+ params?: undefined;
186
+ };
187
+ ReturnType: import("ox/_types/core/Hex").Hex;
188
+ } | {
189
+ Request: {
190
+ method: "eth_newFilter";
191
+ params: [filter: import("ox/_types/core/Filter").Rpc];
192
+ };
193
+ ReturnType: import("ox/_types/core/Hex").Hex;
194
+ } | {
195
+ Request: {
196
+ method: "eth_newPendingTransactionFilter";
197
+ params?: undefined;
198
+ };
199
+ ReturnType: import("ox/_types/core/Hex").Hex;
200
+ } | {
201
+ Request: {
202
+ method: "eth_protocolVersion";
203
+ params?: undefined;
204
+ };
205
+ ReturnType: string;
206
+ } | {
207
+ Request: {
208
+ method: "eth_requestAccounts";
209
+ params?: undefined;
210
+ };
211
+ ReturnType: readonly import("ox/_types/core/Address").Address[];
212
+ } | {
213
+ Request: {
214
+ method: "eth_sendRawTransaction";
215
+ params: [serializedTransaction: import("ox/_types/core/Hex").Hex];
216
+ };
217
+ ReturnType: import("ox/_types/core/Hex").Hex;
218
+ } | {
219
+ Request: {
220
+ method: "eth_sendTransaction";
221
+ params: [transaction: import("ox/_types/core/TransactionRequest").Rpc];
222
+ };
223
+ ReturnType: import("ox/_types/core/Hex").Hex;
224
+ } | {
225
+ Request: {
226
+ method: "eth_signTransaction";
227
+ params: [request: import("ox/_types/core/TransactionRequest").Rpc];
228
+ };
229
+ ReturnType: import("ox/_types/core/Hex").Hex;
230
+ } | {
231
+ Request: {
232
+ method: "eth_signTypedData_v4";
233
+ params: [address: import("ox/_types/core/Address").Address, message: string];
234
+ };
235
+ ReturnType: import("ox/_types/core/Hex").Hex;
236
+ } | {
237
+ Request: {
238
+ method: "eth_uninstallFilter";
239
+ params: [filterId: import("ox/_types/core/Hex").Hex];
240
+ };
241
+ ReturnType: boolean;
242
+ } | {
243
+ Request: {
244
+ method: "eth_requestAccounts";
245
+ params?: undefined;
246
+ };
247
+ ReturnType: readonly import("ox/_types/core/Address").Address[];
248
+ } | {
249
+ Request: {
250
+ method: "eth_sendRawTransaction";
251
+ params: [serializedTransaction: import("ox/_types/core/Hex").Hex];
252
+ };
253
+ ReturnType: import("ox/_types/core/Hex").Hex;
254
+ } | {
255
+ Request: {
256
+ method: "eth_sendTransaction";
257
+ params: [transaction: import("ox/_types/core/TransactionRequest").Rpc];
258
+ };
259
+ ReturnType: import("ox/_types/core/Hex").Hex;
260
+ } | {
261
+ Request: {
262
+ method: "eth_signTransaction";
263
+ params: [request: import("ox/_types/core/TransactionRequest").Rpc];
264
+ };
265
+ ReturnType: import("ox/_types/core/Hex").Hex;
266
+ } | {
267
+ Request: {
268
+ method: "eth_signTypedData_v4";
269
+ params: [address: import("ox/_types/core/Address").Address, message: string];
270
+ };
271
+ ReturnType: import("ox/_types/core/Hex").Hex;
272
+ } | {
273
+ Request: {
274
+ method: "personal_sign";
275
+ params: [data: import("ox/_types/core/Hex").Hex, address: import("ox/_types/core/Address").Address];
276
+ };
277
+ ReturnType: import("ox/_types/core/Hex").Hex;
278
+ } | {
279
+ Request: {
280
+ method: "wallet_addEthereumChain";
281
+ params: [chain: {
282
+ chainId: string;
283
+ chainName: string;
284
+ nativeCurrency?: {
285
+ name: string;
286
+ symbol: string;
287
+ decimals: number;
288
+ } | undefined | undefined;
289
+ rpcUrls: readonly string[];
290
+ blockExplorerUrls?: readonly string[] | undefined;
291
+ iconUrls?: readonly string[] | undefined;
292
+ }];
293
+ };
294
+ ReturnType: null;
295
+ } | {
296
+ Request: {
297
+ method: "wallet_getCallsStatus";
298
+ params?: [string];
299
+ };
300
+ ReturnType: {
301
+ status: "PENDING" | "CONFIRMED";
302
+ receipts?: readonly {
303
+ logs: {
304
+ address: import("ox/_types/core/Hex").Hex;
305
+ data: import("ox/_types/core/Hex").Hex;
306
+ topics: readonly import("ox/_types/core/Hex").Hex[];
307
+ }[];
308
+ status: import("ox/_types/core/Hex").Hex;
309
+ blockHash: import("ox/_types/core/Hex").Hex;
310
+ blockNumber: import("ox/_types/core/Hex").Hex;
311
+ gasUsed: import("ox/_types/core/Hex").Hex;
312
+ transactionHash: import("ox/_types/core/Hex").Hex;
313
+ }[] | undefined;
314
+ };
315
+ } | {
316
+ Request: {
317
+ method: "wallet_getCapabilities";
318
+ params?: [import("ox/_types/core/Address").Address];
319
+ };
320
+ ReturnType: {
321
+ [x: `0x${string}`]: {
322
+ [capability: string]: any;
323
+ };
324
+ };
325
+ } | {
326
+ Request: {
327
+ method: "wallet_getPermissions";
328
+ params?: undefined;
329
+ };
330
+ ReturnType: readonly {
331
+ caveats: readonly {
332
+ type: string;
333
+ value: any;
334
+ }[];
335
+ date: number;
336
+ id: string;
337
+ invoker: `http://${string}` | `https://${string}`;
338
+ parentCapability: "eth_accounts" | string;
339
+ }[];
340
+ } | {
341
+ Request: {
342
+ method: "wallet_grantPermissions";
343
+ params?: [{
344
+ signer?: {
345
+ type: string;
346
+ data?: unknown | undefined;
347
+ } | undefined;
348
+ permissions: readonly {
349
+ data: unknown;
350
+ policies: readonly {
351
+ data: unknown;
352
+ type: string;
353
+ }[];
354
+ required?: boolean | undefined;
355
+ type: string;
356
+ }[];
357
+ expiry: number;
358
+ }];
359
+ };
360
+ ReturnType: {
361
+ expiry: number;
362
+ factory?: `0x${string}` | undefined | undefined;
363
+ factoryData?: string | undefined | undefined;
364
+ grantedPermissions: readonly {
365
+ data: unknown;
366
+ policies: readonly {
367
+ data: unknown;
368
+ type: string;
369
+ }[];
370
+ required?: boolean | undefined;
371
+ type: string;
372
+ }[];
373
+ permissionsContext: string;
374
+ signerData?: {
375
+ userOpBuilder?: `0x${string}` | undefined;
376
+ submitToAddress?: `0x${string}` | undefined;
377
+ } | undefined | undefined;
378
+ };
379
+ } | {
380
+ Request: {
381
+ method: "wallet_requestPermissions";
382
+ params: [permissions: {
383
+ eth_accounts: Record<string, any>;
384
+ }];
385
+ };
386
+ ReturnType: readonly {
387
+ caveats: readonly {
388
+ type: string;
389
+ value: any;
390
+ }[];
391
+ date: number;
392
+ id: string;
393
+ invoker: `http://${string}` | `https://${string}`;
394
+ parentCapability: "eth_accounts" | string;
395
+ }[];
396
+ } | {
397
+ Request: {
398
+ method: "wallet_revokePermissions";
399
+ params: [permissions: {
400
+ eth_accounts: Record<string, any>;
401
+ }];
402
+ };
403
+ ReturnType: null;
404
+ } | {
405
+ Request: {
406
+ method: "wallet_sendCalls";
407
+ params: [{
408
+ calls: readonly {
409
+ to?: import("ox/_types/core/Address").Address | undefined;
410
+ data?: import("ox/_types/core/Hex").Hex | undefined;
411
+ value?: import("ox/_types/core/Hex").Hex | undefined;
412
+ }[];
413
+ capabilities?: {
414
+ [capability: string]: any;
415
+ } | undefined;
416
+ chainId?: import("ox/_types/core/Hex").Hex | undefined;
417
+ from: import("ox/_types/core/Address").Address;
418
+ version: string;
419
+ }];
420
+ };
421
+ ReturnType: string;
422
+ } | {
423
+ Request: {
424
+ method: "wallet_showCallsStatus";
425
+ params: [string];
426
+ };
427
+ ReturnType: undefined;
428
+ } | {
429
+ Request: {
430
+ method: "wallet_switchEthereumChain";
431
+ params: [chain: {
432
+ chainId: string;
433
+ }];
434
+ };
435
+ ReturnType: null;
436
+ } | {
437
+ Request: {
438
+ method: "wallet_watchAsset";
439
+ params: [{
440
+ type: "ERC20";
441
+ options: {
442
+ address: string;
443
+ symbol: string;
444
+ decimals: number;
445
+ image?: string | undefined;
446
+ };
447
+ }];
448
+ };
449
+ ReturnType: boolean;
450
+ }>;
451
+ on: import("ox/_types/core/Provider").EventListenerFn;
452
+ removeListener: import("ox/_types/core/Provider").EventListenerFn;
453
+ }, Record<string, unknown>, Record<string, unknown>>]>;
@@ -4,6 +4,7 @@ exports.useWagmiConfig = useWagmiConfig;
4
4
  const constants_1 = require("../../../shared/constants");
5
5
  const supported_1 = require("../../../shared/constants/chains/supported");
6
6
  const thirdweb_1 = require("../../../shared/utils/thirdweb");
7
+ const miniapp_wagmi_connector_1 = require("@farcaster/miniapp-wagmi-connector");
7
8
  const wagmi_adapter_1 = require("@thirdweb-dev/wagmi-adapter");
8
9
  const react_1 = require("react");
9
10
  const viem_1 = require("viem");
@@ -33,6 +34,7 @@ function useWagmiConfig(partnerId, rpcUrls) {
33
34
  ...ecocystemConfig,
34
35
  client: thirdweb_1.client,
35
36
  }),
37
+ (0, miniapp_wagmi_connector_1.farcasterMiniApp)(),
36
38
  // injected(),
37
39
  // coinbaseWallet({ appName: "HypeDuel" }),
38
40
  ],
@@ -223,8 +223,6 @@ export interface AnySpendStakeUpsideProps extends BaseModalProps {
223
223
  stakeAmount: string;
224
224
  /** Staking contract address */
225
225
  stakingContractAddress: string;
226
- /** Pool type for staking */
227
- poolType: "b3" | "weth";
228
226
  /** Token address to stake */
229
227
  token: components["schemas"]["Token"];
230
228
  /** Active tab for the modal */
@@ -7,8 +7,13 @@ const utils_1 = require("../../../shared/utils");
7
7
  const button_1 = require("../../../global-account/react/components/ui/button");
8
8
  const dropdown_menu_1 = require("../../../global-account/react/components/ui/dropdown-menu");
9
9
  const currencyStore_1 = require("../stores/currencyStore");
10
- const currencies = ["B3", "ETH", "SOL", "USD", "EUR", "GBP", "KRW", "JPY", "CAD", "AUD"];
10
+ const builtInCurrencies = ["B3", "ETH", "SOL", "USD", "EUR", "GBP", "KRW", "JPY", "CAD", "AUD"];
11
11
  function CurrencySelector({ labelClassName, buttonVariant = "dark", label }) {
12
- const { selectedCurrency, setSelectedCurrency } = (0, currencyStore_1.useCurrencyStore)();
13
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("text-foreground text-sm font-medium leading-none tracking-tight sm:text-base", labelClassName), children: label })), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: buttonVariant, className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium", children: currencyStore_1.CURRENCY_NAMES[selectedCurrency] }), (0, jsx_runtime_1.jsx)("svg", { className: "h-4 w-4", fill: "currentColor", viewBox: "0 0 20 20", children: (0, jsx_runtime_1.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" }) })] })] }) }), (0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuContent, { align: "end", className: "z-[100] min-w-[200px]", children: currencies.map(currency => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(dropdown_menu_1.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: [(0, jsx_runtime_1.jsx)("span", { className: "text-foreground text-sm font-medium", children: currencyStore_1.CURRENCY_NAMES[currency] }), (0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground text-xs font-medium", children: currencyStore_1.CURRENCY_SYMBOLS[currency] })] }), currency === "SOL" && (0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuSeparator, { className: "bg-border my-1" }, "separator")] }, currency))) })] }) }));
12
+ const selectedCurrency = (0, currencyStore_1.useCurrencyStore)(state => state.selectedCurrency);
13
+ const setSelectedCurrency = (0, currencyStore_1.useCurrencyStore)(state => state.setSelectedCurrency);
14
+ const customCurrencies = (0, currencyStore_1.useCurrencyStore)(state => state.customCurrencies);
15
+ // Separate built-in and custom for better organization
16
+ const customCurrencyCodes = Object.keys(customCurrencies);
17
+ const hasCustomCurrencies = customCurrencyCodes.length > 0;
18
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("text-foreground text-sm font-medium leading-none tracking-tight sm:text-base", labelClassName), children: label })), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: buttonVariant, className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium", children: (0, currencyStore_1.getCurrencyName)(selectedCurrency) }), (0, jsx_runtime_1.jsx)("svg", { className: "h-4 w-4", fill: "currentColor", viewBox: "0 0 20 20", children: (0, jsx_runtime_1.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" }) })] })] }) }), (0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenuContent, { align: "end", className: "z-[100] min-w-[200px]", children: [builtInCurrencies.map(currency => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(dropdown_menu_1.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: [(0, jsx_runtime_1.jsx)("span", { className: "text-foreground text-sm font-medium", children: currencyStore_1.CURRENCY_NAMES[currency] }), (0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground text-xs font-medium", children: currencyStore_1.CURRENCY_SYMBOLS[currency] })] }), currency === "SOL" && (0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuSeparator, { className: "bg-border my-1" }, "separator")] }, currency))), hasCustomCurrencies && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuSeparator, { className: "bg-border my-1" }), customCurrencyCodes.map(currency => ((0, jsx_runtime_1.jsxs)(dropdown_menu_1.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: [(0, jsx_runtime_1.jsx)("span", { className: "text-foreground text-sm font-medium", children: (0, currencyStore_1.getCurrencyName)(currency) }), (0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground text-xs font-medium", children: (0, currencyStore_1.getCurrencySymbol)(currency) })] }, currency)))] }))] })] }) }));
14
19
  }
@@ -1,12 +1,12 @@
1
1
  interface FormattedCurrencyProps {
2
- amount: number;
2
+ amount: string;
3
+ sourceCurrency: string;
3
4
  showChange?: boolean;
4
5
  showColor?: boolean;
5
6
  className?: string;
6
7
  subB3Icon?: boolean;
7
8
  clickable?: boolean;
8
9
  decimals?: number;
9
- currency?: string;
10
10
  }
11
- export declare function FormattedCurrency({ amount, showChange, showColor, className, subB3Icon, clickable, decimals, currency, }: FormattedCurrencyProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function FormattedCurrency({ amount, sourceCurrency, showChange, showColor, className, subB3Icon, clickable, decimals, }: FormattedCurrencyProps): import("react/jsx-runtime").JSX.Element;
12
12
  export {};