-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow optional "fetch_balance" parameter on /token-details route #204
Conversation
Something went wrong with PR preview build please check |
src/service/mercury/index.ts
Outdated
network: NetworkNames | ||
): Promise<{ name: string; symbol: string; decimals: string }> => { | ||
network: NetworkNames, | ||
fetchBalance: boolean = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: can we use a boolean naming convention here? should_fetch_balance
or something like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preview is available here: |
should we have a test at the route level as well? |
Preview is available here: |
@aristidesstaffieri good point, just added it here |
Use decimals as a string consistently
Preview is available here: |
@aristidesstaffieri I've made a change so that it's returning But it's funny though that |
Yeah that's a good point about decimals, I would guess that the http clients on the receiving ends are parsing it as a number when the json gets parsed but this lgtm for the big number, thanks! |
* Bump the minor-and-patch group with 3 updates (#190) Bumps the minor-and-patch group with 3 updates: [@blockaid/client](https://github.com/blockaid-official/blockaid-client-node), [@sentry/node](https://github.com/getsentry/sentry-javascript) and [fastify](https://github.com/fastify/fastify). Updates `@blockaid/client` from 0.31.0 to 0.32.0 - [Release notes](https://github.com/blockaid-official/blockaid-client-node/releases) - [Changelog](https://github.com/blockaid-official/blockaid-client-node/blob/main/CHANGELOG.md) - [Commits](blockaid-official/blockaid-client-node@v0.31.0...v0.32.0) Updates `@sentry/node` from 8.43.0 to 8.45.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](getsentry/sentry-javascript@8.43.0...8.45.0) Updates `fastify` from 5.1.0 to 5.2.0 - [Release notes](https://github.com/fastify/fastify/releases) - [Commits](fastify/fastify@v5.1.0...v5.2.0) --- updated-dependencies: - dependency-name: "@blockaid/client" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: "@sentry/node" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: fastify dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add Blockaid reporting endpoints (#196) * add Blockaid reporting endpoints * use Blockaid tx warning type and update tests * Bump webpack-cli from 5.1.4 to 6.0.1 in the major group (#195) Bumps the major group with 1 update: [webpack-cli](https://github.com/webpack/webpack-cli). Updates `webpack-cli` from 5.1.4 to 6.0.1 - [Release notes](https://github.com/webpack/webpack-cli/releases) - [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-cli/compare/[email protected]@6.0.1) --- updated-dependencies: - dependency-name: webpack-cli dependency-type: direct:development update-type: version-update:semver-major dependency-group: major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Allow optional "fetch_balance" parameter on /token-details route (#204) * Allow optional "fetch_balance" parameter on "/token-details/:contractId" route * fetch_balance => should_fetch_balance * Add tests on the route level * Parse balance to a string Use decimals as a string consistently --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Piyal Basu <[email protected]> Co-authored-by: Cássio Marcos Goulart <[email protected]>
Related: https://github.com/orgs/stellar/projects/58/views/2?pane=issue&itemId=80122477&issue=stellar%7Cfreighter%7C1646
Given the new "Add Token" API we are implementing on freighter's extension we'll need to return the token balance along with its other details in order to display it on the popup's UI (see comments) so users are aware of the new balance info.