-
Notifications
You must be signed in to change notification settings - Fork 79
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
razvantomegea
wants to merge
122
commits into
development
Choose a base branch
from
rt/feature/sdk-dapp-core
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
4721146
Migrate
razvantomegea 909c58d
Login and sign message
razvantomegea 2e891ee
Ping transactions
razvantomegea 8b44297
Removed ping pong abi and service
razvantomegea d0e74e8
Batch transactions
razvantomegea 1347c1a
Transactons
razvantomegea 51731f8
Added transaction interpretation helpers
razvantomegea 45b67c7
Added transaction interpretation UI and helpers
razvantomegea 67893ec
Added transaction interpretation UI and helpers
razvantomegea 7063ab9
fix build
razvantomegea bf45f4e
Fix build
razvantomegea dae68f4
Refactor
razvantomegea e7e0abd
Added reactive store subscription
razvantomegea e2f9072
Fix
razvantomegea 37f11bc
Update versions
arhtudormorar cdc8f15
Improve useStore
arhtudormorar f26a5d6
Local working
arhtudormorar 2b25485
Work on reactivity
arhtudormorar 34b4eb7
Removed logs
razvantomegea 9ff7517
Track transactions
razvantomegea f8bb725
Use selector from sdk-dapp-core
arhtudormorar f85cc39
Remove unused
arhtudormorar dbcdd4b
Fix rerenders
arhtudormorar 675c8a2
Remove unused
arhtudormorar aaa76e9
Remove dependecy
arhtudormorar 8ace13f
Added formatAmount
razvantomegea 28b71f7
Integrate hooks
arhtudormorar 85fcc56
Upgrade sdk-dapp-core
arhtudormorar 2406187
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/integrate-hooks
arhtudormorar d2bce86
Merge pull request #270 from multiversx/tm/feature/integrate-hooks
arhtudormorar 768aed0
remove selector
arhtudormorar 85326cc
Remove unused
arhtudormorar 092bda2
Bring back useSendBatchTransaction
arhtudormorar 6cdd470
Restore features
arhtudormorar 2c7cee3
Merge pull request #271 from multiversx/tm/feature/restore-widgets
arhtudormorar 48e5532
Added FormatAmount.tsx
razvantomegea 8caa0a5
Added FormatAmount.tsx
razvantomegea b0a8ba1
Remove unused hooks
arhtudormorar 1ee026f
Custom provider implementation (#272)
arhtudormorar 7df59ca
Improve-in-memory-provider (#274)
arhtudormorar dfe11c2
add toast lifetime (#275)
DanutIlie 9c48535
Added transactions table from sdk-dapp-core/ui (#273)
razvantomegea da161fa
use react output (#279)
DanutIlie 187c7d1
Transactions table (#278)
razvantomegea c9e7783
Fixed build and added missing UI elements (#280)
razvantomegea 97ca156
Fixed build and lint issues
razvantomegea dc5f52f
Fix
razvantomegea 415b8ef
Fixed lint and build
razvantomegea afab2a2
Merged development
razvantomegea 5b91d19
Fixed build
razvantomegea 9bbdb0f
Added sdk-core back
razvantomegea 3d2ed82
Fixed import
razvantomegea 5667113
Merge pull request #281 from multiversx/rt/fix/build-and-lint
razvantomegea bc806b8
Merge branch 'development' into rt/feature/sdk-dapp-core
razvantomegea fee1781
Remove unnecessary refresh account (#283)
DanutIlie e243a6e
Refactor
razvantomegea 5dd6f8f
Renamed props type
razvantomegea 87db609
Refactor
razvantomegea c17be28
Refactor and comments (#284)
razvantomegea 68aed91
Added back batch transactions functions (#286)
razvantomegea f4954e7
Fix
razvantomegea 4099be3
Refactor imports
razvantomegea e873509
Conflicts
razvantomegea e8eeb9f
Merge branch 'development' into rt/feature/sdk-dapp-core
razvantomegea 2ccb759
Revert
razvantomegea f2814ae
Refactor explorerlink
razvantomegea 2fa946e
Fixed build and added AuthenticatedRoutesWrapper
razvantomegea dc51e44
Revert AuthenticatedRouteWrapper
razvantomegea 1258568
Fixed build
razvantomegea e886857
Tm/feature/sdk-dapp-core/merge-1 (#291)
arhtudormorar cb96ca1
Fix sort imports
razvantomegea 60a18ab
Merge branch 'development' into rt/fix/sort-imports
razvantomegea 91dde85
Merge pull request #295 from multiversx/rt/fix/sort-imports
arhtudormorar 99b1ed5
Fixed sort exports
razvantomegea bd95e23
Merge development
razvantomegea 3886c39
Merge pull request #296 from multiversx/rt/fix/sort-imports
arhtudormorar 40277be
Revert import type
razvantomegea 2936b50
Move components
arhtudormorar 289a178
lint
arhtudormorar 198c894
Added PageNotFound
razvantomegea 73a92ac
Move components (#298)
arhtudormorar 973a5ee
Merge development
razvantomegea 14bc613
Merge pull request #300 from multiversx/rt/fix/import-type
arhtudormorar 5de2dc2
Merge branch 'development' into rt/fix/merge-dev
razvantomegea 45b833a
Merge pull request #304 from multiversx/rt/fix/merge-dev
razvantomegea b6805e0
Merge dev
razvantomegea 88dd8bd
Updates
arhtudormorar 7420888
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/sdk-dapp-core…
arhtudormorar 6a06d9a
Merge pull request #307 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar 51ee890
Updated SignSuccess
razvantomegea ca1a82a
Minor refactor
arhtudormorar 34c307c
Minor changes
arhtudormorar 9848014
Merge dev
razvantomegea 114d233
Tm/feature/sdk dapp core/refactor 2 (#309)
arhtudormorar 5c3a1bd
Merge pull request #310 from multiversx/rt/fix/merge-dev
razvantomegea 77a0f00
Merge branch 'development' into rt/feature/sdk-dapp-core
arhtudormorar 687245b
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/sdk-dapp-core…
arhtudormorar cb2ec7b
Minor refactor
arhtudormorar 4b6f917
Refactor
razvantomegea e73457d
Fix errors
arhtudormorar cd8e631
Merge pull request #312 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar 5dd0773
Merge branch 'rt/feature/sdk-dapp-core' into rt/fix/refactor
razvantomegea 29834bb
Revert
razvantomegea 03aeea0
Revert
razvantomegea b07f1a6
Merge pull request #311 from multiversx/rt/fix/refactor
arhtudormorar 73c3b74
Some updates
arhtudormorar daf36d0
Merge branch 'rt/feature/sdk-dapp-core' into tm/feature/sdk-dapp-core…
arhtudormorar c007402
Some updates (#313)
arhtudormorar fd23313
Implement changes
arhtudormorar fedff79
Merge branch 'development' into tm/feature/sdk-dapp-core/refactor-2
arhtudormorar a73aeb0
Merge branch 'development' into rt/feature/sdk-dapp-core
arhtudormorar 2bf0a2d
Update README
arhtudormorar 434c596
Merge pull request #315 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar 9ca1fcd
Added missing code
razvantomegea 1335f5b
Merge pull request #317 from multiversx/rt/fix/bring-back-code
arhtudormorar 5d9430a
Remove immer (#316)
arhtudormorar 3a757c2
Latest versions
arhtudormorar 50271da
added sdk-dapp-core-ui to optimizeDeps
DanutIlie a11280e
Added axios interceptors (#318)
razvantomegea 98cfc6d
Merge branch 'development' into rt/feature/sdk-dapp-core
arhtudormorar 33e46b3
Merge pull request #320 from multiversx/tm/feature/sdk-dapp-core/refa…
arhtudormorar 017714d
Added unlock panel (#321)
DanutIlie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,28 @@ | ||
import { Route, BrowserRouter as Router, Routes } from 'react-router-dom'; | ||
import { Layout } from 'components'; | ||
import { | ||
apiTimeout, | ||
environment, | ||
sampleAuthenticatedDomains, | ||
walletConnectV2ProjectId | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use this walletConnectV2ProjectId @razvantomegea |
||
} from 'config'; | ||
import { | ||
AxiosInterceptorContext, // using this is optional | ||
DappProvider, | ||
NotificationModal, | ||
SignTransactionsModals, | ||
TransactionsToastList | ||
// uncomment this to use the custom transaction tracker | ||
// TransactionsTracker | ||
} from 'lib'; | ||
import { RouteNamesEnum } from 'localConstants'; | ||
import { PageNotFound } from 'pages'; | ||
import { PageNotFound } from 'pages/PageNotFound/PageNotFound'; | ||
import { routes } from 'routes'; | ||
import { BatchTransactionsContextProvider } from 'wrappers'; | ||
|
||
const AppContent = () => { | ||
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> | ||
<Layout> | ||
<TransactionsToastList /> | ||
<NotificationModal /> | ||
<SignTransactionsModals /> | ||
<Routes> | ||
{routes.map((route) => ( | ||
<Route | ||
path={route.path} | ||
key={`route-key-'${route.path}`} | ||
element={<route.component />} | ||
/> | ||
))} | ||
<Route path='*' element={<PageNotFound />} /> | ||
arhtudormorar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Routes> | ||
</Layout> | ||
</AxiosInterceptorContext.Listener> | ||
</DappProvider> | ||
); | ||
}; | ||
import { AxiosInterceptors, BatchTransactionsContextProvider } from 'wrappers'; | ||
import { Layout } from './components'; | ||
|
||
export const App = () => { | ||
return ( | ||
<AxiosInterceptorContext.Provider> | ||
<AxiosInterceptorContext.Interceptor | ||
authenticatedDomains={sampleAuthenticatedDomains} | ||
> | ||
<Router> | ||
<BatchTransactionsContextProvider> | ||
<AppContent /> | ||
</BatchTransactionsContextProvider> | ||
</Router> | ||
</AxiosInterceptorContext.Interceptor> | ||
</AxiosInterceptorContext.Provider> | ||
<Router> | ||
<AxiosInterceptors> | ||
<BatchTransactionsContextProvider> | ||
<Layout> | ||
<Routes> | ||
{routes.map((route) => ( | ||
<Route | ||
key={`route-key-'${route.path}`} | ||
path={route.path} | ||
element={<route.component />} | ||
/> | ||
))} | ||
<Route path='*' element={<PageNotFound />} /> | ||
</Routes> | ||
</Layout> | ||
</BatchTransactionsContextProvider> | ||
</AxiosInterceptors> | ||
</Router> | ||
); | ||
}; |
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,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> | ||
); | ||
}; |
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 @@ | ||
export * from './Loader'; |
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,43 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { | ||
ITransactionsTableRow, | ||
ServerTransactionType, | ||
TransactionsTableController, | ||
TransactionsTableSDK, | ||
useGetAccount, | ||
useGetNetworkConfig | ||
} from 'lib'; | ||
|
||
interface TransactionsTablePropsType { | ||
transactions?: ServerTransactionType[]; | ||
} | ||
|
||
export const TransactionsTable = ({ | ||
transactions = [] | ||
}: TransactionsTablePropsType) => { | ||
const { address } = useGetAccount(); | ||
const { network } = useGetNetworkConfig(); | ||
const [processedTransaction, setProcessedTransactions] = useState< | ||
ITransactionsTableRow[] | ||
>([]); | ||
|
||
useEffect(() => { | ||
processTransactions(); | ||
}, []); | ||
|
||
const processTransactions = async () => { | ||
const transactionsData = | ||
await TransactionsTableController.processTransactions({ | ||
address, | ||
arhtudormorar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
egldLabel: network.egldLabel, | ||
explorerAddress: network.explorerAddress, | ||
transactions | ||
}); | ||
|
||
setProcessedTransactions( | ||
transactionsData as unknown as ITransactionsTableRow[] | ||
); | ||
}; | ||
|
||
return <TransactionsTableSDK transactions={processedTransaction} />; | ||
}; |
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 @@ | ||
export * from './TransactionsTable'; |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bring back or use in promise.all @razvantomegea