Skip to content

Commit 70090cf

Browse files
committed
updates
1 parent 8f30c88 commit 70090cf

19 files changed

+1432
-1387
lines changed

.env.example

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# Public variables (exposed on the frontend)
33
# =============================================
44

5-
# Elrond chain (can be devnet, testnet, mainnet)
6-
NEXT_PUBLIC_ELROND_CHAIN = devnet
5+
# MultiversX chain (can be devnet, testnet, mainnet)
6+
NEXT_PUBLIC_MULTIVERSX_CHAIN = devnet
77

88
# This is the masked/proxied public API endpoint
99
# only current instance of the Dapp can use it if only API_ALLOWED_DAPP_HOST is set
10-
NEXT_PUBLIC_ELROND_API = /api/elrond
10+
NEXT_PUBLIC_MULTIVERSX_API = /api/multiversx
1111

1212
# This is basically the main domain of your dapp
1313
NEXT_PUBLIC_DAPP_HOST = http://localhost:3000
@@ -16,9 +16,9 @@ NEXT_PUBLIC_DAPP_HOST = http://localhost:3000
1616
# Private variables (used on backend)
1717
# =============================================
1818

19-
# Your main Elrond API can be a custom one. There won't be a possibility
20-
# to reveal this endpoint, it will be masked by NEXT_PUBLIC_ELROND_API
21-
ELROND_CUSTOM_API = https://devnet-api.elrond.com
19+
# Your main MultiversX API can be a custom one. There won't be a possibility
20+
# to reveal this endpoint, it will be masked by NEXT_PUBLIC_MULTIVERSX_API
21+
MULTIVERSX_CUSTOM_API = https://devnet-api.elrond.com
2222

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

CHANGELOG.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
### [2.2.2](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.2.2) (2022-10-30)
1+
### [3.0.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v2.3.0) (2022-11-16)
2+
- dependencies updates
3+
- first phase of 'rebranding' into MultiversX ;)
4+
- **Breaking**: `useElrondNetworkSync` is now `useNetworkSync`
5+
6+
### [2.2.2](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v2.2.2) (2022-10-30)
27
- dependencies updates, also Next 13, changes in the routing will be introduced later. Waits for new Next 13 docs to be completed.
38

4-
### [2.2.1](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.2.1) (2022-10-10)
9+
### [2.2.1](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v2.2.1) (2022-10-10)
510
- bugfix for the wrong usage of the Chakra Factory on CardWrapper and FlexCardWrapper components. Thanks to @janniksam for reporting that
611

7-
### [2.2.0](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.2.0) (2022-10-09)
12+
### [2.2.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v2.2.0) (2022-10-09)
813
- dependencies updates (Next, erdjs, etc.)
914

10-
### [2.1.0](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.1.0) (2022-09-04)
15+
### [2.1.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v2.1.0) (2022-09-04)
1116
- new `useApiCall` hook, check the readme for more info
1217

13-
### [2.0.1](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.0.1) (2022-08-13)
18+
### [2.0.1](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v2.0.1) (2022-08-13)
1419
- fix problems with rerendering (wrong memo usage)
1520
- update dependencies
1621

17-
### [2.0.0](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.0.0) (2022-08-01)
22+
### [2.0.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v2.0.0) (2022-08-01)
1823
- Nextjs update
1924
- React update
2025
- erdjs libraries update
@@ -25,8 +30,8 @@
2530
- ts types improvements
2631
- switched to MIT license (erdjs libs are now MIT too)
2732

28-
### [1.1.0](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v1.1.0) (2022-06-19)
33+
### [1.1.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v1.1.0) (2022-06-19)
2934
- added HW provider
3035

31-
### [1.0.0](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v1.0.0) (2022-05-15)
36+
### [1.0.0](https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v1.0.0) (2022-05-15)
3237
- initial code

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### NextJS Dapp Template
22

