TypeScript SDK for interacting with Wildcat markets, controllers, and managing our onchain state
wildcat.ts exposes typed helpers for working with Wildcat markets: querying controllers, inspecting market state, and managing lender or borrower activity. the sdk bundles contract typings, gql fragments, utils and constants like deployment addresses, rpc urls, sugraph urls etc. The main app is the consumer.
The most likely scenario for working in this repo is while also working on app side. Theres a section below specifically on how to manage this as a local dependency.
For local development inside this repo run yarn build (or npm run build) to compile TypeScript output before linking or publishing
- Code generation: run
yarn codegen(ornpm run codegen) whenever contracts incontracts/or GraphQL fragments ingql/change. This invokes:yarn codegen:gql→ rebuilds typed gqlyarn codegen:typechain→ regenerates typeChain bindings and exports
- Build:
yarn build(ornpm run build) outputs the package defined bytsconfig.prod.json.
To validate SDK changes against wildcat-app-v2:
- Run
npm pack(oryarn npm pack) in this repository to produce a local tarball in the project root. - in the app repo, update
package.jsonto point to the new.tgzfile (e.g."@wildcatfi/wildcat-sdk": "file:../wildcat.ts/wildcatfi-wildcat-sdk-3.0.54-beta.tgz"). - Reinstall dependencies in the app (
npm installor use the provided reinstall script with the appropriate environment variables configured).
Once happy with changes publish to npm (if you have permissions):
npm publish --tag beta
main: latest supported release branch. Publish production npm releases (npm publishoryarn npm publish).develop: integration branch. Publish beta releases withnpm publish --tag beta(or the yarn equivalent).- Feature branches should merge into
developvia pull request, then graduate tomainfor release once validated.