-
Notifications
You must be signed in to change notification settings - Fork 54
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
Conversation
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.
One small cleanup (maybe)
src/core/account/custom-tokens.ts
Outdated
/** | ||
* 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) | ||
} | ||
|
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.
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.
src/types/types.ts
Outdated
/** | ||
* Search the blockchain for a token. | ||
*/ | ||
export interface EdgeGetTokenDetails { |
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.
Also, shouldn't this be named EdgeGetTokenDetailsParams
or EdgeGetTokenDetailsFilter
?
8a3f1a0
to
99582c9
Compare
c86d5a8
to
ee2855d
Compare
changes accepted. dismissed review to merge while reviewer is OOO
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
none