From 0ca8f97b696d4fce197bdabb6e1445aee0a6303d Mon Sep 17 00:00:00 2001 From: Sebastian Scatularo Date: Fri, 15 Nov 2024 11:16:04 -0300 Subject: [PATCH] remove additional payload, since aptos does not support it acordingly to the wormhole sdk comment --- src/hooks/useHandleTransfer.tsx | 17 +++++++++-------- src/utils/parseError.ts | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hooks/useHandleTransfer.tsx b/src/hooks/useHandleTransfer.tsx index 8ea67c908..031cc9a00 100644 --- a/src/hooks/useHandleTransfer.tsx +++ b/src/hooks/useHandleTransfer.tsx @@ -282,19 +282,20 @@ async function aptos( const baseAmountParsed = parseUnits(amount, decimals); const feeParsed = parseUnits(relayerFee || "0", decimals); const transferAmountParsed = baseAmountParsed.add(feeParsed); - - const additionalPayload = maybeAdditionalPayload(); - + // Aptos does not support additional payload, comment out for now + // See https://github.com/wormhole-foundation/wormhole/blob/main/sdk/js/src/token_bridge/transfer.ts#L901 + // const additionalPayload = maybeAdditionalPayload(); const transferPayload = transferFromAptos( tokenBridgeAddress, tokenAddress, transferAmountParsed.toString(), recipientChain, - additionalPayload?.receivingContract || recipientAddress, - additionalPayload?.payload - ? undefined - : createNonce().readUInt32LE(0).toString(), - additionalPayload?.payload + recipientAddress, + //additionalPayload?.receivingContract || recipientAddress, + //additionalPayload?.payload + // ? undefined + // : createNonce().readUInt32LE(0).toString(), + //additionalPayload?.payload ); const hash = await waitForSignAndSubmitTransaction(transferPayload, wallet); diff --git a/src/utils/parseError.ts b/src/utils/parseError.ts index 76268fe25..7bba99f80 100644 --- a/src/utils/parseError.ts +++ b/src/utils/parseError.ts @@ -3,6 +3,8 @@ const MM_ERR_WITH_INFO_START = const DEFAULT_ERROR_MESSAGE = "An unknown error occurred"; const parseError = (e: any): string => { + // Logs more information about the error + console.trace(e); if (e?.data?.message?.startsWith(MM_ERR_WITH_INFO_START)) { return e.data.message.replace(MM_ERR_WITH_INFO_START, ""); }