Fee Delegation
VeChain Kit includes built-in fee delegation handling. If you already have fee delegation in your app, you must remove it to avoid conflicts.
Problem
Using both your own fee delegation and VeChain Kit's delegation causes:
Transaction failures
Double delegation attempts
Multiple signatures on transactions
Incorrect transaction format
Solution
Remove Existing Fee Delegation
Remove all custom fee delegation logic from your application:
Remove fee delegation middleware
Remove delegation signing logic
Remove any custom delegation providers
If you do not remove your own delegation then transactions could fail because your transaction will delegate 2 times, will have 2 signatures and an incorrect format.
Configure VeChain Kit Fee Delegation
Simply provide the delegation URL in the VeChainKitProvider:
<VeChainKitProvider
feeDelegation={{
delegatorUrl: process.env.NEXT_PUBLIC_DELEGATOR_URL,
delegateAllTransactions: false
}}
// ... other config
>
<App />
</VeChainKitProvider>
Delegation Options
delegatorUrl: Your fee delegation service URL
delegateAllTransactions: Set to true to delegate fees for all transactions, including VeWorld users
Important Notes
VeChain Kit handles all delegation logic internally
No additional delegation setup required
Works automatically with all supported wallets
Verification
To verify that delegation is working correctly:
Check that transactions only have one delegation signature
Monitor your delegation service logs
Ensure transactions complete successfully
Common Errors
"Transaction has multiple delegations": You still have custom delegation code active. Remove all custom delegation logic.
"Delegation failed": Check that your delegation URL is correct and the service is running.
Last updated
Was this helpful?