Skip to content

fix: await sealMessage which is now async#12

Closed
avral wants to merge 1 commit intoXPRNetwork:masterfrom
avral:fix/await-sealMessage
Closed

fix: await sealMessage which is now async#12
avral wants to merge 1 commit intoXPRNetwork:masterfrom
avral:fix/await-sealMessage

Conversation

@avral
Copy link

@avral avral commented Feb 8, 2026

Summary

sealMessage from @wharfkit/protocol-esr is now an async function, but it was being called without await. This caused the Promise object to be serialized as an empty object {}, resulting in an empty message being sent to the Buoy callback service.

Error: POST https://cb.anchor.link/... 400 (Bad Request) with body "Unable to forward empty message"

Root Cause

In @wharfkit/protocol-esr v1.6.0, sealMessage is defined as:

async function sealMessage(message, privateKey, publicKey, nonce) {
    return sealedMessagePayload(message, privateKey, publicKey, nonce);
}

But in this plugin it was called without await:

const sealedMessage = sealMessage(...) // Returns Promise, not SealedMessage

When Serializer.encode({ object: sealedMessage }) is called on a Promise, it produces an empty byte array.

Fix

- const sealedMessage = sealMessage(...)
+ const sealedMessage = await sealMessage(...)

Test Plan

  • Tested transaction signing with WebAuth wallet after fix
  • Verified sealed message is properly encoded (63+ bytes vs 0 bytes before)

🤖 Generated with Claude Code

sealMessage from @wharfkit/protocol-esr is now an async function,
but it was being called without await. This caused the Promise object
to be serialized as an empty object {}, resulting in empty message
being sent to the Buoy callback service (400 Bad Request: "Unable to
forward empty message").

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@andreyjamer
Copy link
Collaborator

Hello! Thank you for the PR. Yes it is caused by @wharfkit/protocol-esr update. In version 1.4.0 this method didn't return Promise.
Anyway I created another PR with your change + I bumped versions of our 3rdparty deps. #13

It should be reviewed and released soon

@andreyjamer
Copy link
Collaborator

@avral New version of @proton/wharfkit-plugin-webauth released. It already has this change. Feel free to update and try.
I'll close this PR for now.

@andreyjamer andreyjamer closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants