|
| 1 | +--- |
| 2 | +"@evolution-sdk/evolution": patch |
| 3 | +"@evolution-sdk/devnet": patch |
| 4 | +--- |
| 5 | + |
| 6 | +### Added: Redeemer Labels for Script Debugging |
| 7 | + |
| 8 | +Added optional `label` property to redeemer operations (`collectFrom`, `withdraw`, `mint`, and stake operations) to help identify which script failed during evaluation. |
| 9 | + |
| 10 | +```typescript |
| 11 | +client.newTx() |
| 12 | + .collectFrom({ |
| 13 | + inputs: [utxo], |
| 14 | + redeemer: makeSpendRedeemer(999n), |
| 15 | + label: "coordinator-spend-utxo" // Shows in failure output |
| 16 | + }) |
| 17 | + .withdraw({ |
| 18 | + stakeCredential, |
| 19 | + amount: 0n, |
| 20 | + redeemer: makeWithdrawRedeemer([999n]), |
| 21 | + label: "coordinator-withdrawal" |
| 22 | + }) |
| 23 | +``` |
| 24 | + |
| 25 | +When scripts fail, the `EvaluationError` now includes a structured `failures` array: |
| 26 | + |
| 27 | +```typescript |
| 28 | +interface ScriptFailure { |
| 29 | + purpose: "spend" | "mint" | "withdraw" | "cert" |
| 30 | + index: number |
| 31 | + label?: string // User-provided label |
| 32 | + redeemerKey: string // e.g., "spend:0", "withdraw:0" |
| 33 | + utxoRef?: string // For spend failures |
| 34 | + credential?: string // For withdraw/cert failures |
| 35 | + policyId?: string // For mint failures |
| 36 | + validationError: string |
| 37 | + traces: string[] |
| 38 | +} |
| 39 | +``` |
| 40 | + |
| 41 | +### Added: Stake Operations |
| 42 | + |
| 43 | +Full support for Conway-era stake operations: |
| 44 | + |
| 45 | +- `registerStake` - Register stake credential (RegCert) |
| 46 | +- `deregisterStake` - Deregister stake credential (UnregCert) |
| 47 | +- `delegateTo` - Delegate to pool and/or DRep (StakeDelegation, VoteDelegCert, StakeVoteDelegCert) |
| 48 | +- `registerAndDelegateTo` - Combined registration + delegation (StakeRegDelegCert, VoteRegDelegCert, StakeVoteRegDelegCert) |
| 49 | +- `withdraw` - Withdraw staking rewards (supports coordinator pattern with amount: 0n) |
| 50 | + |
| 51 | +All operations support script-controlled credentials with RedeemerBuilder for deferred redeemer resolution. |
0 commit comments