Skip to content

feat: Add AccountAllBalances API endpoint#533

Merged
jacquescaocb merged 1 commit intocoinbase:masterfrom
jacquescaocb:add-account-all-balances-api
Dec 8, 2025
Merged

feat: Add AccountAllBalances API endpoint#533
jacquescaocb merged 1 commit intocoinbase:masterfrom
jacquescaocb:add-account-all-balances-api

Conversation

@jacquescaocb
Copy link
Copy Markdown
Contributor

Add AllAccountBalances API and Fix URL Naming Consistency

Overview

This PR integrates the new AllAccountBalances API from Rosetta specification v1.7.1 and fixes URL naming consistency issues across all Construction and Account endpoints.

Changes

1. AllAccountBalances API Integration

New Endpoint: POST /account/all-balances

Adds complete implementation for the AllAccountBalances API that consolidates multiple sub-account balance queries into a single request.

Components Added:

  • Types: AllAccountBalancesRequest, AllAccountBalancesResponse, AccountBalanceWithSubAccount
  • Client: HTTP client method in client/api_account.go
  • Server: HTTP handler and routing in server/api_account.go
  • Fetcher: High-level wrapper with retry logic in fetcher/account.go

Key Features:

  • Single request returns all account balances (main + sub-accounts)
  • Consistent block context for all returned balances
  • Optional block identifier for historical queries
  • Optional currency filtering

2. URL Naming Consistency Fix

Updated all endpoints to use kebab-case consistently:

  • Account API: /account/all_balances/account/all-balances
  • Construction API: /construction/preprocess_operations/construction/preprocess-operations

Files Updated:

  • client/api_account.go - Client endpoint paths
  • client/api_construction.go - Client endpoint paths
  • server/api_account.go - Server route definitions
  • server/api_construction.go - Server route definitions
  • types/ - Documentation references in type definitions

@cb-heimdall
Copy link
Copy Markdown

cb-heimdall commented Dec 8, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@jacquescaocb jacquescaocb force-pushed the add-account-all-balances-api branch 2 times, most recently from d388654 to 116c982 Compare December 8, 2025 20:08
….7.1

This commit consolidates all changes for the AllAccountBalances feature and
Check-Gen issue resolution:

## New Features
- Add AllAccountBalances API endpoint (/account/all_balances)
- Enables fetching all sub-account balances in a single request
- Reduces network overhead and ensures consistent block context
- Add AccountBalanceWithSubAccount type for structured responses

## API Changes
- Add AllAccountBalancesRequest and AllAccountBalancesResponse types
- Add AllAccountBalances methods to client, fetcher, and server
- Update asserter with validation for new endpoint

## Infrastructure Updates
- Update to mesh-specifications v1.7.1 (latest)
- Remove replace directive to use remote types v1.7.1
- Keep local types directory for development
- Fix codegen.sh to use standard remote download
- Restore AccountBalanceWithSubAccount.SubAccountIdentifier field

## Bug Fixes
- Fix Check-Gen issue with missing SubAccountIdentifier
- Fix URL naming consistency (kebab-case)
- Add ConstructionPreprocessOperations API support

## Testing
- All tests pass except one unrelated headerforwarder test
- Check-Gen now correctly detects differences
- Go build succeeds with remote dependencies
@jacquescaocb jacquescaocb force-pushed the add-account-all-balances-api branch from 116c982 to 9f01272 Compare December 8, 2025 20:11
@jacquescaocb jacquescaocb merged commit a9e0a3f into coinbase:master Dec 8, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants