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

Claim as X #6193

Merged
merged 91 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
a2d6822
progress
benisgold Oct 7, 2024
c13988a
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Oct 10, 2024
e5bae77
progress
benisgold Oct 10, 2024
aac6130
progress
benisgold Oct 11, 2024
60a73f2
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Oct 11, 2024
7c84da5
testing
benisgold Oct 11, 2024
21c64e6
progress
benisgold Oct 11, 2024
cda4fed
progress
benisgold Oct 11, 2024
7460833
crosschain quote working
benisgold Oct 15, 2024
3606a67
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Oct 15, 2024
402daf0
claim + crosschainswap rap worked
benisgold Oct 15, 2024
bd3c346
raps logic is done
benisgold Oct 17, 2024
853610a
delete v2
benisgold Oct 17, 2024
2da4b13
cleanup
benisgold Oct 18, 2024
c4dc4bc
working on dropdowns
benisgold Oct 23, 2024
f9091b5
little dropdown refactor
benisgold Oct 23, 2024
1df2591
useDropdownMenu hook
benisgold Oct 24, 2024
b48a2c2
refactoring
benisgold Oct 25, 2024
257b159
working on dropdown
benisgold Oct 28, 2024
ffda496
basically done with ui refactor
benisgold Oct 28, 2024
7df4103
fixes
benisgold Oct 29, 2024
7c6101e
claim as x is working
benisgold Oct 29, 2024
ab1a2fc
context work
benisgold Oct 29, 2024
6188258
progress
benisgold Oct 31, 2024
8486d61
gas
benisgold Nov 5, 2024
1567415
enormous refactor, need to fix some things
benisgold Nov 7, 2024
c989327
gas fixes
benisgold Nov 7, 2024
4d5664c
pretty sure i fixed quotes
benisgold Nov 8, 2024
8d34e00
functional
benisgold Nov 8, 2024
1f7ef8c
wrapping things up
benisgold Nov 12, 2024
5f3e715
cleaning up
benisgold Nov 12, 2024
bcca162
fixes
benisgold Nov 14, 2024
e090638
more fixes
benisgold Nov 14, 2024
e819399
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Nov 14, 2024
bede077
fix formatting
benisgold Nov 15, 2024
7dbe664
lint
benisgold Nov 15, 2024
4f91665
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Nov 15, 2024
ff7a615
gas and quote state fixes
benisgold Nov 15, 2024
07d9e1d
rm logs
benisgold Nov 18, 2024
417dbfa
error messages
benisgold Nov 18, 2024
9fafef9
error messages + i18n
benisgold Nov 20, 2024
4dd4b4b
fix bug that allowed button press w/o token/chain selected
benisgold Nov 20, 2024
f0f702d
disable watched wallets
benisgold Nov 20, 2024
d2221c3
error logging in executeClaim
benisgold Nov 22, 2024
bfb9f86
i18n
benisgold Nov 22, 2024
e2d61b0
slippage
benisgold Nov 22, 2024
38485be
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Nov 22, 2024
4f83347
add comments to transaction context
benisgold Nov 24, 2024
84ca209
comments
benisgold Nov 25, 2024
0f37430
erge branch 'develop' of https://github.com/rainbow-me/rainbow into @…
benisgold Nov 25, 2024
76ab7f7
rainbow fee
benisgold Nov 25, 2024
c17c60e
adjust rainbow fee
benisgold Nov 25, 2024
4a33e9e
gas improvements
benisgold Nov 26, 2024
5d5767a
forgot to undo this
benisgold Nov 26, 2024
eb94ed9
fix gas race condition
benisgold Nov 27, 2024
ab9e67d
fix swap data assetToSell bug
benisgold Nov 27, 2024
4e09866
rm comment
benisgold Nov 27, 2024
a43c5e5
improve error logging in raps
benisgold Nov 27, 2024
3276da4
nit
benisgold Nov 27, 2024
7a2bab3
temp, merging develop
benisgold Nov 27, 2024
feab384
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Nov 27, 2024
ccb2333
fix gas estimation
benisgold Dec 3, 2024
a75fb52
rm unused imports
benisgold Dec 3, 2024
08a088e
rm console log
benisgold Dec 3, 2024
86d0ba7
rm dai, wbtc, add usdc
benisgold Dec 3, 2024
27c2768
fix quote amount + fix gas estimation throttling
benisgold Dec 3, 2024
57304ce
rename txState to gasState
benisgold Dec 3, 2024
9e1b1ce
more gas fixes
benisgold Dec 3, 2024
ca5d31c
network icons for dropdown menu
benisgold Dec 4, 2024
7f8aaca
fix populateSwap util and some other minor things
benisgold Dec 4, 2024
9926097
fix analyticsId
benisgold Dec 4, 2024
77c4501
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Dec 4, 2024
8975cdc
fix scenario where user does not have native asset for gas calculations
benisgold Dec 4, 2024
3743c90
fix context menu ordering on android
benisgold Dec 4, 2024
06a9f7d
fix gas estimation
benisgold Dec 4, 2024
f15a655
undo obsolete change
benisgold Dec 4, 2024
48f6179
fix analytics
benisgold Dec 4, 2024
a5fbefe
Claimables followups (#6301)
benisgold Dec 5, 2024
a4e0d64
fix hook usage
benisgold Dec 5, 2024
93a7e45
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Dec 5, 2024
256e71c
lint
benisgold Dec 5, 2024
e4fd27a
wallet screen fix
benisgold Dec 5, 2024
59c8e38
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Dec 6, 2024
9307b62
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Dec 6, 2024
3554880
dont throw errors in rap creation
benisgold Dec 6, 2024
08f5aca
remove claimable asset from dropdown if network is not compatible
benisgold Dec 8, 2024
0a1b9c1
rm unnecessary useCallback dep
benisgold Dec 9, 2024
06f2093
show wallet error alert if can't load wallet
benisgold Dec 9, 2024
149c19b
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Dec 9, 2024
9afef38
fix approval target
benisgold Dec 9, 2024
29410e4
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/raps/claimClaimable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ export async function createClaimClaimableRap(parameters: RapSwapActionParameter
}

if (swapAssetNeedsUnlocking) {
if (!quote.to) {
logger.error(new RainbowError('[raps/claimClaimable]: quote.to is undefined'));
return { actions: [] };
}

const unlock = createNewAction('unlock', {
fromAddress: accountAddress,
assetToUnlock: assetToSell,
chainId,
contractAddress: quote.to as Address,
Copy link
Member Author

Choose a reason for hiding this comment

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

this was the bug

contractAddress: allowanceTarget,
});
actions = actions.concat(unlock);
}
Expand Down
12 changes: 5 additions & 7 deletions src/screens/claimables/transaction/estimateGas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CrosschainQuote, Quote, getRainbowRouterContractAddress } from '@rainbow-me/swaps';
import { CrosschainQuote, Quote } from '@rainbow-me/swaps';
import { getProvider } from '@/handlers/web3';
import { Address } from 'viem';
import { metadataPOSTClient } from '@/graphql';
Expand Down Expand Up @@ -34,10 +34,8 @@ export const estimateClaimUnlockSwapGasLimit = async ({

let swapAssetNeedsUnlocking = false;

const spender = getRainbowRouterContractAddress(chainId as number);

if (quote) {
const { from: accountAddress, sellTokenAddress, allowanceNeeded, sellTokenAsset, sellAmount } = quote;
const { from: accountAddress, sellTokenAddress, allowanceNeeded, allowanceTarget, sellTokenAsset, sellAmount } = quote;

if (!sellTokenAsset) {
logger.error(new RainbowError('[estimateClaimUnlockSwapGasLimit]: Quote is missing sellTokenAsset'));
Expand All @@ -48,7 +46,7 @@ export const estimateClaimUnlockSwapGasLimit = async ({
const allowance = await getAssetRawAllowance({
owner: accountAddress as Address,
assetAddress: sellTokenAddress as Address,
spender,
spender: allowanceTarget as Address,
chainId,
});

Expand All @@ -62,7 +60,7 @@ export const estimateClaimUnlockSwapGasLimit = async ({
const approveTransaction = await populateApprove({
owner: accountAddress as Address,
tokenAddress: sellTokenAddress as Address,
spender,
spender: allowanceTarget as Address,
chainId,
});

Expand Down Expand Up @@ -125,7 +123,7 @@ export const estimateClaimUnlockSwapGasLimit = async ({
gasEstimate = await estimateApprove({
owner: quote.from as Address,
tokenAddress: quote.sellTokenAddress as Address,
spender,
spender: quote.allowanceTarget as Address,
chainId,
});
} else if (step === 'swap') {
Expand Down
Loading