genlayer 0.39.0 → 0.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,29 @@
1
- name: Release & Publish Package to NPM
1
+ name: Publish Package to NPM
2
2
 
3
+ # Tag-driven publish. The release is cut by a human (or Claude via the
4
+ # release skill) running scripts/release.sh on the target stable branch
5
+ # — that script bumps package.json, updates CHANGELOG.md, commits,
6
+ # tags vX.Y.Z, and pushes both the branch commit and the tag. This
7
+ # workflow fires on the tag push, sanity-checks the tag matches
8
+ # package.json, builds, publishes to npm, and creates the GitHub
9
+ # Release. It never bumps or tags by itself.
3
10
  on:
4
11
  workflow_dispatch:
5
12
  push:
6
- branches:
7
- - main
8
- - staging
9
- paths-ignore:
10
- - 'docs/**'
13
+ tags:
14
+ - "v*"
11
15
 
12
16
  permissions:
13
17
  contents: write
14
18
  id-token: write
15
19
 
16
20
  jobs:
17
- release:
21
+ publish:
18
22
  runs-on: ubuntu-latest
19
- environment: npm
23
+ environment: Publish
20
24
  steps:
21
- - name: Get CI Bot Token
22
- uses: tibdex/github-app-token@v2
23
- id: ci_bot_token
24
- with:
25
- app_id: ${{ secrets.CI_BOT_APP_ID }}
26
- private_key: ${{ secrets.CI_BOT_SECRET }}
27
-
28
- - name: Checkout source code
25
+ - name: Checkout tag
29
26
  uses: actions/checkout@v4
30
- with:
31
- token: ${{ steps.ci_bot_token.outputs.token }}
32
-
33
- - name: Initialize Git User
34
- run: |
35
- git config --global user.email "github-actions[bot]@genlayer.com"
36
- git config --global user.name "github-actions[bot]"
37
27
 
38
28
  - uses: actions/setup-node@v4
39
29
  with:
@@ -42,12 +32,36 @@ jobs:
42
32
 
43
33
  - run: npm ci
44
34
 
45
- - name: Release
35
+ - name: Verify tag matches package.json version
46
36
  run: |
47
- if [ "${{ github.ref_name }}" = "staging" ]; then
48
- npm run release-beta
49
- else
50
- npm run release
37
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
38
+ PKG_VERSION="$(node -p "require('./package.json').version")"
39
+ if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
40
+ echo "Tag ($TAG_VERSION) and package.json ($PKG_VERSION) disagree — refusing to publish." >&2
41
+ echo "Re-cut the release via scripts/release.sh so the tag and the committed version match." >&2
42
+ exit 1
51
43
  fi
44
+ echo "Tag $GITHUB_REF_NAME matches package.json $PKG_VERSION."
45
+
46
+ - run: npm run build
47
+
48
+ - name: Publish to npm
49
+ run: npm publish --provenance --access public
50
+ env:
51
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52
+
53
+ - name: Create GitHub Release
52
54
  env:
53
- GITHUB_TOKEN: ${{ steps.ci_bot_token.outputs.token }}
55
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56
+ run: |
57
+ NOTES="$(awk -v ver="$GITHUB_REF_NAME" '
58
+ $0 ~ "^## \\[?" substr(ver, 2) {capture=1; next}
59
+ capture && /^## / {exit}
60
+ capture {print}
61
+ ' CHANGELOG.md)"
62
+ if [ -z "$NOTES" ]; then
63
+ NOTES="Release $GITHUB_REF_NAME"
64
+ fi
65
+ gh release create "$GITHUB_REF_NAME" \
66
+ --title "$GITHUB_REF_NAME" \
67
+ --notes "$NOTES"
@@ -10,6 +10,7 @@ jobs:
10
10
  # Skip for pre-releases (tags containing '-') unless manually dispatched
11
11
  if: github.event_name != 'release' || !contains(github.event.release.tag_name, '-')
12
12
  runs-on: ubuntu-latest
13
+ environment: Sync-docs
13
14
  permissions:
