Skip to content

Commit e53a3fb

Browse files
devin-ai-integration[bot]Jayant Krishnamurthy
andcommitted
build: align contract_manager build with turbo and add docs
Co-Authored-By: Jayant Krishnamurthy <jayant@dourolabs.xyz>
1 parent 58f900b commit e53a3fb

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

contract_manager/README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,37 @@
22

33
The contract manager is a tool to interact with Pyth related contracts on all supported chains.
44

5-
It has the following structure:
6-
5+
## Project Structure
76
- `store` contains all the necessary information for registered chains and deployed contracts
87
- `scripts` contains utility scripts to interact with the contract manager and accomplish common tasks
98
- `src` contains the contract manager code
109

11-
# Main Entities
10+
## Setup and Building
11+
```bash
12+
# Install dependencies
13+
pnpm install
14+
15+
# Build the package (done automatically by test/lint commands)
16+
pnpm build
17+
```
18+
19+
## Running Scripts
20+
Scripts can be run using either ts-node directly or the shell command:
21+
22+
```bash
23+
# Run a script directly with ts-node
24+
ts-node scripts/generate_upgrade_ton_contract_proposal.ts --help
25+
26+
# Or use the shell command
27+
pnpm shell generate_upgrade_ton_contract_proposal --help
28+
```
29+
30+
### Available Scripts
31+
- `generate_upgrade_ton_contract_proposal.ts`: Generate proposal for TON contract upgrade
32+
- Required env vars: ENV_TON_MAINNET_API_KEY, ENV_TON_TESTNET_API_KEY
33+
- Uses chain configuration from store/chains/TonChains.yaml
34+
35+
## Main Entities
1236

1337
Contract Manager has base classes which you can use to interact with the following entities:
1438

@@ -18,10 +42,6 @@ Contract Manager has base classes which you can use to interact with the followi
1842

1943
Each of these entities has a specialized class for each supported chain (EVM/Cosmos/Aptos/Sui).
2044

21-
# Docs
45+
## Documentation
2246

2347
You can generate the docs by running `pnpm exec typedoc src/index.ts` from this directory. Open the docs by opening `docs/index.html` in your browser.
24-
25-
# Scripts
26-
27-
You can run the scripts by executing `pnpm exec ts-node scripts/<script_name>.ts` from this directory.

contract_manager/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"lib/**/*"
1010
],
1111
"scripts": {
12-
"build": "tsc",
12+
"build": "pnpm run build:cjs && pnpm run build:esm",
13+
"build:cjs": "tsc -p tsconfig.json",
14+
"build:esm": "tsc -p tsconfig.esm.json",
1315
"shell": "ts-node ./src/shell.ts",
1416
"test:lint": "eslint src/ scripts/",
1517
"format": "prettier --write \"src/**/*.ts\" \"scripts/**/*.ts\""

contract_manager/tsconfig.esm.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"outDir": "./lib/esm"
6+
}
7+
}

0 commit comments

Comments
 (0)