diff --git a/CHANGELOG.md b/CHANGELOG.md index d14e85d665..6490a02f36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ - **Breaking change** The decorated field getters on `Struct` were moved to the prototype class for performance reasons. While `struct.` access still behaves in the same way, with the same results, this does mean that the prototype getters are not visible when doing an `Object.keys(struct)` or when doing an object spread. - **Breaking change** Deprecated interfaces have been removed including `tx.sign(...)` (use `signAsync`), `Result.{is, as}Error` (use `{is, as}Err`) as well as storage `.range(...)` operations. -- **Breaking change** Only current Substrate contracts pallets are supported. This means `api-contract` will detect the usage of `storageDepositLimit` in params, if not available the contract interfaces will not be available. -- **Breaking change** Deprecated call interfaces on `api-contract` have been removed. Always ensure you pass an options options to construction and queries. +- **Breaking change** Contracts access via `api-contract` will now detect the usage of `storageDepositLimit` in params, if not available the contract interfaces will not be decorated. +- **Breaking change** Deprecated call interfaces on `api-contract` have been removed. Always ensure you pass an options object to construction and query methods. Changes: @@ -14,6 +14,7 @@ Changes: - Drop support for contract runtimes without `storageDepositLimit` (runtime `contractsApi` only has support for latest) - Export `api.rx.call.*` for internal usage (derive, contracts) - Remove old-style param passing as opposed to options in `api-contract` +- Support for alliance/motion collective derives - Add Kusama 9260 upgrade block - Add Polkadot 9230 & 9250 upgrade blocks - Add Westend 9251, 9260 & 9261 upgrade blocks diff --git a/packages/api-derive/src/allianceMotion/index.ts b/packages/api-derive/src/allianceMotion/index.ts new file mode 100644 index 0000000000..d670d28696 --- /dev/null +++ b/packages/api-derive/src/allianceMotion/index.ts @@ -0,0 +1,14 @@ +// Copyright 2017-2022 @polkadot/api-derive authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective'; + +export const members = collectiveMembers('allianceMotion'); + +export const hasProposals = collectiveHasProposals('allianceMotion'); +export const proposal = collectiveProposal('allianceMotion'); +export const proposalCount = collectiveProposalCount('allianceMotion'); +export const proposalHashes = collectiveProposalHashes('allianceMotion'); +export const proposals = collectiveProposals('allianceMotion'); + +export const prime = collectivePrime('allianceMotion'); diff --git a/packages/api-derive/src/bundle.ts b/packages/api-derive/src/bundle.ts index 4aae5c0422..cc2b33d66a 100644 --- a/packages/api-derive/src/bundle.ts +++ b/packages/api-derive/src/bundle.ts @@ -22,6 +22,10 @@ export { lazyDeriveSection }; // Enable derive only if some of these modules are available const checks: Record = { + allianceMotion: { + instances: ['allianceMotion'], + methods: [] + }, bagsList: { instances: ['voterList', 'bagsList'], methods: [], diff --git a/packages/api-derive/src/collective/types.ts b/packages/api-derive/src/collective/types.ts index d2e378e939..578c31621a 100644 --- a/packages/api-derive/src/collective/types.ts +++ b/packages/api-derive/src/collective/types.ts @@ -1,4 +1,4 @@ // Copyright 2017-2022 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -export type Collective = 'council' | 'membership' | 'technicalCommittee'; +export type Collective = 'allianceMotion' | 'council' | 'membership' | 'technicalCommittee'; diff --git a/packages/api-derive/src/derive.ts b/packages/api-derive/src/derive.ts index 8f44c826ff..9b769b2e38 100644 --- a/packages/api-derive/src/derive.ts +++ b/packages/api-derive/src/derive.ts @@ -4,6 +4,7 @@ import type { AnyFunction } from '@polkadot/types/types'; import * as accounts from './accounts'; +import * as allianceMotion from './allianceMotion'; import * as bagsList from './bagsList'; import * as balances from './balances'; import * as bounties from './bounties'; @@ -23,7 +24,7 @@ import * as technicalCommittee from './technicalCommittee'; import * as treasury from './treasury'; import * as tx from './tx'; -export const derive = { accounts, bagsList, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx }; +export const derive = { accounts, allianceMotion, bagsList, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx }; type DeriveSection
= { [M in keyof Section]: Section[M] extends AnyFunction