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 83 commits
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
2 changes: 1 addition & 1 deletion src/__swaps__/screens/Swap/hooks/useEstimatedGasFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useSelectedGas } from './useSelectedGas';
import { useSwapEstimatedGasLimit } from './useSwapEstimatedGasLimit';
import { useSwapsStore } from '@/state/swaps/swapsStore';

function safeBigInt(value: string) {
export function safeBigInt(value: string) {
try {
return BigInt(value);
} catch {
Expand Down
13 changes: 13 additions & 0 deletions src/analytics/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,12 @@ export type EventProperties = {
symbol: string;
address: string;
};
outputAsset: {
symbol: string;
address: string;
};
outputChainId: ChainId;
isSwapping: boolean;
amount: string;
usdValue: number;
};
Expand All @@ -645,6 +651,13 @@ export type EventProperties = {
symbol: string;
address: string;
};
isSwapping: boolean;
outputAsset: {
symbol: string;
address: string;
};
outputChainId: ChainId;
failureStep: 'claim' | 'swap' | 'unknown';
amount: string;
usdValue: number;
errorMessage: string;
Expand Down
77 changes: 61 additions & 16 deletions src/components/asset-list/RecyclerAssetList2/Claimable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useMemo } from 'react';
import { Box, Inline, Stack, Text } from '@/design-system';
import { useAccountSettings } from '@/hooks';
import { useClaimables } from '@/resources/addys/claimables/query';
Expand All @@ -7,41 +7,85 @@ import { ButtonPressAnimation } from '@/components/animations';
import { deviceUtils } from '@/utils';
import Routes from '@/navigation/routesNames';
import { ExtendedState } from './core/RawRecyclerList';
import { convertAmountToNativeDisplayWorklet } from '@/helpers/utilities';
import { convertAmountAndPriceToNativeDisplay, convertAmountToNativeDisplayWorklet, convertRawAmountToBalance } from '@/helpers/utilities';
import { analyticsV2 } from '@/analytics';
import { ChainBadge } from '@/components/coin-icon';
import { useNativeAsset } from '@/utils/ethereumUtils';
import { ChainId } from '@/chains/types';
import { usePoints } from '@/resources/points';

const RAINBOW_ICON_URL = 'https://rainbowme-res.cloudinary.com/image/upload/v1694722625/dapps/rainbow-icon-large.png';

export const Claimable = React.memo(function Claimable({ uniqueId, extendedState }: { uniqueId: string; extendedState: ExtendedState }) {
const { accountAddress, nativeCurrency } = useAccountSettings();
const { navigate } = extendedState;

const isETHRewards = uniqueId === 'rainbow-eth-rewards';

const eth = useNativeAsset({ chainId: ChainId.mainnet });

const { data = [] } = useClaimables(
{
address: accountAddress,
currency: nativeCurrency,
},
{
select: data => data?.filter(claimable => claimable.uniqueId === uniqueId),
enabled: !isETHRewards,
}
);

const { data: points } = usePoints({
walletAddress: accountAddress,
});

const [claimable] = data;
if (!claimable) return null;
const claimableETHRewardsRawAmount = points?.points?.user?.rewards?.claimable;

if (isETHRewards) {
if (!claimableETHRewardsRawAmount) return null;
} else {
if (!claimable) return null;
}

const { display: claimableETHRewardsDisplay, amount: claimableETHRewardsAmount } = isETHRewards
? convertRawAmountToBalance(claimableETHRewardsRawAmount ?? '0', {
decimals: 18,
symbol: 'ETH',
})
: { display: undefined, amount: undefined };

const nativeDisplay = convertAmountToNativeDisplayWorklet(
isETHRewards
? convertAmountAndPriceToNativeDisplay(claimableETHRewardsAmount ?? '0', eth?.price?.value || 0, nativeCurrency)?.amount
: claimable?.value.nativeAsset.amount,
nativeCurrency,
true
);

if (isETHRewards) {
if (!claimableETHRewardsDisplay) return null;
}

const nativeDisplay = convertAmountToNativeDisplayWorklet(claimable.value.nativeAsset.amount, nativeCurrency, true);
if (!nativeDisplay) return null;

return (
<Box
as={ButtonPressAnimation}
onPress={() => {
analyticsV2.track(analyticsV2.event.claimablePanelOpened, {
claimableType: claimable.type,
claimableId: claimable.uniqueId,
chainId: claimable.chainId,
asset: { symbol: claimable.asset.symbol, address: claimable.asset.address },
amount: claimable.value.claimAsset.amount,
usdValue: claimable.value.usd,
});
navigate(Routes.CLAIM_CLAIMABLE_PANEL, { claimable });
if (!isETHRewards) {
analyticsV2.track(analyticsV2.event.claimablePanelOpened, {
claimableType: claimable?.type,
claimableId: claimable?.analyticsId,
chainId: claimable?.chainId,
asset: { symbol: claimable?.asset.symbol, address: claimable?.asset.address },
amount: claimable?.value.claimAsset.amount,
usdValue: claimable?.value.usd,
});
navigate(Routes.CLAIM_CLAIMABLE_PANEL, { claimable });
} else {
navigate(Routes.CLAIM_REWARDS_PANEL);
}
}}
scaleTo={0.96}
paddingHorizontal="20px"
Expand All @@ -51,8 +95,9 @@ export const Claimable = React.memo(function Claimable({ uniqueId, extendedState
>
<Inline alignVertical="center" space="12px">
<Box borderRadius={11} borderWidth={1} borderColor={{ custom: 'rgba(0, 0, 0, 0.03)' }}>
<FasterImageView source={{ url: claimable.iconUrl }} style={{ height: 40, width: 40 }} />
<FasterImageView source={{ url: isETHRewards ? RAINBOW_ICON_URL : claimable?.iconUrl }} style={{ height: 40, width: 40 }} />
</Box>
<ChainBadge chainId={isETHRewards ? ChainId.mainnet : claimable?.chainId} position="absolute" size="small" forceDark={true} />
<Stack space={{ custom: 11 }}>
<Text
weight="semibold"
Expand All @@ -62,10 +107,10 @@ export const Claimable = React.memo(function Claimable({ uniqueId, extendedState
numberOfLines={1}
style={{ maxWidth: deviceUtils.dimensions.width - 220 }}
>
{claimable.name}
{isETHRewards ? 'Rainbow ETH Rewards' : claimable?.name}
</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if claimable?.name is undefined here? Maybe will cause a crash

<Text weight="semibold" color="labelTertiary" size="13pt">
{claimable.value.claimAsset.display}
{isETHRewards ? claimableETHRewardsDisplay : claimable?.value.claimAsset.display}
</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if claimable?.value.claimAsset.display is undefined here? Maybe will cause a crash

</Stack>
</Inline>
Expand Down
36 changes: 29 additions & 7 deletions src/helpers/buildWalletSections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { buildBriefCoinsList, buildBriefUniqueTokenList } from './assets';
import { NativeCurrencyKey, ParsedAddressAsset } from '@/entities';
import store from '@/redux/store';
import { ClaimableExtraData, PositionExtraData } from '@/components/asset-list/RecyclerAssetList2/core/ViewTypes';
import { DEFI_POSITIONS, CLAIMABLES, ExperimentalValue } from '@/config/experimental';
import { DEFI_POSITIONS, CLAIMABLES, ExperimentalValue, ETH_REWARDS } from '@/config/experimental';
import { RainbowPositions } from '@/resources/defi/types';
import { Claimable } from '@/resources/addys/claimables/types';
import { add, convertAmountToNativeDisplay, lessThan } from './utilities';
import { add, convertAmountToNativeDisplay, greaterThan, lessThan } from './utilities';
import { RainbowConfig } from '@/model/remoteConfig';
import { IS_TEST } from '@/env';
import { UniqueId } from '@/__swaps__/types/assets';
Expand Down Expand Up @@ -60,22 +60,27 @@ const remoteConfigSelector = (state: any) => state.remoteConfig;
const experimentalConfigSelector = (state: any) => state.experimentalConfig;
const positionsSelector = (state: any) => state.positions;
const claimablesSelector = (state: any) => state.claimables;
const claimableETHRewardsNativeAmountSelector = (state: any) => state.claimableETHRewardsNativeAmount;

const buildBriefWalletSections = (
balanceSectionData: any,
uniqueTokenFamiliesSection: any,
remoteConfig: RainbowConfig,
experimentalConfig: Record<string, ExperimentalValue>,
positions: RainbowPositions | undefined,
claimables: Claimable[] | undefined
claimables: Claimable[] | undefined,
claimableETHRewardsNativeAmount: string | undefined
) => {
const { balanceSection, isEmpty, isLoadingUserAssets } = balanceSectionData;

const positionsEnabled = experimentalConfig[DEFI_POSITIONS] && !IS_TEST;
const claimablesEnabled = (remoteConfig.claimables || experimentalConfig[CLAIMABLES]) && !IS_TEST;
const ethRewardsEnabled = (remoteConfig.rewards_enabled || experimentalConfig[ETH_REWARDS]) && !IS_TEST;

const positionSection = positionsEnabled ? withPositionsSection(positions, isLoadingUserAssets) : [];
const claimablesSection = claimablesEnabled ? withClaimablesSection(claimables, isLoadingUserAssets) : [];
const claimablesSection = claimablesEnabled
? withClaimablesSection(claimables, ethRewardsEnabled, claimableETHRewardsNativeAmount, isLoadingUserAssets)
: [];
const sections = [balanceSection, claimablesSection, positionSection, uniqueTokenFamiliesSection];

const filteredSections = sections.filter(section => section.length !== 0).flat(1);
Expand Down Expand Up @@ -120,12 +125,28 @@ const withPositionsSection = (positionsObj: RainbowPositions | undefined, isLoad
return [];
};

const withClaimablesSection = (claimables: Claimable[] | undefined, isLoadingUserAssets: boolean) => {
const withClaimablesSection = (
claimables: Claimable[] | undefined,
ethRewardsEnabled: boolean,
claimableETHRewardsNativeAmount: string | undefined,
isLoadingUserAssets: boolean
) => {
const { nativeCurrency: currency } = store.getState().settings;

const result: ClaimableExtraData[] = [];
const ethRewards = {
value: { nativeAsset: { amount: claimableETHRewardsNativeAmount } },
uniqueId: 'rainbow-eth-rewards',
};

let result: ClaimableExtraData[] = [];
let totalNativeValue = '0';
claimables?.forEach(claimable => {

const sortedClaimables = [
...(claimables ?? []),
...(ethRewardsEnabled && claimableETHRewardsNativeAmount && claimableETHRewardsNativeAmount !== '0' ? [ethRewards] : []),
]?.sort((a, b) => (greaterThan(a.value.nativeAsset.amount ?? '0', b.value.nativeAsset.amount ?? '0') ? -1 : 1));

sortedClaimables?.forEach(claimable => {
totalNativeValue = add(totalNativeValue, claimable.value.nativeAsset.amount ?? '0');
const listData = {
type: 'CLAIMABLE',
Expand Down Expand Up @@ -293,6 +314,7 @@ export const buildBriefWalletSectionsSelector = createSelector(
experimentalConfigSelector,
positionsSelector,
claimablesSelector,
claimableETHRewardsNativeAmountSelector,
],
buildBriefWalletSections
);
27 changes: 26 additions & 1 deletion src/hooks/useWalletSectionsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import { useUserAssetsStore } from '@/state/assets/userAssets';
import { analyticsV2 } from '@/analytics';
import { Claimable } from '@/resources/addys/claimables/types';
import { throttle } from 'lodash';
import { usePoints } from '@/resources/points';
import { convertAmountAndPriceToNativeDisplay, convertRawAmountToBalance } from '@/helpers/utilities';
import { useNativeAsset } from '@/utils/ethereumUtils';
import { ChainId } from '@/chains/types';

// user properties analytics for claimables that executes at max once every 2 min
const throttledClaimablesAnalytics = throttle(
Expand All @@ -30,7 +34,7 @@ const throttledClaimablesAnalytics = throttle(
} = {};

claimables.forEach(claimable => {
const attribute = `${claimable.analyticsId}USDValue`;
const attribute = `claimable-${claimable.analyticsId}-USDValue`;
totalUSDValue += claimable.value.usd;

if (claimablesUSDValues[attribute] !== undefined) {
Expand Down Expand Up @@ -69,6 +73,25 @@ export default function useWalletSectionsData({
});
const { data: positions } = usePositions({ address: accountAddress, currency: nativeCurrency });
const { data: claimables } = useClaimables({ address: accountAddress, currency: nativeCurrency });
const { data: points } = usePoints({
walletAddress: accountAddress,
});

const claimableETHRewardsRawAmount = points?.points?.user?.rewards?.claimable;

const eth = useNativeAsset({ chainId: ChainId.mainnet });

const claimableETHRewardsNativeAmount = useMemo(() => {
if (!eth) return undefined;

const claimableETH = convertRawAmountToBalance(claimableETHRewardsRawAmount || '0', {
decimals: 18,
symbol: 'ETH',
});
const { amount } = convertAmountAndPriceToNativeDisplay(claimableETH.amount, eth?.price?.value || 0, nativeCurrency);

return amount;
}, [claimableETHRewardsRawAmount, eth, nativeCurrency]);

// claimables analytics
useEffect(() => {
Expand Down Expand Up @@ -124,6 +147,7 @@ export default function useWalletSectionsData({
experimentalConfig,
positions,
claimables,
claimableETHRewardsNativeAmount,
};

const { briefSectionsData, isEmpty } = buildBriefWalletSectionsSelector(accountInfo);
Expand Down Expand Up @@ -161,6 +185,7 @@ export default function useWalletSectionsData({
experimentalConfig,
positions,
claimables,
claimableETHRewardsNativeAmount,
]);
return walletSections;
}
15 changes: 13 additions & 2 deletions src/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,13 @@
},
"claimables": {
"panel": {
"calculating_gas_fee": "Calculating gas fee...",
"estimating_gas_fee": "Estimating Gas Fee...",
"gas_error": "Gas Error",
"quote_error": "Quote Error",
"no_route_found": "No Route Found",
"fetching_quote": "Fetching Quote...",
"select_a_network": "Select a Network",
"select_a_token": "Select a Token",
"amount_to_claim_on_network": "%{amount} to claim on %{network}",
"claim": "Claim",
"claiming": "Claiming",
Expand All @@ -463,7 +469,12 @@
"claim_amount": "Claim %{amount}",
"done": "Done",
"try_again": "Try Again",
"tokens_on_the_way": "Tokens on the way!"
"tokens_on_the_way": "Tokens on the way!",
"a_token": "a token",
"a_network": "a network",
"swap_failed": "Swap Failed",
"receive": "Receive",
"on": "on"
}
},
"cloud": {
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/Routes.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import AppIconUnlockSheet from '@/screens/AppIconUnlockSheet';
import { SwapScreen } from '@/__swaps__/screens/Swap/Swap';
import { ControlPanel } from '@/components/DappBrowser/control-panel/ControlPanel';
import { ClaimRewardsPanel } from '@/screens/points/claim-flow/ClaimRewardsPanel';
import { ClaimClaimablePanel } from '@/screens/claimables/ClaimClaimablePanel';
import { ClaimClaimablePanel } from '@/screens/claimables/ClaimPanel';
import { RootStackParamList } from './types';

const Stack = createStackNavigator();
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/Routes.ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ import { SwapScreen } from '@/__swaps__/screens/Swap/Swap';
import CheckIdentifierScreen from '@/screens/CheckIdentifierScreen';
import { ControlPanel } from '@/components/DappBrowser/control-panel/ControlPanel';
import { ClaimRewardsPanel } from '@/screens/points/claim-flow/ClaimRewardsPanel';
import { ClaimClaimablePanel } from '@/screens/claimables/ClaimClaimablePanel';
import { ClaimClaimablePanel } from '@/screens/claimables/ClaimPanel';
import { RootStackParamList } from './types';

const Stack = createStackNavigator();
Expand Down
8 changes: 8 additions & 0 deletions src/raps/actions/claimClaimable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ActionProps, RapActionResult } from '../references';
import { executeClaim } from '@/screens/claimables/transaction/claim';

export async function claimClaimable({ wallet, parameters }: ActionProps<'claimClaimable'>): Promise<RapActionResult> {
const { claimTx, asset } = parameters;

return executeClaim({ asset, claimTx, wallet });
}
1 change: 1 addition & 0 deletions src/raps/actions/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export const estimateSwapGasLimit = async ({
}

const gasLimit = await estimateGasWithPadding(params, method, methodArgs, provider, SWAP_GAS_PADDING);

if (gasLimit === null || gasLimit === undefined || isNaN(Number(gasLimit))) {
return getDefaultGasLimitForTrade(quote, chainId);
}
Expand Down
Loading
Loading