@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.
Files changed (228) hide show
  1. package/.dockerignore +1 -0
  2. package/.env.example +2 -0
  3. package/.eslintrc.js +188 -0
  4. package/.github/CODEOWNERS +1 -0
  5. package/.github/mergify.yml +57 -0
  6. package/.github/workflows/dependabot.yml +13 -0
  7. package/.github/workflows/generate.yml +57 -0
  8. package/.github/workflows/publish.yml +50 -0
  9. package/.github/workflows/stale.yml +19 -0
  10. package/.github/workflows/test.yml +43 -0
  11. package/.github/workflows/validate.yml +67 -0
  12. package/.prettierrc.js +8 -0
  13. package/.vscode/extensions.json +10 -0
  14. package/.vscode/settings.json +10 -0
  15. package/CNAME +1 -0
  16. package/Dockerfile.bot +14 -0
  17. package/README.md +162 -0
  18. package/babel.config.js +6 -0
  19. package/bin/cli.ts +61 -0
  20. package/data/0xBTC/data.json +19 -0
  21. package/data/0xBTC/logo.png +0 -0
  22. package/data/AAVE/data.json +19 -0
  23. package/data/AAVE/logo.svg +1 -0
  24. package/data/ACX/data.json +15 -0
  25. package/data/ACX/logo.png +0 -0
  26. package/data/AELIN/data.json +11 -0
  27. package/data/AELIN/logo.png +0 -0
  28. package/data/BAL/data.json +19 -0
  29. package/data/BAL/logo.png +0 -0
  30. package/data/BANK/data.json +15 -0
  31. package/data/BANK/logo.png +0 -0
  32. package/data/BAXA/data.json +22 -0
  33. package/data/BAXA/logo.svg +3 -0
  34. package/data/BOB/data.json +16 -0
  35. package/data/BOB/logo.svg +11 -0
  36. package/data/BOND/data.json +19 -0
  37. package/data/BOND/logo.svg +10 -0
  38. package/data/BitANT/data.json +19 -0
  39. package/data/BitANT/logo.png +0 -0
  40. package/data/BitBTC/data.json +31 -0
  41. package/data/BitBTC/logo.png +0 -0
  42. package/data/CRV/data.json +13 -0
  43. package/data/CRV/logo.png +0 -0
  44. package/data/CTSI/data.json +19 -0
  45. package/data/CTSI/logo.svg +23 -0
  46. package/data/DAI/data.json +43 -0
  47. package/data/DAI/logo.svg +13 -0
  48. package/data/DCN/data.json +25 -0
  49. package/data/DCN/logo.svg +47 -0
  50. package/data/DF/data.json +20 -0
  51. package/data/DF/logo.svg +15 -0
  52. package/data/DHT/data.json +13 -0
  53. package/data/DHT/logo.svg +1 -0
  54. package/data/DOLA/data.json +19 -0
  55. package/data/DOLA/logo.png +0 -0
  56. package/data/DUCK/data.json +13 -0
  57. package/data/DUCK/logo.png +0 -0
  58. package/data/ENS/data.json +13 -0
  59. package/data/ENS/logo.png +0 -0
  60. package/data/EQZ/data.json +19 -0
  61. package/data/EQZ/logo.png +0 -0
  62. package/data/EST/data.json +13 -0
  63. package/data/EST/logo.png +0 -0
  64. package/data/ETH/data.json +25 -0
  65. package/data/ETH/logo.svg +13 -0
  66. package/data/EURT/data.json +13 -0
  67. package/data/EURT/logo.png +0 -0
  68. package/data/FLASH/data.json +16 -0
  69. package/data/FLASH/logo.svg +22 -0
  70. package/data/GTC/data.json +19 -0
  71. package/data/GTC/logo.svg +5 -0
  72. package/data/GYSR/data.json +19 -0
  73. package/data/GYSR/logo.png +0 -0
  74. package/data/HAN/data.json +22 -0
  75. package/data/HAN/logo.svg +25 -0
  76. package/data/IBEX/data.json +16 -0
  77. package/data/IBEX/logo.png +0 -0
  78. package/data/INSURE/data.json +16 -0
  79. package/data/INSURE/logo.png +0 -0
  80. package/data/KNC/data.json +19 -0
  81. package/data/KNC/logo.png +0 -0
  82. package/data/KROM/data.json +19 -0
  83. package/data/KROM/logo.png +0 -0
  84. package/data/LAND/data.json +13 -0
  85. package/data/LAND/logo.png +0 -0
  86. package/data/LDO/data.json +30 -0
  87. package/data/LDO/logo.svg +5 -0
  88. package/data/LINK/data.json +25 -0
  89. package/data/LINK/logo.png +0 -0
  90. package/data/LIZ/data.json +19 -0
  91. package/data/LIZ/logo.png +0 -0
  92. package/data/LPF/data.json +15 -0
  93. package/data/LPF/logo.svg +18 -0
  94. package/data/LRC/data.json +13 -0
  95. package/data/LRC/logo.png +0 -0
  96. package/data/LUSD/data.json +13 -0
  97. package/data/LUSD/logo.svg +1 -0
  98. package/data/LYRA/data.json +13 -0
  99. package/data/LYRA/logo.png +0 -0
  100. package/data/MASK/data.json +13 -0
  101. package/data/MASK/logo.svg +4 -0
  102. package/data/MKR/data.json +14 -0
  103. package/data/MKR/logo.png +0 -0
  104. package/data/MOCHI/data.json +16 -0
  105. package/data/MOCHI/logo.svg +36 -0
  106. package/data/MOM/data.json +19 -0
  107. package/data/MOM/logo.svg +5 -0
  108. package/data/OP/data.json +14 -0
  109. package/data/OP/logo.png +0 -0
  110. package/data/OUTb/data.json +13 -0
  111. package/data/OUTb/logo.svg +4 -0
  112. package/data/PAPER/data.json +13 -0
  113. package/data/PAPER/logo.svg +4 -0
  114. package/data/PERP/data.json +25 -0
  115. package/data/PERP/logo.png +0 -0
  116. package/data/PHTK/data.json +16 -0
  117. package/data/PHTK/logo.svg +14 -0
  118. package/data/POOL/data.json +13 -0
  119. package/data/POOL/logo.svg +22 -0
  120. package/data/POP/data.json +16 -0
  121. package/data/POP/logo.svg +8 -0
  122. package/data/PREMIA/data.json +13 -0
  123. package/data/PREMIA/logo.svg +4 -0
  124. package/data/RAI/data.json +19 -0
  125. package/data/RAI/logo.svg +273 -0
  126. package/data/RFWSTETH/data.json +21 -0
  127. package/data/RFWSTETH/logo.svg +36 -0
  128. package/data/RGT/data.json +13 -0
  129. package/data/RGT/logo.png +0 -0
  130. package/data/SARCO/data.json +13 -0
  131. package/data/SARCO/logo.png +0 -0
  132. package/data/SDL/data.json +22 -0
  133. package/data/SDL/logo.svg +5 -0
  134. package/data/SNX/data.json +43 -0
  135. package/data/SNX/logo.svg +20 -0
  136. package/data/SPANK/data.json +19 -0
  137. package/data/SPANK/logo.png +0 -0
  138. package/data/SUKU/data.json +22 -0
  139. package/data/SUKU/logo.png +0 -0
  140. package/data/THALES/data.json +13 -0
  141. package/data/THALES/logo.png +0 -0
  142. package/data/TRB/data.json +22 -0
  143. package/data/TRB/logo.png +0 -0
  144. package/data/TUSD/data.json +19 -0
  145. package/data/TUSD/logo.png +0 -0
  146. package/data/TheDAO/data.json +32 -0
  147. package/data/TheDAO/logo.svg +1 -0
  148. package/data/UBI/data.json +22 -0
  149. package/data/UBI/logo.svg +5 -0
  150. package/data/UMA/data.json +13 -0
  151. package/data/UMA/logo.png +0 -0
  152. package/data/UNI/data.json +19 -0
  153. package/data/UNI/logo.png +0 -0
  154. package/data/USDC/data.json +28 -0
  155. package/data/USDC/logo.png +0 -0
  156. package/data/USDD/data.json +19 -0
  157. package/data/USDD/logo.png +0 -0
  158. package/data/USDT/data.json +28 -0
  159. package/data/USDT/logo.png +0 -0
  160. package/data/USDplus/data.json +14 -0
  161. package/data/USDplus/logo.svg +9 -0
  162. package/data/UST/data.json +13 -0
  163. package/data/UST/logo.png +0 -0
  164. package/data/USX/data.json +31 -0
  165. package/data/USX/logo.svg +14 -0
  166. package/data/VALX/data.json +15 -0
  167. package/data/VALX/logo.png +0 -0
  168. package/data/VELO/data.json +10 -0
  169. package/data/VELO/logo.svg +71 -0
  170. package/data/WAD/data.json +19 -0
  171. package/data/WAD/logo.png +0 -0
  172. package/data/WBTC/data.json +30 -0
  173. package/data/WBTC/logo.svg +20 -0
  174. package/data/WETH/data.json +11 -0
  175. package/data/WETH/logo.png +0 -0
  176. package/data/WMP/data.json +15 -0
  177. package/data/WMP/logo.svg +52 -0
  178. package/data/WOO/data.json +16 -0
  179. package/data/WOO/logo.svg +1489 -0
  180. package/data/XCHF/data.json +13 -0
  181. package/data/XCHF/logo.png +0 -0
  182. package/data/ZRX/data.json +13 -0
  183. package/data/ZRX/logo.png +0 -0
  184. package/data/aCRV/data.json +22 -0
  185. package/data/aCRV/logo.svg +9 -0
  186. package/data/alETH/data.json +16 -0
  187. package/data/alETH/logo.svg +17 -0
  188. package/data/rETH/data.json +13 -0
  189. package/data/rETH/logo.png +0 -0
  190. package/data/sBTC/data.json +11 -0
  191. package/data/sBTC/logo.svg +18 -0
  192. package/data/sETH/data.json +11 -0
  193. package/data/sETH/logo.svg +23 -0
  194. package/data/sLINK/data.json +11 -0
  195. package/data/sLINK/logo.svg +23 -0
  196. package/data/sUSD/data.json +17 -0
  197. package/data/sUSD/logo.svg +17 -0
  198. package/data/veKWENTA/data.json +22 -0
  199. package/data/veKWENTA/logo.svg +24 -0
  200. package/data/wstETH/data.json +31 -0
  201. package/data/wstETH/logo.svg +11 -0
  202. package/dist/declarations/src/index.d.ts +79 -0
  203. package/dist/eth-optimism-tokenlist.cjs.d.ts +1 -0
  204. package/dist/eth-optimism-tokenlist.cjs.dev.js +3098 -0
  205. package/dist/eth-optimism-tokenlist.cjs.js +7 -0
  206. package/dist/eth-optimism-tokenlist.cjs.prod.js +3098 -0
  207. package/dist/eth-optimism-tokenlist.esm.js +3090 -0
  208. package/jest.config.js +5 -0
  209. package/optimism.defaulttokens.json +26 -0
  210. package/optimism.svg +4 -0
  211. package/optimism.tokenlist.json +3086 -0
  212. package/package.json +80 -0
  213. package/src/abi.ts +77 -0
  214. package/src/bot.ts +236 -0
  215. package/src/chains.ts +58 -0
  216. package/src/generate.ts +69 -0
  217. package/src/index.ts +71 -0
  218. package/src/schemas.ts +174 -0
  219. package/src/types.ts +33 -0
  220. package/src/validate.ts +271 -0
  221. package/tests/__snapshots__/generate.test.ts.snap +87 -0
  222. package/tests/data/ETH/data.json +21 -0
  223. package/tests/data/ETH/logo.svg +13 -0
  224. package/tests/data/OP/data.json +16 -0
  225. package/tests/data/OP/logo.png +0 -0
  226. package/tests/defaultTokens.test.ts +12 -0
  227. package/tests/generate.test.ts +20 -0
  228. package/tsconfig.json +27 -0
package/.dockerignore ADDED
@@ -0,0 +1 @@
1
+ node_modules
package/.env.example ADDED
@@ -0,0 +1,2 @@
1
+ TOKEN_LIST_BOT__SECRET=
2
+ TOKEN_LIST_BOT__PAT=
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,8 @@
1
+ module.exports = {
2
+ $schema: 'http://json.schemastore.org/prettierrc',
3
+ trailingComma: 'es5',
4
+ tabWidth: 2,
5
+ semi: false,
6
+ singleQuote: true,
7
+ arrowParens: 'always',
8
+ }
@@ -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
package/Dockerfile.bot ADDED
@@ -0,0 +1,14 @@
1
+ FROM node:16-alpine3.14
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package*.json /app
6
+ COPY yarn.lock /app
7
+
8
+ RUN yarn install
9
+
10
+ COPY . /app
11
+
12
+ CMD [ "yarn", "start-bot" ]
13
+
14
+ EXPOSE 7300