@uniswap/token-list-bridge-utils 0.1.1-beta.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 (61) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +17 -0
  3. package/dist/arb-token-lists/server/app.d.ts +1 -0
  4. package/dist/arb-token-lists/src/lib/getClargs.d.ts +8 -0
  5. package/dist/arb-token-lists/src/lib/graph.d.ts +2 -0
  6. package/dist/arb-token-lists/src/lib/instantiate_bridge.d.ts +15 -0
  7. package/dist/arb-token-lists/src/lib/token_list_gen.d.ts +23 -0
  8. package/dist/arb-token-lists/src/lib/types.d.ts +36 -0
  9. package/dist/arb-token-lists/src/lib/utils.d.ts +18 -0
  10. package/dist/arb-token-lists/src/main.d.ts +1 -0
  11. package/dist/constants/chainId.d.ts +10 -0
  12. package/dist/constants/tokens.d.ts +5 -0
  13. package/dist/fixtures/index.d.ts +24 -0
  14. package/dist/index.d.ts +18 -0
  15. package/dist/index.js +8 -0
  16. package/dist/providers/ArbitrumMappingProvider.d.ts +11 -0
  17. package/dist/providers/MappingProvider.d.ts +4 -0
  18. package/dist/providers/OptimismMappingProvider.d.ts +10 -0
  19. package/dist/providers/PolygonMappingProvider.d.ts +9 -0
  20. package/dist/providers/index.d.ts +5 -0
  21. package/dist/token-list-bridge-utils.cjs.development.js +2217 -0
  22. package/dist/token-list-bridge-utils.cjs.development.js.map +1 -0
  23. package/dist/token-list-bridge-utils.cjs.production.min.js +2 -0
  24. package/dist/token-list-bridge-utils.cjs.production.min.js.map +1 -0
  25. package/dist/token-list-bridge-utils.esm.js +2201 -0
  26. package/dist/token-list-bridge-utils.esm.js.map +1 -0
  27. package/dist/utils.d.ts +4 -0
  28. package/dist/verify.d.ts +9 -0
  29. package/package.json +68 -0
  30. package/src/arb-token-lists/.env.sample +4 -0
  31. package/src/arb-token-lists/.eslintrc.js +43 -0
  32. package/src/arb-token-lists/.gitignore +4 -0
  33. package/src/arb-token-lists/package.json +40 -0
  34. package/src/arb-token-lists/readme.md +14 -0
  35. package/src/arb-token-lists/server/app.ts +21 -0
  36. package/src/arb-token-lists/src/Assets/coingecko_uris.json +5108 -0
  37. package/src/arb-token-lists/src/Assets/logo_uris.json +44 -0
  38. package/src/arb-token-lists/src/WarningList/warningTokens.json +290 -0
  39. package/src/arb-token-lists/src/lib/getClargs.ts +32 -0
  40. package/src/arb-token-lists/src/lib/graph.ts +116 -0
  41. package/src/arb-token-lists/src/lib/instantiate_bridge.ts +35 -0
  42. package/src/arb-token-lists/src/lib/token_list_gen.ts +334 -0
  43. package/src/arb-token-lists/src/lib/types.ts +44 -0
  44. package/src/arb-token-lists/src/lib/utils.ts +285 -0
  45. package/src/arb-token-lists/src/main.ts +54 -0
  46. package/src/arb-token-lists/tsconfig.json +20 -0
  47. package/src/arb-token-lists/update_all +6 -0
  48. package/src/arb-token-lists/yarn.lock +4273 -0
  49. package/src/constants/chainId.ts +13 -0
  50. package/src/constants/tokens.ts +31 -0
  51. package/src/fixtures/index.ts +104 -0
  52. package/src/index.test.ts +211 -0
  53. package/src/index.ts +92 -0
  54. package/src/providers/ArbitrumMappingProvider.ts +28 -0
  55. package/src/providers/MappingProvider.ts +5 -0
  56. package/src/providers/OptimismMappingProvider.ts +13 -0
  57. package/src/providers/PolygonMappingProvider.ts +127 -0
  58. package/src/providers/index.ts +17 -0
  59. package/src/utils.ts +21 -0
  60. package/src/verify.test.ts +19 -0
  61. package/src/verify.ts +60 -0
