Developer Fundamentals

6. Fee Delegation Deep

Activate sponsors via service URL or private key for user-free tx.

Prerequisites

Users hate gas? Delegate! 🆓 Set buildTransactionBody(..., isDelegated: true).

Sponsor options:

  • Use a Service:

wallet = new ProviderInternalBaseWallet(..., gasPayer: { gasPayerServiceUrl: 'https://sponsor-testnet.vechain.energy/by90' }); 
provider = new VeChainProvider(thor, wallet, true);
wallet = new ProviderInternalBaseWallet(..., gasPayer: { gasPayerServiceUrl: 'https://sponsor-testnet.vechain.energy/by90' }); 
provider = new VeChainProvider(thor, wallet, true);
wallet = new ProviderInternalBaseWallet(..., gasPayer: { gasPayerServiceUrl: 'https://sponsor-testnet.vechain.energy/by90' }); 
provider = new VeChainProvider(thor, wallet, true);
  • Use a PrivateKey:

gasPayer: { gasPayerPrivateKey }
gasPayer: { gasPayerPrivateKey }
gasPayer: { gasPayerPrivateKey }

Running a backend? You can co-sign raw transactions following the VIP-201.


Same sign/send—magic! Mass adoption unlocked.​

CAN I MAKE TRANSACTIONS WITHOUT VTHO?

Delegate or it will fail; testnet sponsors first.