Skip to content

Releases: polkadot-js/api

v2.10.1

07 Dec 10:24
Compare
Choose a tag to compare

Upgrade priority: Low. Recommended when following Substrate master and/or parachains development, contains the latest types for both.

  • Breaking change If using the staking.query derive, you now need to pass flags as to which values to retrieve

Changes:

  • Ensure that maximum era is limited to consts.system.blockHashCount (don't overflow on very low blocktimes)
  • Apply current Polkadot master parachain types
  • Apply current Substrate master asset types
  • Add system_{addLogFilter, resetLogFilter} RPCs
  • Adjust tests for latest Substrate metadata
  • Adjust staking derives to be more performant (flags indicate which query values to retrieve)
  • Add account derive to cater for the availability of identities
  • Use import type in all cases

v2.9.1

30 Nov 12:12
Compare
Choose a tag to compare

Upgrade priority: Low. No major changes when on at least 2.8.2. Users encouraged to upgrade to at least that patch.

  • Breaking change The API will now not attempt to queue calls made while not connected and send on connection. Rather when making a call and the RPC node is not connected, an error will be thrown.

Contributed:

Changes:

  • Remove rpc-core send queue, only allow sends while connected
  • Adjust staking derive for electedInfo to contain details of current validators
  • Extract identity-only derive from accounts.info for simpler reusability
  • Add types for Substrate master node (to allow for consistent swapping to MultiAddress)
  • Adjust Bytes with .slice to be consistent for Uint8array extensions (already released in 2.8.2 as a bugfix)

v2.8.1

28 Nov 10:15
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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)