-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
134 additions
and
59 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,28 @@ | ||
name: Check format token list | ||
|
||
on: pull_request | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
check-token-list: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14" | ||
- name: Install dependencies | ||
shell: bash | ||
run: yarn install --frozen-lockfile --verbose | ||
- name: Validate JSON file | ||
run: yarn validate | ||
- name: Discord notification (failure) | ||
if: failure() | ||
uses: Ilshidur/action-discord@master | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
with: | ||
args: "Error token list format" |
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,2 +1,4 @@ | ||
/node_modules | ||
.DS_Store | ||
.DS_Store | ||
dist | ||
build |
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 |
---|---|---|
|
@@ -3,10 +3,18 @@ | |
"version": "1.0.0", | ||
"main": "src/index.ts", | ||
"repository": "https://github.com/AngleProtocol/angle-token-list.git", | ||
"author": "greedythib <[email protected]>", | ||
"author": "greedythib <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@angleprotocol/sdk": "^1.0.63", | ||
"ts-node": "^10.7.0" | ||
"joi": "^17.6.0" | ||
}, | ||
"scripts": { | ||
"validate": "ts-node src/index.ts" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^17.0.38", | ||
"ts-node": "^10.7.0", | ||
"typescript": "^4.7.2" | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,7 +1,13 @@ | ||
import { ChainId } from "@angleprotocol/sdk"; | ||
import { TokenInfo, TokenInfoListType, TokenList } from "./types"; | ||
import { token_list as mainnet_token_list } from "./chains/mainnet"; | ||
import { TokenList, joiSchema } from "./types"; | ||
import erc20s from "../ERC20_LIST.json"; | ||
import { inspect } from "util"; | ||
|
||
export const TOKEN_LIST: TokenList = { | ||
[ChainId.MAINNET]: mainnet_token_list, | ||
}; | ||
export const TOKEN_LIST: TokenList[] = erc20s; | ||
|
||
const result = joiSchema.validate(TOKEN_LIST); | ||
if (result.error) { | ||
console.log(inspect(result.error, { showHidden: false, depth: null, colors: true })); | ||
throw new Error("wrong JSON format"); | ||
} else { | ||
console.log("all good"); | ||
} |
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,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2018", | ||
"module": "commonjs", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"resolveJsonModule": true, | ||
"sourceMap": true, | ||
"outDir": "build" | ||
}, | ||
"include": ["src"] | ||
} |
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 |
---|---|---|
|
@@ -366,6 +366,35 @@ | |
"@ethersproject/properties" "^5.6.0" | ||
"@ethersproject/strings" "^5.6.0" | ||
|
||
"@hapi/hoek@^9.0.0": | ||
version "9.3.0" | ||
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" | ||
integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== | ||
|
||
"@hapi/topo@^5.0.0": | ||
version "5.1.0" | ||
resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" | ||
integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== | ||
dependencies: | ||
"@hapi/hoek" "^9.0.0" | ||
|
||
"@sideway/address@^4.1.3": | ||
version "4.1.4" | ||
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" | ||
integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== | ||
dependencies: | ||
"@hapi/hoek" "^9.0.0" | ||
|
||
"@sideway/formula@^3.0.0": | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" | ||
integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== | ||
|
||
"@sideway/pinpoint@^2.0.0": | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" | ||
integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== | ||
|
||
"@tsconfig/node10@^1.0.7": | ||
version "1.0.8" | ||
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" | ||
|
@@ -394,6 +423,11 @@ | |
lodash "^4.17.15" | ||
ts-essentials "^7.0.1" | ||
|
||
"@types/node@^17.0.38": | ||
version "17.0.38" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.38.tgz#f8bb07c371ccb1903f3752872c89f44006132947" | ||
integrity sha512-5jY9RhV7c0Z4Jy09G+NIDTsCZ5G0L5n+Z+p+Y7t5VJHM30bgwzSjVtlcBxqAj+6L/swIlvtOSzr8rBk/aNyV2g== | ||
|
||
"@types/prettier@^2.1.1": | ||
version "2.4.4" | ||
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" | ||
|
@@ -743,6 +777,17 @@ inherits@2, inherits@^2.0.3, inherits@^2.0.4: | |
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" | ||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== | ||
|
||
joi@^17.6.0: | ||
version "17.6.0" | ||
resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" | ||
integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== | ||
dependencies: | ||
"@hapi/hoek" "^9.0.0" | ||
"@hapi/topo" "^5.0.0" | ||
"@sideway/address" "^4.1.3" | ||
"@sideway/formula" "^3.0.0" | ||
"@sideway/pinpoint" "^2.0.0" | ||
|
||
[email protected], js-sha3@^0.8.0: | ||
version "0.8.0" | ||
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" | ||
|
@@ -932,6 +977,11 @@ typechain@^6.0.5: | |
ts-command-line-args "^2.2.0" | ||
ts-essentials "^7.0.1" | ||
|
||
typescript@^4.7.2: | ||
version "4.7.2" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4" | ||
integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A== | ||
|
||
typical@^4.0.0: | ||
version "4.0.0" | ||
resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" | ||
|