Skip to content

feat: @hashpower/collateral-abi package + semver-aware auto-publish - #47

Merged
abs2023 merged 2 commits into
devfrom
feat/collateral-abi-package
Jul 29, 2026
Merged

feat: @hashpower/collateral-abi package + semver-aware auto-publish#47
abs2023 merged 2 commits into
devfrom
feat/collateral-abi-package

Conversation

@abs2023

@abs2023 abs2023 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Pillar 1 of the Agent Access Layer — same template as Lumerin-protocol/hashprice-oracle#83.

  • collateral-abi/ — publishable @hashpower/collateral-abi (v1.0.0 live; published manually to bootstrap npm Trusted Publishing). Vault, PortfolioMarginEngine, and Points ABIs with full as const literal types for viem, plus raw JSON under json/. Zero runtime dependencies.
  • collateral-abi/deployments.json — testnet addresses taken from the GitHub dev environment and verified on-chain (vault's marginEngine() returns the PME address; collateral token matches testnet USDC). mainnet empty until deploy. Vault subgraph omitted — no dev deployment exists yet (filling it in later auto-publishes a patch).
  • .github/workflows/publish-collateral-abi.yml — auto-publish on dev pushes touching contracts/abi/** or collateral-abi/**: computed semver via ABI-surface diff (removed/changed → major, added → minor, metadata → patch, identical → skip), tokenless OIDC publish in the npm-publish environment, Slack announce via the shared action. Trigger flips to main at GA.

Also included: check-contracts-abi.yml — the ABI drift check this repo was missing (ported from hashprice-oracle, triggers on dev/main). The publish pipeline trusts contracts/abi/; this makes that trust CI-enforced.

Test plan

  • cd collateral-abi && pnpm install && pnpm build — 10 ABI modules, clean tsc
  • After merge: publish workflow runs and skips (identical 1.0.0 already on registry)
  • npm-publish GitHub environment created (deployment branch rule: dev)
  • Trusted Publisher configured on npmjs.com for this package → repo + publish-collateral-abi.yml + env npm-publish

Made with Cursor

abs2023 and others added 2 commits July 29, 2026 11:20
…eline

Publishes viem-ready vault/margin-engine/points ABIs plus a
testnet/mainnet deployments manifest (addresses verified on-chain).
CI computes the semver bump by diffing the ABI surface against the
last published version and publishes via npm Trusted Publishing
(OIDC, tokenless) with Slack announce. v1.0.0 published manually to
bootstrap the trust.

Co-authored-by: Cursor <cursoragent@cursor.com>
Guarantees committed ABIs in contracts/abi/ always match compiled
output — the publish pipeline and semver classifier depend on them
being truthful. Ported from hashprice-oracle.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abs2023
abs2023 merged commit df8a549 into dev Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant