-
Notifications
You must be signed in to change notification settings - Fork 31
Added option fee-less transactions using launchtube #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for staging-tansu failed. Why did it fail? →
|
✅ Deploy Preview for tansu canceled.
|
|
Nice @truthixify let me know when this is ready for a review. Also please make it also work with testnet. It should mostly just be a matter of getting the env variable about network selection and selecting one or the other set of variables for the URL and Token. |
|
it’s ready for review now but are you suggesting we have a way to switch between mainnet and testnet using the config files? For now, it’s only on testnet. |
|
@truthixify in general the app works on both testnet and mainnet. It does it with some env vars. There is also an open issue to make things as bit smoother #247. What I suggest is to at least have a way to use testnet or mainnet from the env variables. To be clear, that feature is only really useful if we consider mainnet since on testnet we do not care how much operations cost. |
Ok cool, I’ll implement the option for both mainnet and testnet and we can choose based on the env we set. I’ll look into the issue you mentioned, maybe I can also fix that once I’m done with this. |
tupui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are close, nice 👍
| return res.json(); | ||
| }); | ||
|
|
||
| // Handle contract errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function for launchtube should stop there. There rest is the same as what we have for a classic transaction no? We should just have two small functions: send with launchtube; send with RPC. And then do the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, does this mean I need to write a separate function for send with RPC?
Also, I believe we don't want to throw any errors when send with launchtube fails right?
We just fall back to send with rpc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can have a function for launchtube and another one for the RPC. Or just a if for the RPC part if we don't need to post process the data to match a common data format.
Yes if launchtube is failing we want to use RPC. But failing launchtube is just about failing the request. The rest is the same code to deal with the response or error.
| import { retryAsync } from "../utils/retry"; | ||
| import { parseContractError } from "../utils/contractErrors"; | ||
|
|
||
| const LAUNCHTUBE_URL = import.meta.env.LAUNCHTUBE_URL || "https://launchtube.xyz"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default values should be testnet one.
|
You can check it now. |
Shadow-MMN
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is nice , just check the little reviews I gave
Happy Coding 😊
| * Check if Launchtube is enabled and configured | ||
| */ | ||
| export function isLaunchtubeEnabled(): boolean { | ||
| const useLaunchtube = import.meta.env.PUBLIC_USE_LAUNCHTUBE ?? "true"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant more to have above
import.meta.env.PUBLIC_USE_LAUNCHTUBE || "true";| const useLaunchtube = import.meta.env.PUBLIC_USE_LAUNCHTUBE ?? "true"; | ||
| return ( | ||
| useLaunchtube === "true" && | ||
| !!import.meta.env.PUBLIC_LAUNCHTUBE_TOKEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean this will always be there. So I am not sure we even need that function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I’ll look into this.
|
Any updates? |
|
CI is all red. Any updates? |
|
Friendly reminder @truthixify |
I'll check this again, took a long break after OD end. Sorry. |
This PR added option to create transaction where the fees are sponsored using the launch tube API.
This currently integrates with testnet.
Closes #201