Releases: polkadot-js/api
v2.8.1
Upgrade priority: Low. Recommended if using Substrate master with new MultiAddress.
Contributed:
- Export
derive.chain.getBlock(Thanks to https://github.com/lovesh)
Changes:
- Expand
MultiAddressconstruction with multi type detection - Rename
GenericLookupSourcetoIndicesLookupSource(internal use) - Cleanup list retrievals with
Rawdata results for undecodable entries - Export actual version via
RegistryMetadata - Dedupe bn.js (one version shared between dependencies)
v2.7.1
Upgrade priority: Medium. Recommended for users of Polkadot/Kusama and api-contract users.
Changes:
- Allow for
ExtrinsicSignatureoverrides (defaults toMultiSignature) - Update api-contract
Blueprintto allow for optional salt (auto if not provided) - Support for ink!
.contractfiles (in addition to ABI.json) - Fix contract event decoding with pass-through of raw
Bytes - Fix support for enum encoding in api-contract
- Support new contract
Scheduletype as per Substrate - Update Kusama/Polkadot known upgrade blocks
- Adjust typegen generated
@polkadot/typesimports - Adjust internal
@polkadot/typesimports/exports (overall bundle sizes)
v2.6.1
Upgrade priority: Low. Should be done alongside an update to @polkadot/util to 4.0
Changes:
- Adjust auto-gas to contract RPC call to 5 * 10 ^ 12 (align with Rust)
- Adjust derive AccountId check to take Ethereum-compatible chains into account
- Fallback for chains with invalid council proposal data in derives
- Bump static v12 Metadata (tests) to latest Substrate version
- Bump
@polkadot/{util,util-crypto}to 4.0 (optimized WASM layers)
v2.5.1
Upgrade priority: Low. Recommended for api-contract developers.
- Breaking change Substrate changed the
ContractExecResultfromapi.rpc.contracts.call. The API does have pass-through support for both old and new variants via theContractinterface, however it means the structure has changed to accommodate the new Substrate structure. Refer to the docs for the latest interface (includingisSuccess/isError->isOk/isErr, and the availability of thegasConsumed)
Contributed:
- Dedup similar types on generation (Thanks to https://github.com/monitz87)
Changes:
Contractexecution will now return contract events decoded in the result- Add
.dryRunon extrinsics (alongside.paymentInfousage) - Add
system_syncStateandsyncstate_genSyncSpecRPCs - Enhance error reporting,
Callindicates explicit call as found - Adjust internal metadata decoration and use as exposed from
@types/metadata - Expand Rococo known types to cater for v1 (specVersion 10)
registry.hashnow returns anH256object (as opposed to raw Uint8Array)- Use utility logger in all relevant error messages (consistency in logging)
- Add
derive.council.proposal(<hash>)for retrieval of a single (expanded) proposal - Correctly and transparently format type generation types (allowing for nested variants)
v2.4.1
Upgrade priority: Low. No breaking changes, however it does move api-contract forward with additional features.
Contributed:
- Add support for both
{i,u}256types on contracts (Thanks to https://github.com/seanyoung)
Changes:
- Add
.keysAt&.entriesAtto query maps at a specific blockHash - Adjust ordering of type injection, any
types: { ... }definitions not have precedence - Correctly format Tuples in both RPC and const definitions as part of type generation
- Add node-template to known types (tracking inside API), remove warnings for the spec
- Add initial implementation for new Substrate
MultiAddresstype - Add
api.derive.chain.subscribeNewBlocksfor full block retrievals - Contracts identifiers to
.{exec, read}('name', ...)now matches on both snake_case and camelCase (consistency) - Cleanup contracts serialization for messages to allow both to and from
- Add deserialization of contract events against the ABI
- Adjust contracts metadata parsing to be future-proof with type retrievals
- Add tests for Solang into contracts, re-organize layout per type
v2.3.1
Upgrade priority: Low. Recommended for api-contracts developers and those using large messages via Node.js WS.
Contributed:
- Adjust frame size for Node.js WebSockets (Thanks to https://github.com/mnaamani)
- Update warnings to reflect new docs URLs (Thanks to https://github.com/aphelionz)
Changes:
- Expose
dispatch{Error, Info}on all.txresults (less boilerplate on info checks) - Add missing primitive types inside contracts type parsing
- Adjust api-contract to expose
Contract.{query, tx}.<message>andBlueprint.tx.<constructor> - Rework contracts registry to be generic to all scale-info definitions
- Allow for auto-max weight on contract read/exec (useful in estimation)
- Fix memoization where
BigIntparams are passed
v2.2.1
Upgrade priority: Low.
- Breaking change
@polkadot/api-contractnow only supports ink! 3.0-rc1 and later formats. Users of ink! 2.1 are recommended to stay on an older version until upgraded.
Contributed:
- Add latest Ink! types (Thanks to https://github.com/ascjones & https://github.com/kwingram25)
- Add base for new contract metadata parsing (Thanks to https://github.com/ascjones & https://github.com/kwingram25)
Changes:
- Introduce
OriginCallertype (& apply to scheduler types) - Adjust
ContractInfostruct to cater for latest Substrate - Allow snake_case to be handled transparently in structs
- Full new api-contract developer interfaces (Code, Blueprint, Contract)
- Rework Abi & Abi Registry use & parse (on-top-of-contributed) for efficiency & non-global clobber
- Allow
nullinput onTextvalues in addition to existingundefined - Remove all documentation after move to https://github.com/polkadot-js/docs repo
- Adjust type encoding from TypeDef, s/encodeType/encodeTypeDef/
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.validatorsFromto 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
RefCounttype (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_proveFinalityRPC - Drop support for linked map queries not via .entries (deprecated since early versions of Substrate 2)
- Support
.entries()on older chains withoutqueryStorageAtsupport - Add bounty type definitions from treasury palette
- Adjust
RefCounttype as per substrate 2.0 - Add
PalletVersiontypes 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 validMetadataobject to be passed-in, instead of raw data. It is recommended to create aMetadataobject, set it on the registry with.setMetadataand then only create aDecoratedinstance. (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 }tosignAndSendthe API will usesystem.accountNextIndexto 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)