@eth-optimism/tokenlist 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +1 -0
- package/.env.example +2 -0
- package/.eslintrc.js +188 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/mergify.yml +57 -0
- package/.github/workflows/dependabot.yml +13 -0
- package/.github/workflows/generate.yml +57 -0
- package/.github/workflows/publish.yml +50 -0
- package/.github/workflows/stale.yml +19 -0
- package/.github/workflows/test.yml +43 -0
- package/.github/workflows/validate.yml +67 -0
- package/.prettierrc.js +8 -0
- package/.vscode/extensions.json +10 -0
- package/.vscode/settings.json +10 -0
- package/CNAME +1 -0
- package/Dockerfile.bot +14 -0
- package/README.md +162 -0
- package/babel.config.js +6 -0
- package/bin/cli.ts +61 -0
- package/data/0xBTC/data.json +19 -0
- package/data/0xBTC/logo.png +0 -0
- package/data/AAVE/data.json +19 -0
- package/data/AAVE/logo.svg +1 -0
- package/data/ACX/data.json +15 -0
- package/data/ACX/logo.png +0 -0
- package/data/AELIN/data.json +11 -0
- package/data/AELIN/logo.png +0 -0
- package/data/BAL/data.json +19 -0
- package/data/BAL/logo.png +0 -0
- package/data/BANK/data.json +15 -0
- package/data/BANK/logo.png +0 -0
- package/data/BAXA/data.json +22 -0
- package/data/BAXA/logo.svg +3 -0
- package/data/BOB/data.json +16 -0
- package/data/BOB/logo.svg +11 -0
- package/data/BOND/data.json +19 -0
- package/data/BOND/logo.svg +10 -0
- package/data/BitANT/data.json +19 -0
- package/data/BitANT/logo.png +0 -0
- package/data/BitBTC/data.json +31 -0
- package/data/BitBTC/logo.png +0 -0
- package/data/CRV/data.json +13 -0
- package/data/CRV/logo.png +0 -0
- package/data/CTSI/data.json +19 -0
- package/data/CTSI/logo.svg +23 -0
- package/data/DAI/data.json +43 -0
- package/data/DAI/logo.svg +13 -0
- package/data/DCN/data.json +25 -0
- package/data/DCN/logo.svg +47 -0
- package/data/DF/data.json +20 -0
- package/data/DF/logo.svg +15 -0
- package/data/DHT/data.json +13 -0
- package/data/DHT/logo.svg +1 -0
- package/data/DOLA/data.json +19 -0
- package/data/DOLA/logo.png +0 -0
- package/data/DUCK/data.json +13 -0
- package/data/DUCK/logo.png +0 -0
- package/data/ENS/data.json +13 -0
- package/data/ENS/logo.png +0 -0
- package/data/EQZ/data.json +19 -0
- package/data/EQZ/logo.png +0 -0
- package/data/EST/data.json +13 -0
- package/data/EST/logo.png +0 -0
- package/data/ETH/data.json +25 -0
- package/data/ETH/logo.svg +13 -0
- package/data/EURT/data.json +13 -0
- package/data/EURT/logo.png +0 -0
- package/data/FLASH/data.json +16 -0
- package/data/FLASH/logo.svg +22 -0
- package/data/GTC/data.json +19 -0
- package/data/GTC/logo.svg +5 -0
- package/data/GYSR/data.json +19 -0
- package/data/GYSR/logo.png +0 -0
- package/data/HAN/data.json +22 -0
- package/data/HAN/logo.svg +25 -0
- package/data/IBEX/data.json +16 -0
- package/data/IBEX/logo.png +0 -0
- package/data/INSURE/data.json +16 -0
- package/data/INSURE/logo.png +0 -0
- package/data/KNC/data.json +19 -0
- package/data/KNC/logo.png +0 -0
- package/data/KROM/data.json +19 -0
- package/data/KROM/logo.png +0 -0
- package/data/LAND/data.json +13 -0
- package/data/LAND/logo.png +0 -0
- package/data/LDO/data.json +30 -0
- package/data/LDO/logo.svg +5 -0
- package/data/LINK/data.json +25 -0
- package/data/LINK/logo.png +0 -0
- package/data/LIZ/data.json +19 -0
- package/data/LIZ/logo.png +0 -0
- package/data/LPF/data.json +15 -0
- package/data/LPF/logo.svg +18 -0
- package/data/LRC/data.json +13 -0
- package/data/LRC/logo.png +0 -0
- package/data/LUSD/data.json +13 -0
- package/data/LUSD/logo.svg +1 -0
- package/data/LYRA/data.json +13 -0
- package/data/LYRA/logo.png +0 -0
- package/data/MASK/data.json +13 -0
- package/data/MASK/logo.svg +4 -0
- package/data/MKR/data.json +14 -0
- package/data/MKR/logo.png +0 -0
- package/data/MOCHI/data.json +16 -0
- package/data/MOCHI/logo.svg +36 -0
- package/data/MOM/data.json +19 -0
- package/data/MOM/logo.svg +5 -0
- package/data/OP/data.json +14 -0
- package/data/OP/logo.png +0 -0
- package/data/OUTb/data.json +13 -0
- package/data/OUTb/logo.svg +4 -0
- package/data/PAPER/data.json +13 -0
- package/data/PAPER/logo.svg +4 -0
- package/data/PERP/data.json +25 -0
- package/data/PERP/logo.png +0 -0
- package/data/PHTK/data.json +16 -0
- package/data/PHTK/logo.svg +14 -0
- package/data/POOL/data.json +13 -0
- package/data/POOL/logo.svg +22 -0
- package/data/POP/data.json +16 -0
- package/data/POP/logo.svg +8 -0
- package/data/PREMIA/data.json +13 -0
- package/data/PREMIA/logo.svg +4 -0
- package/data/RAI/data.json +19 -0
- package/data/RAI/logo.svg +273 -0
- package/data/RFWSTETH/data.json +21 -0
- package/data/RFWSTETH/logo.svg +36 -0
- package/data/RGT/data.json +13 -0
- package/data/RGT/logo.png +0 -0
- package/data/SARCO/data.json +13 -0
- package/data/SARCO/logo.png +0 -0
- package/data/SDL/data.json +22 -0
- package/data/SDL/logo.svg +5 -0
- package/data/SNX/data.json +43 -0
- package/data/SNX/logo.svg +20 -0
- package/data/SPANK/data.json +19 -0
- package/data/SPANK/logo.png +0 -0
- package/data/SUKU/data.json +22 -0
- package/data/SUKU/logo.png +0 -0
- package/data/THALES/data.json +13 -0
- package/data/THALES/logo.png +0 -0
- package/data/TRB/data.json +22 -0
- package/data/TRB/logo.png +0 -0
- package/data/TUSD/data.json +19 -0
- package/data/TUSD/logo.png +0 -0
- package/data/TheDAO/data.json +32 -0
- package/data/TheDAO/logo.svg +1 -0
- package/data/UBI/data.json +22 -0
- package/data/UBI/logo.svg +5 -0
- package/data/UMA/data.json +13 -0
- package/data/UMA/logo.png +0 -0
- package/data/UNI/data.json +19 -0
- package/data/UNI/logo.png +0 -0
- package/data/USDC/data.json +28 -0
- package/data/USDC/logo.png +0 -0
- package/data/USDD/data.json +19 -0
- package/data/USDD/logo.png +0 -0
- package/data/USDT/data.json +28 -0
- package/data/USDT/logo.png +0 -0
- package/data/USDplus/data.json +14 -0
- package/data/USDplus/logo.svg +9 -0
- package/data/UST/data.json +13 -0
- package/data/UST/logo.png +0 -0
- package/data/USX/data.json +31 -0
- package/data/USX/logo.svg +14 -0
- package/data/VALX/data.json +15 -0
- package/data/VALX/logo.png +0 -0
- package/data/VELO/data.json +10 -0
- package/data/VELO/logo.svg +71 -0
- package/data/WAD/data.json +19 -0
- package/data/WAD/logo.png +0 -0
- package/data/WBTC/data.json +30 -0
- package/data/WBTC/logo.svg +20 -0
- package/data/WETH/data.json +11 -0
- package/data/WETH/logo.png +0 -0
- package/data/WMP/data.json +15 -0
- package/data/WMP/logo.svg +52 -0
- package/data/WOO/data.json +16 -0
- package/data/WOO/logo.svg +1489 -0
- package/data/XCHF/data.json +13 -0
- package/data/XCHF/logo.png +0 -0
- package/data/ZRX/data.json +13 -0
- package/data/ZRX/logo.png +0 -0
- package/data/aCRV/data.json +22 -0
- package/data/aCRV/logo.svg +9 -0
- package/data/alETH/data.json +16 -0
- package/data/alETH/logo.svg +17 -0
- package/data/rETH/data.json +13 -0
- package/data/rETH/logo.png +0 -0
- package/data/sBTC/data.json +11 -0
- package/data/sBTC/logo.svg +18 -0
- package/data/sETH/data.json +11 -0
- package/data/sETH/logo.svg +23 -0
- package/data/sLINK/data.json +11 -0
- package/data/sLINK/logo.svg +23 -0
- package/data/sUSD/data.json +17 -0
- package/data/sUSD/logo.svg +17 -0
- package/data/veKWENTA/data.json +22 -0
- package/data/veKWENTA/logo.svg +24 -0
- package/data/wstETH/data.json +31 -0
- package/data/wstETH/logo.svg +11 -0
- package/dist/declarations/src/index.d.ts +79 -0
- package/dist/eth-optimism-tokenlist.cjs.d.ts +1 -0
- package/dist/eth-optimism-tokenlist.cjs.dev.js +3098 -0
- package/dist/eth-optimism-tokenlist.cjs.js +7 -0
- package/dist/eth-optimism-tokenlist.cjs.prod.js +3098 -0
- package/dist/eth-optimism-tokenlist.esm.js +3090 -0
- package/jest.config.js +5 -0
- package/optimism.defaulttokens.json +26 -0
- package/optimism.svg +4 -0
- package/optimism.tokenlist.json +3086 -0
- package/package.json +80 -0
- package/src/abi.ts +77 -0
- package/src/bot.ts +236 -0
- package/src/chains.ts +58 -0
- package/src/generate.ts +69 -0
- package/src/index.ts +71 -0
- package/src/schemas.ts +174 -0
- package/src/types.ts +33 -0
- package/src/validate.ts +271 -0
- package/tests/__snapshots__/generate.test.ts.snap +87 -0
- package/tests/data/ETH/data.json +21 -0
- package/tests/data/ETH/logo.svg +13 -0
- package/tests/data/OP/data.json +16 -0
- package/tests/data/OP/logo.png +0 -0
- package/tests/defaultTokens.test.ts +12 -0
- package/tests/generate.test.ts +20 -0
- package/tsconfig.json +27 -0
package/.dockerignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules
|
package/.env.example
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
browser: true,
|
|
5
|
+
es6: true,
|
|
6
|
+
},
|
|
7
|
+
ignorePatterns: ['dist', 'coverage', 'packages/contracts/hardhat'],
|
|
8
|
+
extends: ['plugin:prettier/recommended'],
|
|
9
|
+
parser: '@babel/eslint-parser',
|
|
10
|
+
parserOptions: {
|
|
11
|
+
es6: true,
|
|
12
|
+
ecmaVersion: 6,
|
|
13
|
+
sourceType: 'module',
|
|
14
|
+
requireConfigFile: false,
|
|
15
|
+
},
|
|
16
|
+
plugins: [
|
|
17
|
+
'eslint-plugin-import',
|
|
18
|
+
'eslint-plugin-unicorn',
|
|
19
|
+
'eslint-plugin-jsdoc',
|
|
20
|
+
'eslint-plugin-prefer-arrow',
|
|
21
|
+
'eslint-plugin-react',
|
|
22
|
+
'@typescript-eslint',
|
|
23
|
+
],
|
|
24
|
+
overrides: [
|
|
25
|
+
{
|
|
26
|
+
files: ['**/*.ts'],
|
|
27
|
+
parser: '@typescript-eslint/parser',
|
|
28
|
+
parserOptions: {
|
|
29
|
+
project: './packages/**/tsconfig.json',
|
|
30
|
+
sourceType: 'module',
|
|
31
|
+
allowAutomaticSingleRunInference: true,
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
35
|
+
'@typescript-eslint/array-type': 'off',
|
|
36
|
+
'@typescript-eslint/ban-types': 'off',
|
|
37
|
+
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
38
|
+
'@typescript-eslint/dot-notation': 'off',
|
|
39
|
+
'@typescript-eslint/indent': 'off',
|
|
40
|
+
'@typescript-eslint/member-delimiter-style': [
|
|
41
|
+
'off',
|
|
42
|
+
{
|
|
43
|
+
multiline: {
|
|
44
|
+
delimiter: 'none',
|
|
45
|
+
requireLast: true,
|
|
46
|
+
},
|
|
47
|
+
singleline: {
|
|
48
|
+
delimiter: 'semi',
|
|
49
|
+
requireLast: false,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
'@typescript-eslint/member-ordering': 'off',
|
|
54
|
+
'@typescript-eslint/naming-convention': 'off',
|
|
55
|
+
'@typescript-eslint/no-empty-function': 'error',
|
|
56
|
+
'@typescript-eslint/no-empty-interface': 'off',
|
|
57
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
58
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
59
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
60
|
+
'@typescript-eslint/no-parameter-properties': 'off',
|
|
61
|
+
'@typescript-eslint/no-shadow': [
|
|
62
|
+
'error',
|
|
63
|
+
{
|
|
64
|
+
hoist: 'all',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
68
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
69
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
70
|
+
'@typescript-eslint/no-var-requires': 'error',
|
|
71
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
72
|
+
'@typescript-eslint/prefer-function-type': 'error',
|
|
73
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
74
|
+
'@typescript-eslint/quotes': 'off',
|
|
75
|
+
'@typescript-eslint/semi': ['off', null],
|
|
76
|
+
'@typescript-eslint/triple-slash-reference': [
|
|
77
|
+
'error',
|
|
78
|
+
{
|
|
79
|
+
path: 'always',
|
|
80
|
+
types: 'prefer-import',
|
|
81
|
+
lib: 'always',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
'@typescript-eslint/type-annotation-spacing': 'off',
|
|
85
|
+
'@typescript-eslint/unified-signatures': 'error',
|
|
86
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
rules: {
|
|
91
|
+
'prettier/prettier': 'warn',
|
|
92
|
+
'arrow-parens': ['off', 'always'],
|
|
93
|
+
'brace-style': ['off', 'off'],
|
|
94
|
+
'comma-dangle': 'off',
|
|
95
|
+
complexity: 'off',
|
|
96
|
+
'constructor-super': 'error',
|
|
97
|
+
curly: 'error',
|
|
98
|
+
'dot-notation': 'off',
|
|
99
|
+
'eol-last': 'off',
|
|
100
|
+
eqeqeq: ['error', 'smart'],
|
|
101
|
+
'guard-for-in': 'error',
|
|
102
|
+
'id-blacklist': 'off',
|
|
103
|
+
'id-match': 'off',
|
|
104
|
+
'import/no-extraneous-dependencies': ['error'],
|
|
105
|
+
'import/no-internal-modules': 'off',
|
|
106
|
+
'import/order': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
groups: ['builtin', 'external', 'internal'],
|
|
110
|
+
'newlines-between': 'always',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
indent: 'off',
|
|
114
|
+
'jsdoc/check-alignment': 'error',
|
|
115
|
+
'jsdoc/check-indentation': 'error',
|
|
116
|
+
'jsdoc/newline-after-description': 'error',
|
|
117
|
+
'linebreak-style': 'off',
|
|
118
|
+
'max-classes-per-file': 'off',
|
|
119
|
+
'max-len': 'off',
|
|
120
|
+
'new-parens': 'off',
|
|
121
|
+
'newline-per-chained-call': 'off',
|
|
122
|
+
'no-bitwise': 'off',
|
|
123
|
+
'no-caller': 'error',
|
|
124
|
+
'no-cond-assign': 'error',
|
|
125
|
+
'no-console': 'off',
|
|
126
|
+
'no-debugger': 'error',
|
|
127
|
+
'no-duplicate-case': 'error',
|
|
128
|
+
'no-duplicate-imports': 'error',
|
|
129
|
+
'no-empty': 'error',
|
|
130
|
+
'no-eval': 'error',
|
|
131
|
+
'no-extra-bind': 'error',
|
|
132
|
+
'no-extra-semi': 'off',
|
|
133
|
+
'no-fallthrough': 'off',
|
|
134
|
+
'no-invalid-this': 'off',
|
|
135
|
+
'no-irregular-whitespace': 'off',
|
|
136
|
+
'no-multiple-empty-lines': 'off',
|
|
137
|
+
'no-new-func': 'error',
|
|
138
|
+
'no-new-wrappers': 'error',
|
|
139
|
+
'no-redeclare': 'error',
|
|
140
|
+
'no-return-await': 'error',
|
|
141
|
+
'no-sequences': 'error',
|
|
142
|
+
'no-sparse-arrays': 'error',
|
|
143
|
+
'no-template-curly-in-string': 'error',
|
|
144
|
+
'no-throw-literal': 'error',
|
|
145
|
+
'no-trailing-spaces': 'off',
|
|
146
|
+
'no-undef-init': 'error',
|
|
147
|
+
'no-underscore-dangle': 'off',
|
|
148
|
+
'no-unsafe-finally': 'error',
|
|
149
|
+
'no-unused-expressions': 'off',
|
|
150
|
+
'no-unused-labels': 'error',
|
|
151
|
+
'no-use-before-define': 'off',
|
|
152
|
+
'no-var': 'error',
|
|
153
|
+
'object-shorthand': 'error',
|
|
154
|
+
'one-var': ['error', 'never'],
|
|
155
|
+
'padded-blocks': [
|
|
156
|
+
'off',
|
|
157
|
+
{
|
|
158
|
+
blocks: 'never',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
allowSingleLineBlocks: true,
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
'prefer-arrow/prefer-arrow-functions': 'error',
|
|
165
|
+
'prefer-const': 'error',
|
|
166
|
+
'prefer-object-spread': 'error',
|
|
167
|
+
'quote-props': 'off',
|
|
168
|
+
quotes: 'off',
|
|
169
|
+
radix: 'error',
|
|
170
|
+
'react/jsx-curly-spacing': 'off',
|
|
171
|
+
'react/jsx-equals-spacing': 'off',
|
|
172
|
+
'react/jsx-tag-spacing': [
|
|
173
|
+
'off',
|
|
174
|
+
{
|
|
175
|
+
afterOpening: 'allow',
|
|
176
|
+
closingSlash: 'allow',
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
'react/jsx-wrap-multilines': 'off',
|
|
180
|
+
semi: 'off',
|
|
181
|
+
'space-before-blocks': 'error',
|
|
182
|
+
'space-before-function-paren': 'off',
|
|
183
|
+
'space-in-parens': ['off', 'never'],
|
|
184
|
+
'unicorn/prefer-ternary': 'off',
|
|
185
|
+
'use-isnan': 'error',
|
|
186
|
+
'valid-typeof': 'off',
|
|
187
|
+
},
|
|
188
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@elenadimitrova
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
queue_rules:
|
|
2
|
+
- name: default
|
|
3
|
+
conditions: []
|
|
4
|
+
|
|
5
|
+
pull_request_rules:
|
|
6
|
+
- name: Ask to resolve conflict
|
|
7
|
+
conditions:
|
|
8
|
+
- conflict
|
|
9
|
+
actions:
|
|
10
|
+
comment:
|
|
11
|
+
message: Hey @{{author}}! This PR has merge conflicts. Please fix them before continuing review.
|
|
12
|
+
label:
|
|
13
|
+
add:
|
|
14
|
+
- conflict
|
|
15
|
+
|
|
16
|
+
- name: Remove conflicts label when conflicts gone
|
|
17
|
+
conditions:
|
|
18
|
+
- -conflict
|
|
19
|
+
actions:
|
|
20
|
+
label:
|
|
21
|
+
remove:
|
|
22
|
+
- conflict
|
|
23
|
+
|
|
24
|
+
- name: Notify author when merge queue failed
|
|
25
|
+
conditions:
|
|
26
|
+
- 'check-failure=Queue: Embarked in merge train'
|
|
27
|
+
actions:
|
|
28
|
+
comment:
|
|
29
|
+
message: |
|
|
30
|
+
Merge failed. Please see automated check logs for more details.
|
|
31
|
+
|
|
32
|
+
- name: automatic update prs
|
|
33
|
+
conditions:
|
|
34
|
+
- -conflict
|
|
35
|
+
- -draft
|
|
36
|
+
- label!="do-not-merge"
|
|
37
|
+
- 'base=master'
|
|
38
|
+
actions:
|
|
39
|
+
update:
|
|
40
|
+
|
|
41
|
+
- name: Say hi to contributors if they are not part of the regularcontributors team
|
|
42
|
+
conditions:
|
|
43
|
+
- author!=@regularcontributors
|
|
44
|
+
actions:
|
|
45
|
+
comment:
|
|
46
|
+
message: |
|
|
47
|
+
Thanks for creating the PR! We're stoked to see you building on Optimism.
|
|
48
|
+
Please give our team about a week to review your PR :)
|
|
49
|
+
|
|
50
|
+
- name: Say thanks
|
|
51
|
+
conditions:
|
|
52
|
+
- author!=@regularcontributors
|
|
53
|
+
- merged
|
|
54
|
+
actions:
|
|
55
|
+
comment:
|
|
56
|
+
message: |
|
|
57
|
+
Congrats! Your token has been merged. Consider joining our Discord to stay up to date with other builders in the ecosystem. Make sure to drink plenty of water.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: 'npm'
|
|
4
|
+
directory: '/'
|
|
5
|
+
schedule:
|
|
6
|
+
interval: 'monthly'
|
|
7
|
+
open-pull-requests-limit: 2
|
|
8
|
+
|
|
9
|
+
- package-ecosystem: 'github-actions'
|
|
10
|
+
directory: '/'
|
|
11
|
+
schedule:
|
|
12
|
+
interval: 'monthly'
|
|
13
|
+
open-pull-requests-limit: 2
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: Generate Token List
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches: [master]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
generate:
|
|
10
|
+
name: generate
|
|
11
|
+
if: |
|
|
12
|
+
github.event.head_commit.committer.username != 'github-actions[bot]'
|
|
13
|
+
&& github.repository == 'ethereum-optimism/ethereum-optimism.github.io'
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v2
|
|
19
|
+
with:
|
|
20
|
+
token: ${{ secrets.PAT }}
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Use Node.js 16.x
|
|
24
|
+
uses: actions/setup-node@v2
|
|
25
|
+
with:
|
|
26
|
+
node-version: 16.x
|
|
27
|
+
|
|
28
|
+
- name: Get yarn cache directory path
|
|
29
|
+
id: yarn-cache-dir-path
|
|
30
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
31
|
+
|
|
32
|
+
- uses: actions/cache@v2
|
|
33
|
+
id: yarn-cache
|
|
34
|
+
with:
|
|
35
|
+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
36
|
+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
37
|
+
restore-keys: |
|
|
38
|
+
${{ runner.os }}-yarn-
|
|
39
|
+
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
run: yarn --frozen-lockfile
|
|
42
|
+
|
|
43
|
+
- name: Patch token list version
|
|
44
|
+
run: |
|
|
45
|
+
git config --global user.email "will@oplabs.co"
|
|
46
|
+
git config --global user.name "Github action bot"
|
|
47
|
+
npm version patch
|
|
48
|
+
|
|
49
|
+
- name: Generate token list
|
|
50
|
+
run: |
|
|
51
|
+
yarn generate:ci
|
|
52
|
+
|
|
53
|
+
- name: Commit token list
|
|
54
|
+
uses: stefanzweifel/git-auto-commit-action@v4
|
|
55
|
+
with:
|
|
56
|
+
commit_message: 'bot(ci): generate token list'
|
|
57
|
+
file_pattern: optimism.tokenlist.json
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Publish Packages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish-bot:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout
|
|
13
|
+
uses: actions/checkout@v2
|
|
14
|
+
|
|
15
|
+
- name: Get changed files
|
|
16
|
+
id: changed-files
|
|
17
|
+
uses: tj-actions/changed-files@v29
|
|
18
|
+
with:
|
|
19
|
+
files: |
|
|
20
|
+
bin/**
|
|
21
|
+
src/bot.ts
|
|
22
|
+
package.json
|
|
23
|
+
yarn.lock
|
|
24
|
+
Dockerfile.bot
|
|
25
|
+
|
|
26
|
+
- name: Set up QEMU
|
|
27
|
+
uses: docker/setup-qemu-action@v2
|
|
28
|
+
|
|
29
|
+
- name: Set up Docker Buildx
|
|
30
|
+
uses: docker/setup-buildx-action@v2
|
|
31
|
+
|
|
32
|
+
- name: Login to DockerHub
|
|
33
|
+
uses: docker/login-action@v2
|
|
34
|
+
with:
|
|
35
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
36
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
37
|
+
|
|
38
|
+
- name: Build and push
|
|
39
|
+
uses: docker/build-push-action@v3
|
|
40
|
+
with:
|
|
41
|
+
push: true
|
|
42
|
+
tags: ethereumoptimism/tokenlist-bot:latest
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies to prepare for release 🔧
|
|
45
|
+
run: yarn
|
|
46
|
+
|
|
47
|
+
- name: Build and publish package on NPM 📦
|
|
48
|
+
run: yarn release
|
|
49
|
+
env:
|
|
50
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: 'Close stale issues and PRs'
|
|
2
|
+
on:
|
|
3
|
+
schedule:
|
|
4
|
+
- cron: '30 1 * * *'
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
stale:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/stale@v6
|
|
11
|
+
with:
|
|
12
|
+
stale-issue-message: 'This issue has been automatically marked as stale and will be closed in 7 days if no updates'
|
|
13
|
+
stale-pr-message: 'This pr has been automatically marked as stale and will be closed in 7 days if no updates'
|
|
14
|
+
close-issue-message: 'This issue was closed as stale. Please reopen if this is a mistake'
|
|
15
|
+
close-pr-message: 'This PR was closed as stale. Please reopen if this is a mistake'
|
|
16
|
+
days-before-issue-stale: 7
|
|
17
|
+
days-before-pr-stale: 7
|
|
18
|
+
days-before-issue-close: 7
|
|
19
|
+
days-before-pr-close: 7
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Test Scripts
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: test
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
node-version: [16.x]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v2
|
|
20
|
+
|
|
21
|
+
- name: Use Node.js 16.x
|
|
22
|
+
uses: actions/setup-node@v2
|
|
23
|
+
with:
|
|
24
|
+
node-version: 16.x
|
|
25
|
+
|
|
26
|
+
- name: Get yarn cache directory path
|
|
27
|
+
id: yarn-cache-dir-path
|
|
28
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
29
|
+
|
|
30
|
+
- uses: actions/cache@v2
|
|
31
|
+
id: yarn-cache
|
|
32
|
+
with:
|
|
33
|
+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
34
|
+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
35
|
+
restore-keys: |
|
|
36
|
+
${{ runner.os }}-yarn-
|
|
37
|
+
|
|
38
|
+
- name: Install dependencies
|
|
39
|
+
run: yarn --frozen-lockfile
|
|
40
|
+
|
|
41
|
+
- name: Run Test
|
|
42
|
+
run: |
|
|
43
|
+
npm run test
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Validate PR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
validate:
|
|
11
|
+
name: validate
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v2
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Use Node.js 16.x
|
|
20
|
+
uses: actions/setup-node@v2
|
|
21
|
+
with:
|
|
22
|
+
node-version: 16.x
|
|
23
|
+
|
|
24
|
+
- name: Get yarn cache directory path
|
|
25
|
+
id: yarn-cache-dir-path
|
|
26
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
27
|
+
|
|
28
|
+
- uses: actions/cache@v2
|
|
29
|
+
id: yarn-cache
|
|
30
|
+
with:
|
|
31
|
+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
32
|
+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
33
|
+
restore-keys: |
|
|
34
|
+
${{ runner.os }}-yarn-
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: yarn --frozen-lockfile
|
|
38
|
+
|
|
39
|
+
- name: Save PR number
|
|
40
|
+
run: echo ${{ github.event.number }} > pr.txt
|
|
41
|
+
|
|
42
|
+
- name: Get changed files
|
|
43
|
+
id: changed-files
|
|
44
|
+
uses: tj-actions/changed-files@v29
|
|
45
|
+
with:
|
|
46
|
+
files: |
|
|
47
|
+
data/**
|
|
48
|
+
|
|
49
|
+
- name: Validate token list
|
|
50
|
+
run: |
|
|
51
|
+
CHANGED=$(echo ${{ steps.changed-files.outputs.all_changed_files }} | sed -nr "s/data\/(.*?)\/.*/\1/p" | paste -sd "," -)
|
|
52
|
+
yarn validate --datadir ./data --tokens "${CHANGED}" 2> err.txt 1> std.txt
|
|
53
|
+
|
|
54
|
+
- name: Print output
|
|
55
|
+
if: ${{ always() }}
|
|
56
|
+
run: |
|
|
57
|
+
cat std.txt; cat err.txt
|
|
58
|
+
|
|
59
|
+
- name: Upload artifacts
|
|
60
|
+
if: ${{ always() }}
|
|
61
|
+
uses: actions/upload-artifact@v3
|
|
62
|
+
with:
|
|
63
|
+
name: logs-artifact
|
|
64
|
+
path: |
|
|
65
|
+
pr.txt
|
|
66
|
+
err.txt
|
|
67
|
+
std.txt
|
package/.prettierrc.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
|
|
3
|
+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
|
4
|
+
|
|
5
|
+
// List of extensions which should be recommended for users of this workspace.
|
|
6
|
+
"recommendations": [
|
|
7
|
+
"dbaeumer.vscode-eslint",
|
|
8
|
+
"editorconfig.editorconfig",
|
|
9
|
+
],
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[typescript]": {
|
|
3
|
+
"editor.defaultFormatter": "vscode.typescript-language-features",
|
|
4
|
+
"editor.formatOnSave": true
|
|
5
|
+
},
|
|
6
|
+
"eslint.nodePath": "./node_modules/eslint/bin/",
|
|
7
|
+
"eslint.format.enable": true,
|
|
8
|
+
"editorconfig.generateAuto": false,
|
|
9
|
+
"files.trimTrailingWhitespace": true
|
|
10
|
+
}
|
package/CNAME
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
static.optimism.io
|