Evolution SDK
Staking

Deregistration

Deregister stake credentials and reclaim deposit

Deregistration

Deregistering a stake credential removes it from the chain and refunds the deposit you paid during registration. Withdraw all accumulated rewards before deregistering — rewards are lost after deregistration.

Basic Deregistration

import { , ,  } from "@evolution-sdk/evolution"

const  = .()
  .({
    : "https://cardano-preprod.blockfrost.io/api/v0",
    : ..!
  })
  .({ : ..!, : 0 })

declare const : .

const  = await .().({  }).()

const  = await .()
await .()

Withdraw and Deregister Together

Best practice: withdraw rewards and deregister in the same transaction to avoid losing rewards:

import { , ,  } from "@evolution-sdk/evolution"

const  = .()
  .({
    : "https://cardano-preprod.blockfrost.io/api/v0",
    : ..!
  })
  .({ : ..!, : 0 })

declare const : .
declare const : bigint

const  = await 
  .()
  .({ , :  })
  .({  })
  .()

const  = await .()
await .()

Script-Controlled Deregistration

import { , , ,  } from "@evolution-sdk/evolution"

const  = .()
  .({
    : "https://cardano-preprod.blockfrost.io/api/v0",
    : ..!
  })
  .({ : ..!, : 0 })

declare const : .
declare const : any

const  = await 
  .()
  .({
    : ,
    : .(0n, []),
    : "deregister-script-stake"
  })
  .({ :  })
  .()

const  = await .()
await .()

Next Steps