Bump common (#1563)

This commit is contained in:
Jaco Greeff
2019-11-11 11:34:08 +01:00
committed by GitHub
parent 8ea07727ba
commit f080d6ed1c
11 changed files with 47 additions and 49 deletions
+1 -1
View File
@@ -32,6 +32,6 @@
"@polkadot/types": "^0.97.0-beta.0"
},
"devDependencies": {
"@polkadot/keyring": "^1.7.0-beta.5"
"@polkadot/keyring": "^1.7.0-beta.6"
}
}
+2 -2
View File
@@ -41,7 +41,7 @@ export function indexes (api: ApiInterfaceRx): () => Observable<AccountIndexes>
api.query.indices.enumSet.multi([...Array(next.toNumber() + 1).keys()]) as Observable<any>
),
map((all: (AccountId[] | undefined)[]): AccountIndexes =>
(all || []).reduce((result, list, outerIndex): AccountIndexes => {
(all || []).reduce((result: AccountIndexes, list, outerIndex): AccountIndexes => {
(list || []).forEach((accountId, innerIndex): void => {
// re-create the index based on position 0 is [0][0] and likewise
// 64 (0..63 in first) is [1][0] (the first index value in set 2)
@@ -51,7 +51,7 @@ export function indexes (api: ApiInterfaceRx): () => Observable<AccountIndexes>
});
return result;
}, {} as AccountIndexes)),
}, {})),
drr()
);
}
+12 -12
View File
@@ -4,7 +4,7 @@
import { ApiInterfaceRx } from '@polkadot/api/types';
import { AccountId, AccountIndex, Address, Balance } from '@polkadot/types/interfaces';
import { Codec } from '@polkadot/types/types';
import { ITuple } from '@polkadot/types/types';
import { DeriveAccountInfo } from '../types';
import { Observable, combineLatest, of } from 'rxjs';
@@ -15,17 +15,17 @@ import { u8aToString } from '@polkadot/util';
import { drr } from '../util';
function retrieveNick (api: ApiInterfaceRx, accountId?: AccountId): Observable<string | undefined> {
return accountId && api.query.nicks
? api.query.nicks
.nameOf<Option<[Bytes, Balance] & Codec>>(accountId)
.pipe(
map((nameOf): string | undefined =>
nameOf?.isSome
? u8aToString(nameOf.unwrap()[0]).substr(0, (api.consts.nicks.maxLength as u32).toNumber())
: undefined
)
)
: of(undefined);
return ((
accountId && api.query.nicks
? api.query.nicks.nameOf<Option<ITuple<[Bytes, Balance]>>>(accountId)
: of(undefined)
) as Observable<Option<ITuple<[Bytes, Balance]>> | undefined>).pipe(
map((nameOf): string | undefined =>
nameOf?.isSome
? u8aToString(nameOf.unwrap()[0]).substr(0, (api.consts.nicks.maxLength as u32).toNumber())
: undefined
)
);
}
/**
+3 -3
View File
@@ -28,10 +28,10 @@
"dependencies": {
"@babel/runtime": "^7.7.1",
"@polkadot/types": "^0.97.0-beta.0",
"@polkadot/util": "^1.7.0-beta.5",
"@polkadot/util-crypto": "^1.7.0-beta.5"
"@polkadot/util": "^1.7.0-beta.6",
"@polkadot/util-crypto": "^1.7.0-beta.6"
},
"devDependencies": {
"@polkadot/keyring": "^1.7.0-beta.5"
"@polkadot/keyring": "^1.7.0-beta.6"
}
}
+3 -3
View File
@@ -29,13 +29,13 @@
"@babel/runtime": "^7.7.1",
"@polkadot/api-derive": "^0.97.0-beta.0",
"@polkadot/api-metadata": "^0.97.0-beta.0",
"@polkadot/keyring": "^1.7.0-beta.5",
"@polkadot/keyring": "^1.7.0-beta.6",
"@polkadot/rpc-core": "^0.97.0-beta.0",
"@polkadot/rpc-provider": "^0.97.0-beta.0",
"@polkadot/types": "^0.97.0-beta.0",
"@polkadot/util-crypto": "^1.7.0-beta.5"
"@polkadot/util-crypto": "^1.7.0-beta.6"
},
"devDependencies": {
"@polkadot/keyring": "^1.7.0-beta.5"
"@polkadot/keyring": "^1.7.0-beta.6"
}
}
+2 -4
View File
@@ -30,7 +30,7 @@ try {
function assertResult<T> (value: T | undefined): T {
assert(!isUndefined(value), 'Api needs to be initialized before using, listen on \'ready\'');
return value as T;
return value;
}
export default abstract class ApiBase<ApiType extends ApiTypes> extends Init<ApiType> {
@@ -265,9 +265,7 @@ export default abstract class ApiBase<ApiType extends ApiTypes> extends Init<Api
public async sign (signer: KeyringSigner | string, data: SignerPayloadRawBase): Promise<string> {
// NOTE Do we really want to do this? Or turn it into an observable for rxjs?
if (isString(signer)) {
if (!this._rx.signer || !this._rx.signer.signRaw) {
throw new Error('No signer exists with a signRaw interface');
}
assert(this._rx.signer?.signRaw, 'No signer exists with a signRaw interface');
return (
await this._rx.signer.signRaw({
+1 -1
View File
@@ -30,7 +30,7 @@
"@polkadot/jsonrpc": "^0.97.0-beta.0",
"@polkadot/rpc-provider": "^0.97.0-beta.0",
"@polkadot/types": "^0.97.0-beta.0",
"@polkadot/util": "^1.7.0-beta.5",
"@polkadot/util": "^1.7.0-beta.6",
"rxjs": "^6.5.3"
}
}
+3 -3
View File
@@ -28,14 +28,14 @@
"dependencies": {
"@babel/runtime": "^7.7.1",
"@polkadot/api-metadata": "^0.97.0-beta.0",
"@polkadot/util": "^1.7.0-beta.5",
"@polkadot/util-crypto": "^1.7.0-beta.5",
"@polkadot/util": "^1.7.0-beta.6",
"@polkadot/util-crypto": "^1.7.0-beta.6",
"eventemitter3": "^4.0.0",
"isomorphic-fetch": "^2.2.1",
"websocket": "^1.0.30"
},
"devDependencies": {
"@polkadot/keyring": "^1.7.0-beta.5",
"@polkadot/keyring": "^1.7.0-beta.6",
"mock-socket": "^9.0.2",
"nock": "^11.4.0"
}
+3 -3
View File
@@ -27,12 +27,12 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.7.1",
"@polkadot/util": "^1.7.0-beta.5",
"@polkadot/util-crypto": "^1.7.0-beta.5",
"@polkadot/util": "^1.7.0-beta.6",
"@polkadot/util-crypto": "^1.7.0-beta.6",
"@types/memoizee": "^0.4.3",
"memoizee": "^0.4.14"
},
"devDependencies": {
"@polkadot/keyring": "^1.7.0-beta.5"
"@polkadot/keyring": "^1.7.0-beta.6"
}
}
@@ -25,13 +25,13 @@ import { getTypeRegistry } from './registry';
function getSubDefArray (value: TypeDef): TypeDef[] {
assert(value.sub && Array.isArray(value.sub), `Expected subtype as TypeDef[] in ${JSON.stringify(value)}`);
return value.sub as TypeDef[];
return value.sub;
}
function getSubDef (value: TypeDef): TypeDef {
assert(value.sub && !Array.isArray(value.sub), `Expected subtype as TypeDef in ${JSON.stringify(value)}`);
return value.sub as TypeDef;
return value.sub;
}
function getSubType (value: TypeDef): InterfaceTypes {
+15 -15
View File
@@ -1865,14 +1865,14 @@
typescript "^3.7.2"
vuepress "^1.2.0"
"@polkadot/keyring@^1.7.0-beta.5":
version "1.7.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-1.7.0-beta.5.tgz#8502e6d4375badffb520064c7adb6539621de0f7"
integrity sha512-RoU6+ypGeSFArHWufLCpC9UhnHSHA94HjpCYvmbHkGU1nqMPGhHkszVvvuZ2b9D/Z5U28/N5rRQQS02nu943rQ==
"@polkadot/keyring@^1.7.0-beta.6":
version "1.7.0-beta.6"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-1.7.0-beta.6.tgz#c5ae5d684e2cee0037b68d381707f33b35c975eb"
integrity sha512-wSMAn7ZOHEKa+bW2h0K1fM1dNr5LCarCSY3JiPPyNxoY4+M1WtqGm0fU+A5+FLXOnXXJywrPkeripakaLXMocw==
dependencies:
"@babel/runtime" "^7.7.1"
"@polkadot/util" "^1.7.0-beta.5"
"@polkadot/util-crypto" "^1.7.0-beta.5"
"@polkadot/util" "^1.7.0-beta.6"
"@polkadot/util-crypto" "^1.7.0-beta.6"
"@polkadot/ts@^0.1.84":
version "0.1.84"
@@ -1881,13 +1881,13 @@
dependencies:
"@types/chrome" "^0.0.91"
"@polkadot/util-crypto@^1.7.0-beta.5":
version "1.7.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-1.7.0-beta.5.tgz#5c21c6cb714b4c5169ffa0b1404ce1442800b17a"
integrity sha512-EbaSjLlBYVxg2YKbelWUf6/HiVtSmmYky8YAI1v7c4x+WwnPPIo3eEgj3G/r1Cjyw0vmwoZXhRgrdKzXECyPoA==
"@polkadot/util-crypto@^1.7.0-beta.6":
version "1.7.0-beta.6"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-1.7.0-beta.6.tgz#48161cdc6fe06002aedbe5806ab241cfb4bac3bb"
integrity sha512-QXXJLhv/4YmCRSWGEjTghFq/FmVkejIokgVn71PUMqOx2/0H+9jgaMv9DCZC1UfrP8h4f4sPBSP9AKnHbNTs6w==
dependencies:
"@babel/runtime" "^7.7.1"
"@polkadot/util" "^1.7.0-beta.5"
"@polkadot/util" "^1.7.0-beta.6"
"@polkadot/wasm-crypto" "^0.14.1"
"@types/bip39" "^2.4.2"
"@types/bs58" "^4.0.0"
@@ -1903,10 +1903,10 @@
tweetnacl "^1.0.1"
xxhashjs "^0.2.2"
"@polkadot/util@^1.7.0-beta.5":
version "1.7.0-beta.5"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-1.7.0-beta.5.tgz#88643e004ad887de72535262c9a6ca7cf56536b3"
integrity sha512-07EVqjLGRS01CvMpqGc0GxPEO1ok6jUO1h2hUJ/RoLaf8KfS/EPxP1cYvzWCBm5upvriHe18GwEGHRZI6oAuyg==
"@polkadot/util@^1.7.0-beta.6":
version "1.7.0-beta.6"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-1.7.0-beta.6.tgz#82712376f2b999f079f4021c5ec08d4a8f0a57cd"
integrity sha512-QyOz5a0DaK7FMN+GtE7nOHO1JgOmPf5RcPcA3pXsEQgpIFlx8pctU18kXI2uY/Q+124rV8OECM7IVMaypJeNnA==
dependencies:
"@babel/runtime" "^7.7.1"
"@types/bn.js" "^4.11.5"