Skip to content

Commit

Permalink
type-def and augument-api updates
Browse files Browse the repository at this point in the history
  • Loading branch information
smohan-dw authored and amarts committed Dec 1, 2023
1 parent 423e8b0 commit 548617e
Show file tree
Hide file tree
Showing 30 changed files with 1,411 additions and 1,531 deletions.
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "yarn workspaces foreach -Apt --exclude '{root-workspace}' run build",
"build:docs": "typedoc --skipErrorChecking --theme default --out docs/api --tsconfig tsconfig.docs.json && touch docs/.nojekyll",
"bundle": "yarn workspace @cord.network/sdk run bundle",
"clean": "rimraf tests/dist && yarn workspaces foreach -p --exclude '{root-workspace}' run clean",
"clean": "rimraf tests/dist && yarn workspaces foreach -Ap --exclude '{root-workspace}' run clean",
"clean:docs": "rimraf docs/api",
"func-test": "tsx --no-cache demo/src/func-test.ts",
"set:version": "yarn workspaces foreach -pt exec npm version --no-git-tag-version",
Expand Down Expand Up @@ -61,10 +61,20 @@
"ts-jest-resolver": "^2.0.1",
"tsx": "^3.4.3",
"typedoc": "^0.25.3",
"typescript": "^5.2.2"
"typescript": "^5.1.6"
},
"resolutions": {
"typescript": "5.2.2"
"typescript": "5.1.6",
"@polkadot/api": "10.10.1",
"@polkadot/keyring": "12.4.1",
"@polkadot/types": "10.10.1",
"@polkadot/types-codec": "10.10.1",
"@polkadot/typegen": "10.10.1",
"@polkadot/util": "12.4.1",
"@polkadot/util-crypto": "12.4.1",
"@polkadot/rpc-augment": "10.10.1",
"@polkadot/rpc-core": "10.10.1",
"@polkadot/rpc-provider": "10.10.1"
},
"version": "0.8.0-7",
"packageManager": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion packages/augment-api/metadata/cord.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions packages/augment-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,32 @@
"build:types": "yarn generate:defs && yarn generate:meta && yarn build:fixes",
"build:fixes": "node scripts/fixTypes.mjs",
"build:ts": "tsc -p tsconfig.build.json",
"generate:defs": "ts-node --esm -P tsconfig.build.json ../../node_modules/.bin/polkadot-types-from-defs --package @cord.network/augment-api --input ./src/interfaces --endpoint ./metadata/cord.json",
"generate:meta": "ts-node --esm -P tsconfig.build.json ../../node_modules/.bin/polkadot-types-from-chain --package @cord.network/augment-api --endpoint ./metadata/cord.json --output ./src/interfaces",
"generate:defs": "ts-node --experimental-specifier-resolution=node --esm -P tsconfig.build.json ../../node_modules/.bin/polkadot-types-from-defs --package @cord.network/augment-api --input ./src/interfaces --endpoint ./metadata/cord.json",
"generate:meta": "ts-node --experimental-specifier-resolution=node --esm -P tsconfig.build.json ../../node_modules/.bin/polkadot-types-from-chain --package @cord.network/augment-api --endpoint ./metadata/cord.json --output ./src/interfaces --strict",
"update-metadata": "node ./scripts/fetchMetadata.cjs -o './metadata/cord.json' -e 'wss://staging.cord.network/'"
},
"repository": "github:dhiway/cord.js",
"engines": {
"node": ">=20.0"
"node": ">=18.0"
},
"author": "Dhiway <[email protected]>",
"license": "Apache-2.0",
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"@polkadot/api": "^10.11.0",
"@polkadot/typegen": "^10.11.0",
"@polkadot/api": "^10.10.1",
"@polkadot/typegen": "^10.10.1",
"@types/node": "^20.8.4",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"typescript": "^5.1.6",
"yargs": "^16.2.0"
},
"dependencies": {
"@cord.network/type-definitions": "workspace:*",
"@polkadot/rpc-augment": "10.11.1",
"@polkadot/rpc-core": "10.11.1",
"@polkadot/rpc-provider": "10.11.1",
"@polkadot/rpc-augment": "^10.10.1",
"@polkadot/rpc-core": "^10.10.1",
"@polkadot/rpc-provider": "^10.10.1",
"glob": "^7.1.1"
}
}
100 changes: 6 additions & 94 deletions packages/augment-api/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ import '@polkadot/api-base/types/consts';

