@1delta/providers 0.0.55 → 0.0.58

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/providers",
3
- "version": "0.0.55",
3
+ "version": "0.0.58",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -18,8 +18,8 @@
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
20
  "vitest": "^4.0.18",
21
- "@1delta/chain-registry": "0.0.4",
22
- "@1delta/data-sdk": "0.0.22"
21
+ "@1delta/chain-registry": "0.0.5",
22
+ "@1delta/data-sdk": "0.0.25"
23
23
  },
24
24
  "devDependencies": {
25
25
  "tsup": "^8.5.1",
@@ -73,6 +73,11 @@ import {
73
73
  zkLinkNova,
74
74
  vana,
75
75
  confluxESpace,
76
+ megaeth,
77
+ lisk,
78
+ plumeMainnet,
79
+ stable,
80
+ etherlink,
76
81
  } from 'viem/chains'
77
82
  import { customChains, katana, plasma } from './customChains'
78
83
 
@@ -308,6 +313,18 @@ export function getEvmChain(chain: string) {
308
313
  return customChains.swellchain
309
314
  case Chain.TAC_MAINNET:
310
315
  return customChains.tacMainnet
316
+ case Chain.LISK:
317
+ return lisk
318
+ case Chain.MEGAETH_MAINNET:
319
+ return megaeth
320
+ case Chain.STABLE_MAINNET:
321
+ return stable
322
+ case Chain.PLUME_MAINNET:
323
+ return plumeMainnet
324
+ case Chain.ETHERLINK_MAINNET:
325
+ return etherlink
326
+ case Chain.PHAROS_MAINNET:
327
+ return customChains.pharosMainnet
311
328
  case Chain.ZKLINK_NOVA_MAINNET:
312
329
  return {
313
330
  ...zkLinkNova,
@@ -240,6 +240,29 @@ const tacMainnet = defineChain({
240
240
  },
241
241
  })
242
242
 
243
+ const pharosMainnet = defineChain({
244
+ id: 1672,
245
+ name: 'Pharos Mainnet',
246
+ nativeCurrency: {
247
+ decimals: 18,
248
+ name: 'Pharos',
249
+ symbol: 'PROS',
250
+ },
251
+ rpcUrls: {
252
+ default: { http: ['https://rpc.pharos.xyz'] }, // Public RPC
253
+ },
254
+ blockExplorers: {
255
+ default: { name: 'Pharos Explorer', url: 'https://explorer.pharos.xyz' },
256
+ },
257
+ // Multicall3 contract address for Pharos, if available
258
+ contracts: {
259
+ multicall3: {
260
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
261
+ blockCreated: 1,
262
+ },
263
+ },
264
+ })
265
+
243
266
  export const customChains = {
244
267
  artela,
245
268
  botanix,
@@ -249,4 +272,5 @@ export const customChains = {
249
272
  monadMainnet,
250
273
  swellchain,
251
274
  tacMainnet,
275
+ pharosMainnet,
252
276
  } as const
@@ -280,7 +280,11 @@ export function createMulticallRetry(
280
280
 
281
281
  // Out-of-gas: batch too large for the RPC gas limit — halve batch size and retry
282
282
  if (isOutOfGasError(e) && batchSize > 1) {
283
- if (logErrors) console.debug('[multicall] OOG', formatViemError(e))
283
+ if (logErrors)
284
+ console.debug(
285
+ `[multicall] OOG chain=${chain}`,
286
+ formatViemError(e),
287
+ )
284
288
  return await multicallRetry(
285
289
  chain,
286
290
  calls,
@@ -302,7 +306,7 @@ export function createMulticallRetry(
302
306
  if (logErrors) {
303
307
  const tag = isHttpError(e) ? 'HTTP' : 'unknown-transient'
304
308
  console.debug(
305
- `[multicall] ${tag} error on provider ${providerId}, skipping:`,
309
+ `[multicall] ${tag} error on chain=${chain} provider ${providerId}, skipping:`,
306
310
  formatViemError(e),
307
311
  )
308
312
  }
@@ -322,14 +326,15 @@ export function createMulticallRetry(
322
326
 
323
327
  if (maxRetries === 0) {
324
328
  if (!allowFailure) throw e
325
- if (logErrors) console.debug('[multicall]', formatViemError(e))
329
+ if (logErrors)
330
+ console.debug(`[multicall] chain=${chain}`, formatViemError(e))
326
331
  return Array(calls.length).fill('0x')
327
332
  }
328
333
 
329
334
  // Skips exhausted — consume a retry and rotate RPC
330
335
  if (logErrors)
331
336
  console.debug(
332
- `[multicall] retrying on provider ${providerId + 1}:`,
337
+ `[multicall] retrying on chain=${chain} provider ${providerId + 1}:`,
333
338
  formatViemError(e),
334
339
  )
335
340
 
@@ -228,7 +228,6 @@ export const LIST_OVERRIDES: Record<string, string[]> = {
228
228
  'https://opbnb-mainnet.nodereal.io/v1/64a9df0874fb4a93b9d0a3849de012d3',
229
229
  'wss://opbnb-mainnet.nodereal.io/ws/v1/64a9df0874fb4a93b9d0a3849de012d3',
230
230
  ],
231
- [Chain.X_LAYER_MAINNET]: ['https://xlayerrpc.okx.com'],
232
231
  [Chain.MANTA_PACIFIC_MAINNET]: [
233
232
  'https://manta.nirvanalabs.xyz/mantapublic',
234
233
  'https://manta-pacific-gascap.calderachain.xyz/http',
@@ -290,4 +289,45 @@ export const LIST_OVERRIDES: Record<string, string[]> = {
290
289
  'https://unichain.api.onfinality.io/public',
291
290
  'https://rpc.poolz.finance/unichain',
292
291
  ],
292
+ [Chain.X_LAYER_MAINNET]: [
293
+ 'https://rpc.xlayer.tech',
294
+ 'https://xlayer.rpc.blxrbdn.com',
295
+ 'https://okx-xlayer.rpc.blxrbdn.com',
296
+ 'https://flap-xlayer.rpc.blxrbdn.com',
297
+ 'https://xlayer.drpc.org',
298
+ 'https://rpc.sentio.xyz/xlayer-mainnet',
299
+ ],
300
+ [Chain.LISK]: [
301
+ 'https://lisk.gateway.tenderly.co',
302
+ 'https://lisk.drpc.org',
303
+ 'https://rpc.api.lisk.com',
304
+ ],
305
+ [Chain.MEGAETH_MAINNET]: [
306
+ 'https://rpc-megaeth-mainnet.globalstake.io',
307
+ 'https://mainnet.megaeth.com/rpc',
308
+ 'https://megaeth.drpc.org',
309
+ ],
310
+ [Chain.PLUME_MAINNET]: [
311
+ 'https://rpc.plume.org',
312
+ 'https://plume.drpc.org',
313
+ 'https://plume-mainnet.gateway.tatum.io',
314
+ ],
315
+ [Chain.PHAROS_MAINNET]: [
316
+ 'https://rpc.pharos.xyz',
317
+ 'https://infra.originstake.com/pharos/evm',
318
+ ],
319
+ [Chain.BOB]: [
320
+ 'https://rpc.gobob.xyz',
321
+ 'https://bob.drpc.org',
322
+ 'https://bob.gateway.tenderly.co',
323
+ 'https://rpc.sentio.xyz/bob',
324
+ ],
325
+ [Chain.ROOTSTOCK_MAINNET]: [
326
+ 'https://mycrypto.rsk.co',
327
+ 'https://public-node.rsk.co',
328
+ ],
329
+ [Chain.ETHERLINK_MAINNET]: [
330
+ 'https://node.mainnet.etherlink.com',
331
+ 'https://rpc.ankr.com/etherlink_mainnet',
332
+ ],
293
333
  }