Skip to content

Releases: polkadot-js/api

v2.8.1

28 Nov 10:15

Choose a tag to compare

Upgrade priority: Low. Recommended if using Substrate master with new MultiAddress.

Contributed:

Changes:

  • Expand MultiAddress construction with multi type detection
  • Rename GenericLookupSource to IndicesLookupSource (internal use)
  • Cleanup list retrievals with Raw data results for undecodable entries
  • Export actual version via RegistryMetadata
  • Dedupe bn.js (one version shared between dependencies)

v2.7.1

16 Nov 09:41

Choose a tag to compare

Upgrade priority: Medium. Recommended for users of Polkadot/Kusama and api-contract users.

Changes:

  • Allow for ExtrinsicSignature overrides (defaults to MultiSignature)
  • Update api-contract Blueprint to allow for optional salt (auto if not provided)
  • Support for ink! .contract files (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 Schedule type as per Substrate
  • Update Kusama/Polkadot known upgrade blocks
  • Adjust typegen generated @polkadot/types imports
  • Adjust internal @polkadot/types imports/exports (overall bundle sizes)

v2.6.1

09 Nov 10:50

Choose a tag to compare

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

02 Nov 12:03

Choose a tag to compare

Upgrade priority: Low. Recommended for api-contract developers.

  • Breaking change Substrate changed the ContractExecResult from api.rpc.contracts.call. The API does have pass-through support for both old and new variants via the Contract interface, however it means the structure has changed to accommodate the new Substrate structure. Refer to the docs for the latest interface (including isSuccess/isError -> isOk/isErr, and the availability of the gasConsumed)

Contributed:

Changes:

  • Contract execution will now return contract events decoded in the result
  • Add .dryRun on extrinsics (alongside .paymentInfo usage)
  • Add system_syncState and syncstate_genSyncSpec RPCs
  • Enhance error reporting, Call indicates 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.hash now returns an H256 object (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

26 Oct 08:53

Choose a tag to compare

Upgrade priority: Low. No breaking changes, however it does move api-contract forward with additional features.

Contributed:

Changes:

  • Add .keysAt & .entriesAt to 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 MultiAddress type
  • Add api.derive.chain.subscribeNewBlocks for 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

18 Oct 14:47

Choose a tag to compare

Upgrade priority: Low. Recommended for api-contracts developers and those using large messages via Node.js WS.

Contributed:

Changes:

  • Expose dispatch{Error, Info} on all .tx results (less boilerplate on info checks)
  • Add missing primitive types inside contracts type parsing
  • Adjust api-contract to expose Contract.{query, tx}.<message> and Blueprint.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 BigInt params are passed

v2.2.1

12 Oct 14:13

Choose a tag to compare

Upgrade priority: Low.

  • Breaking change @polkadot/api-contract now 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:

Changes:

  • Introduce OriginCaller type (& apply to scheduler types)
  • Adjust ContractInfo struct 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 null input on Text values in addition to existing undefined
  • Remove all documentation after move to https://github.com/polkadot-js/docs repo
  • Adjust type encoding from TypeDef, s/encodeType/encodeTypeDef/

v2.1.1

05 Oct 08:43

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

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

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)