Delegations
API Overview
Delegations in Cardano enable users to participate in the network without running infrastructure themselves. Stake pool delegations allow users to earn rewards by supporting the network's security, while DRep delegations empower users to participate in governance decisions. The Anvil API simplifies implementing both delegation types through a unified interface, letting applications offer these essential features without complex blockchain interactions.
pool
Delegate to stake pool for rewards
StakeDelegation
drep
Delegate to DRep for governance
VoteDelegation
API Endpoint
URL: https://preprod.api.ada-anvil.app/v2/services/transactions/build
Method: POST
Headers: Content-Type: application/json
, x-api-key: YOUR_API_KEY
Request Format
Parameters
type
Either "pool"
or "drep"
Yes
address
User's full address
Yes
keyHash
Pool ID or DRep ID
Yes
changeAddress
Address for change
Yes
utxos
Array of UTXOs in CBOR hex format
Yes (in production)
Implementation Guides
Transaction Workflow
Prepare: Include delegation certificates in transaction
Build & Sign: Process transaction with proper certificates and signatures
Submit: Send to network (changes effective after current epoch)
Best Practices
Verification: Confirm pool/DRep IDs before delegation
Testing: Use testnet before mainnet operations
Error Handling: Implement robust handling for:
Invalid address formats
Unknown pool/DRep IDs
Insufficient funds
Missing signers
Related Resources
Last updated
Was this helpful?