@tokemak/graph-cli 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +591 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +574 -39
- package/dist/index.mjs +579 -43
- package/generated/arbitrum.ts +12671 -8242
- package/generated/base.ts +12671 -8242
- package/generated/eth.ts +12671 -8242
- package/generated/linea.ts +32662 -0
- package/generated/plasma.ts +12671 -8242
- package/generated/sonic.ts +12671 -8242
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// clients.ts
|
|
2
2
|
import { GraphQLClient } from "graphql-request";
|
|
3
|
-
import { base, mainnet, plasma, sonic, arbitrum } from "viem/chains";
|
|
3
|
+
import { base, mainnet, plasma, sonic, arbitrum, linea } from "viem/chains";
|
|
4
4
|
|
|
5
5
|
// generated/eth.ts
|
|
6
6
|
import gql from "graphql-tag";
|
|
@@ -346,12 +346,13 @@ var GetUserActivityDocument = gql`
|
|
|
346
346
|
}
|
|
347
347
|
`;
|
|
348
348
|
var GetUserBalanceChangeHistoryDocument = gql`
|
|
349
|
-
query GetUserBalanceChangeHistory($userAddress: Bytes
|
|
349
|
+
query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!, $vaultAddress: Bytes) {
|
|
350
350
|
userAutopoolBalanceChanges(
|
|
351
|
-
where: {walletAddress: $userAddress}
|
|
351
|
+
where: {walletAddress: $userAddress, vaultAddress: $vaultAddress}
|
|
352
352
|
orderBy: timestamp
|
|
353
353
|
orderDirection: asc
|
|
354
|
-
first:
|
|
354
|
+
first: $first
|
|
355
|
+
skip: $skip
|
|
355
356
|
) {
|
|
356
357
|
vaultAddress
|
|
357
358
|
timestamp
|
|
@@ -851,12 +852,13 @@ var GetUserActivityDocument2 = gql2`
|
|
|
851
852
|
}
|
|
852
853
|
`;
|
|
853
854
|
var GetUserBalanceChangeHistoryDocument2 = gql2`
|
|
854
|
-
query GetUserBalanceChangeHistory($userAddress: Bytes
|
|
855
|
+
query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!, $vaultAddress: Bytes) {
|
|
855
856
|
userAutopoolBalanceChanges(
|
|
856
|
-
where: {walletAddress: $userAddress}
|
|
857
|
+
where: {walletAddress: $userAddress, vaultAddress: $vaultAddress}
|
|
857
858
|
orderBy: timestamp
|
|
858
859
|
orderDirection: asc
|
|
859
|
-
first:
|
|
860
|
+
first: $first
|
|
861
|
+
skip: $skip
|
|
860
862
|
) {
|
|
861
863
|
vaultAddress
|
|
862
864
|
timestamp
|
|
@@ -1356,12 +1358,13 @@ var GetUserActivityDocument3 = gql3`
|
|
|
1356
1358
|
}
|
|
1357
1359
|
`;
|
|
1358
1360
|
var GetUserBalanceChangeHistoryDocument3 = gql3`
|
|
1359
|
-
query GetUserBalanceChangeHistory($userAddress: Bytes
|
|
1361
|
+
query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!, $vaultAddress: Bytes) {
|
|
1360
1362
|
userAutopoolBalanceChanges(
|
|
1361
|
-
where: {walletAddress: $userAddress}
|
|
1363
|
+
where: {walletAddress: $userAddress, vaultAddress: $vaultAddress}
|
|
1362
1364
|
orderBy: timestamp
|
|
1363
1365
|
orderDirection: asc
|
|
1364
|
-
first:
|
|
1366
|
+
first: $first
|
|
1367
|
+
skip: $skip
|
|
1365
1368
|
) {
|
|
1366
1369
|
vaultAddress
|
|
1367
1370
|
timestamp
|
|
@@ -1861,12 +1864,13 @@ var GetUserActivityDocument4 = gql4`
|
|
|
1861
1864
|
}
|
|
1862
1865
|
`;
|
|
1863
1866
|
var GetUserBalanceChangeHistoryDocument4 = gql4`
|
|
1864
|
-
query GetUserBalanceChangeHistory($userAddress: Bytes
|
|
1867
|
+
query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!, $vaultAddress: Bytes) {
|
|
1865
1868
|
userAutopoolBalanceChanges(
|
|
1866
|
-
where: {walletAddress: $userAddress}
|
|
1869
|
+
where: {walletAddress: $userAddress, vaultAddress: $vaultAddress}
|
|
1867
1870
|
orderBy: timestamp
|
|
1868
1871
|
orderDirection: asc
|
|
1869
|
-
first:
|
|
1872
|
+
first: $first
|
|
1873
|
+
skip: $skip
|
|
1870
1874
|
) {
|
|
1871
1875
|
vaultAddress
|
|
1872
1876
|
timestamp
|
|
@@ -2022,16 +2026,7 @@ function getSdk4(client, withWrapper = defaultWrapper4) {
|
|
|
2022
2026
|
};
|
|
2023
2027
|
}
|
|
2024
2028
|
|
|
2025
|
-
//
|
|
2026
|
-
import {
|
|
2027
|
-
coreBaseConfig,
|
|
2028
|
-
coreMainnetConfig,
|
|
2029
|
-
coreSonicConfig,
|
|
2030
|
-
corePlasmaConfig,
|
|
2031
|
-
coreArbitrumConfig
|
|
2032
|
-
} from "@tokemak/config";
|
|
2033
|
-
|
|
2034
|
-
// generated/arbitrum.ts
|
|
2029
|
+
// generated/linea.ts
|
|
2035
2030
|
import gql5 from "graphql-tag";
|
|
2036
2031
|
var GetAllAutopoolRebalancesDocument5 = gql5`
|
|
2037
2032
|
query GetAllAutopoolRebalances($first: Int = 1000, $skip: Int = 0) {
|
|
@@ -2375,12 +2370,13 @@ var GetUserActivityDocument5 = gql5`
|
|
|
2375
2370
|
}
|
|
2376
2371
|
`;
|
|
2377
2372
|
var GetUserBalanceChangeHistoryDocument5 = gql5`
|
|
2378
|
-
query GetUserBalanceChangeHistory($userAddress: Bytes
|
|
2373
|
+
query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!, $vaultAddress: Bytes) {
|
|
2379
2374
|
userAutopoolBalanceChanges(
|
|
2380
|
-
where: {walletAddress: $userAddress}
|
|
2375
|
+
where: {walletAddress: $userAddress, vaultAddress: $vaultAddress}
|
|
2381
2376
|
orderBy: timestamp
|
|
2382
2377
|
orderDirection: asc
|
|
2383
|
-
first:
|
|
2378
|
+
first: $first
|
|
2379
|
+
skip: $skip
|
|
2384
2380
|
) {
|
|
2385
2381
|
vaultAddress
|
|
2386
2382
|
timestamp
|
|
@@ -2537,26 +2533,566 @@ function getSdk5(client, withWrapper = defaultWrapper5) {
|
|
|
2537
2533
|
}
|
|
2538
2534
|
|
|
2539
2535
|
// clients.ts
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2536
|
+
import {
|
|
2537
|
+
coreBaseConfig,
|
|
2538
|
+
coreMainnetConfig,
|
|
2539
|
+
coreSonicConfig,
|
|
2540
|
+
corePlasmaConfig,
|
|
2541
|
+
coreArbitrumConfig,
|
|
2542
|
+
coreLineaConfig
|
|
2543
|
+
} from "@tokemak/config";
|
|
2544
|
+
|
|
2545
|
+
// generated/arbitrum.ts
|
|
2546
|
+
import gql6 from "graphql-tag";
|
|
2547
|
+
var GetAllAutopoolRebalancesDocument6 = gql6`
|
|
2548
|
+
query GetAllAutopoolRebalances($first: Int = 1000, $skip: Int = 0) {
|
|
2549
|
+
autopoolRebalances(
|
|
2550
|
+
orderBy: timestamp
|
|
2551
|
+
orderDirection: desc
|
|
2552
|
+
first: $first
|
|
2553
|
+
skip: $skip
|
|
2554
|
+
) {
|
|
2555
|
+
autopool
|
|
2556
|
+
timestamp
|
|
2557
|
+
blockNumber
|
|
2558
|
+
tokenOut {
|
|
2559
|
+
id
|
|
2560
|
+
symbol
|
|
2561
|
+
decimals
|
|
2562
|
+
}
|
|
2563
|
+
tokenOutValueInEth
|
|
2564
|
+
tokenOutValueBaseAsset
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
`;
|
|
2568
|
+
var GetAutopoolDayDataDocument6 = gql6`
|
|
2569
|
+
query GetAutopoolDayData($address: String!, $timestamp: BigInt!) {
|
|
2570
|
+
autopoolDayDatas(
|
|
2571
|
+
where: {id_contains_nocase: $address, timestamp_gte: $timestamp}
|
|
2572
|
+
orderBy: timestamp
|
|
2573
|
+
orderDirection: asc
|
|
2574
|
+
first: 1000
|
|
2575
|
+
) {
|
|
2576
|
+
totalSupply
|
|
2577
|
+
nav
|
|
2578
|
+
date
|
|
2579
|
+
timestamp
|
|
2580
|
+
id
|
|
2581
|
+
baseAsset {
|
|
2582
|
+
id
|
|
2583
|
+
decimals
|
|
2584
|
+
}
|
|
2585
|
+
autopoolApy
|
|
2586
|
+
autopoolDay7MAApy
|
|
2587
|
+
autopoolDay30MAApy
|
|
2588
|
+
rewarderApy
|
|
2589
|
+
rewarderDay7MAApy
|
|
2590
|
+
rewarderDay30MAApy
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
`;
|
|
2594
|
+
var GetAutopoolRebalancesDocument6 = gql6`
|
|
2595
|
+
query GetAutopoolRebalances($address: Bytes!, $first: Int! = 1000, $skip: Int! = 0) {
|
|
2596
|
+
autopoolRebalances(
|
|
2597
|
+
where: {autopool: $address}
|
|
2598
|
+
orderBy: timestamp
|
|
2599
|
+
orderDirection: desc
|
|
2600
|
+
first: $first
|
|
2601
|
+
skip: $skip
|
|
2602
|
+
) {
|
|
2603
|
+
autopool
|
|
2604
|
+
timestamp
|
|
2605
|
+
logIndex
|
|
2606
|
+
transactionHash
|
|
2607
|
+
blockNumber
|
|
2608
|
+
tokenOut {
|
|
2609
|
+
id
|
|
2610
|
+
symbol
|
|
2611
|
+
}
|
|
2612
|
+
tokenOutAmount
|
|
2613
|
+
tokenOutValueInEth
|
|
2614
|
+
tokenOutValueBaseAsset
|
|
2615
|
+
tokenOutValueDenominatedIn
|
|
2616
|
+
tokenIn {
|
|
2617
|
+
id
|
|
2618
|
+
symbol
|
|
2619
|
+
}
|
|
2620
|
+
tokenInAmount
|
|
2621
|
+
tokenInValueInEth
|
|
2622
|
+
tokenInValueBaseAsset
|
|
2623
|
+
tokenInValueDenominatedIn
|
|
2624
|
+
destinationOutName
|
|
2625
|
+
destinationOutAddress
|
|
2626
|
+
destinationOutExchangeName
|
|
2627
|
+
destinationOutUnderlyingTokens {
|
|
2628
|
+
id
|
|
2629
|
+
symbol
|
|
2630
|
+
}
|
|
2631
|
+
destinationInName
|
|
2632
|
+
destinationInAddress
|
|
2633
|
+
destinationInExchangeName
|
|
2634
|
+
destinationInUnderlyingTokens {
|
|
2635
|
+
id
|
|
2636
|
+
symbol
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
`;
|
|
2641
|
+
var GetAutopoolsAprDocument6 = gql6`
|
|
2642
|
+
query GetAutopoolsApr {
|
|
2643
|
+
autopools(where: {registered: true}) {
|
|
2644
|
+
id
|
|
2645
|
+
rewarder {
|
|
2646
|
+
id
|
|
2647
|
+
currentApy
|
|
2648
|
+
day7MAApy
|
|
2649
|
+
day30MAApy
|
|
2650
|
+
currentRewardDuration
|
|
2651
|
+
currentRewardAmount
|
|
2652
|
+
extraRewarders {
|
|
2653
|
+
id
|
|
2654
|
+
currentApy
|
|
2655
|
+
rewardToken {
|
|
2656
|
+
symbol
|
|
2657
|
+
id
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
currentApy
|
|
2662
|
+
day7MAApy
|
|
2663
|
+
day30MAApy
|
|
2664
|
+
denominatedIn {
|
|
2665
|
+
id
|
|
2666
|
+
decimals
|
|
2667
|
+
symbol
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
`;
|
|
2672
|
+
var GetAutopoolsDayDataDocument6 = gql6`
|
|
2673
|
+
query GetAutopoolsDayData($timestamp: BigInt!, $first: Int = 1000, $skip: Int = 0) {
|
|
2674
|
+
autopoolDayDatas(
|
|
2675
|
+
where: {timestamp_gte: $timestamp}
|
|
2676
|
+
orderBy: timestamp
|
|
2677
|
+
orderDirection: asc
|
|
2678
|
+
first: $first
|
|
2679
|
+
skip: $skip
|
|
2680
|
+
) {
|
|
2681
|
+
totalSupply
|
|
2682
|
+
nav
|
|
2683
|
+
date
|
|
2684
|
+
timestamp
|
|
2685
|
+
id
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
`;
|
|
2689
|
+
var GetAutopoolsInactiveDestinationsDocument6 = gql6`
|
|
2690
|
+
query GetAutopoolsInactiveDestinations {
|
|
2691
|
+
autopools {
|
|
2692
|
+
id
|
|
2693
|
+
inactiveDestinations {
|
|
2694
|
+
vaultAddress
|
|
2695
|
+
exchangeName
|
|
2696
|
+
totalSupply
|
|
2697
|
+
debtValueHeldByVault
|
|
2698
|
+
lastSnapshotTimestamp
|
|
2699
|
+
dexPool
|
|
2700
|
+
lpTokenAddress
|
|
2701
|
+
lpTokenSymbol
|
|
2702
|
+
lpTokenName
|
|
2703
|
+
compositeReturn
|
|
2704
|
+
underlyingTokens {
|
|
2705
|
+
tokenAddress
|
|
2706
|
+
}
|
|
2707
|
+
underlyingTokenSymbols {
|
|
2708
|
+
symbol
|
|
2709
|
+
}
|
|
2710
|
+
underlyingTokenValueHeld {
|
|
2711
|
+
valueHeldInEth
|
|
2712
|
+
}
|
|
2713
|
+
reservesInEth
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
`;
|
|
2718
|
+
var GetAutopoolsRebalancesDocument6 = gql6`
|
|
2719
|
+
query GetAutopoolsRebalances {
|
|
2720
|
+
autopools(where: {registered: true}) {
|
|
2721
|
+
id
|
|
2722
|
+
rebalances(orderBy: timestamp, orderDirection: desc) {
|
|
2723
|
+
autopool
|
|
2724
|
+
blockNumber
|
|
2725
|
+
hash
|
|
2726
|
+
id
|
|
2727
|
+
ix
|
|
2728
|
+
autopool
|
|
2729
|
+
timestamp
|
|
2730
|
+
outData {
|
|
2731
|
+
id
|
|
2732
|
+
exchangeName
|
|
2733
|
+
ethValue
|
|
2734
|
+
destination
|
|
2735
|
+
underlyer {
|
|
2736
|
+
decimals
|
|
2737
|
+
id
|
|
2738
|
+
name
|
|
2739
|
+
symbol
|
|
2740
|
+
}
|
|
2741
|
+
tokens {
|
|
2742
|
+
decimals
|
|
2743
|
+
id
|
|
2744
|
+
name
|
|
2745
|
+
symbol
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
inData {
|
|
2749
|
+
ethValue
|
|
2750
|
+
exchangeName
|
|
2751
|
+
id
|
|
2752
|
+
destination
|
|
2753
|
+
underlyer {
|
|
2754
|
+
decimals
|
|
2755
|
+
id
|
|
2756
|
+
name
|
|
2757
|
+
symbol
|
|
2758
|
+
}
|
|
2759
|
+
tokens {
|
|
2760
|
+
decimals
|
|
2761
|
+
id
|
|
2762
|
+
name
|
|
2763
|
+
symbol
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
`;
|
|
2770
|
+
var GetLatestSubgraphTimestampDocument6 = gql6`
|
|
2771
|
+
query GetLatestSubgraphTimestamp {
|
|
2772
|
+
_meta {
|
|
2773
|
+
block {
|
|
2774
|
+
timestamp
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
`;
|
|
2779
|
+
var GetMutlipleAutopoolRebalancesDocument6 = gql6`
|
|
2780
|
+
query GetMutlipleAutopoolRebalances($addresses: [Bytes!]!) {
|
|
2781
|
+
autopools(where: {id_in: $addresses}) {
|
|
2782
|
+
id
|
|
2783
|
+
rebalances(orderBy: timestamp, orderDirection: desc) {
|
|
2784
|
+
autopool
|
|
2785
|
+
blockNumber
|
|
2786
|
+
hash
|
|
2787
|
+
id
|
|
2788
|
+
ix
|
|
2789
|
+
autopool
|
|
2790
|
+
timestamp
|
|
2791
|
+
outData {
|
|
2792
|
+
id
|
|
2793
|
+
exchangeName
|
|
2794
|
+
ethValue
|
|
2795
|
+
destination
|
|
2796
|
+
underlyer {
|
|
2797
|
+
decimals
|
|
2798
|
+
id
|
|
2799
|
+
name
|
|
2800
|
+
symbol
|
|
2801
|
+
}
|
|
2802
|
+
tokens {
|
|
2803
|
+
decimals
|
|
2804
|
+
id
|
|
2805
|
+
name
|
|
2806
|
+
symbol
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
inData {
|
|
2810
|
+
ethValue
|
|
2811
|
+
exchangeName
|
|
2812
|
+
id
|
|
2813
|
+
destination
|
|
2814
|
+
underlyer {
|
|
2815
|
+
decimals
|
|
2816
|
+
id
|
|
2817
|
+
name
|
|
2818
|
+
symbol
|
|
2819
|
+
}
|
|
2820
|
+
tokens {
|
|
2821
|
+
decimals
|
|
2822
|
+
id
|
|
2823
|
+
name
|
|
2824
|
+
symbol
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
`;
|
|
2831
|
+
var GetSTokeRewardsDocument6 = gql6`
|
|
2832
|
+
query GetSTokeRewards($first: Int = 1000, $skip: Int = 0) {
|
|
2833
|
+
poolRewardsBalances {
|
|
2834
|
+
id
|
|
2835
|
+
balance
|
|
2836
|
+
balanceUSD
|
|
2837
|
+
currentAprPerCredit
|
|
2838
|
+
}
|
|
2839
|
+
poolRewardsBalanceDayDatas(first: $first, skip: $skip) {
|
|
2840
|
+
id
|
|
2841
|
+
earned
|
|
2842
|
+
earnedUSD
|
|
2843
|
+
balance
|
|
2844
|
+
balanceUSD
|
|
2845
|
+
dayAprPerCredit
|
|
2846
|
+
timestamp
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
`;
|
|
2850
|
+
var GetSTokeVotesDocument6 = gql6`
|
|
2851
|
+
query GetSTokeVotes {
|
|
2852
|
+
voteStatuses(where: {id: "global"}) {
|
|
2853
|
+
id
|
|
2854
|
+
pools
|
|
2855
|
+
points
|
|
2856
|
+
}
|
|
2857
|
+
accTokeVoteWeights(where: {id: "global"}) {
|
|
2858
|
+
id
|
|
2859
|
+
voted
|
|
2860
|
+
notVoted
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
`;
|
|
2864
|
+
var GetTopAutopoolHoldersDocument6 = gql6`
|
|
2865
|
+
query GetTopAutopoolHolders($address: Bytes) {
|
|
2866
|
+
holders(
|
|
2867
|
+
orderBy: sharesHeld
|
|
2868
|
+
orderDirection: desc
|
|
2869
|
+
where: {autoPool: $address}
|
|
2870
|
+
first: 100
|
|
2871
|
+
) {
|
|
2872
|
+
sharesHeld
|
|
2873
|
+
user
|
|
2874
|
+
lastUpdated
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
`;
|
|
2878
|
+
var GetUserActivityDocument6 = gql6`
|
|
2879
|
+
query GetUserActivity($address: Bytes!) {
|
|
2880
|
+
userActivities(where: {user: $address}, first: 1000) {
|
|
2881
|
+
id
|
|
2882
|
+
timestamp
|
|
2883
|
+
type
|
|
2884
|
+
data
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
`;
|
|
2888
|
+
var GetUserBalanceChangeHistoryDocument6 = gql6`
|
|
2889
|
+
query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!, $vaultAddress: Bytes) {
|
|
2890
|
+
userAutopoolBalanceChanges(
|
|
2891
|
+
where: {walletAddress: $userAddress, vaultAddress: $vaultAddress}
|
|
2892
|
+
orderBy: timestamp
|
|
2893
|
+
orderDirection: asc
|
|
2894
|
+
first: $first
|
|
2895
|
+
skip: $skip
|
|
2896
|
+
) {
|
|
2897
|
+
vaultAddress
|
|
2898
|
+
timestamp
|
|
2899
|
+
items {
|
|
2900
|
+
shareChange
|
|
2901
|
+
assetChange
|
|
2902
|
+
staked
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
`;
|
|
2907
|
+
var GetUserSTokeBalanceDocument6 = gql6`
|
|
2908
|
+
query GetUserSTokeBalance($address: ID!) {
|
|
2909
|
+
accountBalanceV1S(where: {id: $address}) {
|
|
2910
|
+
id
|
|
2911
|
+
amount
|
|
2912
|
+
points
|
|
2913
|
+
cycleStartPoints
|
|
2914
|
+
cycleStartBalance
|
|
2915
|
+
cycleStartBalanceIndex
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
`;
|
|
2919
|
+
var GetUserSTokeVotesDocument6 = gql6`
|
|
2920
|
+
query GetUserSTokeVotes($address: ID!) {
|
|
2921
|
+
userVotes(where: {id: $address}) {
|
|
2922
|
+
id
|
|
2923
|
+
weights
|
|
2924
|
+
pools
|
|
2925
|
+
}
|
|
2926
|
+
accountBalanceV1S(where: {id: $address}) {
|
|
2927
|
+
id
|
|
2928
|
+
amount
|
|
2929
|
+
points
|
|
2930
|
+
cycleStartPoints
|
|
2931
|
+
cycleStartBalance
|
|
2932
|
+
cycleStartBalanceIndex
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
`;
|
|
2936
|
+
var GetUserVaultInfoDocument6 = gql6`
|
|
2937
|
+
query GetUserVaultInfo($address: ID!) {
|
|
2938
|
+
userInfo(id: $address) {
|
|
2939
|
+
vaults {
|
|
2940
|
+
vaultAddress
|
|
2941
|
+
totalShares
|
|
2942
|
+
walletShares
|
|
2943
|
+
stakedShares
|
|
2944
|
+
rewardsClaimed
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
`;
|
|
2949
|
+
var GetUserVaultsDayDataDocument6 = gql6`
|
|
2950
|
+
query GetUserVaultsDayData($address: Bytes!, $timestamp: BigInt!) {
|
|
2951
|
+
userVaultDayDatas(
|
|
2952
|
+
where: {walletAddress: $address, timestamp_gte: $timestamp}
|
|
2953
|
+
orderBy: timestamp
|
|
2954
|
+
orderDirection: asc
|
|
2955
|
+
) {
|
|
2956
|
+
date
|
|
2957
|
+
vaultAddress
|
|
2958
|
+
totalShares
|
|
2959
|
+
rewardsClaimed
|
|
2960
|
+
timestamp
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
`;
|
|
2964
|
+
var GetVaultAddedsDocument6 = gql6`
|
|
2965
|
+
query GetVaultAddeds {
|
|
2966
|
+
vaultAddeds {
|
|
2967
|
+
vault
|
|
2968
|
+
blockTimestamp
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
`;
|
|
2972
|
+
var GetTokenValueDayDatasDocument6 = gql6`
|
|
2973
|
+
query GetTokenValueDayDatas($tokenAddress: String!) {
|
|
2974
|
+
tokenValueDayDatas(
|
|
2975
|
+
where: {id_contains_nocase: $tokenAddress}
|
|
2976
|
+
orderBy: lastSnapshotTimestamp
|
|
2977
|
+
orderDirection: asc
|
|
2978
|
+
first: 1000
|
|
2979
|
+
) {
|
|
2980
|
+
lastSnapshotTimestamp
|
|
2981
|
+
priceInUsd
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
`;
|
|
2985
|
+
var defaultWrapper6 = (action, _operationName, _operationType, _variables) => action();
|
|
2986
|
+
function getSdk6(client, withWrapper = defaultWrapper6) {
|
|
2987
|
+
return {
|
|
2988
|
+
GetAllAutopoolRebalances(variables, requestHeaders) {
|
|
2989
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetAllAutopoolRebalancesDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetAllAutopoolRebalances", "query", variables);
|
|
2990
|
+
},
|
|
2991
|
+
GetAutopoolDayData(variables, requestHeaders) {
|
|
2992
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetAutopoolDayDataDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetAutopoolDayData", "query", variables);
|
|
2993
|
+
},
|
|
2994
|
+
GetAutopoolRebalances(variables, requestHeaders) {
|
|
2995
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetAutopoolRebalancesDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetAutopoolRebalances", "query", variables);
|
|
2996
|
+
},
|
|
2997
|
+
GetAutopoolsApr(variables, requestHeaders) {
|
|
2998
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetAutopoolsAprDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetAutopoolsApr", "query", variables);
|
|
2999
|
+
},
|
|
3000
|
+
GetAutopoolsDayData(variables, requestHeaders) {
|
|
3001
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetAutopoolsDayDataDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetAutopoolsDayData", "query", variables);
|
|
3002
|
+
},
|
|
3003
|
+
GetAutopoolsInactiveDestinations(variables, requestHeaders) {
|
|
3004
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetAutopoolsInactiveDestinationsDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetAutopoolsInactiveDestinations", "query", variables);
|
|
3005
|
+
},
|
|
3006
|
+
GetAutopoolsRebalances(variables, requestHeaders) {
|
|
3007
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetAutopoolsRebalancesDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetAutopoolsRebalances", "query", variables);
|
|
3008
|
+
},
|
|
3009
|
+
GetLatestSubgraphTimestamp(variables, requestHeaders) {
|
|
3010
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetLatestSubgraphTimestampDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetLatestSubgraphTimestamp", "query", variables);
|
|
3011
|
+
},
|
|
3012
|
+
GetMutlipleAutopoolRebalances(variables, requestHeaders) {
|
|
3013
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetMutlipleAutopoolRebalancesDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetMutlipleAutopoolRebalances", "query", variables);
|
|
3014
|
+
},
|
|
3015
|
+
GetSTokeRewards(variables, requestHeaders) {
|
|
3016
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetSTokeRewardsDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetSTokeRewards", "query", variables);
|
|
3017
|
+
},
|
|
3018
|
+
GetSTokeVotes(variables, requestHeaders) {
|
|
3019
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetSTokeVotesDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetSTokeVotes", "query", variables);
|
|
3020
|
+
},
|
|
3021
|
+
GetTopAutopoolHolders(variables, requestHeaders) {
|
|
3022
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetTopAutopoolHoldersDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetTopAutopoolHolders", "query", variables);
|
|
3023
|
+
},
|
|
3024
|
+
GetUserActivity(variables, requestHeaders) {
|
|
3025
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetUserActivityDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetUserActivity", "query", variables);
|
|
3026
|
+
},
|
|
3027
|
+
GetUserBalanceChangeHistory(variables, requestHeaders) {
|
|
3028
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetUserBalanceChangeHistoryDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetUserBalanceChangeHistory", "query", variables);
|
|
3029
|
+
},
|
|
3030
|
+
GetUserSTokeBalance(variables, requestHeaders) {
|
|
3031
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetUserSTokeBalanceDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetUserSTokeBalance", "query", variables);
|
|
3032
|
+
},
|
|
3033
|
+
GetUserSTokeVotes(variables, requestHeaders) {
|
|
3034
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetUserSTokeVotesDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetUserSTokeVotes", "query", variables);
|
|
3035
|
+
},
|
|
3036
|
+
GetUserVaultInfo(variables, requestHeaders) {
|
|
3037
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetUserVaultInfoDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetUserVaultInfo", "query", variables);
|
|
3038
|
+
},
|
|
3039
|
+
GetUserVaultsDayData(variables, requestHeaders) {
|
|
3040
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetUserVaultsDayDataDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetUserVaultsDayData", "query", variables);
|
|
3041
|
+
},
|
|
3042
|
+
GetVaultAddeds(variables, requestHeaders) {
|
|
3043
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetVaultAddedsDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetVaultAddeds", "query", variables);
|
|
3044
|
+
},
|
|
3045
|
+
GetTokenValueDayDatas(variables, requestHeaders) {
|
|
3046
|
+
return withWrapper((wrappedRequestHeaders) => client.request(GetTokenValueDayDatasDocument6, variables, { ...requestHeaders, ...wrappedRequestHeaders }), "GetTokenValueDayDatas", "query", variables);
|
|
3047
|
+
}
|
|
3048
|
+
};
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
// clients.ts
|
|
3052
|
+
var getEndpoint = (chainId) => {
|
|
3053
|
+
let config;
|
|
3054
|
+
switch (chainId) {
|
|
3055
|
+
case mainnet.id:
|
|
3056
|
+
config = coreMainnetConfig;
|
|
3057
|
+
break;
|
|
3058
|
+
case base.id:
|
|
3059
|
+
config = coreBaseConfig;
|
|
3060
|
+
break;
|
|
3061
|
+
case sonic.id:
|
|
3062
|
+
config = coreSonicConfig;
|
|
3063
|
+
break;
|
|
3064
|
+
case plasma.id:
|
|
3065
|
+
config = corePlasmaConfig;
|
|
3066
|
+
break;
|
|
3067
|
+
case arbitrum.id:
|
|
3068
|
+
config = coreArbitrumConfig;
|
|
3069
|
+
break;
|
|
3070
|
+
case linea.id:
|
|
3071
|
+
config = coreLineaConfig;
|
|
3072
|
+
break;
|
|
3073
|
+
default:
|
|
3074
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
3075
|
+
}
|
|
3076
|
+
if (!config) {
|
|
3077
|
+
throw new Error(
|
|
3078
|
+
`Config for chainId ${chainId} is undefined. Make sure @tokemak/config is properly installed and built.`
|
|
3079
|
+
);
|
|
3080
|
+
}
|
|
3081
|
+
if (!config.subgraphEndpoint) {
|
|
3082
|
+
throw new Error(
|
|
3083
|
+
`subgraphEndpoint is undefined for chainId ${chainId}. Make sure @tokemak/config is properly configured.`
|
|
3084
|
+
);
|
|
3085
|
+
}
|
|
3086
|
+
return config.subgraphEndpoint;
|
|
2546
3087
|
};
|
|
2547
3088
|
var getSdkByChainId = (chainId) => {
|
|
2548
|
-
const url =
|
|
2549
|
-
if (!url)
|
|
2550
|
-
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
3089
|
+
const url = getEndpoint(chainId);
|
|
2551
3090
|
const client = new GraphQLClient(url);
|
|
2552
|
-
if (chainId === base.id)
|
|
2553
|
-
|
|
2554
|
-
if (chainId ===
|
|
2555
|
-
|
|
2556
|
-
if (chainId ===
|
|
2557
|
-
return getSdk4(client);
|
|
2558
|
-
if (chainId === arbitrum.id)
|
|
2559
|
-
return getSdk5(client);
|
|
3091
|
+
if (chainId === base.id) return getSdk2(client);
|
|
3092
|
+
if (chainId === sonic.id) return getSdk3(client);
|
|
3093
|
+
if (chainId === plasma.id) return getSdk4(client);
|
|
3094
|
+
if (chainId === arbitrum.id) return getSdk6(client);
|
|
3095
|
+
if (chainId === linea.id) return getSdk5(client);
|
|
2560
3096
|
return getSdk(client);
|
|
2561
3097
|
};
|
|
2562
3098
|
export {
|