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

Sdk-dapp-core migration #264

Open
wants to merge 121 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
4721146
Migrate
razvantomegea Dec 18, 2024
909c58d
Login and sign message
razvantomegea Dec 18, 2024
2e891ee
Ping transactions
razvantomegea Dec 18, 2024
8b44297
Removed ping pong abi and service
razvantomegea Dec 18, 2024
d0e74e8
Batch transactions
razvantomegea Dec 18, 2024
1347c1a
Transactons
razvantomegea Dec 19, 2024
51731f8
Added transaction interpretation helpers
razvantomegea Dec 20, 2024
45b67c7
Added transaction interpretation UI and helpers
razvantomegea Dec 22, 2024
67893ec
Added transaction interpretation UI and helpers
razvantomegea Dec 22, 2024
7063ab9
fix build
razvantomegea Dec 22, 2024
bf45f4e
Fix build
razvantomegea Dec 22, 2024
dae68f4
Refactor
razvantomegea Dec 23, 2024
e7e0abd
Added reactive store subscription
razvantomegea Dec 23, 2024
e2f9072
Fix
razvantomegea Dec 23, 2024
37f11bc
Update versions
arhtudormorar Dec 24, 2024
cdc8f15
Improve useStore
arhtudormorar Dec 24, 2024
f26a5d6
Local working
arhtudormorar Dec 24, 2024
2b25485
Work on reactivity
arhtudormorar Dec 24, 2024
34b4eb7
Removed logs
razvantomegea Dec 30, 2024
9ff7517
Track transactions
razvantomegea Dec 30, 2024
f8bb725
Use selector from sdk-dapp-core
arhtudormorar Jan 8, 2025
f85cc39
Remove unused
arhtudormorar Jan 8, 2025
dbcdd4b
Fix rerenders
arhtudormorar Jan 16, 2025
675c8a2
Remove unused
arhtudormorar Jan 16, 2025
aaa76e9
Remove dependecy
arhtudormorar Jan 16, 2025
8ace13f
Added formatAmount
razvantomegea Jan 16, 2025
28b71f7
Integrate hooks
arhtudormorar Jan 17, 2025
85fcc56
Upgrade sdk-dapp-core
arhtudormorar Jan 20, 2025
2406187
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/integrate-hooks
arhtudormorar Jan 20, 2025
d2bce86
Merge pull request #270 from multiversx/tm/feature/integrate-hooks
arhtudormorar Jan 20, 2025
768aed0
remove selector
arhtudormorar Jan 20, 2025
85326cc
Remove unused
arhtudormorar Jan 20, 2025
092bda2
Bring back useSendBatchTransaction
arhtudormorar Jan 20, 2025
6cdd470
Restore features
arhtudormorar Jan 20, 2025
2c7cee3
Merge pull request #271 from multiversx/tm/feature/restore-widgets
arhtudormorar Jan 20, 2025
48e5532
Added FormatAmount.tsx
razvantomegea Jan 21, 2025
8caa0a5
Added FormatAmount.tsx
razvantomegea Jan 21, 2025
b0a8ba1
Remove unused hooks
arhtudormorar Jan 24, 2025
1ee026f
Custom provider implementation (#272)
arhtudormorar Jan 24, 2025
7df59ca
Improve-in-memory-provider (#274)
arhtudormorar Jan 27, 2025
dfe11c2
add toast lifetime (#275)
DanutIlie Jan 27, 2025
9c48535
Added transactions table from sdk-dapp-core/ui (#273)
razvantomegea Jan 28, 2025
da161fa
use react output (#279)
DanutIlie Feb 4, 2025
187c7d1
Transactions table (#278)
razvantomegea Feb 5, 2025
c9e7783
Fixed build and added missing UI elements (#280)
razvantomegea Feb 10, 2025
97ca156
Fixed build and lint issues
razvantomegea Feb 10, 2025
dc5f52f
Fix
razvantomegea Feb 10, 2025
415b8ef
Fixed lint and build
razvantomegea Feb 11, 2025
afab2a2
Merged development
razvantomegea Feb 11, 2025
5b91d19
Fixed build
razvantomegea Feb 11, 2025
9bbdb0f
Added sdk-core back
razvantomegea Feb 11, 2025
3d2ed82
Fixed import
razvantomegea Feb 11, 2025
5667113
Merge pull request #281 from multiversx/rt/fix/build-and-lint
razvantomegea Feb 11, 2025
bc806b8
Merge branch 'development' into rt/feature/sdk-dapp-core
razvantomegea Feb 11, 2025
fee1781
Remove unnecessary refresh account (#283)
DanutIlie Feb 12, 2025
e243a6e
Refactor
razvantomegea Feb 12, 2025
5dd6f8f
Renamed props type
razvantomegea Feb 12, 2025
87db609
Refactor
razvantomegea Feb 12, 2025
c17be28
Refactor and comments (#284)
razvantomegea Feb 12, 2025
68aed91
Added back batch transactions functions (#286)
razvantomegea Feb 12, 2025
f4954e7
Fix
razvantomegea Feb 12, 2025
4099be3
Refactor imports
razvantomegea Feb 13, 2025
e873509
Conflicts
razvantomegea Feb 13, 2025
e8eeb9f
Merge branch 'development' into rt/feature/sdk-dapp-core
razvantomegea Feb 13, 2025
2ccb759
Revert
razvantomegea Feb 13, 2025
f2814ae
Refactor explorerlink
razvantomegea Feb 13, 2025
2fa946e
Fixed build and added AuthenticatedRoutesWrapper
razvantomegea Feb 13, 2025
dc51e44
Revert AuthenticatedRouteWrapper
razvantomegea Feb 13, 2025
1258568
Fixed build
razvantomegea Feb 13, 2025
e886857
Tm/feature/sdk-dapp-core/merge-1 (#291)
arhtudormorar Feb 14, 2025
cb96ca1
Fix sort imports
razvantomegea Feb 14, 2025
60a18ab
Merge branch 'development' into rt/fix/sort-imports
razvantomegea Feb 14, 2025
91dde85
Merge pull request #295 from multiversx/rt/fix/sort-imports
arhtudormorar Feb 14, 2025
99b1ed5
Fixed sort exports
razvantomegea Feb 14, 2025
bd95e23
Merge development
razvantomegea Feb 14, 2025
3886c39
Merge pull request #296 from multiversx/rt/fix/sort-imports
arhtudormorar Feb 14, 2025
40277be
Revert import type
razvantomegea Feb 14, 2025
2936b50
Move components
arhtudormorar Feb 14, 2025
289a178
lint
arhtudormorar Feb 14, 2025
198c894
Added PageNotFound
razvantomegea Feb 14, 2025
73a92ac
Move components (#298)
arhtudormorar Feb 14, 2025
973a5ee
Merge development
razvantomegea Feb 14, 2025
14bc613
Merge pull request #300 from multiversx/rt/fix/import-type
arhtudormorar Feb 14, 2025
5de2dc2
Merge branch 'development' into rt/fix/merge-dev
razvantomegea Feb 14, 2025
45b833a
Merge pull request #304 from multiversx/rt/fix/merge-dev
razvantomegea Feb 14, 2025
b6805e0
Merge dev
razvantomegea Feb 14, 2025
88dd8bd
Updates
arhtudormorar Feb 14, 2025
7420888
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/sdk-dapp-core…
arhtudormorar Feb 14, 2025
6a06d9a
Merge pull request #307 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar Feb 14, 2025
51ee890
Updated SignSuccess
razvantomegea Feb 14, 2025
ca1a82a
Minor refactor
arhtudormorar Feb 14, 2025
34c307c
Minor changes
arhtudormorar Feb 14, 2025
9848014
Merge dev
razvantomegea Feb 14, 2025
114d233
Tm/feature/sdk dapp core/refactor 2 (#309)
arhtudormorar Feb 14, 2025
5c3a1bd
Merge pull request #310 from multiversx/rt/fix/merge-dev
razvantomegea Feb 14, 2025
77a0f00
Merge branch 'development' into rt/feature/sdk-dapp-core
arhtudormorar Feb 14, 2025
687245b
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/sdk-dapp-core…
arhtudormorar Feb 14, 2025
cb2ec7b
Minor refactor
arhtudormorar Feb 14, 2025
4b6f917
Refactor
razvantomegea Feb 14, 2025
e73457d
Fix errors
arhtudormorar Feb 14, 2025
cd8e631
Merge pull request #312 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar Feb 14, 2025
5dd0773
Merge branch 'rt/feature/sdk-dapp-core' into rt/fix/refactor
razvantomegea Feb 14, 2025
29834bb
Revert
razvantomegea Feb 14, 2025
03aeea0
Revert
razvantomegea Feb 14, 2025
b07f1a6
Merge pull request #311 from multiversx/rt/fix/refactor
arhtudormorar Feb 14, 2025
73c3b74
Some updates
arhtudormorar Feb 14, 2025
daf36d0
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/sdk-dapp-core…
arhtudormorar Feb 14, 2025
c007402
Some updates (#313)
arhtudormorar Feb 14, 2025
fd23313
Implement changes
arhtudormorar Feb 17, 2025
fedff79
Merge branch 'development' into tm/feature/sdk-dapp-core/refactor-2
arhtudormorar Feb 17, 2025
a73aeb0
Merge branch 'development' into rt/feature/sdk-dapp-core
arhtudormorar Feb 17, 2025
2bf0a2d
Update README
arhtudormorar Feb 17, 2025
434c596
Merge pull request #315 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar Feb 17, 2025
9ca1fcd
Added missing code
razvantomegea Feb 17, 2025
1335f5b
Merge pull request #317 from multiversx/rt/fix/bring-back-code
arhtudormorar Feb 17, 2025
5d9430a
Remove immer (#316)
arhtudormorar Feb 17, 2025
3a757c2
Latest versions
arhtudormorar Feb 18, 2025
50271da
added sdk-dapp-core-ui to optimizeDeps
DanutIlie Feb 18, 2025
a11280e
Added axios interceptors (#318)
razvantomegea Feb 18, 2025
98cfc6d
Merge branch 'development' into rt/feature/sdk-dapp-core
arhtudormorar Feb 19, 2025
33e46b3
Merge pull request #320 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar Feb 19, 2025
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
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@fortawesome/free-solid-svg-icons": "6.5.1",
"@fortawesome/react-fontawesome": "0.2.0",
"@multiversx/sdk-core": "13.16.0",
"@multiversx/sdk-dapp": "3.1.5",
"@multiversx/sdk-dapp-core": "0.0.0-alpha.11",
"@multiversx/sdk-dapp-utils": "1.0.2",
arhtudormorar marked this conversation as resolved.
Show resolved Hide resolved
"axios": "1.7.4",
"classnames": "2.3.2",
"moment": "2.29.4",
Expand All @@ -24,9 +25,9 @@
"start:devnet": "yarn run copy:devnet-config & vite dev",
"start:testnet": "yarn run copy:testnet-config & vite dev",
"start:mainnet": "yarn run copy:mainnet-config & vite dev",
"build:devnet": "yarn run copy:devnet-config & vite build",
"build:testnet": "yarn run copy:testnet-config & vite build",
"build:mainnet": "yarn run copy:mainnet-config & vite build",
"build:devnet": "tsc & yarn run copy:devnet-config & vite build",
"build:testnet": "tsc & yarn run copy:testnet-config & vite build",
"build:mainnet": "tsc & yarn run copy:mainnet-config & vite build",
"copy:devnet-config": "cp ./src/config/config.devnet.ts ./src/config/index.ts",
"copy:testnet-config": "cp ./src/config/config.testnet.ts ./src/config/index.ts",
"copy:mainnet-config": "cp ./src/config/config.mainnet.ts ./src/config/index.ts",
Expand Down
80 changes: 8 additions & 72 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,89 +1,25 @@
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';

import {
AxiosInterceptorContext, // using this is optional
DappProvider,
Layout,
TransactionsToastList,
NotificationModal,
SignTransactionsModals
// uncomment this to use the custom transaction tracker
// TransactionsTracker
} from 'components';

import {
apiTimeout,
walletConnectV2ProjectId,
environment,
sampleAuthenticatedDomains
} from 'config';
import { RouteNamesEnum } from 'localConstants';
import { PageNotFound, Unlock } from 'pages';
import { routes } from 'routes';
import { BatchTransactionsContextProvider } from 'wrappers';
import { Layout } from './components';

const AppContent = () => {
export const App = () => {
return (
<DappProvider
environment={environment}
customNetworkConfig={{
name: 'customConfig',
apiTimeout,
walletConnectV2ProjectId
}}
dappConfig={{
shouldUseWebViewProvider: true,
logoutRoute: RouteNamesEnum.unlock
}}
customComponents={{
transactionTracker: {
// uncomment this to use the custom transaction tracker
// component: TransactionsTracker,
props: {
onSuccess: (sessionId: string) => {
console.log(`Session ${sessionId} successfully completed`);
},
onFail: (sessionId: string, errorMessage: string) => {
console.log(`Session ${sessionId} failed. ${errorMessage ?? ''}`);
}
}
}
}}
>
<AxiosInterceptorContext.Listener>
<Router>
<BatchTransactionsContextProvider>
<Layout>
<TransactionsToastList />
<NotificationModal />
<SignTransactionsModals />
<Routes>
<Route path={RouteNamesEnum.unlock} element={<Unlock />} />
{routes.map((route) => (
<Route
path={route.path}
key={`route-key-'${route.path}`}
path={route.path}
element={<route.component />}
/>
))}
<Route path='*' element={<PageNotFound />} />
arhtudormorar marked this conversation as resolved.
Show resolved Hide resolved
<Route path='*' element={<div>NOT FOUND</div>} />
</Routes>
</Layout>
</AxiosInterceptorContext.Listener>
</DappProvider>
);
};

export const App = () => {
return (
<AxiosInterceptorContext.Provider>
<AxiosInterceptorContext.Interceptor
authenticatedDomains={sampleAuthenticatedDomains}
>
<Router>
<BatchTransactionsContextProvider>
<AppContent />
</BatchTransactionsContextProvider>
</Router>
</AxiosInterceptorContext.Interceptor>
</AxiosInterceptorContext.Provider>
</BatchTransactionsContextProvider>
</Router>
);
};
4 changes: 2 additions & 2 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PropsWithChildren, MouseEvent } from 'react';
import { WithClassnameType } from 'types';
import { WithClassnamePropsType } from 'types';

interface ButtonType extends WithClassnameType, PropsWithChildren {
interface ButtonType extends WithClassnamePropsType, PropsWithChildren {
onClick: (e: MouseEvent) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

PR to dev

disabled?: boolean;
dataTestId?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { PropsWithChildren } from 'react';
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { WithClassnameType } from 'types';
import { WithClassnamePropsType } from 'types';
razvantomegea marked this conversation as resolved.
Show resolved Hide resolved

interface CardType extends PropsWithChildren, WithClassnameType {
interface CardType extends PropsWithChildren, WithClassnamePropsType {
title: string;
description?: string;
reference: string;
Expand Down
3 changes: 2 additions & 1 deletion src/components/ContractAddress/ContractAddress.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Label } from 'components/Label';
import { ACCOUNTS_ENDPOINT, ExplorerLink } from 'components/sdkDappComponents';
import { contractAddress } from 'config';
import { ExplorerLink } from '../ExplorerLink';
import { ACCOUNTS_ENDPOINT } from 'localConstants';

export const ContractAddress = () => {
return (
Expand Down
45 changes: 45 additions & 0 deletions src/components/ExplorerLink/ExplorerLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { PropsWithChildren } from 'react';
import {
faArrowUpRightFromSquare,
IconDefinition
} from '@fortawesome/free-solid-svg-icons';
import { getState, networkSelector } from 'lib/sdkDappCore';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { WithClassnamePropsType } from '../../types';

export interface ExplorerLinkPropsType
razvantomegea marked this conversation as resolved.
Show resolved Hide resolved
razvantomegea marked this conversation as resolved.
Show resolved Hide resolved
extends WithClassnamePropsType,
PropsWithChildren {
page: string;
text?: any;
customExplorerIcon?: IconDefinition;
title?: string;
onClick?: () => void;
}

export const ExplorerLink = ({
page,
text,
className = 'dapp-explorer-link',
children,
customExplorerIcon,
...rest
}: ExplorerLinkPropsType) => {
const network = networkSelector(getState());

const defaultContent = text ?? (
<FontAwesomeIcon icon={customExplorerIcon ?? faArrowUpRightFromSquare} />
);

return (
<a
href={`${network.explorerAddress}${page}`}
target='_blank'
className={className}
rel='noreferrer'
{...rest}
>
{children ?? defaultContent}
</a>
);
};
1 change: 1 addition & 0 deletions src/components/ExplorerLink/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ExplorerLink';
40 changes: 8 additions & 32 deletions src/components/Layout/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,25 @@
import { Button } from 'components/Button';
import { MxLink } from 'components/MxLink';
import { environment } from 'config';
import { logout } from 'helpers';
import { useGetIsLoggedIn } from 'hooks';
import { RouteNamesEnum } from 'localConstants';
import MultiversXLogo from '../../../assets/img/multiversx-logo.svg?react';
import { useMatch } from 'react-router-dom';

const callbackUrl = `${window.location.origin}/unlock`;
const onRedirect = undefined; // use this to redirect with useNavigate to a specific page after logout
const shouldAttemptReLogin = false; // use for special cases where you want to re-login after logout
const options = {
/*
* @param {boolean} [shouldBroadcastLogoutAcrossTabs=true]
* @description If your dApp supports multiple accounts on multiple tabs,
* this param will broadcast the logout event across all tabs.
*/
shouldBroadcastLogoutAcrossTabs: true,
/*
* @param {boolean} [hasConsentPopup=false]
* @description Set it to true if you want to perform async calls before logging out on Safari.
* It will open a consent popup for the user to confirm the action before leaving the page.
*/
hasConsentPopup: false
};
import { useMatch, useNavigate } from 'react-router-dom';
import { getAccountProvider, getIsLoggedIn } from 'lib/sdkDappCore';

export const Header = () => {
const isLoggedIn = useGetIsLoggedIn();
const isLoggedIn = getIsLoggedIn();
const isUnlockRoute = Boolean(useMatch(RouteNamesEnum.unlock));
const navigate = useNavigate();
const provider = getAccountProvider();

const ConnectButton = isUnlockRoute ? null : (
<MxLink to={RouteNamesEnum.unlock}>Connect</MxLink>
);

const handleLogout = () => {
const handleLogout = async () => {
sessionStorage.clear();
logout(
callbackUrl,
/*
* following are optional params. Feel free to remove them in your implementation
*/
onRedirect,
shouldAttemptReLogin,
options
);
await provider.logout();
navigate(RouteNamesEnum.unlock);
};

return (
Expand Down
14 changes: 2 additions & 12 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
import type { PropsWithChildren } from 'react';
import { useLocation } from 'react-router-dom';
import { AuthenticatedRoutesWrapper } from 'components/sdkDappComponents';
import { RouteNamesEnum } from 'localConstants/routes';
import { routes } from 'routes/routes';
import { PropsWithChildren } from 'react';
import { Footer } from './Footer';
import { Header } from './Header';

export const Layout = ({ children }: PropsWithChildren) => {
const { search } = useLocation();
return (
<div className='flex min-h-screen flex-col bg-slate-200'>
<Header />
<main className='flex flex-grow items-stretch justify-center p-6'>
<AuthenticatedRoutesWrapper
routes={routes}
unlockRoute={`${RouteNamesEnum.unlock}${search}`}
>
{children}
</AuthenticatedRoutesWrapper>
{children}
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove AuthenticatedRoutesWrapper ?

</main>
<Footer />
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/components/Loader/Loader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

export const Loader = () => {
return (
<div className='flex justify-center items-center h-screen'>
<FontAwesomeIcon
icon={faSpinner}
spin
className='text-4xl text-blue-500'
/>
</div>
);
};
1 change: 1 addition & 0 deletions src/components/Loader/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Loader';
6 changes: 3 additions & 3 deletions src/components/MxLink/MxLink.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { PropsWithChildren } from 'react';
import { PropsWithChildren } from 'react';
Copy link
Contributor

@arhtudormorar arhtudormorar Feb 12, 2025

Choose a reason for hiding this comment

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

PR to dev

import { Link } from 'react-router-dom';
import { WithClassnameType } from 'types';
import { WithClassnamePropsType } from 'types';

interface MxLinkPropsType extends PropsWithChildren, WithClassnameType {
interface MxLinkPropsType extends PropsWithChildren, WithClassnamePropsType {
to: string;
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/OutputContainer/OutputContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { PropsWithChildren } from 'react';
import classNames from 'classnames';
import { Loader } from 'components/sdkDappComponents';
import { WithClassnameType } from 'types';
import { Loader } from 'components/Loader';
Copy link
Contributor

@arhtudormorar arhtudormorar Feb 12, 2025

Choose a reason for hiding this comment

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

PR to dev

import { WithClassnamePropsType } from 'types';

interface OutputContainerPropsType
extends PropsWithChildren,
WithClassnameType {
WithClassnamePropsType {
isLoading?: boolean;
}

Expand Down
26 changes: 12 additions & 14 deletions src/components/OutputContainer/components/TransactionOutput.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import {
TRANSACTIONS_ENDPOINT,
ACCOUNTS_ENDPOINT
} from '@multiversx/sdk-dapp/apiCalls/endpoints';
Copy link
Contributor

Choose a reason for hiding this comment

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

'@multiversx/sdk-dapp/apiCalls/endpoints'; --> move to utils in PR to dev ?

import { useGetNetworkConfig } from '@multiversx/sdk-dapp/hooks/useGetNetworkConfig';
import { ExplorerLink } from '@multiversx/sdk-dapp/UI/ExplorerLink';
Copy link
Contributor

Choose a reason for hiding this comment

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

import from components ? pr to DEV

import { Label } from 'components/Label';
Copy link
Contributor

Choose a reason for hiding this comment

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

import from components ? pr to DEV

import { FormatAmount } from 'components/sdkDappComponents';
import { SignedTransactionType } from 'types';
import { ExplorerLink } from '../../ExplorerLink';
arhtudormorar marked this conversation as resolved.
Show resolved Hide resolved
import {
ACCOUNTS_ENDPOINT,
razvantomegea marked this conversation as resolved.
Show resolved Hide resolved
DataTestIdsEnum,
TRANSACTIONS_ENDPOINT
} from 'localConstants';
import { formatAmount } from 'lib/sdkDappUtils';

export const TransactionOutput = ({
transaction
}: {
transaction: SignedTransactionType;
}) => {
const { network } = useGetNetworkConfig();
const decodedData = transaction.data
? Buffer.from(transaction.data, 'base64').toString('ascii')
: 'N/A';
Expand All @@ -40,12 +39,11 @@ export const TransactionOutput = ({

<p>
<Label>Amount: </Label>
<FormatAmount
value={transaction.value}
showLabel={transaction.value !== '0'}
egldLabel={network.egldLabel}
data-testid='balance'
/>
<span data-testid={DataTestIdsEnum.balance}>
{formatAmount({
input: transaction.value
razvantomegea marked this conversation as resolved.
Show resolved Hide resolved
razvantomegea marked this conversation as resolved.
Show resolved Hide resolved
})}
</span>
</p>
<p>
<Label>Gas price: </Label>
Expand Down
Loading