import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
import type { u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';

export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;

declare module '@polkadot/api-base/types/consts' {
interface AugmentedConsts<ApiType extends ApiTypes> {
asset: {
maxAssetDistribution: u32 & AugmentedConst<ApiType>;
maxEncodedValueLength: u32 & AugmentedConst<ApiType>;
};
babe: {
/**
* The amount of time, in slots, that each epoch should last.
Expand All @@ -37,10 +40,6 @@ declare module '@polkadot/api-base/types/consts' {
* The maximum number of nominators for each validator.
**/
maxNominators: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
balances: {
/**
Expand Down Expand Up @@ -71,28 +70,16 @@ declare module '@polkadot/api-base/types/consts' {
* The maximum number of named reserves that can exist on an account.
**/
maxReserves: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
chainSpace: {
maxSpaceDelegates: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
council: {
/**
* The maximum weight of a dispatch call that can be proposed and
* executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
did: {
/**
Expand Down Expand Up @@ -142,10 +129,6 @@ declare module '@polkadot/api-base/types/consts' {
* Should be greater than `MaxNewKeyAgreementKeys`.
**/
maxTotalKeyAgreementKeys: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
didName: {
/**
Expand All @@ -160,10 +143,6 @@ declare module '@polkadot/api-base/types/consts' {
* The min encoded length of a name.
**/
minNameLength: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
grandpa: {
/**
Expand All @@ -183,20 +162,12 @@ declare module '@polkadot/api-base/types/consts' {
* can be zero.
**/
maxSetIdSessionEntries: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
identifier: {
/**
* The maximum number of activity for a statement.
**/
maxEventsHistory: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
identity: {
/**
Expand All @@ -210,10 +181,6 @@ declare module '@polkadot/api-base/types/consts' {
* the complexity of, e.g., updating judgements.
**/
maxRegistrars: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
imOnline: {
/**
Expand All @@ -223,20 +190,12 @@ declare module '@polkadot/api-base/types/consts' {
* multiple pallets send unsigned transactions.
**/
unsignedPriority: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
indices: {
/**
* The deposit needed for reserving an index.
**/
deposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
mixnet: {
/**
Expand Down Expand Up @@ -285,10 +244,6 @@ declare module '@polkadot/api-base/types/consts' {
* Priority of unsigned transactions used to register mixnodes.
**/
registrationPriority: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
multisig: {
/**
Expand All @@ -310,10 +265,6 @@ declare module '@polkadot/api-base/types/consts' {
* The maximum amount of signatories allowed in the multisig.
**/
maxSignatories: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
networkMembership: {
maxMembersPerBlock: u32 & AugmentedConst<ApiType>;
Expand All @@ -322,10 +273,6 @@ declare module '@polkadot/api-base/types/consts' {
* blocks)
**/
membershipPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
nodeAuthorization: {
/**
Expand All @@ -340,10 +287,6 @@ declare module '@polkadot/api-base/types/consts' {
* The maximum number of well known nodes that are allowed to set
**/
maxWellKnownNodes: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
scheduler: {
/**
Expand All @@ -358,24 +301,13 @@ declare module '@polkadot/api-base/types/consts' {
* higher limit under `runtime-benchmarks` feature.
**/
maxScheduledPerBlock: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
schema: {
maxEncodedSchemaLength: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
score: {
valueLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
maxEncodedValueLength: u32 & AugmentedConst<ApiType>;
maxRatingValue: u32 & AugmentedConst<ApiType>;
};
statement: {
/**
Expand All @@ -386,10 +318,6 @@ declare module '@polkadot/api-base/types/consts' {
* Maximum removals per call
**/
maxRemoveEntries: u16 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
system: {
/**
Expand Down Expand Up @@ -420,21 +348,13 @@ declare module '@polkadot/api-base/types/consts' {
* Get the chain's current version.
**/
version: SpVersionRuntimeVersion & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
technicalCommittee: {
/**
* The maximum weight of a dispatch call that can be proposed and
* executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
Expand All @@ -446,20 +366,12 @@ declare module '@polkadot/api-base/types/consts' {
* period on default settings.
**/
minimumPeriod: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
utility: {
/**
* The limit on the number of batched calls.
**/
batchedCallsLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
} // AugmentedConsts
} // declare module
Loading

0 comments on commit 548617e

Please sign in to comment.