14.05.2026 rip

This commit is contained in:
2026-05-14 18:30:57 +03:00
parent 22bb446309
commit 2de30fbde6
14 changed files with 415 additions and 78 deletions

View File

@@ -35,6 +35,12 @@ export interface SendWalletResponse {
data: { txid: string; chain: Chain }
}
export interface WalletAddress {
chain: Chain
address: string
derivationPath: string
}
export const CHAINS: Chain[] = ['ETH', 'BSC', 'BTC', 'TRX', 'SOL']
async function walletGet<T>(path: string, allowRetry: boolean = true): Promise<T> {
@@ -94,6 +100,11 @@ async function walletPost<T>(path: string, body: unknown, allowRetry: boolean =
return data as T
}
export async function getWalletAddresses(): Promise<WalletAddress[]> {
const res = await walletGet<{ success: boolean; data: WalletAddress[] }>('/api/wallets')
return res.data
}
export async function getWalletBalance(chain: Chain): Promise<WalletBalanceData> {
const res = await walletGet<{ success: boolean; data: WalletBalanceData }>(`/api/wallets/${chain}/balance`)
return res.data