Bash & cURL

Prepare Pool Delegation Transaction

Payload

{
  "changeAddress": "addr_test1...",
  "delegations": [
    {
      "type": "pool",
      "address": "addr_test1...",
      "keyHash": "pool1z5uq..."
    }
  ]
}

Example

POOL_ID="pool1n3sjq3qvu5vvcd6aud6ndcwq7r3ghmkafcg60gznlwfrk2ucxku"
ADDR="addr_test1qzyttcj6czjltcs3tn3vls6yg90542lctrzwg5aagduqlfgupztxhczzmuakzfuwvrht542yrx7ll3fk29lcl2xl8axqh3pjdh"
# See Authentication page for API key details.
X_API_KEY="testnet_EyrkvCWDZqjkfLSe1pxaF0hXxUcByHEhHuXIBjt9"
curl -X POST \
     -H "Content-Type: application/json" \
     -H "X-Api-Key: ${X_API_KEY}" \
     -d '{
           "changeAddress": "'${ADDR}'",
           "delegations": [
             {
               "type": "pool",
               "address": "'${ADDR}'",
               "keyHash": "'${POOL_ID}'"
             }
           ]
         }' \
     https://preprod.api.ada-anvil.app/v2/services/transactions/build

Output

Last updated

Was this helpful?