Skip to content

feat: 🎸 Update types for 8.1.1 chain - #54

Merged
polymesh-bot merged 1 commit into
mainfrom
feat/8.1-types
Sep 14, 2026
Merged

polymesh-bot merged 1 commit into
mainfrom
feat/8.1-types

Conversation

@F-OBrien

@F-OBrien F-OBrien commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

Updates Polymesh types for chain v8.1.1 (spec 8001010).

  • 8.1.x types bundle: new src/types/8.1.x.json, covering spec 8001000+ (v8.1.0 and v8.1.1). Adds PolymeshPrimitivesNftNftId: u64, needed for typegen of the new NFTApi.token_approval runtime call. The metadata registry unwraps the NFTId(u64) newtype, so it has no lookup entry.
  • Non-overlapping spec ranges: 8.0.x is now [8000000, 8000999] and 7.3.x is [7003000, 7003999]. Polkadot.js merges every matching minmax entry, and later entries win, so an overlapping older bundle could override the newer one (7.3.x was overriding 7.4.x's PortfolioKind on 7.4 chains).
  • RPC definitions match what 8.x nodes register:
    • removed staking_getCurve, asset_transferReport and nft_transferReport, which are no longer served as of v8.0. The transfer reports are available via the AssetApi / NFTApi runtime calls.
    • removed compliance_complianceReport, which no node release has ever registered.
    • deleted the unused legacy src/rpc/6.x.ts.
    • added the optional blockHash param to settlement_getTransferReport and settlement_getExecuteInstructionReport, matching the node's at: Option<BlockHash>.
  • Signed extensions: added EthSetOrigin (pallet_revive, an empty struct). Together with the existing AuthorizeCall and StoreCallMetadata, this removes the Unknown signed extensions ... treating them as no-effect warning. polkadot.js 16.5.6 doesn't know these yet.
  • Regenerated types from a v8.1.1 node, plus spec diffs. Chain additions covered include:
    • NFT approvals: nft.approve / setApprovalForAll extrinsics, the NFTApi.tokenApproval / operatorApproval runtime calls, and the NFTApproval / NFTApprovalForAll / NFTApprovalSpent events.
    • Token freezing: asset.setFrozenTokens, setHolderFrozen, freezePartialTokens and unfreezePartialTokens, with the FrozenBalanceSet and SetAccountFreeze events.
    • asset.controllerTransferTo and nft.controllerTransferTo, with the ControllerTransferTo event.

Verified against a local v8.1.1 node with typesBundle:

  • no signed-extension warnings on ApiPromise init.
  • every registered Polymesh RPC and the new NFT runtime calls resolve, and the bundle defines no RPC the node doesn't serve.
  • yarn lint and yarn build:ts pass.

The remaining RPC methods not decorated init warning covers standard Substrate methods only: the new JSON-RPC spec (archive_v1_*, chainHead_v1_*, …) plus author_rotateKeysWithOwner / mmr_generateAncestryProof. The latter two were added upstream in polkadot-js/api#6263, pending a release.

Known chain-side issue, not addressed here: settlement_getTransferReport and settlement_getAffirmationCount (with a non-empty holder set) are rejected by the node when called via api.rpc. polkadot.js serialises enum params as camelCase JSON (fungible, account), and the node's serde expects PascalCase. The equivalent api.call.settlementApi.* runtime calls work.

Breaking Changes

  • api.rpc.staking.getCurve, api.rpc.asset.transferReport, api.rpc.nft.transferReport and api.rpc.compliance.complianceReport are no longer defined. Consumers still connecting to ≤7.x nodes that use these RPCs need to call them directly or pin an earlier version of this package.
  • The settlement error AllowancesNotSupportedForNFTs is renamed DeprecatedAllowancesNotSupportedForNFTs by the chain.

JIRA Link

Checklist

  • Updated the Readme.md (if required) ?

Regenerated from a v8.1.1 node (spec 8001010).

- Add 8.1.x types bundle for spec 8001000+, including
  PolymeshPrimitivesNftNftId used by the NFTApi.token_approval runtime call
- Narrow the 8.0.x and 7.3.x spec ranges so bundles no longer overlap
- Remove RPC definitions not served by 8.x nodes (staking_getCurve,
  asset_transferReport, nft_transferReport, compliance_complianceReport)
  and the unused 6.x RPC definitions
- Add the optional blockHash param to settlement getTransferReport and
  getExecuteInstructionReport
- Add EthSetOrigin signed extension
- Regenerate types and spec diffs

Chain additions covered include NFT approvals, partial token freezing and
the asset/nft controller_transfer_to extrinsics.
@prashantasdeveloper

Copy link
Copy Markdown
Collaborator

/fast-forward

@polymesh-bot
polymesh-bot merged commit 01e1125 into main Sep 14, 2026
6 checks passed
@polymesh-bot
polymesh-bot deleted the feat/8.1-types branch September 14, 2026 10:34
@polymesh-bot

Copy link
Copy Markdown

🎉 This PR is included in version 7.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants