fix(PaymentSession): find minSendAmount independent of rate#1048
Merged
Conversation
Contributor
Extension builds preview
|
sidvishnoi
commented
May 2, 2025
| #minSendAmountPromise: ReturnType<typeof this._findMinSendAmount>; | ||
|
|
||
| findMinSendAmount(): Promise<void> { | ||
| this.#minSendAmountPromise ??= this._findMinSendAmount(); |
Member
Author
There was a problem hiding this comment.
This ensures we call _findMinSendAmount() only once per PaymentSession instance.
Member
Author
|
Aside: I really need to figure out |
DarianM
approved these changes
May 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Part of #976
Extracted from #1046
Changes proposed in this pull request
minSendAmount, even if theadjustAmountmay change due to splits.adjustAmountresulting rate is >=minSendAmount, so it makes sense to findminSendAmountfirst, and not find it ever again.Known existing issues (discovered while working this out):
minSendAmountin future. In that case, we'd need to probe/findMinSendAmountagain.minSendAmount? Need to check how OP/Rafiki behaves in this scenario. For example, when sending ZAR to USD (20 units vs 1), minSendAmount can be 20. Rate of pay can say we've to pay 30, but we can pay either 20 or 40 (1 or 2 units only). OP allows this, but is this optimum distribution?