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

TW-1479: EVM Transactions History #1207

Open
wants to merge 86 commits into
base: development-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
3c9068a
TW-1479: [EVM] Transactions history
alex-tsx Sep 10, 2024
c95d0f6
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Sep 11, 2024
e0bd985
TW-1479: [EVM] Transactions history. ++ Parsing
alex-tsx Sep 11, 2024
73c13cd
Merge branch 'TW-1446-epic-evm-account-management' into TW-1479-evm-t…
alex-tsx Sep 12, 2024
5f8c1dc
Merge branch 'TW-1446-epic-evm-account-management' into TW-1479-evm-t…
alex-tsx Sep 12, 2024
c821058
TW-1479: [EVM] Transaction history. + Extra icon SRC from API
alex-tsx Sep 12, 2024
d2ab39b
TW-1479: [EVM] Transaction history. Refactor. Assets Images Components
alex-tsx Sep 12, 2024
65a605c
TW-1479: [EVM] Transactions history. Minor fixes
alex-tsx Sep 13, 2024
3f587ce
TW-1479: [EVM] Transaction history. + Gas operation
alex-tsx Sep 15, 2024
eacd106
TW-1479: [EVM] Transactions history. [Tezos] Formatting activities. […
alex-tsx Sep 16, 2024
844ef6d
TW-1479: [EVM] Transactions history. [EVM] + InfiniteScroll
alex-tsx Sep 16, 2024
bd3cf32
TW-1479: [EVM] Transaction history. Token page
alex-tsx Sep 17, 2024
c934a03
TW-1479: [EVM] Transaction history. API calls. Refactor. With nextPage
alex-tsx Sep 17, 2024
97b08a2
TW-1479: [EVM] Transaction history. Token page. Using endpoint V2
alex-tsx Sep 18, 2024
2a06a96
TW-1479: [EVM] Transactions history. [Tezos] Fix 'receive' operations
alex-tsx Sep 18, 2024
117262c
TW-1479: [EVM] Transactions history. [Tezos] Refactor
alex-tsx Sep 18, 2024
5701f95
TW-1479: [EVM] Transactions history. [Tezos] Clean-up
alex-tsx Sep 18, 2024
4b03306
TW-1479: [EVM] Transactions history. [Tezos] -- lib/temple/activity
alex-tsx Sep 18, 2024
6be2e1d
TW-1479: [EVM] Transactions history. [Tezos] + Approve
alex-tsx Sep 22, 2024
9234607
TW-1479: [EVM] Transactions history. + Kind 'Transfer'
alex-tsx Sep 22, 2024
00500f9
TW-1479: [EVM] Transactions history. [Tezos] Restored opers order. Re…
alex-tsx Sep 22, 2024
794e47b
TW-1479: [EVM] Transactions history. Fix InfiniteScroll
alex-tsx Sep 23, 2024
36aa7b4
TW-1479: [EVM] Transactions history. [EVM] + TransferSingle support
alex-tsx Sep 23, 2024
c80d6a2
TW-1479: [EVM] Transactions history. Refactor. OperationBaseComponent
alex-tsx Sep 23, 2024
3b52785
TW-1479: [EVM] Transactions history. [Tezos] + Bundles
alex-tsx Sep 24, 2024
5f32821
TW-1479: [EVM] Transactions history. [Tezos] Token page. -- Asset icons
alex-tsx Sep 24, 2024
e8e2d84
TW-1479: [EVM] Transactions history. [EVM] + Bundles
alex-tsx Sep 24, 2024
ab49975
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Sep 24, 2024
8bf6464
TW-1479: [EVM] Transactions history. Explore Tab -> Page
alex-tsx Sep 24, 2024
c3f1509
TW-1479: [EVM] Transactions history. Filters. By network. WIP
alex-tsx Sep 26, 2024
b9dd96a
TW-1479: [EVM] Transactions history. Multichain. WIP: For EVM
alex-tsx Sep 30, 2024
99ab0cf
TW-1479: [EVM] Transactions history. Multichain. EVM. Optimization: l…
alex-tsx Oct 1, 2024
5625eeb
TW-1479: [EVM] Transactions history. Multichain. + AbortSignal
alex-tsx Oct 1, 2024
66ac409
TW-1479: [EVM] Transactions history. Multichain. + useActivitiesLoadi…
alex-tsx Oct 2, 2024
ac81a2e
TW-1479: [EVM] Transactions history. InfiniteScroll. Fix loader show-up
alex-tsx Oct 2, 2024
a9c3813
TW-1479: [EVM] Transactions history. Multichain. Refactor
alex-tsx Oct 2, 2024
62fa623
TW-1479: [EVM] Transactions history. Approve kind. + Unlimited
alex-tsx Oct 2, 2024
0956fc9
TW-1479: [EVM] Transactions history. Amounts crypto & fiat
alex-tsx Oct 3, 2024
cc0c582
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Oct 3, 2024
be732c5
TW-1479: [EVM] Transactions history. Filters. WIP
alex-tsx Oct 3, 2024
951cea3
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 4, 2024
8f1776b
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 4, 2024
442be66
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 4, 2024
90d8c76
TW-1479: [EVM] Transactions history. Filters. Networks dropdown
alex-tsx Oct 7, 2024
fbe168b
TW-1479: [EVM] Transactions history. Refactor NetworkIcon tooltips
alex-tsx Oct 7, 2024
c152286
TW-1479: [EVM] Transactions history. Bundle modal. ++
alex-tsx Oct 8, 2024
7454434
TW-1479: [EVM] Transactions history. Multichain list. + Ad
alex-tsx Oct 8, 2024
db783b4
TW-1479: [EVM] Transactions history. + @covalenthq/client-sdk
alex-tsx Oct 8, 2024
d22af19
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 8, 2024
40ea89d
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Oct 8, 2024
d8cf707
TW-1479: [EVM] Transactions history. + Grouping by Date
alex-tsx Oct 9, 2024
83ca8dc
TW-1479: [EVM] Transactions history. Fix amountSigned. + Green positi…
alex-tsx Oct 9, 2024
946302d
TW-1479: [EVM] Transactions history. + Bundle icons stack. + NFTs rou…
alex-tsx Oct 9, 2024
638838d
TW-1479: [EVM] Transactions history. ++ Asset Images
alex-tsx Oct 9, 2024
18e7f3d
TW-1479: [EVM] Transactions history. Fix pipeline
alex-tsx Oct 10, 2024
ab1532a
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Oct 10, 2024
aefd6ae
TW-1479: [EVM] Transactions history. Trigger pipeline
alex-tsx Oct 10, 2024
e94a76e
TW-1479: [EVM] Transactions history. Trigger pipeline
alex-tsx Oct 10, 2024
d848041
TW-1479: [EVM] Transactions history. Minor design fixes
alex-tsx Oct 11, 2024
40fe4c9
TW-1479: [EVM] Transactions history. + Activity status tag elem
alex-tsx Oct 11, 2024
a494404
TW-1479: [EVM] Transactions history. + Address chips in Bundle modal
alex-tsx Oct 14, 2024
df056be
TW-1479: [EVM] Transactions history. Refactor. + Transfer types
alex-tsx Oct 14, 2024
f50c8e1
TW-1479: [EVM] Transactions history. Refactor. Transfer types
alex-tsx Oct 14, 2024
8575d5c
TW-1479: [EVM] Transactions history. Minor fixes
alex-tsx Oct 14, 2024
7df286c
TW-1479: [EVM] Transactions history. Multichain. + Fallback icons
alex-tsx Oct 14, 2024
528d248
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Oct 14, 2024
9d0fe6e
TW-1479: [EVM] Transactions history. + New loader
alex-tsx Oct 15, 2024
28926ed
TW-1479: [EVM] Transactions history. Multichain. -- Filters by kind
alex-tsx Oct 15, 2024
b5c529b
TW-1479: [EVM] Transactions history. Fix merge
alex-tsx Oct 15, 2024
787ad52
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 15, 2024
b957e97
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 15, 2024
a80bc78
TW-1479: [EVM] Transactions history. Multichain. Refactor
alex-tsx Oct 15, 2024
b02d81b
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 16, 2024
bac34e1
TW-1479: [EVM] Transactions history. Refactor
alex-tsx Oct 16, 2024
f0acb7d
Fix audit-deps
alex-tsx Oct 28, 2024
8ecb3e0
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Oct 28, 2024
0e6d2b2
TW-1479: [EVM] Transactions history. Minor fixes
alex-tsx Oct 28, 2024
3b982da
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Oct 30, 2024
4c40189
TW-1479: [EVM] Transactions history. Reduced number of checksumming a…
alex-tsx Nov 3, 2024
c7ffe0f
TW-1479: [EVM] Transactions history. Eliminated checksumming addresse…
alex-tsx Nov 3, 2024
9ca36e9
TW-1479: [EVM] Transactions history. Bundle modal. + Lazy render
alex-tsx Nov 4, 2024
31b9be6
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Nov 4, 2024
5aa2c4d
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Nov 4, 2024
2838d85
TW-1479: [EVM] Transactions history. Minor refactor
alex-tsx Nov 4, 2024
4e762da
Merge branch 'development-2' into TW-1479-evm-transactions-history
alex-tsx Nov 6, 2024
4312004
fix after merge
alex-tsx Nov 6, 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"dependencies": {
"@apollo/client": "^3.7.2",
"@covalenthq/client-sdk": "^2",
"@dicebear/bottts-neutral": "^8.0.1",
"@dicebear/core": "^8.0.1",
"@firebase/app": "^0.10.1",
Expand Down Expand Up @@ -200,7 +201,7 @@
"ts-prune": "^0.10.3",
"typescript": "^5.4.2",
"typescript-eslint": "^7",
"use-debounce": "7.0.1",
"use-debounce": "^10",
"use-force-update": "1.0.7",
"use-onclickoutside": "0.4.1",
"util": "0.11.1",
Expand Down
4 changes: 0 additions & 4 deletions public/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,6 @@
"message": "Tezos Mainnet",
"description": "Mainnet = main network"
},
"marigoldMainnet": {
"message": "Marigold Mainnet",
"description": "Mainnet = main network"
},
"templeWalletOptions": {
"message": "Temple Wallet | Optionen"
},
Expand Down
1 change: 1 addition & 0 deletions public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2442,6 +2442,7 @@
"blockExplorer": {
"message": "Block Explorer"
},
"viewOnExplorer": { "message": "View on explorer" },
"viewOnBlockExplorer": { "message": "View on block explorer" },
"specifyTokenId": {
"message": "Specify token ID"
Expand Down
3 changes: 3 additions & 0 deletions public/_locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1960,5 +1960,8 @@
},
"zarName": {
"message": "Південноафриканський ранд"
},
"allNetworks": {
"message": "Всі мережі"
}
}
2 changes: 2 additions & 0 deletions src/app/PageRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { useTempleClient } from 'lib/temple/front';
import * as Woozie from 'lib/woozie';
import { TempleChainKind } from 'temple/types';

