@b3dotfun/sdk 0.0.30 → 0.0.31
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/cjs/anyspend/react/components/AnySpend.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +6 -1
- package/dist/cjs/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/ChainTokenIcon.js +2 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +23 -28
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +5 -5
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +3 -3
- package/dist/cjs/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +5 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +1 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.d.ts +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +94 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.d.ts +14 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +272 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +9 -51
- package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +10 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.js +8 -0
- package/dist/cjs/global-account/react/components/TokenIcon.d.ts +11 -0
- package/dist/cjs/global-account/react/components/TokenIcon.js +43 -0
- package/dist/cjs/global-account/react/components/ui/accordion.d.ts +7 -0
- package/dist/cjs/global-account/react/components/ui/accordion.js +53 -0
- package/dist/cjs/global-account/react/components/ui/dialog.js +1 -1
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -0
- package/dist/cjs/global-account/react/hooks/index.js +5 -1
- package/dist/cjs/global-account/react/hooks/useAnalytics.d.ts +7 -0
- package/dist/cjs/global-account/react/hooks/useAnalytics.js +29 -0
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +2 -1
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -1
- package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +24 -0
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +29 -0
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +2 -2
- package/dist/cjs/global-account/react/utils/profileDisplay.js +9 -0
- package/dist/cjs/global-account/utils/analytics.d.ts +16 -0
- package/dist/cjs/global-account/utils/analytics.js +55 -0
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +2 -1
- package/dist/cjs/shared/generated/chain-networks.json +185 -17
- package/dist/esm/anyspend/react/components/AnySpend.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +5 -1
- package/dist/esm/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/ChainTokenIcon.js +2 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +22 -27
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +5 -5
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -4
- package/dist/esm/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/esm/global-account/react/components/B3DynamicModal.js +2 -5
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +5 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +1 -0
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.d.ts +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +88 -0
- package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.d.ts +14 -0
- package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +266 -0
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +12 -51
- package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +10 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.js +5 -0
- package/dist/esm/global-account/react/components/TokenIcon.d.ts +11 -0
- package/dist/esm/global-account/react/components/TokenIcon.js +37 -0
- package/dist/esm/global-account/react/components/ui/accordion.d.ts +7 -0
- package/dist/esm/global-account/react/components/ui/accordion.js +14 -0
- package/dist/esm/global-account/react/components/ui/dialog.js +1 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -0
- package/dist/esm/global-account/react/hooks/index.js +2 -0
- package/dist/esm/global-account/react/hooks/useAnalytics.d.ts +7 -0
- package/dist/esm/global-account/react/hooks/useAnalytics.js +26 -0
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +2 -1
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +2 -1
- package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +24 -0
- package/dist/esm/global-account/react/hooks/useSimBalance.js +26 -0
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +2 -2
- package/dist/esm/global-account/react/utils/profileDisplay.js +9 -0
- package/dist/esm/global-account/utils/analytics.d.ts +16 -0
- package/dist/esm/global-account/utils/analytics.js +50 -0
- package/dist/esm/shared/constants/index.d.ts +1 -0
- package/dist/esm/shared/constants/index.js +1 -0
- package/dist/esm/shared/generated/chain-networks.json +185 -17
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/types/global-account/react/components/ManageAccount/BalanceContent.d.ts +6 -0
- package/dist/types/global-account/react/components/ManageAccount/ContentTokens.d.ts +14 -0
- package/dist/types/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +10 -0
- package/dist/types/global-account/react/components/TokenIcon.d.ts +11 -0
- package/dist/types/global-account/react/components/ui/accordion.d.ts +7 -0
- package/dist/types/global-account/react/hooks/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/useAnalytics.d.ts +7 -0
- package/dist/types/global-account/react/hooks/useSimBalance.d.ts +24 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +2 -2
- package/dist/types/global-account/utils/analytics.d.ts +16 -0
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/package.json +10 -18
- package/src/anyspend/react/components/AnySpend.tsx +1 -0
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +2 -1
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -2
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +10 -0
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +4 -4
- package/src/anyspend/react/components/common/ChainTokenIcon.tsx +8 -2
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +56 -107
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +12 -3
- package/src/anyspend/react/components/common/OrderDetails.tsx +5 -5
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +2 -2
- package/src/anyspend/react/components/common/PanelOnramp.tsx +11 -5
- package/src/anyspend/react/components/common/PaySection.tsx +1 -1
- package/src/global-account/react/components/B3DynamicModal.tsx +8 -7
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +6 -0
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +2 -1
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +228 -0
- package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +568 -0
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +86 -341
- package/src/global-account/react/components/ManageAccount/TokenBalanceRow.tsx +46 -0
- package/src/global-account/react/components/TokenIcon.tsx +87 -0
- package/src/global-account/react/components/ui/accordion.tsx +53 -0
- package/src/global-account/react/components/ui/dialog.tsx +1 -1
- package/src/global-account/react/hooks/index.ts +2 -0
- package/src/global-account/react/hooks/useAccountAssets.ts +1 -0
- package/src/global-account/react/hooks/useAnalytics.tsx +30 -0
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +3 -2
- package/src/global-account/react/hooks/useNativeBalance.tsx +2 -1
- package/src/global-account/react/hooks/useSimBalance.ts +56 -0
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +3 -1
- package/src/global-account/react/stores/useModalStore.ts +2 -2
- package/src/global-account/react/utils/profileDisplay.ts +9 -0
- package/src/global-account/utils/analytics.ts +64 -0
- package/src/shared/constants/index.ts +2 -0
- package/src/shared/generated/chain-networks.json +185 -17
- package/src/{anyspend/types → types}/window.d.ts +5 -1
- package/dist/cjs/index.d.ts +0 -0
- package/dist/cjs/index.js +0 -2
- package/dist/esm/index.d.ts +0 -0
- package/dist/esm/index.js +0 -2
- package/dist/types/index.d.ts +0 -0
- package/src/index.ts +0 -1
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"testnetConfigID": "66b380b0fae0f6d8266798d0",
|
|
30
30
|
"badge": "https://cdn.b3.fun/b3_logo.svg",
|
|
31
31
|
"color": "#3368ef",
|
|
32
|
-
"enabledFeatures": ["
|
|
32
|
+
"enabledFeatures": ["basement", "explorer"]
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"_id": "66b380b0fae0f6d8266798d0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"format": "svg"
|
|
50
50
|
},
|
|
51
51
|
"blockExplorers": {
|
|
52
|
-
"default": "https://sepolia
|
|
52
|
+
"default": "https://sepolia.explorer.b3.fun",
|
|
53
53
|
"explorerTitle": "B3 Sepolia Explorer"
|
|
54
54
|
},
|
|
55
55
|
"nativeCurrency": {
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
},
|
|
60
60
|
"testnet": true,
|
|
61
61
|
"badge": "https://cdn.b3.fun/b3_logo.svg",
|
|
62
|
-
"color": "#3368ef"
|
|
62
|
+
"color": "#3368ef",
|
|
63
|
+
"enabledFeatures": ["basement", "explorer"]
|
|
63
64
|
},
|
|
64
65
|
{
|
|
65
66
|
"_id": "66f2044afe5a3ac32a1de9ff",
|
|
@@ -89,7 +90,8 @@
|
|
|
89
90
|
},
|
|
90
91
|
"testnet": false,
|
|
91
92
|
"badge": "https://cdn.b3.fun/base-badge.svg",
|
|
92
|
-
"color": "#004ae7"
|
|
93
|
+
"color": "#004ae7",
|
|
94
|
+
"enabledFeatures": ["basement", "explorer"]
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
97
|
"_id": "66f3221afe5a3ac32a1dea00",
|
|
@@ -119,7 +121,8 @@
|
|
|
119
121
|
},
|
|
120
122
|
"testnet": false,
|
|
121
123
|
"badge": "https://cdn.b3.fun/base-badge.svg",
|
|
122
|
-
"color": "#004ae7"
|
|
124
|
+
"color": "#004ae7",
|
|
125
|
+
"enabledFeatures": ["basement"]
|
|
123
126
|
},
|
|
124
127
|
{
|
|
125
128
|
"_id": "6706b240d442b7a2f8cb9efa",
|
|
@@ -149,7 +152,8 @@
|
|
|
149
152
|
},
|
|
150
153
|
"testnet": true,
|
|
151
154
|
"badge": "https://cdn.b3.fun/eth-badge.svg",
|
|
152
|
-
"color": "#B38DF0"
|
|
155
|
+
"color": "#B38DF0",
|
|
156
|
+
"enabledFeatures": ["basement"]
|
|
153
157
|
},
|
|
154
158
|
{
|
|
155
159
|
"_id": "671945d9d442b7a2f8cb9efe",
|
|
@@ -178,7 +182,8 @@
|
|
|
178
182
|
},
|
|
179
183
|
"testnet": true,
|
|
180
184
|
"badge": "https://cdn.b3.fun/eth-badge.svg",
|
|
181
|
-
"color": "#B38DF0"
|
|
185
|
+
"color": "#B38DF0",
|
|
186
|
+
"enabledFeatures": ["basement"]
|
|
182
187
|
},
|
|
183
188
|
{
|
|
184
189
|
"_id": "679a4a91703428bb5bb2f1ba",
|
|
@@ -208,7 +213,8 @@
|
|
|
208
213
|
},
|
|
209
214
|
"testnet": false,
|
|
210
215
|
"badge": "https://cdn.b3.fun/avalanche-badge.svg",
|
|
211
|
-
"color": "#c33738"
|
|
216
|
+
"color": "#c33738",
|
|
217
|
+
"enabledFeatures": ["basement"]
|
|
212
218
|
},
|
|
213
219
|
{
|
|
214
220
|
"_id": "679be46ca0f78fd619f6954b",
|
|
@@ -238,7 +244,8 @@
|
|
|
238
244
|
},
|
|
239
245
|
"testnet": false,
|
|
240
246
|
"badge": "https://cdn.b3.fun/geist-logo.svg",
|
|
241
|
-
"color": "#808080"
|
|
247
|
+
"color": "#808080",
|
|
248
|
+
"enabledFeatures": ["basement"]
|
|
242
249
|
},
|
|
243
250
|
{
|
|
244
251
|
"_id": "679be960a0f78fd619f6954d",
|
|
@@ -268,7 +275,8 @@
|
|
|
268
275
|
},
|
|
269
276
|
"testnet": false,
|
|
270
277
|
"badge": "https://cdn.b3.fun/arbitrum-badge.svg",
|
|
271
|
-
"color": "#4a5c7e"
|
|
278
|
+
"color": "#4a5c7e",
|
|
279
|
+
"enabledFeatures": ["basement"]
|
|
272
280
|
},
|
|
273
281
|
{
|
|
274
282
|
"_id": "679be9eba0f78fd619f6954f",
|
|
@@ -298,7 +306,8 @@
|
|
|
298
306
|
},
|
|
299
307
|
"testnet": false,
|
|
300
308
|
"badge": "https://cdn.b3.fun/ronin-logo.svg",
|
|
301
|
-
"color": "#004de5"
|
|
309
|
+
"color": "#004de5",
|
|
310
|
+
"enabledFeatures": ["basement"]
|
|
302
311
|
},
|
|
303
312
|
{
|
|
304
313
|
"_id": "679beabca0f78fd619f69551",
|
|
@@ -328,7 +337,8 @@
|
|
|
328
337
|
},
|
|
329
338
|
"testnet": false,
|
|
330
339
|
"badge": "https://cdn.b3.fun/solana-logo.png",
|
|
331
|
-
"color": "#9945FF"
|
|
340
|
+
"color": "#9945FF",
|
|
341
|
+
"enabledFeatures": ["basement"]
|
|
332
342
|
},
|
|
333
343
|
{
|
|
334
344
|
"_id": "67a452dda0f78fd619f69558",
|
|
@@ -358,7 +368,8 @@
|
|
|
358
368
|
},
|
|
359
369
|
"testnet": true,
|
|
360
370
|
"badge": "https://cdn.b3.fun/gunz-logo.svg",
|
|
361
|
-
"color": "#c8edfa"
|
|
371
|
+
"color": "#c8edfa",
|
|
372
|
+
"enabledFeatures": ["basement"]
|
|
362
373
|
},
|
|
363
374
|
{
|
|
364
375
|
"_id": "67aede9db3ba503f51eeaff7",
|
|
@@ -388,7 +399,8 @@
|
|
|
388
399
|
},
|
|
389
400
|
"testnet": false,
|
|
390
401
|
"badge": "https://cdn.b3.fun/ton-logo.svg",
|
|
391
|
-
"color": "#0088cc"
|
|
402
|
+
"color": "#0088cc",
|
|
403
|
+
"enabledFeatures": ["basement"]
|
|
392
404
|
},
|
|
393
405
|
{
|
|
394
406
|
"_id": "67b7895fb3ba503f51eeaffc",
|
|
@@ -418,7 +430,8 @@
|
|
|
418
430
|
},
|
|
419
431
|
"testnet": false,
|
|
420
432
|
"badge": "https://cdn.b3.fun/optimism-badge.svg",
|
|
421
|
-
"color": "#d6031b"
|
|
433
|
+
"color": "#d6031b",
|
|
434
|
+
"enabledFeatures": ["basement"]
|
|
422
435
|
},
|
|
423
436
|
{
|
|
424
437
|
"_id": "67bcbdb782f62aa6dc1efa60",
|
|
@@ -448,7 +461,8 @@
|
|
|
448
461
|
},
|
|
449
462
|
"testnet": false,
|
|
450
463
|
"badge": "https://cdn.b3.fun/polygon-badge.svg",
|
|
451
|
-
"color": "#7540cf"
|
|
464
|
+
"color": "#7540cf",
|
|
465
|
+
"enabledFeatures": ["basement"]
|
|
452
466
|
},
|
|
453
467
|
{
|
|
454
468
|
"_id": "6837258b25c59b8e08f806bf",
|
|
@@ -478,6 +492,160 @@
|
|
|
478
492
|
},
|
|
479
493
|
"testnet": false,
|
|
480
494
|
"badge": "https://avatars.githubusercontent.com/u/45615063?s=280&v=4",
|
|
481
|
-
"color": "#F3BA2F"
|
|
495
|
+
"color": "#F3BA2F",
|
|
496
|
+
"enabledFeatures": ["basement"]
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"_id": "684afd314a478ffb44a4f83e",
|
|
500
|
+
"id": 19934,
|
|
501
|
+
"name": "B4 Testnet",
|
|
502
|
+
"rpcUrls": {
|
|
503
|
+
"default": {
|
|
504
|
+
"http": "https://b4-testnet.rpc.caldera.xyz/http",
|
|
505
|
+
"ws": "wss://b4-testnet.rpc.caldera.xyz/ws"
|
|
506
|
+
},
|
|
507
|
+
"backups": []
|
|
508
|
+
},
|
|
509
|
+
"icon": {
|
|
510
|
+
"url": "https://cdn.b3.fun/b4-logo.png",
|
|
511
|
+
"width": 32,
|
|
512
|
+
"height": 32,
|
|
513
|
+
"format": "svg"
|
|
514
|
+
},
|
|
515
|
+
"blockExplorers": {
|
|
516
|
+
"default": "https://b4-testnet.explorer.caldera.xyz",
|
|
517
|
+
"explorerTitle": "B4 Testnet Explorer"
|
|
518
|
+
},
|
|
519
|
+
"nativeCurrency": {
|
|
520
|
+
"name": "Ether",
|
|
521
|
+
"symbol": "ETH",
|
|
522
|
+
"decimals": 18
|
|
523
|
+
},
|
|
524
|
+
"testnet": true,
|
|
525
|
+
"badge": "https://cdn.b3.fun/b4-logo.png",
|
|
526
|
+
"color": "#3368ef",
|
|
527
|
+
"enabledFeatures": ["explorer"]
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"_id": "684afdec4a478ffb44a4f83f",
|
|
531
|
+
"id": 243,
|
|
532
|
+
"name": "Reach Testnet",
|
|
533
|
+
"rpcUrls": {
|
|
534
|
+
"default": {
|
|
535
|
+
"http": "https://reach-testnet.rpc.caldera.xyz/http",
|
|
536
|
+
"ws": "wss://reach-testnet.rpc.caldera.xyz/ws"
|
|
537
|
+
},
|
|
538
|
+
"backups": []
|
|
539
|
+
},
|
|
540
|
+
"icon": {
|
|
541
|
+
"url": "https://cdn.b3.fun/reach-logo.png",
|
|
542
|
+
"width": 32,
|
|
543
|
+
"height": 32,
|
|
544
|
+
"format": "png"
|
|
545
|
+
},
|
|
546
|
+
"blockExplorers": {
|
|
547
|
+
"default": "https://reach-testnet.explorer.caldera.xyz",
|
|
548
|
+
"explorerTitle": "Reach Testnet Explorer"
|
|
549
|
+
},
|
|
550
|
+
"nativeCurrency": {
|
|
551
|
+
"name": "Ether",
|
|
552
|
+
"symbol": "ETH",
|
|
553
|
+
"decimals": 18
|
|
554
|
+
},
|
|
555
|
+
"testnet": true,
|
|
556
|
+
"badge": "https://cdn.b3.fun/reach-logo.png",
|
|
557
|
+
"color": "#3368ef",
|
|
558
|
+
"enabledFeatures": ["explorer"]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"_id": "684afed04a478ffb44a4f840",
|
|
562
|
+
"id": 10211403,
|
|
563
|
+
"name": "GLHF Testnet",
|
|
564
|
+
"rpcUrls": {
|
|
565
|
+
"default": {
|
|
566
|
+
"http": "https://glhf-testnet.rpc.caldera.xyz/http",
|
|
567
|
+
"ws": "wss://glhf-testnet.rpc.caldera.xyz/ws"
|
|
568
|
+
},
|
|
569
|
+
"backups": []
|
|
570
|
+
},
|
|
571
|
+
"icon": {
|
|
572
|
+
"url": "https://cdn.b3.fun/supergaming-logo.png",
|
|
573
|
+
"width": 62,
|
|
574
|
+
"height": 48,
|
|
575
|
+
"format": "png"
|
|
576
|
+
},
|
|
577
|
+
"blockExplorers": {
|
|
578
|
+
"default": "https://glhf-testnet.explorer.caldera.xyz",
|
|
579
|
+
"explorerTitle": "SuperGaming Testnet Explorer"
|
|
580
|
+
},
|
|
581
|
+
"nativeCurrency": {
|
|
582
|
+
"name": "Ether",
|
|
583
|
+
"symbol": "ETH",
|
|
584
|
+
"decimals": 18
|
|
585
|
+
},
|
|
586
|
+
"testnet": true,
|
|
587
|
+
"badge": "https://cdn.b3.fun/supergaming-logo.png",
|
|
588
|
+
"color": "#000000",
|
|
589
|
+
"enabledFeatures": ["explorer"]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"_id": "685341f5ac22b8c3faae86ae",
|
|
593
|
+
"id": 4224,
|
|
594
|
+
"name": "Arpa Testnet",
|
|
595
|
+
"rpcUrls": {
|
|
596
|
+
"default": {
|
|
597
|
+
"http": "https://arpachain.calderachain.xyz/http",
|
|
598
|
+
"ws": "wss://arpachain.calderachain.xyz/ws"
|
|
599
|
+
},
|
|
600
|
+
"backups": []
|
|
601
|
+
},
|
|
602
|
+
"icon": {
|
|
603
|
+
"url": "https://cdn.b3.fun/arpa-logo.png",
|
|
604
|
+
"width": 175,
|
|
605
|
+
"height": 158,
|
|
606
|
+
"format": "png"
|
|
607
|
+
},
|
|
608
|
+
"blockExplorers": {
|
|
609
|
+
"default": "https://arpachain.calderaexplorer.xyz/",
|
|
610
|
+
"explorerTitle": "ArpaChain Testnet Explorer"
|
|
611
|
+
},
|
|
612
|
+
"nativeCurrency": {
|
|
613
|
+
"name": "Ether",
|
|
614
|
+
"symbol": "ETH",
|
|
615
|
+
"decimals": 18
|
|
616
|
+
},
|
|
617
|
+
"testnet": true,
|
|
618
|
+
"badge": "https://cdn.b3.fun/arpa-logo.png",
|
|
619
|
+
"color": "#3368ef",
|
|
620
|
+
"enabledFeatures": ["explorer"]
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"_id": "68a351c603e65c07b7645581",
|
|
624
|
+
"id": 1448000,
|
|
625
|
+
"name": "XRPLT",
|
|
626
|
+
"rpcUrls": {
|
|
627
|
+
"default": {
|
|
628
|
+
"http": "https://xrplt.rpc.caldera.xyz/http",
|
|
629
|
+
"ws": "wss://xrplt.rpc.caldera.xyz/ws"
|
|
630
|
+
},
|
|
631
|
+
"backups": []
|
|
632
|
+
},
|
|
633
|
+
"icon": {
|
|
634
|
+
"url": "https://cdn.b3.fun/xrpl_logo.svg",
|
|
635
|
+
"width": 32,
|
|
636
|
+
"height": 32,
|
|
637
|
+
"format": "svg"
|
|
638
|
+
},
|
|
639
|
+
"blockExplorers": {
|
|
640
|
+
"default": "https://xrplt.explorer.caldera.xyz/",
|
|
641
|
+
"explorerTitle": "XRPLT Explorer"
|
|
642
|
+
},
|
|
643
|
+
"nativeCurrency": {
|
|
644
|
+
"name": "XRP",
|
|
645
|
+
"symbol": "XRP",
|
|
646
|
+
"decimals": 18
|
|
647
|
+
},
|
|
648
|
+
"testnet": true,
|
|
649
|
+
"enabledFeatures": ["xcade", "explorer"]
|
|
482
650
|
}
|
|
483
651
|
]
|
|
@@ -655,7 +655,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
655
655
|
setActivePanel(PanelView.MAIN);
|
|
656
656
|
setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE); // Reset payment method when going back
|
|
657
657
|
} })] })) }) }));
|
|
658
|
-
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [isBuyMode && (_jsxs("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? (_jsx(PaySection, { paymentType: "crypto", selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, selectedFiatPaymentMethod: selectedFiatPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), onSelectFiatPaymentMethod: () => setActivePanel(PanelView.FIAT_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmountOnRamp, setSrcAmountOnRamp: setSrcAmountOnRamp, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD }) })), _jsx(Button, { variant: "ghost", className: cn("border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "top-[calc(50%+56px)] cursor-default", activeTab === "fiat" && "hidden"), onClick: () => {
|
|
658
|
+
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [isBuyMode && (_jsxs("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? (_jsx(PaySection, { paymentType: "crypto", selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, selectedFiatPaymentMethod: selectedFiatPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), onSelectFiatPaymentMethod: () => setActivePanel(PanelView.FIAT_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmountOnRamp, setSrcAmountOnRamp: setSrcAmountOnRamp, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION }) })), _jsx(Button, { variant: "ghost", className: cn("border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "top-[calc(50%+56px)] cursor-default", activeTab === "fiat" && "hidden"), onClick: () => {
|
|
659
659
|
if (activeTab === "fiat" || isBuyMode) {
|
|
660
660
|
return;
|
|
661
661
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { B3_TOKEN } from "../../../anyspend/index.js";
|
|
3
3
|
import { Button, GlareCardRounded, Input, StyleRoot, TextLoop, useHasMounted, useModalStore, useTokenBalance, useUnifiedChainSwitchAndExecute, } from "../../../global-account/react/index.js";
|
|
4
|
+
import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
|
|
4
5
|
import { baseMainnet } from "../../../shared/constants/chains/supported.js";
|
|
5
6
|
import invariant from "invariant";
|
|
6
7
|
import { ArrowRight, Loader2 } from "lucide-react";
|
|
@@ -82,7 +83,7 @@ function generateEncodedDataForBuyEntriesAndSpin(user, quantity) {
|
|
|
82
83
|
}
|
|
83
84
|
const basePublicClient = createPublicClient({
|
|
84
85
|
chain: baseMainnet,
|
|
85
|
-
transport: http(),
|
|
86
|
+
transport: http(PUBLIC_BASE_RPC_URL),
|
|
86
87
|
});
|
|
87
88
|
export function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }) {
|
|
88
89
|
const hasMounted = useHasMounted();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ABI_ERC20_STAKING, B3_TOKEN } from "../../../anyspend/index.js";
|
|
3
3
|
import { Button, GlareCardRounded, Input, StyleRoot, TextLoop, useHasMounted, useModalStore, useTokenBalance, useUnifiedChainSwitchAndExecute, } from "../../../global-account/react/index.js";
|
|
4
|
+
import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
|
|
4
5
|
import { formatTokenAmount } from "../../../shared/utils/number.js";
|
|
5
6
|
import invariant from "invariant";
|
|
6
7
|
import { ArrowRight, Loader2 } from "lucide-react";
|
|
@@ -16,7 +17,7 @@ import { SolIcon } from "./icons/SolIcon.js";
|
|
|
16
17
|
import { UsdcIcon } from "./icons/USDCIcon.js";
|
|
17
18
|
const basePublicClient = createPublicClient({
|
|
18
19
|
chain: base,
|
|
19
|
-
transport: http(),
|
|
20
|
+
transport: http(PUBLIC_BASE_RPC_URL),
|
|
20
21
|
});
|
|
21
22
|
const ERC20Staking = "0xbf04200be3cbf371467a539706393c81c470f523";
|
|
22
23
|
function generateEncodedDataForStakingB3(amount, beneficiary) {
|
|
@@ -22,6 +22,10 @@ import { ESCROW_ABI } from "../../../anyspend/abis/escrow.js";
|
|
|
22
22
|
import { ArrowDown } from "lucide-react";
|
|
23
23
|
import { PanelOnramp } from "./common/PanelOnramp.js";
|
|
24
24
|
const SLIPPAGE_PERCENT = 3;
|
|
25
|
+
export const HYPE_TOKEN_DETAILS = {
|
|
26
|
+
SYMBOL: "HYPE",
|
|
27
|
+
LOGO_URI: "https://cdn.hypeduel.com/hypes-coin.svg",
|
|
28
|
+
};
|
|
25
29
|
function generateEncodedDataForDepositHype(amount, beneficiary) {
|
|
26
30
|
invariant(BigInt(amount) > 0, "Amount must be greater than zero");
|
|
27
31
|
const encodedData = encodeFunctionData({
|
|
@@ -118,7 +122,7 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
|
|
|
118
122
|
await handleFiatOrder();
|
|
119
123
|
}
|
|
120
124
|
};
|
|
121
|
-
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }), _jsx("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? (_jsx(PaySection, { paymentType: "crypto", selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, selectedFiatPaymentMethod: selectedFiatPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), onSelectFiatPaymentMethod: () => setActivePanel(PanelView.FIAT_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: B3_TOKEN, destinationChainId: base.id, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD }) })), _jsx("div", { className: cn("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: _jsx(Button, { variant: "ghost", className: cn("swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl"), children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: B3_TOKEN, selectedDstChainId: base.id, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, onChangeDstAmount: value => {
|
|
125
|
+
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }), _jsx("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? (_jsx(PaySection, { paymentType: "crypto", selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, selectedFiatPaymentMethod: selectedFiatPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), onSelectFiatPaymentMethod: () => setActivePanel(PanelView.FIAT_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: B3_TOKEN, destinationChainId: base.id, dstTokenSymbol: HYPE_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION }) })), _jsx("div", { className: cn("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: _jsx(Button, { variant: "ghost", className: cn("swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl"), children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: B3_TOKEN, dstTokenSymbol: HYPE_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: HYPE_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: base.id, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, onChangeDstAmount: value => {
|
|
122
126
|
setIsSrcInputDirty(false);
|
|
123
127
|
setSrcAmount(value);
|
|
124
128
|
}, anyspendQuote: anyspendQuote }))] }) }), _jsx(ErrorSection, { error: getAnyspendQuoteError }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2", getAnyspendQuoteError && "mt-0"), children: _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: btnInfo.text }) }), mainFooter ? mainFooter : null] }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { HelpCircle } from "lucide-react";
|
|
2
3
|
export function ChainTokenIcon({ chainUrl, tokenUrl, className = "", }) {
|
|
3
|
-
return (_jsxs("div", { className: `relative ${className}`, children: [_jsx("img", { src: tokenUrl, alt: "Token", className: "h-full w-full rounded-full" }), _jsx("div", { className: "bg-as-on-surface-1 border-as-stroke absolute bottom-0 right-0 h-[45%] w-[45%] rounded border", children: _jsx("img", { src: chainUrl, alt: "Chain", className: "h-full w-full rounded" }) })] }));
|
|
4
|
+
return (_jsxs("div", { className: `relative ${className}`, children: [tokenUrl ? (_jsx("img", { src: tokenUrl, alt: "Token", className: "h-full w-full rounded-full" })) : (_jsx(HelpCircle, { className: "text-b3-react-foreground h-full w-full" })), _jsx("div", { className: "bg-as-on-surface-1 border-as-stroke absolute bottom-0 right-0 h-[45%] w-[45%] rounded border", children: _jsx("img", { src: chainUrl, alt: "Chain", className: "h-full w-full rounded" }) })] }));
|
|
4
5
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useAccountWallet } from "../../../../global-account/react/index.js";
|
|
4
4
|
import { cn } from "../../../../shared/utils/cn.js";
|
|
5
5
|
import { shortenAddress } from "../../../../shared/utils/formatAddress.js";
|
|
6
|
+
import { WalletCoinbase, WalletMetamask, WalletPhantom, WalletRainbow, WalletWalletConnect } from "@web3icons/react";
|
|
6
7
|
import { ChevronLeft, ChevronRightCircle, Wallet, X, ZapIcon } from "lucide-react";
|
|
7
8
|
import { useState } from "react";
|
|
8
9
|
import { createPortal } from "react-dom";
|
|
@@ -21,46 +22,49 @@ export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentM
|
|
|
21
22
|
const { disconnect } = useDisconnect();
|
|
22
23
|
const { data: walletClient } = useWalletClient();
|
|
23
24
|
const [showWalletModal, setShowWalletModal] = useState(false);
|
|
24
|
-
const [selectedWalletConnector, setSelectedWalletConnector] = useState(null);
|
|
25
|
-
const [modalStep, setModalStep] = useState("wallet-selection");
|
|
26
25
|
// Define available wallet connectors
|
|
27
|
-
const availableConnectors = connectors.filter(connector => ["MetaMask", "WalletConnect", "Coinbase Wallet", "Rainbow"].includes(connector.name));
|
|
26
|
+
const availableConnectors = connectors.filter(connector => ["MetaMask", "WalletConnect", "Coinbase Wallet", "Rainbow", "Phantom"].includes(connector.name));
|
|
28
27
|
// Define wallet options with icons and info
|
|
29
28
|
const walletOptions = [
|
|
30
29
|
{
|
|
31
30
|
id: "metamask",
|
|
32
31
|
name: "MetaMask",
|
|
33
|
-
icon:
|
|
32
|
+
icon: _jsx(WalletMetamask, { size: 48 }),
|
|
34
33
|
description: "Connect using MetaMask browser extension",
|
|
35
34
|
connector: availableConnectors.find(c => c.name === "MetaMask"),
|
|
36
35
|
},
|
|
37
36
|
{
|
|
38
37
|
id: "coinbase",
|
|
39
38
|
name: "Coinbase Wallet",
|
|
40
|
-
icon:
|
|
39
|
+
icon: _jsx(WalletCoinbase, { size: 48 }),
|
|
41
40
|
description: "Connect using Coinbase Wallet",
|
|
42
41
|
connector: availableConnectors.find(c => c.name === "Coinbase Wallet"),
|
|
43
42
|
},
|
|
44
43
|
{
|
|
45
44
|
id: "rainbow",
|
|
46
45
|
name: "Rainbow",
|
|
47
|
-
icon:
|
|
46
|
+
icon: _jsx(WalletRainbow, { size: 48 }),
|
|
48
47
|
description: "Connect using Rainbow wallet",
|
|
49
48
|
connector: availableConnectors.find(c => c.name === "Rainbow"),
|
|
50
49
|
},
|
|
51
50
|
{
|
|
52
51
|
id: "walletconnect",
|
|
53
52
|
name: "WalletConnect",
|
|
54
|
-
icon:
|
|
53
|
+
icon: _jsx(WalletWalletConnect, { size: 48 }),
|
|
55
54
|
description: "Connect using WalletConnect protocol",
|
|
56
55
|
connector: availableConnectors.find(c => c.name === "WalletConnect"),
|
|
57
56
|
},
|
|
57
|
+
{
|
|
58
|
+
id: "phantom",
|
|
59
|
+
name: "Phantom",
|
|
60
|
+
icon: _jsx(WalletPhantom, { size: 48 }),
|
|
61
|
+
description: "Connect using Phantom wallet",
|
|
62
|
+
connector: availableConnectors.find(c => c.name === "Phantom"),
|
|
63
|
+
},
|
|
58
64
|
].filter(wallet => wallet.connector); // Only show wallets that have available connectors
|
|
59
65
|
// Reset modal state when closing
|
|
60
66
|
const handleCloseModal = () => {
|
|
61
67
|
setShowWalletModal(false);
|
|
62
|
-
setModalStep("wallet-selection");
|
|
63
|
-
setSelectedWalletConnector(null);
|
|
64
68
|
};
|
|
65
69
|
// Function to request wallet permissions for specific wallet
|
|
66
70
|
const requestWalletPermissions = async (walletConnector) => {
|
|
@@ -132,22 +136,13 @@ export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentM
|
|
|
132
136
|
setSelectedPaymentMethod(CryptoPaymentMethodType.NONE);
|
|
133
137
|
}
|
|
134
138
|
}, className: "text-as-primary/60 hover:text-as-primary/80 rounded-lg p-1.5 transition-colors", children: _jsx(X, { className: "h-4 w-4" }) })] })] }) }) })] }))] })] }), showWalletModal &&
|
|
135
|
-
createPortal(_jsx("div", { className: "pointer-events-auto fixed inset-0 z-[9999] flex items-center justify-center bg-black/50", children: _jsxs("div", { className: "max-h-[80vh] w-[400px] max-w-[90vw] overflow-auto rounded-xl bg-white p-6 dark:bg-gray-900", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const isCurrentWallet = isConnected && connector?.name === walletOption.connector?.name;
|
|
139
|
-
return (_jsx("button", { onClick: async () => {
|
|
140
|
-
setSelectedWalletConnector(walletOption.connector);
|
|
141
|
-
setModalStep("account-selection");
|
|
142
|
-
}, disabled: isPending, className: `w-full rounded-xl border p-4 text-left transition-all hover:shadow-md disabled:opacity-50 ${isCurrentWallet
|
|
143
|
-
? "border-blue-500 bg-blue-50 dark:bg-blue-900/20"
|
|
144
|
-
: "border-gray-200 bg-white hover:border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:hover:border-gray-500"}`, children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: `flex h-12 w-12 items-center justify-center rounded-xl text-xl ${isCurrentWallet ? "bg-blue-100 dark:bg-blue-800" : "bg-gray-100 dark:bg-gray-700"}`, children: walletOption.icon }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: walletOption.name }), isCurrentWallet && (_jsx("span", { className: "rounded-full bg-blue-100 px-2 py-0.5 text-xs font-medium text-blue-700 dark:bg-blue-800 dark:text-blue-200", children: "Connected" }))] }), _jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: isCurrentWallet ? "Switch account or reconnect" : walletOption.description })] })] }), _jsx(ChevronRightCircle, { className: "h-5 w-5 text-gray-400" })] }) }, walletOption.id));
|
|
145
|
-
})] }) })) : (
|
|
146
|
-
/* Account Selection Step */
|
|
147
|
-
_jsxs("div", { className: "space-y-4", children: [_jsxs("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: ["Connect to ", selectedWalletConnector?.name, " to view available accounts"] }), _jsx("button", { onClick: async () => {
|
|
139
|
+
createPortal(_jsx("div", { className: "wallet-connection-modal pointer-events-auto fixed inset-0 z-[9999] flex items-center justify-center bg-black/50", children: _jsxs("div", { className: "max-h-[80vh] w-[400px] max-w-[90vw] overflow-auto rounded-xl bg-white p-6 dark:bg-gray-900", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between", children: [_jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: isConnected ? "Switch wallet or account" : "Choose wallet to connect" }), _jsx("button", { onClick: handleCloseModal, className: "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200", children: _jsx(X, { className: "h-5 w-5" }) })] }), _jsx("div", { className: "space-y-4", children: _jsx("div", { className: "space-y-3", children: walletOptions.map(walletOption => {
|
|
140
|
+
const isCurrentWallet = isConnected && connector?.name === walletOption.connector?.name;
|
|
141
|
+
return (_jsx("button", { onClick: async () => {
|
|
148
142
|
handleCloseModal();
|
|
149
|
-
await requestWalletPermissions(
|
|
150
|
-
}, disabled: isPending, className:
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
await requestWalletPermissions(walletOption.connector);
|
|
144
|
+
}, disabled: isPending, className: `wallet-option w-full rounded-xl border p-4 text-left transition-all hover:shadow-md disabled:opacity-50 ${isCurrentWallet
|
|
145
|
+
? "wallet-option--active border-blue-500 bg-blue-50 dark:bg-blue-900/20"
|
|
146
|
+
: "border-gray-200 bg-white hover:border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:hover:border-gray-500"}`, children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [walletOption.icon, _jsxs("div", { children: [_jsxs("div", { className: "wallet-option-name flex items-center gap-2", children: [_jsx("div", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: walletOption.name }), isCurrentWallet && (_jsx("span", { className: "rounded-full bg-blue-100 px-2 py-0.5 text-xs font-medium text-blue-700 dark:bg-blue-800 dark:text-blue-200", children: "Connected" }))] }), _jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: isCurrentWallet ? "Switch account or reconnect" : walletOption.description })] })] }), _jsx(ChevronRightCircle, { className: "h-5 w-5 text-gray-400" })] }) }, walletOption.id));
|
|
147
|
+
}) }) })] }) }), typeof window !== "undefined" ? document.getElementById("b3-root") || document.body : document.body)] }));
|
|
153
148
|
}
|
|
@@ -12,6 +12,8 @@ interface CryptoReceiveSectionProps {
|
|
|
12
12
|
setSelectedDstToken?: (token: components["schemas"]["Token"]) => void;
|
|
13
13
|
onChangeDstAmount?: (value: string) => void;
|
|
14
14
|
anyspendQuote?: any;
|
|
15
|
+
dstTokenSymbol?: string;
|
|
16
|
+
dstTokenLogoURI?: string;
|
|
15
17
|
}
|
|
16
|
-
export declare function CryptoReceiveSection({ isDepositMode, isBuyMode, selectedRecipientAddress, recipientName, onSelectRecipient, dstAmount, dstToken, selectedDstChainId, setSelectedDstChainId, setSelectedDstToken, onChangeDstAmount, anyspendQuote, }: CryptoReceiveSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function CryptoReceiveSection({ isDepositMode, isBuyMode, selectedRecipientAddress, recipientName, onSelectRecipient, dstAmount, dstToken, selectedDstChainId, setSelectedDstChainId, setSelectedDstToken, onChangeDstAmount, anyspendQuote, dstTokenSymbol, dstTokenLogoURI, }: CryptoReceiveSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export {};
|
|
@@ -6,10 +6,10 @@ import { formatDisplayNumber } from "../../../../shared/utils/number.js";
|
|
|
6
6
|
import { ChevronRight } from "lucide-react";
|
|
7
7
|
import { motion } from "motion/react";
|
|
8
8
|
import { OrderTokenAmount } from "./OrderTokenAmount.js";
|
|
9
|
-
export function CryptoReceiveSection({ isDepositMode = false, isBuyMode = false, selectedRecipientAddress, recipientName, onSelectRecipient, dstAmount, dstToken, selectedDstChainId, setSelectedDstChainId, setSelectedDstToken, onChangeDstAmount, anyspendQuote, }) {
|
|
9
|
+
export function CryptoReceiveSection({ isDepositMode = false, isBuyMode = false, selectedRecipientAddress, recipientName, onSelectRecipient, dstAmount, dstToken, selectedDstChainId, setSelectedDstChainId, setSelectedDstToken, onChangeDstAmount, anyspendQuote, dstTokenSymbol, dstTokenLogoURI, }) {
|
|
10
10
|
return (_jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "receive-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [_jsxs("div", { className: "flex w-full items-center justify-between", children: [_jsx("div", { className: "text-as-primary/50 flex h-7 items-center text-sm", children: isDepositMode ? "Deposit" : "Receive" }), selectedRecipientAddress ? (_jsx("button", { className: cn("text-as-tertiarry flex h-7 items-center gap-2 rounded-lg"), onClick: onSelectRecipient, children: _jsxs(_Fragment, { children: [_jsx("span", { className: "text-as-tertiarry flex items-center gap-1 text-sm", children: recipientName ? formatUsername(recipientName) : shortenAddress(selectedRecipientAddress || "") }), _jsx(ChevronRight, { className: "h-4 w-4" })] }) })) : (_jsx("button", { className: "text-as-primary/70 flex items-center gap-1 rounded-lg", onClick: onSelectRecipient, children: _jsx("div", { className: "text-sm font-medium", children: "Select recipient" }) }))] }), isBuyMode || isDepositMode ? (
|
|
11
11
|
// Fixed destination token display for buy mode and deposit mode
|
|
12
|
-
_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-as-primary text-2xl font-bold", children: dstAmount || "0" }), _jsxs("div", { className: "bg-as-brand/10 border-as-brand/30 flex items-center gap-3 rounded-xl border px-4 py-3", children: [dstToken.metadata?.logoURI && (_jsx("img", { src: dstToken.metadata
|
|
12
|
+
_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-as-primary text-2xl font-bold", children: dstAmount || "0" }), _jsxs("div", { className: "bg-as-brand/10 border-as-brand/30 flex items-center gap-3 rounded-xl border px-4 py-3", children: [(dstTokenLogoURI || dstToken.metadata?.logoURI) && (_jsx("img", { src: dstTokenLogoURI || dstToken.metadata?.logoURI, alt: dstTokenSymbol || dstToken.symbol, className: "h-8 w-8 rounded-full" })), _jsx("span", { className: "text-as-brand text-lg font-bold", children: dstTokenSymbol || dstToken.symbol })] })] })) : (
|
|
13
13
|
// Token selection for regular swap mode
|
|
14
14
|
_jsx(OrderTokenAmount, { address: selectedRecipientAddress, context: "to", inputValue: dstAmount, onChangeInput: onChangeDstAmount || (() => { }), chainId: selectedDstChainId || dstToken.chainId, setChainId: setSelectedDstChainId || (() => { }), token: dstToken, setToken: setSelectedDstToken || (() => { }) })), _jsxs("div", { className: "text-as-primary/50 flex h-5 items-center text-sm", children: [formatDisplayNumber(anyspendQuote?.data?.currencyOut?.amountUsd, {
|
|
15
15
|
style: "currency",
|