Feature/GBI-2521 - Add isPegoutRefundable method#26
Merged
AndresQuijano merged 5 commits intoflyover-2.2.0from Apr 3, 2025
Merged
Feature/GBI-2521 - Add isPegoutRefundable method#26AndresQuijano merged 5 commits intoflyover-2.2.0from
AndresQuijano merged 5 commits intoflyover-2.2.0from
Conversation
Dependency ReviewThe following issues were found:
License Issuesintegration-test/package-lock.json
package-lock.json
package.json
OpenSSF Scorecard
Scanned Files
|
| description: 'Network not specified for pegout quote' | ||
| }, | ||
| PEG_OUT_REFUND_NOT_EXPIRED_BY_BLOCKS: { | ||
| code: 'FLYOVER-SDK-0008', |
Collaborator
Author
There was a problem hiding this comment.
what do you mean?
src/sdk/isPegoutRefundable.ts
Outdated
| } | ||
|
|
||
| function isExpiredByDate (quote: PegoutQuoteDetail): boolean { | ||
| return quote.expireDate < (Date.now() / 1000) |
There was a problem hiding this comment.
Client-side time can be manipulated. It would be safer to also check that the difference between expireDate and current time is substantial (e.g., greater than a certain threshold).
Collaborator
Author
There was a problem hiding this comment.
Makes sense, I'll replace with last's block timestamp, that should address both points. Firstly because its a more reliable source of info, secondly because if the timestamp of the last block is expired then the actual time (and therefore the time when the refund is eventually called) is probably going to be higher so there difference increases
AndresQuijano
approved these changes
Mar 22, 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.
What
isPegoutRefundablein FlyoverSDK and integration testsisPegoutQuotePaidto use FlyoverContextWhy
This function is to let the consumer know if a pegout can be refunded so they can enable that action in their UI
Task
https://rsklabs.atlassian.net/browse/GBI-2521
Update
After the last changes, I needed to add a function to the core package. I added it in this commit in a new branch called version-0.5.0, this is only temporary we can discuss later in which core version we're going to include that function