@@ -0,0 +1,44 @@
1
+ {
2
+ "0x0000000000085d4780b73119b644ae5ecd22b376": "https://images.prismic.io/tusd-homepage/fb4d581a-95ed-404c-b9de-7ab1365c1386_%E5%9B%BE%E5%B1%82+1.png",
3
+ "0x0391d2021f89dc339f60fff84546ea23e337750f": "https://cryptologos.cc/logos/barnbridge-bond-logo.png",
4
+ "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2": "https://cryptologos.cc/logos/sushiswap-sushi-logo.png",
5
+ "0xd533a949740bb3306d119cc777fa900ba034cd52": "https://cryptologos.cc/logos/curve-dao-token-crv-logo.png",
6
+ "0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e": "https://cryptologos.cc/logos/yearn-finance-yfi-logo.png",
7
+ "0x2ba592f78db6436527729929aaf6c908497cb200": "https://cryptologos.cc/logos/cream-finance-cream-logo.png",
8
+ "0x7645ddfeeceda57e41f92679c4acd83c56a81d14": "https://cryptologos.cc/logos/zel-flux-logo.png",
9
+ "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2": "https://cryptologos.cc/logos/maker-mkr-logo.png",
10
+ "0xba100000625a3754423978a60c9317c58a424e3d": "https://cryptologos.cc/logos/balancer-bal-logo.png",
11
+ "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd": "https://cryptologos.cc/logos/loopring-lrc-logo.png",
12
+ "0xddb3422497e61e13543bea06989c0789117555c5": "https://cryptologos.cc/logos/coti-coti-logo.png",
13
+ "0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd": "https://etherscan.io/token/images/dodo_32.png",
14
+ "0x03ab458634910aad20ef5f1c8ee96f1d6ac54919": "https://etherscan.io/token/images/raireflexindex_32.png",
15
+ "0x043c308bb8a5ae96d0093444be7f56459f1340b1": "https://etherscan.io/token/images/sumswap_32.png",
16
+ "0x090185f2135308bad17527004364ebcc2d37e5f6": "https://etherscan.io/token/images/spelltoken_32.png",
17
+ "0x0a5e677a6a24b2f1a2bf4f3bffc443231d2fdec8": "https://etherscan.io/token/images/dforceusd_32.png",
18
+ "0x0e192d382a36de7011f795acc4391cd302003606": "https://etherscan.io/token/images/futureswap2_32.png",
19
+ "0x0ff5a8451a839f5f0bb3562689d9a44089738d11": "https://etherscan.io/token/images/dopexrebate_32.png",
20
+ "0x27c4af9a860c4cadc358005f8b48140b2e434a7b": "https://etherscan.io/token/images/validator_32.png",
21
+ "0x3258cd8134b6b28e814772dd91d5ecceea512818": "https://etherscan.io/token/images/farmland_32.png",
22
+ "0x3472a5a71965499acd81997a54bba8d852c6e53d": "https://etherscan.io/token/images/badger_32.png",
23
+ "0x41a3dba3d677e573636ba691a70ff2d606c29666": "https://etherscan.io/token/images/blanktoken_32.png",
24
+ "0x429876c4a6f89fb470e92456b8313879df98b63c": "https://etherscan.io/token/images/cryptionnetwork_32.png",
25
+ "0x429881672b9ae42b8eba0e26cd9c73711b891ca5": "https://etherscan.io/token/images/pickle_32.png",
26
+ "0x4e0fca55a6c3a94720ded91153a27f60e26b9aa8": "https://etherscan.io/token/images/boostcoin_32.png",
27
+ "0x7b35ce522cb72e4077baeb96cb923a5529764a00": "https://etherscan.io/token/images/impermax_32.png",
28
+ "0x8d610e20481f4c4f3acb87bba9c46bef7795fdfe": "https://etherscan.io/token/images/unitynetwork_32.png",
29
+ "0x9695e0114e12c0d3a3636fab5a18e6b737529023": "https://etherscan.io/token/images/dfynnetwork_32.png",
30
+ "0x97872eafd79940c7b24f7bcc1eadb1457347adc9": "https://etherscan.io/token/images/strips_32.png",
31
+ "0x9b99cca871be05119b2012fd4474731dd653febe": "https://etherscan.io/token/images/antimatter_32.png",
32
+ "0xb683d83a532e2cb7dfa5275eed3698436371cc9f": "https://etherscan.io/token/images/btu_32.png",
33
+ "0xb986f3a2d91d3704dc974a24fb735dcc5e3c1e70": "https://etherscan.io/token/images/dforceeur_32.png",
34
+ "0xbaac2b4491727d78d2b78815144570b9f2fe8899": "https://etherscan.io/token/images/thedogenft_32.png",
35
+ "0xca1207647ff814039530d7d35df0e1dd2e91fa84": "https://etherscan.io/token/images/dHedge_32.png",
36
+ "0xd291e7a03283640fdc51b121ac401383a46cc623": "https://etherscan.io/token/images/RariGovernanceToken_32.png",
37
+ "0xdddddd4301a082e62e84e43f474f044423921918": "https://etherscan.io/token/images/dvf_32.png",
38
+ "0xdeeb6091a5adc78fa0332bee5a38a8908b6b566e": "https://etherscan.io/token/images/tkdcoop_32.png",
39
+ "0xdfdb7f72c1f195c5951a234e8db9806eb0635346": "https://etherscan.io/token/images/feistydoge_32.png",
40
+ "0xeec2be5c91ae7f8a338e1e5f3b5de49d07afdc81": "https://etherscan.io/token/images/dopexgovernance_32.png",
41
+ "0xc18360217d8f7ab5e7c516566761ea12ce7f9d72": "https://etherscan.io/token/images/ens2_32.png",
42
+ "0xf8e9f10c22840b613cda05a0c5fdb59a4d6cd7ef": "https://etherscan.io/token/images/dogsofelon_32.png"
43
+
44
+ }
@@ -0,0 +1,290 @@
1
+ {
2
+ "0x383518188c0c6d7730d91b2c03a03c837814a899": {
3
+ "address": "0x383518188c0c6d7730d91b2c03a03c837814a899",
4
+ "type": 0
5
+ },
6
+ "0x0e2298e3b3390e3b945a5456fbf59ecc3f55da16": {
7
+ "address": "0x0e2298e3b3390e3b945a5456fbf59ecc3f55da16",
8
+ "type": 0
9
+ },
10
+ "0xd46ba6d942050d489dbd938a2c909a5d5039a161": {
11
+ "address": "0xd46ba6d942050d489dbd938a2c909a5d5039a161",
12
+ "type": 0
13
+ },
14
+ "0x798d1be841a82a273720ce31c822c61a67a601c3": {
15
+ "address": "0x798d1be841a82a273720ce31c822c61a67a601c3",
16
+ "type": 0
17
+ },
18
+ "0xe8b251822d003a2b2466ee0e38391c2db2048739": {
19
+ "address": "0xe8b251822d003a2b2466ee0e38391c2db2048739",
20
+ "type": 0
21
+ },
22
+ "0x3d1e3c5f658d74c585267350cac22fd44e8d951c": {
23
+ "address": "0x3d1e3c5f658d74c585267350cac22fd44e8d951c",
24
+ "type": 0
25
+ },
26
+ "0x67c597624b17b16fb77959217360b7cd18284253": {
27
+ "address": "0x67c597624b17b16fb77959217360b7cd18284253",
28
+ "type": 0
29
+ },
30
+ "0x1c7bbadc81e18f7177a95eb1593e5f5f35861b10": {
31
+ "address": "0x1c7bbadc81e18f7177a95eb1593e5f5f35861b10",
32
+ "type": 0
33
+ },
34
+ "0x68a118ef45063051eac49c7e647ce5ace48a68a5": {
35
+ "address": "0x68a118ef45063051eac49c7e647ce5ace48a68a5",
36
+ "type": 0
37
+ },
38
+ "0x2f6081e3552b1c86ce4479b80062a1dda8ef23e3": {
39
+ "address": "0x2f6081e3552b1c86ce4479b80062a1dda8ef23e3",
40
+ "type": 0
41
+ },
42
+ "0x07150e919b4de5fd6a63de1f9384828396f25fdc": {
43
+ "address": "0x07150e919b4de5fd6a63de1f9384828396f25fdc",
44
+ "type": 0
45
+ },
46
+ "0x39795344cbcc76cc3fb94b9d1b15c23c2070c66d": {
47
+ "address": "0x39795344cbcc76cc3fb94b9d1b15c23c2070c66d",
48
+ "type": 0
49
+ },
50
+ "0x9248c485b0b80f76da451f167a8db30f33c70907": {
51
+ "address": "0x9248c485b0b80f76da451f167a8db30f33c70907",
52
+ "type": 0
53
+ },
54
+ "0x7777770f8a6632ff043c8833310e245eba9209e6": {
55
+ "address": "0x7777770f8a6632ff043c8833310e245eba9209e6",
56
+ "type": 0
57
+ },
58
+ "0x3936ad01cf109a36489d93cabda11cf062fd3d48": {
59
+ "address": "0x3936ad01cf109a36489d93cabda11cf062fd3d48",
60
+ "type": 0
61
+ },
62
+ "0x3fa807b6f8d4c407e6e605368f4372d14658b38c": {
63
+ "address": "0x3fa807b6f8d4c407e6e605368f4372d14658b38c",
64
+ "type": 0
65
+ },
66
+ "0x15e4132dcd932e8990e794d1300011a472819cbd": {
67
+ "address": "0x15e4132dcd932e8990e794d1300011a472819cbd",
68
+ "type": 0
69
+ },
70
+ "0x5166d4ce79b9bf7df477da110c560ce3045aa889": {
71
+ "address": "0x5166d4ce79b9bf7df477da110c560ce3045aa889",
72
+ "type": 0
73
+ },
74
+ "0xf911a7ec46a2c6fa49193212fe4a2a9b95851c27": {
75
+ "address": "0xf911a7ec46a2c6fa49193212fe4a2a9b95851c27",
76
+ "type": 0
77
+ },
78
+ "0x04f2694c8fcee23e8fd0dfea1d4f5bb8c352111f": {
79
+ "address": "0x04f2694c8fcee23e8fd0dfea1d4f5bb8c352111f",
80
+ "type": 0
81
+ },
82
+ "0xfc1e690f61efd961294b3e1ce3313fbd8aa4f85d": {
83
+ "address": "0xfc1e690f61efd961294b3e1ce3313fbd8aa4f85d",
84
+ "type": 1
85
+ },
86
+ "0x4da9b813057d04baef4e5800e36083717b4a0341": {
87
+ "address": "0x4da9b813057d04baef4e5800e36083717b4a0341",
88
+ "type": 1
89
+ },
90
+ "0x9ba00d6856a4edf4665bca2c2309936572473b7e": {
91
+ "address": "0x9ba00d6856a4edf4665bca2c2309936572473b7e",
92
+ "type": 1
93
+ },
94
+ "0x71fc860f7d3a592a4a98740e39db31d25db65ae8": {
95
+ "address": "0x71fc860f7d3a592a4a98740e39db31d25db65ae8",
96
+ "type": 1
97
+ },
98
+ "0x625ae63000f46200499120b906716420bd059240": {
99
+ "address": "0x625ae63000f46200499120b906716420bd059240",
100
+ "type": 1
101
+ },
102
+ "0x7d2d3688df45ce7c552e19c27e007673da9204b8": {
103
+ "address": "0x7d2d3688df45ce7c552e19c27e007673da9204b8",
104
+ "type": 1
105
+ },
106
+ "0xe1ba0fb44ccb0d11b80f92f4f8ed94ca3ff51d00": {
107
+ "address": "0xe1ba0fb44ccb0d11b80f92f4f8ed94ca3ff51d00",
108
+ "type": 1
109
+ },
110
+ "0x3a3a65aab0dd2a17e3f1947ba16138cd37d08c04": {
111
+ "address": "0x3a3a65aab0dd2a17e3f1947ba16138cd37d08c04",
112
+ "type": 1
113
+ },
114
+ "0xa64bd6c70cb9051f6a9ba1f163fdc07e0dfb5f84": {
115
+ "address": "0xa64bd6c70cb9051f6a9ba1f163fdc07e0dfb5f84",
116
+ "type": 1
117
+ },
118
+ "0x9d91be44c06d373a8a226e1f3b146956083803eb": {
119
+ "address": "0x9d91be44c06d373a8a226e1f3b146956083803eb",
120
+ "type": 1
121
+ },
122
+ "0x71010a9d003445ac60c4e6a7017c1e89a477b438": {
123
+ "address": "0x71010a9d003445ac60c4e6a7017c1e89a477b438",
124
+ "type": 1
125
+ },
126
+ "0x7deb5e830be29f91e298ba5ff1356bb7f8146998": {
127
+ "address": "0x7deb5e830be29f91e298ba5ff1356bb7f8146998",
128
+ "type": 1
129
+ },
130
+ "0x6fce4a401b6b80ace52baaefe4421bd188e76f6f": {
131
+ "address": "0x6fce4a401b6b80ace52baaefe4421bd188e76f6f",
132
+ "type": 1
133
+ },
134
+ "0x6fb0855c404e09c47c3fbca25f08d4e41f9f062f": {
135
+ "address": "0x6fb0855c404e09c47c3fbca25f08d4e41f9f062f",
136
+ "type": 1
137
+ },
138
+ "0x328c4c80bc7aca0834db37e6600a6c49e12da4de": {
139
+ "address": "0x328c4c80bc7aca0834db37e6600a6c49e12da4de",
140
+ "type": 1
141
+ },
142
+ "0xfc4b8ed459e00e5400be803a9bb3954234fd50e3": {
143
+ "address": "0xfc4b8ed459e00e5400be803a9bb3954234fd50e3",
144
+ "type": 1
145
+ },
146
+ "0x6ee0f7bb50a54ab5253da0667b0dc2ee526c30a8": {
147
+ "address": "0x6ee0f7bb50a54ab5253da0667b0dc2ee526c30a8",
148
+ "type": 1
149
+ },
150
+ "0x712db54daa836b53ef1ecbb9c6ba3b9efb073f40": {
151
+ "address": "0x712db54daa836b53ef1ecbb9c6ba3b9efb073f40",
152
+ "type": 1
153
+ },
154
+ "0x69948cc03f478b95283f7dbf1ce764d0fc7ec54c": {
155
+ "address": "0x69948cc03f478b95283f7dbf1ce764d0fc7ec54c",
156
+ "type": 1
157
+ },
158
+ "0x12e51e77daaa58aa0e9247db7510ea4b46f9bead": {
159
+ "address": "0x12e51e77daaa58aa0e9247db7510ea4b46f9bead",
160
+ "type": 1
161
+ },
162
+ "0xba3d9687cf50fe253cd2e1cfeede1d6787344ed5": {
163
+ "address": "0xba3d9687cf50fe253cd2e1cfeede1d6787344ed5",
164
+ "type": 1
165
+ },
166
+ "0xb124541127a0a657f056d9dd06188c4f1b0e5aab": {
167
+ "address": "0xb124541127a0a657f056d9dd06188c4f1b0e5aab",
168
+ "type": 1
169
+ },
170
+ "0x6179078872605396ee62960917128f9477a5ddbb": {
171
+ "address": "0x6179078872605396ee62960917128f9477a5ddbb",
172
+ "type": 1
173
+ },
174
+ "0x048930eec73c91b44b0844aeacdebadc2f2b6efb": {
175
+ "address": "0x048930eec73c91b44b0844aeacdebadc2f2b6efb",
176
+ "type": 1
177
+ },
178
+ "0xe02b2ad63eff3ac1d5827cbd7ab9dd3dac4f4ad0": {
179
+ "address": "0xe02b2ad63eff3ac1d5827cbd7ab9dd3dac4f4ad0",
180
+ "type": 1
181
+ },
182
+ "0xb977ee318010a5252774171494a1bcb98e7fab65": {
183
+ "address": "0xb977ee318010a5252774171494a1bcb98e7fab65",
184
+ "type": 1
185
+ },
186
+ "0xbbbb7f2ac04484f7f04a2c2c16f20479791bbb44": {
187
+ "address": "0xbbbb7f2ac04484f7f04a2c2c16f20479791bbb44",
188
+ "type": 1
189
+ },
190
+ "0x1d0e53a0e524e3cc92c1f0f33ae268fff8d7e7a5": {
191
+ "address": "0x1d0e53a0e524e3cc92c1f0f33ae268fff8d7e7a5",
192
+ "type": 1
193
+ },
194
+ "0x84bbcab430717ff832c3904fa6515f97fc63c76f": {
195
+ "address": "0x84bbcab430717ff832c3904fa6515f97fc63c76f",
196
+ "type": 1
197
+ },
198
+ "0xc88ebbf7c523f38ef3eb8a151273c0f0da421e63": {
199
+ "address": "0xc88ebbf7c523f38ef3eb8a151273c0f0da421e63",
200
+ "type": 1
201
+ },
202
+ "0x8c69f7a4c9b38f1b48005d216c398efb2f1ce3e4": {
203
+ "address": "0x8c69f7a4c9b38f1b48005d216c398efb2f1ce3e4",
204
+ "type": 1
205
+ },
206
+ "0x9548db8b1ca9b6c757485e7861918b640390169c": {
207
+ "address": "0x9548db8b1ca9b6c757485e7861918b640390169c",
208
+ "type": 1
209
+ },
210
+ "0x3ed3b47dd13ec9a98b44e6204a523e766b225811": {
211
+ "address": "0x3ed3b47dd13ec9a98b44e6204a523e766b225811",
212
+ "type": 1
213
+ },
214
+ "0x9ff58f4ffb29fa2266ab25e75e2a8b3503311656": {
215
+ "address": "0x9ff58f4ffb29fa2266ab25e75e2a8b3503311656",
216
+ "type": 1
217
+ },
218
+ "0x030ba81f1c18d280636f32af80b9aad02cf0854e": {
219
+ "address": "0x030ba81f1c18d280636f32af80b9aad02cf0854e",
220
+ "type": 1
221
+ },
222
+ "0x5165d24277cd063f5ac44efd447b27025e888f37": {
223
+ "address": "0x5165d24277cd063f5ac44efd447b27025e888f37",
224
+ "type": 1
225
+ },
226
+ "0xdf7ff54aacacbff42dfe29dd6144a69b629f8c9e": {
227
+ "address": "0xdf7ff54aacacbff42dfe29dd6144a69b629f8c9e",
228
+ "type": 1
229
+ },
230
+ "0xb9d7cb55f463405cdfbe4e90a6d2df01c2b92bf1": {
231
+ "address": "0xb9d7cb55f463405cdfbe4e90a6d2df01c2b92bf1",
232
+ "type": 1
233
+ },
234
+ "0xffc97d72e13e01096502cb8eb52dee56f74dad7b": {
235
+ "address": "0xffc97d72e13e01096502cb8eb52dee56f74dad7b",
236
+ "type": 1
237
+ },
238
+ "0x05ec93c0365baaeabf7aeffb0972ea7ecdd39cf1": {
239
+ "address": "0x05ec93c0365baaeabf7aeffb0972ea7ecdd39cf1",
240
+ "type": 1
241
+ },
242
+ "0xa361718326c15715591c299427c62086f69923d9": {
243
+ "address": "0xa361718326c15715591c299427c62086f69923d9",
244
+ "type": 1
245
+ },
246
+ "0x028171bca77440897b824ca71d1c56cac55b68a3": {
247
+ "address": "0x028171bca77440897b824ca71d1c56cac55b68a3",
248
+ "type": 1
249
+ },
250
+ "0xac6df26a590f08dcc95d5a4705ae8abbc88509ef": {
251
+ "address": "0xac6df26a590f08dcc95d5a4705ae8abbc88509ef",
252
+ "type": 1
253
+ },
254
+ "0x39c6b3e42d6a679d7d776778fe880bc9487c2eda": {
255
+ "address": "0x39c6b3e42d6a679d7d776778fe880bc9487c2eda",
256
+ "type": 1
257
+ },
258
+ "0xa06bc25b5805d5f8d82847d191cb4af5a3e873e0": {
259
+ "address": "0xa06bc25b5805d5f8d82847d191cb4af5a3e873e0",
260
+ "type": 1
261
+ },
262
+ "0xa685a61171bb30d4072b338c80cb7b2c865c873e": {
263
+ "address": "0xa685a61171bb30d4072b338c80cb7b2c865c873e",
264
+ "type": 1
265
+ },
266
+ "0xc713e5e149d5d0715dcd1c156a020976e7e56b88": {
267
+ "address": "0xc713e5e149d5d0715dcd1c156a020976e7e56b88",
268
+ "type": 1
269
+ },
270
+ "0xcc12abe4ff81c9378d670de1b57f8e0dd228d77a": {
271
+ "address": "0xcc12abe4ff81c9378d670de1b57f8e0dd228d77a",
272
+ "type": 1
273
+ },
274
+ "0x35f6b052c598d933d69a4eec4d04c73a191fe6c2": {
275
+ "address": "0x35f6b052c598d933d69a4eec4d04c73a191fe6c2",
276
+ "type": 1
277
+ },
278
+ "0x6c5024cd4f8a59110119c56f8933403a539555eb": {
279
+ "address": "0x6c5024cd4f8a59110119c56f8933403a539555eb",
280
+ "type": 1
281
+ },
282
+ "0x101cc05f4a51c0319f570d5e146a8c625198e636": {
283
+ "address": "0x101cc05f4a51c0319f570d5e146a8c625198e636",
284
+ "type": 1
285
+ },
286
+ "0xbcca60bb61934080951369a648fb03df4f96263c": {
287
+ "address": "0xbcca60bb61934080951369a648fb03df4f96263c",
288
+ "type": 1
289
+ }
290
+ }
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright 2021, Offchain Labs, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ // import yargs from 'yargs/yargs';
18
+ 'use strict';
19
+ import yargs from 'yargs/yargs';
20
+
21
+ const argv = yargs(process.argv.slice(2))
22
+ .options({
23
+ l2NetworkID: {
24
+ type: 'number',
25
+ },
26
+ tokenList: {
27
+ type: 'string',
28
+ },
29
+ })
30
+ .parseSync();
31
+
32
+ export default argv;
@@ -0,0 +1,116 @@
1
+ import { request, gql } from 'graphql-request';
2
+ import { excludeList } from './utils';
3
+ import { GraphTokensResult } from './types'
4
+
5
+ const apolloL2GatewaysRinkebyClient =
6
+ 'https://api.thegraph.com/subgraphs/name/fredlacs/layer2-token-gateway-rinkeby';
7
+ const apolloL2GatewaysClient =
8
+ 'https://api.thegraph.com/subgraphs/name/fredlacs/layer2-token-gateway';
9
+
10
+ const chaidIdToGraphClientUrl = (chainID: string) => {
11
+ switch (chainID) {
12
+ case '42161':
13
+ return apolloL2GatewaysClient;
14
+ case '421611':
15
+ return apolloL2GatewaysRinkebyClient;
16
+ default:
17
+ throw new Error('Unsupported chain');
18
+ }
19
+ };
20
+
21
+ const isGraphTokenResult = (obj: any)=>{
22
+ if(!obj){
23
+ throw new Error("Graph result: undefined")
24
+ }
25
+ const expectedKeys = ["joinTableEntry", "l1TokenAddr"]
26
+ const actualKeys = new Set(Object.keys(obj))
27
+
28
+ if(!expectedKeys.every((key)=> actualKeys.has(key))){
29
+ throw new Error("Graph result: missing top level key")
30
+ }
31
+ const joinTableEntry = obj.joinTableEntry[0]
32
+ if(!joinTableEntry){
33
+ throw new Error("Graph result: no joinTableEntry")
34
+ }
35
+ if(!joinTableEntry.gateway.gatewayAddr){
36
+ throw new Error("Graph result: could not get gateway address")
37
+ }
38
+ }
39
+ export const getTokens = async (
40
+ l1TokenAddresses: string[],
41
+ networkID: string
42
+ ) => {
43
+ const clientUrl = chaidIdToGraphClientUrl(networkID);
44
+ // lazy solution for big lists for now; we'll have to paginate once we have > 500 tokens registed
45
+ if (l1TokenAddresses.length > 500){
46
+ const allTokens = await getAllTokens(networkID)
47
+ const allTokenAddresses = new Set(allTokens.map((token)=> token.l1TokenAddr.toLowerCase()))
48
+ l1TokenAddresses = l1TokenAddresses.filter((addr)=> allTokenAddresses.has(addr.toLowerCase()))
49
+ if(l1TokenAddresses.length > 500) throw new Error("Too many tokens for graph query")
50
+ }
51
+ const formattedAddresses = l1TokenAddresses
52
+ .map((a: string) => `"${a}"`.toLowerCase())
53
+ .join(',');
54
+ const query = gql`
55
+ {
56
+ tokens(first: 500, skip: 0, where:{
57
+ id_in:[${formattedAddresses}]
58
+ }) {
59
+ l1TokenAddr: id
60
+ joinTableEntry: gateway(
61
+ first: 1
62
+ orderBy: blockNum
63
+ orderDirection: desc
64
+ ) {
65
+ id
66
+ blockNum
67
+ token {
68
+ tokenAddr: id
69
+ }
70
+ gateway {
71
+ gatewayAddr: id
72
+ }
73
+ }
74
+ }
75
+ }
76
+ `;
77
+
78
+ const { tokens } = await request(clientUrl, query) as GraphTokensResult
79
+ tokens.map((token)=> isGraphTokenResult(token))
80
+
81
+ return tokens.filter(
82
+ (token) => !excludeList.includes(token.l1TokenAddr.toLowerCase())
83
+ );
84
+ };
85
+
86
+ export const getAllTokens = async (networkID: string) => {
87
+ const clientUrl = chaidIdToGraphClientUrl(networkID);
88
+ const query = gql`
89
+ {
90
+ tokens(first: 500, skip: 0) {
91
+ l1TokenAddr: id
92
+ joinTableEntry: gateway(
93
+ first: 1
94
+ orderBy: blockNum
95
+ orderDirection: desc
96
+ ) {
97
+ id
98
+ blockNum
99
+ token {
100
+ tokenAddr: id
101
+ }
102
+ gateway {
103
+ gatewayAddr: id
104
+ }
105
+ }
106
+ }
107
+ }
108
+ `;
109
+
110
+ const { tokens } = await request(clientUrl, query) as GraphTokensResult
111
+ tokens.map((token)=> isGraphTokenResult(token))
112
+
113
+ return tokens.filter(
114
+ (token) => !excludeList.includes(token.l1TokenAddr.toLowerCase())
115
+ );
116
+ };
@@ -0,0 +1,35 @@
1
+ import { providers, Wallet, VoidSigner } from 'ethers';
2
+ import args from './getClargs';
3
+ import dotenv from 'dotenv';
4
+ import { getL1Network, getL2Network, MultiCaller, TokenBridger } from "arb-ts"
5
+ dotenv.config();
6
+
7
+ const networkID = args.l2NetworkID?.toString() || '42161';
8
+
9
+ console.log('Using L2 networkID:', networkID);
10
+
11
+ export const getNetworkConfig = async () => {
12
+ const l2Network = await getL2Network(networkID)
13
+ const l1Network = await getL1Network(l2Network.partnerChainID)
14
+
15
+ const arbProvider = new providers.JsonRpcProvider(l2Network.rpcURL);
16
+ const ethProvider = new providers.JsonRpcProvider(l1Network.rpcURL)
17
+
18
+ const l1MultiCaller = await MultiCaller.fromProvider(ethProvider)
19
+ const l2MultiCaller = await MultiCaller.fromProvider(arbProvider)
20
+ const tokenBridger = new TokenBridger(l2Network)
21
+
22
+ return {
23
+ l1: {
24
+ network: l1Network,
25
+ provider: ethProvider,
26
+ multiCaller: l1MultiCaller
27
+ },
28
+ l2: {
29
+ network: l2Network,
30
+ provider: arbProvider,
31
+ multiCaller: l2MultiCaller
32
+ },
33
+ tokenBridger,
34
+ }
35
+ }