-
Notifications
You must be signed in to change notification settings - Fork 6
Generic delegator v2 #438
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?
Generic delegator v2 #438
Conversation
🚀 Preview environment deployed!Preview URL: https://preview.vechainkit.vechain.org/mikegeneric-delegator-v2 |
} | ||
throw new Error(t("No sufficient gas found for any token, please make sure you have enough balance in your wallet or check your gas token preferences")); | ||
} else { | ||
return await privyWalletProvider.sendTransaction({ |
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.
what if generic delegator is not enabled AND fee delegation url is not provided? Becsause we were saying that after we go live with generic delegator the fee delegation should not be mandatory anymore.
}; | ||
}; | ||
genericDelegator?: { | ||
enabled: boolean; |
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.
dev does not need to know about generic delegator. By default it is enabled when using social login.
Now, what a dev can do is:
- he wants to pass a fee delegation url and delegate all transactions (which means that
delegateAllTransactions: boolean;
becomes obsolete) - or the user wants to pass his own generic delegator url
if there is a feeDelegationUrl it has priority over all, otherwise we check if the dev provided a genericDelegatorUrl, if yes it has priority over our default one, otherwise we use the default one.
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'm not sure if this should be moved inside feeDelegation object
suggestedMaxGas, | ||
}); | ||
if (genericDelegator?.enabled) { | ||
for (let i = 0; i < availableTokens.length; i++) { |
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.
can we find a better way to write this piece of code?
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.
LGTM
Description
This PR allows developers to use a generic delegator instead of a dedicated fee delegation url.
This means that end users will pay an extra fee in order to pay for both gas fees and the service fee for using the generic delegator
Please visit the confluence page to see how to get your own local delegator working if testnet one is not updated or contact me
Closes #419
Updated packages (if any):