-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TW-1479: [EVM] Transactions history with Alchemy (#1231)
* TW-1479: [EVM] Transactions history * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. ++ Parsing * TW-1479: [EVM] Transaction history. + Extra icon SRC from API * TW-1479: [EVM] Transaction history. Refactor. Assets Images Components * TW-1479: [EVM] Transactions history. Minor fixes * TW-1479: [EVM] Transaction history. + Gas operation * TW-1479: [EVM] Transactions history. [Tezos] Formatting activities. [EVM] Applying metadata. * TW-1479: [EVM] Transactions history. [EVM] + InfiniteScroll * TW-1479: [EVM] Transaction history. Token page * TW-1479: [EVM] Transaction history. API calls. Refactor. With nextPage * TW-1479: [EVM] Transaction history. Token page. Using endpoint V2 * TW-1479: [EVM] Transactions history. [Tezos] Fix 'receive' operations * TW-1479: [EVM] Transactions history. [Tezos] Refactor * TW-1479: [EVM] Transactions history. [Tezos] Clean-up * TW-1479: [EVM] Transactions history. [Tezos] -- lib/temple/activity * TW-1479: [EVM] Transactions history. [Tezos] + Approve * TW-1479: [EVM] Transactions history. + Kind 'Transfer' * TW-1479: [EVM] Transactions history. [Tezos] Restored opers order. Reversed back * TW-1479: [EVM] Transactions history. Fix InfiniteScroll * TW-1479: [EVM] Transactions history. [EVM] + TransferSingle support * TW-1479: [EVM] Transactions history. Refactor. OperationBaseComponent * TW-1479: [EVM] Transactions history. [Tezos] + Bundles * TW-1479: [EVM] Transactions history. [Tezos] Token page. -- Asset icons * TW-1479: [EVM] Transactions history. [EVM] + Bundles * TW-1479: [EVM] Transactions history. Explore Tab -> Page * TW-1479: [EVM] Transactions history. Filters. By network. WIP * TW-1479: [EVM] Transactions history. Multichain. WIP: For EVM * TW-1479: [EVM] Transactions history. Multichain. EVM. Optimization: loops reduction * TW-1479: [EVM] Transactions history. Multichain. + AbortSignal * TW-1479: [EVM] Transactions history. Multichain. + useActivitiesLoadingLogic() * TW-1479: [EVM] Transactions history. InfiniteScroll. Fix loader show-up * TW-1479: [EVM] Transactions history. Multichain. Refactor * TW-1479: [EVM] Transactions history. Approve kind. + Unlimited * TW-1479: [EVM] Transactions history. Amounts crypto & fiat * TW-1479: [EVM] Transactions history. Filters. WIP * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. Filters. Networks dropdown * TW-1479: [EVM] Transactions history. Refactor NetworkIcon tooltips * TW-1479: [EVM] Transactions history. Bundle modal. ++ * TW-1479: [EVM] Transactions history. Multichain list. + Ad * TW-1479: [EVM] Transactions history. + @covalenthq/client-sdk * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. + Grouping by Date * TW-1479: [EVM] Transactions history. Fix amountSigned. + Green positive amounts * TW-1479: [EVM] Transactions history. + Bundle icons stack. + NFTs rounding * TW-1479: [EVM] Transactions history. ++ Asset Images * TW-1479: [EVM] Transactions history. Fix pipeline * TW-1479: [EVM] Transactions history. Trigger pipeline * TW-1479: [EVM] Transactions history. Trigger pipeline * TW-1479: [EVM] Transactions history. Minor design fixes * TW-1479: [EVM] Transactions history. + Activity status tag elem * TW-1479: [EVM] Transactions history. + Address chips in Bundle modal * TW-1479: [EVM] Transactions history. Refactor. + Transfer types * TW-1479: [EVM] Transactions history. Refactor. Transfer types * TW-1479: [EVM] Transactions history. Minor fixes * TW-1479: [EVM] Transactions history. Multichain. + Fallback icons * TW-1479: [EVM] Transactions history. + New loader * TW-1479: [EVM] Transactions history. Multichain. -- Filters by kind * TW-1479: [EVM] Transactions history. Fix merge * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. Multichain. Refactor * TW-1479: [EVM] Transactions history. Refactor * TW-1479: [EVM] Transactions history. Refactor * Fix audit-deps * TW-1479: [EVM] Transactions history. Minor fixes * TW-1479: [EVM] Transactions history. Reduced number of checksumming addresses while parsing * TW-1479: [EVM] Transactions history. Eliminated checksumming addresses while parsing * TW-1479: [EVM] Transactions history. Bundle modal. + Lazy render * TW-1479: [EVM] Transactions history. Minor refactor * fix after merge * TW-1587: [research] Activity History on Alchemy. Transfers * TW-1587: [research] Activity History on Alchemy. Multichain * TW-1587: [research] Activity History on Alchemy. + Approvals * TW-1479: [EVM] Transactions history with Alchemy. -- Covalent SDK * TW-1479: [EVM] Transactions history with Alchemy. Merging from/to transfers correctly * TW-1479: [EVM] Transactions history with Alchemy. ++ Merging transfers * TW-1479: [EVM] Transactions history with Alchemy. + Sort by log index * TW-1587: [research] Activity History on Alchemy. + Block Explorer URLs * TW-1479: [EVM] Transactions history with Alchemy * TW-1479: [EVM] Transactions history with Alchemy. Removed 'alchemy-sdk' * TW-1479: [EVM] Transactions history with Alchemy. Return Optimism to def networks * TW-1479: [EVM] Transactions history with Alchemy. Minor fixes * TW-1479: [EVM] Transactions history with Alchemy. Transfer -> Send/Receive * TW-1479: [EVM] Transactions history with Alchemy. Refactor * fix pipeline * TW-1479: [EVM] Transactions history with Alchemy. Fix Firefox lag
- Loading branch information
Showing
176 changed files
with
4,110 additions
and
2,327 deletions.
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
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 |
---|---|---|
|
@@ -1943,5 +1943,8 @@ | |
}, | ||
"zarName": { | ||
"message": "Південноафриканський ранд" | ||
}, | ||
"allNetworks": { | ||
"message": "Всі мережі" | ||
} | ||
} |
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 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
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; |
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,3 @@ | ||
.activateContentFader .fadeableContent { | ||
filter: brightness(0.85); | ||
} |
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
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,82 @@ | ||
import React, { CSSProperties, FC, ReactElement, useEffect, useMemo } 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; | ||
|
||
/** | ||
* Build onscroll listener to trigger next loading, when fetching data resulted in error. | ||
* `InfiniteScroll.props.next` won't be triggered in this case. | ||
*/ | ||
const onScroll = useMemo(() => { | ||
if (isSyncing || reachedTheEnd) return; | ||
|
||
return ({ target }: { target: EventTarget | null }) => { | ||
const elem = (target instanceof Document ? target.scrollingElement! : target) as HTMLElement; | ||
|
||
if (isScrollAtTheEnd(elem)) loadNext(); | ||
}; | ||
}, [loadNext, isSyncing, reachedTheEnd]); | ||
|
||
const scrollableElem = useMemo(() => document.getElementById(APP_CONTENT_PAPER_DOM_ID), []); | ||
|
||
// For when there are too few items to make initial scroll for loadMore: | ||
useEffect(() => { | ||
if (SCROLL_DOCUMENT || isSyncing || reachedTheEnd) return; | ||
|
||
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' | ||
}; | ||
|
||
function isScrollAtTheEnd(elem: Element) { | ||
return elem.scrollHeight === elem.clientHeight + elem.scrollTop; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.