Skip to content

fix: migrate balance and nonce api calls from v1 to v3 - #1879

Merged
jannik-stacks merged 7 commits into
mainfrom
v3-api
Oct 5, 2026
Merged

jannik-stacks merged 7 commits into
mainfrom
v3-api

Conversation

@rafa-stacks

@rafa-stacks rafa-stacks commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Migrates deprecated /extended/v1 Stacks API endpoints to their /extended/v3 replacements:

  • /extended/v1/address/{address}/balances → /extended/v3/principals/{principal}/balances/stx
  • /extended/v1/address/{address}/nonces → /extended/v3/principals/{principal}/nonces

@rafa-stacks rafa-stacks changed the title fix: migrate balance and nonce API calls to /extended/v3 fix: migrate balance and nonce api calls from v1 to v3 Aug 24, 2026
@codecov-commenter

codecov-commenter commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/api/src/api.ts 0.00% 8 Missing ⚠️
packages/cli/src/cli.ts 80.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rafa-stacks
rafa-stacks marked this pull request as ready for review August 24, 2026 16:05
@rafa-stacks
rafa-stacks requested review from jannik-stacks and a balanced review from Copilot August 24, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates deprecated balance and nonce API calls from v1 to v3 across the SDK.

Changes:

  • Updates nonce fetching to use the v3 principal endpoint.
  • Migrates STX balance responses and bigint conversions to the v3 shape.
  • Updates CLI consumers, tests, documentation, and release metadata.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/transactions/tests/builder.test.ts Updates the nonce response fixture.
packages/transactions/src/fetch.ts Migrates nonce fetching to v3.
packages/stacking/src/index.ts Migrates balances and response types to v3.
packages/stacking/README.md Documents the new balance shape.
packages/cli/tests/cli.test.ts Updates the CLI balance fixture.
packages/cli/src/cli.ts Uses StackingClient for balance requests.
packages/api/src/types.ts Defines v3 balance response types.
packages/api/src/api.ts Migrates balance fetching to v3.
.changeset/shiny-moons-attend.md Records the transactions change.
.changeset/lucky-buses-repeat.md Records balance API changes.
Suppressed comments (1)

packages/cli/src/cli.ts:1746

  • Use available for this spendability check. With locked or pending STX, balance can exceed available, causing the CLI to proceed and submit a stack transaction for funds that cannot be locked; the transaction then fails instead of producing the intended local balance error.
      const balanceBN = balance.balance;

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/cli/src/cli.ts Outdated
Comment thread .changeset/lucky-buses-repeat.md Outdated
Comment thread packages/transactions/src/fetch.ts
Comment thread packages/stacking/src/index.ts Outdated
jannik-stacks
jannik-stacks previously approved these changes Sep 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The stacking package still exposes a production path that calls the deprecated v1 balance endpoint.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 40/40 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread packages/api/src/api.ts
Comment thread packages/cli/tests/cli.test.ts Outdated
@jannik-stacks
jannik-stacks merged commit e6084a5 into main Oct 5, 2026
7 checks passed
@jannik-stacks
jannik-stacks deleted the v3-api branch October 5, 2026 22:02
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.

4 participants