Releases: polkadot-js/api
Releases · polkadot-js/api
v1.5.1
- Important Substrate master has updated staking, on older chains supply
StakingLedger: 'StakingLedgerTo223' - Important Substrate master has updated collective, on older chains supply
Votes: 'VotesTo230' - Add proper support for type generation with an Enum containing an Tuple (Thanks to https://github.com/monitz87)
- Fix storage parsing not resulting in rejected Promises (Fix from https://github.com/aniiantt applied)
- Remove use of deprecated
Observable.create(Thanks to https://github.com/Himself65) - Add types & metadata for the latest Polkadot/Substrate runtime versions (master branches)
- Type extraction will now allow the same sub-module name across packages, i.e.
@polkadot/types/interfaces/runtime&@mine/interfaces/runtimewill be valid - Add
.range([from, to]: [Hash, Hash?], ...args: any[]): [Hash, Codec][]on all storage entries - Add
.raw(...args: any[]): Promise<Uint8Array & Codec>to all RPC calls, returning the un-encoded result - Allow pre-module type aliasing with
typesAlias: { <moduleName>: { <meta-type>: <alias-type> } }in API construction options - Allow
BTreeMapto be initialized with aRecord<string, any>object (in addition toMap) - Allow for
HashMap<KeyType, ValueType>definitions Boolwill now correctly returnisEmptyon false/default values- Refresh the
NetworkStatetypes as returned by therpc.system.networkState()call to current - Expose
registry.createClass(<typeName>)to allow for creating type classes. If you are usingcreateClassorClassOfin your code, it is recommended to swap to this instance. - Add additional derives to
api.derive.stakingto handle lazy-payout retrievals - Update
@polkadot/{util, util-crypto, keyring}to 1.6.1 &@polkadot/wasmto 1.2.1
1.4.1
- Breaking change (TypeScript only) The
*.d.tsfiles now contain TypeScript 3.8 features (specifically#private), which is not usable in TS versions < 3.8 - Breaking change -
api.derive.staking.*has updated result types and detects support for lazy payouts queries - Rework type generation for
api.{query, tx}to properly handle complex type inputs (Thanks to https://github.com/monitz87) - Rework metadata
--strictmode to effectively decorate chain metadata (Thanks to https://github.com/monitz87) - Add
api.rpc.chain.subscribeAllHeads(not just best) (Thanks to https://github.com/jak-pan) - Add
api.rpc.engine.*for manual seal support - Add
api.injectMetadata(metadata)to initialize API with a specific metadata version - The api now checks for runtime upgrades, augmenting the interfaces with new metadata when found
- Support types & interfaces required for lazy reaping, lazy payouts & offchain phragmen
Optiontypes now has an.unwrapOrDefaultas an complement to.unwrap&.unwrapOr- Support JS
BigIntinputs in any derivedUIntandIntobject, e.g.api.tx.balances.transfer(..., 9876543210123456789n) UInt&Intnow does source bitLength checks upon construction- Registry now exposes
.createType(<type>, ...args)as an additional helper (like the API) - Expand
.toHumanonExtrinsicEra,SubmittableResult&Vote - Move
DigestItem,Fixed64,H160,H256&H512to interfaces in@polkadot/types/interfaces - Align construction of unknown types in
registry.getconsistently warn on detection, throw on use - Support for arbitrary
u*types viaUInt<bitLength>type definitions - Expose static
.withonUInt,Int&U8aFixedclasses with optional type name override - Remove 11 Jan 2019 extrinsic length hack
- Use ES
#fieldon private class fields as applicable - Move
types/primitive/{extrinsics, generic}totypes/{extrinsics, generic} - Cleanup augmentation and generation scripts for type definitions, aligning with api augmentation
- Bump to
@polkadot/{util, util-crypto, keyring}2.5.1
v1.3.1
This is a slightly-out-of-band release, with mostly internal refactoring. It was pushed earlier than normal to ensure there is a minor release available that fixing the TypeScript typing issues. Unless you are running @polkadot/util 2.4.1, or don't want to explicitly install @types/bn.js to the use the API (TS) an upgrade is not strictly required for on-chain functionality.
- Add
@types/bn.jsas a normal dependency, exposed in*.d.ts((Thanks to https://github.com/monitz87) - Type generation scripts (including
polkadot-types-from-{chain,defs}) has been moved to the@polkadot/typegenpackage - The
@polkadot/types/codec/createhas been moved to@polkadot/types/create, imports from@polkadot/typesare unaffected - Expose chain properties on registry (and use for API type formatting)
- Add
toHuman(isExtended?: boolean)to all codec types, formatting into a human-readable structure
v1.2.1
- Important Update RPC status codes (latest Substrate 2), with the
isInBlock(isFinalizednow indicates finality) - Storage
.entries(arg?: any)now has the correct argument type for DoubleMap (Thanks to https://github.com/monitz87) - Swap Kusama and Polkadot aliasses for
AddresstoAccountId(future update) - Add
LookupSourceandLookupTargettypes instead of mapping these directly for aliassing - Add
BitVectype primitive - Add support for
system.accountfor balance & nonce queries in derives as well as Submittables (Substrate composites) - Add
rpc.author.hasKeyandrpc.author.hasSessinKeysRPCs - Add derives for the parachains interfaces
- Applied the latest types for Polkadot parachains
registry.findMetaErrornow can take in aDispatchErrorModuleobject for error lookups (fromasModuleinDispatchError)- Metadata now correctly serializes to the original input data via
toHex()&toU8a() - Metadata documentation generation rework, including the output of errors from metadata
- Update all examples and comments to use latest
system.accountqueries (instead ofsystem.accountNonceandbalances.freeBalance/balances.reservedBalance) - Cleanup
codec/Datetests to make it run properly on all timezones - Add explicit dependencies to all packages and move TypeScript
@types/*to dev deps
1.1.1
- Important Chains without
balances.accountorsystem.accountshould supply"BalanceLock": "BalanceLockTo212"to their types to use the previous-generationBalanceLock(when querying locks) - Add support for
balances.accountin all applicable derives (incl.vestingmodule) - Inject and use SignedExtensions by name from V11 metadata (V4 extrinsics only)
- Add typings for
api.tx.*.*- thepolkadot-types-from-chainnow also generates these - Remove additional V1-only derives
(staking.recentlyOffline,balances.nominatorsFor) - Add
.isMax()on int values, an opposite ofisZero()(e.g.u128, as well as derived, e.g.Balances) - Add
.keyPrefix()to allapi.query.*complementing the.key()call, both returning a hex string - Council derives now takes bootstrapping (member, no elections) into account
- Account derives now allow for an optional indices module (not required)
- Adjust balances fees derivation with optional transfer and creation fees (removed in Substrate)
- Adjust enum
.toJSON()to return type name as specified
v1.0.1
- Breaking change Drop support for Substrate v1 chain in all derives
- Return unsub functions from provider .on emitters (Thanks to https://github.com/jak-pan)
ApiPromise.isReadynow rejects on unrecoverable errors (Thanks to https://github.com/laec)- Add
polkadot-types-from-chain&polkadot-types-from-defsTypeScript generators to@polkadot/types - Only decorate derives where relevant parent
api.query.*is available - Support
.entries(arg?: any)lookups on DoubleMaps (in addition to previously supported maps) - Allow v9 metadata to parse even in cases where it was wrongly deployed pre-v10
- Allow type-aliases on a per-module basis (e.g.
Judgementin identity as well as society) - Allow passing
{ signer }to bothapi.tx.*andapi.sign(in addition toapi.setSigner) - Add derives for the society module
- Don't map empty tuples, e..
()toNull, rather keep them empty - Add lookups to the metadata errors via
findMetaError - Update metadata and types for the latest Substrate & Polkadot versions
- Support metadata V11 as per latest Substrate
- Remove support for un-deployed metadata
- Remove old known types for Substrate V1
v0.100.1
- Important This will the the last API version with Substrate 1.x support. Although you will still be able to use subsequent versions with older chans, dependent libraries such as sr25519 may not be compatible.
- Add support for the Substrate identity module
- Remove the
codec/Datatype, to remove a conflict with Substrate. This type is now namedRaw - Fix for linked maps using
Option - Add support for
BTreeSet(Thanks to https://github.com/satellitex) - Add support for Metadata v10
- Add support for latest Polkadot/Substrate types
- Add
paymentInfoto submittables to calculate fees
v0.99.1
- Breaking change The
DataandU8atype has been renamed and just replaced with theRawtype - Breaking change The
api.derive.staking.infohas been split into 2 -staking.queryfor non-balance related information (more effective) andstaking.accountthat enhances query for all the information previously found.info - Cleanup
DoubleMaphashing to always hash over the full value (in the case ofVec<T>, this includes the length) - Update democracy derives to take care of nextTally and lowestUnbaked
- Add additional derives for both council & treasury
- Alignment with latest Polkadot/Substrate master branch types
v0.98.1
- Make the TypeScript generation script more re-usable (Thanks to @xlc)
- Add
.entries()for all map-types, returning storage keys and values - Add
.signAsyncto submittable extrinsics (Thanks to @c410-f3r) - Cleanup circular references between internal dependencies
- Support for new Substrate democracy with preimages in derive
- Alignment of types with Substrate/Polkadot master branches
v0.97.1
- Breaking change Add the passing on an explicit
Registryto all calls tocreateTypeas well as all codec classes. If you are upgrading form an older version, use the migration guide to walk through the changes required. - Breaking change The metadata classes have been moved from
@polkadot/typesinto@polkadot/metadata. If you explicitly createMetadataclasses, you now would need to do so with theimport Metadata from '@polkadot/metadata';This is a decorated class, where the previous metadata is now available onMetadata.metadata, alongside decoratedconsts.*',tx.*andquery.*. - Breaking change Session
Keysdefaults to 4 keys now (Substrate master), depending on your node config, you would want to override with e.g.Keys: 'SessionKeys3'(1, 2, 3, 4, 5 & 6) - Breaking change
ValidatorPrefsnow default to the new percentage commission model, to use the previousvalidatorPayment, you can override withValidatorPrefs: 'ValidatorPrefsTo196' api.derive.*now has built-in memomization- Various fixes and cleanups to
api.derive.*including era length progress and vesting calculations - Aligned all types with the latest Polkadot & Substrate, including Kusama CC3
- Support for Metadata V9, which adjusts the hashing methods of storage entries
- Support for Metadata V10 (still un-released), which includes prefixed map support