Skip to content

Conversation

mikeredmond
Copy link
Collaborator

@mikeredmond mikeredmond commented Sep 5, 2025

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):

  • next-template
  • homepage
  • vechain-kit
  • contracts

@mikeredmond mikeredmond requested review from victhorbi and a team September 5, 2025 11:25
Copy link

github-actions bot commented Sep 5, 2025

🚀 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({
Copy link
Member

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;
Copy link
Member

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.

Copy link
Member

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++) {
Copy link
Member

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?

@Agilulfo1820 Agilulfo1820 changed the base branch from main to dev September 10, 2025 15:25
Copy link
Collaborator

@victhorbi victhorbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Agilulfo1820 Agilulfo1820 changed the base branch from dev to main September 19, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integrate generic delegator in VeChain kit v2
3 participants