14
15
  contents: read
15
16
  steps:
@@ -44,29 +45,11 @@ jobs:
44
45
  DOCS_VERSION: ${{ steps.version.outputs.value }}
45
46
  run: node scripts/generate-cli-docs.mjs | cat
46
47
 
47
- - name: Set up Git (for committing to CLI repo)
48
- run: |
49
- git config user.name "github-actions[bot]"
50
- git config user.email "github-actions[bot]@users.noreply.github.com"
51
-
52
- - name: Commit and push docs back to CLI repo (non-beta releases)
53
- if: github.event_name == 'release' && !contains(github.event.release.tag_name, '-')
54
- run: |
55
- set -euo pipefail
56
- if [ -n "$(git status --porcelain docs/api-references || true)" ]; then
57
- git add docs/api-references
58
- VERSION=${{ steps.version.outputs.value }}
59
- git commit -m "docs(cli): update API reference for ${VERSION}"
60
- git push
61
- else
62
- echo "No docs changes to commit"
63
- fi
64
-
65
48
  - name: Generate docs repo token
66
49
  id: app-token
67
- uses: actions/create-github-app-token@v1
50
+ uses: actions/create-github-app-token@v3
68
51
  with:
69
- app-id: ${{ vars.DOCS_SYNC_APP_ID }}
52
+ client-id: ${{ vars.DOCS_SYNC_APP_CLIENT_ID }}
70
53
  private-key: ${{ secrets.DOCS_SYNC_APP_KEY }}
71
54
  repositories: genlayer-docs
72
55
 
@@ -8,7 +8,7 @@ on:
8
8
  - reopened
9
9
  push:
10
10
  branches:
11
- - main
11
+ - v0.39
12
12
 
13
13
  jobs:
