Function govActionIdFromBech32

Deserializes a Bech32-encoded governance action ID string into a GovernanceActionId object.

This function parses a governance action ID string (e.g., "gov_action1...") according to the CIP-129 specification and returns a structured object containing the transaction ID and action index.

Throws an error if the Bech32 string is malformed or invalid.

https://cips.cardano.org/cip/CIP-129|CIP-129 for the official specification.

const bech32Id = 'gov_action1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpzklpgpf';
const govActionId = govActionIdFromBech32(bech32Id);

console.log(govActionId.id);
//-> "0000000000000000000000000000000000000000000000000000000000000000"

console.log(govActionId.actionIndex);
//-> 11