diff --git a/api/xverse.ts b/api/xverse.ts index 2a4ba77e..7a4d9a19 100644 --- a/api/xverse.ts +++ b/api/xverse.ts @@ -21,6 +21,7 @@ import { StackingPoolInfo, SupportedCurrency, TokenFiatRateResponse, + DappSectionData, } from '../types'; import { handleAxiosError } from './error'; import { fetchBtcOrdinalsData } from './ordinals'; @@ -310,6 +311,12 @@ export async function getAppConfig(network: NetworkType) { return appConfig; } +export async function getFeaturedDapps(network: NetworkType): Promise { + const url = `${XVERSE_API_BASE_URL(network)}/v2/featured/dapp`; + const response = await axios.get(url); + return response.data.featuredDapp; +} + export async function getSpamTokensList(network: NetworkType) { const spamTokensUrl = `${XVERSE_API_BASE_URL(network)}/v1/spam-tokens`; const spamTokens = await axios.get(spamTokensUrl); diff --git a/types/api/xverse/appConfig.ts b/types/api/xverse/appConfig.ts new file mode 100644 index 00000000..bc8ec2e8 --- /dev/null +++ b/types/api/xverse/appConfig.ts @@ -0,0 +1,18 @@ +export type FeaturedDapp = { + name: string; + url: string; + icon: string; + description: string; + order: number; + banner?: string; +}; + +export type DappSectionData = { + section: string; + view: string; + apps: FeaturedDapp[]; +}; + +export type AppConfig = { + btcApiURL: string; +}; diff --git a/types/index.ts b/types/index.ts index d58f53e6..f286f363 100644 --- a/types/index.ts +++ b/types/index.ts @@ -35,6 +35,7 @@ export * from './api/xverse/sponsor'; export type { Pool, StackerInfo, StackingData, StackingPoolInfo, StackingStateData } from './api/xverse/stacking'; export * from './api/xverse/transaction'; export * from './api/xverse/wallet'; +export * from './api/xverse/appConfig'; export * from './api/xverseInscribe'; export * from './currency'; export type { SupportedCurrency } from './currency';