Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
VITE_DLP_ADDRESS =
VITE_STAKING_ADDRESS =
VITE_TOKEN_ADDRESS =
VITE_RPC_URL =
VITE_TEE_POOL_ADDRESS =
VITE_DF_BASE_URL =
VITE_DLP_ADDRESS=
VITE_STAKING_ADDRESS=
VITE_TOKEN_ADDRESS=
VITE_RPC_URL=
VITE_TEE_POOL_ADDRESS=
VITE_DF_BASE_URL=
VITE_INDEXER_BASE_URL=
24 changes: 24 additions & 0 deletions src/api/createAiTokenGatingConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { httpAiAgent, type ApiResponse } from "../lib/http/http";

export interface IAiTokenGatingResponse {
id: string;
createdAt: string;
updatedAt: string;
stakeThreshold: number;
balanceThreshold: number;
}

export interface ICreateTokenGatingConfigParams {
stakeThreshold: number;
balanceThreshold: number;
}

export async function createAiTokenGatingConfig(params: ICreateTokenGatingConfigParams) {
try {
const response: ApiResponse<IAiTokenGatingResponse> = await httpAiAgent.post(`/token-gating-configs`, params);

return response.data;
} catch (error) {
throw error;
}
}
18 changes: 18 additions & 0 deletions src/api/fetchAITokenGating.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { httpAiAgent, type ApiResponse } from "../lib/http/http";

export interface IAiTokenGatingResponse {
id: string;
createdAt: string;
updatedAt: string;
stakeThreshold: string;
balanceThreshold: string;
}
export async function fetchAiTokenGating() {
try {
const response: ApiResponse<IAiTokenGatingResponse> = await httpAiAgent.get(`/token-gating-configs/latest`);

return response.data;
} catch (error) {
throw error;
}
}
2 changes: 1 addition & 1 deletion src/api/fetchAvgChatsPerContributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { http, type ApiResponse } from "$lib/http/http";
export async function fetchAvgChatsPerContributor() {

try {
const response: ApiResponse<number> = await http.get(`/api/stats/average-chats-per-contributor`);
const response: ApiResponse<number> = await http.get(`/stats/average-chats-per-contributor`);

return response;
} catch (error) {
Expand Down
17 changes: 0 additions & 17 deletions src/api/fetchChatInfo.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/fetchChatStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function fetchChatStats(params: IChatStatsParams) {
const queryString = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<IChatStatItem> = await http.get(`/api/stats/chats-stats${queryString}`);
const response: ApiResponse<IChatStatItem> = await http.get(`/stats/chats-stats${queryString}`);

return response.data;
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/fetchDailyUniqueContributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function fetchDailyUniqueContributors(params: IDailyUniqueContribut
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<IDailyUniqueContributorsItem[]> = await http.get(`/api/stats/daily-unique-contributors${query}`);
const response: ApiResponse<IDailyUniqueContributorsItem[]> = await http.get(`/stats/daily-unique-contributors${query}`);

return response;
} catch (error) {
Expand Down
28 changes: 28 additions & 0 deletions src/api/fetchNetTokenFlow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { generateQuery } from "$lib/utils";
import { httpIndexRequest, type ApiResponse } from "../lib/http/http";

export interface INetTokenFlowResponse {
totalStakeAmount: string
totalUnstakeAmount: string
netFlow: string
dailyNetFlow: string
weeklyNetFlow: string
}

interface INetTokenFlowParams {
startDate: string
endDate: string
}

export async function fetchNetTokenFlow(params: INetTokenFlowParams) {
const { startDate, endDate } = params;
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<INetTokenFlowResponse> = await httpIndexRequest.get(`/staking-events/token-flow-info${query}`);

return response.data;
} catch (error) {
throw error;
}
}
2 changes: 1 addition & 1 deletion src/api/fetchNewChatsPerDay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function fetchNewChatsPerDay(params: INewChatsPerDayParams) {
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<INewChatsPerDayItem[]> = await http.get(`/api/stats/new-chats-per-day${query}`);
const response: ApiResponse<INewChatsPerDayItem[]> = await http.get(`/stats/new-chats-per-day${query}`);

return response;
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/fetchRefreshedChatsCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function fetchRefreshedChatsCount(params: IRefreshedChatsCountParam
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<number> = await http.get(`/api/stats/refreshed-chats-count${query}`);
const response: ApiResponse<number> = await http.get(`/stats/refreshed-chats-count${query}`);

return response;
} catch (error) {
Expand Down
37 changes: 0 additions & 37 deletions src/api/fetchRewardRequestForDate.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/api/fetchStakingEventForDate.ts

This file was deleted.

62 changes: 0 additions & 62 deletions src/api/fetchStakingEvents.ts

This file was deleted.

25 changes: 25 additions & 0 deletions src/api/fetchStakingMovement.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { generateQuery } from "$lib/utils";
import { httpIndexRequest, type ApiResponse } from "../lib/http/http";

export interface IStakeItem {
stakeamount: string,
date: string
}

interface IStakeMovementParams {
startDate: string
endDate: string
}

export async function fetchStakingMovement(params: IStakeMovementParams) {
const { startDate, endDate } = params;
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<IStakeItem[]> = await httpIndexRequest.get(`/staking-events/get-staking-movement${query}`);

return response.data;
} catch (error) {
throw error;
}
}
25 changes: 25 additions & 0 deletions src/api/fetchTokenEmissionMovement.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { generateQuery } from "$lib/utils";
import { httpIndexRequest, type ApiResponse } from "../lib/http/http";

export interface ITokenEmissionItem {
reqrewardamount: string,
date: string
}

interface ITokenEmissionMovementParams {
startDate: string
endDate: string
}

export async function fetchTokenEmissionMovement(params: ITokenEmissionMovementParams) {
const { startDate, endDate } = params;
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<ITokenEmissionItem[]> = await httpIndexRequest.get(`/request-rewards/get-token-emission-movement${query}`);

return response.data;
} catch (error) {
throw error;
}
}
24 changes: 24 additions & 0 deletions src/api/fetchTokenVelocity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { generateQuery } from "$lib/utils";
import { httpIndexRequest, type ApiResponse } from "../lib/http/http";

export interface ITokenVelocity {
tokenVelocity: string,
}

export interface ITokenVelocityParams {
startDate: string
endDate: string
}

export async function fetchTokenVelocity(params: ITokenVelocityParams) {
const { startDate, endDate } = params;
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<ITokenVelocity> = await httpIndexRequest.get(`/staking-events/token-velocity${query}`);

return response.data;
} catch (error) {
throw error;
}
}
25 changes: 25 additions & 0 deletions src/api/fetchTopStaker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { generateQuery } from "$lib/utils";
import { httpIndexRequest, type ApiResponse } from "../lib/http/http";

export interface ITopStakerItem {
wallet_address: string,
stake_amount: string
}

export interface ITopStakersParams {
startDate: string
endDate: string
}

export async function fetchTopStakers(params: ITopStakersParams) {
const { startDate, endDate } = params;
const query = generateQuery({ startDate, endDate });

try {
const response: ApiResponse<ITopStakerItem[]> = await httpIndexRequest.get(`/staking-events/top-5-stakers${query}`);

return response.data;
} catch (error) {
throw error;
}
}
Loading