14.05.2026 rip
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useQuery, useQueries, useMutation } from '@tanstack/react-query'
|
||||
import { getWalletBalance, getPrices, sendWallet, getWalletAddresses, getPortfolio, getTokensList, getRelayQuote, executeRelaySwap, signRawEvmTx, signSolTx, createWallet, revealMnemonic, CHAINS, type Chain, type SendWalletPayload, type RelayQuotePayload, type RelaySwapStep } from '../api/walletApi'
|
||||
import { getWalletBalance, getPrices, sendWallet, getWalletAddresses, getPortfolio, getTokensList, getRelayQuote, executeRelaySwap, signRawEvmTx, signSolTx, getTrxSwapQuote, executeTrxSwap, createWallet, revealMnemonic, CHAINS, type Chain, type SendWalletPayload, type RelayQuotePayload, type RelaySwapStep, type TrxSwapQuotePayload } from '../api/walletApi'
|
||||
|
||||
export function useWalletBalance(chain: Chain) {
|
||||
return useQuery({
|
||||
@@ -97,3 +97,20 @@ export function useSignSwap() {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export function useTrxSwapQuote(payload: TrxSwapQuotePayload | null) {
|
||||
return useQuery({
|
||||
queryKey: ['trx', 'quote', payload?.from, payload?.to, payload?.amountHuman],
|
||||
queryFn: () => getTrxSwapQuote(payload!),
|
||||
enabled: !!payload,
|
||||
staleTime: 10_000,
|
||||
})
|
||||
}
|
||||
|
||||
export function useFetchTrxQuote() {
|
||||
return useMutation({ mutationFn: getTrxSwapQuote })
|
||||
}
|
||||
|
||||
export function useExecuteTrxSwap() {
|
||||
return useMutation({ mutationFn: (quoteId: string) => executeTrxSwap(quoteId) })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user