@1delta/providers 0.0.50 → 0.0.52

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/dist/index.d.mts CHANGED
@@ -364,6 +364,94 @@ declare const customChains: {
364
364
  verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
365
365
  readonly network: "monad";
366
366
  };
367
+ readonly swellchain: {
368
+ blockExplorers: {
369
+ readonly default: {
370
+ readonly name: "Explorer";
371
+ readonly url: "https://explorer.swellnetwork.io";
372
+ };
373
+ };
374
+ blockTime?: number | undefined | undefined;
375
+ contracts: {
376
+ readonly multicall3: {
377
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
378
+ readonly blockCreated: 1;
379
+ };
380
+ };
381
+ ensTlds?: readonly string[] | undefined;
382
+ id: 1923;
383
+ name: "Swellchain";
384
+ nativeCurrency: {
385
+ readonly decimals: 18;
386
+ readonly name: "Ether";
387
+ readonly symbol: "ETH";
388
+ };
389
+ experimental_preconfirmationTime?: number | undefined | undefined;
390
+ rpcUrls: {
391
+ readonly default: {
392
+ readonly http: readonly ["https://rpc.swellnetwork.io"];
393
+ };
394
+ };
395
+ sourceId?: number | undefined | undefined;
396
+ testnet?: boolean | undefined | undefined;
397
+ custom?: Record<string, unknown> | undefined;
398
+ extendSchema?: Record<string, unknown> | undefined;
399
+ fees?: viem.ChainFees<undefined> | undefined;
400
+ formatters?: undefined;
401
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
402
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
403
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
404
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
405
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
406
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
407
+ }] | undefined;
408
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
409
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
410
+ };
411
+ readonly tacMainnet: {
412
+ blockExplorers: {
413
+ readonly default: {
414
+ readonly name: "Explorer";
415
+ readonly url: "https://explorer.tac.build";
416
+ };
417
+ };
418
+ blockTime?: number | undefined | undefined;
419
+ contracts: {
420
+ readonly multicall3: {
421
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
422
+ readonly blockCreated: 1;
423
+ };
424
+ };
425
+ ensTlds?: readonly string[] | undefined;
426
+ id: 239;
427
+ name: "TAC Mainnet";
428
+ nativeCurrency: {
429
+ readonly decimals: 18;
430
+ readonly name: "Ether";
431
+ readonly symbol: "ETH";
432
+ };
433
+ experimental_preconfirmationTime?: number | undefined | undefined;
434
+ rpcUrls: {
435
+ readonly default: {
436
+ readonly http: readonly ["https://rpc.tac.build"];
437
+ };
438
+ };
439
+ sourceId?: number | undefined | undefined;
440
+ testnet?: boolean | undefined | undefined;
441
+ custom?: Record<string, unknown> | undefined;
442
+ extendSchema?: Record<string, unknown> | undefined;
443
+ fees?: viem.ChainFees<undefined> | undefined;
444
+ formatters?: undefined;
445
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
446
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
447
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
448
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
449
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
450
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
451
+ }] | undefined;
452
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
453
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
454
+ };
367
455
  };
368
456
 
