Skip to content

Add getTokenDetails to currency tools #658

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

Merged
merged 1 commit into from
May 26, 2025
Merged

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented May 19, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

One small cleanup (maybe)

Comment on lines 36 to 50
/**
* Query the network for a token's details
*/
export async function getTokenDetails(
ai: ApiInput,
pluginId: string,
filter: EdgeGetTokenDetails
): Promise<EdgeToken[]> {
// The normal code path:
const tools = await getCurrencyTools(ai, pluginId)
if (tools.getTokenDetails == null) return []

return await tools.getTokenDetails(filter)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

This is simple enough, I would just put it inline in plugin-api.ts. There is no real logic in this function, just a wrapper around a tools method.

/**
* Search the blockchain for a token.
*/
export interface EdgeGetTokenDetails {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, shouldn't this be named EdgeGetTokenDetailsParams or EdgeGetTokenDetailsFilter?

@samholmes samholmes force-pushed the matthew/get-token-details branch from 8a3f1a0 to 99582c9 Compare May 22, 2025 16:17
@peachbits peachbits force-pushed the matthew/get-token-details branch from c86d5a8 to ee2855d Compare May 26, 2025 18:33
@peachbits peachbits enabled auto-merge May 26, 2025 18:33
@peachbits peachbits dismissed samholmes’s stale review May 26, 2025 19:15

changes accepted. dismissed review to merge while reviewer is OOO

@peachbits peachbits merged commit 15925f7 into master May 26, 2025
2 checks passed
@peachbits peachbits deleted the matthew/get-token-details branch May 26, 2025 19:15
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