Skip to content

fix: use dedicated address UTXO endpoint - #2

Open
tolga-tom-nook wants to merge 1 commit into
BitgesellOfficial:mainfrom
tolga-tom-nook:fix/address-utxo-endpoint
Open

fix: use dedicated address UTXO endpoint#2
tolga-tom-nook wants to merge 1 commit into
BitgesellOfficial:mainfrom
tolga-tom-nook:fix/address-utxo-endpoint

Conversation

@tolga-tom-nook

@tolga-tom-nook tolga-tom-nook commented May 24, 2026

Copy link
Copy Markdown

Summary

  • fixes Address.getAddressUTXO() to call /address/utxo/{address}
  • avoids duplicating the unconfirmed-transactions endpoint for UTXO lookups
  • adds a focused Jest regression test for the requested endpoint and returned data shape

Root cause / acceptance proof

On the upstream main branch, getAddressUTXO() calls the exact same endpoint as getUnconfirmedAddressTransactions():

/address/unconfirmed/transactions/${address}

That endpoint returns a paginated transaction-list shape, not UTXOs. The live API exposes a dedicated UTXO endpoint and returns a distinct UTXO shape:

GET /address/utxo/bgl1qlmzckh904vze03n0lwzptt5dkmvf2vj3ev4qm9
{"data": [{"txId": "10c84f22...", "vOut": 1, "block": 306435, "txIndex": 1, "amount": 633731214}], ...}

GET /address/unconfirmed/transactions/bgl1qlmzckh904vze03n0lwzptt5dkmvf2vj3ev4qm9
{"data": {"page": 1, "limit": 50, "pages": 0, "list": []}, ...}

Validation

  • npx jest src/__tests__/address-utxo-endpoint.test.ts --runInBand --no-cache
  • npx tsc -p tsconfig.json
  • npm test -- --runInBand --no-cache
Test Suites: 6 passed, 6 total
Tests:       23 passed, 23 total

Bounty note

Submitting as a focused SDK correctness fix for the Bitgesell bounty/improvement program, especially BitgesellOfficial/bitgesell#81. If approved for payout, USDT/EVM-compatible address: 0x4a76c7E64C08cF29B59eFC640b4ada97A270d428.

Assisted by Hermes Agent.

Fix `Address.getAddressUTXO()` so it calls the dedicated `/address/utxo/{address}` endpoint instead of duplicating the unconfirmed-transactions endpoint.\n\nThe wrong endpoint returns a paginated transaction response, while `getAddressUTXO()` is typed as `AddressUTXOs`. Added a focused Jest test that verifies the requested URL and returned data.
@MyTH-zyxeon

Copy link
Copy Markdown

Maintainer review assist for the Bitgesell #81 improvement queue:

This PR looks like a focused SDK correctness fix: Address.getAddressUTXO() stops calling the unconfirmed-transaction list endpoint and now targets the dedicated /address/utxo/{address} route. The added Jest test is useful because it asserts the exact URL and returned UTXO shape instead of only proving that the method returns something.

Suggested merge checks:

  • Run the focused address UTXO test and the existing SDK test suite so the endpoint regression stays covered alongside the older address methods.
  • Confirm the SDK _get wrapper unwraps the API response envelope the same way the new test expects, since the live example returns data: [...] under the response body.
  • Keep the scope read-only: this should not touch wallet key handling, transaction signing, broadcast behavior, or live-chain mutation.
  • If maintainers want transaction-list behavior retained, keep it on the existing unconfirmed-transactions method rather than overloading getAddressUTXO().

Main acceptance criterion: UTXO callers should deterministically hit /address/utxo/{address} and receive UTXO records, while unconfirmed transaction-list callers continue to use their separate endpoint.

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.

2 participants