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

Paul/mtpelerin fixes #5150

Merged
merged 4 commits into from
Jul 18, 2024
Merged

Paul/mtpelerin fixes #5150

merged 4 commits into from
Jul 18, 2024

Conversation

paullinator
Copy link
Member

@paullinator paullinator commented Jul 16, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@paullinator paullinator force-pushed the paul/mtpelerinFixes branch 2 times, most recently from aaef199 to 543d528 Compare July 16, 2024 23:25
CHANGELOG.md Outdated
@@ -3,9 +3,11 @@
## Unreleased

- added: 0x Gasless Swap exchange plugin
- added: Add Mt Pelerin support for buy and sell with reverse quotes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be clearer to be explicit instead of "reverse quote" - implying knowledge or agreement on what a "regular quote" is.

Suggest saying something along the lines of "fixed 'from' quote" or "fixed 'to' quote"

Would be helpful to adopt this kind of documentation/naming in code as well so it's easier to read.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree this is not well documented, but we and several exchange partners very frequently use the term "reverse" quote to refer to 'to' quotes. Almost every exchange partner offers 'from' quotes. It is seemingly the default and hence why it is considered the "regular" quote.

@@ -267,18 +271,32 @@ type WidgetParams = (WidgetBuyParams | WidgetSellParams) & {
type: 'webview' // Integration type ('web'|'popup'|'webview')
}

interface WidgetBuyParams {
interface WidgetBuySourceParams {
bsa: string // Default buy tab source amount
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interfaces need readability improvement.

bsa -> buySourceAmount... I think?
Human interpretation would be more efficient if more information could be gleaned from
call sites instead of having to look into definitions and implementations.

Also change comment format to /** comments */ so the hovers work if the
interface is still not clear to the reader.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will use the /** */ style quotes. Good catch. But I can't change the bsa type of params. Those are the API to MtPelerin so it's out of our control.


if (hexGasLimit != null && hexGasPrice != null) {
gasLimit = hexToDecimal(hexGasLimit)
gasPrice = div(hexToDecimal(hexGasPrice), '1000000000')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make 1000000000 constant

hash: string // Hash of signature
net: string // Default network
type: 'webview' // Integration type ('web'|'popup'|'webview')
lang?: string /** 2 characters language code ('fr'|'en') */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comments need to be above the keys to show in hovers

Copy link
Member Author

Choose a reason for hiding this comment

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

ack. waste of space.

@paullinator
Copy link
Member Author

/rebase

@paullinator paullinator merged commit 03eefab into develop Jul 18, 2024
2 checks passed
@paullinator paullinator deleted the paul/mtpelerinFixes branch July 18, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants