Use .js imports in src (#5526)
* Use .js imports in src * Adjust * Fix imports * Bump dev * Adjust with .js imports for typegen * Adjust * Adjust * Remove target override
This commit is contained in:
@@ -7,15 +7,15 @@ import type { BlockNumber, Call, Hash, ReferendumIndex, Scheduled } from '@polka
|
||||
import type { FrameSupportPreimagesBounded, PalletSchedulerScheduled } from '@polkadot/types/lookup';
|
||||
import type { Codec, ITuple } from '@polkadot/types/types';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { DeriveApi, DeriveDispatch, DeriveProposalImage } from '../types';
|
||||
import type { DeriveApi, DeriveDispatch, DeriveProposalImage } from '../types.js';
|
||||
|
||||
import { catchError, combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { Enum } from '@polkadot/types';
|
||||
import { isFunction, objectSpread, stringToHex } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { getImageHashBounded } from './util';
|
||||
import { memo } from '../util/index.js';
|
||||
import { getImageHashBounded } from './util.js';
|
||||
|
||||
const DEMOCRACY_ID = stringToHex('democrac');
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './dispatchQueue';
|
||||
export * from './locks';
|
||||
export * from './nextExternal';
|
||||
export * from './preimages';
|
||||
export * from './proposals';
|
||||
export * from './referendumIds';
|
||||
export * from './referendums';
|
||||
export * from './referendumsActive';
|
||||
export * from './referendumsFinished';
|
||||
export * from './referendumsInfo';
|
||||
export * from './sqrtElectorate';
|
||||
export * from './dispatchQueue.js';
|
||||
export * from './locks.js';
|
||||
export * from './nextExternal.js';
|
||||
export * from './preimages.js';
|
||||
export * from './proposals.js';
|
||||
export * from './referendumIds.js';
|
||||
export * from './referendums.js';
|
||||
export * from './referendumsActive.js';
|
||||
export * from './referendumsFinished.js';
|
||||
export * from './referendumsInfo.js';
|
||||
export * from './sqrtElectorate.js';
|
||||
|
||||
@@ -5,13 +5,13 @@ import type { Observable } from 'rxjs';
|
||||
import type { AccountId, ReferendumInfoTo239, Vote } from '@polkadot/types/interfaces';
|
||||
import type { PalletDemocracyReferendumInfo, PalletDemocracyVoteVoting } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveApi, DeriveDemocracyLock } from '../types';
|
||||
import type { DeriveApi, DeriveDemocracyLock } from '../types.js';
|
||||
|
||||
import { map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { BN_ZERO, isUndefined } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { memo } from '../util/index.js';
|
||||
|
||||
type ReferendumInfoFinished = PalletDemocracyReferendumInfo['asFinished'];
|
||||
type VotingDelegating = PalletDemocracyVoteVoting['asDelegating'];
|
||||
|
||||
@@ -6,12 +6,12 @@ import type { Option } from '@polkadot/types';
|
||||
import type { H256 } from '@polkadot/types/interfaces';
|
||||
import type { FrameSupportPreimagesBounded, PalletDemocracyVoteThreshold } from '@polkadot/types/lookup';
|
||||
import type { ITuple } from '@polkadot/types/types';
|
||||
import type { DeriveApi, DeriveProposalExternal } from '../types';
|
||||
import type { DeriveApi, DeriveProposalExternal } from '../types.js';
|
||||
|
||||
import { map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { getImageHashBounded } from './util';
|
||||
import { memo } from '../util/index.js';
|
||||
import { getImageHashBounded } from './util.js';
|
||||
|
||||
function withImage (api: DeriveApi, nextOpt: Option<ITuple<[H256 | FrameSupportPreimagesBounded, PalletDemocracyVoteThreshold]>>): Observable<DeriveProposalExternal | null> {
|
||||
if (nextOpt.isNone) {
|
||||
|
||||
@@ -7,14 +7,14 @@ import type { FrameSupportPreimagesBounded, PalletPreimageRequestStatus } from '
|
||||
import type { Bytes, Option } from '@polkadot/types-codec';
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { DeriveApi, DeriveProposalImage } from '../types';
|
||||
import type { DeriveApi, DeriveProposalImage } from '../types.js';
|
||||
|
||||
import { map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { BN_ZERO, isFunction } from '@polkadot/util';
|
||||
|
||||
import { firstMemo, memo } from '../util';
|
||||
import { getImageHashBounded } from './util';
|
||||
import { firstMemo, memo } from '../util/index.js';
|
||||
import { getImageHashBounded } from './util.js';
|
||||
|
||||
type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber];
|
||||
type OldPreimage = ITuple<PreimageInfo>;
|
||||
|
||||
@@ -6,14 +6,14 @@ import type { Option, Vec } from '@polkadot/types';
|
||||
import type { AccountId, Balance, Hash, PropIndex } from '@polkadot/types/interfaces';
|
||||
import type { FrameSupportPreimagesBounded } from '@polkadot/types/lookup';
|
||||
import type { ITuple } from '@polkadot/types/types';
|
||||
import type { DeriveApi, DeriveProposal, DeriveProposalImage } from '../types';
|
||||
import type { DeriveApi, DeriveProposal, DeriveProposalImage } from '../types.js';
|
||||
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { isFunction, objectSpread } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { getImageHashBounded } from './util';
|
||||
import { memo } from '../util/index.js';
|
||||
import { getImageHashBounded } from './util.js';
|
||||
|
||||
type DepositorsNew = Option<ITuple<[Vec<AccountId>, Balance]>>;
|
||||
type DepositorsOld = Option<ITuple<[Balance, Vec<AccountId>]>>;
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ReferendumIndex } from '@polkadot/types/interfaces';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveApi } from '../types';
|
||||
import type { DeriveApi } from '../types.js';
|
||||
|
||||
import { map, of } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { memo } from '../util/index.js';
|
||||
|
||||
export function referendumIds (instanceId: string, api: DeriveApi): () => Observable<BN[]> {
|
||||
return memo(instanceId, (): Observable<BN[]> =>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { DeriveApi, DeriveReferendumExt } from '../types';
|
||||
import type { DeriveApi, DeriveReferendumExt } from '../types.js';
|
||||
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { memo } from '../util/index.js';
|
||||
|
||||
export function referendums (instanceId: string, api: DeriveApi): () => Observable<DeriveReferendumExt[]> {
|
||||
return memo(instanceId, (): Observable<DeriveReferendumExt[]> =>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { DeriveApi, DeriveReferendum } from '../types';
|
||||
import type { DeriveApi, DeriveReferendum } from '../types.js';
|
||||
|
||||
import { of, switchMap } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { memo } from '../util/index.js';
|
||||
|
||||
export function referendumsActive (instanceId: string, api: DeriveApi): () => Observable<DeriveReferendum[]> {
|
||||
return memo(instanceId, (): Observable<DeriveReferendum[]> =>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { PalletDemocracyReferendumInfo } from '@polkadot/types/lookup';
|
||||
import type { DeriveApi } from '../types';
|
||||
import type { DeriveApi } from '../types.js';
|
||||
|
||||
import { map, switchMap } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { memo } from '../util/index.js';
|
||||
|
||||
type ReferendumInfoFinished = PalletDemocracyReferendumInfo['asFinished'];
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ import type { Option, Vec } from '@polkadot/types';
|
||||
import type { AccountId, Hash, ReferendumInfoTo239, Vote } from '@polkadot/types/interfaces';
|
||||
import type { PalletDemocracyReferendumInfo, PalletDemocracyReferendumStatus, PalletDemocracyVoteVoting } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveApi, DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types';
|
||||
import type { DeriveApi, DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types.js';
|
||||
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { isFunction, objectSpread } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { calcVotes, getImageHash, getStatus } from './util';
|
||||
import { memo } from '../util/index.js';
|
||||
import { calcVotes, getImageHash, getStatus } from './util.js';
|
||||
|
||||
type VotingDelegating = PalletDemocracyVoteVoting['asDelegating'];
|
||||
type VotingDirect = PalletDemocracyVoteVoting['asDirect'];
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveApi } from '../types';
|
||||
import type { DeriveApi } from '../types.js';
|
||||
|
||||
import { map } from 'rxjs';
|
||||
|
||||
import { bnSqrt } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { memo } from '../util/index.js';
|
||||
|
||||
export function sqrtElectorate (instanceId: string, api: DeriveApi): () => Observable<BN> {
|
||||
return memo(instanceId, (): Observable<BN> =>
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Hash, ReferendumInfoTo239, Tally } from '@polkadot/types/interface
|
||||
import type { FrameSupportPreimagesBounded, PalletDemocracyReferendumInfo, PalletDemocracyReferendumStatus, PalletDemocracyVoteThreshold } from '@polkadot/types/lookup';
|
||||
import type { Option } from '@polkadot/types-codec';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types';
|
||||
import type { DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types.js';
|
||||
|
||||
import { BN, bnSqrt, isHex, isString, isU8a, objectSpread, stringToHex, u8aToHex } from '@polkadot/util';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user