-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- implement account, contract, stats and token api
- Loading branch information
Juan Pablo Garcia
authored and
Juan Pablo Garcia
committed
Jan 30, 2021
0 parents
commit 313badc
Showing
19 changed files
with
7,130 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
version: 2.1 | ||
|
||
refs: | ||
container: &container | ||
docker: | ||
- image: node:12.13.0 | ||
working_directory: ~/repo | ||
|
||
steps: | ||
- &Versions | ||
run: | ||
name: Versions | ||
command: node -v && npm -v && yarn -v | ||
- &CacheRestore | ||
restore_cache: | ||
key: dependency-cache-{{ checksum "yarn.lock" }} | ||
- &Install | ||
run: | ||
name: Install Dependencies | ||
command: yarn install --pure-lockfile | ||
- &CacheSave | ||
save_cache: | ||
key: dependency-cache-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ./node_modules | ||
- &Build | ||
run: | ||
name: Build | ||
command: yarn build | ||
- &Lint | ||
run: | ||
name: Lint | ||
command: yarn lint | ||
- &Release | ||
run: | ||
name: Release | ||
command: yarn release | ||
jobs: | ||
verify-build-status: | ||
<<: *container | ||
steps: | ||
- checkout | ||
- *Versions | ||
- *CacheRestore | ||
- *Install | ||
- *CacheSave | ||
- *Build | ||
- *Lint | ||
|
||
release: | ||
<<: *container | ||
steps: | ||
- checkout | ||
- *Versions | ||
- *CacheRestore | ||
- *Install | ||
- *CacheSave | ||
- *Build | ||
- *Lint | ||
- *Release | ||
|
||
workflows: | ||
version: 2 | ||
run-checks: | ||
jobs: | ||
- verify-build-status: | ||
filters: | ||
branches: | ||
ignore: | ||
- main | ||
release: | ||
jobs: | ||
- release: | ||
filters: | ||
branches: | ||
only: main |
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,3 @@ | ||
node_modules | ||
dist | ||
coverage |
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,9 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "prettier/@typescript-eslint"], | ||
"rules": { | ||
"@typescript-eslint/explicit-module-boundary-types": "off" | ||
} | ||
} |
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,21 @@ | ||
# OSX | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-error.log* | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Other | ||
package-lock.json | ||
.github/ | ||
docs/ | ||
dist/ |
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,23 @@ | ||
############ | ||
# Node | ||
############ | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
## Other | ||
.github/ | ||
docs/ | ||
|
||
src | ||
example | ||
|
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 @@ | ||
save-exact=true |
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,5 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"semi": false | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Charles Stover | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,37 @@ | ||
# Node.js BscScan API | ||
|
||
[![npm](https://img.shields.io/npm/v/bsc-scan.svg?style=flat-square)](https://www.npmjs.com/package/bsc-scan) | ||
[![Travis branch](https://img.shields.io/travis/jpgarcia/bsc-scan/master.svg?style=flat-square)](https://travis-ci.org/jpgarcia/bsc-scan) | ||
|
||
Node.js package to interact with official [BscScan API](https://bscscan.io/apis) | ||
|
||
## Documentation | ||
|
||
**[API reference](https://bscscan.com/apis)** | ||
|
||
## Installation | ||
|
||
```bash | ||
$ yarn add bsc-scan | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
import bscscan, { account } from 'bsc-scan' | ||
|
||
bscscan.setUrl('https://testnet.bscscan.com') | ||
bscscan.setApiKey('YourApiKeyToken') | ||
|
||
const start = async () => { | ||
try { | ||
const balance = await account.getBnbBalance('0x765090aB712984081aeE059eA7025C48a4198183') | ||
|
||
console.log(`Your balance is: ${balance}`) | ||
} catch (err) { | ||
console.log(err) | ||
} | ||
} | ||
|
||
start() | ||
``` |
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,77 @@ | ||
{ | ||
"name": "bsc-scan", | ||
"version": "0.0.1", | ||
"description": "Node.js package to interact with official BscScan API", | ||
"repository": "https://github.com/jpgarcia/bsc-scan", | ||
"author": "Juan Pablo Garcia", | ||
"files": [ | ||
"dist/", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"homepage": "https://github.com/jpgarcia/bsc-scan#readme", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"clean:dist": "rm -rf dist", | ||
"lint": "eslint --ext .js,.ts src", | ||
"prebuild": "yarn clean:dist", | ||
"prepare": "yarn build", | ||
"release": "semantic-release" | ||
}, | ||
"devDependencies": { | ||
"@semantic-release/changelog": "5.0.1", | ||
"@semantic-release/git": "9.0.0", | ||
"@semantic-release/npm": "7.0.10", | ||
"@types/axios": "0.14.0", | ||
"@types/lodash": "4.14.168", | ||
"@typescript-eslint/eslint-plugin": "4.14.1", | ||
"@typescript-eslint/parser": "4.14.1", | ||
"commitizen": "4.2.3", | ||
"cz-conventional-changelog": "3.3.0", | ||
"eslint": "7.18.0", | ||
"eslint-config-prettier": "7.2.0", | ||
"husky": "4.3.8", | ||
"lint-staged": "10.5.3", | ||
"prettier": "2.2.1", | ||
"semantic-release": "17.3.7", | ||
"typescript": "4.1.3" | ||
}, | ||
"release": { | ||
"branches": [ | ||
"main" | ||
], | ||
"verifyConditions": [ | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/git" | ||
], | ||
"prepare": [ | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/git" | ||
] | ||
}, | ||
"lint-staged": { | ||
"**/*.{js,ts}": "yarn eslint" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true", | ||
"pre-commit": "yarn lint-staged", | ||
"pre-push": "yarn tsc && yarn lint --quiet" | ||
} | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
}, | ||
"dependencies": { | ||
"axios": "0.21.1", | ||
"lodash.identity": "3.0.0", | ||
"lodash.pickby": "4.6.0", | ||
"querystring": "0.2.0" | ||
} | ||
} |
Oops, something went wrong.