14.05.2026 rip
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user