Skip to content

Sign in with Solana type error and subsequent failure when types are fixed. #94

Discussion options

You must be logged in to vote

Actually Anvit was already able to help me solve it:

The Output object has to be formatted with Array.from() on the client side
-> Because apparently Uint8Arrays can't be Json.stringified

So on the client I need to do this:

let strPayload = JSON.stringify({ input, output: {
account: {
address: output.account.address,
publicKey: Array.from(output.account.publicKey),
},
signature: Array.from(output["signature"]),
signedMessage: Array.from(output["signedMessage"]),
} });

const verifyResponse = await fetch("/api/wallet/verifySIWS", {
method: "POST",
body: strPayload,
});

And then on my server I do as you say and reformat it back to a Uint8Array:

const deconstructPayload: {
input: SolanaSignIn…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@adamdelphantom
Comment options

Comment options

You must be logged in to vote
1 reply
@s-bilic
Comment options

Answer selected by adamdelphantom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants