Skip to content

Commit 5a4035d

Browse files
committed
replace mutliversx npm libraries
1 parent 72141ab commit 5a4035d

23 files changed

+2576
-2092
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ NEXT_PUBLIC_MULTIVERSX_CHAIN = devnet
1212
# You have three options:
1313
#
1414
# 1. By commenting this out the dapp will use the default
15-
# MultiversX api endpoint (e.g. https://devnet-api.elrond.com)
15+
# MultiversX api endpoint (e.g. https://devnet-api.multiversx.com)
1616
#
1717
# Note: MULTIVERSX_PRIVATE_API must be removed/commented out.
1818
#
@@ -39,7 +39,7 @@ NEXT_PUBLIC_DAPP_HOST = http://localhost:3000
3939
# This can be either a custom api endpoint or the default MultiversX api endpoint.
4040
# You will have to delete this or comment this out, if you don't wanna
4141
# mask / proxy your MultiversX api endpoint.
42-
MULTIVERSX_PRIVATE_API = https://devnet-api.elrond.com
42+
MULTIVERSX_PRIVATE_API = https://devnet-api.multiversx.com
4343

4444
# Only this host will be allowed to consume the API (optional)
4545
# It will work only inside the Dapp, no one will be able to use the endpoint, even in browser

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### [4.2.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v4.2.0) (2023-01-14)
2+
- rebrand to multiversx (continuation)
3+
- npm packages are replaced
4+
- public api/explorer endpoints are replaced
5+
- update dependencies
6+
17
### [4.1.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v4.1.0) (2022-12-17)
28
- added `ProtectedPageWrapper` component - client side only 'gate keeper', check README.md for more info
39
- fix for the `useApiCall` hook

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- [multiversx-nextjs-dapp.netlify.com](https://multiversx-nextjs-dapp.netlify.com)
44

5-
Nextjs alternative to the [dapp-core](https://github.com/ElrondNetwork/dapp-core).
5+
Nextjs alternative to the [sdk-dapp](https://github.com/multiversx/mx-sdk-dapp).
66
Based on [Elven Tools Dapp](https://www.elven.tools/docs/minter-dapp-introduction.html), (It is developed simultaneously, and at some stages, it will have more core functionality)
77

88
The Dapp is built using Nextjs and a couple of helpful tools.
@@ -58,7 +58,7 @@ const NextJSDappTemplate = ({ Component, pageProps }: AppProps) => {
5858

5959
#### LoginModalButton
6060

61-
The component provides the `Connect` button with the modal, which will contain another three buttons for four different authentication possibilities (Maiar Mobile App, Maiar Defi Wallet - browser extension, Elrond Web Wallet). You should be able to use it in any place on the website.
61+
The component provides the `Connect` button with the modal, which will contain another three buttons for four different authentication possibilities (Maiar Mobile App, Maiar Defi Wallet - browser extension, MultiversX Web Wallet). You should be able to use it in any place on the website.
6262

6363
```jsx
6464
import { LoginModalButton } from '../tools/LoginModalButton';
@@ -164,7 +164,7 @@ const {
164164
**Example** with `SCQueryType.COMPLEX`. This type uses `/vm-values/query`, ABI and ResultParser. The ABI JSON contents are required here. You can copy abi.json and import it in the same place you use useScQuery. Put the abi JSON file wherever you like in the codebase. I chose the `config` directory. See the example below:
165165

166166
```jsx
167-
import { TypedOutcomeBundle } from '@elrondnetwork/erdjs';
167+
import { TypedOutcomeBundle } from '@multiversx/sdk-core';
168168
import abiJSON from '../config/abi.json';
169169

170170
const { data } = useScQuery<TypedOutcomeBundle>({
@@ -289,7 +289,7 @@ NEXT_PUBLIC_MULTIVERSX_CHAIN = devnet
289289
# You have three options:
290290
#
291291
# 1. By commenting this out the dapp will use the default
292-
# MultiversX api endpoint (e.g. https://devnet-api.elrond.com)
292+
# MultiversX api endpoint (e.g. https://devnet-api.multiversx.com)
293293
#
294294
# Note: MULTIVERSX_PRIVATE_API needs to be removed/commented out.
295295
#
@@ -316,7 +316,7 @@ NEXT_PUBLIC_DAPP_HOST = http://localhost:3000
316316
# This can be either a custom api endpoint or the default MultiversX api endpoint.
317317
# You will have to delete this or comment this out, if you don't wanna
318318
# mask / proxy your MultiversX api endpoint.
319-
MULTIVERSX_PRIVATE_API = https://devnet-api.elrond.com
319+
MULTIVERSX_PRIVATE_API = https://devnet-api.multiversx.com
320320

321321
# Only this host will be allowed to consume the API (optional)
322322
# It will work only inside the Dapp, no one will be able to use the endpoint, even in browser
@@ -381,12 +381,12 @@ The same dapp, but with Tailwind instead Chakra UI:
381381
If you would like to test other templates check:
382382

383383
- [erd-next-starter](https://github.com/Elrond-Giants/erd-next-starter)
384-
- [dapp-template](https://github.com/ElrondNetwork/dapp-template)
384+
- [dapp-template]https://github.com/multiversx/mx-template-dapp)
385385

386386
Dapps using the template (send the links if you used it, use issues here on GitHub):
387387

388388
- [Elven Tools Dapp](https://dapp-demo.elven.tools/)
389-
- [MultiversX ESDT Faucet Dapp](https://devnet-elrond-esdt-faucet.netlify.app/)
389+
- [MultiversX ESDT Faucet Dapp](https://devnet-multiversx-esdt-faucet.netlify.app/)
390390

391391
Compact MultiversX SDK for browsers (no build steps required)
392392

components/demo/GetUserDataDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TokenPayment } from '@elrondnetwork/erdjs';
1+
import { TokenPayment } from '@multiversx/sdk-core';
22
import { Text, Link } from '@chakra-ui/react';
33
import { shortenHash } from '../../utils/shortenHash';
44
import { useAccount } from '../../hooks/auth/useAccount';

components/demo/SimpleEGLDTxDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Link, Text } from '@chakra-ui/react';
2-
import { TransactionPayload } from '@elrondnetwork/erdjs';
2+
import { TransactionPayload } from '@multiversx/sdk-core';
33
import { useTransaction } from '../../hooks/core/useTransaction';
44
import { useCallback } from 'react';
55
import { ActionButton } from '../tools/ActionButton';

components/demo/SimpleNftMintDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Link, Text } from '@chakra-ui/react';
2-
import { U32Value, ContractFunction } from '@elrondnetwork/erdjs';
2+
import { U32Value, ContractFunction } from '@multiversx/sdk-core';
33
import { useScTransaction } from '../../hooks/core/useScTransaction';
44
import { useCallback } from 'react';
55
import { ActionButton } from '../tools/ActionButton';

components/tools/LoginComponent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ export const LoginComponent = memo(() => {
4444
isFullWidth
4545
onClick={handleLogin(LoginMethodsEnum.wallet)}
4646
>
47-
Elrond Web Wallet
47+
MultiversX Web Wallet
4848
</ActionButton>
4949
<ActionButton
5050
isFullWidth
5151
onClick={handleLogin(LoginMethodsEnum.extension)}
5252
>
53-
Maiar Browser Extension
53+
MultiversX Browser Extension
5454
</ActionButton>
5555
<ActionButton
5656
isFullWidth
5757
onClick={handleLogin(LoginMethodsEnum.walletconnect)}
5858
>
59-
Maiar Mobile App
59+
xPortal Mobile App
6060
</ActionButton>
6161
<ActionButton isFullWidth onClick={handleLedgerAccountsList}>
6262
Ledger

components/ui/Footer.tsx

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,37 @@ export const Footer = () => {
3737
>
3838
{'xDevGuild'}
3939
</Text>
40-
<Text ml={2} mr={2}>
41-
{' '}
42-
|{' '}
40+
<Text fontWeight="hairline"> | </Text>
41+
<Text
42+
as="a"
43+
color="dappTemplate.color3.base"
44+
href="https://github.com/ElvenTools"
45+
target="_blank"
46+
rel="noopener noreferrer nofollow"
47+
>
48+
{'Elven Tools'}
49+
</Text>
50+
<Text fontWeight="hairline"> | </Text>
51+
<Text
52+
as="a"
53+
color="dappTemplate.color3.base"
54+
href="https://github.com/juliancwirko/elven.js"
55+
target="_blank"
56+
rel="noopener noreferrer nofollow"
57+
>
58+
{'Elven.js'}
59+
</Text>
60+
<Text fontWeight="hairline"> | </Text>
61+
<Text
62+
as="a"
63+
color="dappTemplate.color3.base"
64+
href="https://github.com/xdevguild/buildo-begins"
65+
target="_blank"
66+
rel="noopener noreferrer nofollow"
67+
>
68+
{'Buildo Begins'}
4369
</Text>
70+
<Text fontWeight="hairline"> | </Text>
4471
<Text
4572
as="a"
4673
color="dappTemplate.color3.base"

config/network.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export const networkConfig: Record<string, NetworkType> = {
2020
decimals: '4',
2121
gasPerDataByte: '1500',
2222
walletConnectDeepLink:
23-
'https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/',
23+
'https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/',
2424
walletConnectBridgeAddresses: ['https://bridge.walletconnect.org'],
25-
walletAddress: 'https://devnet-wallet.elrond.com',
25+
walletAddress: 'https://devnet-wallet.multiversx.com',
2626
apiAddress:
27-
process.env.NEXT_PUBLIC_MULTIVERSX_API || 'https://devnet-api.elrond.com',
28-
explorerAddress: 'https://devnet-explorer.elrond.com',
27+
process.env.NEXT_PUBLIC_MULTIVERSX_API || 'https://devnet-api.multiversx.com',
28+
explorerAddress: 'https://devnet-explorer.multiversx.com',
2929
apiTimeout: '4000',
3030
},
3131

@@ -38,13 +38,13 @@ export const networkConfig: Record<string, NetworkType> = {
3838
decimals: '4',
3939
gasPerDataByte: '1500',
4040
walletConnectDeepLink:
41-
'https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/',
41+
'https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/',
4242
walletConnectBridgeAddresses: ['https://bridge.walletconnect.org'],
43-
walletAddress: 'https://testnet-wallet.elrond.com',
43+
walletAddress: 'https://testnet-wallet.multiversx.com',
4444
apiAddress:
4545
process.env.NEXT_PUBLIC_MULTIVERSX_API ||
46-
'https://testnet-api.elrond.com',
47-
explorerAddress: 'https://testnet-explorer.elrond.com',
46+
'https://testnet-api.multiversx.com',
47+
explorerAddress: 'https://testnet-explorer.multiversx.com',
4848
apiTimeout: '4000',
4949
},
5050

@@ -57,12 +57,12 @@ export const networkConfig: Record<string, NetworkType> = {
5757
decimals: '4',
5858
gasPerDataByte: '1500',
5959
walletConnectDeepLink:
60-
'https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/',
60+
'https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/',
6161
walletConnectBridgeAddresses: ['https://bridge.walletconnect.org'],
62-
walletAddress: 'https://wallet.elrond.com',
62+
walletAddress: 'https://wallet.multiversx.com',
6363
apiAddress:
64-
process.env.NEXT_PUBLIC_MULTIVERSX_API || 'https://api.elrond.com',
65-
explorerAddress: 'https://explorer.elrond.com',
64+
process.env.NEXT_PUBLIC_MULTIVERSX_API || 'https://api.multiversx.com',
65+
explorerAddress: 'https://explorer.multiversx.com',
6666
apiTimeout: '4000',
6767
},
6868
};

hooks/auth/useExtensionLogin.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Address, Account } from '@elrondnetwork/erdjs';
2-
import { ExtensionProvider } from '@elrondnetwork/erdjs-extension-provider';
1+
import { Address, Account } from '@multiversx/sdk-core';
2+
import { ExtensionProvider } from '@multiversx/sdk-extension-provider';
33
import { LoginMethodsEnum } from '../../types/enums';
44
import { optionalRedirect } from '../../utils/optionalRedirect';
55
import {
@@ -12,7 +12,7 @@ import { getNewLoginExpiresTimestamp } from '../../utils/expiresAt';
1212
import { useLogout } from './useLogout';
1313
import { Login } from '../../types/account';
1414
import { useLoggingIn } from './useLoggingIn';
15-
import { ApiNetworkProvider } from '@elrondnetwork/erdjs-network-providers';
15+
import { ApiNetworkProvider } from '@multiversx/sdk-network-providers';
1616
import { errorParse } from '../../utils/errorParse';
1717

1818
export const useExtensionLogin = (params?: Login) => {

0 commit comments

Comments
 (0)