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

  1. 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

  1. 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>

  1. 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:

  1. Check that transactions only have one delegation signature

  2. Monitor your delegation service logs

  3. 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?