Releases: polkadot-js/api
v2.1.1
Upgrade priority: Low.
Contributed:
- Remove unused documentation link (Thanks to https://github.com/roccomuso)
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
Upgrade priority: Medium. Required for all teams building on Substrate 2.0 for full compatibility.
- Important The
RefCount
type (used byquery.system.accounts
) has been changed to au32
. On older chains supply theRefCount: '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:
- Add secondary fields to EpochAuthorship (Thanks to https://github.com/andresilva)
- Add support for FixedVec in enums (Thanks to https://github.com/monitz87)
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 withoutqueryStorageAt
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
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 validMetadata
object to be passed-in, instead of raw data. It is recommended to create aMetadata
object, set it on the registry with.setMetadata
and then only create aDecorated
instance. (Only affects metadata-only users of the API)
Contributed:
- Added support for POW block author extraction (Thanks to https://github.com/sorpaas)
Changes:
- Ensure Metadata retrieval does not pollute the default registry
- When passing
{ nonce: -1 }
tosignAndSend
the API will usesystem.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
Upgrade priority: Low. Recommended when using clones instances.
Changes:
- Allow
paymentInfo
on any extrinsic withtx.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
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 toprovider.isConnected()
. Additionally theprovider.disconnect()
is now async, aligning with.connect()
.
Contributed:
- Expand vesting information via derive balances (Thanks to https://github.com/niklabh)
- Add
isReadyOrError
to API,isReady
always succeeds (Thanks to https://github.com/shawntabrizi)
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 aSignedBlock
extended with an.author
(same asderive.chain.getHeader(...)
) - Added
api.{connect, disconnect}()
as well asisConnected
interfaces. The first functions async returningPromise<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
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 addingRewardDestination: 'RewardDestinationTo257'
- Important Substrate changed the
CompactAssignment
type enhanced types for session solution submissions. If on an older chain consider addingCompactAssignments: 'CompactAssignmentsTo257'
Contributed:
- Fix documentation language and typos (Thanks to https://github.com/Meuko)
- Add missing
TransactionPriority
type (Thanks to https://github.com/aniiantt) - Update definitions for new
CompactAssignments
, including tests (Thanks to https://github.com/kianenigma)
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-inBigInt
) onInt/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
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, underlyingH160
- Allow for configurable hashers via
registry.setHasher(...)
(defaults toblake2AsU8a
) @polkadot/util
3.3
v1.29.1
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, supplyCompactAssignments: '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
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
- 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