{"id":21045127,"url":"https://github.com/arrjunpradeep/safecryptowallet","last_synced_at":"2025-06-26T10:04:03.076Z","repository":{"id":122153707,"uuid":"386543114","full_name":"ArrjunPradeep/safeCryptoWallet","owner":"ArrjunPradeep","description":"NFT Marketplace + Wallet","archived":false,"fork":false,"pushed_at":"2021-12-09T06:08:17.000Z","size":2618,"stargazers_count":2,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"wallet_nft","last_synced_at":"2025-04-12T15:59:59.443Z","etag":null,"topics":["bep20","binance","javascript","mongodb","nft","nft-marketplace","redis-server","solidity","wallet"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArrjunPradeep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-16T07:04:54.000Z","updated_at":"2023-07-09T14:50:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ebd1fbb-2f49-4573-a2db-99ec4a3b1359","html_url":"https://github.com/ArrjunPradeep/safeCryptoWallet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArrjunPradeep/safeCryptoWallet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrjunPradeep%2FsafeCryptoWallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrjunPradeep%2FsafeCryptoWallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrjunPradeep%2FsafeCryptoWallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrjunPradeep%2FsafeCryptoWallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArrjunPradeep","download_url":"https://codeload.github.com/ArrjunPradeep/safeCryptoWallet/tar.gz/refs/heads/wallet_nft","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrjunPradeep%2FsafeCryptoWallet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262044445,"owners_count":23249749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bep20","binance","javascript","mongodb","nft","nft-marketplace","redis-server","solidity","wallet"],"created_at":"2024-11-19T14:20:06.342Z","updated_at":"2025-06-26T10:04:03.058Z","avatar_url":"https://github.com/ArrjunPradeep.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binance Crypto Wallet + NFT\n\n## Setting Up :\n\n**Step 1:** Download the repository using the command:\n\n```\n git clone -b wallet_nft \"https://github.com/Arjun-Pradeep/safeCryptoWallet.git\"\n```\n\n**Step 2:** Change the current working directory to \"safeCryptoWallet\" :\n\n```\n cd safeCryptoWallet\n```\n\n**Step 3:** Install the dependecies :\n\n```\n npm i --save\n```\n\n**Step 4:** Load environment variables from **.env** file\n\n```\nMNEMONIC=\"\"\nPASSPHRASE=\"\"\nAPI_KEY=\"\"\nPROVIDER=\"\"\nWEBSOCKET_URL=\"\"\nPRIVATE_KEY=\"\"\nBNB_API_KEY=\"\"\nMARKETPLACE_ADDRESS=\"\"\nNFT_ADDRESS=\"\"\n```\n\n**Step 5:** Install redis :\n\n```\n sudo apt-get install redis\n\n```\n\n**Step 6:** Install pm2 [daemon process manager] :\n\n```\n    npm install pm2@latest -g\n```\n\n**Step 7:** Compile the smart contracts :\n\n```\n npx hardhat compile\n```\n\n**Step 8:** Run redis service [/home Folder] :\n\n```\n   pm2 start redis-server\n```\n\n**Step 9:** Setup a database in server [MongoDB]:\n\n###### Create a file - database.js [HOME directory] :\n\n```\nconn = new Mongo();\n\ndbName = \"wallets\";\n\ndb = conn.getDB(dbName);\n\ndb.createUser(\n{\nuser: \"cryptoInsider\",\npwd: \"VB\u003cz6LXP.[f/+c3+\",\nroles: [ {role:\"readWrite\", db:dbName} ]\n}\n);\n\n// ACCOUNTS\nprintjson(\n db.createCollection(\"accounts\")\n )\n\n// WALLETS\nprintjson(\n db.createCollection(\"wallets\")\n)\n\n// TRANSACTIONS\nprintjson(\n db.createCollection(\"transactions\")\n)\n\n// TOKENS\nprintjson(\n db.createCollection(\"tokens\")\n)\n\n// SETTINGS\nprintjson(\n db.createCollection(\"settings\")\n)\n\n// NFTS\nprintjson(\n db.createCollection(\"nfts\")\n)\n\n// UNIQUE\ndb.accounts.createIndex({\"email\":1},{ unique: true } );\n\n// INITIALLY CREATE A ADMIN RECORD\nprintjson(\ndb.accounts.insert({\n  name: \"John\",\n  email: \"cryptowalletadmin@gmail.com\",\n  adminLevel: \"0\"\n},{\n  upsert: true\n},\n{ unique: true })\n)\n\n// UNIQUE\ndb.settings.createIndex({marketplace_address:1},{ unique: true } );\n\n// SETTINGS\nprintjson(\ndb.settings.insert({\n  marketplace_address:\"0x487e5a79E03545279Cb662115a4Be91D1136cA75\",\n  nft_address:\"0x0920adAAd74e243Bc4AD4A878A7Ded9b0AF91187\"\n},{\n  upsert: true\n})\n)\n\n// UNIQUE\ndb.tokens.createIndex({\"address\":1},{ unique: true } );\n\n// INITIALLY CREATE A SETTINGS\nprintjson(\ndb.tokens.insert({\n    status: true,\n    name: \"Bank of BIT ETH\",\n    symbol: \"BOBE\",\n    address: \"0x5F5f52DFdB123af72aBc43ab36c191e05c9E5904\",\n    decimal: \"15\",\n    blockchain: \"binance\"\n},{\n  upsert: true\n})\n)\n\n// GET COLLECTIONS\nprintjson(\ndb.getCollectionNames()\n)\n```\n\n###### Open mongo terminal :\n\n```\n   mongo\n```\n\n###### Execute the database.js in mongo terminal :\n\n```\n   load('database.js')\n```\n\n###### Ensure mongodb is running\n\n**Step 5:** Update the database credentials in '/safeCryptoWallet/config/config.js':\n\n```\n    db: {\n        host: \"localhost\",\n        port: \"27017\",\n        userName: \"DB_USERNAME\",\n        password: \"DB_PASSWORD\",\n        dbName: \"DB_NAME\"\n    }\n```\n\n**Step 6:** Execute the crons :\n\n```\npm2 start crons/startSendCrypto.js --name sendCron\npm2 start crons/receiveTransaction.js --name receiveCron\n```\n\n**Step 7:** Start the Application :\n\n```\n pm2 start bin/www --name wallet\n```\n\n## Endpoints :\n\n***POSTMAN Collections : https://www.getpostman.com/collections/2a30700cdcec9e9e1f37***\n\n**For every API call, Need to set \"x-api-key\" in the header**\n\n## ***Wallet :***\n\n***Create wallet account for a user [ /wallet/createWallet ] [ POST ]:***\n\n![CREATE WALLET](/docs/wallet/createWallet.png \"CREATE WALLET\")\n```\nBody Parameters :\n\n-\u003e email : String\n\n-\u003e password : String\n\n```\n\n***Login to the wallet account of the user [ /wallet/login ] [ POST ]:***\n\n![CREATE WALLET](/docs/wallet/login.png \"CREATE WALLET\")\n```\nBody Parameters :\n\n-\u003e email : String\n\n-\u003e password : String\n\n```\n\n***Retrieve account details of a user [ /wallet/user ] [ GET ] [ JWT AUTH ]:***\n\n![USER](/docs/wallet/user.png \"USER\")\n```\nQuery Parameters :\n\n-\u003e email : String\n\n```\n\n***Retrieve transaction history w.r.t user [ /wallet/transactionHistory ] [ GET ]  JWT AUTH ]:***\n\n![TRANSACTION HISTORY](/docs/wallet/transaction.png \"TRANSACTION HISTORY\")\n```\nQuery Parameters :\n\n-\u003e email : String\n\n```\n\n***Validate the transaction [ /wallet/validateTransaction ] [ POST ] [ JWT AUTH ]:***\n\n![VALIDATE](/docs/wallet/validate.png \"VALIDATE\")\n```\nBody Parameters :\n\n-\u003e email : String\n-\u003e crypto : String // 'BNB' or 'BOBE'\n-\u003e receiver : String\n-\u003e amount : String\n\n```\n\n***Crypto transaction [ /wallet/send ] [ POST ] [ JWT AUTH ]:***\n\n![SEND](/docs/wallet/send.png \"SEND\")\n\n```\nBody Parameters :\n\n-\u003e email : String\n-\u003e crypto : String // 'BNB' or 'BOBE'\n-\u003e receiver : String\n-\u003e amount : String\n```\n\n## ***NFT :***\n\n***Upload the image file [ /nft/uploadFile ] [ POST ]:***\n\n![UPLOAD FILE](/docs/nft/uploadFile.png \"UPLOAD FILE\")\n```\nBody Parameters [Form-data] :\n\n-\u003e file : Image File\n-\u003e name : String\n-\u003e description : String\n```\n\n***Create a new NFT [ /nft/createToken ] [ POST ] [ JWT AUTH ]:***\n\n![CREATE TOKEN](/docs/nft/createToken.png \"CREATE TOKEN\")\n```\nBody Parameters :\n\n-\u003e email : String\n-\u003e uri : String\n-\u003e name : String\n-\u003e description : String\n-\u003e image : String\n```\n\n***Create a new market item [ /nft/createItem ] [ POST ] [ JWT AUTH ]:***\n\n![CREATE ITEM](/docs/nft/createItem.png \"CREATE ITEM\")\n```\nBody Parameters :\n\n-\u003e email : String\n-\u003e uri : String\n-\u003e name : String\n-\u003e description : String\n-\u003e image : String\n```\n\n***Create a market sale [ /nft/marketSale ] [ POST ] [ JWT AUTH ]:***\n\n![MARKET SALE](/docs/nft/marketSale.png \"MARKET SALE\")\n```\nBody Parameters :\n\n-\u003e email : String\n-\u003e tokenId : String\n-\u003e auctionPrice : String\n```\n\n***Fetch all the tokens created by the user [ /nft/fetchTokens ] [ GET ] [ JWT AUTH ]:***\n\n![FETCH TOKENS](/docs/nft/fetchTokens.png \"FETCH TOKENS\")\n```\nQuery Parameters :\n\n-\u003e email : String\n```\n\n***Fetch all the listed market items [ /nft/marketItems ] [ GET ] [ JWT AUTH ]:***\n\n![MARKET ITEMS](/docs/nft/marketItems.png \"MARKET ITEMS\")\n```\nQuery Parameters :\n\n-\u003e email : String\n```\n\n***Fetch all the owned market items by the user [ /nft/ownedItems ] [ GET ] [ JWT AUTH ]:***\n\n![OWNED ITEMS](/docs/nft/ownedItems.png \"OWNED ITEMS\")\n```\nQuery Parameters :\n\n-\u003e email : String\n```\n\n***Fetch all the created market items [SOLD \u0026 NOT SOLD] by the user [ /nft/createdItems ] [ GET ] [ JWT AUTH ]:***\n\n![CREATED ITEMS](/docs/nft/createdItems.png \"CREATED ITEMS\")\n```\nQuery Parameters :\n\n-\u003e email : String\n```\n\n***Fetch the metadata [ /nft/metaData ] [ GET ]:***\n\n![METADATA](/docs/nft/metaData.png \"METADATA\")\n```\nQuery Parameters :\n\n-\u003e url : String\n```\n\n## ***Swagger Documentation :***\n\n```\nhttp://localhost:3000/api-docs/\n```\n![SWAGGER DEMO](/docs/swagger/demo.png \"SWAGGER DEMO\")\n![SWAGGER AUTH](/docs/swagger/auth.png \"SWAGGER AUTH\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrjunpradeep%2Fsafecryptowallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrjunpradeep%2Fsafecryptowallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrjunpradeep%2Fsafecryptowallet/lists"}