-
Notifications
You must be signed in to change notification settings - Fork 276
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
Feat/getPriceQuote #2065
Feat/getPriceQuote #2065
Conversation
error: 'Invalid input: tokens must be an array of at least one token', | ||
message: '', |
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.
May be useful to have tokens must be an array of at least one token
in the message
?
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.
good call, adding
type PriceQuote = { | ||
/** The name of the token */ | ||
name: string | ''; | ||
/** The symbol of the token */ | ||
symbol: string | ''; | ||
/** The contract address of the token */ | ||
contractAddress: Address | ''; | ||
/** The price of the token */ | ||
price: string | ''; | ||
/** The timestamp of the price quote */ | ||
timestamp: number | 0; | ||
}; |
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.
Out of curiosity why the ''
?
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.
I haven't been able to discern the pattern, but sometimes the API doesn't return all the fields.
I don't think this is a problem, because it has so far always returned the contractAddress, and the caller should have all the other info.
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.
wouldn't '' be covered under string?
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.
@alessey ah, you're right, i can remove those nullish versions of the types. will handle in a follow-up
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.
lgtm
What changed? Why?
getPriceQuote
getPriceQuote
fetches price quotes for the provided token contract addresses and/or ETHgetPriceQuote
is available only on Base mainnetgetPriceQuote
interfaceRequest
Response
Usage
Notes to reviewers
How has it been tested?