@basedone/core 0.1.10 → 0.2.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.
- package/dist/chunk-4UEJOM6W.mjs +1 -3
- package/dist/chunk-MVFO4WRF.mjs +2091 -0
- package/dist/chunk-VBC6EQ7Q.mjs +235 -0
- package/dist/client-CgmiTuEX.d.mts +179 -0
- package/dist/client-CgmiTuEX.d.ts +179 -0
- package/dist/ecommerce.d.mts +3986 -0
- package/dist/ecommerce.d.ts +3986 -0
- package/dist/ecommerce.js +2135 -0
- package/dist/ecommerce.mjs +2 -0
- package/dist/index.d.mts +51 -43
- package/dist/index.d.ts +51 -43
- package/dist/index.js +2795 -205
- package/dist/index.mjs +68 -90
- package/dist/{meta-FVJIMALT.mjs → meta-JB5ITE27.mjs} +4 -10
- package/dist/meta-UOGUG3OW.mjs +3 -7
- package/dist/{perpDexs-GGL32HT4.mjs → perpDexs-3LRJ5ZHM.mjs} +37 -8
- package/dist/{perpDexs-G7V2QIM6.mjs → perpDexs-4ISLD7NX.mjs} +177 -32
- package/dist/react.d.mts +39 -0
- package/dist/react.d.ts +39 -0
- package/dist/react.js +268 -0
- package/dist/react.mjs +31 -0
- package/dist/{spotMeta-OD7S6HGW.mjs → spotMeta-GHXX7C5M.mjs} +24 -9
- package/dist/{spotMeta-PCN4Z4R3.mjs → spotMeta-IBBUP2SG.mjs} +54 -6
- package/dist/staticMeta-GM7T3OYL.mjs +3 -6
- package/dist/staticMeta-QV2KMX57.mjs +3 -6
- package/ecommerce.ts +15 -0
- package/index.ts +6 -0
- package/lib/ecommerce/FLASH_SALES.md +340 -0
- package/lib/ecommerce/QUICK_REFERENCE.md +211 -0
- package/lib/ecommerce/README.md +391 -0
- package/lib/ecommerce/USAGE_EXAMPLES.md +704 -0
- package/lib/ecommerce/client/base.ts +272 -0
- package/lib/ecommerce/client/customer.ts +639 -0
- package/lib/ecommerce/client/merchant.ts +1341 -0
- package/lib/ecommerce/index.ts +51 -0
- package/lib/ecommerce/types/entities.ts +791 -0
- package/lib/ecommerce/types/enums.ts +270 -0
- package/lib/ecommerce/types/index.ts +18 -0
- package/lib/ecommerce/types/requests.ts +580 -0
- package/lib/ecommerce/types/responses.ts +857 -0
- package/lib/ecommerce/utils/errors.ts +113 -0
- package/lib/ecommerce/utils/helpers.ts +131 -0
- package/lib/hip3/market-info.ts +1 -1
- package/lib/instrument/client.ts +351 -0
- package/lib/meta/data/mainnet/perpDexs.json +34 -4
- package/lib/meta/data/mainnet/spotMeta.json +21 -3
- package/lib/meta/data/testnet/meta.json +1 -3
- package/lib/meta/data/testnet/perpDexs.json +174 -28
- package/lib/meta/data/testnet/spotMeta.json +51 -0
- package/lib/react/InstrumentProvider.tsx +69 -0
- package/lib/utils/flooredDateTime.ts +55 -0
- package/lib/utils/time.ts +51 -0
- package/package.json +37 -11
- package/react.ts +1 -0
|
@@ -2177,6 +2177,15 @@
|
|
|
2177
2177
|
"name": "@257",
|
|
2178
2178
|
"index": 257,
|
|
2179
2179
|
"isCanonical": false
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
"tokens": [
|
|
2183
|
+
398,
|
|
2184
|
+
0
|
|
2185
|
+
],
|
|
2186
|
+
"name": "@258",
|
|
2187
|
+
"index": 258,
|
|
2188
|
+
"isCanonical": false
|
|
2180
2189
|
}
|
|
2181
2190
|
],
|
|
2182
2191
|
"tokens": [
|
|
@@ -2187,7 +2196,10 @@
|
|
|
2187
2196
|
"index": 0,
|
|
2188
2197
|
"tokenId": "0x6d1e7cde53ba9467b783cb7c530ce054",
|
|
2189
2198
|
"isCanonical": true,
|
|
2190
|
-
"evmContract":
|
|
2199
|
+
"evmContract": {
|
|
2200
|
+
"address": "0x6b9e773128f453f5c2c60935ee2de2cbc5390a24",
|
|
2201
|
+
"evm_extra_wei_decimals": -2
|
|
2202
|
+
},
|
|
2191
2203
|
"fullName": null,
|
|
2192
2204
|
"deployerTradingFeeShare": "0.0"
|
|
2193
2205
|
},
|
|
@@ -6681,7 +6693,10 @@
|
|
|
6681
6693
|
"index": 381,
|
|
6682
6694
|
"tokenId": "0xbd6af8c18f3e56d2da95a3c81d18e814",
|
|
6683
6695
|
"isCanonical": false,
|
|
6684
|
-
"evmContract":
|
|
6696
|
+
"evmContract": {
|
|
6697
|
+
"address": "0x99603f5cb890faca5cc5495ccc74391cdffa28bc",
|
|
6698
|
+
"evm_extra_wei_decimals": 10
|
|
6699
|
+
},
|
|
6685
6700
|
"fullName": "Funnel BNB",
|
|
6686
6701
|
"deployerTradingFeeShare": "1.0"
|
|
6687
6702
|
},
|
|
@@ -6880,7 +6895,10 @@
|
|
|
6880
6895
|
"index": 398,
|
|
6881
6896
|
"tokenId": "0xec43194f64d555bdaef5afb5b6c6c686",
|
|
6882
6897
|
"isCanonical": false,
|
|
6883
|
-
"evmContract":
|
|
6898
|
+
"evmContract": {
|
|
6899
|
+
"address": "0xa51dc81944a15623874981181a99d6c56b20ed56",
|
|
6900
|
+
"evm_extra_wei_decimals": 11
|
|
6901
|
+
},
|
|
6884
6902
|
"fullName": "Stable",
|
|
6885
6903
|
"deployerTradingFeeShare": "1.0"
|
|
6886
6904
|
},
|
|
@@ -291,6 +291,12 @@
|
|
|
291
291
|
"feeRecipient": "0x40008f23a17a1ba9a6f25723a4d06bcd81c33426",
|
|
292
292
|
"assetToStreamingOiCap": [],
|
|
293
293
|
"subDeployers": [
|
|
294
|
+
[
|
|
295
|
+
"registerAsset",
|
|
296
|
+
[
|
|
297
|
+
"0xb26126e39214f9594802b59515f409479e202f3a"
|
|
298
|
+
]
|
|
299
|
+
],
|
|
294
300
|
[
|
|
295
301
|
"setOracle",
|
|
296
302
|
[
|
|
@@ -446,79 +452,79 @@
|
|
|
446
452
|
"assetToFundingMultiplier": [
|
|
447
453
|
[
|
|
448
454
|
"vntls:vANDRL",
|
|
449
|
-
"0.
|
|
455
|
+
"0.005000002"
|
|
450
456
|
],
|
|
451
457
|
[
|
|
452
458
|
"vntls:vANTHRPC",
|
|
453
|
-
"0.
|
|
459
|
+
"0.0171374751"
|
|
454
460
|
],
|
|
455
461
|
[
|
|
456
462
|
"vntls:vBYTED",
|
|
457
|
-
"0.
|
|
463
|
+
"0.0148191144"
|
|
458
464
|
],
|
|
459
465
|
[
|
|
460
466
|
"vntls:vCHAIN",
|
|
461
|
-
"0.
|
|
467
|
+
"0.005"
|
|
462
468
|
],
|
|
463
469
|
[
|
|
464
470
|
"vntls:vCLUELY",
|
|
465
|
-
"0
|
|
471
|
+
"2.0"
|
|
466
472
|
],
|
|
467
473
|
[
|
|
468
474
|
"vntls:vCOLOSSAL",
|
|
469
|
-
"0
|
|
475
|
+
"2.0"
|
|
470
476
|
],
|
|
471
477
|
[
|
|
472
478
|
"vntls:vCURSOR",
|
|
473
|
-
"0
|
|
479
|
+
"2.0"
|
|
474
480
|
],
|
|
475
481
|
[
|
|
476
482
|
"vntls:vDBRICKS",
|
|
477
|
-
"0.
|
|
483
|
+
"0.0050534663"
|
|
478
484
|
],
|
|
479
485
|
[
|
|
480
486
|
"vntls:vFIG",
|
|
481
|
-
"0
|
|
487
|
+
"2.0"
|
|
482
488
|
],
|
|
483
489
|
[
|
|
484
490
|
"vntls:vFIGAI",
|
|
485
|
-
"0.
|
|
491
|
+
"0.0050472398"
|
|
486
492
|
],
|
|
487
493
|
[
|
|
488
494
|
"vntls:vKRAKEN",
|
|
489
|
-
"0.
|
|
495
|
+
"0.005"
|
|
490
496
|
],
|
|
491
497
|
[
|
|
492
498
|
"vntls:vNLINK",
|
|
493
|
-
"0
|
|
499
|
+
"2.0"
|
|
494
500
|
],
|
|
495
501
|
[
|
|
496
502
|
"vntls:vOAI",
|
|
497
|
-
"0
|
|
503
|
+
"2.0"
|
|
498
504
|
],
|
|
499
505
|
[
|
|
500
506
|
"vntls:vPERPLXT",
|
|
501
|
-
"0.
|
|
507
|
+
"0.0167613111"
|
|
502
508
|
],
|
|
503
509
|
[
|
|
504
510
|
"vntls:vPOLY",
|
|
505
|
-
"0
|
|
511
|
+
"2.0"
|
|
506
512
|
],
|
|
507
513
|
[
|
|
508
514
|
"vntls:vRAMP",
|
|
509
|
-
"0.
|
|
515
|
+
"0.0050482304"
|
|
510
516
|
],
|
|
511
517
|
[
|
|
512
518
|
"vntls:vSPACEX",
|
|
513
|
-
"0.
|
|
519
|
+
"0.0050030981"
|
|
514
520
|
],
|
|
515
521
|
[
|
|
516
522
|
"vntls:vSTRIPE",
|
|
517
|
-
"0
|
|
523
|
+
"2.0"
|
|
518
524
|
],
|
|
519
525
|
[
|
|
520
526
|
"vntls:vXAI",
|
|
521
|
-
"0
|
|
527
|
+
"2.0"
|
|
522
528
|
]
|
|
523
529
|
]
|
|
524
530
|
},
|
|
@@ -1541,6 +1547,7 @@
|
|
|
1541
1547
|
[
|
|
1542
1548
|
"setOracle",
|
|
1543
1549
|
[
|
|
1550
|
+
"0x897ee1987787a2cd302ea9d729e5c46ccd302afe",
|
|
1544
1551
|
"0xa67b36947149a7f2312bffc9d1c859bf12029986"
|
|
1545
1552
|
]
|
|
1546
1553
|
]
|
|
@@ -2125,7 +2132,24 @@
|
|
|
2125
2132
|
"deployer": "0x2e3ee3705913258c9a0ecb643571045343d77e1b",
|
|
2126
2133
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2127
2134
|
"feeRecipient": null,
|
|
2128
|
-
"assetToStreamingOiCap": [
|
|
2135
|
+
"assetToStreamingOiCap": [
|
|
2136
|
+
[
|
|
2137
|
+
"trve:CRZD",
|
|
2138
|
+
"3000000.0"
|
|
2139
|
+
],
|
|
2140
|
+
[
|
|
2141
|
+
"trve:CS2",
|
|
2142
|
+
"3000000.0"
|
|
2143
|
+
],
|
|
2144
|
+
[
|
|
2145
|
+
"trve:F1LN",
|
|
2146
|
+
"3000000.0"
|
|
2147
|
+
],
|
|
2148
|
+
[
|
|
2149
|
+
"trve:PMRT",
|
|
2150
|
+
"3000000.0"
|
|
2151
|
+
]
|
|
2152
|
+
],
|
|
2129
2153
|
"subDeployers": [
|
|
2130
2154
|
[
|
|
2131
2155
|
"setOracle",
|
|
@@ -2168,7 +2192,16 @@
|
|
|
2168
2192
|
"deployer": "0xb38a498cc3f358899a5a7ad67608271b679a4167",
|
|
2169
2193
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2170
2194
|
"feeRecipient": null,
|
|
2171
|
-
"assetToStreamingOiCap": [
|
|
2195
|
+
"assetToStreamingOiCap": [
|
|
2196
|
+
[
|
|
2197
|
+
"trv:POKE",
|
|
2198
|
+
"3000000.0"
|
|
2199
|
+
],
|
|
2200
|
+
[
|
|
2201
|
+
"trv:ZARD",
|
|
2202
|
+
"3000000.0"
|
|
2203
|
+
]
|
|
2204
|
+
],
|
|
2172
2205
|
"subDeployers": [
|
|
2173
2206
|
[
|
|
2174
2207
|
"setOracle",
|
|
@@ -2479,7 +2512,16 @@
|
|
|
2479
2512
|
"deployer": "0x9b4989cb2735a1ac906cd99648fe3d84ef4b4d2d",
|
|
2480
2513
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2481
2514
|
"feeRecipient": null,
|
|
2482
|
-
"assetToStreamingOiCap": [
|
|
2515
|
+
"assetToStreamingOiCap": [
|
|
2516
|
+
[
|
|
2517
|
+
"trov:NDTO",
|
|
2518
|
+
"3000000.0"
|
|
2519
|
+
],
|
|
2520
|
+
[
|
|
2521
|
+
"trov:NTDO",
|
|
2522
|
+
"3000000.0"
|
|
2523
|
+
]
|
|
2524
|
+
],
|
|
2483
2525
|
"subDeployers": [
|
|
2484
2526
|
[
|
|
2485
2527
|
"setOracle",
|
|
@@ -2601,7 +2643,16 @@
|
|
|
2601
2643
|
"deployer": "0xfe770a17e47717b2e43504cf8f00ced96cf00979",
|
|
2602
2644
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2603
2645
|
"feeRecipient": null,
|
|
2604
|
-
"assetToStreamingOiCap": [
|
|
2646
|
+
"assetToStreamingOiCap": [
|
|
2647
|
+
[
|
|
2648
|
+
"trvv:BIRKN",
|
|
2649
|
+
"3000000.0"
|
|
2650
|
+
],
|
|
2651
|
+
[
|
|
2652
|
+
"trvv:WATCH",
|
|
2653
|
+
"3000000.0"
|
|
2654
|
+
]
|
|
2655
|
+
],
|
|
2605
2656
|
"subDeployers": [
|
|
2606
2657
|
[
|
|
2607
2658
|
"setOracle",
|
|
@@ -2620,7 +2671,16 @@
|
|
|
2620
2671
|
"deployer": "0xaaf21c1d7e7da1604c85d3ea93268e91902ba41e",
|
|
2621
2672
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2622
2673
|
"feeRecipient": null,
|
|
2623
|
-
"assetToStreamingOiCap": [
|
|
2674
|
+
"assetToStreamingOiCap": [
|
|
2675
|
+
[
|
|
2676
|
+
"trvo:BIRKN",
|
|
2677
|
+
"3000000.0"
|
|
2678
|
+
],
|
|
2679
|
+
[
|
|
2680
|
+
"trvo:WATCH",
|
|
2681
|
+
"3000000.0"
|
|
2682
|
+
]
|
|
2683
|
+
],
|
|
2624
2684
|
"subDeployers": [
|
|
2625
2685
|
[
|
|
2626
2686
|
"setOracle",
|
|
@@ -2639,7 +2699,20 @@
|
|
|
2639
2699
|
"deployer": "0x27f9d24b907b86bce4d2cf1299248421391aa444",
|
|
2640
2700
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2641
2701
|
"feeRecipient": null,
|
|
2642
|
-
"assetToStreamingOiCap": [
|
|
2702
|
+
"assetToStreamingOiCap": [
|
|
2703
|
+
[
|
|
2704
|
+
"tvr:HRMES",
|
|
2705
|
+
"3000000.0"
|
|
2706
|
+
],
|
|
2707
|
+
[
|
|
2708
|
+
"tvr:LVMH",
|
|
2709
|
+
"3000000.0"
|
|
2710
|
+
],
|
|
2711
|
+
[
|
|
2712
|
+
"tvr:RCHMT",
|
|
2713
|
+
"3000000.0"
|
|
2714
|
+
]
|
|
2715
|
+
],
|
|
2643
2716
|
"subDeployers": [
|
|
2644
2717
|
[
|
|
2645
2718
|
"setOracle",
|
|
@@ -2658,7 +2731,20 @@
|
|
|
2658
2731
|
"deployer": "0x2be16138a3ea12e09b38dae749f49accc735fded",
|
|
2659
2732
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2660
2733
|
"feeRecipient": null,
|
|
2661
|
-
"assetToStreamingOiCap": [
|
|
2734
|
+
"assetToStreamingOiCap": [
|
|
2735
|
+
[
|
|
2736
|
+
"torv:BRBY",
|
|
2737
|
+
"3000000.0"
|
|
2738
|
+
],
|
|
2739
|
+
[
|
|
2740
|
+
"torv:KRING",
|
|
2741
|
+
"3000000.0"
|
|
2742
|
+
],
|
|
2743
|
+
[
|
|
2744
|
+
"torv:PRADA",
|
|
2745
|
+
"3000000.0"
|
|
2746
|
+
]
|
|
2747
|
+
],
|
|
2662
2748
|
"subDeployers": [
|
|
2663
2749
|
[
|
|
2664
2750
|
"setOracle",
|
|
@@ -2677,7 +2763,20 @@
|
|
|
2677
2763
|
"deployer": "0x5f120e2aed50caf06e89ece2de71c9f5d30bb866",
|
|
2678
2764
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2679
2765
|
"feeRecipient": null,
|
|
2680
|
-
"assetToStreamingOiCap": [
|
|
2766
|
+
"assetToStreamingOiCap": [
|
|
2767
|
+
[
|
|
2768
|
+
"tvro:CRPI",
|
|
2769
|
+
"3000000.0"
|
|
2770
|
+
],
|
|
2771
|
+
[
|
|
2772
|
+
"tvro:GOOS",
|
|
2773
|
+
"3000000.0"
|
|
2774
|
+
],
|
|
2775
|
+
[
|
|
2776
|
+
"tvro:MONC",
|
|
2777
|
+
"3000000.0"
|
|
2778
|
+
]
|
|
2779
|
+
],
|
|
2681
2780
|
"subDeployers": [
|
|
2682
2781
|
[
|
|
2683
2782
|
"setOracle",
|
|
@@ -2696,7 +2795,16 @@
|
|
|
2696
2795
|
"deployer": "0xab8b0324d63cb39728f8c7502ff3b1a905ae8b0d",
|
|
2697
2796
|
"oracleUpdater": "0xec6c68168d9fd51bb078acc74722aeff14db220b",
|
|
2698
2797
|
"feeRecipient": null,
|
|
2699
|
-
"assetToStreamingOiCap": [
|
|
2798
|
+
"assetToStreamingOiCap": [
|
|
2799
|
+
[
|
|
2800
|
+
"tvor:CPRI",
|
|
2801
|
+
"3000000.0"
|
|
2802
|
+
],
|
|
2803
|
+
[
|
|
2804
|
+
"tvor:TPR",
|
|
2805
|
+
"3000000.0"
|
|
2806
|
+
]
|
|
2807
|
+
],
|
|
2700
2808
|
"subDeployers": [
|
|
2701
2809
|
[
|
|
2702
2810
|
"setOracle",
|
|
@@ -2820,5 +2928,43 @@
|
|
|
2820
2928
|
"deployerFeeScale": "1.0",
|
|
2821
2929
|
"lastDeployerFeeScaleChangeTime": "2025-12-02T11:35:58.687904841",
|
|
2822
2930
|
"assetToFundingMultiplier": []
|
|
2931
|
+
},
|
|
2932
|
+
{
|
|
2933
|
+
"name": "wa",
|
|
2934
|
+
"fullName": "wa:GDR Test DEX",
|
|
2935
|
+
"deployer": "0x47515db2eab01758c740ab220352a34b8d5a3826",
|
|
2936
|
+
"oracleUpdater": "0x47515db2eab01758c740ab220352a34b8d5a3826",
|
|
2937
|
+
"feeRecipient": null,
|
|
2938
|
+
"assetToStreamingOiCap": [],
|
|
2939
|
+
"subDeployers": [
|
|
2940
|
+
[
|
|
2941
|
+
"setOracle",
|
|
2942
|
+
[
|
|
2943
|
+
"0x47515db2eab01758c740ab220352a34b8d5a3826"
|
|
2944
|
+
]
|
|
2945
|
+
]
|
|
2946
|
+
],
|
|
2947
|
+
"deployerFeeScale": "1.0",
|
|
2948
|
+
"lastDeployerFeeScaleChangeTime": "2025-12-03T11:35:21.991486494",
|
|
2949
|
+
"assetToFundingMultiplier": []
|
|
2950
|
+
},
|
|
2951
|
+
{
|
|
2952
|
+
"name": "org",
|
|
2953
|
+
"fullName": "org dex",
|
|
2954
|
+
"deployer": "0xf5e2c3905c402ea494e71248c6c75338b9098cf6",
|
|
2955
|
+
"oracleUpdater": "0xf5e2c3905c402ea494e71248c6c75338b9098cf6",
|
|
2956
|
+
"feeRecipient": null,
|
|
2957
|
+
"assetToStreamingOiCap": [],
|
|
2958
|
+
"subDeployers": [
|
|
2959
|
+
[
|
|
2960
|
+
"setOracle",
|
|
2961
|
+
[
|
|
2962
|
+
"0xf5e2c3905c402ea494e71248c6c75338b9098cf6"
|
|
2963
|
+
]
|
|
2964
|
+
]
|
|
2965
|
+
],
|
|
2966
|
+
"deployerFeeScale": "1.0",
|
|
2967
|
+
"lastDeployerFeeScaleChangeTime": "2025-12-05T11:15:20.928371793",
|
|
2968
|
+
"assetToFundingMultiplier": []
|
|
2823
2969
|
}
|
|
2824
2970
|
]
|
|
@@ -10646,6 +10646,24 @@
|
|
|
10646
10646
|
"name": "@1378",
|
|
10647
10647
|
"index": 1378,
|
|
10648
10648
|
"isCanonical": false
|
|
10649
|
+
},
|
|
10650
|
+
{
|
|
10651
|
+
"tokens": [
|
|
10652
|
+
1498,
|
|
10653
|
+
0
|
|
10654
|
+
],
|
|
10655
|
+
"name": "@1379",
|
|
10656
|
+
"index": 1379,
|
|
10657
|
+
"isCanonical": false
|
|
10658
|
+
},
|
|
10659
|
+
{
|
|
10660
|
+
"tokens": [
|
|
10661
|
+
1498,
|
|
10662
|
+
1452
|
|
10663
|
+
],
|
|
10664
|
+
"name": "@1380",
|
|
10665
|
+
"index": 1380,
|
|
10666
|
+
"isCanonical": false
|
|
10649
10667
|
}
|
|
10650
10668
|
],
|
|
10651
10669
|
"tokens": [
|
|
@@ -27527,6 +27545,39 @@
|
|
|
27527
27545
|
"evmContract": null,
|
|
27528
27546
|
"fullName": "$WASH launchpad 2025-12-02T20:17:18.214Z",
|
|
27529
27547
|
"deployerTradingFeeShare": "1.0"
|
|
27548
|
+
},
|
|
27549
|
+
{
|
|
27550
|
+
"name": "RNSZPK",
|
|
27551
|
+
"szDecimals": 0,
|
|
27552
|
+
"weiDecimals": 10,
|
|
27553
|
+
"index": 1496,
|
|
27554
|
+
"tokenId": "0x699de51e4fc0e6d7a6e450d2c3d92a1a",
|
|
27555
|
+
"isCanonical": false,
|
|
27556
|
+
"evmContract": null,
|
|
27557
|
+
"fullName": "$WASH launchpad 2025-12-04T03:17:21.132Z",
|
|
27558
|
+
"deployerTradingFeeShare": "1.0"
|
|
27559
|
+
},
|
|
27560
|
+
{
|
|
27561
|
+
"name": "VENAHX",
|
|
27562
|
+
"szDecimals": 1,
|
|
27563
|
+
"weiDecimals": 9,
|
|
27564
|
+
"index": 1497,
|
|
27565
|
+
"tokenId": "0x43513901b952fcb6d8d5697ce17fa58f",
|
|
27566
|
+
"isCanonical": false,
|
|
27567
|
+
"evmContract": null,
|
|
27568
|
+
"fullName": "$WASH launchpad 2025-12-05T10:17:24.096Z",
|
|
27569
|
+
"deployerTradingFeeShare": "1.0"
|
|
27570
|
+
},
|
|
27571
|
+
{
|
|
27572
|
+
"name": "LMB",
|
|
27573
|
+
"szDecimals": 2,
|
|
27574
|
+
"weiDecimals": 8,
|
|
27575
|
+
"index": 1498,
|
|
27576
|
+
"tokenId": "0x9f416264220c915ec41b6c4c0b11fab1",
|
|
27577
|
+
"isCanonical": false,
|
|
27578
|
+
"evmContract": null,
|
|
27579
|
+
"fullName": "LMB",
|
|
27580
|
+
"deployerTradingFeeShare": "1.0"
|
|
27530
27581
|
}
|
|
27531
27582
|
]
|
|
27532
27583
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useMemo, type ReactNode } from "react";
|
|
4
|
+
import { SpotMeta } from "@nktkas/hyperliquid";
|
|
5
|
+
import { AllPerpsMeta } from "../hip3/market-info";
|
|
6
|
+
import { InstrumentClient } from "../instrument/client";
|
|
7
|
+
|
|
8
|
+
const InstrumentContext = createContext<InstrumentClient | null>(null);
|
|
9
|
+
|
|
10
|
+
export interface InstrumentsProviderProps {
|
|
11
|
+
spotMeta: SpotMeta;
|
|
12
|
+
allPerpsMeta: AllPerpsMeta;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Provides InstrumentClient to the React tree.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <InstrumentsProvider spotMeta={spotMeta} allPerpsMeta={allPerpsMeta}>
|
|
22
|
+
* <App />
|
|
23
|
+
* </InstrumentsProvider>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function InstrumentsProvider({
|
|
27
|
+
spotMeta,
|
|
28
|
+
allPerpsMeta,
|
|
29
|
+
children,
|
|
30
|
+
}: InstrumentsProviderProps) {
|
|
31
|
+
const client = useMemo(
|
|
32
|
+
() => new InstrumentClient(spotMeta, allPerpsMeta).init(),
|
|
33
|
+
[spotMeta, allPerpsMeta],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<InstrumentContext.Provider value={client}>
|
|
38
|
+
{children}
|
|
39
|
+
</InstrumentContext.Provider>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Access the InstrumentClient from context.
|
|
45
|
+
* Must be used within an InstrumentsProvider.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* const client = useInstruments();
|
|
50
|
+
* const btc = client.getInstrument("BTC");
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export function useInstruments(): InstrumentClient {
|
|
54
|
+
const client = useContext(InstrumentContext);
|
|
55
|
+
if (!client) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
"useInstruments must be used within an InstrumentsProvider",
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return client;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Access the InstrumentClient from context, returns null if not in provider.
|
|
65
|
+
* Useful for optional instrument access.
|
|
66
|
+
*/
|
|
67
|
+
export function useInstrumentsOptional(): InstrumentClient | null {
|
|
68
|
+
return useContext(InstrumentContext);
|
|
69
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// ====== UTC-only rounding utilities ======
|
|
2
|
+
|
|
3
|
+
type RoundMode = 'floor' | 'round' | 'ceil';
|
|
4
|
+
|
|
5
|
+
const MIN = 60_000;
|
|
6
|
+
const HOUR = 60 * MIN;
|
|
7
|
+
const DAY = 24 * HOUR;
|
|
8
|
+
const WEEK = 7 * DAY;
|
|
9
|
+
|
|
10
|
+
const opOf = (m: RoundMode) => m === 'ceil' ? Math.ceil : m === 'round' ? Math.round : Math.floor;
|
|
11
|
+
|
|
12
|
+
interface UtcRoundOptions {
|
|
13
|
+
mode?: RoundMode; // default 'floor'
|
|
14
|
+
weekStartsOn?: 0|1|2|3|4|5|6; // only used if stepMs % WEEK === 0; 0=Sun..6=Sat
|
|
15
|
+
anchorUtc?: number; // custom UTC anchor (ms). Default 0 or computed for weekStartsOn
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Higher-order UTC rounder.
|
|
20
|
+
* Snaps an instant t to the UTC grid defined by (anchorUtc + k*stepMs).
|
|
21
|
+
* Formula: anchor + step * op((t - anchor)/step)
|
|
22
|
+
*/
|
|
23
|
+
export function makeUtcRounder(stepMs: number, opts: UtcRoundOptions = {}) {
|
|
24
|
+
const mode = opts.mode ?? 'floor';
|
|
25
|
+
const op = opOf(mode);
|
|
26
|
+
|
|
27
|
+
// Determine anchor in UTC millis
|
|
28
|
+
let anchorUtc = opts.anchorUtc ?? 0;
|
|
29
|
+
|
|
30
|
+
// If weekly and weekStartsOn provided, anchor to the desired weekday at 00:00 UTC
|
|
31
|
+
if (stepMs % WEEK === 0 && opts.weekStartsOn !== undefined) {
|
|
32
|
+
// 1970-01-04T00:00:00Z was a Sunday in UTC
|
|
33
|
+
const sundayUTC = Date.UTC(1970, 0, 4);
|
|
34
|
+
anchorUtc = sundayUTC + opts.weekStartsOn * DAY; // e.g., 1 => Monday, 2 => Tuesday, etc.
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (t: Date): Date => {
|
|
38
|
+
const ts = t.getTime(); // UTC ms
|
|
39
|
+
const snapped = op((ts - anchorUtc) / stepMs) * stepMs + anchorUtc;
|
|
40
|
+
return new Date(snapped);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ---------- Convenience helpers (UTC) ----------
|
|
45
|
+
|
|
46
|
+
// Floor to arbitrary minute step (UTC)
|
|
47
|
+
export const floorUtcMinutes = (stepMinutes: number) =>
|
|
48
|
+
makeUtcRounder(stepMinutes * MIN, { mode: 'floor' });
|
|
49
|
+
|
|
50
|
+
// Floor to hour/day/week (UTC)
|
|
51
|
+
export const floorUtcHour = () => makeUtcRounder(HOUR, { mode: 'floor' });
|
|
52
|
+
export const floorUtcDay = () => makeUtcRounder(DAY, { mode: 'floor' });
|
|
53
|
+
export const floorUtcWeek = (weekStartsOn: 0|1|2|3|4|5|6 = 1) =>
|
|
54
|
+
makeUtcRounder(WEEK, { mode: 'floor', weekStartsOn }); // default Monday-start
|
|
55
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { floorUtcWeek } from './flooredDateTime';
|
|
2
|
+
|
|
3
|
+
export enum DayOfWeek {
|
|
4
|
+
Sunday = 0,
|
|
5
|
+
Monday = 1,
|
|
6
|
+
Tuesday = 2,
|
|
7
|
+
Wednesday = 3,
|
|
8
|
+
Thursday = 4,
|
|
9
|
+
Friday = 5,
|
|
10
|
+
Saturday = 6,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface WeekInfo {
|
|
14
|
+
weekNumber: number;
|
|
15
|
+
startDate: Date;
|
|
16
|
+
endDate: Date;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const WEEK_IN_MS = 7 * 24 * 60 * 60 * 1000;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Gets the latest completed week information.
|
|
23
|
+
*
|
|
24
|
+
* @param currentTimestamp - Optional timestamp in milliseconds. If not provided, uses current time.
|
|
25
|
+
* @param offset - Optional number of weeks to offset (0 = latest completed week, 1 = previous week, etc.)
|
|
26
|
+
* @param weekStartsOn - Day of week the week should start on. Defaults to Thursday.
|
|
27
|
+
* @returns WeekInfo with weekNumber, startDate, and endDate
|
|
28
|
+
*/
|
|
29
|
+
export function getLatestCompletedWeek(
|
|
30
|
+
currentTimestamp?: number,
|
|
31
|
+
offset: number = 0,
|
|
32
|
+
weekStartsOn: DayOfWeek = DayOfWeek.Thursday
|
|
33
|
+
): WeekInfo {
|
|
34
|
+
const now = new Date(currentTimestamp ?? Date.now());
|
|
35
|
+
|
|
36
|
+
// floorUtcWeek floors to the beginning of the week on the specified day.
|
|
37
|
+
// This gives us the start of the *current* week, which is the end of the *last completed* week.
|
|
38
|
+
const floorToWeekStart = floorUtcWeek(weekStartsOn as 0|1|2|3|4|5|6);
|
|
39
|
+
const endDate = new Date(floorToWeekStart(now).getTime() - offset * WEEK_IN_MS);
|
|
40
|
+
|
|
41
|
+
// The start date of the completed week is 7 days before the end date.
|
|
42
|
+
const startDate = new Date(endDate.getTime() - WEEK_IN_MS);
|
|
43
|
+
|
|
44
|
+
// Using a fixed point in time for week 1 calculation for consistency
|
|
45
|
+
const week1StartDate = new Date(process.env.WEEK1_START_DATE || "2025-12-04T00:00:00Z");
|
|
46
|
+
const msSinceWeek1 = startDate.getTime() - week1StartDate.getTime();
|
|
47
|
+
const weekNumber = Math.round(msSinceWeek1 / WEEK_IN_MS) + 1;
|
|
48
|
+
|
|
49
|
+
return { weekNumber, startDate, endDate };
|
|
50
|
+
}
|
|
51
|
+
|