-
Couldn't load subscription status.
- Fork 325
Feat/opdata 4680 streamex ea #4132
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 16136ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| import { AdapterConfig } from '@chainlink/external-adapter-framework/config' | ||
|
|
||
| export const config = new AdapterConfig({ | ||
| STREAMEX_API_KEY: { |
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.
Usually prefixing the env var would be reserved for changes where you would select your api key per asset for example, but even then you'd probably want something more like GLDY_API_KEY, OTHERASSET_API_KEY, etc.
Based on the default API below seeming pretty special for us though, I'm assuming we'll be safe with just API_KEY
| export type BaseEndpointTypes = { | ||
| Parameters: typeof inputParameters.definition | ||
| Response: PoRProviderResponse & { | ||
| ripcordAsInt?: number |
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.
holding on additional usage info in ticket for whether we need this field or not
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.
seems we can remove
| tiers: { | ||
| default: { | ||
| rateLimit1m: 10, // 10 requests per minute | ||
| rateLimit1s: 2, // 20 per 10s = ~2 per second |
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 think you're trying to define some sort of burst limiter, correct?
While usefulness is debatable, I don't think this will work the way you expect it to. Here's the usage in the framework: https://github.com/smartcontractkit/ea-framework-js/blob/main/src/rate-limiting/index.ts#L139-L141
IMO just stick with the 10req/min and you can remove the rateLimit1s line.
| params: [param], | ||
| request: { | ||
| baseURL: config.API_ENDPOINT, | ||
| url: '/gldy-status', |
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.
qq: do you want to stick this in the default API_ENDPOINT or is it possible we'll reuse this data provider with another path?
| response: { | ||
| errorMessage: message, | ||
| ripcord, | ||
| ripcordAsInt, |
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.
again, may not need this (awaiting further details), if we do, this is not the correct implementation. See https://github.com/smartcontractkit/external-adapters-js/blob/main/packages/sources/the-network-firm/src/endpoint/reserve.ts#L17-L23 for more context
|
|
||
| // If ripcord is true, return 502 error | ||
| if (ripcord) { | ||
| const ripcordDetails = response.data.ripcordDetails.join(', ') |
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.
do we have an example of the ripcord details?
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.
can remove
|
Please also try adding transport unit tests 🙏 A good example written by @dskloetc is solactive EA: https://github.com/smartcontractkit/external-adapters-js/blob/main/packages/sources/solactive/test/unit/nav.test.ts Take a lot of inspiration from this test file. Adding the unit tests will likely require a small refactor of the transport in order to make it more testable. See https://github.com/smartcontractkit/external-adapters-js/blob/main/packages/sources/solactive/src/transport/nav.ts for inspiration there. |
Closes OPDATA-4680
Description
This EA fetches Streamex’s GLDY PoR status, verifies gold reserves and ripcord state, and outputs a result for Chainlink PoR feeds.
......
Changes
reserveendpoint and transport for streamex endpointSteps to Test
export STREAMEX_API_KEY=<STREAMEX_API_KEY>
reserve endpoint test
Quality Assurance
infra-k8sconfiguration file.adapter-secretsconfiguration file or update the soak testing blacklist.test-payload.jsonfile with relevant requests.feature/x,chore/x,release/x,hotfix/x,fix/x) or is created from Jira.