-
Notifications
You must be signed in to change notification settings - Fork 10
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: Send Earn #1085
Open
0xBigBoss
wants to merge
75
commits into
dev
Choose a base branch
from
bb/send-earn
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+19,558
−7,469
Open
feat: Send Earn #1085
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
f73c154
Added first part of dummy UI for earn
musidlo 3714681
Added earning form screen
musidlo ac9984b
Added active earnings screen
musidlo fea9d29
Added withdraw form
musidlo 6dee9f2
Added earnings and rewards balance
musidlo 45d1499
fix: StartEarning -> Deposit
0xBigBoss f8a0ee0
feat: add oliveDrab color
0xBigBoss 7a49895
refactor: DepositForm
0xBigBoss 21b2bba
feat(ui): add base style to Shake
0xBigBoss cec5097
fix: update EarnTerms and DepositForm
0xBigBoss 79735bf
feat(wagmi): add Send Earn
0xBigBoss 6ddbe56
fix: StartEarning -> Deposit
0xBigBoss b9af0ed
fix(app): update useUserOpTransferMutation
0xBigBoss 13695c8
feat(wagmi): add Send Earn
0xBigBoss bed6892
feat(app): SendEarn Deposit onchain
0xBigBoss 991aa60
feat(app): SendEarn Deposit onchain
0xBigBoss f07f892
fix: double render on HomeSidebar
0xBigBoss 2058b7b
feat(playwright): deposit Send Earn spec
0xBigBoss 64d7772
feat(app): add link to Send Earn
0xBigBoss 1ab4dc9
fix(app): do not retry not enough USDC
0xBigBoss 7121491
feat(app): move useSendEarnDepositUserOp to hooks
0xBigBoss b2c32e4
fix(app): app crash
0xBigBoss 5b155e7
fix(app): improve amount sanitization
0xBigBoss 7e87084
fix(app): enforce minimum deposit amount in DepositForm
0xBigBoss 4263ff0
feat(app): show estimated earnings and APY for Send Earn
0xBigBoss 152ca98
fix(app): update SendEarnVault type to ensure non-null data handling …
0xBigBoss a245fff
fix(app): adjust minimum deposit to 10 USDC and update form error han…
0xBigBoss 8bc5cdc
shovel: upgrade to latest
0xBigBoss 30f7bf8
feat(shovel): add send_earn_new_affiliate integration
0xBigBoss bc1f737
feat(wagmi): update SendEarn contracts and add revenue safe configura…
0xBigBoss 50eab56
feat(shovel): add send earn integrations
0xBigBoss 941c747
fix: send earn address
0xBigBoss e35a023
refactor: organize checkout form and utils
0xBigBoss 1821233
fix(shovel): typo send earn integrations
0xBigBoss 621e266
fix(supabase): specify bigint for id in send_earn_create and send_ear…
0xBigBoss 11f4723
fix: update contract addresses in config for SendEarn and SendEarnFac…
0xBigBoss 408ee99
fix(supabase): update types in send_earn_create and send_earn_new_aff…
0xBigBoss 6c47e5c
refactor: organize checkout form and utils
0xBigBoss 63afb28
fix(shovel): commit shovel snapshot, limit shovel resources
0xBigBoss 2f6f1b8
fix: limit anvil resources
0xBigBoss 34484d7
fix(shovel): set default SHOVEL_VERSION
0xBigBoss 86bc02d
feat(shovel): add send_earn deposits and withdraws
0xBigBoss ebce9ca
feat(supabase): send earn deposit and withdraw RLS
0xBigBoss ce637e0
feat(app): add more send earn hooks
0xBigBoss 480e29a
fix: add more memory to anvil
0xBigBoss 42b59ae
feat(app): add sendEarnDepositVault
0xBigBoss ecf5985
feat(app): add useReferrerVault hook
0xBigBoss ed6f014
refactor(app): update jsdoc
0xBigBoss 9b07961
refactor: sendEarnUsdcFactoryAddress
0xBigBoss de21e9b
refactor(app): enhance referrer logic with profile type
0xBigBoss 6d2998b
refactor(app): wip on createAndDeposit affiliate flow
0xBigBoss 8f260ea
fix(tilt): anvil keeps being OOM killed
0xBigBoss 9c87b04
refactor(app): fix calcualating base apy using default vault
0xBigBoss 54a83ed
fix(app): earn summary
0xBigBoss 7b77131
fix(supabase): correct RLS policy for send_earn_balances
0xBigBoss d8b6e0e
feat(app): add asset to URL path param
0xBigBoss 5e8fcc4
fix(app): refactor coin schemas and improve send earn balance handlin…
0xBigBoss a86a547
feat(app): reorganize earn feature imports and implement new earnings…
0xBigBoss 0d9e1fd
test(app): add unit tests for toNiceError utility with various error …
0xBigBoss a54df45
feat(app): add erc20Coins list to coins data for better coin manageme…
0xBigBoss f93f429
feat(app): formatCoinAmount utility
0xBigBoss 567cb61
feat(app): enhance ActiveEarnings screen with new balances and improv…
0xBigBoss f11ff57
feat(supabase): add send_earn_activity view
0xBigBoss 375f3de
feat(app): add EarningsFeed and TotalEarning components
0xBigBoss 58ebc10
fix: update @0xsend/send-earn-contracts
0xBigBoss 7817d43
refactor(earn): optimize EarningsSummary calculations with useMemo fo…
0xBigBoss 20645d9
fix(shovel): snapshots and config after send earn update
0xBigBoss c2adb18
feat(supabase): add created_at to referrals
0xBigBoss 377ed4c
sync snaplet
0xBigBoss 6cd1a8d
feat(supabase): add created_at to referrals
0xBigBoss 76c00d0
fix(snaplet): include receipts
0xBigBoss bfc8bb6
feat(app): add referrer view
0xBigBoss 2b21fee
feat(app): lookup existing referrer vault
0xBigBoss 282a8fb
feat(app): add ReferredBy component for managing referral codes in ch…
0xBigBoss 037c901
fix(playwright): better tests, clean up on deposit flow
0xBigBoss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { TopNav } from 'app/components/TopNav' | ||
import { EarningsBalance } from 'app/features/earn/earnings/screen' | ||
import { HomeLayout } from 'app/features/home/layout.web' | ||
import Head from 'next/head' | ||
import { userProtectedGetSSP } from 'utils/userProtected' | ||
import type { NextPageWithLayout } from '../../_app' | ||
|
||
export const Page: NextPageWithLayout = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Send | Earnings Balance</title> | ||
</Head> | ||
<EarningsBalance /> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = userProtectedGetSSP() | ||
|
||
Page.getLayout = (children) => ( | ||
<HomeLayout TopNav={<TopNav header="Earnings Balance" backFunction="router" />} fullHeight> | ||
{children} | ||
</HomeLayout> | ||
) | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TopNav } from 'app/components/TopNav' | ||
import { DepositScreen } from 'app/features/earn/deposit/screen' | ||
import { HomeLayout } from 'app/features/home/layout.web' | ||
import Head from 'next/head' | ||
import { userProtectedGetSSP } from 'utils/userProtected' | ||
import type { NextPageWithLayout } from '../../_app' | ||
|
||
export const Page: NextPageWithLayout = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Send | Start Earning</title> | ||
</Head> | ||
<DepositScreen /> | ||
</> | ||
) | ||
} | ||
export const getServerSideProps = userProtectedGetSSP() | ||
|
||
Page.getLayout = (children) => ( | ||
<HomeLayout TopNav={<TopNav header="Start Earning" backFunction="router" />}> | ||
{children} | ||
</HomeLayout> | ||
) | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { TopNav } from 'app/components/TopNav' | ||
import { ActiveEarnings } from 'app/features/earn/active/screen' | ||
import { HomeLayout } from 'app/features/home/layout.web' | ||
import Head from 'next/head' | ||
import { userProtectedGetSSP } from 'utils/userProtected' | ||
import type { NextPageWithLayout } from '../../_app' | ||
import { coinsBySymbol } from 'app/data/coins' | ||
import type { GetServerSideProps } from 'next' | ||
import type { ParsedUrlQuery } from 'node:querystring' | ||
import debug from 'debug' | ||
|
||
const log = debug('app:pages:earn:active') | ||
|
||
export const Page: NextPageWithLayout = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Send | Active Earnings</title> | ||
</Head> | ||
<ActiveEarnings /> | ||
</> | ||
) | ||
} | ||
|
||
interface Params extends ParsedUrlQuery { | ||
asset?: string | ||
} | ||
|
||
export const getServerSideProps: GetServerSideProps = async (context) => { | ||
const { asset } = context.params as Params | ||
|
||
if (!asset) { | ||
log('no asset') | ||
return { | ||
redirect: { | ||
destination: '/earn', | ||
permanent: false, | ||
}, | ||
} | ||
} | ||
|
||
if (!coinsBySymbol[asset.toUpperCase()]) { | ||
log('coin not supported', asset) | ||
// 404 if coin is not supported | ||
return { | ||
notFound: true, | ||
} | ||
} | ||
|
||
return userProtectedGetSSP()(context) | ||
} | ||
|
||
Page.getLayout = (children) => ( | ||
<HomeLayout TopNav={<TopNav header="Active Earnings" backFunction="root" />}> | ||
{children} | ||
</HomeLayout> | ||
) | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TopNav } from 'app/components/TopNav' | ||
import { RewardsBalance } from 'app/features/earn/rewards-balance/screen' | ||
import { HomeLayout } from 'app/features/home/layout.web' | ||
import Head from 'next/head' | ||
import { userProtectedGetSSP } from 'utils/userProtected' | ||
import type { NextPageWithLayout } from '../../_app' | ||
|
||
export const Page: NextPageWithLayout = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Send | Rewards Balance</title> | ||
</Head> | ||
<RewardsBalance /> | ||
</> | ||
) | ||
} | ||
export const getServerSideProps = userProtectedGetSSP() | ||
|
||
Page.getLayout = (children) => ( | ||
<HomeLayout TopNav={<TopNav header="Rewards Balance" backFunction="router" />} fullHeight> | ||
{children} | ||
</HomeLayout> | ||
) | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { TopNav } from 'app/components/TopNav' | ||
import { WithdrawForm } from 'app/features/earn/withdraw/screen' | ||
import { HomeLayout } from 'app/features/home/layout.web' | ||
import Head from 'next/head' | ||
import { userProtectedGetSSP } from 'utils/userProtected' | ||
import type { NextPageWithLayout } from '../../_app' | ||
|
||
export const Page: NextPageWithLayout = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Send | Withdraw Deposit</title> | ||
</Head> | ||
<WithdrawForm /> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = userProtectedGetSSP() | ||
|
||
Page.getLayout = (children) => ( | ||
<HomeLayout TopNav={<TopNav header="Withdraw Deposit" backFunction="router" />}> | ||
{children} | ||
</HomeLayout> | ||
) | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { TopNav } from 'app/components/TopNav' | ||
import { EarnScreen } from 'app/features/earn/screen' | ||
import { HomeLayout } from 'app/features/home/layout.web' | ||
import Head from 'next/head' | ||
import type { NextPageWithLayout } from '../_app' | ||
|
||
export const Page: NextPageWithLayout = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Send | Earn</title> | ||
</Head> | ||
<EarnScreen /> | ||
</> | ||
) | ||
} | ||
|
||
Page.getLayout = (children) => ( | ||
<HomeLayout TopNav={<TopNav header="Earn" backFunction="root" />}>{children}</HomeLayout> | ||
) | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Extract to helper function