Skip to content

Commit

Permalink
10.1.2 (#5535)
Browse files Browse the repository at this point in the history
* 10.1.2

* USe /*#__PURE__*/  exports in derives
  • Loading branch information
jacogr authored Mar 11, 2023
1 parent 3887f6f commit a370450
Show file tree
Hide file tree
Showing 60 changed files with 319 additions and 275 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 10.1.2 Mar 11, 2023

Changes:

- Adjust type exports to remove invalid generated exports from `/src/`
- Apply missing `/*#__PURE__*/` exports in `api-derive`


## 10.1.1 Mar 11, 2023

Contributed:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "module",
"version": "10.1.1",
"version": "10.1.2",
"versions": {
"git": "10.1.1",
"npm": "10.1.1"
Expand All @@ -37,7 +37,7 @@
"test:one": "polkadot-dev-run-test --env node"
},
"devDependencies": {
"@polkadot/dev": "^0.71.4",
"@polkadot/dev": "^0.71.5",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/node": "^18.15.0"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/api-augment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.1",
"version": "10.1.2",
"main": "index.js",
"dependencies": {
"@polkadot/api-base": "10.1.1",
"@polkadot/rpc-augment": "10.1.1",
"@polkadot/types": "10.1.1",
"@polkadot/types-augment": "10.1.1",
"@polkadot/types-codec": "10.1.1",
"@polkadot/api-base": "10.1.2",
"@polkadot/rpc-augment": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-augment": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@polkadot/util": "^11.0.2",
"tslib": "^2.5.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/api-augment/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.1.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.1.2' };
6 changes: 3 additions & 3 deletions packages/api-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.1",
"version": "10.1.2",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "10.1.1",
"@polkadot/types": "10.1.1",
"@polkadot/rpc-core": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/util": "^11.0.2",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/api-base/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.1.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.1.2' };
12 changes: 6 additions & 6 deletions packages/api-contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.1",
"version": "10.1.2",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.1.1",
"@polkadot/types": "10.1.1",
"@polkadot/types-codec": "10.1.1",
"@polkadot/types-create": "10.1.1",
"@polkadot/api": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@polkadot/types-create": "10.1.2",
"@polkadot/util": "^11.0.2",
"@polkadot/util-crypto": "^11.0.2",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api-augment": "10.1.1",
"@polkadot/api-augment": "10.1.2",
"@polkadot/keyring": "^11.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/api-contract/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.1.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.1.2' };
24 changes: 12 additions & 12 deletions packages/api-derive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.1.1",
"version": "10.1.2",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.1.1",
"@polkadot/api-augment": "10.1.1",
"@polkadot/api-base": "10.1.1",
"@polkadot/rpc-core": "10.1.1",
"@polkadot/types": "10.1.1",
"@polkadot/types-codec": "10.1.1",
"@polkadot/api": "10.1.2",
"@polkadot/api-augment": "10.1.2",
"@polkadot/api-base": "10.1.2",
"@polkadot/rpc-core": "10.1.2",
"@polkadot/types": "10.1.2",
"@polkadot/types-codec": "10.1.2",
"@polkadot/util": "^11.0.2",
"@polkadot/util-crypto": "^11.0.2",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api": "10.1.1",
"@polkadot/api-augment": "10.1.1",
"@polkadot/rpc-augment": "10.1.1",
"@polkadot/rpc-provider": "10.1.1",
"@polkadot/types-support": "10.1.1"
"@polkadot/api": "10.1.2",
"@polkadot/api-augment": "10.1.2",
"@polkadot/rpc-augment": "10.1.2",
"@polkadot/rpc-provider": "10.1.2",
"@polkadot/types-support": "10.1.2"
}
}
2 changes: 1 addition & 1 deletion packages/api-derive/src/accounts/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function identity (instanceId: string, api: DeriveApi): (accountId?: Acco
);
}

