@pyxisjs/chains 0.2.0 → 0.2.2

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.mjs CHANGED
@@ -7430,17 +7430,17 @@ var AptosAnalyticsClient = class {
7430
7430
  };
7431
7431
 
7432
7432
  // src/evm/adapter.ts
7433
- import {
7434
- createPublicClient,
7435
- http,
7436
- erc20Abi
7437
- } from "viem";
7438
- import { mainnet, sepolia, arbitrum } from "viem/chains";
7439
7433
  import {
7440
7434
  BaseChainAdapter as BaseChainAdapter3,
7441
- ChainId
7435
+ ChainId,
7436
+ getChainConfig as getChainConfig3
7442
7437
  } from "@pyxisjs/core";
7443
- import { getChainConfig as getChainConfig3 } from "@pyxisjs/core";
7438
+ import {
7439
+ createPublicClient,
7440
+ erc20Abi,
7441
+ http
7442
+ } from "viem";
7443
+ import { arbitrum, mainnet, sepolia } from "viem/chains";
7444
7444
  var viemChainMap = {
7445
7445
  [ChainId.ETHEREUM_MAINNET]: mainnet,
7446
7446
  [ChainId.ETHEREUM_SEPOLIA]: sepolia,
@@ -7449,25 +7449,15 @@ var viemChainMap = {
7449
7449
  var EthereumChainAdapter = class extends BaseChainAdapter3 {
7450
7450
  constructor(chain) {
7451
7451
  super(chain);
7452
- const config = getChainConfig3(chain.id);
7453
- if (!config.chainId) {
7454
- throw new Error(`EVM chain requires chainId: ${chain.id}`);
7455
- }
7456
- this.viemChain = viemChainMap[chain.id] || {
7457
- id: config.chainId,
7458
- name: config.name,
7459
- nativeCurrency: config.nativeCurrency,
7460
- rpcUrls: {
7461
- default: { http: [chain.rpcUrl] }
7462
- },
7463
- blockExplorers: config.blockExplorerUrls?.length ? {
7464
- default: { name: "Explorer", url: config.blockExplorerUrls[0] }
7465
- } : void 0
7466
- };
7467
- this.createClient();
7452
+ this.viemChain = viemChainMap[chain.id];
7453
+ invariant(this.viemChain, `Chain ${chain.id} not found in viemChainMap`);
7454
+ this.client = createPublicClient({
7455
+ chain: this.viemChain,
7456
+ transport: http(this.chain.rpcUrl)
7457
+ });
7468
7458
  }
7469
7459
  /**
7470
- * Create EVM client using viem
7460
+ * [DEPRECATED] Create EVM client using viem
7471
7461
  */
7472
7462
  createClient(config) {
7473
7463
  this.client = createPublicClient({