Drift
When the optional signing dependency (ethers in TypeScript, eth-account in Python) isn't installed, each SDK raises a different generic error type — and neither is PmxtError, so the two languages are also inconsistent with each other.
TypeScript SDK
sdks/typescript/pmxt/signers.ts:44-61 (loadEthers):
export function loadEthers(installHint: string = ETHERS_INSTALL_HINT): any {
if (typeof require === "function") {
try {
return require("ethers");
} catch {
throw new Error(installHint);
}
}
...
if (!req) throw new Error(installHint);
try {
return req("ethers");
} catch {
throw new Error(installHint);
}
}
Throws a plain JS Error, not PmxtError.
Python SDK
sdks/python/pmxt/signers.py:24-33 (_load_eth_account):
def _load_eth_account() -> tuple[Any, Any]:
try:
from eth_account import Account
from eth_account.messages import encode_typed_data
except ImportError as exc:
raise ImportError(
"Hosted PMXT signing requires the optional eth-account dependency. "
f"Install it with: {_ETH_ACCOUNT_INSTALL_HINT}."
) from exc
return Account, encode_typed_data
Raises a built-in ImportError, not PmxtError.
Expected
Both SDKs should raise the same typed SDK error (e.g. a PmxtError subclass) for a missing optional signing dependency, so the failure is catchable through the SDK's normal error-handling surface.
Impact
Code written to catch PmxtError for "hosted signing unavailable" misses this condition in both SDKs, but in mutually incompatible ways: TypeScript callers must catch a generic Error, Python callers must specifically catch ImportError. Neither matches the other, and neither integrates with the SDK's typed error hierarchy. Not covered by already-filed #1438 (which only addresses the visibility/reusability of loadEthers, not its error type).
Found by automated SDK cross-language drift audit
Drift
When the optional signing dependency (
ethersin TypeScript,eth-accountin Python) isn't installed, each SDK raises a different generic error type — and neither isPmxtError, so the two languages are also inconsistent with each other.TypeScript SDK
sdks/typescript/pmxt/signers.ts:44-61(loadEthers):Throws a plain JS
Error, notPmxtError.Python SDK
sdks/python/pmxt/signers.py:24-33(_load_eth_account):Raises a built-in
ImportError, notPmxtError.Expected
Both SDKs should raise the same typed SDK error (e.g. a
PmxtErrorsubclass) for a missing optional signing dependency, so the failure is catchable through the SDK's normal error-handling surface.Impact
Code written to catch
PmxtErrorfor "hosted signing unavailable" misses this condition in both SDKs, but in mutually incompatible ways: TypeScript callers must catch a genericError, Python callers must specifically catchImportError. Neither matches the other, and neither integrates with the SDK's typed error hierarchy. Not covered by already-filed #1438 (which only addresses the visibility/reusability ofloadEthers, not its error type).Found by automated SDK cross-language drift audit