369
457
  declare function getEvmChain(chain: string): {
@@ -718,6 +806,92 @@ declare function getEvmChain(chain: string): {
718
806
  serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
719
807
  verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
720
808
  readonly network: "monad";
809
+ } | {
810
+ blockExplorers: {
811
+ readonly default: {
812
+ readonly name: "Explorer";
813
+ readonly url: "https://explorer.swellnetwork.io";
814
+ };
815
+ };
816
+ blockTime?: number | undefined | undefined;
817
+ contracts: {
818
+ readonly multicall3: {
819
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
820
+ readonly blockCreated: 1;
821
+ };
822
+ };
823
+ ensTlds?: readonly string[] | undefined;
824
+ id: 1923;
825
+ name: "Swellchain";
826
+ nativeCurrency: {
827
+ readonly decimals: 18;
828
+ readonly name: "Ether";
829
+ readonly symbol: "ETH";
830
+ };
831
+ experimental_preconfirmationTime?: number | undefined | undefined;
832
+ rpcUrls: {
833
+ readonly default: {
834
+ readonly http: readonly ["https://rpc.swellnetwork.io"];
835
+ };
836
+ };
837
+ sourceId?: number | undefined | undefined;
838
+ testnet?: boolean | undefined | undefined;
839
+ custom?: Record<string, unknown> | undefined;
840
+ extendSchema?: Record<string, unknown> | undefined;
841
+ fees?: viem.ChainFees<undefined> | undefined;
842
+ formatters?: undefined;
843
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
844
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
845
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
846
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
847
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
848
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
849
+ }] | undefined;
850
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
851
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
852
+ } | {
853
+ blockExplorers: {
854
+ readonly default: {
855
+ readonly name: "Explorer";
856
+ readonly url: "https://explorer.tac.build";
857
+ };
858
+ };
859
+ blockTime?: number | undefined | undefined;
860
+ contracts: {
861
+ readonly multicall3: {
862
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
863
+ readonly blockCreated: 1;
864
+ };
865
+ };
866
+ ensTlds?: readonly string[] | undefined;
867
+ id: 239;
868
+ name: "TAC Mainnet";
869
+ nativeCurrency: {
870
+ readonly decimals: 18;
871
+ readonly name: "Ether";
872
+ readonly symbol: "ETH";
873
+ };
874
+ experimental_preconfirmationTime?: number | undefined | undefined;
875
+ rpcUrls: {
876
+ readonly default: {
877
+ readonly http: readonly ["https://rpc.tac.build"];
878
+ };
879
+ };
880
+ sourceId?: number | undefined | undefined;
881
+ testnet?: boolean | undefined | undefined;
882
+ custom?: Record<string, unknown> | undefined;
883
+ extendSchema?: Record<string, unknown> | undefined;
884
+ fees?: viem.ChainFees<undefined> | undefined;
885
+ formatters?: undefined;
886
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
887
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
888
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
889
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
890
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
891
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
892
+ }] | undefined;
893
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
894
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
721
895
  } | {
722
896
  blockExplorers: {
723
897
  readonly default: {
@@ -8308,6 +8482,7 @@ declare function createMulticallRetry(customRpcs?: Record<string, string[]>): (c
8308
8482
  * @see multicallRetryUniversal
8309
8483
  */
8310
8484
  declare function multicallRetry(chain: string, calls: any[], abi: any, batchSize?: number, maxRetries?: number, providerId?: number, allowFailure?: boolean, overrdies?: Record<string, string[]>, logErrors?: boolean): Promise<any[]>;
8485
+ declare function createMulticallRetryUniversal(customRpcs?: Record<string, string[]>): (params: MulticallRetryParams) => Promise<any[]>;
8311
8486
  declare function multicallRetryUniversal({ chain, calls, abi, batchSize, maxRetries, providerId, allowFailure, overrdies, logErrors, }: MulticallRetryParams): Promise<any[]>;
8312
8487
 
8313
- export { DEFAULT_BATCH_SIZE, LIST_OVERRIDES, type MulticallRetryParams, createMulticallRetry, createTransport, customChains, deepCompare, filterHttpRpcs, getEvmChain, getEvmClient, getEvmClientUniversal, getEvmClientWithCustomRpcs, getEvmClientWithCustomRpcsUniversal, getTransport, isArray, katana, multicallRetry, multicallRetryUniversal, plasma, trimTrailingSlash, uniq };
8488
+ export { DEFAULT_BATCH_SIZE, LIST_OVERRIDES, type MulticallRetryParams, createMulticallRetry, createMulticallRetryUniversal, createTransport, customChains, deepCompare, filterHttpRpcs, getEvmChain, getEvmClient, getEvmClientUniversal, getEvmClientWithCustomRpcs, getEvmClientWithCustomRpcsUniversal, getTransport, isArray, katana, multicallRetry, multicallRetryUniversal, plasma, trimTrailingSlash, uniq };
package/dist/index.d.ts CHANGED
@@ -364,6 +364,94 @@ declare const customChains: {
364
364
  verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
365
365
  readonly network: "monad";
366
366
  };
367
+ readonly swellchain: {
368
+ blockExplorers: {
369
+ readonly default: {
370
+ readonly name: "Explorer";
371
+ readonly url: "https://explorer.swellnetwork.io";
372
+ };
373
+ };
374
+ blockTime?: number | undefined | undefined;
375
+ contracts: {
376
+ readonly multicall3: {
377
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
378
+ readonly blockCreated: 1;
379
+ };
380
+ };
381
+ ensTlds?: readonly string[] | undefined;
382
+ id: 1923;
383
+ name: "Swellchain";
384
+ nativeCurrency: {
385
+ readonly decimals: 18;
386
+ readonly name: "Ether";
387
+ readonly symbol: "ETH";
388
+ };
389
+ experimental_preconfirmationTime?: number | undefined | undefined;
390
+ rpcUrls: {
391
+ readonly default: {
392
+ readonly http: readonly ["https://rpc.swellnetwork.io"];
393
+ };
394
+ };
395
+ sourceId?: number | undefined | undefined;
396
+ testnet?: boolean | undefined | undefined;
397
+ custom?: Record<string, unknown> | undefined;
398
+ extendSchema?: Record<string, unknown> | undefined;
399
+ fees?: viem.ChainFees<undefined> | undefined;
400
+ formatters?: undefined;
401
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
402
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
403
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
404
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
405
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
406
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
407
+ }] | undefined;
408
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
409
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
410
+ };
411
+ readonly tacMainnet: {
412
+ blockExplorers: {
413
+ readonly default: {
414
+ readonly name: "Explorer";
415
+ readonly url: "https://explorer.tac.build";
416
+ };
417
+ };
418
+ blockTime?: number | undefined | undefined;
419
+ contracts: {
420
+ readonly multicall3: {
421
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
422
+ readonly blockCreated: 1;
423
+ };
424
+ };
425
+ ensTlds?: readonly string[] | undefined;
426
+ id: 239;
427
+ name: "TAC Mainnet";
428
+ nativeCurrency: {
429
+ readonly decimals: 18;
430
+ readonly name: "Ether";
431
+ readonly symbol: "ETH";
432
+ };
433
+ experimental_preconfirmationTime?: number | undefined | undefined;
434
+ rpcUrls: {
435
+ readonly default: {
436
+ readonly http: readonly ["https://rpc.tac.build"];
437
+ };
438
+ };
439
+ sourceId?: number | undefined | undefined;
440
+ testnet?: boolean | undefined | undefined;
441
+ custom?: Record<string, unknown> | undefined;
442
+ extendSchema?: Record<string, unknown> | undefined;
443
+ fees?: viem.ChainFees<undefined> | undefined;
444
+ formatters?: undefined;
445
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
446
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
447
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
448
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
449
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
450
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
451
+ }] | undefined;
452
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
453
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
454
+ };
367
455
  };
368
456
 
