Summary
The package root exports seven Predicate-related runtime values/functions that are absent from the published TypeScript declarations. JavaScript consumers can import them from @fairblock/stabletrust, while strict TypeScript consumers receive TS2305 for the same imports.
Affected exports:
APPLY_PENDING_SIGNATURE
CREATE_CONFIDENTIAL_ACCOUNT_SIGNATURE
DEPOSIT_SIGNATURE
PREDICATE_ATTESTATION_SIGNATURE
emptyPredicateAttestation
injectPredicateAttestation
isPredicateAttestation
Tested on:
- repository SHA:
7a3faaa5f7e136ea3fafaefd1bc6541a9a5954fe
- package:
@fairblock/stabletrust@2.0.15
- TypeScript:
5.9.2
- Node.js:
v22.23.1
Expected behavior
Values and functions exported by the package's public runtime entrypoint should also be available from its configured TypeScript declaration entrypoint.
Actual behavior
All seven names exist and import successfully at runtime on Node 18 and Node 22. Compiling equivalent TypeScript imports produces seven TS2305 diagnostics and exits with code 2.
Reproduction
Create a clean directory and install:
npm install @fairblock/stabletrust@2.0.15 typescript@5.9.2
Save as repro.ts:
import {
APPLY_PENDING_SIGNATURE,
CREATE_CONFIDENTIAL_ACCOUNT_SIGNATURE,
DEPOSIT_SIGNATURE,
PREDICATE_ATTESTATION_SIGNATURE,
emptyPredicateAttestation,
injectPredicateAttestation,
isPredicateAttestation,
} from "@fairblock/stabletrust";
const attestation = emptyPredicateAttestation();
void injectPredicateAttestation("applyPending", []);
void isPredicateAttestation(attestation);
void [
APPLY_PENDING_SIGNATURE,
CREATE_CONFIDENTIAL_ACCOUNT_SIGNATURE,
DEPOSIT_SIGNATURE,
PREDICATE_ATTESTATION_SIGNATURE,
];
Compile:
npx tsc --noEmit \
--target ES2022 \
--module NodeNext \
--moduleResolution NodeNext \
--strict \
--skipLibCheck false \
repro.ts
Observed result:
error TS2305: Module '"@fairblock/stabletrust"' has no exported member 'APPLY_PENDING_SIGNATURE'.
error TS2305: Module '"@fairblock/stabletrust"' has no exported member 'CREATE_CONFIDENTIAL_ACCOUNT_SIGNATURE'.
error TS2305: Module '"@fairblock/stabletrust"' has no exported member 'DEPOSIT_SIGNATURE'.
error TS2305: Module '"@fairblock/stabletrust"' has no exported member 'PREDICATE_ATTESTATION_SIGNATURE'.
error TS2305: Module '"@fairblock/stabletrust"' has no exported member 'emptyPredicateAttestation'.
error TS2305: Module '"@fairblock/stabletrust"' has no exported member 'injectPredicateAttestation'.
error TS2305: Module '"@fairblock/stabletrust"' has no exported member 'isPredicateAttestation'.
TSC_EXIT=2
A runtime control importing the same seven names from the same installed package exits successfully.
Root cause
Merged PR #7 added the Predicate constants and helpers to src/index.js, src/constants.js, and src/predicate-contract.js, but did not update src/index.d.ts or the supplemental src/withdrawal-fees.d.ts used by the package's types entrypoint.
The package therefore publishes a runtime surface newer than its declaration surface.
Impact
TypeScript applications cannot use the current Predicate compatibility helpers and selector constants without local declaration augmentation, casts, or suppression comments, despite those APIs being publicly exported and used by the runtime wrappers.
Suggested fix
- declare a named Predicate attestation tuple/object type matching the runtime guard;
- declare the three helper functions with their real argument and return shapes;
- declare the four signature constants as strings;
- add a packed clean-consumer TypeScript test that imports every root runtime value introduced by Predicate support.
Duplicate check
I searched open and closed issues/PRs using the seven export names, Predicate typings, TypeScript declarations, and TS2305.
No existing report or open fix for these seven exports was found.
Summary
The package root exports seven Predicate-related runtime values/functions that are absent from the published TypeScript declarations. JavaScript consumers can import them from
@fairblock/stabletrust, while strict TypeScript consumers receiveTS2305for the same imports.Affected exports:
APPLY_PENDING_SIGNATURECREATE_CONFIDENTIAL_ACCOUNT_SIGNATUREDEPOSIT_SIGNATUREPREDICATE_ATTESTATION_SIGNATUREemptyPredicateAttestationinjectPredicateAttestationisPredicateAttestationTested on:
7a3faaa5f7e136ea3fafaefd1bc6541a9a5954fe@fairblock/stabletrust@2.0.155.9.2v22.23.1Expected behavior
Values and functions exported by the package's public runtime entrypoint should also be available from its configured TypeScript declaration entrypoint.
Actual behavior
All seven names exist and import successfully at runtime on Node 18 and Node 22. Compiling equivalent TypeScript imports produces seven
TS2305diagnostics and exits with code 2.Reproduction
Create a clean directory and install:
Save as
repro.ts:Compile:
npx tsc --noEmit \ --target ES2022 \ --module NodeNext \ --moduleResolution NodeNext \ --strict \ --skipLibCheck false \ repro.tsObserved result:
A runtime control importing the same seven names from the same installed package exits successfully.
Root cause
Merged PR #7 added the Predicate constants and helpers to
src/index.js,src/constants.js, andsrc/predicate-contract.js, but did not updatesrc/index.d.tsor the supplementalsrc/withdrawal-fees.d.tsused by the package'stypesentrypoint.The package therefore publishes a runtime surface newer than its declaration surface.
Impact
TypeScript applications cannot use the current Predicate compatibility helpers and selector constants without local declaration augmentation, casts, or suppression comments, despite those APIs being publicly exported and used by the runtime wrappers.
Suggested fix
Duplicate check
I searched open and closed issues/PRs using the seven export names, Predicate typings, TypeScript declarations, and
TS2305.src/index.d.ts, but its head predates Predicate PR Update SDK for Predicate-bearing confidential ABI #7 and contains none of these seven symbols. It addresses signer, return-type, and anonymous-method declarations instead.src/index.d.tsonly for deterministic key-derivation signer types and does not add these Predicate declarations.No existing report or open fix for these seven exports was found.