An open API service indexing awesome lists of open source software.

https://github.com/arrjunpradeep/safecryptowallet

NFT Marketplace + Wallet
https://github.com/arrjunpradeep/safecryptowallet

bep20 binance javascript mongodb nft nft-marketplace redis-server solidity wallet

Last synced: about 2 months ago
JSON representation

NFT Marketplace + Wallet

Awesome Lists containing this project

README

        

# Binance Crypto Wallet + NFT

## Setting Up :

**Step 1:** Download the repository using the command:

```
git clone -b wallet_nft "https://github.com/Arjun-Pradeep/safeCryptoWallet.git"
```

**Step 2:** Change the current working directory to "safeCryptoWallet" :

```
cd safeCryptoWallet
```

**Step 3:** Install the dependecies :

```
npm i --save
```

**Step 4:** Load environment variables from **.env** file

```
MNEMONIC=""
PASSPHRASE=""
API_KEY=""
PROVIDER=""
WEBSOCKET_URL=""
PRIVATE_KEY=""
BNB_API_KEY=""
MARKETPLACE_ADDRESS=""
NFT_ADDRESS=""
```

**Step 5:** Install redis :

```
sudo apt-get install redis

```

**Step 6:** Install pm2 [daemon process manager] :

```
npm install pm2@latest -g
```

**Step 7:** Compile the smart contracts :

```
npx hardhat compile
```

**Step 8:** Run redis service [/home Folder] :

```
pm2 start redis-server
```

**Step 9:** Setup a database in server [MongoDB]:

###### Create a file - database.js [HOME directory] :

```
conn = new Mongo();

dbName = "wallets";

db = conn.getDB(dbName);

db.createUser(
{
user: "cryptoInsider",
pwd: "VB email : String

-> password : String

```

***Login to the wallet account of the user [ /wallet/login ] [ POST ]:***

![CREATE WALLET](/docs/wallet/login.png "CREATE WALLET")
```
Body Parameters :

-> email : String

-> password : String

```

***Retrieve account details of a user [ /wallet/user ] [ GET ] [ JWT AUTH ]:***

![USER](/docs/wallet/user.png "USER")
```
Query Parameters :

-> email : String

```

***Retrieve transaction history w.r.t user [ /wallet/transactionHistory ] [ GET ] JWT AUTH ]:***

![TRANSACTION HISTORY](/docs/wallet/transaction.png "TRANSACTION HISTORY")
```
Query Parameters :

-> email : String

```

***Validate the transaction [ /wallet/validateTransaction ] [ POST ] [ JWT AUTH ]:***

![VALIDATE](/docs/wallet/validate.png "VALIDATE")
```
Body Parameters :

-> email : String
-> crypto : String // 'BNB' or 'BOBE'
-> receiver : String
-> amount : String

```

***Crypto transaction [ /wallet/send ] [ POST ] [ JWT AUTH ]:***

![SEND](/docs/wallet/send.png "SEND")

```
Body Parameters :

-> email : String
-> crypto : String // 'BNB' or 'BOBE'
-> receiver : String
-> amount : String
```

## ***NFT :***

***Upload the image file [ /nft/uploadFile ] [ POST ]:***

![UPLOAD FILE](/docs/nft/uploadFile.png "UPLOAD FILE")
```
Body Parameters [Form-data] :

-> file : Image File
-> name : String
-> description : String
```

***Create a new NFT [ /nft/createToken ] [ POST ] [ JWT AUTH ]:***

![CREATE TOKEN](/docs/nft/createToken.png "CREATE TOKEN")
```
Body Parameters :

-> email : String
-> uri : String
-> name : String
-> description : String
-> image : String
```

***Create a new market item [ /nft/createItem ] [ POST ] [ JWT AUTH ]:***

![CREATE ITEM](/docs/nft/createItem.png "CREATE ITEM")
```
Body Parameters :

-> email : String
-> uri : String
-> name : String
-> description : String
-> image : String
```

***Create a market sale [ /nft/marketSale ] [ POST ] [ JWT AUTH ]:***

![MARKET SALE](/docs/nft/marketSale.png "MARKET SALE")
```
Body Parameters :

-> email : String
-> tokenId : String
-> auctionPrice : String
```

***Fetch all the tokens created by the user [ /nft/fetchTokens ] [ GET ] [ JWT AUTH ]:***

![FETCH TOKENS](/docs/nft/fetchTokens.png "FETCH TOKENS")
```
Query Parameters :

-> email : String
```

***Fetch all the listed market items [ /nft/marketItems ] [ GET ] [ JWT AUTH ]:***

![MARKET ITEMS](/docs/nft/marketItems.png "MARKET ITEMS")
```
Query Parameters :

-> email : String
```

***Fetch all the owned market items by the user [ /nft/ownedItems ] [ GET ] [ JWT AUTH ]:***

![OWNED ITEMS](/docs/nft/ownedItems.png "OWNED ITEMS")
```
Query Parameters :

-> email : String
```

***Fetch all the created market items [SOLD & NOT SOLD] by the user [ /nft/createdItems ] [ GET ] [ JWT AUTH ]:***

![CREATED ITEMS](/docs/nft/createdItems.png "CREATED ITEMS")
```
Query Parameters :

-> email : String
```

***Fetch the metadata [ /nft/metaData ] [ GET ]:***

![METADATA](/docs/nft/metaData.png "METADATA")
```
Query Parameters :

-> url : String
```

## ***Swagger Documentation :***

```
http://localhost:3000/api-docs/
```
![SWAGGER DEMO](/docs/swagger/demo.png "SWAGGER DEMO")
![SWAGGER AUTH](/docs/swagger/auth.png "SWAGGER AUTH")