Skip to content

Commit 210e50e

Browse files
committed
refactor(nft-marketplace): extract NFT contract ID to env variable
1 parent bc21d96 commit 210e50e

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

apps/nft-marketplace/src/app/page.tsx

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
'use client'
22

3-
import { useCallback, useEffect, useState } from 'react'
4-
import Head from 'next/head'
3+
import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'
4+
import AddShoppingCartIcon from '@mui/icons-material/AddShoppingCart'
5+
import GavelIcon from '@mui/icons-material/Gavel'
6+
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'
57
import {
68
AppBar,
79
Box,
@@ -18,22 +20,10 @@ import {
1820
Toolbar,
1921
Typography,
2022
} from '@mui/material'
21-
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'
22-
import GavelIcon from '@mui/icons-material/Gavel'
23-
import AddShoppingCartIcon from '@mui/icons-material/AddShoppingCart'
24-
import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'
25-
import {
26-
connect,
27-
Contract,
28-
keyStores,
29-
WalletConnection,
30-
utils,
31-
transactions,
32-
Connection,
33-
} from 'near-api-js'
23+
import { connect, Contract, keyStores, transactions, utils, WalletConnection } from 'near-api-js'
3424
import type { NextPage } from 'next'
35-
import { PublicKey, serialize } from 'near-api-js/lib/utils'
36-
import { createTransaction } from 'near-api-js/lib/transaction'
25+
import Head from 'next/head'
26+
import { useCallback, useEffect, useState } from 'react'
3727

3828
/* ----------------------------------- Config ---------------------------------- */
3929

@@ -42,7 +32,7 @@ const NODE_URL = process.env.NEXT_PUBLIC_NODE_URL || 'https://rpc.mainnet.near.o
4232
const WALLET_URL = process.env.NEXT_PUBLIC_WALLET_URL || 'https://app.mynearwallet.com'
4333
const HELPER_URL = process.env.NEXT_PUBLIC_HELPER_URL || 'https://helper.mainnet.near.org'
4434
const CONTRACT_NAME = process.env.NEXT_PUBLIC_CONTRACT_NAME || 'market.aigency.near'
45-
const NFT_CONTRACT_ID = 'my-new-nft-contract.near'
35+
const NFT_CONTRACT_ID = process.env.NEXT_PUBLIC_NFT_CONTRACT_NAME || 'my-new-nft-contract.near'
4636

4737
// 150 Tgas
4838
const GAS_BN = BigInt('150000000000000')

0 commit comments

Comments
 (0)