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

Implement 0xgasless swap #334

Merged
merged 4 commits into from
Jul 3, 2024
Merged

Implement 0xgasless swap #334

merged 4 commits into from
Jul 3, 2024

Conversation

samholmes
Copy link
Contributor

@samholmes samholmes commented Jun 25, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

const orderId = apiSwapSubmition.tradeHash
const {
publicAddress: toWalletAddress
} = await swapRequest.toWallet.getReceiveAddress({
Copy link
Contributor

Choose a reason for hiding this comment

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

This is really freaking me out. We never seem to request an address from the toWallet before this line, so how on earth are the funds arriving there? It seems like the gasless swaps are only within the same wallet, so do we need to add a toWallet.id === fromWallet.id check?

@samholmes samholmes force-pushed the sam/0xgasless branch 2 times, most recently from f5510c4 to 88fc25c Compare June 26, 2024 22:46
Fee is paid out of the fromToken amount, so in other words, the exchange
rate is adjusted to account for the fee. This means the user will always
expect to pay the `nativeAmount` with no fee, but this does impact the
exchange rate used to calculate the buy-token (to-token) amount.
@samholmes samholmes merged commit 829ab3e into master Jul 3, 2024
1 check passed
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