export const hasIdentity = firstMemo(
export const hasIdentity = /*#__PURE__*/ firstMemo(
(api: DeriveApi, accountId: AccountId | Uint8Array | string) =>
api.derive.accounts.hasIdentityMulti([accountId])
);
Expand Down
18 changes: 11 additions & 7 deletions packages/api-derive/src/alliance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective/index.js';

export const members = collectiveMembers('allianceMotion');
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { u32 } from '@polkadot/types';
export type { AccountId } from '@polkadot/types/interfaces';

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 members = /*#__PURE__*/ collectiveMembers('allianceMotion');

export const prime = collectivePrime('allianceMotion');
export const hasProposals = /*#__PURE__*/ collectiveHasProposals('allianceMotion');
export const proposal = /*#__PURE__*/ collectiveProposal('allianceMotion');
export const proposalCount = /*#__PURE__*/ collectiveProposalCount('allianceMotion');
export const proposalHashes = /*#__PURE__*/ collectiveProposalHashes('allianceMotion');
export const proposals = /*#__PURE__*/ collectiveProposals('allianceMotion');

export const prime = /*#__PURE__*/ collectivePrime('allianceMotion');
5 changes: 4 additions & 1 deletion packages/api-derive/src/chain/bestNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import type { DeriveApi } from '../types.js';

import { createBlockNumberDerive } from './util.js';

// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { BlockNumber } from '@polkadot/types/interfaces';

/**
* @name bestNumber
* @returns The latest block number.
Expand All @@ -17,7 +20,7 @@ import { createBlockNumberDerive } from './util.js';
* });
* ```
*/
export const bestNumber = createBlockNumberDerive(
export const bestNumber = /*#__PURE__*/ createBlockNumberDerive(
(api: DeriveApi) =>
api.rpc.chain.subscribeNewHeads()
);
5 changes: 4 additions & 1 deletion packages/api-derive/src/chain/bestNumberFinalized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import type { DeriveApi } from '../types.js';

import { createBlockNumberDerive } from './util.js';

// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { BlockNumber } from '@polkadot/types/interfaces';

/**
* @name bestNumberFinalized
* @returns A BlockNumber
Expand All @@ -18,7 +21,7 @@ import { createBlockNumberDerive } from './util.js';
* });
* ```
*/
export const bestNumberFinalized = createBlockNumberDerive(
export const bestNumberFinalized = /*#__PURE__*/ createBlockNumberDerive(
(api: DeriveApi) =>
api.rpc.chain.subscribeFinalizedHeads()
);
4 changes: 0 additions & 4 deletions packages/api-derive/src/chain/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { combineLatest, map, of } from 'rxjs';

import { memo, unwrapBlockNumber } from '../util/index.js';

// re-export these - since these needs to be resolvable from api-derive, i.e. without this
// we would emit code with ../<somewhere>/src embedded in the *.d.ts files
export type { BlockNumber } from '@polkadot/types/interfaces';

export function createBlockNumberDerive <T extends { number: Compact<BlockNumber> | BlockNumber }> (fn: (api: DeriveApi) => Observable<T>): (instanceId: string, api: DeriveApi) => () => Observable<BlockNumber> {
return (instanceId: string, api: DeriveApi) =>
memo(instanceId, () =>
Expand Down
2 changes: 1 addition & 1 deletion packages/api-derive/src/collective/members.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ import { callMethod } from './helpers.js';
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { AccountId } from '@polkadot/types/interfaces';

export const members = callMethod<AccountId[]>('members', []);
export const members = /*#__PURE__*/ callMethod<AccountId[]>('members', []);
4 changes: 2 additions & 2 deletions packages/api-derive/src/collective/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ export function proposal (section: Collective): (instanceId: string, api: Derive
);
}

export const proposalCount = callMethod<u32 | null>('proposalCount', null);
export const proposalHashes = callMethod<Hash[]>('proposals', []);
export const proposalCount = /*#__PURE__*/ callMethod<u32 | null>('proposalCount', null);
export const proposalHashes = /*#__PURE__*/ callMethod<Hash[]>('proposals', []);
18 changes: 11 additions & 7 deletions packages/api-derive/src/council/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import { hasProposals as collectiveHasProposals, members as collectiveMembers, p
export * from './votes.js';
export * from './votesOf.js';

export const members = collectiveMembers('council');
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { u32 } from '@polkadot/types';
export type { AccountId } from '@polkadot/types/interfaces';

export const hasProposals = collectiveHasProposals('council');
export const proposal = collectiveProposal('council');
export const proposalCount = collectiveProposalCount('council');
export const proposalHashes = collectiveProposalHashes('council');
export const proposals = collectiveProposals('council');
export const members = /*#__PURE__*/ collectiveMembers('council');

export const prime = collectivePrime('council');
export const hasProposals = /*#__PURE__*/ collectiveHasProposals('council');
export const proposal = /*#__PURE__*/ collectiveProposal('council');
export const proposalCount = /*#__PURE__*/ collectiveProposalCount('council');
export const proposalHashes = /*#__PURE__*/ collectiveProposalHashes('council');
export const proposals = /*#__PURE__*/ collectiveProposals('council');

export const prime = /*#__PURE__*/ collectivePrime('council');
2 changes: 1 addition & 1 deletion packages/api-derive/src/democracy/preimages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function preimages (instanceId: string, api: DeriveApi): (hashes: (Hash |
);
}

export const preimage = firstMemo(
export const preimage = /*#__PURE__*/ firstMemo(
(api: DeriveApi, hash: Hash | Uint8Array | string | FrameSupportPreimagesBounded) =>
api.derive.democracy.preimages([hash])
);
18 changes: 11 additions & 7 deletions packages/api-derive/src/membership/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective/index.js';

export const members = collectiveMembers('membership');
// We are re-exporting these from here to ensure that *.d.ts generation is correct
export type { u32 } from '@polkadot/types';
export type { AccountId } from '@polkadot/types/interfaces';

export const hasProposals = collectiveHasProposals('membership');
export const proposal = collectiveProposal('membership');
export const proposalCount = collectiveProposalCount('membership');
export const proposalHashes = collectiveProposalHashes('membership');
export const proposals = collectiveProposals('membership');
export const members = /*#__PURE__*/ collectiveMembers('membership');

export const prime = collectivePrime('membership');
export const hasProposals = /*#__PURE__*/ collectiveHasProposals('membership');
export const proposal = /*#__PURE__*/ collectiveProposal('membership');
export const proposalCount = /*#__PURE__*/ collectiveProposalCount('membership');
export const proposalHashes = /*#__PURE__*/ collectiveProposalHashes('membership');
export const proposals = /*#__PURE__*/ collectiveProposals('membership');

export const prime = /*#__PURE__*/ collectivePrime('membership');
2 changes: 1 addition & 1 deletion packages/api-derive/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.1.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.1.2' };
6 changes: 3 additions & 3 deletions packages/api-derive/src/session/progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ export function progress (instanceId: string, api: DeriveApi): () => Observable<
);
}

export const eraLength = withProgressField('eraLength');
export const eraProgress = withProgressField('eraProgress');
export const sessionProgress = withProgressField('sessionProgress');
export const eraLength = /*#__PURE__*/ withProgressField('eraLength');
export const eraProgress = /*#__PURE__*/ withProgressField('eraProgress');
export const sessionProgress = /*#__PURE__*/ withProgressField('sessionProgress');
2 changes: 1 addition & 1 deletion packages/api-derive/src/staking/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function accounts (instanceId: string, api: DeriveApi): (accountIds: (Uin
/**
* @description From a stash, retrieve the controllerId and fill in all the relevant staking details
*/
export const account = firstMemo(
export const account = /*#__PURE__*/ firstMemo(
(api: DeriveApi, accountId: Uint8Array | string, opts?: StakingQueryFlags) =>
api.derive.staking.accounts([accountId], opts)
);
6 changes: 3 additions & 3 deletions packages/api-derive/src/staking/erasExposure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ export function _eraExposure (instanceId: string, api: DeriveApi): (era: EraInde
});
}

export const eraExposure = singleEra('_eraExposure');
export const _erasExposure = combineEras('_eraExposure');
export const erasExposure = erasHistoricApply('_erasExposure');
export const eraExposure = /*#__PURE__*/ singleEra('_eraExposure');
export const _erasExposure = /*#__PURE__*/ combineEras('_eraExposure');
export const erasExposure = /*#__PURE__*/ erasHistoricApply('_erasExposure');
2 changes: 1 addition & 1 deletion packages/api-derive/src/staking/erasPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export function _erasPoints (instanceId: string, api: DeriveApi): (eras: EraInde
});
}

export const erasPoints = erasHistoricApply('_erasPoints');
export const erasPoints = /*#__PURE__*/ erasHistoricApply('_erasPoints');
6 changes: 3 additions & 3 deletions packages/api-derive/src/staking/erasPrefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ export function _eraPrefs (instanceId: string, api: DeriveApi): (era: EraIndex,
});
}

export const eraPrefs = singleEra('_eraPrefs');
export const _erasPrefs = combineEras('_eraPrefs');
export const erasPrefs = erasHistoricApply('_erasPrefs');
export const eraPrefs = /*#__PURE__*/ singleEra('_eraPrefs');
export const _erasPrefs = /*#__PURE__*/ combineEras('_eraPrefs');
export const erasPrefs = /*#__PURE__*/ erasHistoricApply('_erasPrefs');
2 changes: 1 addition & 1 deletion packages/api-derive/src/staking/erasRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export function _erasRewards (instanceId: string, api: DeriveApi): (eras: EraInd
});
}

