diff --git a/test/__snapshots__/make.test.ts.snap b/test/__snapshots__/make.test.ts.snap
index 994969c01..62cde40fd 100644
--- a/test/__snapshots__/make.test.ts.snap
+++ b/test/__snapshots__/make.test.ts.snap
@@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`create 'none' 'next' 'none': --none_next_none--.gitignore 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--.gitignore 1`] = `
[
- "--none_next_none--.gitignore",
+ "--none_next-app_none--.gitignore",
"# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
@@ -43,9 +43,9 @@ next-env.d.ts
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--README.md 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--README.md 1`] = `
[
- "--none_next_none--README.md",
+ "--none_next-app_none--README.md",
"This is a [Next.js](https://nextjs.org/) project bootstrapped with [\`create-next-app\`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
@@ -86,9 +86,9 @@ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deploym
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--jsconfig.json 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--jsconfig.json 1`] = `
[
- "--none_next_none--jsconfig.json",
+ "--none_next-app_none--jsconfig.json",
"{
"compilerOptions": {
"paths": {
@@ -100,9 +100,9 @@ exports[`create 'none' 'next' 'none': --none_next_none--jsconfig.json 1`] = `
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--next.config.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--next.config.js 1`] = `
[
- "--none_next_none--next.config.js",
+ "--none_next-app_none--next.config.js",
"/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
@@ -113,9 +113,9 @@ module.exports = nextConfig;
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--package.json 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--package.json 1`] = `
[
- "--none_next_none--package.json",
+ "--none_next-app_none--package.json",
"{
"name": "hello-near",
"version": "1.0.0",
@@ -163,17 +163,17 @@ exports[`create 'none' 'next' 'none': --none_next_none--package.json 1`] = `
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--public--near.svg 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--public--near.svg 1`] = `
[
- "--none_next_none--public--near.svg",
+ "--none_next-app_none--public--near.svg",
"
",
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--public--near-logo.svg 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--public--near-logo.svg 1`] = `
[
- "--none_next_none--public--near-logo.svg",
+ "--none_next-app_none--public--near-logo.svg",
"
",
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--public--vercel.svg 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--public--vercel.svg 1`] = `
[
- "--none_next_none--public--vercel.svg",
+ "--none_next-app_none--public--vercel.svg",
"",
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--app--app.module.css 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--app--app.module.css 1`] = `
[
- "--none_next_none--src--app--app.module.css",
+ "--none_next-app_none--src--app--app.module.css",
".main {
display: flex;
flex-direction: column;
@@ -469,9 +469,9 @@ exports[`create 'none' 'next' 'none': --none_next_none--src--app--app.module.css
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--app--favicon.ico 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--app--favicon.ico 1`] = `
[
- "--none_next_none--src--app--favicon.ico",
+ "--none_next-app_none--src--app--favicon.ico",
"�PNG
@@ -481,9 +481,9 @@ IHDR @ @ �iq� SIDATx�՛�m�0�?t��2�Fh4A� �
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--app--globals.css 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--app--globals.css 1`] = `
[
- "--none_next_none--src--app--globals.css",
+ "--none_next-app_none--src--app--globals.css",
"@import 'bootstrap';
@import 'bootstrap-icons';
@@ -582,9 +582,9 @@ a {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--app--hello-components--page.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--app--hello-components--page.js 1`] = `
[
- "--none_next_none--src--app--hello-components--page.js",
+ "--none_next-app_none--src--app--hello-components--page.js",
"import dynamic from 'next/dynamic';
import styles from '@/app/app.module.css';
@@ -632,9 +632,9 @@ export default function HelloComponents() {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--app--hello-near--page.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--app--hello-near--page.js 1`] = `
[
- "--none_next_none--src--app--hello-near--page.js",
+ "--none_next-app_none--src--app--hello-near--page.js",
"'use client';
import { DocsCard, HelloComponentsCard } from '@/components/cards';
import { useWallet } from '@/wallets/wallet-selector';
@@ -703,9 +703,9 @@ export default function HelloNear() {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--app--layout.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--app--layout.js 1`] = `
[
- "--none_next_none--src--app--layout.js",
+ "--none_next-app_none--src--app--layout.js",
"'use client';
import './globals.css';
import '@near-wallet-selector/modal-ui/styles.css';
@@ -731,9 +731,9 @@ export default function RootLayout({ children }) {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--app--page.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--app--page.js 1`] = `
[
- "--none_next_none--src--app--page.js",
+ "--none_next-app_none--src--app--page.js",
"import Image from 'next/image';
import styles from './app.module.css';
import { DocsCard, HelloComponentsCard, HelloNearCard } from '@/components/cards';
@@ -775,9 +775,9 @@ export default function Home() {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--components--cards.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--components--cards.js 1`] = `
[
- "--none_next_none--src--components--cards.js",
+ "--none_next-app_none--src--components--cards.js",
"import styles from '../app/app.module.css';
export const DocsCard = () => {
@@ -827,9 +827,9 @@ export const HelloComponentsCard = () => {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--components--navigation.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--components--navigation.js 1`] = `
[
- "--none_next_none--src--components--navigation.js",
+ "--none_next-app_none--src--components--navigation.js",
"import Image from 'next/image';
import Link from 'next/link';
import { useEffect, useState } from 'react';
@@ -869,9 +869,9 @@ export const Navigation = () => {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--components--vm-component.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--components--vm-component.js 1`] = `
[
- "--none_next_none--src--components--vm-component.js",
+ "--none_next-app_none--src--components--vm-component.js",
"'use client';
import { useEffect } from 'react';
import { useInitNear, Widget, EthersProviderContext } from 'near-social-vm';
@@ -902,9 +902,9 @@ export default function Component({ src }) {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--config.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--config.js 1`] = `
[
- "--none_next_none--src--config.js",
+ "--none_next-app_none--src--config.js",
"export const NetworkId = 'testnet';
export const HelloNearContract = {
@@ -929,9 +929,9 @@ export const ComponentMap = {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--wallets--wallet-selector.js 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--wallets--wallet-selector.js 1`] = `
[
- "--none_next_none--src--wallets--wallet-selector.js",
+ "--none_next-app_none--src--wallets--wallet-selector.js",
"import { create as createStore } from 'zustand';
import { distinctUntilChanged, map } from 'rxjs';
import { providers } from 'near-api-js';
@@ -1055,9 +1055,1417 @@ export function useInitWallet({ createAccessKeyFor, networkId }) {
]
`;
-exports[`create 'none' 'next' 'none': --none_next_none--src--wallets--web3-wallet.ts 1`] = `
+exports[`create 'none' 'next-app' 'none': --none_next-app_none--src--wallets--web3-wallet.ts 1`] = `
[
- "--none_next_none--src--wallets--web3-wallet.ts",
+ "--none_next-app_none--src--wallets--web3-wallet.ts",
+ "'use client';
+import type { EIP1193Provider } from '@web3-onboard/core';
+import injectedModule from '@web3-onboard/injected-wallets';
+import ledgerModule from '@web3-onboard/ledger';
+import { init, useConnectWallet } from '@web3-onboard/react';
+import walletConnectModule from '@web3-onboard/walletconnect';
+import { useEffect, useState } from 'react';
+import { singletonHook } from 'react-singleton-hook';
+
+const web3onboardKey = 'web3-onboard:connectedWallets';
+
+const wcV2InitOptions: any = {
+ version: 2,
+ projectId: '72b7b3359ab477e339a070f615806aa6',
+ requiredChains: [1, 56],
+};
+
+const walletConnect = walletConnectModule(wcV2InitOptions);
+const ledger = ledgerModule(wcV2InitOptions);
+const injected = injectedModule();
+
+// initialize Onboard
+export const onboard = init({
+ wallets: [injected, walletConnect, ledger],
+ chains: [
+ {
+ id: 1,
+ token: 'ETH',
+ label: 'Ethereum Mainnet',
+ rpcUrl: 'https://rpc.ankr.com/eth',
+ },
+ {
+ id: 3,
+ token: 'ETH',
+ label: 'Ropsten - Ethereum Testnet',
+ rpcUrl: 'https://rpc.ankr.com/eth_ropsten',
+ },
+ {
+ id: 5,
+ token: 'ETH',
+ label: 'Goerli - Ethereum Testnet',
+ rpcUrl: 'https://rpc.ankr.com/eth_goerli',
+ },
+ {
+ id: 10,
+ token: 'ETH',
+ label: 'Optimism',
+ rpcUrl: 'https://rpc.ankr.com/optimism',
+ },
+ {
+ id: 420,
+ token: 'ETH',
+ label: 'Optimism Goerli Testnet',
+ rpcUrl: 'https://optimism-goerli.publicnode.com',
+ },
+ {
+ id: 56,
+ token: 'BNB',
+ label: 'Binance Smart Chain Mainnet',
+ rpcUrl: 'https://bsc.publicnode.com',
+ },
+ {
+ id: 97,
+ token: 'tBNB',
+ label: 'Binance Smart Chain Testnet',
+ rpcUrl: 'https://bsc-testnet.publicnode.com',
+ },
+ {
+ id: 1313161554,
+ token: 'ETH',
+ label: 'Aurora Mainnet',
+ rpcUrl: 'https://mainnet.aurora.dev',
+ },
+ {
+ id: 1313161555,
+ token: 'ETH',
+ label: 'Aurora Testnet',
+ rpcUrl: 'https://testnet.aurora.dev',
+ },
+ {
+ id: 137,
+ token: 'MATIC',
+ label: 'Polygon Mainnet',
+ rpcUrl: 'https://rpc.ankr.com/polygon',
+ },
+ {
+ id: 80001,
+ token: 'MATIC',
+ label: 'Polygon Testnet Mumbai',
+ rpcUrl: 'https://rpc.ankr.com/polygon_mumbai',
+ },
+ {
+ id: 280,
+ token: 'ETH',
+ label: 'zkSync Era Testnet',
+ rpcUrl: 'https://testnet.era.zksync.dev',
+ },
+ {
+ id: 324,
+ token: 'ETH',
+ label: 'zkSync Era Mainnet',
+ rpcUrl: 'https://zksync2-mainnet.zksync.io',
+ },
+ {
+ id: 1101,
+ token: 'ETH',
+ label: 'Polygon zkEVM',
+ rpcUrl: 'https://zkevm-rpc.com',
+ },
+ {
+ id: 1442,
+ token: 'ETH',
+ label: 'Polygon zkEVM Testnet',
+ rpcUrl: 'https://rpc.public.zkevm-test.net',
+ },
+ {
+ id: 42161,
+ token: 'ETH',
+ label: 'Arbitrum One Mainnet',
+ rpcUrl: 'https://arb1.arbitrum.io/rpc',
+ },
+ {
+ id: 42170,
+ token: 'ETH',
+ label: 'Arbitrum Nova',
+ rpcUrl: 'https://nova.arbitrum.io/rpc',
+ },
+ {
+ id: 421613,
+ token: 'AGOR',
+ label: 'Arbitrum Goerli',
+ rpcUrl: 'https://goerli-rollup.arbitrum.io/rpc',
+ },
+ {
+ id: 25,
+ token: 'CRO',
+ label: 'Cronos Mainnet Beta',
+ rpcUrl: 'https://evm.cronos.org',
+ },
+ {
+ id: 338,
+ token: 'TCRO',
+ label: 'Cronos Testnet',
+ rpcUrl: 'https://evm-t3.cronos.org',
+ },
+ {
+ id: 100,
+ token: 'XDAI',
+ label: 'Gnosis',
+ rpcUrl: 'https://rpc.ankr.com/gnosis',
+ },
+ {
+ id: 10200,
+ token: 'XDAI',
+ label: 'Gnosis Chiado Testnet',
+ rpcUrl: 'https://rpc.chiadochain.net',
+ },
+ {
+ id: 42220,
+ token: 'CELO',
+ label: 'Celo Mainnet',
+ rpcUrl: 'https://rpc.ankr.com/celo',
+ },
+ {
+ id: 44787,
+ token: 'CELO',
+ label: 'Celo Alfajores Testnet',
+ rpcUrl: 'https://alfajores-forno.celo-testnet.org',
+ },
+ {
+ id: 43114,
+ token: 'AVAX',
+ label: 'Avalanche C-Chain',
+ rpcUrl: 'https://rpc.ankr.com/avalanche',
+ },
+ {
+ id: 43113,
+ token: 'AVAX',
+ label: 'Avalanche Fuji Testnet',
+ rpcUrl: 'https://rpc.ankr.com/avalanche_fuji',
+ },
+ {
+ id: 250,
+ token: 'FTM',
+ label: 'Fantom Opera',
+ rpcUrl: 'https://rpc.ankr.com/fantom',
+ },
+ {
+ id: 4002,
+ token: 'FTM',
+ label: 'Fantom Testnet',
+ rpcUrl: 'https://rpc.ankr.com/fantom_testnet',
+ },
+ {
+ id: 1284,
+ token: 'GLMR',
+ label: 'Moonbeam',
+ rpcUrl: 'https://rpc.ankr.com/moonbeam',
+ },
+ {
+ id: 61,
+ token: 'ETC',
+ label: 'Ethereum Classic Mainnet',
+ rpcUrl: 'https://etc.rivet.link',
+ },
+ {
+ id: 84531,
+ token: 'ETH',
+ label: 'Base Goerli Testnet',
+ rpcUrl: 'https://goerli.base.org',
+ },
+ {
+ id: 8453,
+ token: 'ETH',
+ label: 'Base',
+ rpcUrl: 'https://mainnet.base.org',
+ },
+ {
+ id: 5001,
+ token: 'MNT',
+ label: 'Mantle Testnet',
+ rpcUrl: 'https://rpc.testnet.mantle.xyz',
+ },
+ {
+ id: 5000,
+ token: 'MNT',
+ label: 'Mantle',
+ rpcUrl: 'https://rpc.mantle.xyz',
+ },
+ ],
+ appMetadata: {
+ name: 'NEAR',
+ icon: '/next.svg',
+ description: 'NEAR',
+ },
+ theme: 'dark',
+ containerElements: {
+ // connectModal: '#near-social-navigation-bar',
+ // accountCenter: "#near-social-web3-account",
+ },
+});
+
+type EthersProviderContext = {
+ provider?: EIP1193Provider;
+ useConnectWallet: typeof useConnectWallet;
+};
+
+const defaultEthersProviderContext: EthersProviderContext = { useConnectWallet };
+
+export const useEthersProviderContext = singletonHook(defaultEthersProviderContext, () => {
+ const [{ wallet }] = useConnectWallet();
+ const [ethersProvider, setEthersProvider] = useState(defaultEthersProviderContext);
+
+ useEffect(() => {
+ (async () => {
+ if (typeof localStorage === 'undefined') return;
+
+ const walletsSub = onboard.state.select('wallets');
+
+ walletsSub.subscribe((wallets) => {
+ const connectedWallets = wallets.map(({ label }) => label);
+ localStorage.setItem(web3onboardKey, JSON.stringify(connectedWallets));
+ });
+
+ const previouslyConnectedWallets = JSON.parse(localStorage.getItem(web3onboardKey) || '[]');
+
+ if (previouslyConnectedWallets) {
+ // You can also auto connect "silently" and disable all onboard modals to avoid them flashing on page load
+ await onboard.connectWallet({
+ autoSelect: {
+ label: previouslyConnectedWallets[0],
+ disableModals: true,
+ },
+ });
+ }
+ })();
+ }, []);
+
+ useEffect(() => {
+ if (!wallet) return;
+
+ setEthersProvider({
+ provider: wallet.provider,
+ useConnectWallet,
+ });
+ }, [wallet]);
+
+ return ethersProvider;
+});",
+]
+`;
+
+exports[`create 'none' 'next-page' 'none': --none_next-page_none--.gitignore 1`] = `
+[
+ "--none_next-page_none--.gitignore",
+ "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+.yarn/install-state.gz
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env*.local
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
+",
+]
+`;
+
+exports[`create 'none' 'next-page' 'none': --none_next-page_none--README.md 1`] = `
+[
+ "--none_next-page_none--README.md",
+ "This is a [Next.js](https://nextjs.org/) project bootstrapped with [\`create-next-app\`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
+
+## Getting Started
+
+First, run the development server:
+
+\`\`\`bash
+npm run dev
+# or
+yarn dev
+# or
+pnpm dev
+# or
+bun dev
+\`\`\`
+
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+
+You can start editing the page by modifying \`app/page.js\`. The page auto-updates as you edit the file.
+
+This project uses [\`next/font\`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
+
+## Learn More
+
+To learn more about Next.js, take a look at the following resources:
+
+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
+
+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
+
+## Deploy on Vercel
+
+The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
+
+Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
+",
+]
+`;
+
+exports[`create 'none' 'next-page' 'none': --none_next-page_none--jsconfig.json 1`] = `
+[
+ "--none_next-page_none--jsconfig.json",
+ "{
+ "compilerOptions": {
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ }
+}
+",
+]
+`;
+
+exports[`create 'none' 'next-page' 'none': --none_next-page_none--next.config.js 1`] = `
+[
+ "--none_next-page_none--next.config.js",
+ "/** @type {import('next').NextConfig} */
+const nextConfig = {
+ reactStrictMode: true,
+}
+
+module.exports = nextConfig;
+",
+]
+`;
+
+exports[`create 'none' 'next-page' 'none': --none_next-page_none--package.json 1`] = `
+[
+ "--none_next-page_none--package.json",
+ "{
+ "name": "hello-near",
+ "version": "1.0.0",
+ "private": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start",
+ "lint": "next lint"
+ },
+ "dependencies": {
+ "@near-wallet-selector/core": "^8.5.1",
+ "@near-wallet-selector/here-wallet": "^8.5.1",
+ "@near-wallet-selector/modal-ui": "^8.5.1",
+ "@near-wallet-selector/my-near-wallet": "^8.5.1",
+ "@web3-onboard/core": "^2.20.2",
+ "@web3-onboard/injected-wallets": "^2.10.1",
+ "@web3-onboard/ledger": "^2.4.6",
+ "@web3-onboard/react": "^2.8.7",
+ "@web3-onboard/walletconnect": "^2.3.9",
+ "base64-js": "^1.5.1",
+ "bootstrap": "^5.3.2",
+ "bootstrap-icons": "^1.11.1",
+ "ieee754": "^1.2.1",
+ "near-api-js": "^2.1.3",
+ "near-social-vm": "github:NearSocial/VM#2.5.2",
+ "next": "14.0.1",
+ "pino-pretty": "^10.2.3",
+ "react": "^18",
+ "react-bootstrap": "2.9.1",
+ "react-bootstrap-icons": "^1.10.3",
+ "react-dom": "^18",
+ "react-singleton-hook": "^4.0.1",
+ "zustand": "^4.4.4"
+ },
+ "devDependencies": {
+ "eslint": "^8.53",
+ "eslint-config-next": "14.0.1"
+ }
+}
+",
+]
+`;
+
+exports[`create 'none' 'next-page' 'none': --none_next-page_none--public--favicon.ico 1`] = `
+[
+ "--none_next-page_none--public--favicon.ico",
+ "�PNG
+
+
+IHDR @ @ �iq� SIDATx�՛�m�0�?t��2�Fh4A� ������Gp7P6P7\`d�6M�<�b~�O��O'�"%ý���i�t��3� � g\`$3���'��^��V��0l?�N/��������ev[g�M�RW���\\o�wA�� �HZ�8�49� �L��K�Qq�s;������ö�^�S\\VI����]a�&