369
457
  declare function getEvmChain(chain: string): {
@@ -718,6 +806,92 @@ declare function getEvmChain(chain: string): {
718
806
  serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
719
807
  verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
720
808
  readonly network: "monad";
809
+ } | {
810
+ blockExplorers: {
811
+ readonly default: {
812
+ readonly name: "Explorer";
813
+ readonly url: "https://explorer.swellnetwork.io";
814
+ };
815
+ };
816
+ blockTime?: number | undefined | undefined;
817
+ contracts: {
818
+ readonly multicall3: {
819
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
820
+ readonly blockCreated: 1;
821
+ };
822
+ };
823
+ ensTlds?: readonly string[] | undefined;
824
+ id: 1923;
825
+ name: "Swellchain";
826
+ nativeCurrency: {
827
+ readonly decimals: 18;
828
+ readonly name: "Ether";
829
+ readonly symbol: "ETH";
830
+ };
831
+ experimental_preconfirmationTime?: number | undefined | undefined;
832
+ rpcUrls: {
833
+ readonly default: {
834
+ readonly http: readonly ["https://rpc.swellnetwork.io"];
835
+ };
836
+ };
837
+ sourceId?: number | undefined | undefined;
838
+ testnet?: boolean | undefined | undefined;
839
+ custom?: Record<string, unknown> | undefined;
840
+ extendSchema?: Record<string, unknown> | undefined;
841
+ fees?: viem.ChainFees<undefined> | undefined;
842
+ formatters?: undefined;
843
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
844
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
845
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
846
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
847
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
848
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
849
+ }] | undefined;
850
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
851
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
852
+ } | {
853
+ blockExplorers: {
854
+ readonly default: {
855
+ readonly name: "Explorer";
856
+ readonly url: "https://explorer.tac.build";
857
+ };
858
+ };
859
+ blockTime?: number | undefined | undefined;
860
+ contracts: {
861
+ readonly multicall3: {
862
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
863
+ readonly blockCreated: 1;
864
+ };
865
+ };
866
+ ensTlds?: readonly string[] | undefined;
867
+ id: 239;
868
+ name: "TAC Mainnet";
869
+ nativeCurrency: {
870
+ readonly decimals: 18;
871
+ readonly name: "Ether";
872
+ readonly symbol: "ETH";
873
+ };
874
+ experimental_preconfirmationTime?: number | undefined | undefined;
875
+ rpcUrls: {
876
+ readonly default: {
877
+ readonly http: readonly ["https://rpc.tac.build"];
878
+ };
879
+ };
880
+ sourceId?: number | undefined | undefined;
881
+ testnet?: boolean | undefined | undefined;
882
+ custom?: Record<string, unknown> | undefined;
883
+ extendSchema?: Record<string, unknown> | undefined;
884
+ fees?: viem.ChainFees<undefined> | undefined;
885
+ formatters?: undefined;
886
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
887
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
888
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
889
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
890
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
891
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
892
+ }] | undefined;
893
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
894
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
721
895
  } | {
722
896
  blockExplorers: {
723
897
  readonly default: {
@@ -8308,6 +8482,7 @@ declare function createMulticallRetry(customRpcs?: Record<string, string[]>): (c
8308
8482
  * @see multicallRetryUniversal
8309
8483
  */
8310
8484
  declare function multicallRetry(chain: string, calls: any[], abi: any, batchSize?: number, maxRetries?: number, providerId?: number, allowFailure?: boolean, overrdies?: Record<string, string[]>, logErrors?: boolean): Promise<any[]>;
8485
+ declare function createMulticallRetryUniversal(customRpcs?: Record<string, string[]>): (params: MulticallRetryParams) => Promise<any[]>;
8311
8486
  declare function multicallRetryUniversal({ chain, calls, abi, batchSize, maxRetries, providerId, allowFailure, overrdies, logErrors, }: MulticallRetryParams): Promise<any[]>;
8312
8487
 
8313
- export { DEFAULT_BATCH_SIZE, LIST_OVERRIDES, type MulticallRetryParams, createMulticallRetry, createTransport, customChains, deepCompare, filterHttpRpcs, getEvmChain, getEvmClient, getEvmClientUniversal, getEvmClientWithCustomRpcs, getEvmClientWithCustomRpcsUniversal, getTransport, isArray, katana, multicallRetry, multicallRetryUniversal, plasma, trimTrailingSlash, uniq };
8488
+ export { DEFAULT_BATCH_SIZE, LIST_OVERRIDES, type MulticallRetryParams, createMulticallRetry, createMulticallRetryUniversal, createTransport, customChains, deepCompare, filterHttpRpcs, getEvmChain, getEvmClient, getEvmClientUniversal, getEvmClientWithCustomRpcs, getEvmClientWithCustomRpcsUniversal, getTransport, isArray, katana, multicallRetry, multicallRetryUniversal, plasma, trimTrailingSlash, uniq };
package/dist/index.js CHANGED
@@ -13453,6 +13453,7 @@ __export(index_exports, {
13453
13453
  DEFAULT_BATCH_SIZE: () => DEFAULT_BATCH_SIZE,
13454
13454
  LIST_OVERRIDES: () => LIST_OVERRIDES,
13455
13455
  createMulticallRetry: () => createMulticallRetry,
13456
+ createMulticallRetryUniversal: () => createMulticallRetryUniversal,
13456
13457
  createTransport: () => createTransport2,
13457
13458
  customChains: () => customChains,
13458
13459
  deepCompare: () => deepCompare,
@@ -21636,13 +21637,61 @@ var monadMainnet = defineChain({
21636
21637
  }
21637
21638
  }
21638
21639
  });
21640
+ var swellchain = defineChain({
21641
+ id: 1923,
21642
+ name: "Swellchain",
21643
+ nativeCurrency: {
21644
+ decimals: 18,
21645
+ name: "Ether",
21646
+ symbol: "ETH"
21647
+ },
21648
+ rpcUrls: {
21649
+ default: {
21650
+ http: ["https://rpc.swellnetwork.io"]
21651
+ }
21652
+ },
21653
+ blockExplorers: {
21654
+ default: { name: "Explorer", url: "https://explorer.swellnetwork.io" }
21655
+ },
21656
+ contracts: {
21657
+ multicall3: {
21658
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
21659
+ blockCreated: 1
21660
+ }
21661
+ }
21662
+ });
21663
+ var tacMainnet = defineChain({
21664
+ id: 239,
21665
+ name: "TAC Mainnet",
21666
+ nativeCurrency: {
21667
+ decimals: 18,
21668
+ name: "Ether",
21669
+ symbol: "ETH"
21670
+ },
21671
+ rpcUrls: {
21672
+ default: {
21673
+ http: ["https://rpc.tac.build"]
21674
+ }
21675
+ },
21676
+ blockExplorers: {
21677
+ default: { name: "Explorer", url: "https://explorer.tac.build" }
21678
+ },
21679
+ contracts: {
21680
+ multicall3: {
21681
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
21682
+ blockCreated: 1
21683
+ }
21684
+ }
21685
+ });
21639
21686
  var customChains = {
21640
21687
  artela,
21641
21688
  botanix,
21642
21689
  crossfi,
21643
21690
  GraphLinq,
21644
21691
  hyperEvm,
21645
- monadMainnet
21692
+ monadMainnet,
21693
+ swellchain,
21694
+ tacMainnet
21646
21695
  };
21647
21696
 
21648
21697
  // src/chains/chainMapping.ts
@@ -24857,6 +24906,10 @@ function getEvmChain(chain) {
24857
24906
  return worldchain;
24858
24907
  case import_chain_registry.Chain.MONAD_MAINNET:
24859
24908
  return customChains.monadMainnet;
24909
+ case import_chain_registry.Chain.SWELLCHAIN:
24910
+ return customChains.swellchain;
24911
+ case import_chain_registry.Chain.TAC_MAINNET:
24912
+ return customChains.tacMainnet;
24860
24913
  case import_chain_registry.Chain.ZKLINK_NOVA_MAINNET:
24861
24914
  return {
24862
24915
  ...zkLinkNova,
@@ -24932,7 +24985,6 @@ var LIST_OVERRIDES = {
24932
24985
  "https://erpc.xdcrpc.com"
24933
24986
  ],
24934
24987
  [import_chain_registry2.Chain.ETHEREUM_MAINNET]: [
24935
- "https://eth.llamarpc.com",
24936
24988
  "https://api.zan.top/eth-mainnet",
24937
24989
  "https://rpc.flashbots.net/fast",
24938
24990
  "https://rpc.owlracle.info/eth/70d38ce1826c4a60bb2a8e05a6c8b20f",
@@ -24943,6 +24995,7 @@ var LIST_OVERRIDES = {
24943
24995
  "https://rpc.flashbots.net",
24944
24996
  "https://public-eth.nownodes.io",
24945
24997
  "https://ethereum-json-rpc.stakely.io",
24998
+ "https://eth.llamarpc.com",
24946
24999
  "https://eth.blockrazor.xyz",
24947
25000
  "https://eth.drpc.org",
24948
25001
  "https://ethereum.public.blockpi.network/v1/rpc/public",
@@ -24962,11 +25015,11 @@ var LIST_OVERRIDES = {
24962
25015
  "https://scroll-rpc.publicnode.com"
24963
25016
  ],
24964
25017
  [import_chain_registry2.Chain.SONIC_MAINNET]: [
24965
- "https://sonic.api.onfinality.io/public",
24966
25018
  "https://sonic-rpc.publicnode.com",
24967
25019
  "https://rpc.soniclabs.com",
24968
25020
  "https://sonic.drpc.org",
24969
- "https://sonic-json-rpc.stakely.io"
25021
+ "https://sonic-json-rpc.stakely.io",
25022
+ "https://sonic.api.onfinality.io/public"
24970
25023
  ],
24971
25024
  [import_chain_registry2.Chain.KAIA_MAINNET]: [
24972
25025
  "https://public-en.node.kaia.io",
@@ -25133,6 +25186,18 @@ var LIST_OVERRIDES = {
25133
25186
  "https://rpc.hyperlend.finance",
25134
25187
  "https://rpc.hyperliquid.xyz/evm"
25135
25188
  ],
25189
+ [import_chain_registry2.Chain.SWELLCHAIN]: [
25190
+ "https://rpc.swellnetwork.io",
25191
+ "https://swell-mainnet.alt.technology",
25192
+ "https://rpc.sentio.xyz/swell-mainnet",
25193
+ "https://rpc.ankr.com/swell"
25194
+ ],
25195
+ [import_chain_registry2.Chain.TAC_MAINNET]: [
25196
+ "https://rpc.ankr.com/tac",
25197
+ "https://rpc.tac.build",
25198
+ "https://tac.therpc.io",
25199
+ "https://ws.rpc.tac.build"
25200
+ ],
25136
25201
  [import_chain_registry2.Chain.UNICHAIN]: [
25137
25202
  "https://mainnet.unichain.org",
25138
25203
  "https://rpc.sentio.xyz/unichain-mainnet",
@@ -25277,22 +25342,68 @@ function getEvmClientWithCustomRpcsUniversal({
25277
25342
  }
25278
25343
 
25279
25344
  // src/multicall/multicall.ts
25280
- function isTransportError(e) {
25281
- const msg = e instanceof Error ? (e.message ?? "") + (e.details ?? "") : "";
25282
- return msg.includes("is not a constructor") || msg.includes("Dynamic require") || msg.includes("is not supported") || msg.includes("wrong json-rpc response") || msg.includes("there is neither result nor error");
25283
- }
25345
+ var HTTP_ERROR_CODES = /* @__PURE__ */ new Set([
25346
+ "ECONNRESET",
25347
+ "ECONNREFUSED",
25348
+ "ECONNABORTED",
25349
+ "ETIMEDOUT",
25350
+ "ENOTFOUND",
25351
+ "EPIPE",
25352
+ "EAI_AGAIN",
25353
+ "ERR_SOCKET_TIMEOUT",
25354
+ "UND_ERR_CONNECT_TIMEOUT",
25355
+ "UND_ERR_HEADERS_TIMEOUT",
25356
+ "UND_ERR_BODY_TIMEOUT",
25357
+ "UND_ERR_SOCKET"
25358
+ ]);
25359
+ var HTTP_ERROR_STRINGS = [
25360
+ "rate-limit",
25361
+ "Too Many Requests",
25362
+ "Bad gateway",
25363
+ "Service Unavailable",
25364
+ "<!DOCTYPE html>",
25365
+ "HTTP request failed",
25366
+ "fetch failed",
25367
+ "not whitelisted",
25368
+ "timed out",
25369
+ "timeout",
25370
+ "took too long",
25371
+ "socket hang up",
25372
+ "network error",
25373
+ "request aborted",
25374
+ "body exceeded",
25375
+ "CORS",
25376
+ "AbortError",
25377
+ "-32601",
25378
+ "-32005",
25379
+ "exceeded",
25380
+ "limit reached",
25381
+ "overloaded"
25382
+ ];
25284
25383
  function isHttpError(e) {
25384
+ const err = e;
25385
+ const code = err?.code ?? err?.cause?.code;
25386
+ if (code && HTTP_ERROR_CODES.has(code)) return true;
25387
+ if (err?.status === 401 || err?.status === 429 || err?.status >= 500)
25388
+ return true;
25389
+ if (err?.name === "AbortError" || err?.cause?.name === "AbortError")
25390
+ return true;
25285
25391
  if (e instanceof BaseError2) {
25286
- let err = e;
25287
- while (err) {
25288
- const status = err.status;
25392
+ let current = e;
25393
+ while (current) {
25394
+ const status = current.status;
25289
25395
  if (status && status >= 400) return true;
25290
- const details = err.details ?? "";
25291
- if (details.includes("rate-limit") || details.includes("Too Many Requests") || details.includes("Bad gateway") || details.includes("<!DOCTYPE html>"))
25292
- return true;
25293
- err = err.cause ?? null;
25396
+ const details = current.details ?? "";
25397
+ const message = current.message ?? "";
25398
+ const combined = `${message} ${details}`;
25399
+ if (HTTP_ERROR_STRINGS.some((s) => combined.includes(s))) return true;
25400
+ current = current.cause ?? null;
25294
25401
  }
25295
25402
  }
25403
+ if (e instanceof Error) {
25404
+ const combined = `${e.message ?? ""} ${e.details ?? ""}`;
25405
+ if (HTTP_ERROR_STRINGS.some((s) => combined.includes(s))) return true;
25406
+ }
25296
25407
  return false;
25297
25408
  }
25298
25409
  function isOutOfGasError(e) {
@@ -25404,8 +25515,11 @@ function createMulticallRetry(customRpcs = LIST_OVERRIDES) {
25404
25515
  maxSkips
25405
25516
  );
25406
25517
  }
25407
- if ((isHttpError(e) || isTransportError(e)) && maxSkips > 0) {
25408
- if (logErrors) console.debug(e);
25518
+ if (maxSkips > 0) {
25519
+ if (logErrors) {
25520
+ const tag = isHttpError(e) ? "HTTP" : "unknown-transient";
25521
+ console.debug(`[multicall] ${tag} error on provider ${providerId}, skipping`, e);
25522
+ }
25409
25523
  return await multicallRetry2(
25410
25524
  chain,
25411
25525
  calls,
@@ -25466,6 +25580,21 @@ async function multicallRetry(chain, calls, abi2, batchSize = DEFAULT_BATCH_SIZE
25466
25580
  logErrors
25467
25581
  );
25468
25582
  }
25583
+ function createMulticallRetryUniversal(customRpcs = LIST_OVERRIDES) {
25584
+ return async function multicallRetryUniversal2(params) {
25585
+ return multicallRetryInternal(
25586
+ params.chain,
25587
+ params.calls,
25588
+ params.abi,
25589
+ params.batchSize,
25590
+ params.maxRetries,
25591
+ params.providerId,
25592
+ params.allowFailure,
25593
+ customRpcs,
25594
+ params.logErrors
25595
+ );
25596
+ };
25597
+ }
25469
25598
  async function multicallRetryUniversal({
25470
25599
  chain,
25471
25600
  calls,
@@ -25494,6 +25623,7 @@ async function multicallRetryUniversal({
25494
25623
  DEFAULT_BATCH_SIZE,
25495
25624
  LIST_OVERRIDES,
25496
25625
  createMulticallRetry,
25626
+ createMulticallRetryUniversal,
25497
25627
  createTransport,
25498
25628
  customChains,
25499
25629
  deepCompare,
package/dist/index.mjs CHANGED
@@ -7926,13 +7926,61 @@ var monadMainnet = defineChain({
7926
7926
  }
7927
7927
  }
7928
7928
  });
7929
+ var swellchain = defineChain({
7930
+ id: 1923,
7931
+ name: "Swellchain",
7932
+ nativeCurrency: {
7933
+ decimals: 18,
7934
+ name: "Ether",
7935
+ symbol: "ETH"
7936
+ },
7937
+ rpcUrls: {
7938
+ default: {
7939
+ http: ["https://rpc.swellnetwork.io"]
7940
+ }
7941
+ },
7942
+ blockExplorers: {
7943
+ default: { name: "Explorer", url: "https://explorer.swellnetwork.io" }
7944
+ },
7945
+ contracts: {
7946
+ multicall3: {
7947
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
7948
+ blockCreated: 1
7949
+ }
7950
+ }
7951
+ });
7952
+ var tacMainnet = defineChain({
7953
+ id: 239,
7954
+ name: "TAC Mainnet",
7955
+ nativeCurrency: {
7956
+ decimals: 18,
7957
+ name: "Ether",
7958
+ symbol: "ETH"
7959
+ },
7960
+ rpcUrls: {
7961
+ default: {
7962
+ http: ["https://rpc.tac.build"]
7963
+ }
7964
+ },
7965
+ blockExplorers: {
7966
+ default: { name: "Explorer", url: "https://explorer.tac.build" }
7967
+ },
7968
+ contracts: {
7969
+ multicall3: {
7970
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
7971
+ blockCreated: 1
7972
+ }
7973
+ }
7974
+ });
7929
7975
  var customChains = {
7930
7976
  artela,
7931
7977
  botanix,
7932
7978
  crossfi,
7933
7979
  GraphLinq,
7934
7980
  hyperEvm,
7935
- monadMainnet
7981
+ monadMainnet,
7982
+ swellchain,
7983
+ tacMainnet
7936
7984
  };
7937
7985
 
7938
7986
  // src/chains/chainMapping.ts
@@ -11097,6 +11145,10 @@ function getEvmChain(chain) {
11097
11145
  return worldchain;
11098
11146
  case Chain.MONAD_MAINNET:
11099
11147
  return customChains.monadMainnet;
11148
+ case Chain.SWELLCHAIN:
11149
+ return customChains.swellchain;
11150
+ case Chain.TAC_MAINNET:
11151
+ return customChains.tacMainnet;
11100
11152
  case Chain.ZKLINK_NOVA_MAINNET:
11101
11153
  return {
11102
11154
  ...zkLinkNova,
@@ -11172,7 +11224,6 @@ var LIST_OVERRIDES = {
11172
11224
  "https://erpc.xdcrpc.com"
11173
11225
  ],
11174
11226
  [Chain2.ETHEREUM_MAINNET]: [
11175
- "https://eth.llamarpc.com",
11176
11227
  "https://api.zan.top/eth-mainnet",
11177
11228
  "https://rpc.flashbots.net/fast",
11178
11229
  "https://rpc.owlracle.info/eth/70d38ce1826c4a60bb2a8e05a6c8b20f",
@@ -11183,6 +11234,7 @@ var LIST_OVERRIDES = {
11183
11234
  "https://rpc.flashbots.net",
11184
11235
  "https://public-eth.nownodes.io",
11185
11236
  "https://ethereum-json-rpc.stakely.io",
11237
+ "https://eth.llamarpc.com",
11186
11238
  "https://eth.blockrazor.xyz",
11187
11239
  "https://eth.drpc.org",
11188
11240
  "https://ethereum.public.blockpi.network/v1/rpc/public",
@@ -11202,11 +11254,11 @@ var LIST_OVERRIDES = {
11202
11254
  "https://scroll-rpc.publicnode.com"
11203
11255
  ],
11204
11256
  [Chain2.SONIC_MAINNET]: [
11205
- "https://sonic.api.onfinality.io/public",
11206
11257
  "https://sonic-rpc.publicnode.com",
11207
11258
  "https://rpc.soniclabs.com",
11208
11259
  "https://sonic.drpc.org",
11209
- "https://sonic-json-rpc.stakely.io"
11260
+ "https://sonic-json-rpc.stakely.io",
11261
+ "https://sonic.api.onfinality.io/public"
11210
11262
  ],
11211
11263
  [Chain2.KAIA_MAINNET]: [
11212
11264
  "https://public-en.node.kaia.io",
@@ -11373,6 +11425,18 @@ var LIST_OVERRIDES = {
11373
11425
  "https://rpc.hyperlend.finance",
11374
11426
  "https://rpc.hyperliquid.xyz/evm"
11375
11427
  ],
11428
+ [Chain2.SWELLCHAIN]: [
11429
+ "https://rpc.swellnetwork.io",
11430
+ "https://swell-mainnet.alt.technology",
11431
+ "https://rpc.sentio.xyz/swell-mainnet",
11432
+ "https://rpc.ankr.com/swell"
11433
+ ],
11434
+ [Chain2.TAC_MAINNET]: [
11435
+ "https://rpc.ankr.com/tac",
11436
+ "https://rpc.tac.build",
11437
+ "https://tac.therpc.io",
11438
+ "https://ws.rpc.tac.build"
11439
+ ],
11376
11440
  [Chain2.UNICHAIN]: [
11377
11441
  "https://mainnet.unichain.org",
11378
11442
  "https://rpc.sentio.xyz/unichain-mainnet",
@@ -11517,22 +11581,68 @@ function getEvmClientWithCustomRpcsUniversal({
11517
11581
  }
11518
11582
 
11519
11583
  // src/multicall/multicall.ts
11520
- function isTransportError(e) {
11521
- const msg = e instanceof Error ? (e.message ?? "") + (e.details ?? "") : "";
11522
- return msg.includes("is not a constructor") || msg.includes("Dynamic require") || msg.includes("is not supported") || msg.includes("wrong json-rpc response") || msg.includes("there is neither result nor error");
11523
- }
11584
+ var HTTP_ERROR_CODES = /* @__PURE__ */ new Set([
11585
+ "ECONNRESET",
11586
+ "ECONNREFUSED",
11587
+ "ECONNABORTED",
11588
+ "ETIMEDOUT",
11589
+ "ENOTFOUND",
11590
+ "EPIPE",
11591
+ "EAI_AGAIN",
11592
+ "ERR_SOCKET_TIMEOUT",
11593
+ "UND_ERR_CONNECT_TIMEOUT",
11594
+ "UND_ERR_HEADERS_TIMEOUT",
11595
+ "UND_ERR_BODY_TIMEOUT",
11596
+ "UND_ERR_SOCKET"
11597
+ ]);
11598
+ var HTTP_ERROR_STRINGS = [
11599
+ "rate-limit",
11600
+ "Too Many Requests",
11601
+ "Bad gateway",
11602
+ "Service Unavailable",
11603
+ "<!DOCTYPE html>",
11604
+ "HTTP request failed",
11605
+ "fetch failed",
11606
+ "not whitelisted",
11607
+ "timed out",
11608
+ "timeout",
11609
+ "took too long",
11610
+ "socket hang up",
11611
+ "network error",
11612
+ "request aborted",
11613
+ "body exceeded",
11614
+ "CORS",
11615
+ "AbortError",
11616
+ "-32601",
11617
+ "-32005",
11618
+ "exceeded",
11619
+ "limit reached",
11620
+ "overloaded"
11621
+ ];
11524
11622
  function isHttpError(e) {
11623
+ const err = e;
11624
+ const code = err?.code ?? err?.cause?.code;
11625
+ if (code && HTTP_ERROR_CODES.has(code)) return true;
11626
+ if (err?.status === 401 || err?.status === 429 || err?.status >= 500)
11627
+ return true;
11628
+ if (err?.name === "AbortError" || err?.cause?.name === "AbortError")
11629
+ return true;
11525
11630
  if (e instanceof BaseError) {
11526
- let err = e;
11527
- while (err) {
11528
- const status = err.status;
11631
+ let current = e;
11632
+ while (current) {
11633
+ const status = current.status;
11529
11634
  if (status && status >= 400) return true;
11530
- const details = err.details ?? "";
11531
- if (details.includes("rate-limit") || details.includes("Too Many Requests") || details.includes("Bad gateway") || details.includes("<!DOCTYPE html>"))
11532
- return true;
11533
- err = err.cause ?? null;
11635
+ const details = current.details ?? "";
11636
+ const message = current.message ?? "";
11637
+ const combined = `${message} ${details}`;
11638
+ if (HTTP_ERROR_STRINGS.some((s) => combined.includes(s))) return true;
11639
+ current = current.cause ?? null;
11534
11640
  }
11535
11641
  }
11642
+ if (e instanceof Error) {
11643
+ const combined = `${e.message ?? ""} ${e.details ?? ""}`;
11644
+ if (HTTP_ERROR_STRINGS.some((s) => combined.includes(s))) return true;
11645
+ }
11536
11646
  return false;
11537
11647
  }
11538
11648
  function isOutOfGasError(e) {
@@ -11644,8 +11754,11 @@ function createMulticallRetry(customRpcs = LIST_OVERRIDES) {
11644
11754
  maxSkips
11645
11755
  );
11646
11756
  }
11647
- if ((isHttpError(e) || isTransportError(e)) && maxSkips > 0) {
11648
- if (logErrors) console.debug(e);
11757
+ if (maxSkips > 0) {
11758
+ if (logErrors) {
11759
+ const tag = isHttpError(e) ? "HTTP" : "unknown-transient";
11760
+ console.debug(`[multicall] ${tag} error on provider ${providerId}, skipping`, e);
11761
+ }
11649
11762
  return await multicallRetry2(
11650
11763
  chain,
11651
11764
  calls,
@@ -11706,6 +11819,21 @@ async function multicallRetry(chain, calls, abi2, batchSize = DEFAULT_BATCH_SIZE
11706
11819
  logErrors
11707
11820
  );
11708
11821
  }
11822
+ function createMulticallRetryUniversal(customRpcs = LIST_OVERRIDES) {
11823
+ return async function multicallRetryUniversal2(params) {
11824
+ return multicallRetryInternal(
11825
+ params.chain,
11826
+ params.calls,
11827
+ params.abi,
11828
+ params.batchSize,
11829
+ params.maxRetries,
11830
+ params.providerId,
11831
+ params.allowFailure,
11832
+ customRpcs,
11833
+ params.logErrors
11834
+ );
11835
+ };
11836
+ }
11709
11837
  async function multicallRetryUniversal({
11710
11838
  chain,
11711
11839
  calls,
@@ -11733,6 +11861,7 @@ export {
11733
11861
  DEFAULT_BATCH_SIZE,
11734
11862
  LIST_OVERRIDES,
11735
11863
  createMulticallRetry,
11864
+ createMulticallRetryUniversal,
11736
11865
  createTransport2 as createTransport,
11737
11866
  customChains,
11738
11867
  deepCompare,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/providers",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
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/data-sdk": "0.0.17",
22
- "@1delta/chain-registry": "0.0.4"
21
+ "@1delta/chain-registry": "0.0.4",
22
+ "@1delta/data-sdk": "0.0.17"
23
23
  },
24
24
  "devDependencies": {
25
25
  "tsup": "^8.5.1",
@@ -304,6 +304,10 @@ export function getEvmChain(chain: string) {
304
304
  return worldchain
305
305
  case Chain.MONAD_MAINNET:
306
306
  return customChains.monadMainnet
307
+ case Chain.SWELLCHAIN:
308
+ return customChains.swellchain
309
+ case Chain.TAC_MAINNET:
310
+ return customChains.tacMainnet
307
311
  case Chain.ZKLINK_NOVA_MAINNET:
308
312
  return {
309
313
  ...zkLinkNova,
@@ -192,6 +192,54 @@ const monadMainnet = defineChain({
192
192
  },
193
193
  })
194
194
 
195
+ const swellchain = defineChain({
196
+ id: 1923,
197
+ name: 'Swellchain',
198
+ nativeCurrency: {
199
+ decimals: 18,
200
+ name: 'Ether',
201
+ symbol: 'ETH',
202
+ },
203
+ rpcUrls: {
204
+ default: {
205
+ http: ['https://rpc.swellnetwork.io'],
206
+ },
207
+ },
208
+ blockExplorers: {
209
+ default: { name: 'Explorer', url: 'https://explorer.swellnetwork.io' },
210
+ },
211
+ contracts: {
212
+ multicall3: {
213
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
214
+ blockCreated: 1,
215
+ },
216
+ },
217
+ })
218
+
219
+ const tacMainnet = defineChain({
220
+ id: 239,
221
+ name: 'TAC Mainnet',
222
+ nativeCurrency: {
223
+ decimals: 18,
224
+ name: 'Ether',
225
+ symbol: 'ETH',
226
+ },
227
+ rpcUrls: {
228
+ default: {
229
+ http: ['https://rpc.tac.build'],
230
+ },
231
+ },
232
+ blockExplorers: {
233
+ default: { name: 'Explorer', url: 'https://explorer.tac.build' },
234
+ },
235
+ contracts: {
236
+ multicall3: {
237
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
238
+ blockCreated: 1,
239
+ },
240
+ },
241
+ })
242
+
195
243
  export const customChains = {
196
244
  artela,
197
245
  botanix,
@@ -199,4 +247,6 @@ export const customChains = {
199
247
  GraphLinq,
200
248
  hyperEvm,
201
249
  monadMainnet,
250
+ swellchain,
251
+ tacMainnet,
202
252
  } as const
@@ -7,37 +7,83 @@ import { LIST_OVERRIDES } from '../rpc/rpcOverrides'
7
7
  import { getEvmClientWithCustomRpcsUniversal } from '../client/client'
8
8
  import { DEFAULT_BATCH_SIZE, deepCompare, isArray } from '../utils/utils'
9
9
 
10
- /** Return true if the error is a transport/environment issue (not an RPC or contract error) */
11
- function isTransportError(e: unknown): boolean {
12
- const msg =
13
- e instanceof Error ? (e.message ?? '') + ((e as any).details ?? '') : ''
14
- return (
15
- msg.includes('is not a constructor') ||
16
- msg.includes('Dynamic require') ||
17
- msg.includes('is not supported') ||
18
- msg.includes('wrong json-rpc response') ||
19
- msg.includes('there is neither result nor error')
20
- )
21
- }
10
+ /** Connection-level error codes that indicate a transport failure */
11
+ const HTTP_ERROR_CODES = new Set([
12
+ 'ECONNRESET',
13
+ 'ECONNREFUSED',
14
+ 'ECONNABORTED',
15
+ 'ETIMEDOUT',
16
+ 'ENOTFOUND',
17
+ 'EPIPE',
18
+ 'EAI_AGAIN',
19
+ 'ERR_SOCKET_TIMEOUT',
20
+ 'UND_ERR_CONNECT_TIMEOUT',
21
+ 'UND_ERR_HEADERS_TIMEOUT',
22
+ 'UND_ERR_BODY_TIMEOUT',
23
+ 'UND_ERR_SOCKET',
24
+ ])
25
+
26
+ /** Substrings in error messages that indicate an HTTP/transport failure */
27
+ const HTTP_ERROR_STRINGS = [
28
+ 'rate-limit',
29
+ 'Too Many Requests',
30
+ 'Bad gateway',
31
+ 'Service Unavailable',
32
+ '<!DOCTYPE html>',
33
+ 'HTTP request failed',
34
+ 'fetch failed',
35
+ 'not whitelisted',
36
+ 'timed out',
37
+ 'timeout',
38
+ 'took too long',
39
+ 'socket hang up',
40
+ 'network error',
41
+ 'request aborted',
42
+ 'body exceeded',
43
+ 'CORS',
44
+ 'AbortError',
45
+ '-32601',
46
+ '-32005',
47
+ 'exceeded',
48
+ 'limit reached',
49
+ 'overloaded',
50
+ ]
22
51
 
23
52
  /** Return true if the error is an HTTP-level failure (429, 502, 503, etc.) rather than a contract/RPC error */
24
53
  function isHttpError(e: unknown): boolean {
54
+ // Check connection-level error codes on the error and its cause chain
55
+ const err = e as any
56
+ const code = err?.code ?? err?.cause?.code
57
+ if (code && HTTP_ERROR_CODES.has(code)) return true
58
+
59
+ // Check numeric status on the error itself (non-BaseError cases)
60
+ if (err?.status === 401 || err?.status === 429 || err?.status >= 500)
61
+ return true
62
+
63
+ // Check error name (e.g. AbortError from fetch timeout)
64
+ if (err?.name === 'AbortError' || err?.cause?.name === 'AbortError')
65
+ return true
66
+
67
+ // Walk the BaseError cause chain for status codes and detail strings
25
68
  if (e instanceof BaseError) {
26
- let err: any = e
27
- while (err) {
28
- const status = err.status as number | undefined
69
+ let current: any = e
70
+ while (current) {
71
+ const status = current.status as number | undefined
29
72
  if (status && status >= 400) return true
30
- const details: string = err.details ?? ''
31
- if (
32
- details.includes('rate-limit') ||
33
- details.includes('Too Many Requests') ||
34
- details.includes('Bad gateway') ||
35
- details.includes('<!DOCTYPE html>')
36
- )
37
- return true
38
- err = err.cause ?? null
73
+ const details: string = current.details ?? ''
74
+ const message: string = current.message ?? ''
75
+ const combined = `${message} ${details}`
76
+ if (HTTP_ERROR_STRINGS.some((s) => combined.includes(s))) return true
77
+ current = current.cause ?? null
39
78
  }
40
79
  }
80
+
81
+ // Fallback: check message + details as strings for non-BaseError errors
82
+ if (e instanceof Error) {
83
+ const combined = `${e.message ?? ''} ${(e as any).details ?? ''}`
84
+ if (HTTP_ERROR_STRINGS.some((s) => combined.includes(s))) return true
85
+ }
86
+
41
87
  return false
42
88
  }
43
89
 
@@ -217,10 +263,14 @@ export function createMulticallRetry(
217
263
  )
218
264
  }
219
265
 
220
- // Rate-limit (429) or transport/environment errors:
221
- // skip to next RPC without consuming a retry
222
- if ((isHttpError(e) || isTransportError(e)) && maxSkips > 0) {
223
- if (logErrors) console.debug(e)
266
+ // Any non-revert, non-OOG error is treated as transient (HTTP, transport,
267
+ // rate-limit, unknown RPC error). Skip to next RPC without consuming a
268
+ // retry only deterministic errors (revert, OOG) are handled above.
269
+ if (maxSkips > 0) {
270
+ if (logErrors) {
271
+ const tag = isHttpError(e) ? 'HTTP' : 'unknown-transient'
272
+ console.debug(`[multicall] ${tag} error on provider ${providerId}, skipping`, e)
273
+ }
224
274
  return await multicallRetry(
225
275
  chain,
226
276
  calls,
@@ -241,6 +291,7 @@ export function createMulticallRetry(
241
291
  return Array(calls.length).fill('0x')
242
292
  }
243
293
 
294
+ // Skips exhausted — consume a retry and rotate RPC
244
295
  if (logErrors) console.debug(e)
245
296
 
246
297
  return await multicallRetry(
@@ -311,6 +362,26 @@ export async function multicallRetry(
311
362
  )
312
363
  }
313
364
 
365
+ export function createMulticallRetryUniversal(
366
+ customRpcs: Record<string, string[]> = LIST_OVERRIDES,
367
+ ) {
368
+ return async function multicallRetryUniversal(
369
+ params: MulticallRetryParams,
370
+ ): Promise<any[]> {
371
+ return multicallRetryInternal(
372
+ params.chain,
373
+ params.calls,
374
+ params.abi,
375
+ params.batchSize,
376
+ params.maxRetries,
377
+ params.providerId,
378
+ params.allowFailure,
379
+ customRpcs,
380
+ params.logErrors,
381
+ )
382
+ }
383
+ }
384
+
314
385
  export async function multicallRetryUniversal({
315
386
  chain,
316
387
  calls,
@@ -61,7 +61,6 @@ export const LIST_OVERRIDES: Record<string, string[]> = {
61
61
  'https://erpc.xdcrpc.com',
62
62
  ],
63
63
  [Chain.ETHEREUM_MAINNET]: [
64
- 'https://eth.llamarpc.com',
65
64
  'https://api.zan.top/eth-mainnet',
66
65
  'https://rpc.flashbots.net/fast',
67
66
  'https://rpc.owlracle.info/eth/70d38ce1826c4a60bb2a8e05a6c8b20f',
@@ -72,6 +71,7 @@ export const LIST_OVERRIDES: Record<string, string[]> = {
72
71
  'https://rpc.flashbots.net',
73
72
  'https://public-eth.nownodes.io',
74
73
  'https://ethereum-json-rpc.stakely.io',
74
+ 'https://eth.llamarpc.com',
75
75
  'https://eth.blockrazor.xyz',
76
76
  'https://eth.drpc.org',
77
77
  'https://ethereum.public.blockpi.network/v1/rpc/public',
@@ -91,11 +91,11 @@ export const LIST_OVERRIDES: Record<string, string[]> = {
91
91
  'https://scroll-rpc.publicnode.com',
92
92
  ],
93
93
  [Chain.SONIC_MAINNET]: [
94
- 'https://sonic.api.onfinality.io/public',
95
94
  'https://sonic-rpc.publicnode.com',
96
95
  'https://rpc.soniclabs.com',
97
96
  'https://sonic.drpc.org',
98
97
  'https://sonic-json-rpc.stakely.io',
98
+ 'https://sonic.api.onfinality.io/public',
99
99
  ],
100
100
  [Chain.KAIA_MAINNET]: [
101
101
  'https://public-en.node.kaia.io',
@@ -262,6 +262,18 @@ export const LIST_OVERRIDES: Record<string, string[]> = {
262
262
  'https://rpc.hyperlend.finance',
263
263
  'https://rpc.hyperliquid.xyz/evm',
264
264
  ],
265
+ [Chain.SWELLCHAIN]: [
266
+ 'https://rpc.swellnetwork.io',
267
+ 'https://swell-mainnet.alt.technology',
268
+ 'https://rpc.sentio.xyz/swell-mainnet',
269
+ 'https://rpc.ankr.com/swell',
270
+ ],
271
+ [Chain.TAC_MAINNET]: [
272
+ 'https://rpc.ankr.com/tac',
273
+ 'https://rpc.tac.build',
274
+ 'https://tac.therpc.io',
275
+ 'https://ws.rpc.tac.build',
276
+ ],
265
277
  [Chain.UNICHAIN]: [
266
278
  'https://mainnet.unichain.org',
267
279
  'https://rpc.sentio.xyz/unichain-mainnet',