Skip to content

Releases: polkadot-js/api

v2.1.1

05 Oct 08:43
Compare
Choose a tag to compare

Upgrade priority: Low.

Contributed:

Changes:

  • Adjust RPC error formatting with string cleanups and a larger allowed range
  • Apply limit protection on Text & Bytes, protecting against OOM on erroneous decoding
  • Add derive.staking.validatorsFrom to determine validators nominated and own validators
  • Cleanup document generation without (currently unused) summary links
  • Rename static TRANSACTION_VERSION to EXTRINSIC_VERSION (Substrate alignment)
  • Bump Substrate metadata (tests, doc generation)

v2.0.1

28 Sep 07:14
Compare
Choose a tag to compare

Upgrade priority: Medium. Required for all teams building on Substrate 2.0 for full compatibility.

  • Important The RefCount type (used by query.system.accounts) has been changed to a u32. On older chains supply the RefCount: 'RefCountTo259' override
  • Breaking change Metadata versions before v9 as not supported anymore. v4 was the first version to go with the Substrate 1.0 while Kusama itself starts at v9 as the earliest version. This means that Substrate 1.x chains that have not had any upgrades are not supported in this version of the API anymore.
  • Breaking change Extrinsic versions before v4 (1-3) are not supported anymore. This aligns with the above metadata change, where v4 is the canonical version.
  • Breaking change Support for the old-style linked-map retrievals via query.<module>.map() have been dropped, only the existing .keys()/.entries() are available for map iteration.

Contributed:

Changes:

  • Drop support for Substrate 1.0 metadata versions 1-8
  • Drop support for Substrate 1.0 extrinsics version 1-3
  • Add support for grandpa_proveFinality RPC
  • Drop support for linked map queries not via .entries (deprecated since early versions of Substrate 2)
  • Support .entries() on older chains without queryStorageAt support
  • Add bounty type definitions from treasury palette
  • Adjust RefCount type as per substrate 2.0
  • Add PalletVersion types for future palette versioning
  • Adjust formatting for Per{cent, bill, mill} without instance checks
  • Skip invalid keys on validator retrievals

v1.34.1

21 Sep 07:34
Compare
Choose a tag to compare

Upgrade priority: High. Metadata v12 is the next major version containing structural data exchange changes and will start rolling out to test and live networks in due course.

  • Breaking change The Decorated (from @polkadot/metadata) class signature has changed. It now always expects a valid Metadata object to be passed-in, instead of raw data. It is recommended to create a Metadata object, set it on the registry with .setMetadata and then only create a Decorated instance. (Only affects metadata-only users of the API)

Contributed:

Changes:

  • Ensure Metadata retrieval does not pollute the default registry
  • When passing { nonce: -1 } to signAndSend the API will use system.accountNextIndex to determine the nonce
  • Ensure that upgrades override old registry types (non-specified in current)
  • Support for Metadata v12 with fixed indices
  • Cleanups for WebSocket class detection and creation
  • Ensure that ignored map params yield an error on iterKey
  • Cater for older chains in derive democracy locks (availability detection)

v1.33.1

14 Sep 07:13
Compare
Choose a tag to compare

Upgrade priority: Low. Recommended when using clones instances.

Changes:

  • Allow paymentInfo on any extrinsic with tx.paymentInfo(<address>, <at>) (hash specified)
  • When cloning an API instance the runtimeChain is now properly set from source
  • When cloning an API instance the registry is shared with the source
  • Optimize derive receivedHeartbeats to not re-create the full object
  • Add staking.stakerPrefs derive to retrieve validatorPrefs over a range of eras
  • Basic map of Websocket error codes to short descriptions (where none available)

v1.32.1

07 Sep 07:31
Compare
Choose a tag to compare

Upgrade priority: Low. Recommended when manually using provider connect/disconnect or using multiple instances in a single process.

  • Breaking change Previously .isReady could throw an error, now it will always succeed on connection. For trapping errors, use the .isReadyOrError variant on the API
  • Breaking change The isConnected provider interface is now a getter, replacing previous calls to provider.isConnected(). Additionally the provider.disconnect() is now async, aligning with .connect().

Contributed:

