Files
api/CHANGELOG.md
T
Jaco Greeff f807a93e87 Handle storage with optional modifiers (#717)
* Handle storage with optional modifiers

* Storage docs indicate Option

* Cleanup Option logic

* Convert Optional derive to use Option

* Bump version, update changelog

* Update CHANGELOG description

* Enum.spec.js -> Enum.spec.ts

* Add isEmpty to primitive types
2019-02-19 13:47:36 +01:00

3.6 KiB

0.45.1

  • Storage with option values now correctly return Option<Type> and is indicated as such in the documentation
// old
const ll = await api.query.session.lastLengthChange();

console.log('ll', ll /* BlockNumber */); // would be 0 if not set yet

// new
const llo = await api.query.session.lastLengthChange();

console.log('llo', llo.unwrapOr('not set') /* Option<BlockNumber> */)

0.44.1

  • Split primitives and types into seperate folders. This should not affect external use since the exports remain the same, however does have an impact where classes are referenced directly. e.g.
// old (affected)
import Method from '@polkadot/types/Method';
import Signature from '@polkadot/types/Signature';

// new locations
import Method from '@polkadot/types/primitive/Method';
import Signature from '@polkadot/types/type/Signature';

// unaffected
import { Method, Signature } from '@polkadot/types';

0.43.1

  • Intrduces support for the new keyring with sr25519 support in addition to ed25519. While this does not change the exposed API, it is considerred breaking since @polkadot/keuyring has interface changes. (Unless needed, don't rush the upgrade)

0.42.1

  • Support for substrate hash signing with implVersion >= 18
  • Changed signatures for Extrinsic signing, this should not have (much) of an impact since it is generally not used directly. SubmittableExtrinsic (as exposed by the API), supports the old-style use.

0.41.1

  • Support the V1 metadata specification from Substrate in addition to the currently testnet-active V0 version

0.40.1

  • The API interfaces now require a WS-compatible provider, e.g. subscription support is a must. Previously the HTTPProvider could be use (although it was very limited in the interactions).

0.39.1

  • The Promise API now returns a Promise<UnsubFunction> instead of UnsubFunction when making subscriptions.

0.38.1

Substrate has been updated with a breaking new transaction format where the Index/Nonce is now encoded as a Compact. This change is being rolled out to both Alexander (Polkadot testnet) as well as Charred Cherry (Substrate testnet) - transactions between old and new are not compatible.

0.37.1

api-observable has been removed. This was only used in /apps and inconsistent with the api/rx and api/promise APIs. Future work will include derivates like was included in api-observable into the base.

Tuples now return single types when only one type is available, i.e. (AccountId) would now resolve as AccountId. The extra type wrapper adds no benefit to users here.

0.36.1

Api Promise has been updated in the way we deal with subscriptions. Previously a subscription returned Promise<number> where the caller was to keep track of the id and use it in subsequent unsubscribes. Now any subscriptions return an unsubscribe/destroy function (): void, that is use for removing the subscriptions, e.g.

const unsubscribe = api.query.balance.freeBalance(Alice, (balance) => {...});

unsubscribe(); // here we destroy the subscription

0.35.1

Swapped to new metadata structures from Substrate. If the API is not working with your node, update Substrate to latest master branch. (Or 0.9.1 for Charred Cherry). Dropped support for old metadata as found as far back as BBQ Birch.

0.34.1

Changed the send signature (for future expansion of eg. events) to return result: { status: ExtrinsicStatus } instead of status: ExtrinsicStatus. For most cases where only status type checks are used, i.e. status.type === 'Finalised' this should not be a breaking change. Deep inspection of the status object however will need to adapt.