Vana SDK - v0.1.0
    Preparing search index...

    Function getContractAddress

    • Retrieves the deployed contract address for a specific contract on a given chain.

      Parameters

      • chainId: number

        The chain ID to look up the contract on

      • contract:
            | "TeePool"
            | "DLPRoot"
            | "DataPermissions"
            | "DataRegistry"
            | "TeePoolPhala"
            | "ComputeEngine"
            | "DataRefinerRegistry"
            | "QueryEngine"
            | "ComputeInstructionRegistry"
            | "TeePoolEphemeralStandard"
            | "TeePoolPersistentStandard"
            | "TeePoolPersistentGpu"
            | "TeePoolDedicatedStandard"
            | "TeePoolDedicatedGpu"
            | "VanaEpoch"
            | "DLPRegistry"
            | "DLPRegistryTreasury"
            | "DLPRewardDeployerTreasury"
            | "DLPRegistryTreasuryImplementation"
            | "DLPPerformance"
            | "DLPRewardDeployer"
            | "DLPRewardSwap"
            | "SwapHelper"
            | "DataLiquidityPool"
            | "VanaPoolStaking"
            | "VanaPoolEntity"
            | "VanaPoolTreasury"
            | "DAT"
            | "DATFactory"
            | "DATPausable"
            | "DATVotes"

        The contract name to get the address for

      Returns `0x${string}`

      The contract address as a hex string

      When contract address not found for the specified contract and chain

      try {
      const dataRegistryAddress = getContractAddress(1480, 'DataRegistry');
      console.log('DataRegistry address:', dataRegistryAddress);
      } catch (error) {
      console.error('Contract not deployed on this chain:', error.message);
      }