Skip to content

Releases: polkadot-js/api

v3.7.1

01 Feb 08:12

Choose a tag to compare

Upgrade priority: Low. However recommended for current Substrate master, Polkadot and Rococo users and those wishing to support the upcoming Polkadot 28 runtime with the new MultiAddress.

  • Breaking change As indicated in the 3.5.1 release notes, the Address/LookupSource defaults have now been adjusted for MultiAddress. If your chain does not use these types, explicitly add the correct Address/LookupSource types. This new extensible format is mean to cater for all address types into the future, removing a lot of discrepancies between chains.

Contributed:

Changes:

  • Allow .slice operator on the Vec type
  • Apply MultiAddress as a default
  • Adds support for the upcoming Polkadot 28 and Kusama 2028 runtimes
  • Add checkpoint for Kusama 2027 upgrade
  • Update all parachain types (as per latest Rococo)
  • Correctly use relay blockNumber in parachain validation data
  • remove information log for capabilities detection (creates confusion)
  • Remove explicit references to global, use the x-global detection
  • Remove explicit module in package.json (exports map available)

v3.6.1

24 Jan 13:05

Choose a tag to compare

Upgrade priority: Medium if not already on at least 3.3.1. The next upgrade of Kusama/Polkadot requires it.

  • Breaking change To support chains with multiple tokens, such as bridges, the ChainProperties type now returns an array of tokens and decimals (instead of singular values) in the token{Decimals, Symbol} getters. Additionally, this means that the registry interfaces has been changes, to registry.chainDecimals: number[] and registry.chainTokens: string[]. Where used the [0] index will return the first value if only interested in a single, for a straight conversion.

Changes:

  • Allow for the detection of on-chain capabilities as available (e.g. AccountData, ValidatorPrefs)
  • Cater for multiple tokens and decimals in the chain the chain system.properties (as per the chain specification)
  • Add a instances: { [key]: [module1, module2] } definition in teh bundle types, allowing for multiple instances (e.g. Balances)
  • Adjust the api-derive for balances to retrieve values via instances as well as across multiple modules
  • Ensure all types are registered for all metadata typegen steps
  • Add rpc.payment.queryFeeDetails RPC endpoint
  • Update types & metadata to latest Substrate
  • Move the @polkadot/x-rxjs package into the common repo
  • Allow doc generation for errors/events (markdown outputs)

v3.5.1

18 Jan 11:47

Choose a tag to compare

Upgrade priority: Low. Recommended for parachain developers.

  • Important The default for Substrate on the Address types are MultiAddress. It is recommended that chains add explicit definitions for Address and LookupSource in their types, instead of relying on the API-defaults. A future update will swap the API defaults to align with Substrate.
  • Important Like the above changes in Substrate, the AccountInfo structure has also changed. It is recommended that chain developers explicitly add AccountInfo: 'AccountInfoWithRefCount' for the version with refCount on and AccountInfoWithProviders for the latest Substrate version. As per the above, the API defaults will be changed to align with Substrate.

Contributed:

Changes:

  • Remove recursion in vector/struct U8a stream decoding
  • Availability of staking made optional in session length calcs (era does require it)
  • Updates to parachain types, ensuring it has coverage for all the latest
  • Update all Rococo types to the latest (session keys, session reports, parachain indexes)
  • Update known upgrade checkpoints fo WestEnd
  • Add types of the lottery module in Substrate
  • Add and extend types for the crowdloan module in Polkadot
  • Adjust node-template to default to MultiAddress on specVersion >= 100

v3.4.1

11 Jan 08:16

Choose a tag to compare

Upgrade priority: Low. Fixes for parachain types, .entries() (with no values) and event.is(...) checks, users of these interfaces will have benefit.

  • Breaking change The derive.chain.{getBlock, subscribeNewBlocks} now return SignedBlockExtended, all with the actual extrinsics and events mapped. Users of the latter interface should take note.

Contributed:

Changes:

  • derive.chain.getBlock() now maps events to extrinsics via .extrinsics getter
  • Ensure dispatchInfo is extracted on failed extrinsics (getBlock derive)
  • Allow specification of additional signed extrinsic via API options
  • Add missing parachain types, ParaGenesisArgs
  • Correct EthTransaction type (as per the correct cargo crate)
  • Update with latest contract types for Substrate master
  • Update alias mapping for asset palette (including Substrate starting defaults)
  • Allow .entries() call where 0 keys are present
  • Fix .is on events not checking the correct index
  • Construction of i* types ow correctly checks for max positive/negative

v3.3.1

04 Jan 10:12

Choose a tag to compare

Upgrade priority: Low. Recommended for users of frontier evm module with additional types.

Contributed:

Changes:

  • Parallelize the API-init RPC calls for faster overall startup
  • Add ExitReason types for the frontier evm module
  • Adjust checks for indexed/non-indexed module checks (metadata decoration)
  • Apply module aliases on constants (aligning with events, extrinsics)
  • Allow for use of system.ss58Prefix as exposed (current Substrate master)
  • Correct use of api-contract blockWeights.maxBlock in estimation
  • Build metadata docs & interfaces with section aliases
  • Update to latest Substrate master metadata in tests

v3.2.1

27 Dec 19:26

Choose a tag to compare

Upgrade priority: Low. Recommended for users of parachains.

Contributed:

Changes:

  • Add api.{errors, events, query, tx}.<section>.<name>.is(...)
  • Remove support for staking pre Substrate 2.0
  • Add all frontier types & RPCs
  • Support AccountInfo with new provider/consumer refCount structure
  • Additional Cumulus parachain types
  • Consistently format number JSON based on bitLength
  • Cleanup metadata -> api dependencies
  • Update @polkadot/util to 5.2.1

v3.1.1

21 Dec 07:30

Choose a tag to compare

Upgrade priority: Low. Recommended for users of parachains.

Contributed:

Changes:

  • Adjust core type creation, removing storage duplication
  • Update parachain types to support Rococo v1
  • Adjust bounties derive to cater for new Substrate namespaces (& move to bounties)
  • Mark detectPackage as known side-effect
  • Add detectPackage to @polkadot/metadata (a number of requests on this)
  • Adjust x-rxjs wrapper to expose all methods, incl. Node.js esm fixes
  • Update to latest Substrate static metadata
  • Update @polkadot/util to 5.1.1

v3.0.1

14 Dec 09:26

Choose a tag to compare

Upgrade priority: Low. Recommended for the next Kusama/Polkadot upgrades due to additional types and those following chains following Substrate master closely.

Important While this package contains no external interface changes, it now compiles and ships both cjs and esm modules. This means that modern bundlers will have more information for tree-shaking available. Additionally when using Node with .mjs extensions, the esm version imports will be used on recent Node versions. Adding an export map, as here, may have some impacts so a major semver bump is advised. There may be (small) dragons hiding in the dark corners...

Contributed:

Changes:

  • Build and expose both cjs and esm via exports map
  • Inject RPC definitions for typesBundle, allowing per-spec configuration
  • Added query.<section>.<method>.sizeAt(hash, [...params]) for all storage
  • Add new Substrate consumed Weight types
  • Expand SessionKeys<n> definitions (up to 9)
  • Cleanup circular Type <-> Text definitions
  • Cleanup circular Metadata <-> TypeRegistry imports
  • Update @polkadot/util to 5.0.1

v2.10.1

07 Dec 10:24

Choose a tag to compare

Upgrade priority: Low. Recommended when following Substrate master and/or parachains development, contains the latest types for both.

  • Breaking change If using the staking.query derive, you now need to pass flags as to which values to retrieve

Changes:

  • Ensure that maximum era is limited to consts.system.blockHashCount (don't overflow on very low blocktimes)
  • Apply current Polkadot master parachain types
  • Apply current Substrate master asset types
  • Add system_{addLogFilter, resetLogFilter} RPCs
  • Adjust tests for latest Substrate metadata
  • Adjust staking derives to be more performant (flags indicate which query values to retrieve)
  • Add account derive to cater for the availability of identities
  • Use import type in all cases

v2.9.1

30 Nov 12:12

Choose a tag to compare

Upgrade priority: Low. No major changes when on at least 2.8.2. Users encouraged to upgrade to at least that patch.

  • Breaking change The API will now not attempt to queue calls made while not connected and send on connection. Rather when making a call and the RPC node is not connected, an error will be thrown.

Contributed:

Changes:

  • Remove rpc-core send queue, only allow sends while connected
  • Adjust staking derive for electedInfo to contain details of current validators
  • Extract identity-only derive from accounts.info for simpler reusability
  • Add types for Substrate master node (to allow for consistent swapping to MultiAddress)
  • Adjust Bytes with .slice to be consistent for Uint8array extensions (already released in 2.8.2 as a bugfix)