Skip to content

Add more_info_url to transaction lookup response#158

Merged
0xNgoo merged 5 commits into0xNgoo:mainfrom
Lynndabel:lookup
Apr 1, 2026
Merged

Add more_info_url to transaction lookup response#158
0xNgoo merged 5 commits into0xNgoo:mainfrom
Lynndabel:lookup

Conversation

@Lynndabel
Copy link
Copy Markdown
Contributor

Adds more_info_url to successful GET /transactions/:id lookup responses when server.interactiveDomain is configured. The URL points to the same interactive deposit status page the SDK already builds (e.g. https://anchor.example.com/deposit/:id). When no interactive domain is configured, more_info_url is omitted from the response.

Closes #92

How to test?
Automated
Run:
bash
bun test tests/mvp-express.integration.test.ts
Run full suite:
bash
bun test
Run lint:
bash
bun run lint
Manual verification (optional)
Start your app that mounts the router with server.interactiveDomain set.
Create an interactive deposit, then lookup the transaction:
GET /transactions/:id
Confirm the JSON includes:
interactive_url
more_info_url (same /deposit/:id page, based on interactiveDomain)
Repeat with interactiveDomain unset and confirm more_info_url is not present.
Checklist
My code follows the code style of this project.
I have added tests for my changes.
I have updated the documentation accordingly. (not needed for this narrow change)
I have run bun run test and bun run lint locally.
Issue Reference
Closes #92

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@Lynndabel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request extends the transaction lookup API by introducing an optional more_info_url field in the response. This URL provides an additional link to the interactive deposit status page, enhancing user experience by offering another access point to transaction details, provided the necessary server configuration is in place.

Highlights

  • API Enhancement: The transaction lookup response for GET /transactions/:id now includes a new field, more_info_url.
  • Conditional Inclusion: The more_info_url is only present in the response if server.interactiveDomain is configured in the application settings.
  • URL Consistency: When present, more_info_url points to the same interactive deposit status page as the existing interactive_url.
  • Test Coverage: New test assertions have been added to verify the correct inclusion and value of more_info_url in the transaction lookup response.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the /deposit endpoint to conditionally include a more_info_url in the response, which is only present when server.interactiveDomain is configured. The changes also include an updated test case to assert the presence of this new URL. Feedback suggests refactoring the response data construction for improved type safety and maintainability by avoiding any and extracting URL components. Additionally, a new test case is recommended to cover the scenario where server.interactiveDomain is not configured, ensuring more_info_url is correctly omitted.

Comment on lines +558 to +574
const serverConfig = this.config.get('server');
const responseData: any = {
id: transaction.id,
kind: transaction.kind,
status: transaction.status,
amount: transaction.amount,
asset_code: transaction.assetCode,
account: transaction.account,
interactive_url: `${this.config.get('server').interactiveDomain ?? 'http://localhost:3000'}/deposit/${transaction.id}`,
interactive_url: `${serverConfig.interactiveDomain ?? 'http://localhost:3000'}/deposit/${transaction.id}`,
created_at: transaction.createdAt,
updated_at: transaction.updatedAt,
});
};

// Add more_info_url only when interactive domain is configured
if (serverConfig.interactiveDomain) {
responseData.more_info_url = `${serverConfig.interactiveDomain}/deposit/${transaction.id}`;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and type safety, I suggest a small refactor here:

  • Avoid using any for responseData. Record<string, unknown> is a more type-safe alternative that aligns with the sendJson function's signature.
  • Extract the URL components into constants to avoid repetition and make the code DRY (Don't Repeat Yourself). This makes it easier to update the URL structure in the future.
Suggested change
const serverConfig = this.config.get('server');
const responseData: any = {
id: transaction.id,
kind: transaction.kind,
status: transaction.status,
amount: transaction.amount,
asset_code: transaction.assetCode,
account: transaction.account,
interactive_url: `${this.config.get('server').interactiveDomain ?? 'http://localhost:3000'}/deposit/${transaction.id}`,
interactive_url: `${serverConfig.interactiveDomain ?? 'http://localhost:3000'}/deposit/${transaction.id}`,
created_at: transaction.createdAt,
updated_at: transaction.updatedAt,
});
};
// Add more_info_url only when interactive domain is configured
if (serverConfig.interactiveDomain) {
responseData.more_info_url = `${serverConfig.interactiveDomain}/deposit/${transaction.id}`;
}
const serverConfig = this.config.get('server');
const interactiveDomain = serverConfig.interactiveDomain;
const depositUrlPath = `/deposit/${transaction.id}`;
const responseData: Record<string, unknown> = {
id: transaction.id,
kind: transaction.kind,
status: transaction.status,
amount: transaction.amount,
asset_code: transaction.assetCode,
account: transaction.account,
interactive_url: `${interactiveDomain ?? 'http://localhost:3000'}${depositUrlPath}`,
created_at: transaction.createdAt,
updated_at: transaction.updatedAt,
};
// Add more_info_url only when interactive domain is configured
if (interactiveDomain) {
responseData.more_info_url = `${interactiveDomain}${depositUrlPath}`;
}

expect(response.body.more_info_url).toBe(
`https://anchor.example.com/deposit/${transactionId}`,
);
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This is a good test for the happy path. However, the test suite is missing coverage for the case where server.interactiveDomain is not configured. According to the logic, more_info_url should be omitted in that scenario. Please consider adding a new test case to verify this behavior and ensure robustness.

@0xNgoo
Copy link
Copy Markdown
Owner

0xNgoo commented Mar 26, 2026

@Lynndabel Please fix CI

@Lynndabel
Copy link
Copy Markdown
Contributor Author

@0xNgoo approve my workflow so i can see the error please

@0xNgoo
Copy link
Copy Markdown
Owner

0xNgoo commented Mar 28, 2026

@Lynndabel

Please fix ci

@0xNgoo 0xNgoo merged commit 5293e35 into 0xNgoo:main Apr 1, 2026
1 check passed
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.

Add more_info_url to transaction lookup response

2 participants