Skip to content

Add Liquid address asset balance helper - #7

Merged
Micfinch merged 2 commits into
mainfrom
copilot/feat-update-api-endpoints
Sep 15, 2026
Merged

Micfinch merged 2 commits into
mainfrom
copilot/feat-update-api-endpoints

Conversation

Copilot AI commented Sep 15, 2026

Copy link
Copy Markdown

Viewing Liquid assets by address required stitching together UTXOs and asset metadata manually, and the current address typings did not expose an address-level balance helper. This change adds a first-class API for deriving per-asset balances directly from a Liquid address.

  • API

    • Adds liquid.addresses.getAddressAssetBalances({ address })
    • Returns grouped balances per asset with:
      • asset_id
      • value
      • utxo_count
  • Liquid typing updates

    • Introduces Liquid-specific address interfaces instead of reusing the Bitcoin address types
    • Extends Liquid transaction outputs with asset so asset ids can be resolved from UTXOs
  • Balance aggregation

    • Aggregates unspent outputs by asset id for a given address
    • Reuses /address/{address}/utxo and resolves output asset ids from the referenced transactions
    • Deduplicates transaction fetches before grouping balances
  • Docs and examples

    • Documents the new helper in README-liquid.md
    • Updates Liquid Node.js and HTML address examples to show address-level asset balance retrieval
const {
  liquid: { addresses },
} = mempoolJS({ hostname: 'liquid.network' });

const balances = await addresses.getAddressAssetBalances({
  address: 'YOUR_ADDRESS',
});

console.log(balances);

Copilot AI and others added 2 commits September 15, 2026 12:59
Co-authored-by: Micfinch <142565130+Micfinch@users.noreply.github.com>
Co-authored-by: Micfinch <142565130+Micfinch@users.noreply.github.com>
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