- copy .env-example to .env
- Generate self-signed certificate for proxy with the commands
openssl req -x509 -out ./docker-proxy-certs/safu.crt -keyout ./docker/proxy-certs/safu.key \ -newkey rsa:2048 -nodes -sha256 \ -subj '/CN=localhost' -extensions EXT -config <( \ printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
- run docker-compose up -d
- Token query is done at : https://localhost:443/api/info with query parameter
address=TOKEN_ADDRESS
andrefresh=BOOLEAN
to renew token info
safuscan-api's Introduction
safuscan-api's People
Forkers
agunghermwansafuscan-api's Issues
Add POLYGON and ETH networks
- https://localhost/api/info?address=0xc74cd0042c837ce59210857504ebb0859e06aa22&type=eth
- https://localhost/api/info?address=0xc74cd0042c837ce59210857504ebb0859e06aa22&type=polygon
- https://localhost/api/info?address=0xc74cd0042c837ce59210857504ebb0859e06aa22&type=bsc
- store in MongoDB, add a new field = type
We should be able to scan ETH and Polygon too..
Convert to checksum address before storing to DB
- We want to store checksummed 0x address to avoid duplicates -> https://piyopiyo.medium.com/how-to-convert-ethereum-address-to-checksum-address-cd3e2305e2fc (Web3.utils.toChecksumAddress)
- This should avoid duplicates being stored right now like https://fomo.tech/api/info?address=0xc74cd0042c837ce59210857504ebb0859e06aa22 or https://fomo.tech/api/info?address=0xc74cD0042c837Ce59210857504eBb0859E06aA22
- If the user enters a non checksummed address, just convert it in the background
Add a simple counter - stats per token + total
-
Each time the API get request is executed 2 things should happen
-
Counter for each token contract - suggest creating a new field api_stats_counter so we know each token address "popularity"
-
Increase the total_api_calls field this is a simple counter for now so we can track the number of times the API was used (we will expand on this later, such as IP address, auth token or wallet address to have better/specific API access permissions
SLICE error
api/info?address=0xa99c3ade9b6d4c9a1b786afae64ad62ab194e0bf
/usr/src/app/build/src/routes/info.js:72
const burnedTokens = parseInt((yield (0, bsc_scan_service_1.getBurnedTokenAmount)(contractAddress)).slice(0, -tokenDecimals)) || 0;
^
TypeError: Cannot read properties of undefined (reading 'slice')
at /usr/src/app/build/src/routes/info.js:72:109
at Generator.next (<anonymous>)
at fulfilled (/usr/src/app/build/src/routes/info.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Improve Error Handling
Grab token info from moralis web3 API
If token does not exist in db, then info should be grabbed from moralis web3 API.
Create API documentation
One fine tool for creating good documentation is: https://github.com/mpociot/whiteboard
Create contract utilities for checking common exploits
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.