export const erasRewards = erasHistoricApply('_erasRewards');
export const erasRewards = /*#__PURE__*/ erasHistoricApply('_erasRewards');
6 changes: 3 additions & 3 deletions packages/api-derive/src/staking/erasSlashes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ export function _eraSlashes (instanceId: string, api: DeriveApi): (era: EraIndex
});
}

export const eraSlashes = singleEra('_eraSlashes');
export const _erasSlashes = combineEras('_eraSlashes');
export const erasSlashes = erasHistoricApply('_erasSlashes');
export const eraSlashes = /*#__PURE__*/ singleEra('_eraSlashes');
export const _erasSlashes = /*#__PURE__*/ combineEras('_eraSlashes');
export const erasSlashes = /*#__PURE__*/ erasHistoricApply('_erasSlashes');
2 changes: 1 addition & 1 deletion packages/api-derive/src/staking/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function extractsIds (stashId: Uint8Array | string, queuedKeys: [AccountId, Kitc
};
}

export const keys = firstMemo(
export const keys = /*#__PURE__*/ firstMemo(
(api: DeriveApi, stashId: Uint8Array | string) =>
api.derive.staking.keysMulti([stashId])
);
Expand Down
4 changes: 2 additions & 2 deletions packages/api-derive/src/staking/ownExposure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export function _ownExposures (instanceId: string, api: DeriveApi): (accountId:
);
}

export const ownExposure = firstMemo(
export const ownExposure = /*#__PURE__*/ firstMemo(
(api: DeriveApi, accountId: Uint8Array | string, era: EraIndex) =>
api.derive.staking._ownExposures(accountId, [era], true)
);

export const ownExposures = erasHistoricApplyAccount('_ownExposures');
export const ownExposures = /*#__PURE__*/ erasHistoricApplyAccount('_ownExposures');
Loading

0 comments on commit a370450

Please sign in to comment.