This repository has been archived by the owner on Mar 22, 2023. It is now read-only.
forked from Uniswap/v2-subgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dayupdates function logic and working corrected (tested), tokensList …
…Model and Endpoints created (tested)
- Loading branch information
1 parent
a7904da
commit d1c3878
Showing
14 changed files
with
161 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MCowBQYDK2VwAyEALL3X/DHIFDBLlC2KxLdViyhGpsITRk9CC2z/dZGNwbo= | ||
MCowBQYDK2VwAyEA3+dK57Rtp6tCa8ok1Tc7nsBk58+yRje2BOR/jpXRd9M= | ||
-----END PUBLIC KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
012cbdd7fc31c814304b942d8ac4b7558b2846a6c213464f420b6cff75918dc1ba | ||
01dfe74ae7b46da7ab426bca24d5373b9ec064e7cfb24637b604e47f8e95d177d3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MC4CAQAwBQYDK2VwBCIEIJ2oD3148IO8k5o4CXd0SEmC4cOwtQNp4hO0OMYGY+g6 | ||
MC4CAQAwBQYDK2VwBCIEIAXbC6e4WdEjVyRrAD3RxaSDzw+vjnjoXfcYZXvZ/eS6 | ||
-----END PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MCowBQYDK2VwAyEALL3X/DHIFDBLlC2KxLdViyhGpsITRk9CC2z/dZGNwbo= | ||
MCowBQYDK2VwAyEA3+dK57Rtp6tCa8ok1Tc7nsBk58+yRje2BOR/jpXRd9M= | ||
-----END PUBLIC KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
012cbdd7fc31c814304b942d8ac4b7558b2846a6c213464f420b6cff75918dc1ba | ||
01dfe74ae7b46da7ab426bca24d5373b9ec064e7cfb24637b604e47f8e95d177d3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MC4CAQAwBQYDK2VwBCIEIJ2oD3148IO8k5o4CXd0SEmC4cOwtQNp4hO0OMYGY+g6 | ||
MC4CAQAwBQYDK2VwBCIEIAXbC6e4WdEjVyRrAD3RxaSDzw+vjnjoXfcYZXvZ/eS6 | ||
-----END PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var mongoose = require('mongoose'); | ||
var Schema = mongoose.Schema; | ||
|
||
const tokensListSchema = new Schema({ | ||
|
||
//tokens Data | ||
data: { | ||
type: Object, | ||
} | ||
|
||
}); | ||
|
||
var tokensList = mongoose.model("tokensList", tokensListSchema); | ||
module.exports = tokensList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
require('dotenv').config() | ||
var express = require('express'); | ||
var router = express.Router(); | ||
var tokensListModel=require('../models/tokensList'); | ||
|
||
router.route("/addtokensList").post(async function (req, res, next) { | ||
try { | ||
|
||
if(!req.body.tokensList) | ||
{ | ||
return res.status(400).json({ | ||
success: false, | ||
message: "tokensList not found in the request Body.", | ||
}); | ||
} | ||
let newData= new tokensListModel({ | ||
data:req.body.tokensList | ||
}); | ||
await tokensListModel.create(newData); | ||
|
||
return res.status(200).json({ | ||
success: true, | ||
message: "Token List Data SuccessFully Saved." | ||
}); | ||
|
||
} catch (error) { | ||
console.log("error (try-catch) : " + error); | ||
return res.status(500).json({ | ||
success: false, | ||
err: error, | ||
}); | ||
} | ||
}); | ||
|
||
router.route("/tokensList").get(async function (req, res, next) { | ||
try { | ||
|
||
var tokensList= await tokensListModel.findOne({}); | ||
if(tokensList==null) | ||
{ | ||
return res.status(400).json({ | ||
success: false, | ||
message: "There is no data in tokensList Collection.", | ||
}); | ||
} | ||
return res.status(200).json({ | ||
success: true, | ||
message: "Token List Data: ", | ||
data: tokensList.data | ||
}); | ||
|
||
} catch (error) { | ||
console.log("error (try-catch) : " + error); | ||
return res.status(500).json({ | ||
success: false, | ||
err: error, | ||
}); | ||
} | ||
}); | ||
|
||
|
||
module.exports = router; |