diff --git a/packages/core/src/Cardano/types/Transaction.ts b/packages/core/src/Cardano/types/Transaction.ts index bd5ffbd8086..2b7599a8e77 100644 --- a/packages/core/src/Cardano/types/Transaction.ts +++ b/packages/core/src/Cardano/types/Transaction.ts @@ -96,7 +96,9 @@ export enum RedeemerPurpose { mint = 'mint', certificate = 'certificate', withdrawal = 'withdrawal', - delegateRepresentative = 'representative' + delegateRepresentative = 'representative', + propose = 'propose', + vote = 'vote' } export interface Redeemer { diff --git a/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/Redeemer.ts b/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/Redeemer.ts index e4f1a28a794..defed96139b 100644 --- a/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/Redeemer.ts +++ b/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/Redeemer.ts @@ -107,6 +107,12 @@ export class Redeemer { case RedeemerTag.Reward: purpose = Cardano.RedeemerPurpose.withdrawal; break; + case RedeemerTag.Voting: + purpose = Cardano.RedeemerPurpose.vote; + break; + case RedeemerTag.Proposing: + purpose = Cardano.RedeemerPurpose.propose; + break; default: throw new InvalidStateError(`Invalid redeemer type ${this.#tag}`); } @@ -140,6 +146,12 @@ export class Redeemer { case Cardano.RedeemerPurpose.withdrawal: tag = RedeemerTag.Reward; break; + case Cardano.RedeemerPurpose.vote: + tag = RedeemerTag.Voting; + break; + case Cardano.RedeemerPurpose.propose: + tag = RedeemerTag.Proposing; + break; default: throw new InvalidStateError(`Invalid redeemer type ${redeemer.purpose}`); } diff --git a/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/RedeemerTag.ts b/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/RedeemerTag.ts index 1ae37444629..74a67b7915c 100644 --- a/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/RedeemerTag.ts +++ b/packages/core/src/Serialization/TransactionWitnessSet/Redeemer/RedeemerTag.ts @@ -3,6 +3,13 @@ * redeemer in a transaction. When a Plutus script is executed, the specific action * type related to the redeemer can be identified using these tags, allowing the * script to respond appropriately. + * redeemer_tag = + * 0 ; Spending + * / 1 ; Minting + * / 2 ; Certifying + * / 3 ; Rewarding + * / 4 ; Voting + * / 5 ; Proposing */ export enum RedeemerTag { /** Indicates the redeemer is for spending a UTxO. */ @@ -12,5 +19,7 @@ export enum RedeemerTag { /** Indicates the redeemer is related to a certificate action within a transaction. */ Cert = 2, /** Indicates the redeemer is for withdrawing rewards from staking. */ - Reward = 3 + Reward = 3, + Voting = 4, + Proposing = 5 }