diff --git a/.eslintrc.json b/.eslintrc.json
index 85c8e9d37..be5d8d096 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -12,7 +12,6 @@
"@nrwl/nx",
"@typescript-eslint",
"prettier",
- "react",
"react-hooks"
],
"overrides": [
@@ -40,7 +39,6 @@
"plugin:@nrwl/nx/typescript",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
- "plugin:react/recommended",
"prettier"
],
"rules": {
@@ -112,15 +110,7 @@
}
],
"strict": ["error", "global"],
- "valid-jsdoc": "error",
- "react/jsx-uses-react": "error",
- "react/react-in-jsx-scope": "error",
- "react/jsx-no-target-blank": "off",
- "react/no-unescaped-entities": "off",
- "react/prop-types": "off",
- "react-hooks/rules-of-hooks": "error",
- "react-hooks/exhaustive-deps": "warn",
- "react/display-name": "off"
+ "valid-jsdoc": "error"
}
},
{
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 203c11aa5..4c4d4f2f4 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,36 +1,8 @@
-# Description
+Thanks for taking the time to submit a pull request!
-Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
+If you haven't already, be sure to take a look at the [CONTRIBUTING](https://github.com/near/wallet-selector/blob/main/CONTRIBUTING.md) documentation to get up to speed with the practices in this repository.
-Closes # (issue)
-
+When you're ready, switch to the "Preview" tab to select an applicable template:
-
-# Checklist:
-
-- [ ] I have performed a self-review of my own code
-- [ ] I have commented my code, particularly in hard-to-understand areas
-- [ ] I have made corresponding changes to the documentation
-- [ ] My changes generate no new warnings
-
-
-# Type of change. This type of change is the main reason for the PR.
-
-- [ ] FIX - a PR of this type patches a bug.
-- [ ] FEATURE - a PR of this type introduces a new feature.
-- [ ] BUILD - a PR of this type introduces build changes.
-- [ ] CI - a PR of this type introduces CI changes.
-- [ ] DOCS - a PR of this type introduces DOCS improvement.
-- [ ] STYLE - a PR of this type introduces style changes.
-- [ ] REFACTOR - a PR of this type introduces refactoring.
-- [ ] PERFORMANCE - a PR of this type introduces performance changes.
-- [ ] TEST - a PR of this type adds more tests.
-- [ ] CHORE - a PR introduces other changes than the specified above.
-
-
-# Breaking changes
-
-
-- [ ] BREAKING CHANGE - SPECIFY: _______
-- [ ] NO BREAKING CHANGE - this PR doesn't contain any breaking changes and it's backwards compatible
-
+- [General template (most common)](?expand=1&template=general.md)
+- [Wallet integration template](?expand=1&template=wallet_integration.md)
diff --git a/.github/PULL_REQUEST_TEMPLATE/general.md b/.github/PULL_REQUEST_TEMPLATE/general.md
new file mode 100644
index 000000000..648aecd09
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/general.md
@@ -0,0 +1,25 @@
+# Description
+
+Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
+
+# Checklist:
+
+- [ ] I have performed a self-review of my own code
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] I have made corresponding changes to the documentation
+- [ ] My changes generate no new warnings
+
+
+# Type of change.
+
+- [ ] FIX - a PR of this type patches a bug.
+- [ ] FEATURE - a PR of this type introduces a new feature.
+- [ ] BUILD - a PR of this type introduces build changes.
+- [ ] CI - a PR of this type introduces CI changes.
+- [ ] DOCS - a PR of this type introduces DOCS improvement.
+- [ ] STYLE - a PR of this type introduces style changes.
+- [ ] REFACTOR - a PR of this type introduces refactoring.
+- [ ] PERFORMANCE - a PR of this type introduces performance changes.
+- [ ] TEST - a PR of this type adds more tests.
+- [ ] CHORE - a PR introduces other changes than the specified above.
+
diff --git a/.github/PULL_REQUEST_TEMPLATE/wallet_integration.md b/.github/PULL_REQUEST_TEMPLATE/wallet_integration.md
new file mode 100644
index 000000000..f5e1ebb41
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/wallet_integration.md
@@ -0,0 +1,11 @@
+# Description
+
+Please include a summary of the wallet and how users can install it. Be sure to take a look at our guide on [Custom Wallets](https://github.com/near/wallet-selector/blob/main/packages/core/docs/guides/custom-wallets.md) to understand core concepts when integrating with Wallet Selector.
+
+# Checklist:
+
+- [ ] I have performed a self-review of my own code
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] I have made corresponding changes to the documentation
+- [ ] My changes generate no new warnings
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ed7c8f052..5c969b454 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -15,25 +15,59 @@ yarn nx run [project][:target][:configuration] [options, ...]
yarn nx r [project][:target][:configuration] [options, ...]
```
-In order to run a specific example, make sure you build the UI library beforehand and on each modification by running:
+In order to run a specific example, make sure you build the packages beforehand by running:
```bash
-yarn build # build core package
+yarn build:all # builds all packages
yarn nx serve react # run the react example
yarn nx serve angular # run the angular example
```
-Build and deploy react example
+> Note: [`modal-ui`](/packages/modal-ui) package must be re-build after every change in the source files of this package `yarn nx run modal-ui:build`
+
+
+Build and deploy angular example
```bash
-yarn nx build react # build the react example
-yarn nx deploy react # deploys react example to gh-pages
+yarn nx build angular # build the angular example
+yarn nx deploy angular # deploys angular example to gh-pages
```
+
+# Branching
+
+In this project there are two important branches `main` and `dev` branch. Pushing or committing directly in these two branches is forbidden.
+
+### Main branch
+
+This is the default branch and will be equal the latest official release.
+
+### Dev Branch
+
+This is the branch for development used by the team and/or other contributors from the community.
+New features, fixes and other improvements are first implemented and tested in this
+branch.
+When adding new features/fixes team members must always create a new branch locally based on latest changes of `dev` branch.
+When your work is ready a merge request should be opened from your branch to `dev`. When your PR is reviewed and approved then it can be merged.
+
+### Other branches
+
+Except `main` and `dev` branch other branches are work in progress by the team or related to the open PR(s).
+
+# Release Process
+
+Once the planned work has been finished and the set date has arrived a merge request from `dev` to `main` should be made.
+After merging only two steps remain:
+ - Publish packages to NPM.
+ - Draft release in Github.
+
+Since `main` is the default branch of this project in case of regular release it will be always equal to the latest release. In case of a `pre-release` a specific branch will be linked to the `pre-release` version(tag).
+
# Listing Third Party Wallet on Wallet Selector
Criteria for Including New Wallets for Wallet Selector
+
# Product Criteria:
A wallet project must have comply the following product criteria to listed on Wallet Selector.
diff --git a/README.md b/README.md
index bad7a8829..a8e8f72a1 100644
--- a/README.md
+++ b/README.md
@@ -7,19 +7,28 @@ NEAR Wallet Selector makes it easy for users to interact with your dApp by provi
- [Sender](https://www.npmjs.com/package/@near-wallet-selector/sender) - Injected wallet.
- [Math Wallet](https://www.npmjs.com/package/@near-wallet-selector/math-wallet) - Injected wallet.
- [Nightly](https://www.npmjs.com/package/@near-wallet-selector/nightly) - Injected wallet.
+- [Meteor Wallet](https://www.npmjs.com/package/@near-wallet-selector/meteor-wallet) - Injected wallet.
- [Ledger](https://www.npmjs.com/package/@near-wallet-selector/ledger) - Hardware wallet.
- [WalletConnect](https://www.npmjs.com/package/@near-wallet-selector/wallet-connect) - Bridge wallet.
- [Nightly Connect](https://www.npmjs.com/package/@near-wallet-selector/nightly-connect) - Bridge wallet.
## Preview
-[React](https://reactjs.org/) and [Angular](https://angular.io/) variations of the [Guest Book](https://github.com/near-examples/guest-book/) dApp can be found in the [`examples`](/examples) directory. You can use these to gain a concrete understanding of how to integrate NEAR Wallet Selector into your own dApp.
+[React](https://reactjs.org/) / [Next.js](https://nextjs.org/) and [Angular](https://angular.io/) variations of the [Guest Book](https://github.com/near-examples/guest-book/) dApp can be found in the [`examples`](/examples) directory. You can use these to gain a concrete understanding of how to integrate NEAR Wallet Selector into your own dApp.
![Preview](./images/preview-img.PNG)
## Installation and Usage
-The easiest way to use NEAR Wallet Selector is to install the [`core`](https://www.npmjs.com/package/@near-wallet-selector/core) package from the NPM registry:
+The easiest way to use NEAR Wallet Selector is to install the [`core`](https://www.npmjs.com/package/@near-wallet-selector/core) package from the NPM registry, some packages may require `near-api-js` v0.44.2 or above check them at [`packages`](./packages)
+
+```bash
+# Using Yarn
+yarn add near-api-js@^0.44.2
+
+# Using NPM.
+npm install near-api-js@^0.44.2
+```
```bash
# Using Yarn
@@ -39,9 +48,11 @@ yarn add \
@near-wallet-selector/sender \
@near-wallet-selector/math-wallet \
@near-wallet-selector/nightly \
+ @near-wallet-selector/meteor-wallet \
@near-wallet-selector/ledger \
@near-wallet-selector/wallet-connect \
- @near-wallet-selector/nightly-connect
+ @near-wallet-selector/nightly-connect \
+ @near-wallet-selector/default-wallets
# Using NPM.
npm install \
@@ -50,9 +61,11 @@ npm install \
@near-wallet-selector/sender \
@near-wallet-selector/math-wallet \
@near-wallet-selector/nightly \
+ @near-wallet-selector/meteor-wallet \
@near-wallet-selector/ledger \
@near-wallet-selector/wallet-connect \
- @near-wallet-selector/nightly-connect
+ @near-wallet-selector/nightly-connect \
+ @near-wallet-selector/default-wallets
```
Optionally, you can install our [`modal-ui`](https://www.npmjs.com/package/@near-wallet-selector/modal-ui) package for a pre-built interface that wraps the `core` API and presents the supported wallets:
@@ -75,18 +88,22 @@ import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
+import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
+import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
const selector = await setupWalletSelector({
network: "testnet",
modules: [
+ ...(await setupDefaultWallets()),
setupNearWallet(),
setupMyNearWallet(),
setupSender(),
setupMathWallet(),
setupNightly(),
+ setupMeteorWallet(),
setupLedger(),
setupWalletConnect({
projectId: "c4f79cc...",
diff --git a/examples/angular/project.json b/examples/angular/project.json
index 00725253a..7efe6d95b 100644
--- a/examples/angular/project.json
+++ b/examples/angular/project.json
@@ -57,6 +57,11 @@
"glob": "**/*",
"input": "packages/nightly-connect/assets/",
"output": "assets/"
+ },
+ {
+ "glob": "**/*",
+ "input": "packages/meteor-wallet/assets/",
+ "output": "assets/"
}
],
"styles": ["examples/angular/src/styles.scss"],
@@ -68,7 +73,7 @@
{
"type": "initial",
"maximumWarning": "500kb",
- "maximumError": "1mb"
+ "maximumError": "2mb"
},
{
"type": "anyComponentStyle",
@@ -129,6 +134,12 @@
"jestConfig": "examples/angular/jest.config.js",
"passWithNoTests": true
}
+ },
+ "deploy": {
+ "executor": "@nrwl/workspace:run-script",
+ "options": {
+ "script": "gh-pages -d dist/examples/angular"
+ }
}
},
"tags": []
diff --git a/examples/angular/src/app/app.component.ts b/examples/angular/src/app/app.component.ts
index d64d4a701..be68c6ce4 100644
--- a/examples/angular/src/app/app.component.ts
+++ b/examples/angular/src/app/app.component.ts
@@ -1,14 +1,14 @@
import { Component, OnInit } from "@angular/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import type { WalletSelector, AccountState } from "@near-wallet-selector/core";
+import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
-import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
-import { setupLedger } from "@near-wallet-selector/ledger";
-import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
+import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
+import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupModal } from "@near-wallet-selector/modal-ui";
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
import { CONTRACT_ID } from "../constants";
@@ -43,12 +43,12 @@ export class AppComponent implements OnInit {
network: "testnet",
debug: true,
modules: [
+ ...(await setupDefaultWallets()),
setupNearWallet(),
- setupMyNearWallet(),
setupSender(),
setupMathWallet(),
setupNightly(),
- setupLedger(),
+ setupMeteorWallet(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
diff --git a/examples/angular/src/app/components/content/content.component.html b/examples/angular/src/app/components/content/content.component.html
index 88ca7ffb4..43e57a47c 100644
--- a/examples/angular/src/app/components/content/content.component.html
+++ b/examples/angular/src/app/components/content/content.component.html
@@ -2,6 +2,7 @@
+
diff --git a/examples/angular/src/app/components/content/content.component.ts b/examples/angular/src/app/components/content/content.component.ts
index 62ed199bf..3f4ee7367 100644
--- a/examples/angular/src/app/components/content/content.component.ts
+++ b/examples/angular/src/app/components/content/content.component.ts
@@ -111,6 +111,23 @@ export class ContentComponent implements OnInit, OnDestroy {
alert("Switched account to " + nextAccountId);
}
+ async onVerifyOwner() {
+ const wallet = await this.selector.wallet();
+ try {
+ const owner = await wallet.verifyOwner({
+ message: "test message for verification",
+ });
+
+ if (owner) {
+ alert(`Signature for verification: ${JSON.stringify(owner)}`);
+ }
+ } catch (err) {
+ const message =
+ err instanceof Error ? err.message : "Something went wrong";
+ alert(message);
+ }
+ }
+
subscribeToEvents() {
this.subscription = this.selector.store.observable
.pipe(
diff --git a/examples/react/.babelrc b/examples/react/.babelrc
index 5600712fe..c7d82affe 100644
--- a/examples/react/.babelrc
+++ b/examples/react/.babelrc
@@ -1,13 +1,4 @@
{
- "presets": [
- [
- "@nrwl/react/babel",
- {
- "runtime": "automatic"
- }
- ],
- "@babel/preset-env",
- "@babel/preset-react"
- ],
+ "presets": ["@nrwl/next/babel"],
"plugins": []
}
diff --git a/examples/react/.browserslistrc b/examples/react/.browserslistrc
deleted file mode 100644
index f1d12df4f..000000000
--- a/examples/react/.browserslistrc
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file is used by:
-# 1. autoprefixer to adjust CSS to support the below specified browsers
-# 2. babel preset-env to adjust included polyfills
-#
-# For additional information regarding the format and rule options, please see:
-# https://github.com/browserslist/browserslist#queries
-#
-# If you need to support different browsers in production, you may tweak the list below.
-
-last 1 Chrome version
-last 1 Firefox version
-last 2 Edge major versions
-last 2 Safari major version
-last 2 iOS major versions
-Firefox ESR
-not IE 9-11 # For IE 9-11 support, remove 'not'.
\ No newline at end of file
diff --git a/examples/react/.eslintrc.json b/examples/react/.eslintrc.json
index b4fef957c..2d619e6b3 100644
--- a/examples/react/.eslintrc.json
+++ b/examples/react/.eslintrc.json
@@ -1,10 +1,16 @@
{
- "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
+ "extends": [
+ "plugin:@nrwl/nx/react-typescript",
+ "../../.eslintrc.json",
+ "next",
+ "next/core-web-vitals"
+ ],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
+ "@next/next/no-html-link-for-pages": ["error", "examples/next/pages"],
"no-console": "off"
}
},
@@ -16,5 +22,8 @@
"files": ["*.js", "*.jsx"],
"rules": {}
}
- ]
+ ],
+ "env": {
+ "jest": true
+ }
}
diff --git a/examples/react/src/components/Content.tsx b/examples/react/components/Content.tsx
similarity index 92%
rename from examples/react/src/components/Content.tsx
rename to examples/react/components/Content.tsx
index 6fefda5b7..ca24c5257 100644
--- a/examples/react/src/components/Content.tsx
+++ b/examples/react/components/Content.tsx
@@ -9,13 +9,11 @@ import { Transaction } from "@near-wallet-selector/core";
import type { Account, Message } from "../interfaces";
import { useWalletSelector } from "../contexts/WalletSelectorContext";
import { CONTRACT_ID } from "../constants";
-
import SignIn from "./SignIn";
import Form from "./Form";
import Messages from "./Messages";
const SUGGESTED_DONATION = "0";
-// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const BOATLOAD_OF_GAS = utils.format.parseNearAmount("0.00000000003")!;
const Content: React.FC = () => {
@@ -62,8 +60,6 @@ const Content: React.FC = () => {
useEffect(() => {
// TODO: don't just fetch once; subscribe!
getMessages().then(setMessages);
-
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {
@@ -123,7 +119,6 @@ const Content: React.FC = () => {
methodName: "addMessage",
args: { text: message },
gas: BOATLOAD_OF_GAS,
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
deposit: utils.format.parseNearAmount(donation)!,
},
},
@@ -152,7 +147,6 @@ const Content: React.FC = () => {
text: `${message} (${i + 1}/2)`,
},
gas: BOATLOAD_OF_GAS,
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
deposit: utils.format.parseNearAmount(donation)!,
},
},
@@ -170,12 +164,28 @@ const Content: React.FC = () => {
[selector, accountId]
);
+ const handleVerifyOwner = async () => {
+ const wallet = await selector.wallet();
+ try {
+ const owner = await wallet.verifyOwner({
+ message: "test message for verification",
+ });
+
+ if (owner) {
+ alert(`Signature for verification: ${JSON.stringify(owner)}`);
+ }
+ } catch (err) {
+ const message =
+ err instanceof Error ? err.message : "Something went wrong";
+ alert(message);
+ }
+ };
+
const handleSubmit = useCallback(
async (e: SubmitEvent) => {
e.preventDefault();
// TODO: Fix the typing so that target.elements exists..
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore.
const { fieldset, message, donation, multiple } = e.target.elements;
@@ -227,6 +237,7 @@ const Content: React.FC = () => {
+
{accounts.length > 1 && (
)}
diff --git a/examples/react/src/components/Form.tsx b/examples/react/components/Form.tsx
similarity index 100%
rename from examples/react/src/components/Form.tsx
rename to examples/react/components/Form.tsx
diff --git a/examples/react/src/components/Messages.tsx b/examples/react/components/Messages.tsx
similarity index 100%
rename from examples/react/src/components/Messages.tsx
rename to examples/react/components/Messages.tsx
diff --git a/examples/react/src/components/SignIn.tsx b/examples/react/components/SignIn.tsx
similarity index 100%
rename from examples/react/src/components/SignIn.tsx
rename to examples/react/components/SignIn.tsx
diff --git a/examples/react/src/constants.ts b/examples/react/constants.ts
similarity index 100%
rename from examples/react/src/constants.ts
rename to examples/react/constants.ts
diff --git a/examples/react/src/contexts/WalletSelectorContext.tsx b/examples/react/contexts/WalletSelectorContext.tsx
similarity index 93%
rename from examples/react/src/contexts/WalletSelectorContext.tsx
rename to examples/react/contexts/WalletSelectorContext.tsx
index beed03040..f1791af2c 100644
--- a/examples/react/src/contexts/WalletSelectorContext.tsx
+++ b/examples/react/contexts/WalletSelectorContext.tsx
@@ -4,14 +4,14 @@ import { setupWalletSelector } from "@near-wallet-selector/core";
import type { WalletSelector, AccountState } from "@near-wallet-selector/core";
import { setupModal } from "@near-wallet-selector/modal-ui";
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
+import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
-import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
-import { setupLedger } from "@near-wallet-selector/ledger";
-import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
+import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
+import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { CONTRACT_ID } from "../constants";
declare global {
@@ -41,14 +41,14 @@ export const WalletSelectorContextProvider: React.FC = ({ children }) => {
network: "testnet",
debug: true,
modules: [
+ ...(await setupDefaultWallets()),
setupNearWallet(),
- setupMyNearWallet(),
setupSender(),
setupMathWallet(),
setupNightly(),
- setupLedger(),
+ setupMeteorWallet(),
setupWalletConnect({
- projectId: "c4f79cc...",
+ projectId: "test...",
metadata: {
name: "NEAR Wallet Selector",
description: "Example dApp used by NEAR Wallet Selector",
diff --git a/examples/react/index.d.ts b/examples/react/index.d.ts
new file mode 100644
index 000000000..2ac88d92c
--- /dev/null
+++ b/examples/react/index.d.ts
@@ -0,0 +1,6 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+declare module "*.svg" {
+ const content: any;
+ export const ReactComponent: any;
+ export default content;
+}
diff --git a/examples/react/src/interfaces.ts b/examples/react/interfaces.ts
similarity index 100%
rename from examples/react/src/interfaces.ts
rename to examples/react/interfaces.ts
diff --git a/examples/react/jest.config.js b/examples/react/jest.config.js
deleted file mode 100644
index 80463b576..000000000
--- a/examples/react/jest.config.js
+++ /dev/null
@@ -1,10 +0,0 @@
-module.exports = {
- displayName: "react",
- preset: "../../jest.preset.js",
- transform: {
- "^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nrwl/react/plugins/jest",
- "^.+\\.[tj]sx?$": "babel-jest",
- },
- moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
- coverageDirectory: "../../coverage/examples/react",
-};
diff --git a/examples/react/next-env.d.ts b/examples/react/next-env.d.ts
new file mode 100644
index 000000000..4f11a03dc
--- /dev/null
+++ b/examples/react/next-env.d.ts
@@ -0,0 +1,5 @@
+///
+///
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/examples/react/next.config.js b/examples/react/next.config.js
new file mode 100644
index 000000000..06e572927
--- /dev/null
+++ b/examples/react/next.config.js
@@ -0,0 +1,15 @@
+// eslint-disable-next-line @typescript-eslint/no-var-requires
+const withNx = require("@nrwl/next/plugins/with-nx");
+
+/**
+ * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
+ **/
+const nextConfig = {
+ nx: {
+ // Set this to true if you would like to to use SVGR
+ // See: https://github.com/gregberge/svgr
+ svgr: false,
+ },
+};
+
+module.exports = withNx(nextConfig);
diff --git a/examples/react/pages/_app.tsx b/examples/react/pages/_app.tsx
new file mode 100644
index 000000000..a66b45133
--- /dev/null
+++ b/examples/react/pages/_app.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import "./styles.css";
+import type { AppProps } from "next/app";
+import Head from "next/head";
+import favicon from "../public/favicon.ico";
+
+function MyApp({ Component, pageProps }: AppProps) {
+ return (
+
+
+
+
+
+
+
+ NEAR Guest Book
+
+
+
+
+
+ );
+}
+
+export default MyApp;
diff --git a/examples/react/pages/index.tsx b/examples/react/pages/index.tsx
new file mode 100644
index 000000000..672590f22
--- /dev/null
+++ b/examples/react/pages/index.tsx
@@ -0,0 +1,17 @@
+import type { NextPage } from "next";
+import { Fragment } from "react";
+import { WalletSelectorContextProvider } from "../contexts/WalletSelectorContext";
+import Content from "../components/Content";
+
+const Home: NextPage = () => {
+ return (
+
+
+ Can't found any account associated with this Ledger. Please create a
+ new NEAR account on{" "}
+
+ MyNearWallet
+ {" "}
+ or connect an another Ledger.
+
- Multiple accounts found. Please choose an account per derivation path.
+ We found {accounts.length} accounts on your device. Select the
+ account(s) you wish to connect.