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

claimables #6132

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4c12695
some ui
benisgold Aug 29, 2024
3f0346b
working on claimables query
benisgold Aug 29, 2024
646aa94
finish query?
benisgold Aug 29, 2024
0253f66
fix animation
benisgold Aug 30, 2024
b5166c8
fix unique id + dropdown functionality
benisgold Sep 3, 2024
6b792a5
basically done
benisgold Sep 3, 2024
a0247af
types
benisgold Sep 3, 2024
caca526
feature flag
benisgold Sep 3, 2024
b23222c
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Sep 4, 2024
2d89caf
hardhat
benisgold Sep 4, 2024
aebfc0e
address comments
benisgold Sep 4, 2024
41d4996
fix sorting
benisgold Sep 4, 2024
9addfdc
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Sep 5, 2024
07d1dab
feature flags
benisgold Sep 5, 2024
9ec2dea
pause
benisgold Sep 5, 2024
880fa4a
ui
benisgold Sep 9, 2024
933886b
stuff
benisgold Sep 11, 2024
ca97044
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Sep 12, 2024
5c1e402
changes to accommodate updated figma
benisgold Sep 12, 2024
186ea49
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Sep 12, 2024
215b974
rename eth rewards related raps code
benisgold Sep 12, 2024
0a0e85f
more renaming
benisgold Sep 12, 2024
a13b593
some raps work + type improvements
benisgold Sep 13, 2024
8ecf22c
working on tx
benisgold Sep 16, 2024
6476f7c
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Sep 17, 2024
bd8e428
gas estimation is working, needs cleanup
benisgold Sep 17, 2024
c7006ab
working on gas
benisgold Sep 18, 2024
24ac2ac
some work
benisgold Sep 18, 2024
9bb77a0
gas is done
benisgold Sep 18, 2024
9ced7f9
cleanup
benisgold Sep 18, 2024
4a57903
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Sep 19, 2024
5d3f135
refactor
benisgold Sep 19, 2024
953b036
more refacator
benisgold Sep 19, 2024
5f7c4c1
working rap
benisgold Sep 20, 2024
e2b8a09
giant ui refactor
benisgold Sep 20, 2024
f9f66cc
make wallet screen responsive to changes to positions and claimables
benisgold Sep 20, 2024
d820766
sponsored rap (#6127)
benisgold Sep 20, 2024
15d006d
types
benisgold Sep 23, 2024
b231ee8
types
benisgold Sep 23, 2024
63cfa9e
types
benisgold Sep 23, 2024
2f63a3e
fix components
benisgold Sep 23, 2024
23d9b8b
nit
benisgold Sep 24, 2024
b8a06a7
types
benisgold Sep 24, 2024
31a24d0
claim types
benisgold Sep 24, 2024
904aff1
fix sponsored
benisgold Sep 24, 2024
8fc6f69
ui refactor
benisgold Sep 24, 2024
16b6036
raps refactor
benisgold Sep 24, 2024
9f74136
tweak
benisgold Sep 24, 2024
e285fbc
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
benisgold Sep 24, 2024
382c49d
raps
benisgold Sep 24, 2024
d4dd19b
nit
benisgold Sep 24, 2024
3d8d9d1
comments
benisgold Sep 24, 2024
c268875
nit
benisgold Sep 24, 2024
9beb669
nit
benisgold Sep 24, 2024
8d7b65b
prettier
benisgold Sep 25, 2024
b671253
Merge branch '@benisgold/raps' of https://github.com/rainbow-me/rainb…
benisgold Sep 25, 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
Prev Previous commit
Next Next commit
hardhat
  • Loading branch information
benisgold committed Sep 4, 2024
commit 2d89caf8820b95e144f3cec6a2f1b8334643fd16
2 changes: 0 additions & 2 deletions src/components/asset-list/RecyclerAssetList2/Claimable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { Box, Inline, Stack, Text } from '@/design-system';
import { useAccountSettings, useDimensions } from '@/hooks';
import { useClaimables } from '@/resources/addys/claimables/query';
import { getIsHardhatConnected } from '@/handlers/web3';
import { FasterImageView } from '@candlefinance/faster-image';
import { ButtonPressAnimation } from '@/components/animations';

Expand All @@ -12,7 +11,6 @@ export default function Claimable({ uniqueId }: { uniqueId: string }) {
{
address: accountAddress,
currency: nativeCurrency,
testnetMode: getIsHardhatConnected(),
},
{
select: data => data?.filter(claimable => claimable.uniqueId === uniqueId),
Expand Down
8 changes: 5 additions & 3 deletions src/resources/addys/claimables/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { ConsolidatedClaimablesResponse } from './types';
import { logger, RainbowError } from '@/logger';
import { parseClaimables } from './utils';
import { useRemoteConfig } from '@/model/remoteConfig';
import { CLAIMABLES, OP_REWARDS, useExperimentalFlag } from '@/config';
import { CLAIMABLES, useExperimentalFlag } from '@/config';
import { useConnectedToHardhatStore } from '@/state/connectedToHardhat';

const addysHttp = new RainbowFetchClient({
baseURL: 'https://addys.p.rainbow.me/v3',
Expand Down Expand Up @@ -67,13 +68,14 @@ type ClaimablesResult = QueryFunctionResult<typeof claimablesQueryFunction>;
// Query Hook

export function useClaimables(
{ address, currency, testnetMode }: ClaimablesArgs,
{ address, currency }: ClaimablesArgs,
config: QueryConfigWithSelect<ClaimablesResult, Error, ClaimablesResult, ClaimablesQueryKey> = {}
) {
const { claimables: remoteFlag } = useRemoteConfig();
const localFlag = useExperimentalFlag(CLAIMABLES);
const { connectedToHardhat } = useConnectedToHardhatStore();

return useQuery(claimablesQueryKey({ address, currency, testnetMode }), claimablesQueryFunction, {
return useQuery(claimablesQueryKey({ address, currency, testnetMode: connectedToHardhat }), claimablesQueryFunction, {
...config,
enabled: !!address && (remoteFlag || localFlag),
staleTime: 1000 * 60 * 2,
Expand Down
4 changes: 1 addition & 3 deletions src/screens/WalletScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { UserAssetsSync } from '@/state/sync/UserAssetsSync';
import { useClaimables } from '@/resources/addys/claimables/query';
import { MobileWalletProtocolListener } from '@/components/MobileWalletProtocolListener';
import { runWalletBackupStatusChecks } from '@/handlers/walletReadyEvents';
import { useConnectedToHardhatStore } from '@/state/connectedToHardhat';

const WalletPage = styled(Page)({
...position.sizeAsObject('100%'),
Expand All @@ -46,9 +45,8 @@ const WalletScreen: React.FC<any> = ({ navigation, route }) => {
const [initialized, setInitialized] = useState(!!params?.initialized);
const initializeWallet = useInitializeWallet();
const { network: currentNetwork, accountAddress, appIcon, nativeCurrency } = useAccountSettings();
const { connectedToHardhat } = useConnectedToHardhatStore();
usePositions({ address: accountAddress, currency: nativeCurrency });
useClaimables({ address: accountAddress, currency: nativeCurrency, testnetMode: connectedToHardhat });
useClaimables({ address: accountAddress, currency: nativeCurrency });

const loadAccountLateData = useLoadAccountLateData();
const loadGlobalLateData = useLoadGlobalLateData();
Expand Down