Changes:

  • Adjust memoization to work on a per-instance basis, with no contamination between multiple api/provider instances
  • Added derive.chain.getBlock(hash) to retrieve a SignedBlock extended with an .author (same as derive.chain.getHeader(...))
  • Added api.{connect, disconnect}() as well as isConnected interfaces. The first functions async returning Promise<void>
  • Error on provider connections will now emit all (as expected) via the event emitter
  • Ensure that initial connection failures always retry (when using auto-connection management)
  • The api.derive.staking.query/queryMulti no longer retrieves session keys (can be done via .keys/keysMulti)
  • Add api.derive.accounts.accountId to perform AccountId lookups (from indices or actual AccountId)
  • Lessen load of paymentInfo queries to only use accounId mappings as available
  • Adjust staking derives to cater for early Substrate 2.0 chains (optional/non-optional EraIndexes)
  • Cater for the handling of nested aliased types, e.g. wrapped inside Vec or Tuple
  • Add the support for the grandpa_subscribeJustifications RPC
  • Adjust Call.toHuman() to remove decoding-related technical internal details
  • Static metadata & tests updated for the latest substrate master
  • toHuman() & .toBigInt() has been explicitly added to the API documentation
  • Adjust known types for latest Kusama network state

v1.31.1

31 Aug 16:08
Compare
Choose a tag to compare

Upgrade priority: Medium, especially for staking users on Polkadot, Kusama & Westend (type updates applied for v23 onwards) or if transparent .at(hash) queries are required/used

  • Important Substrate changed the RewardDestination enum with an extra field for payout-to-any account for staking preferences. If on an older chain consider adding RewardDestination: 'RewardDestinationTo257'
  • Important Substrate changed the CompactAssignment type enhanced types for session solution submissions. If on an older chain consider adding CompactAssignments: 'CompactAssignmentsTo257'

Contributed:

Changes:

  • Add transparent support for types/metadata, i.e. hash queries such as rpc.chain.getBlock(<hash>) & query.system.events.at(<hash>) now works out-of-the-box injecting the correct metadata & types.
  • Optimize RPC-layer calls with detection of short-term cacheable calls (in the same way subscriptions are done)
  • Additional checks on AccountId for valid sizes
  • Add toBigInt() (JS built-in BigInt) on Int/Uint, & Compact<*> types
  • Support for .concat on Codec arrays
  • Support for serialization with isBare flag on enums
  • Add api.getBlockRegistry(blockHash?) to create registry/types for a specific block
  • derive.democracy.locks now returns delegated locks for an account as well
  • Adjust unlocking derives with appropriate in-place additions (less object allocations)
  • .sign on submittables is marked deprecated (not due for removal, but rather use .signAsync for consistency with .signAndSend)
  • Adjust types for CompactAssignments & RewardDestination for Polkadot, Kusama & Westend
  • @polkadot/util 3.4
  • @polkadot/wasm-crypto 1.4

v1.30.1

24 Aug 09:54
Compare
Choose a tag to compare

Upgrade priority: Low, unless using the proposeParachain module.

  • Adjust balance retrievals to check for system.account for new/old determination
  • Add types for the new proposeParachain module (as per Rococo)
  • Adjust Address <-> LookupSource definitions (no external impact, both in existence)
  • Add Ethereum-compatible Ethereum{AccountId, LookupSource} types, underlying H160
  • Allow for configurable hashers via registry.setHasher(...) (defaults to blake2AsU8a)
  • @polkadot/util 3.3

v1.29.1

17 Aug 11:02
Compare
Choose a tag to compare

Upgrade priority: Low, unless on bleeding-edge chain with new compact CompactAssignments.

  • Important The Substrate CompactAssignments type has changed for better space utilization. On older chains, supply CompactAssignments: 'CompactAssignmentsTo257'
  • Clean tx cookbook param expansion (Thanks to https://github.com/swswsw)
  • Add additional Fixed{I,U}{64,128} and {I,U}32F32 types
  • Add desiredRunnersUp to council derives
  • Cleanup indices/AccountId combination derive lookups
  • @polkadot/util 3.2

v1.28.1

10 Aug 06:34
Compare
Choose a tag to compare

Upgrade priority: Low, unless using Centrifuge or parachains

  • Update Centrifuge types to latest (Thanks to https://github.com/mikiquantum)
  • Add cookbook entry for viewing block extrinsics
  • Support types for time-delay proxies
  • Update types for parachains
  • @polkadot/util 3.1
  • @polkadot/wasm-crypto 1.3

v1.27.1

03 Aug 09:06
Compare
Choose a tag to compare
  • Remove outdated example poc-3 RPC reference (Thanks to https://github.com/swswsw)
  • Raw/Bytes toHuman detects ASCII sequence for text output
  • Add know types for the Rococo chain