From b1510229604b5b575dba4f77cf3f0d12aa32b583 Mon Sep 17 00:00:00 2001 From: Piotr Napierala Date: Mon, 29 Sep 2025 16:13:33 +0200 Subject: [PATCH] fix deserialization of poolIds The previous implementation was using a method that was working only with Cardano addresses. Since pool IDs aren't addresses, this was throwing errors. --- packages/mesh-core/src/utils/deserializer.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/mesh-core/src/utils/deserializer.ts b/packages/mesh-core/src/utils/deserializer.ts index db4db004c..5eaf84928 100644 --- a/packages/mesh-core/src/utils/deserializer.ts +++ b/packages/mesh-core/src/utils/deserializer.ts @@ -1,6 +1,7 @@ import { DeserializedAddress } from "@meshsdk/common"; import { core } from "../core"; +import { PoolId } from "@meshsdk/core-cst"; /** * Deserialize bech32 address into payment and staking parts, with visibility of whether they are script or key hash @@ -27,5 +28,7 @@ export const deserializeDatum = (datumCbor: string): T => * @param poolId The poolxxxx bech32 pool id * @returns The Ed25519 key hash */ -export const deserializePoolId = (poolId: string): string => - core.resolveEd25519KeyHash(poolId); +export const deserializePoolId = (poolId: string): string => { + const cardanoPoolId: PoolId = PoolId(poolId); + return PoolId.toKeyHash(cardanoPoolId).toString(); +};