diff --git a/sdk/graphql-transport/src/mappers/util.ts b/sdk/graphql-transport/src/mappers/util.ts index 387872df211fd..83796d9a7f2a2 100644 --- a/sdk/graphql-transport/src/mappers/util.ts +++ b/sdk/graphql-transport/src/mappers/util.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 export function toShortTypeString(type?: T): T { - return type?.replace(/0x0+(\d)/g, '0x$1').replace(/,\b/g, ', ') as T; + return type?.replace(/0x0{31,}(\d)/g, '0x$1').replace(/,\b/g, ', ') as T; } export function isNumericString(value: string) { diff --git a/sdk/graphql-transport/src/methods.ts b/sdk/graphql-transport/src/methods.ts index ab8590fd49045..833b0a6374704 100644 --- a/sdk/graphql-transport/src/methods.ts +++ b/sdk/graphql-transport/src/methods.ts @@ -10,7 +10,7 @@ import type { SuiMoveNormalizedModule, } from '@mysten/sui.js/client'; import { TransactionBlock } from '@mysten/sui.js/transactions'; -import { normalizeStructTag, parseStructTag } from '@mysten/sui.js/utils'; +import { normalizeStructTag, normalizeSuiAddress, parseStructTag } from '@mysten/sui.js/utils'; import type { ObjectFilter, @@ -412,7 +412,7 @@ export const RPC_METHODS: { afterStructs = page.structs?.pageInfo.endCursor; } - return mapNormalizedMoveModule(moveModule, pkg); + return mapNormalizedMoveModule(moveModule, normalizeSuiAddress(pkg)); }, async getNormalizedMoveStruct(transport, [pkg, module, struct]) { const moveStruct = await transport.graphqlQuery(