14.05.2026 rip

This commit is contained in:
2026-05-14 23:23:20 +03:00
parent 26a7315ea1
commit 0d114e12c2
6 changed files with 271 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
import { useQuery, useQueries, useMutation } from '@tanstack/react-query'
import { getWalletBalance, getPrices, sendWallet, getWalletAddresses, getPortfolio, getTokensList, getRelayQuote, executeRelaySwap, createWallet, revealMnemonic, CHAINS, type Chain, type SendWalletPayload, type RelayQuotePayload } from '../api/walletApi'
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'
export function useWalletBalance(chain: Chain) {
return useQuery({
@@ -88,3 +88,12 @@ export function useExecuteRelaySwap() {
mutationFn: (payload: RelayQuotePayload) => executeRelaySwap(payload),
})
}
export function useSignSwap() {
return useMutation({
mutationFn: ({ chain, txData }: { chain: Chain; txData: unknown }) => {
if (chain === 'SOL') return signSolTx(txData)
return signRawEvmTx(chain as 'ETH' | 'BSC', txData as RelaySwapStep['items'][0]['data'])
},
})
}