Releases: polkadot-js/api
v2.10.1
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
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:
- Add typegen capability for custom RPCs (Thanks to https://github.com/holygits)
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 forUint8array
extensions (already released in 2.8.2 as a bugfix)
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
MultiAddress
construction with multi type detection - Rename
GenericLookupSource
toIndicesLookupSource
(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
Upgrade priority: Medium. Recommended for users of Polkadot/Kusama and api-contract users.
Changes:
- Allow for
ExtrinsicSignature
overrides (defaults toMultiSignature
) - 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
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
ContractExecResult
fromapi.rpc.contracts.call
. The API does have pass-through support for both old and new variants via theContract
interface, 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:
Contract
execution will now return contract events decoded in the result- Add
.dryRun
on extrinsics (alongside.paymentInfo
usage) - Add
system_syncState
andsyncstate_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 anH256
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
Upgrade priority: Low. No breaking changes, however it does move api-contract
forward with additional features.
Contributed:
- Add support for both
{i,u}256
types on contracts (Thanks to https://github.com/seanyoung)
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
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.tx
results (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
BigInt
params are passed
v2.2.1
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:
- 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
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 onText
values 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.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)