import { ActivityPage } from './pages/Activity';
import { ChainSettings } from './pages/ChainSettings';
import { ImportWallet } from './pages/ImportWallet';
import { Market } from './pages/Market';
Expand Down Expand Up @@ -75,6 +76,7 @@ const ROUTE_MAP = Woozie.createMap<RouteContext>([
<Home chainKind={chainKind} chainId={chainId} assetSlug={assetSlug} />
))
],
['/activity', onlyReady(() => <ActivityPage />)],
['/connect-ledger', onlyReady(onlyInFullPage(() => <ConnectLedger />))],
['/receive', onlyReady(() => <Receive />)],
[
Expand Down
9 changes: 0 additions & 9 deletions src/app/a11y/ContentFader/index.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/a11y/ContentFader/styles.module.css

This file was deleted.

5 changes: 5 additions & 0 deletions src/app/a11y/content-fader/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import ModStyles from './styles.module.css';

export const ACTIVATE_CONTENT_FADER_CLASSNAME = ModStyles.activateContentFader;

export const FADABLE_CONTENT_CLASSNAME = ModStyles.fadeableContent;
3 changes: 3 additions & 0 deletions src/app/a11y/content-fader/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.activateContentFader .fadeableContent {
filter: brightness(0.85);
}
1 change: 0 additions & 1 deletion src/app/atoms/AccountName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ interface CopyAddressButtonProps {

const CopyAddressButton = memo<CopyAddressButtonProps>(({ chain, address, onCopy }) => (
<ActionListItem
className="flex items-center"
onClick={() => {
window.navigator.clipboard.writeText(address);
onCopy();
Expand Down
61 changes: 35 additions & 26 deletions src/app/atoms/ActionListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo } from 'react';
import React, { FC } from 'react';

import clsx from 'clsx';

Expand All @@ -14,33 +14,42 @@ export interface ActionListItemProps extends PropsWithChildren {
/** Pass it, if you want it to be called with `false` on click too */
setOpened?: SyncFn<boolean>;
testID?: string;
active?: boolean;
danger?: boolean;
}

export const ActionListItem = memo<ActionListItemProps>(
({ Icon, linkTo, className, onClick, setOpened, testID, danger, children }) => {
const baseProps = {
testID,
className: clsx(
'flex items-center py-1.5 px-2 gap-x-1 rounded-md text-font-description',
'hover:bg-secondary-low',
className
),
onClick: setOpened
? () => {
setOpened(false);
onClick?.();
}
: onClick,
children: (
<>
{Icon && <IconBase Icon={Icon} size={16} className={danger ? 'text-error' : 'text-secondary'} />}
export const ActionListItem: FC<ActionListItemProps> = ({
Icon,
linkTo,
className,
onClick,
setOpened,
testID,
active,
danger,
children
}) => {
const baseProps = {
testID,
className: clsx(
'flex items-center py-1.5 px-2 gap-x-1 rounded-md text-font-description',
active ? 'bg-grey-4' : danger ? 'hover:bg-error-low' : 'hover:bg-secondary-low',
className
),
onClick: setOpened
? () => {
setOpened(false);
onClick?.();
}
: onClick,
children: (
<>
{Icon && <IconBase Icon={Icon} size={16} className={danger ? 'text-error' : 'text-secondary'} />}

{typeof children === 'string' ? <span className="capitalize">{children}</span> : children}
</>
)
};
{typeof children === 'string' ? <span className="capitalize">{children}</span> : children}
</>
)
};

return linkTo ? <Link {...baseProps} to={linkTo} /> : <Button {...baseProps} />;
}
);
return linkTo ? <Link {...baseProps} to={linkTo} /> : <Button {...baseProps} />;
};
4 changes: 2 additions & 2 deletions src/app/atoms/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import * as React from 'react';

import { AnalyticsEventCategory, setTestID, TestIDProps, useAnalytics } from 'lib/analytics';

interface Props
export interface AnchorProps
extends React.PropsWithRef<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>>,
TestIDProps {
treatAsButton?: boolean;
}

export const Anchor = React.forwardRef<HTMLAnchorElement, Props>(
export const Anchor = React.forwardRef<HTMLAnchorElement, AnchorProps>(
(
{ target = '_blank', rel = 'noopener noreferrer', testID, testIDProperties, treatAsButton, onClick, ...props },
ref
Expand Down
4 changes: 2 additions & 2 deletions src/app/atoms/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export type AvatarProps = AvatarDivProps | AvatarButtonProps;
const sizeButtonClassNames = {
24: 'w-6 h-6 rounded border p-px',
32: 'w-8 h-8 rounded-md border p-px',
60: 'w-15 h-15 rounded-2.5 border-1.5 p-[0.5px]'
60: 'w-15 h-15 rounded-10 border-1.5 p-[0.5px]'
};

const sizeContainerClassNames = {
24: 'rounded-0.75',
24: 'rounded-3',
32: 'rounded',
60: 'rounded-lg border border-white'
};
Expand Down
40 changes: 28 additions & 12 deletions src/app/atoms/Identicon.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import React, { HTMLAttributes, useMemo } from 'react';
import React, { FC, HTMLAttributes, ImgHTMLAttributes, useMemo } from 'react';

import clsx from 'clsx';

import { IdenticonType, getIdenticonUri } from 'lib/temple/front';
import { IdenticonOptions } from 'lib/temple/front/identicon';
import {
IdenticonImgType,
ImageIdenticonOptions,
InitialsIdenticonOptions,
buildImageIdenticonUri,
buildInitialsIdenticonUri
} from 'lib/identicon';

type IdenticonProps<T extends IdenticonType> = HTMLAttributes<HTMLDivElement> & {
interface IdenticonProps<T extends IdenticonImgType> extends HTMLAttributes<HTMLDivElement> {
type: T;
hash: string;
size?: number;
options?: IdenticonOptions<T>;
};
options?: ImageIdenticonOptions<T>;
}

export const Identicon = <T extends IdenticonType>({
export const Identicon = <T extends IdenticonImgType>({
type,
hash,
size = 100,
Expand All @@ -21,19 +26,30 @@ export const Identicon = <T extends IdenticonType>({
options,
...rest
}: IdenticonProps<T>) => {
const backgroundImage = useMemo(() => getIdenticonUri(hash, size, type, options), [hash, options, size, type]);
const backgroundImage = useMemo(() => buildImageIdenticonUri(hash, size, type, options), [hash, options, size, type]);

return (
<div
className={clsx(
type === 'initials' ? 'bg-transparent' : 'bg-white',
'bg-no-repeat bg-center inline-block overflow-hidden',
'bg-white overflow-hidden',
'inline-block bg-no-repeat bg-center', // (!) Why?
className
)}
style={style}
style={{ width: size, height: size, ...style }}
{...rest}
>
<img src={backgroundImage} alt="" style={{ width: size, height: size }} />
<img src={backgroundImage} alt="" className="w-full h-full" />
</div>
);
};

interface IdenticonInitialsProps extends ImgHTMLAttributes<HTMLImageElement> {
value: string;
options?: InitialsIdenticonOptions;
}

export const IdenticonInitials: FC<IdenticonInitialsProps> = ({ value, options, ...props }) => {
const src = useMemo(() => buildInitialsIdenticonUri(value, options), [options, value]);

return <img src={src} {...props} />;
};
83 changes: 83 additions & 0 deletions src/app/atoms/InfiniteScroll.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import React, { CSSProperties, FC, ReactElement, useEffect } from 'react';

import ReactInfiniteScrollComponent from 'react-infinite-scroll-component';

import { APP_CONTENT_PAPER_DOM_ID, SCROLL_DOCUMENT } from 'app/layouts/containers';

import { LoaderDebounce } from './LoaderDebounce';
import { SyncSpinner } from './SyncSpinner';

interface Props extends PropsWithChildren {
itemsLength: number;
isSyncing: boolean;
reachedTheEnd: boolean;
retryInitialLoad: EmptyFn;
loadMore: EmptyFn;
loader?: ReactElement;
}

export const InfiniteScroll: FC<Props> = ({
itemsLength,
isSyncing,
reachedTheEnd,
retryInitialLoad,
loadMore,
loader,
children
}) => {
const loadNext = itemsLength ? loadMore : retryInitialLoad;

const onScroll = isSyncing || reachedTheEnd ? undefined : buildOnScroll(loadNext);

// For when there are too few items to make initial scroll for loadMore:
useEffect(() => {
if (SCROLL_DOCUMENT || isSyncing || reachedTheEnd) return;

const scrollableElem = document.getElementById(APP_CONTENT_PAPER_DOM_ID);

if (!scrollableElem || scrollableElem.scrollTop || scrollableElem.scrollHeight > scrollableElem.clientHeight)
return;

if (isScrollAtTheEnd(scrollableElem)) loadNext();
}, [isSyncing, itemsLength, reachedTheEnd]);

return (
<ReactInfiniteScrollComponent
dataLength={itemsLength}
hasMore={!reachedTheEnd}
next={loadNext}
onScroll={onScroll}
loader={null} // Doesn't always show this way
scrollableTarget={SCROLL_DOCUMENT ? undefined : APP_CONTENT_PAPER_DOM_ID}
style={STYLE}
>
{children}

<LoaderDebounce isSyncing={isSyncing} keepTime={2_000}>
{loader ?? <SyncSpinner className="mt-4" />}
</LoaderDebounce>
</ReactInfiniteScrollComponent>
);
};

const STYLE: CSSProperties = {
/** Scrollable element must be an ancestor of this component - document or other. */
overflow: 'unset'
};

/**
* Build onscroll listener to trigger next loading, when fetching data resulted in error.
* `InfiniteScroll.props.next` won't be triggered in this case.
*/
const buildOnScroll =
(next: EmptyFn) =>
({ target }: { target: EventTarget | null }) => {
const elem: HTMLElement =
target instanceof Document ? (target.scrollingElement! as HTMLElement) : (target as HTMLElement);

if (isScrollAtTheEnd(elem)) next();
};

function isScrollAtTheEnd(elem: Element) {
return elem.scrollHeight === elem.clientHeight + elem.scrollTop;
}
30 changes: 0 additions & 30 deletions src/app/atoms/Loader.tsx

This file was deleted.

Loading
Loading