3-
- [elrond-nextjs-dapp.netlify.com](https://elrond-nextjs-dapp.netlify.com)
3+
- [multiversx-nextjs-dapp.netlify.com](https://multiversx-nextjs-dapp.netlify.com)
44

55
Nextjs alternative to the [dapp-core](https://github.com/ElrondNetwork/dapp-core).
66
Based on [Elven Tools Dapp](https://www.elven.tools/docs/minter-dapp-introduction.html).
@@ -12,7 +12,7 @@ It has straightforward and complete functionality.
1212

1313
- it works on Nextjs
1414
- it uses erdjs 11.* without the dapp-core library.
15-
- it uses backed side redirections to hide the API endpoint. The only exposed one is `/api/elrond` and it is used only be the dapp internally
15+
- it uses backed side redirections to hide the API endpoint. The only exposed one is `/api/multiversx` and it is used only be the dapp internally
1616
- it uses the .env file - there is an example in the repo (for all configuration, also for the demo config)
1717
- it uses chakra-ui
1818

@@ -35,7 +35,7 @@ There are much more hooks and tools, but most of them are already used in the on
3535

3636
The code samples are not ready to copy and paste. Please search them in the code.
3737

38-
#### useElrondNetworkSync()
38+
#### useNetworkSync()
3939

4040
The hook is responsible for synchronizing the network on each refresh. It should be used in the root component. Here is the `_app.tsx`.
4141

@@ -44,10 +44,10 @@ Why not the context wrapper? Because context wrappers with auth state data check
4444
This way, you can check the auth state in chosen places. You are not forced to do this constantly for the whole document tree.
4545

4646
```jsx
47-
import { useElrondNetworkSync } from '../hooks/auth/useElrondNetworkSync';
47+
import { useNetworkSync } from '../hooks/auth/useNetworkSync';
4848

4949
const NextJSDappTemplate = ({ Component, pageProps }: AppProps) => {
50-
useElrondNetworkSync();
50+
useNetworkSync();
5151
return (
5252
<ChakraProvider theme={theme}>
5353
<Component {...pageProps} />
@@ -186,7 +186,7 @@ const { loginMethod, expires, loginToken, signature } = useLoginInfo();
186186

187187
#### useApiCall()
188188

189-
The hook provides a convenient way of doing custom API calls unrelated to transactions or smart contract queries. By default it will use Elrond API endpoint. But it can be any type of API, not only Elrond API. In that case you would need to pass the `{ baseEndpoint: "https://some-api.com" }` in options
189+
The hook provides a convenient way of doing custom API calls unrelated to transactions or smart contract queries. By default it will use MultiversX API endpoint. But it can be any type of API, not only MultiversX API. In that case you would need to pass the `{ baseEndpoint: "https://some-api.com" }` in options
190190

191191
```jsx
192192
const { data, isLoading, isValidating, fetch, error } = useApiCall<Token[]>({
@@ -203,9 +203,9 @@ The hook uses `swr` and native `fetch` under the hood.
203203

204204
### Working with the API
205205

206-
The API endpoint is proxied on the backend side. The only public API endpoint is `/api/elrond`. This is useful when you don't want to show the API endpoint because, for example, you use the paid ones. Also, there is an option to block the `/api/elrond` endpoint to be used only within the Dapp, even previewing it in the browser won't be possible.
206+
The API endpoint is proxied on the backend side. The only public API endpoint is `/api/multiversx`. This is useful when you don't want to show the API endpoint because, for example, you use the paid ones. Also, there is an option to block the `/api/multiversx` endpoint to be used only within the Dapp, even previewing it in the browser won't be possible.
207207

208-
You can use `API_ALLOWED_DAPP_HOST` in the .env file to enable `/api/elrond` restrictions. If you don't want to restrict it, you can remove that variable.
208+
You can use `API_ALLOWED_DAPP_HOST` in the .env file to enable `/api/multiversx` restrictions. If you don't want to restrict it, you can remove that variable.
209209

210210
In the `middleware.ts`, you'll find the logic for the API restrictions. And in the `next.config.js`, you'll find the configuration for rewrites of the API.
211211

@@ -224,12 +224,12 @@ Here are all variables:
224224
# Public variables (exposed on the frontend)
225225
# =============================================
226226

227-
# Elrond chain (can be devnet, testnet, mainnet)
228-
NEXT_PUBLIC_ELROND_CHAIN = devnet
227+
# MultiversX chain (can be devnet, testnet, mainnet)
228+
NEXT_PUBLIC_MULTIVERSX_CHAIN = devnet
229229

230230
# This is the masked/proxied public API endpoint
231231
# only current instance of the Dapp can use it if only API_ALLOWED_DAPP_HOST is set
232-
NEXT_PUBLIC_ELROND_API = /api/elrond
232+
NEXT_PUBLIC_MULTIVERSX_API = /api/multiversx
233233

234234
# This is basically the main domain of your dapp
235235
NEXT_PUBLIC_DAPP_HOST = http://localhost:3000
@@ -238,9 +238,9 @@ NEXT_PUBLIC_DAPP_HOST = http://localhost:3000
238238
# Private variables (used on the backend)
239239
# =============================================
240240

241-
# Your main Elrond API can be a custom one. There won't be a possibility
242-
# to reveal this endpoint, it will be masked by NEXT_PUBLIC_ELROND_API
243-
ELROND_CUSTOM_API = https://devnet-api.elrond.com
241+
# Your main MultiversX API can be a custom one. There won't be a possibility
242+
# to reveal this endpoint, it will be masked by NEXT_PUBLIC_MULTIVERSX_API
243+
MULTIVERSX_CUSTOM_API = https://devnet-api.elrond.com
244244

245245
# Only this host will be allowed to consume the API (optional)
246246
# It will work only inside the Dapp, no one will be able to use the endpoint, even in browser
@@ -272,7 +272,7 @@ NEXT_PUBLIC_EGLD_TRANSFER_AMOUNT = 0.001
272272

273273
All variables which start with `NEXT_PUBLIC_` will be readable on the frontend side of the dapp. So please don't use them for any secret keys and data. If you need something to be available only on the backend side, don't use the `NEXT_PUBLIC_` prefix.
274274

275-
You can set up the chain type here. Use `NEXT_PUBLIC_ELROND_CHAIN` to set devnet, testnet or mainnet.
275+
You can set up the chain type here. Use `NEXT_PUBLIC_MULTIVERSX_CHAIN` to set devnet, testnet or mainnet.
276276

277277
Each hosting provider will have a different way of doing that. We will take a look at how Netlify is doing that below.
278278

@@ -306,12 +306,12 @@ If you would like to test other templates:
306306
Dapps using it (send the links if you used it, use issues here on GitHub):
307307

308308
- [Elven Tools Dapp](https://dapp-demo.elven.tools/)
309-
- [Elrond ESDT Faucet Dapp](https://devnet-elrond-esdt-faucet.netlify.app/)
309+
- [MultiversX ESDT Faucet Dapp](https://devnet-elrond-esdt-faucet.netlify.app/)
310310

311-
Compact Elrond SDK for browsers (no build steps required)
311+
Compact MultiversX SDK for browsers (no build steps required)
312312

313313
- [Elven.js](https://www.elvenjs.com)
314314

315315
### Contact
316316

317-
- [Elrond's Dev Guild](https://github.com/ElrondDevGuild)
317+
- [xDevGuild](https://github.com/xdevguild)

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/out';
1+
import { TokenPayment } from '@elrondnetwork/erdjs';
22
import { Text, Link } from '@chakra-ui/react';
33
import { shortenHash } from '../../utils/shortenHash';
44
import { useAccount } from '../../hooks/auth/useAccount';

components/tools/LedgerAccountsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const LedgerAccountsList: FC<LedgerAccountsListProps> = ({
5454
mounted.current
5555
) {
5656
setError(
57-
'Not connected, please check the connection and make sure that you have the Elrond app opened on your Ledger device.'
57+
'Not connected, please check the connection and make sure that you have the MultiversX app opened on your Ledger device.'
5858
);
5959
} else {
6060
setError(`Error: ${errorParse(e)}`);

components/ui/Footer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const Footer = () => {
1616
fontWeight="normal"
1717
textAlign="center"
1818
>
19-
<Box>Elrond NextJS Dapp Template (v{`${packageJson.version}`})</Box>
19+
<Box>MultiversX NextJS Dapp Template (v{`${packageJson.version}`})</Box>
2020
<Box fontSize="xs" fontWeight="hairline">
2121
All for free. Please support the project. Give it credit and tell the
2222
world about it. Attribution is not required but welcomed in the form
@@ -31,11 +31,11 @@ export const Footer = () => {
3131
<Text
3232
as="a"
3333
color="dappTemplate.color3.base"
34-
href="https://github.com/ElrondDevGuild"
34+
href="https://github.com/zdevguild"
3535
target="_blank"
3636
rel="noopener noreferrer nofollow"
3737
>
38-
{"Elrond's Dev Guild"}
38+
{'xDevGuild'}
3939
</Text>
4040
<Text ml={2} mr={2}>
4141
{' '}

components/ui/Logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const Logo = () => {
1919
fontWeight="black"
2020
color="dappTemplate.white"
2121
>
22-
Elrond Dapp Template
22+
MultiversX Dapp Template
2323
</Text>
2424
</Box>
2525
</NextLink>

components/ui/MetaHead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const MetaHead: FC<MetaHeadProps> = memo(
1818
name="description"
1919
content={metaDescription || defaultMetaTags.description}
2020
/>
21-
<meta name="author" content="Elrond NextJS Dapp Template"></meta>
21+
<meta name="author" content="MultiversX NextJS Dapp Template"></meta>
2222
<meta property="og:type" content="website" />
2323
<meta
2424
property="og:title"

components/ui/SocialMediaIcons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const SocialMediaIcons = () => {
55
return (
66
<Box display="flex" alignItems="center" gap={3}>
77
<SocialIcon
8-
url="https://github.com/ElrondDevGuild/nextjs-dapp-template"
8+
url="https://github.com/xdevguild/nextjs-dapp-template"
99
bgColor="#fff"
1010
style={{ width: 30, height: 30 }}
1111
/>

config/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const dappHostname = process.env.NEXT_PUBLIC_DAPP_HOST;
55

66
// HTML metata and og tags, default values for MetaHead.tsx component
77
export const defaultMetaTags = {
8-
title: 'Elrond NextJS dapp demo - Elrond blockchain',
9-
description: 'Open source Dapp template for the Elrond blockchain.',
8+
title: 'MultiversX NextJS dapp demo - MultiversX blockchain',
9+
description: 'Open source Dapp template for the MultiversX blockchain.',
1010
image: `${dappHostname}/og-image.png`,
1111
};

0 commit comments

Comments
 (0)