@rhinestone/shared-configs 1.0.0

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/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # shared-configs
2
+
3
+ > Reusable configuration files for Rhinestone services
4
+
5
+ ## Usage
6
+
7
+ ### Installation
8
+
9
+ ```bash
10
+ npm install viem @rhinestone/shared-configs
11
+ ```
12
+
13
+ ```bash
14
+ bun install viem @rhinestone/shared-configs
15
+ ```
@@ -0,0 +1,288 @@
1
+ {
2
+ "1": {
3
+ "name": "Ethereum",
4
+ "tokens": [
5
+ {
6
+ "symbol": "ETH",
7
+ "address": "0x0000000000000000000000000000000000000000",
8
+ "decimals": 18,
9
+ "balanceSlot": null
10
+ },
11
+ {
12
+ "symbol": "USDC",
13
+ "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
14
+ "decimals": 6,
15
+ "balanceSlot": 9
16
+ },
17
+ {
18
+ "symbol": "USDT",
19
+ "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
20
+ "decimals": 6,
21
+ "balanceSlot": 2
22
+ },
23
+ {
24
+ "symbol": "WETH",
25
+ "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
26
+ "decimals": 18,
27
+ "balanceSlot": 3
28
+ }
29
+ ]
30
+ },
31
+ "10": {
32
+ "name": "Optimism",
33
+ "tokens": [
34
+ {
35
+ "symbol": "ETH",
36
+ "address": "0x0000000000000000000000000000000000000000",
37
+ "decimals": 18,
38
+ "balanceSlot": null
39
+ },
40
+ {
41
+ "symbol": "USDC",
42
+ "address": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
43
+ "decimals": 6,
44
+ "balanceSlot": 9
45
+ },
46
+ {
47
+ "symbol": "USDT",
48
+ "address": "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
49
+ "decimals": 6,
50
+ "balanceSlot": 0
51
+ },
52
+ {
53
+ "symbol": "WETH",
54
+ "address": "0x4200000000000000000000000000000000000006",
55
+ "decimals": 18,
56
+ "balanceSlot": 3
57
+ }
58
+ ]
59
+ },
60
+ "8453": {
61
+ "name": "Base",
62
+ "tokens": [
63
+ {
64
+ "symbol": "ETH",
65
+ "address": "0x0000000000000000000000000000000000000000",
66
+ "decimals": 18,
67
+ "balanceSlot": null
68
+ },
69
+ {
70
+ "symbol": "USDC",
71
+ "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
72
+ "decimals": 6,
73
+ "balanceSlot": 9
74
+ },
75
+ {
76
+ "symbol": "USDT",
77
+ "address": "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
78
+ "decimals": 6,
79
+ "balanceSlot": 51
80
+ },
81
+ {
82
+ "symbol": "WETH",
83
+ "address": "0x4200000000000000000000000000000000000006",
84
+ "decimals": 18,
85
+ "balanceSlot": 3
86
+ }
87
+ ]
88
+ },
89
+ "42161": {
90
+ "name": "Arbitrum",
91
+ "tokens": [
92
+ {
93
+ "symbol": "ETH",
94
+ "address": "0x0000000000000000000000000000000000000000",
95
+ "decimals": 18,
96
+ "balanceSlot": null
97
+ },
98
+ {
99
+ "symbol": "USDC",
100
+ "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
101
+ "decimals": 6,
102
+ "balanceSlot": 9
103
+ },
104
+ {
105
+ "symbol": "USDT",
106
+ "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
107
+ "decimals": 6,
108
+ "balanceSlot": 51
109
+ },
110
+ {
111
+ "symbol": "WETH",
112
+ "address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
113
+ "decimals": 18,
114
+ "balanceSlot": 51
115
+ }
116
+ ]
117
+ },
118
+ "137": {
119
+ "name": "Polygon",
120
+ "tokens": [
121
+ {
122
+ "symbol": "USDC",
123
+ "address": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
124
+ "decimals": 6,
125
+ "balanceSlot": 9
126
+ },
127
+ {
128
+ "symbol": "USDT",
129
+ "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
130
+ "decimals": 6,
131
+ "balanceSlot": 0
132
+ },
133
+ {
134
+ "symbol": "WETH",
135
+ "address": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
136
+ "decimals": 18,
137
+ "balanceSlot": 3
138
+ }
139
+ ]
140
+ },
141
+ "324": {
142
+ "name": "ZkSync Era",
143
+ "tokens": [
144
+ {
145
+ "symbol": "ETH",
146
+ "address": "0x0000000000000000000000000000000000000000",
147
+ "decimals": 18,
148
+ "balanceSlot": null
149
+ },
150
+ {
151
+ "symbol": "USDC",
152
+ "address": "0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4",
153
+ "decimals": 6,
154
+ "balanceSlot": 9
155
+ },
156
+ {
157
+ "symbol": "USDT",
158
+ "address": "0x493257fD37EDB34451f62EDf8D2a0C418852bA4C",
159
+ "decimals": 6,
160
+ "balanceSlot": 2
161
+ },
162
+ {
163
+ "symbol": "WETH",
164
+ "address": "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",
165
+ "decimals": 18,
166
+ "balanceSlot": 3
167
+ }
168
+ ]
169
+ },
170
+ "1868": {
171
+ "name": "Soneium",
172
+ "tokens": [
173
+ {
174
+ "symbol": "ETH",
175
+ "address": "0x0000000000000000000000000000000000000000",
176
+ "decimals": 18,
177
+ "balanceSlot": null,
178
+ "approvalSlot": null
179
+ },
180
+ {
181
+ "symbol": "USDC",
182
+ "address": "0xbA9986D2381edf1DA03B0B9c1f8b00dc4AacC369",
183
+ "decimals": 6,
184
+ "balanceSlot": 9,
185
+ "approvalSlot": 10
186
+ },
187
+ {
188
+ "symbol": "WETH",
189
+ "address": "0x4200000000000000000000000000000000000006",
190
+ "decimals": 18,
191
+ "balanceSlot": 3,
192
+ "approvalSlot": 4
193
+ }
194
+ ]
195
+ },
196
+ "84532": {
197
+ "name": "Base-sepolia",
198
+ "tokens": [
199
+ {
200
+ "symbol": "ETH",
201
+ "address": "0x0000000000000000000000000000000000000000",
202
+ "decimals": 18,
203
+ "balanceSlot": null
204
+ },
205
+ {
206
+ "symbol": "USDC",
207
+ "address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
208
+ "decimals": 6,
209
+ "balanceSlot": 9
210
+ },
211
+ {
212
+ "symbol": "WETH",
213
+ "address": "0x4200000000000000000000000000000000000006",
214
+ "decimals": 18,
215
+ "balanceSlot": 3
216
+ }
217
+ ]
218
+ },
219
+ "421614": {
220
+ "name": "Arbitrum-sepolia",
221
+ "tokens": [
222
+ {
223
+ "symbol": "ETH",
224
+ "address": "0x0000000000000000000000000000000000000000",
225
+ "decimals": 18,
226
+ "balanceSlot": null
227
+ },
228
+ {
229
+ "symbol": "USDC",
230
+ "address": "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
231
+ "decimals": 6,
232
+ "balanceSlot": 9
233
+ },
234
+ {
235
+ "symbol": "WETH",
236
+ "address": "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
237
+ "decimals": 18,
238
+ "balanceSlot": 51
239
+ }
240
+ ]
241
+ },
242
+ "11155111": {
243
+ "name": "Ethereum-sepolia",
244
+ "tokens": [
245
+ {
246
+ "symbol": "ETH",
247
+ "address": "0x0000000000000000000000000000000000000000",
248
+ "decimals": 18,
249
+ "balanceSlot": null
250
+ },
251
+ {
252
+ "symbol": "USDC",
253
+ "address": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
254
+ "decimals": 6,
255
+ "balanceSlot": 9
256
+ },
257
+ {
258
+ "symbol": "WETH",
259
+ "address": "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
260
+ "decimals": 18,
261
+ "balanceSlot": 3
262
+ }
263
+ ]
264
+ },
265
+ "11155420": {
266
+ "name": "Optimism-sepolia",
267
+ "tokens": [
268
+ {
269
+ "symbol": "ETH",
270
+ "address": "0x0000000000000000000000000000000000000000",
271
+ "decimals": 18,
272
+ "balanceSlot": null
273
+ },
274
+ {
275
+ "symbol": "USDC",
276
+ "address": "0x5fd84259d66Cd46123540766Be93DFE6D43130D7",
277
+ "decimals": 6,
278
+ "balanceSlot": 9
279
+ },
280
+ {
281
+ "symbol": "WETH",
282
+ "address": "0x4200000000000000000000000000000000000006",
283
+ "decimals": 18,
284
+ "balanceSlot": 3
285
+ }
286
+ ]
287
+ }
288
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "DRPC": {
3
+ "url_template": "https://lb.drpc.org/ogrpc?network={{chain_param}}&dkey=${DRPC_API_KEY}",
4
+ "chain_mapping": {
5
+ "1": "ethereum",
6
+ "10": "optimism",
7
+ "137": "polygon",
8
+ "324": "zksync",
9
+ "8453": "base",
10
+ "42161": "arbitrum",
11
+ "1868": "soneium",
12
+ "84532": "base-sepolia",
13
+ "421614": "arbitrum-sepolia",
14
+ "11155111": "sepolia",
15
+ "11155420": "optimism-sepolia"
16
+ }
17
+ },
18
+ "Alchemy": {
19
+ "url_template": "https://{{chain_param}}.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
20
+ "chain_mapping": {
21
+ "1": "eth-mainnet",
22
+ "10": "opt-mainnet",
23
+ "1868": "soneium-mainnet",
24
+ "11155111": "eth-sepolia",
25
+ "11155420": "opt-sepolia",
26
+ "84532": "base-sepolia",
27
+ "421614": "arb-sepolia",
28
+ "137": "polygon-mainnet",
29
+ "324": "zksync-mainnet",
30
+ "8453": "base-mainnet",
31
+ "42161": "arb-mainnet"
32
+ }
33
+ },
34
+ "local-rpc": {
35
+ "url_template": "http://localhost:{{chain_param}}",
36
+ "chain_mapping": {
37
+ "1": "30001",
38
+ "42161": "30002",
39
+ "8453": "30003",
40
+ "137": "30004"
41
+ }
42
+ }
43
+ }
package/index.ts ADDED
@@ -0,0 +1,79 @@
1
+ import type { Address } from 'viem'
2
+ import type {
3
+ arbitrum,
4
+ arbitrumSepolia,
5
+ base,
6
+ baseSepolia,
7
+ mainnet,
8
+ optimism,
9
+ optimismSepolia,
10
+ polygon,
11
+ sepolia,
12
+ soneium,
13
+ zksync,
14
+ } from 'viem/chains'
15
+
16
+ import chainRegistry from './configs/chains.json'
17
+ import providerRegistry from './configs/providers.json'
18
+
19
+ type SupportedTestnet =
20
+ | typeof sepolia.id
21
+ | typeof baseSepolia.id
22
+ | typeof arbitrumSepolia.id
23
+ | typeof optimismSepolia.id
24
+ type SupportedMainnet =
25
+ | typeof mainnet.id
26
+ | typeof base.id
27
+ | typeof arbitrum.id
28
+ | typeof optimism.id
29
+ | typeof polygon.id
30
+ | typeof zksync.id
31
+ | typeof soneium.id
32
+ type SupportedOPStackMainnet =
33
+ | typeof optimism.id
34
+ | typeof base.id
35
+ | typeof soneium.id
36
+ type SupportedOPStackTestnet = typeof optimismSepolia.id | typeof baseSepolia.id
37
+ type SupportedChain = SupportedMainnet | SupportedTestnet
38
+
39
+ interface TokenEntry {
40
+ symbol: string
41
+ address: Address
42
+ decimals: number
43
+ balanceSlot: number | null
44
+ }
45
+
46
+ interface ChainEntry {
47
+ name: string
48
+ tokens: TokenEntry[]
49
+ }
50
+
51
+ interface ChainRegistry {
52
+ [chainId: string]: ChainEntry
53
+ }
54
+
55
+ type ProviderName = 'DRPC' | 'Alchemy' | 'local-rpc'
56
+
57
+ type ProviderRegistry = Record<
58
+ ProviderName,
59
+ {
60
+ url_template: string
61
+ chain_mapping: Partial<Record<SupportedChain, string>>
62
+ }
63
+ >
64
+
65
+ const chains: ChainRegistry = chainRegistry as ChainRegistry
66
+ const providers: ProviderRegistry = providerRegistry as ProviderRegistry
67
+
68
+ export { chains, providers }
69
+ export type {
70
+ ChainEntry,
71
+ ChainRegistry,
72
+ ProviderRegistry,
73
+ ProviderName,
74
+ SupportedMainnet,
75
+ SupportedTestnet,
76
+ SupportedChain,
77
+ SupportedOPStackMainnet,
78
+ SupportedOPStackTestnet,
79
+ }
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@rhinestone/shared-configs",
3
+ "version": "1.0.0",
4
+ "description": "Reusable configuration files for Rhinestone services",
5
+ "author": {
6
+ "name": "Rhinestone",
7
+ "url": "https://rhinestone.dev"
8
+ },
9
+ "module": "index.ts",
10
+ "type": "module",
11
+ "files": [
12
+ "index.ts",
13
+ "configs"
14
+ ],
15
+ "devDependencies": {
16
+ "@biomejs/biome": "^2.1.4",
17
+ "@types/bun": "latest"
18
+ },
19
+ "peerDependencies": {
20
+ "typescript": "^5",
21
+ "viem": "^2.33.3"
22
+ }
23
+ }