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 = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 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 = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
declare const : .
declare const : bigint
const = await
.()
.({ , : })
.({ })
.()
const = await .()
await .()Script-Controlled Deregistration
import { , , } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
declare const : .
declare const : any
const = await
.()
.({
: ,
: .(0n, []),
: "deregister-script-stake"
})
.({ : })
.()
const = await .()
await .()Next Steps
- Registration — Re-register if needed
- Withdrawal — Withdraw rewards before deregistering