Skip to content

Conversation

@t-vila
Copy link
Contributor

@t-vila t-vila commented Nov 6, 2025

No description provided.

Copy link
Contributor

@moeodeh3 moeodeh3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?? {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this part IMO, we send off the stamped request and we are done from the client-side

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.

3 participants