Skip to content

Commit

Permalink
Update polkadot/api to 11.0.1 (#532)
Browse files Browse the repository at this point in the history
* Update polkadot/api to 11.0.1

* Fix staking derive
  • Loading branch information
TarikGul authored Apr 23, 2024
1 parent 2662a1f commit 26cf474
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 183 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"@types/yargs": "^17.0.32"
},
"resolutions": {
"@polkadot/api": "^10.13.1",
"@polkadot/api-derive": "^10.13.1",
"@polkadot/api": "^11.0.1",
"@polkadot/api-derive": "^11.0.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/types": "^10.13.1",
"@polkadot/types": "^11.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"typescript": "^5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/api-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"polkadot-js-api": "./runcli.mjs"
},
"dependencies": {
"@polkadot/api": "^10.13.1",
"@polkadot/api-augment": "^10.13.1",
"@polkadot/api": "^11.0.1",
"@polkadot/api-augment": "^11.0.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/types": "^10.13.1",
"@polkadot/types": "^11.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"tslib": "^2.6.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/json-serve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"polkadot-js-json-serve": "./runcli.mjs"
},
"dependencies": {
"@polkadot/api": "^10.13.1",
"@polkadot/api-augment": "^10.13.1",
"@polkadot/api-derive": "^10.13.1",
"@polkadot/types": "^10.13.1",
"@polkadot/api": "^11.0.1",
"@polkadot/api-augment": "^11.0.1",
"@polkadot/api-derive": "^11.0.1",
"@polkadot/types": "^11.0.1",
"@polkadot/util": "^12.6.2",
"koa": "^2.14.2",
"koa-route": "^3.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/json-serve/src/runcli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ function percentageFormat (top: BN, bottom: BN): string {
}

function onElectedInfo (info: DeriveStakingElected): void {
totalBonded = info.info.reduce((totalBonded, { exposure }): BN => {
return totalBonded.add(exposure?.total.unwrap() || new BN(0));
totalBonded = info.info.reduce((totalBonded, { exposurePaged }): BN => {
return totalBonded.add((exposurePaged.isSome && exposurePaged?.unwrap().pageTotal.unwrap()) || new BN(0));
}, new BN(0));
}

Expand Down Expand Up @@ -116,7 +116,7 @@ async function main (): Promise<void> {

await api.rpc.chain.subscribeNewHeads(onNewHead);
await api.query.balances.totalIssuance(onTotalInsurance);
await api.derive.staking.electedInfo(undefined, onElectedInfo);
await api.derive.staking.electedInfo(undefined, undefined, onElectedInfo);
}

process.on('unhandledRejection', (error): void => {
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 @@ -21,9 +21,9 @@
"polkadot-js-metadata-cmp": "./runcli.mjs"
},
"dependencies": {
"@polkadot/api": "^10.13.1",
"@polkadot/api": "^11.0.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/types": "^10.13.1",
"@polkadot/types": "^11.0.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2",
"yargs": "^17.7.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/monitor-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"polkadot-js-monitor": "./runcli.mjs"
},
"dependencies": {
"@polkadot/api": "^10.13.1",
"@polkadot/types": "^10.13.1",
"@polkadot/api": "^11.0.1",
"@polkadot/types": "^11.0.1",
"@polkadot/util": "^12.6.2",
"koa": "^2.14.2",
"koa-route": "^3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/signer-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"polkadot-js-signer": "./runcli.mjs"
},
"dependencies": {
"@polkadot/api": "^10.13.1",
"@polkadot/api": "^11.0.1",
"@polkadot/api-cli": "^0.56.7",
"@polkadot/keyring": "^12.6.2",
"@polkadot/types": "^10.13.1",
"@polkadot/types": "^11.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"tslib": "^2.6.2",
Expand Down
Loading

0 comments on commit 26cf474

Please sign in to comment.