You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@metadaoproject/programs (0.1.1-alpha.2, built from master) exposes two different priceMath modules through its package entry, which breaks import { PriceMath } from "@metadaoproject/programs" under tsc --strict:
sdk/src/amm/v0.5/index.ts → re-exports its own ./priceMath.js (simulateSwap, SwapSimulation, ...)
sdk/src/index.ts star-exports both chains (export * from "./priceMath.js" and export * from "./launchpad/index.js" → ./amm/v0.5/index.js), so consumers get conflicting module identities for the same name depending on resolution order.
Error
src/index.ts:1:10 - error TS2308: Module './priceMath.js' has already exported a
member named 'PriceMath'. Consider explicitly re-exporting to resolve the ambiguity.
MCVE
Full reproduction (fresh project, npm i @metadaoproject/programs@alpha, single import, npx tsc --strict) is here:
A single canonical priceMath surface, or an explicit namespaced re-export (e.g. export * as AmmV05PriceMath from "./amm/v0.5/priceMath.js").
Environment
@metadaoproject/programs 0.1.1-alpha.2
typescript 5.x, node 22
Happy to open a PR with the namespaced re-export if the maintainers prefer that direction — wanted to check the intended public surface first, since v0.4 does not export priceMath from its index.ts while v0.5 does.
Follow-up while preparing the PR: I checked the published tarball of 0.1.1-alpha.2 and both modules are present, so the ambiguity ships to consumers as-is.
@metapileks you touched the SDK layout most recently (met-454 / the v0.5 restructure) — is the namespaced re-export the direction you would accept? I would rather match the maintainers intended public surface than guess.
Correction for the record (credit to the repo's AI review on #504): the TS2308 I hit does not reproduce against the current branch — my MCVE was resolving a cached tarball of an earlier alpha where the root index re-exported the amm chain. Against master/develop, sdk/src/index.ts does not export from ./amm, so the reported collision does not exist as described.
The remaining (much smaller) ask in #504 is just the optional namespaced alias for explicitness. Closing this issue as not-a-bug; thanks for the look.
Activity
RicainvLovemr commentedon Nov 21, 2026
Follow-up while preparing the PR: I checked the published tarball of 0.1.1-alpha.2 and both modules are present, so the ambiguity ships to consumers as-is.
@metapileks you touched the SDK layout most recently (met-454 / the v0.5 restructure) — is the namespaced re-export the direction you would accept? I would rather match the maintainers intended public surface than guess.
cc @copilot if the repo has triage enabled: the MCVE reproduction is self-contained at https://github.com/RicainvLovemr/mcve-programs-sdk/blob/main/mcve_priceMath.ts — it includes the exact tsc invocation and the expected/actual output for triage.
fix(sdk): namespace amm v0.5 priceMath exports
fix(sdk): keep flat v0.5 priceMath exports + add namespaced alias
RicainvLovemr commentedon Nov 22, 2026
Correction for the record (credit to the repo's AI review on #504): the TS2308 I hit does not reproduce against the current branch — my MCVE was resolving a cached tarball of an earlier alpha where the root index re-exported the amm chain. Against master/develop, sdk/src/index.ts does not export from ./amm, so the reported collision does not exist as described.
The remaining (much smaller) ask in #504 is just the optional namespaced alias for explicitness. Closing this issue as not-a-bug; thanks for the look.