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

feat: add swap quote provider protocol #53

Merged
merged 56 commits into from
Jun 3, 2024

Conversation

janndriessen
Copy link
Collaborator

@janndriessen janndriessen commented May 22, 2024

  • Adds the SwapQuoteProvider protocol making getting quotes more modular by being able to input any desired adapter to handle the swap quotes.

Closes #51

sellTokenAddress: string
}

export class ZeroExSwapQuoteProvider implements SwapQuoteProvider {
Copy link
Collaborator Author

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.

}

return params
}
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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.

@janndriessen janndriessen requested a review from 0xonramp May 22, 2024 13:57
@janndriessen janndriessen force-pushed the feat/add-swap-quote-provider-protocol branch from e138319 to 1f413b6 Compare May 23, 2024 15:42
@janndriessen janndriessen marked this pull request as ready for review June 3, 2024 08:00
@janndriessen janndriessen merged commit bca9305 into main Jun 3, 2024
1 check passed
@janndriessen janndriessen deleted the feat/add-swap-quote-provider-protocol branch June 3, 2024 08:00
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.

refactor: remove 0x dependencies
1 participant