Releases: polkadot-js/api
Releases · polkadot-js/api
v1.33.1
Upgrade priority: Low. Recommended when using clones instances.
Changes:
- Allow
paymentInfoon 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
receivedHeartbeatsto not re-create the full object - Add
staking.stakerPrefsderive 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
.isReadycould throw an error, now it will always succeed on connection. For trapping errors, use the.isReadyOrErrorvariant on the API - Breaking change The
isConnectedprovider 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
isReadyOrErrorto API,isReadyalways 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 aSignedBlockextended with an.author(same asderive.chain.getHeader(...)) - Added
api.{connect, disconnect}()as well asisConnectedinterfaces. 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/queryMultino longer retrieves session keys (can be done via.keys/keysMulti) - Add
api.derive.accounts.accountIdto perform AccountId lookups (from indices or actual AccountId) - Lessen load of
paymentInfoqueries 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_subscribeJustificationsRPC - 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
RewardDestinationenum with an extra field for payout-to-any account for staking preferences. If on an older chain consider addingRewardDestination: 'RewardDestinationTo257' - Important Substrate changed the
CompactAssignmenttype 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
TransactionPrioritytype (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
AccountIdfor valid sizes - Add
toBigInt()(JS built-inBigInt) onInt/Uint, &Compact<*>types - Support for
.concaton Codec arrays - Support for serialization with
isBareflag on enums - Add
api.getBlockRegistry(blockHash?)to create registry/types for a specific block derive.democracy.locksnow returns delegated locks for an account as well- Adjust unlocking derives with appropriate in-place additions (less object allocations)
.signon submittables is marked deprecated (not due for removal, but rather use.signAsyncfor consistency with.signAndSend)- Adjust types for
CompactAssignments&RewardDestinationfor Polkadot, Kusama & Westend @polkadot/util3.4@polkadot/wasm-crypto1.4
v1.30.1
Upgrade priority: Low, unless using the proposeParachain module.
- Adjust balance retrievals to check for
system.accountfor new/old determination - Add types for the new
proposeParachainmodule (as per Rococo) - Adjust
Address<->LookupSourcedefinitions (no external impact, both in existence) - Add Ethereum-compatible
Ethereum{AccountId, LookupSource}types, underlyingH160 - Allow for configurable hashers via
registry.setHasher(...)(defaults toblake2AsU8a) @polkadot/util3.3
v1.29.1
Upgrade priority: Low, unless on bleeding-edge chain with new compact CompactAssignments.
- Important The Substrate
CompactAssignmentstype 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}32F32types - Add
desiredRunnersUpto council derives - Cleanup indices/AccountId combination derive lookups
@polkadot/util3.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/util3.1@polkadot/wasm-crypto1.3
v1.27.1
- Remove outdated example poc-3 RPC reference (Thanks to https://github.com/swswsw)
- Raw/Bytes
toHumandetects ASCII sequence for text output - Add know types for the Rococo chain
v1.26.1
- 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
typesBundleoption to inject a group of chain versions types - Update metadata static tests for latest Substrate
@polkadot/util3.0
v1.25.1
- 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
setImmediatewhen not polyfilled - Update
NetworkStatereputation type forsystem_networkStateRPC - Update session progress calcs for Aura (cater for negative)
- Fix class prototype for (basically-deprecated) Linkage type
- Add Polkadot types for
purchasepallet