init: 初始化 AssetX 项目仓库
包含 webapp(Next.js 用户端)、webapp-back(Go 后端)、 antdesign(管理后台)、landingpage(营销落地页)、 数据库 SQL 和配置文件。
This commit is contained in:
16
webapp/lib/api/contracts.ts
Normal file
16
webapp/lib/api/contracts.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface ContractConfig {
|
||||
name: string
|
||||
chain_id: number
|
||||
address: string
|
||||
}
|
||||
|
||||
export async function fetchContracts(): Promise<ContractConfig[]> {
|
||||
try {
|
||||
const res = await fetch('/api/contracts')
|
||||
if (!res.ok) return []
|
||||
const data = await res.json()
|
||||
return data.contracts ?? []
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user