• Converts a LedgerId object to a CAIP chain id.

    If no mapping is found, returns the CAIP chain id for LedgerId.LOCAL_NODE.

    Parameters

    • ledgerId: LedgerId

      The LedgerId object to be converted

    Returns string

    A string representing the CAIP chain id for the provided LedgerId

    Example

    const mainnetChainId = ledgerIdToCAIPChainId(HederaChainId.Mainnet)
    console.log(mainnetChainId) // LedgerId.PREVIEWNET
    const testnetChainId = ledgerIdToCAIPChainId(HederaChainId.Testnet)
    console.log(testnetChainId) // LedgerId.TESTNET

Generated using TypeDoc