Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

account.getChain()

Get the chain configuration.

Type: instance

Signature

getChain(): Chain

Parameters

None.

Returns

Chain - The chain configuration object.

Chain

interface Chain {
  /** Chain ID */
  id: number;
  /** RPC URL for the chain */
  rpcUrl: string;
  /** Optional paymaster URL for gas sponsorship */
  paymasterUrl?: string;
}

Behavior

Returns a copy of the chain configuration used by this account instance. Modifying the returned object does not affect the account.

Example

import { Account } from '@jaw.id/core';
 
const account = await Account.get({
  chainId: 1,
  apiKey: 'your-api-key',
});
 
const chain = account.getChain();
 
console.log('Chain ID:', chain.id);
console.log('RPC URL:', chain.rpcUrl);
console.log('Paymaster URL:', chain.paymasterUrl);

Related