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

Swaps #1138

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open

Swaps #1138

wants to merge 18 commits into from

Conversation

musidlo
Copy link
Contributor

@musidlo musidlo commented Feb 27, 2025

No description provided.

@musidlo musidlo requested a review from 0xBigBoss as a code owner February 27, 2025 13:06
return (
<>
<Head>
<title>Send | Swap Form</title>
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for Form in the title


const CHAIN = 'base'
const SWAP_FEE = '75' // 0.75% feeAmount is the percentage of fees that we will take with base unit = 10000
const KYBER_NATIVE_TOKEN_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this? lol

}

const {
data: { routeSummary, routerAddress },
Copy link
Contributor

Choose a reason for hiding this comment

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

Should create a zod schema

}),
}).then((res) => res.json())) as KyberEncodeRouteResponse

if (response.code !== 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this code from kybers API?

throw new Error(response.message)
}

return response.data
Copy link
Contributor

Choose a reason for hiding this comment

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

Another place to consider a zod schema

Copy link

Vercel Unique URL: https://sendapp-kq3xwekkf-0xsend.vercel.app
Vercel Preview URL: sendapp-swaps-0xsend.vercel.app
Last Commit: edc2bdd

Copy link

Playwright Report

Summary

Expected Skipped Unexpected Flaky Duration
77 6 2 5 360.72s

Suites

account-rewards.onboarded.spec.ts

can visit rewards page

  • chromium: ✅
  • firefox: ✅

account-sendtag-add.onboarded.spec.ts

can visit add sendtags page

  • chromium: ✅
  • firefox: ✅

can add a pending tag

  • chromium: ✅
  • firefox: ✅

cannot add an invalid tag name

  • chromium: ✅
  • firefox: ✅

cannot add more than 5 tags

  • chromium: ✅
  • firefox: ✅

cannot confirm a tag without paying

  • chromium: ✅
  • firefox: ✅

account-sendtag-checkout.onboarded.spec.ts

can confirm a tag

  • chromium: ✅
  • firefox: ✅

can refer a tag

  • chromium: ✅
  • firefox: ✅

can refer multiple tags in separate transactions

  • chromium: ✅
  • firefox: ✅

account-settings-backup.onboarded.spec.ts

can backup account

  • chromium: ✅
  • firefox: ✅

can remove a signer

  • chromium: ✅
  • firefox: ✅

account.logged-in.spec.ts

can visit account page

  • chromium: ✅
  • firefox: ✅

can update profile

  • chromium: ✅
  • firefox: ✅

activity.onboarded.spec.ts

can visit activity page and see correct activity feed

  • chromium: ✅
  • firefox: ✅

can search on activity page

  • chromium: ✅
  • firefox: ✅

home.onboarded.spec.ts

