Added three new experimental actions to the mini apps SDK in time for Builders Day: - viewToken: navigate to a token page - swapToken: open swap form with pre-filled tokens - sendToken: open send form with pre-filled token & recipient miniapps.farcaster.xyz/docs/sdk/cha...
Cast image embed
Kartik avatar
Already supported on Warpcast web and mobile for the warplet. On mobile, swap and send return the transaction hash on submission. To do: - Return transaction hash on web - Support external wallets
1
4
27
Newty avatar
Get it!
Online avatar
Hey I think the swapToken is not working on mobile (web is fine) @slokh
1
1
Kartik avatar
Will take a look. Got a mini app I can test it on?
1
1
Online avatar
Sure here on menu -> create and if you don’t have Degen then there should be a swap button:
PromoLeague
warpcast.com
PromoLeague
1
Kartik avatar
Looking at this now and doesn't seem like you're calling `sdk.experimental.swapToken` ? Not getting any requests in the mobile app when I press "Swap"
wasyl avatar
is `sendToken` going to be like a quick easier way to perform a typical token "transfer"? To replace usage with wagmi?
Cast image embed
1
1
Kartik avatar
Yeah basically, it also: - renders a nicer preview in the client which makes it more trustable for users than arbitrary tx preview - has the ability to just pass in a recipientFid and we resolve the address Might be some other stuff we can automatically support in the future like cross chain sends that mini app devs don’t have to worry about implementing
1
2
wasyl avatar
Hey @slokh running into an issue with this on Android warpcast app: - In my mini app, I prepare a transaction and call `sdk.experimental.sendToken(...)` with proper fields. - The 'send token' wallet slide up view shows "underneath" my mini app. So at first, it appeared like nothing happening. - After minimizing the mini app, I could then see the 'send tokens' wallet form view
1
Kartik avatar
Thanks for the report! Will fix in a bit
1
Juliuss avatar
for swapping is there a built in dex or does this need to be provided?
1
1
Kartik avatar
You don’t need to worry about any of that! That’s the beauty of it, you just prompt the user with some initial parameters and get back a tx hash (or an error) after the user is done on the client
1
1
Juliuss avatar
but if I created the token wouldn't I need to make sure I am creating a pool with the supported dex? Maybe there is more info in the docs lol.
1
Kartik avatar
Yeah so right now this will work if a pool already exists, we don’t set one up
1
Online avatar
@slokh it seems that the swapToken is not working as expected on web (mobile iOS is fine). the sellAmount and sellToken is ignored on web. using eip155:8453/native as selltoken maybe this is the problem
1
Kartik avatar
will take a look ty
3
1
Online avatar
it seems also that i can´t await for the swap tx within the mini app. after swapping the mini app is minimized and i think i never got this tx hashes
1
1
Kartik avatar
should be fixed, lmk if not
1
Callum Wanderloots ✨ avatar
so does this mean that if my website doesn't natively have tokens/swapping/wallet connect, I can start to do all of these things by referencing the mini app sdk? Can you explain in less technical terms what this means? :)
1
Kartik avatar
Yeah, you don’t have to worry about implementing it yourself if your app is a mini app
1
1
Callum Wanderloots ✨ avatar
cool! that's actually a big help for some of my plans. how does this work with the wallet connection side of things? it's all run natively by the warpcast auth, provided someone is routing through the mini-app rather than the website directly?
1
1
Kartik avatar
Yep exactly! Wallet is automatically connected when running as a mini app
Haole avatar
very cool! so wallet.warpcast.com is a separate project built with expo router? Is it embedded into the main app?
1
Kartik avatar
Yep
1
Garrett avatar
could sendToken be a token claim?
1
Kartik avatar
not following, wdym? intended use case right now is just transferring a token to someone
1
Garrett avatar
Like a linkdrop claim. Enable someone to claim a token if they are on an allowlist for example. Technically, that’s just a transfer but not sure if you can enable transfers from a different wallet than the connect warplet
1
Kartik avatar
What’s the benefit of having an action for that vs just submitting the tx yourself? For swap and send, the action is nice so mini apps don’t have to build their own token selector, quote fetching, cross chain swaps, etc
mvr 🐹 avatar
🔥 Host supports them as well?
1
Kartik avatar
Yep! Still some work to do over the next day or so, hence experimental
Already supported on Warpcast web and mobile for the warplet. On mobile, swap and send return the transaction hash on submission. To do: - Return transaction hash on web - Support external wallets
1
2
mvr 🐹 avatar
Cool, will add it. Any clue how quick coinbasewallet will be with supporting these experiments?
1
Kartik avatar
No idea, I think in general mini apps should have graceful fallbacks. Not all clients will support every action even beyond cbw (i.e. cura, uno, etc)
1
Max Jackson avatar
Ah man you guys are awesome
2
Joe Blau 🎩 avatar
You all are doing WORK!
1
Linda Xie (OOO until Jan 5) avatar
🔥
Kasra Rahjerdi avatar
huge