fix(tfchain-client-js): remove static types.json, use metadata v14/v15 for type resolution#1078
Open
sameh-farouk wants to merge 1 commit intodevelopmentfrom
Open
fix(tfchain-client-js): remove static types.json, use metadata v14/v15 for type resolution#1078sameh-farouk wants to merge 1 commit intodevelopmentfrom
sameh-farouk wants to merge 1 commit intodevelopmentfrom
Conversation
…5 for type resolution TFChain runtime exposes metadata v14 and v15, which embed all SCALE codec type information directly in on-chain metadata. The static types.json was a legacy override from pre-v14 days and is no longer needed — @polkadot/api (^10.9.1) derives all types automatically. Removing this eliminates the need to restart activation-service (and other consumers) after runtime upgrades, since type definitions are now always in sync with the on-chain runtime. Changes: - Remove types.json import and usage from client.js - Delete clients/tfchain-client-js/types.json (38 type definitions) - Update docs/misc/create_farm.md to remove obsolete "copy types" step Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1077
What changed
types.jsonimport and usage fromclients/tfchain-client-js/lib/client.jsclients/tfchain-client-js/types.json(38 type definitions)docs/misc/create_farm.mdto remove the obsolete "copy types" stepWhy
ApiPromise.create({ provider })without custom type overrides lets@polkadot/apiderive all type information directly from on-chain metadata (v14/v15). This means the client always stays in sync with the current runtime — no restart needed after upgrades.Tested
Against mainnet (
wss://tfchain.grid.tf) and devnet (wss://tfchain.dev.grid.tf):tfgridModule.twins(1)andtfgridModule.farms(1)decode correctly