• Converts a CAIP chain id to a LedgerId object.

    If no mapping is found, returns LedgerId.LOCAL_NODE.

    Parameters

    • chainId: string

      The CAIP chain ID (string) to be converted

    Returns LedgerId

    A LedgerId corresponding to the provided CAIP chain ID

    Example

    const previewnetLedgerId = CAIPChainIdToLedgerId(HederaChainId.Previewnet)
    console.log(previewnetLedgerId) // LedgerId.PREVIEWNET
    const testnetLedgerId = CAIPChainIdToLedgerId(HederaChainId.Testnet)
    console.log(testnetLedgerId) // LedgerId.TESTNET

Generated using TypeDoc