Skip to content

Conversation

@bee344
Copy link
Contributor

@bee344 bee344 commented Jan 30, 2026

This adds an endpoint that returns the metadata blob for offline signers. It uses @polkadot-ap/merkleize-metadata to generate the blob and proof for a tx.

The dynamic imports changes were necessary since the latest versions of @polkadot-ap/merkleize-metadata use @scure/base@^2.0.0, which is ESM-only.

Pending:

  • tests
  • update docs
  • update description

Closes #1783

@bee344 bee344 marked this pull request as ready for review January 30, 2026 21:16
@bee344 bee344 requested a review from a team as a code owner January 30, 2026 21:16
// Dynamic import helper that TypeScript won't transform to require()
// This is necessary because @polkadot-api/merkleize-metadata is an ESM-only package
// eslint-disable-next-line @typescript-eslint/no-implied-eval
const dynamicImport = new Function('specifier', 'return import(specifier)') as <T>(specifier: string) => Promise<T>;
Copy link
Member

Choose a reason for hiding this comment

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

Interesting work around. In order to not mess with the bundler, I am okay with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

Great job 👍

@bee344 bee344 merged commit 64c1bdd into master Jan 30, 2026
14 checks passed
@bee344 bee344 deleted the anp-tx-metadata branch January 30, 2026 22:23
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.

Endpoint to Return Merklized Metadata

3 participants