export function parsePkhDid(did) {
    const parts = did.split(":");
    if (!did.startsWith("did:pkh:") || parts.length !== 5) {
        throw new Error("Invalid pkh did");
    }
    const [, , networkId, chainIdStr, address] = parts;
    if (!address.startsWith("0x")) {
        throw new Error(`Invalid address: ${address}`);
    }
    const chainId = Number(chainIdStr);
    if (isNaN(chainId)) {
        throw new Error(`Invalid chain id: ${chainIdStr}`);
    }
    return {
        chainId,
        networkId,
        address: address,
    };
}
//# sourceMappingURL=utils.js.map