Uniswap / v3-sdk

🛠 An SDK for building applications on top of Uniswap V3
MIT License
549 stars 425 forks source link

How do i send a tx to a wallet? #34

Closed buckyroid closed 3 years ago

buckyroid commented 3 years ago

Hi, I want to write a swap api for my native mobile dapp using this sdk. But I have a question, how do i send the transaction to user's wallet? I mean my user's wallet is connected to my app via walletconnect, i got their public wallet address but i cant find the 'send this tx to' part. (Sorry I ask this question here because I can't join uniswap discord channel (it says cant accept invite))

moodysalem commented 3 years ago

this question is not really clear (you do not send a transaction to the user's wallet, but rather to the swap router, via the web3 provider), but you can see examples of how we use the sdk to do swaps in the uniswap interface

https://github.com/Uniswap/uniswap-interface/blob/b14da2844d3d0ff7d9b6a099499b9402db52629c/src/hooks/useSwapCallback.ts#L97-L124