14.05.2026 rip
This commit is contained in:
@@ -255,6 +255,39 @@ export async function signSolTx(txData: unknown): Promise<unknown> {
|
||||
return walletPost('/api/wallets/SOL/sign-and-broadcast-tx', txData)
|
||||
}
|
||||
|
||||
export interface TrxSwapQuotePayload {
|
||||
from: string
|
||||
to: string
|
||||
amountHuman: string
|
||||
}
|
||||
|
||||
export interface TrxSwapQuoteData {
|
||||
quoteId: string
|
||||
expiresIn: number
|
||||
expectedOutFormatted: string
|
||||
minOutFormatted: string
|
||||
fees: {
|
||||
network: { amountFormatted: string; asset: string; amountUsd: number }
|
||||
}
|
||||
}
|
||||
|
||||
export async function getTrxSwapQuote(payload: TrxSwapQuotePayload): Promise<TrxSwapQuoteData> {
|
||||
const res = await walletPost<{ success: boolean; data: TrxSwapQuoteData }>(
|
||||
'/api/wallets/TRX/swap/quote',
|
||||
payload
|
||||
)
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function executeTrxSwap(quoteId: string): Promise<unknown> {
|
||||
return walletPost(
|
||||
'/api/wallets/TRX/swap',
|
||||
{ quoteId },
|
||||
true,
|
||||
{ 'Idempotency-Key': `trx-${Date.now()}` }
|
||||
)
|
||||
}
|
||||
|
||||
export async function createWallet(): Promise<void> {
|
||||
await walletPost<unknown>('/api/wallets/create', {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user