Skip to content
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

Disable includes.json files affects for endpoint:crypto/ crypto_lwba aliases #368

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Subarna-Singh
Copy link

DF 20953 - RWA updates- Disable includes.json files affects for endpoint:crypto/ crypto_lwba aliases
https://smartcontract-it.atlassian.net/browse/DF-20953

Copy link
Contributor

github-actions bot commented Jan 13, 2025

NPM Publishing labels 🏷️

🟢 This PR has valid version labels and will cause a minor bump.

@@ -152,7 +152,9 @@ export class PriceAdapter<
}

for (const endpoint of priceEndpoints) {
endpoint.requestTransforms?.push(requestTransform)
if (!['crypto', 'crypto-lwba'].includes(endpoint.name)){
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommend we lowercase it to avoid issues with for example Crypto

And is this safe? I see that for cryptocompare we are overrding BTC and ETH

Copy link
Contributor

@alecgard alecgard Jan 13, 2025

Choose a reason for hiding this comment

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

+1 that I'm not sure this is safe - can we instead upgrade the includes to have a concept of which endpoints it applies to?

My main concern is that this will change all EA's, and there is no way to tell from the EA implementation level that these includes will be ignored for certain endpoints.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree here, i think hardcoding 'crypto', 'crypto-lwba' might also miss endpoint name aliases in EAs where the "standard" endpoint name isn't used (eg: price instead of crypto)

For a more complete solution, my initial thought is something like eg:

[
  {
    "from": "BTC",
    "to": "ETH",
    "includes": [
      {
        "from": "ETH",
        "to": "BTC",
        "inverse": true,
        "endpoints": ["crypto", "crypto-lwba"]
      }
    ]
  }
]

where endpoints defaults to all endpoints - current behaviour - for backward compatibility

@@ -152,7 +152,9 @@ export class PriceAdapter<
}

for (const endpoint of priceEndpoints) {
endpoint.requestTransforms?.push(requestTransform)
if (!['crypto', 'crypto-lwba'].includes(endpoint.name)){
Copy link
Contributor

@alecgard alecgard Jan 13, 2025

Choose a reason for hiding this comment

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

+1 that I'm not sure this is safe - can we instead upgrade the includes to have a concept of which endpoints it applies to?

My main concern is that this will change all EA's, and there is no way to tell from the EA implementation level that these includes will be ignored for certain endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants