-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: add swap quote provider protocol #53
Conversation
src/quote/swap/adapters/zeroex.ts
Outdated
sellTokenAddress: string | ||
} | ||
|
||
export class ZeroExSwapQuoteProvider implements SwapQuoteProvider { |
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.
Essentially, it's the same class as the ZeroExApi
only adapted to the protocol.
src/quote/swap/adapters/zeroex.ts
Outdated
} | ||
|
||
return params | ||
} |
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 is new converting the swap quote request to the zero ex api swap request.
} else { | ||
params.inputAmount = sellAmount.toString() | ||
} | ||
const quotePromise = swapQuoteProvider.getSwapQuote(params) |
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.
Using the new SwapQuoteRequest
inside this components quote provider which is an essential part of the FlashMintZeroEx provider.
e138319
to
1f413b6
Compare
feat: add swap quote interface
feat: add v3
feat: use rpc url
feat: remove 0x utils
feat: add 0x swap data
feat: enhance quote return
SwapQuoteProvider
protocol making getting quotes more modular by being able to input any desired adapter to handle the swap quotes.Closes #51