-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add Rango Exchange plugin (take 2) #330
Conversation
08408c4
to
601e5df
Compare
My new commits address comments from original PR #322 |
601e5df
to
f5a7988
Compare
src/swap/defi/rango.ts
Outdated
@@ -224,10 +225,12 @@ export function makeRangoPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin { | |||
} | |||
) | |||
|
|||
metaRequest | |||
.then(metaResponse => { | |||
metaRequestPromise = metaRequest |
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 should be broken out as a function and calling it should be governed by a global boolean instead of the promise. Otherwise, a rejected means the user will never use this plugin for the rest of their session.
src/swap/defi/rango.ts
Outdated
return metaResponse.json() | ||
return await metaResponse.json() | ||
} else { | ||
return await metaResponse.text() |
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.
Throw the return from .text() so the log is more useful than a cleaner error
src/swap/defi/rango.ts
Outdated
@@ -368,9 +373,9 @@ export function makeRangoPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin { | |||
amount: nativeAmount, | |||
disableEstimate: true, | |||
slippage: DEFAULT_SLIPPAGE, | |||
...(referrerAddress !== undefined && | |||
...(referrerAddress != null && |
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.
Optional: Can we just enforce that these exist where they're declared and get rid of this spread/boolchain nonsense?
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.
No we shouldn't enforce they exist as the plugin should be usable without referral fees.
f5a7988
to
04a4302
Compare
Some chains are disabled until we write code to support them but add them commented out anyway so we know their codes
04a4302
to
6f7be5e
Compare
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
New branch to address comments from #322