Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs/aptos transfer can not initiate to the wormhole sdk comment #1179

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/hooks/useHandleTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/utils/parseError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
}
Expand Down
Loading