Skip to content

Releases: polkadot-js/api

v1.33.1

14 Sep 07:13

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

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

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

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

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

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

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

v1.26.1

27 Jul 11:27

Choose a tag to compare

  • Update docs for the new system.accountNextIndex (Thanks to https://github.com/shawntabrizi)
  • Update contracts call parameter typing (Thanks to https://github.com/kwingram25)
  • Adjust votingBalance to only return freeBalance (only council voting is free + reserved)
  • Additional checks for referenced Vec sub-type deconstruction in typegen
  • Allow for API typesBundle option to inject a group of chain versions types
  • Update metadata static tests for latest Substrate
  • @polkadot/util 3.0

v1.25.1

20 Jul 07:50

Choose a tag to compare

  • Important Contract RPC result updated on Substrate, on older chains supply ContractExecResult: 'ContractExecResultTo255'
  • Support for custom HTTP headers in providers (Thanks to https://github.com/brad-larson)
  • Update known types for Centrifuge (Thanks to https://github.com/philipstanislaus)
  • Update API users with Registrar #1 (Thanks to https://github.com/chevdor)
  • Raw/Bytes toHuman() displays utf-8 as available
  • Add fallback for setImmediate when not polyfilled
  • Update NetworkState reputation type for system_networkState RPC
  • Update session progress calcs for Aura (cater for negative)
  • Fix class prototype for (basically-deprecated) Linkage type
  • Add Polkadot types for purchase pallet

v1.24.1

13 Jul 09:58

Choose a tag to compare

  • Added isAscii & isUtf8 getters to Bytes & Raw types
  • Added toUtf8() helper to Bytes & Raw types
  • @polkadot/util 2.18