Open
Conversation
moeodeh3
reviewed
Nov 6, 2025
Contributor
moeodeh3
left a comment
There was a problem hiding this comment.
good idea to add an example here! A few small comments, but the main one is that this feels a bit incomplete - we can see the client-side logic, but it might be worth also showing what the server-side implementation looks like (unless we already did)?
|
|
||
| const { body, stamp, url } = signed; | ||
|
|
||
| const xStamp = |
Contributor
There was a problem hiding this comment.
whats the reason for having this? Looking at the definition of stampSignRequest, the stamp is never a string and is instead:
export type TStamp = {
stampHeaderName: string;
stampHeaderValue: string;
};
so I think its safe to remove this check and just do:
const xStamp = stamp?.stampHeaderValue
| const xStamp = | ||
| typeof stamp === 'string' ? stamp : stamp?.stampHeaderValue; | ||
|
|
||
| if (!xStamp) throw new Error('Missing X-Stamp header value'); |
Contributor
There was a problem hiding this comment.
hmm to me we should:
const signed = await httpClient.stampSignRawPayload({
organizationId: session.organizationId,
signWith: <wallet_account_address>,
payload: 'hello',
encoding: 'PAYLOAD_ENCODING_TEXT_UTF8',
hashFunction: 'HASH_FUNCTION_SHA256',
});
if (!signed) throw new Error('Missing signed request');
const xStamp = stamp.stampHeaderValue
// continue on here
| }); | ||
|
|
||
| // Extract r, s, v -> signature | ||
| const { r, s, v } = data?.activity?.result?.signRawPayloadResult ?? {}; |
Contributor
There was a problem hiding this comment.
no need for this part IMO, we send off the stamped request and we are done from the client-side
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.