can visit token detail page

  • chromium: ❌

    • Error: �[31mSnapshot comparison failed:�[39m

    /rest/v1/activity_feed?select=*&event_name=�[0m�[9m�[31meq.�[39m�[29m�[0m�[32min.%28�[39msend_account_transfers�[32m%2Csend_swap%29�[39m&data-%3E%3Elog_addr=eq.%5Cx833589fcd6edb6e08f4c7c32d4f71b54bda02913&or=%28from_user.not.is.null%2C+to_user.not.is.null%29&or=%28data-%3Et.is.null%2C+data-%3Ef.is.null%2C+and%28+data-%3E%3Et.not.in.%28%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%2C%5Cx4c99cdaab0cfe32b4ba77d30342b5c51e0444e5b%2C%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%2C%5Cx60e5445edc1a469cfc0181861c88bd4b6895f615%2C%5Cxc476bb9142440fa46db94ac3351a27f2f1036364%2C%5Cx60e5445edc1a469cfc0181861c88bd4b6895f615%29%2C+data-%3E%3Ef.not.in.%28%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%2C%5Cx4c99cdaab0cfe32b4ba77d30342b5c51e0444e5b%2C%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%29+%29%29&order=created_at.desc&offset=0&limit=10

Expected: �[33m/home/runner/_work/sendapp/sendapp/packages/playwright/tests/home.onboarded.spec.ts-snapshots/token-details-history-url-chromium�[39m
Received: �[33m/home/runner/_work/sendapp/sendapp/packages/playwright/test-results/home.onboarded-can-visit-token-detail-page-chromium-retry2/token-details-history-url-actual�[39m

�[0m �[90m 28 |�[39m status�[33m:�[39m �[35m200�[39m�[33m,�[39m
�[90m 29 |�[39m })
�[31m�[1m>�[22m�[39m�[90m 30 |�[39m expect�[33m.�[39msoft(�[32m${url.pathname}${url.search}�[39m)�[33m.�[39mtoMatchSnapshot(�[32m'token-details-history-url'�[39m)
�[90m |�[39m �[31m�[1m^�[22m�[39m
�[90m 31 |�[39m })
�[90m 32 |�[39m �[36mawait�[39m page�[33m.�[39mgoto(�[32m'/?token=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'�[39m) �[90m// usdc�[39m
�[90m 33 |�[39m log(�[32m'beforeEach'�[39m�[33m,�[39m �[32murl=${page.url()}�[39m)�[0m

at /home/runner/_work/sendapp/sendapp/packages/playwright/tests/home.onboarded.spec.ts:30:49
  • firefox: ❌

    • Error: �[31mSnapshot comparison failed:�[39m

    /rest/v1/activity_feed?select=*&event_name=�[0m�[9m�[31meq.�[39m�[29m�[0m�[32min.%28�[39msend_account_transfers�[32m%2Csend_swap%29�[39m&data-%3E%3Elog_addr=eq.%5Cx833589fcd6edb6e08f4c7c32d4f71b54bda02913&or=%28from_user.not.is.null%2C+to_user.not.is.null%29&or=%28data-%3Et.is.null%2C+data-%3Ef.is.null%2C+and%28+data-%3E%3Et.not.in.%28%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%2C%5Cx4c99cdaab0cfe32b4ba77d30342b5c51e0444e5b%2C%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%2C%5Cx60e5445edc1a469cfc0181861c88bd4b6895f615%2C%5Cxc476bb9142440fa46db94ac3351a27f2f1036364%2C%5Cx60e5445edc1a469cfc0181861c88bd4b6895f615%29%2C+data-%3E%3Ef.not.in.%28%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%2C%5Cx4c99cdaab0cfe32b4ba77d30342b5c51e0444e5b%2C%5Cx592e1224d203be4214b15e205f6081fbbacfcd2d%29+%29%29&order=created_at.desc&offset=0&limit=10

Expected: �[33m/home/runner/_work/sendapp/sendapp/packages/playwright/tests/home.onboarded.spec.ts-snapshots/token-details-history-url-firefox�[39m
Received: �[33m/home/runner/_work/sendapp/sendapp/packages/playwright/test-results/home.onboarded-can-visit-token-detail-page-firefox-retry2/token-details-history-url-actual�[39m

�[0m �[90m 28 |�[39m status�[33m:�[39m �[35m200�[39m�[33m,�[39m
�[90m 29 |�[39m })
�[31m�[1m>�[22m�[39m�[90m 30 |�[39m expect�[33m.�[39msoft(�[32m${url.pathname}${url.search}�[39m)�[33m.�[39mtoMatchSnapshot(�[32m'token-details-history-url'�[39m)
�[90m |�[39m �[31m�[1m^�[22m�[39m
�[90m 31 |�[39m })
�[90m 32 |�[39m �[36mawait�[39m page�[33m.�[39mgoto(�[32m'/?token=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'�[39m) �[90m// usdc�[39m
�[90m 33 |�[39m log(�[32m'beforeEach'�[39m�[33m,�[39m �[32murl=${page.url()}�[39m)�[0m

at /home/runner/_work/sendapp/sendapp/packages/playwright/tests/home.onboarded.spec.ts:30:49

leaderboard.logged-in.spec.ts

can visit leaderboard page

  • chromium: ✅
  • firefox: ✅

onboarding.logged-in.spec.ts

can visit onboarding page

  • chromium: ✅
  • firefox: ✅

profile.anon.spec.ts

anon user can visit public profile

  • chromium: ✅
  • firefox: ✅

anon user cannot visit private profile

  • chromium: ✅
  • firefox: ✅

profile.logged-in.spec.ts

logged in user needs onboarding before visiting profile

  • chromium: ✅
  • firefox: ✅

profile.onboarded.spec.ts

can visit other user profile and send by tag

  • chromium: ✅
  • firefox: ✅

can visit my own profile

  • chromium: ✅
  • firefox: ✅

can visit private profile

  • chromium: ✅
  • firefox: ✅

can view activities between another profile

  • chromium: ✅
  • firefox: ✅

send-token-upgrade.onboarded.spec.ts

can upgrade their Send Token V0 to Send Token V1

  • chromium: ✅
  • firefox: ✅

send.onboarded.spec.ts

can send USDC starting from profile page

  • chromium: ✅
  • firefox: ✅

can send USDC using tag starting from home page

  • chromium: ✅
  • firefox: ✅

can send USDC using sendid starting from home page

  • chromium: ✅
  • firefox: ✅

can send USDC using address starting from home page

  • chromium: ✅
  • firefox: ✅

can send ETH starting from profile page

  • chromium: ✅
  • firefox: ✅

can send ETH using tag starting from home page

  • chromium: ✅
  • firefox: ✅

can send ETH using sendid starting from home page

  • chromium: 🚨
  • firefox: 🚨

can send ETH using address starting from home page

  • chromium: ✅
  • firefox: ✅

can send SEND starting from profile page

  • chromium: ✅
  • firefox: ✅

can send SEND using tag starting from home page

  • chromium: ✅
  • firefox: ✅

can send SEND using sendid starting from home page

  • chromium: ✅
  • firefox: ✅

can send SEND using address starting from home page

  • chromium: ✅
  • firefox: ✅

sign-in.anon.spec.ts

redirect on sign-in

  • chromium: ✅
  • firefox: 🚨

redirect to send confirm page on sign-in

  • chromium: ✅
  • firefox: ✅

sign-up.anon.spec.ts

can sign up

  • chromium: 🚨
  • firefox: ✅

country code is selected based on geoip

  • chromium: ✅
  • firefox: 🚨

skip otp for existing user trying to sign up using already used phone number

  • chromium: ⏭
  • firefox: ⏭

user can sign in with passkey from backing up page

  • chromium: ⏭
  • firefox: ⏭

user can sign in as back up using otp from backing up page

  • chromium: ⏭
  • firefox: ⏭

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be a screen. Also, we need more logic here I just realized. If the user has 0 swaps (hopefully we can check that using the activity feed), we need to show an agreement modal. Hopefully Ethen can get us a quick disclaimer and checkbox agreement soon.

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.

3 participants