diff --git a/packages/api-derive/src/elections/info.ts b/packages/api-derive/src/elections/info.ts index 72f85af756..25616f9c89 100644 --- a/packages/api-derive/src/elections/info.ts +++ b/packages/api-derive/src/elections/info.ts @@ -4,7 +4,8 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { u32, Vec } from '@polkadot/types'; -import type { AccountId, Balance, BlockNumber, SeatHolder } from '@polkadot/types/interfaces'; +import type { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces'; +import type { PalletElectionsPhragmenSeatHolder } from '@polkadot/types/lookup'; import type { ITuple } from '@polkadot/types/types'; import type { DeriveElectionsInfo } from './types'; @@ -13,11 +14,11 @@ import { combineLatest, map, of } from 'rxjs'; import { memo } from '../util'; // SeatHolder is current tuple is 2.x-era Substrate -type Member = SeatHolder | ITuple<[AccountId, Balance]>; +type Member = PalletElectionsPhragmenSeatHolder | ITuple<[AccountId, Balance]>; type Candidate = AccountId | ITuple<[AccountId, Balance]>; -function isSeatHolder (value: Member): value is SeatHolder { +function isSeatHolder (value: Member): value is PalletElectionsPhragmenSeatHolder { return !Array.isArray(value); } diff --git a/packages/api-derive/src/treasury/proposals.ts b/packages/api-derive/src/treasury/proposals.ts index 8be06d1f07..237cbd4fdc 100644 --- a/packages/api-derive/src/treasury/proposals.ts +++ b/packages/api-derive/src/treasury/proposals.ts @@ -4,7 +4,8 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Option } from '@polkadot/types'; -import type { ProposalIndex, TreasuryProposal } from '@polkadot/types/interfaces'; +import type { ProposalIndex } from '@polkadot/types/interfaces'; +import type { PalletTreasuryProposal } from '@polkadot/types/lookup'; import type { DeriveCollectiveProposal, DeriveTreasuryProposal, DeriveTreasuryProposals } from '../types'; import { combineLatest, map, of, switchMap } from 'rxjs'; @@ -13,7 +14,7 @@ import { memo } from '../util'; interface Result { allIds: ProposalIndex[]; - allProposals: Option[]; + allProposals: Option[]; approvalIds: ProposalIndex[]; councilProposals: DeriveCollectiveProposal[]; proposalCount: ProposalIndex; @@ -64,7 +65,7 @@ function retrieveProposals (api: ApiInterfaceRx, proposalCount: ProposalIndex, a ? api.derive.council.proposals() : of([] as DeriveCollectiveProposal[]) ]).pipe( - map(([allProposals, councilProposals]: [Option[], DeriveCollectiveProposal[]]): DeriveTreasuryProposals => + map(([allProposals, councilProposals]: [Option[], DeriveCollectiveProposal[]]): DeriveTreasuryProposals => parseResult(api, { allIds, allProposals, approvalIds, councilProposals, proposalCount }) ) ); diff --git a/packages/api-derive/src/types.ts b/packages/api-derive/src/types.ts index 5b2fcc0ac0..ce3b648a55 100644 --- a/packages/api-derive/src/types.ts +++ b/packages/api-derive/src/types.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { u32 } from '@polkadot/types'; -import type { Balance, BlockNumber, BountyIndex, Hash, Proposal, ProposalIndex, SetIndex, TreasuryProposal, Votes } from '@polkadot/types/interfaces'; -import type { PalletBountiesBounty } from '@polkadot/types/lookup'; +import type { Balance, BlockNumber, BountyIndex, Hash, Proposal, ProposalIndex, SetIndex, Votes } from '@polkadot/types/interfaces'; +import type { PalletBountiesBounty, PalletTreasuryProposal } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; export * from './accounts/types'; @@ -63,7 +63,7 @@ export type DeriveRecentlyOffline = Record; export interface DeriveTreasuryProposal { council: DeriveCollectiveProposal[]; id: ProposalIndex; - proposal: TreasuryProposal; + proposal: PalletTreasuryProposal; } export interface DeriveTreasuryProposals {