-
Notifications
You must be signed in to change notification settings - Fork 327
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
fix: fix support CALL moonpay sell #8323
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
3 Skipped Deployments
|
return getFundProvider(providerName.toLowerCase()); | ||
return getFundProvider(provider.toLowerCase()); | ||
|
||
case ExchangeTypes.Sell: | ||
case ExchangeTypes.SellNg: | ||
return await getSellProvider(providerName.toLowerCase()); | ||
return await getSellProvider(provider.toLowerCase()); | ||
|
||
default: | ||
throw new Error(`Unknown partner ${providerName} type`); | ||
throw new Error(`Unknown partner ${provider} type`); |
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.
Why are you still lowerCasing here and why rename to provider? is it the providerName or now the providerId ?
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.
The provider ID is derived from the old provider's name, converted to lowercase to match the ID format.
However, there are NEW cases where the provider's name varies slightly; for example, "moonpay-sell" has a different public key than "moonpay" (moonpay for swap").
const [sellProvidersData, fundProviderData] = await Promise.all([ | ||
getProvidersData("sell"), | ||
getProvidersData("fund"), // Mercuryo is currently treated as a fund provider | ||
]); | ||
providerDataCache = { ...sellProvidersData, ...fundProviderData }; | ||
return providerDataCache; | ||
const sellProvidersData = await getProvidersData("sell"); | ||
return { ...sellProvidersData }; |
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.
The cache was introduced because old swaps spammed this network call.
With Live apps I can understand you want to remove this. But if you stop using just remove all of its reference in the file
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.
Happy to delete it!
@@ -18,32 +18,23 @@ const testSellProvider: ExchangeProviderNameAndSignature = { | |||
version: 2, | |||
}; | |||
|
|||
let providerDataCache: Record<string, ExchangeProviderNameAndSignature> | null = null; | |||
|
|||
/** | |||
* The result is cached after the first successful fetch to avoid redundant network calls. | |||
* - "fund" providers currently include Mercuryo, which is stored as a fund provider. |
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 does not seem true anymore
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.
what is not true anymore? it was not set in Sara's PR anymore so better remove it
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.
Mercuryo is correctly identified as a sell provider, I think Sara update/removed the logic but didn't change the comment
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.
ahhh yes removing also the comment ok got it
@@ -18,32 +18,23 @@ const testSellProvider: ExchangeProviderNameAndSignature = { | |||
version: 2, | |||
}; | |||
|
|||
let providerDataCache: Record<string, ExchangeProviderNameAndSignature> | null = null; | |||
|
|||
/** | |||
* The result is cached after the first successful fetch to avoid redundant network calls. | |||
* - "fund" providers currently include Mercuryo, which is stored as a fund provider. | |||
* If this behavior changes, this logic should be revisited. | |||
* Reference: https://github.dev/LedgerHQ/crypto-assets/blob/main/assets/partners/mercuryo/common.json |
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.
Link is broken after CAL redesign
β Checklist
npx changeset
was attached.π Description
Moonpay sell is rejected. Move from name to id.
Source of true CAL
β Context
π§ Checklist for the PR Reviewers