14
14
  build-and-test:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.39.2](https://github.com/genlayerlabs/genlayer-cli/compare/v0.39.1...v0.39.2) (2026-06-11)
4
+
5
+ ### Features
6
+
7
+ * add v0.6 fee-aware commands ([#340](https://github.com/genlayerlabs/genlayer-cli/issues/340)) ([ca083ab](https://github.com/genlayerlabs/genlayer-cli/commit/ca083abbf854960a6638d5af63096b532a03cc5a))
8
+ * branch-per-major release model ([#311](https://github.com/genlayerlabs/genlayer-cli/issues/311)) ([6fd2f3a](https://github.com/genlayerlabs/genlayer-cli/commit/6fd2f3a678ce348c92470828b03bdfc596afa9cb)), closes [genlayer-js#172](https://github.com/genlayerlabs/genlayer-js/issues/172)
9
+
10
+ ### Bug Fixes
11
+
12
+ * **localnet:** print validator count to stdout ([37519e1](https://github.com/genlayerlabs/genlayer-cli/commit/37519e18b6155bc762fa24ea809a53c3e83ac9a7))
13
+ * run CI on v0.39 branch ([#322](https://github.com/genlayerlabs/genlayer-cli/issues/322)) ([e129bab](https://github.com/genlayerlabs/genlayer-cli/commit/e129bab0c471c2d59d360b5ca8c1cb3190774ff8))
14
+ * **system:** handle command-check and version parse failures ([#349](https://github.com/genlayerlabs/genlayer-cli/issues/349)) ([5b93dd3](https://github.com/genlayerlabs/genlayer-cli/commit/5b93dd32e45683f30368d0c9324078800c3d8dda)), closes [#301](https://github.com/genlayerlabs/genlayer-cli/issues/301) [#303](https://github.com/genlayerlabs/genlayer-cli/issues/303)
15
+
16
+ ## 0.39.1 (2026-05-06)
17
+
18
+ ### Bug Fixes
19
+
20
+ * **ci:** add trigger comment to publish workflow ([#300](https://github.com/genlayerlabs/genlayer-cli/issues/300)) ([f3eeb99](https://github.com/genlayerlabs/genlayer-cli/commit/f3eeb99ce4e9222e9ba1bd9f6d31faf0e11bd380)), closes [#297](https://github.com/genlayerlabs/genlayer-cli/issues/297) [#298](https://github.com/genlayerlabs/genlayer-cli/issues/298)
21
+
3
22
  ## 0.39.0 (2026-04-23)
4
23
 
5
24
  ### ⚠ BREAKING CHANGES
package/CONTRIBUTING.md CHANGED
@@ -31,6 +31,30 @@ Have ideas for new features or use cases? We're eager to hear them! But first:
31
31
  - Ensure you have the CLI installed to explore existing functionality.
32
32
  - After familiarizing yourself with the CLI, contribute your unique use case and share your ideas in our [Discord channel](https://discord.gg/8Jm4v89VAu).
33
33
 
34
+ ## Branch model
35
+
36
+ This repo uses a branch-per-major release model. There is no `main`.
37
+
38
+ - **`v0.39`** — current stable major (semver-zero, so 0.39 IS the major; 0.40 would be a major bump that gets its own branch). PRs for bug fixes / non-breaking features target this branch.
39
+ - **`v<next>-dev`** — when next-major work is in progress, this branch is open for breaking changes. PRs introducing them target this branch.
40
+ - **Older majors** stay for back-ports. Default branch on github.com is whichever major is current stable.
41
+
42
+ When you fork or clone, the default branch is `v0.39` today. If you have a `main` branch from a previous checkout, delete it locally:
43
+
44
+ ```sh
45
+ git checkout v0.39
46
+ git branch -D main
47
+ git remote prune origin
48
+ ```
49
+
50
+ The previous `staging` branch (beta channel) has been retired. Pre-releases now go through the same release script with an explicit version (`scripts/release.sh 0.39.2-beta.0`).
51
+
52
+ ## Releases
53
+
54
+ Releases are deliberate, not automatic. `scripts/release.sh` bumps the version, updates `CHANGELOG.md`, commits, tags, and pushes; CI takes over from the tag push and publishes to npm. See `.claude/skills/release/SKILL.md` for the full flow.
55
+
56
+ **Semver-zero rule**: this package is on 0.x, so minor IS the breaking-change boundary. `0.39 → 0.40` is a major bump and needs a new branch — the script refuses `minor`/`major` keywords without `--allow-major`.
57
+
34
58
  ### Bug fixing and Feature development
35
59
 
36
60
  #### 1. Set yourself up to start coding
package/README.md CHANGED
@@ -169,11 +169,15 @@ USAGE:
169
169
  genlayer deploy [options]
170
170
  genlayer call <contractAddress> <method> [options]
171
171
  genlayer write <contractAddress> <method> [options]
172
+ genlayer estimate-fees [contractAddress] [method] [options]
172
173
  genlayer schema <contractAddress> [options]
173
174
 
174
175
  OPTIONS (deploy):
175
176
  --contract <contractPath> (Optional) Path to the intelligent contract to deploy
176
177
  --rpc <rpcUrl> RPC URL for the network
178
+ --fees <json> Transaction fee options JSON passed to genlayer-js
179
+ --fee-value <wei> Explicit fee deposit value
180
+ --valid-until <timestamp> Unix timestamp after which the transaction is invalid
177
181
  --args <args...> Contract arguments (see Argument Types below)
178
182
 
179
183
  OPTIONS (call):
@@ -182,8 +186,17 @@ OPTIONS (call):
182
186
 
183
187
  OPTIONS (write):
184
188
  --rpc <rpcUrl> RPC URL for the network
189
+ --fees <json> Transaction fee options JSON passed to genlayer-js
190
+ --fee-value <wei> Explicit fee deposit value
191
+ --valid-until <timestamp> Unix timestamp after which the transaction is invalid
185
192
  --args <args...> Method arguments (see Argument Types below)
186
193
 
194
+ OPTIONS (estimate-fees):
195
+ --rpc <rpcUrl> RPC URL for the network
196
+ --fees <json> Fee estimate options JSON, or a transaction fee object
197
+ --include-report Include simulation fee accounting/report in the generated estimate output
198
+ --args <args...> Method arguments for simulation-derived estimates
199
+
187
200
  OPTIONS (schema):
188
201
  --rpc <rpcUrl> RPC URL for the network
189
202
 
@@ -191,14 +204,51 @@ EXAMPLES:
191
204
  genlayer deploy
192
205
  genlayer deploy --contract ./my_contract.gpy
193
206
  genlayer deploy --contract ./my_contract.gpy --args "arg1" "arg2" 123
207
+ genlayer deploy --contract ./my_contract.gpy --fees '{"distribution":{"leaderTimeunitsAllocation":"100","validatorTimeunitsAllocation":"200","rotations":["0"]}}'
194
208
  genlayer call 0x123456789abcdef greet --args "Hello World!"
195
209
  genlayer write 0x123456789abcdef updateValue --args 42
210
+ genlayer write 0x123456789abcdef updateValue --fees '{"distribution":{"leaderTimeunitsAllocation":"100","validatorTimeunitsAllocation":"200","rotations":["0"]}}' --args 42
211
+ genlayer estimate-fees
212
+ genlayer estimate-fees 0x123456789abcdef updateValue --args 42
196
213
  genlayer write 0x123456789abcdef sendReward --args 0x6857Ed54CbafaA74Fc0357145eC0ee1536ca45A0
197
214
  genlayer write 0x123456789abcdef setScores --args '[1, 2, 3]'
198
215
  genlayer write 0x123456789abcdef setConfig --args '{"timeout": 30, "retries": 5}'
199
216
  genlayer schema 0x123456789abcdef
200
217
  ```
201
218
 
219
+ ##### Transaction Fee Options
220
+
221
+ `--fees` accepts the same transaction fee object as `genlayer-js`. Quote large
222
+ integer values as strings to preserve precision. `messageAllocations[].messageType`
223
+ may be `"internal"`, `"external"`, `0`, or `1`.
224
+
225
+ For targeted message budgets, the CLI can derive GenVM call keys before passing
226
+ the JSON to `genlayer-js`:
227
+
228
+ ```bash
229
+ genlayer estimate-fees 0x123456789abcdef settle \
230
+ --fees '{"messageAllocations":[{"messageType":"internal","recipient":"0x0000000000000000000000000000000000000001","callKeyMethod":"settle_campaign","budget":"700000"}]}'
231
+
232
+ genlayer write 0x123456789abcdef sendReward \
233
+ --fees '{"messageAllocations":[{"messageType":"external","recipient":"0x0000000000000000000000000000000000000002","callKeySelector":"0xa9059cbb","budget":"210000"}]}'
234
+ ```
235
+
236
+ Use `callKeyMethod` for internal GenVM messages, `callKeySelector` for a 4-byte
237
+ EVM selector, or `callKeyCalldata` for full external calldata. Explicit
238
+ `callKey` is still accepted for advanced cases.
239
+
240
+ If `--fees` includes a `distribution` and `--fee-value` is omitted, the SDK
241
+ derives the fee deposit from FeeManager on network backends, or from
242
+ `sim_getFeeConfig` on Studio. Use `--fee-value` only when you need to force an
243
+ explicit deposit value.
244
+
245
+ `estimate-fees` prints the SDK fee preset. Without a contract/method it calls
246
+ `estimateTransactionFees`. With a contract/method it uses the SDK target-write
247
+ estimation helper so the preset reflects the observed Studio fee accounting
248
+ report. Add `--include-report` to use the explicit simulate-and-derive path and
249
+ include the simulation fee accounting and execution fee report next to the
250
+ preset for reproducible gas-unit debugging.
251
+
202
252
  ##### Argument Types
203
253
 
204
254
  The `--args` option automatically detects and converts values to the correct type:
@@ -522,4 +572,3 @@ We welcome contributions to GenLayerJS SDK! Whether it's new features, improved
522
572
  ## License
523
573
 
524
574
  This project is licensed under the ... License - see the [LICENSE](LICENSE) file for details.
525
-