Skip to content

Commit

Permalink
Bump common
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Aug 18, 2023
1 parent 94794ec commit d23c0a7
Show file tree
Hide file tree
Showing 18 changed files with 907 additions and 658 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2023 @polkadot/tools authors & contributors
// Copyright 2018-2023 @polkadot/api-cli authors & contributors
// SPDX-License-Identifier: Apache-2.0

module.exports = require('@polkadot/dev/config/prettier.cjs');
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2023 @polkadot/dev authors & contributors
// Copyright 2017-2023 @polkadot/api-cli authors & contributors
// SPDX-License-Identifier: Apache-2.0

import baseConfig from '@polkadot/dev/config/eslint';
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
"test": "yarn run:api --help && yarn run:json --help && yarn run:metadata --help && yarn run:monitor --help && yarn run:signer --help && yarn run:vanity --help"
},
"devDependencies": {
"@polkadot/dev": "^0.75.26",
"@polkadot/dev": "^0.76.15",
"@types/node": "^20.4.0",
"@types/yargs": "^17.0.24"
},
"resolutions": {
"@polkadot/api": "^10.9.1",
"@polkadot/api-derive": "^10.9.1",
"@polkadot/keyring": "^12.3.2",
"@polkadot/keyring": "^12.4.1",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/util": "^12.4.1",
"@polkadot/util-crypto": "^12.4.1",
"typescript": "^5.1.6"
}
}
6 changes: 3 additions & 3 deletions packages/api-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"dependencies": {
"@polkadot/api": "^10.9.1",
"@polkadot/api-augment": "^10.9.1",
"@polkadot/keyring": "^12.3.2",
"@polkadot/keyring": "^12.4.1",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/util": "^12.4.1",
"@polkadot/util-crypto": "^12.4.1",
"tslib": "^2.6.0",
"yargs": "^17.7.2"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/api-cli/src/runcli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ interface ApiCallFn {
}

// interface ApiExtSection
interface ApiExtSection {
[index: string]: {
[index: string]: ApiCallFn;
};
}
type ApiExtSection = Record<string, Record<string, ApiCallFn>>;

// extend our API definition to know about how we decorate the methods - we are really hacking
// into the API definitions here a bit since we want to dynamically access the endpoints
Expand Down Expand Up @@ -222,6 +218,10 @@ function logDetails ({ fn: { description, meta }, method, section }: CallInfo):
if (description) {
console.log(description);
} else if (meta) {
// We actually override all toString() methods inside the API, so this
// is safe, aka won't display `[Object object]`
//
// eslint-disable-next-line @typescript-eslint/no-base-to-string
meta.docs.forEach((d) => console.log(d.toString()));
} else {
console.log('No documentation available');
Expand Down
2 changes: 1 addition & 1 deletion packages/json-serve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@polkadot/api-augment": "^10.9.1",
"@polkadot/api-derive": "^10.9.1",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util": "^12.4.1",
"koa": "^2.14.2",
"koa-route": "^3.2.0",
"tslib": "^2.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/json-serve/src/runcli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { hideBin } from 'yargs/helpers';
import { ApiPromise, WsProvider } from '@polkadot/api';
import { BN } from '@polkadot/util';

type ArgV = { port: number; ws: string };
interface ArgV { port: number; ws: string }

const { port, ws } = yargs(hideBin(process.argv))
.options({
Expand Down
4 changes: 2 additions & 2 deletions packages/metadata-cmp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
},
"dependencies": {
"@polkadot/api": "^10.9.1",
"@polkadot/keyring": "^12.3.2",
"@polkadot/keyring": "^12.4.1",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util": "^12.4.1",
"tslib": "^2.6.0",
"yargs": "^17.7.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/metadata-cmp/src/runcli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getSiName } from '@polkadot/types/metadata/util';
import { unwrapStorageType } from '@polkadot/types/util';
import { assert, stringCamelCase } from '@polkadot/util';

type ArgV = { _: [string, string] };
interface ArgV { _: [string, string] }

const [ws1, ws2] = (yargs(hideBin(process.argv)).demandCommand(2).argv as unknown as ArgV)._;

Expand Down
2 changes: 1 addition & 1 deletion packages/monitor-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"@polkadot/api": "^10.9.1",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util": "^12.4.1",
"koa": "^2.14.2",
"koa-route": "^3.2.0",
"tslib": "^2.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/monitor-rpc/src/runcli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ApiPromise, WsProvider } from '@polkadot/api';

const MAX_ELAPSED = 60000;

type ArgV = { port: number; ws: string };
interface ArgV { port: number; ws: string }

const { port, ws } = yargs(hideBin(process.argv))
.options({
Expand Down
6 changes: 3 additions & 3 deletions packages/signer-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"dependencies": {
"@polkadot/api": "^10.9.1",
"@polkadot/api-cli": "^0.55.4-0-x",
"@polkadot/keyring": "^12.3.2",
"@polkadot/keyring": "^12.4.1",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/util": "^12.4.1",
"@polkadot/util-crypto": "^12.4.1",
"tslib": "^2.6.0",
"yargs": "^17.7.2"
},
Expand Down
12 changes: 8 additions & 4 deletions packages/signer-cli/src/runcli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import cmdSubmit from './cmdSubmit.js';
const BLOCKTIME = 6;
const ONE_MINUTE = 60 / BLOCKTIME;

type ArgV = { _: string[]; account?: string; blocks?: number; minutes?: number; nonce?: number; params?: string; seed?: string; type?: string; ws?: string; tx?: string; };
interface ArgV { _: string[]; account?: string; blocks?: number; minutes?: number; nonce?: number; params?: string; seed?: string; type?: string; ws?: string; tx?: string; }

const { _: [command, ...paramsInline], account, blocks, minutes, nonce, params: paramsFile, seed, tx, type, ws } = yargs(hideBin(process.argv))
.usage('Usage: [options] <endpoint> <...params>')
Expand Down Expand Up @@ -84,11 +84,15 @@ async function main (): Promise<void> {
? minutes * ONE_MINUTE
: blocks;

if (!account) {
throw new Error('No account has been specified, unable to sign');
}

return command === 'sign'
? cmdSign(account as string, seed, type as 'ed25519', params)
? cmdSign(account, seed, type as 'ed25519', params)
: command === 'submit'
? cmdSubmit(account as string, mortality, ws, tx, params)
: cmdSendOffline(account as string, mortality, ws, nonce, params);
? cmdSubmit(account, mortality, ws, tx, params)
: cmdSendOffline(account, mortality, ws, nonce, params);
}

process.on('unhandledRejection', (error): void => {
Expand Down
2 changes: 1 addition & 1 deletion packages/signer-cli/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { assert } from '@polkadot/util';
export function getTx (api: ApiPromise, name: string): SubmittableExtrinsicFunction<'promise'> {
const [section, method] = name.split('.');

assert(api.tx[section] && api.tx[section][method], `Unable to find method ${section}.${method}`);
assert(api.tx[section]?.[method], `Unable to find method ${section}.${method}`);

return api.tx[section][method];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/vanitygen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"polkadot-js-vanitygen": "./runcli.mjs"
},
"dependencies": {
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/util": "^12.4.1",
"@polkadot/util-crypto": "^12.4.1",
"tslib": "^2.6.0",
"yargs": "^17.7.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vanitygen/src/runcli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Best extends GeneratorMatch {
withCase?: boolean;
}

type ArgV = { match: string; mnemonic: boolean; network: string; type: string; withCase: boolean };
interface ArgV { match: string; mnemonic: boolean; network: string; type: string; withCase: boolean }

const { match, mnemonic, network, type, withCase } = yargs(hideBin(process.argv))
.wrap(120)
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"@polkadot/monitor-rpc": ["monitor-rpc/src/index.ts"],
"@polkadot/monitor-rpc/*": ["monitor-rpc/src/*.ts"],
"@polkadot/signer-cli": ["signer-cli/src/index.ts"],
"@polkadot/signer-cli/*": ["signer-cli/src/*.ts"]
"@polkadot/signer-cli/*": ["signer-cli/src/*.ts"],
"@polkadot/vanitygen": ["vanitygen/src/index.ts"]
}
}
}
Loading

0 comments on commit d23c0a7

Please sign in to comment.