feat: use wallet URLs for Herald QR codes#352
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Herald to publish its configured wallet web URL to clients and switches Herald Client QR codes away from legacy archon://accept deep links toward wallet web URLs.
Changes:
- Expose Herald’s configured wallet base URL via
GET /api/config(walletUrl). - Build wallet web URLs client-side and use them for credential and member-alias QR codes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| services/herald/server/src/index.ts | Adds walletUrl to /api/config so clients can generate wallet web URLs consistently. |
| apps/herald-client/src/App.tsx | Introduces buildWalletUrl() and updates QR/link generation in credential/member views to use wallet web URLs. |
Comments suppressed due to low confidence (2)
apps/herald-client/src/App.tsx:857
fetchCredential()now fetches/configand/credentialin the same try/catch, but the error message fallback still says "Failed to fetch credential" even if/configis what fails. Splitting the requests (or adjusting the fallback message) would make failures easier to diagnose; also consider defaultingsetWalletUrl(configResponse.data.walletUrl || '')to keep state consistent if the field is missing.
useEffect(() => {
const fetchCredential = async () => {
try {
const configResponse = await api.get('/config');
setWalletUrl(configResponse.data.walletUrl);
const response = await api.get('/credential');
setCredentialData(response.data);
}
catch (err: any) {
if (err.response?.status === 401) {
navigate('/login');
} else {
setError(err.response?.data?.error || 'Failed to fetch credential');
}
apps/herald-client/src/App.tsx:1069
ViewMembernow only renders the QR/link whenaliasWalletUrlis truthy. If the server is older (nowalletUrlin/config) or the value is missing/invalid, the QR code disappears entirely, whereas previously it still rendered anarchon://accept?...link. Consider adding a backwards-compatible fallback (legacy URL or at least render the DID without a link) so the page doesn’t silently lose the primary action.
{memberData?.didDocument?.id && aliasWalletUrl && (
<a href={aliasWalletUrl} style={{ color: 'inherit', textDecoration: 'none' }}>
<QRCodeSVG value={aliasWalletUrl} />
<Typography variant="body1" sx={{ fontFamily: 'monospace', color: '#666', wordBreak: 'break-all', mt: 2 }}>
{memberData.didDocument.id}
</Typography>
</a>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
/api/configarchon://acceptlinksValidation
cd apps/herald-client && npx -y npm@10.9.2 run buildcd services/herald/server && npx -y npm@10.9.2 run build