Skip to content

Conversation

@whankinsiv
Copy link
Collaborator

Description

Adds the REST handler for /addresses/{address}/utxos/{asset}. The implementation mirrors the existing /addresses/{address}/utxos endpoint, with the addition of a filtering step to return only UTxOs containing the requested asset.

Related Issue(s)

Completes #335

How was this tested?

Compared responses against Blockfrost to confirm:

  • all UTxOs containing the specified asset are returned
  • an empty array is returned when an address holds none of the specified asset

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • CI is green for this PR

Impact / Side effects

None

Reviewer notes / Areas to focus

The only meaningful changes are in the new endpoint handler.

Ok(RESTResponse::with_json(200, &json))
}

fn split_policy_and_asset(hex_str: &str) -> Result<(PolicyId, AssetName), RESTError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there are a few tests related to this function that should probably be moved into the utils.rs as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved the tests over in 7a04fad. Thanks for catching this.

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.

3 participants