Document getters and functions for all types (static missing) (#431)

* Document getters and functions for all types (static missing)

* Update SignedBlock.ts

* Bump @polkadot/dev, introduce @noInheritDoc

* Text inherits from String

* Link to indv. types from README

* Add base to UInt toString
This commit is contained in:
Jaco Greeff
2018-12-03 15:47:22 +01:00
committed by GitHub
parent f1df2f7c75
commit a7b177d7dd
41 changed files with 704 additions and 83 deletions
+3 -3
View File
@@ -10,7 +10,7 @@
],
"resolutions": {
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.1.6"
"typescript": "^3.2.1"
},
"scripts": {
"build": "polkadot-dev-build-ts && yarn run build:methodsdoc && polkadot-dev-build-docs",
@@ -24,7 +24,7 @@
},
"devDependencies": {
"@babel/core": "^7.1.6",
"@polkadot/dev": "^0.22.5",
"@polkadot/ts": "^0.1.39"
"@polkadot/dev": "^0.22.6",
"@polkadot/ts": "^0.1.40"
}
}
+1 -1
View File
@@ -33,6 +33,6 @@
"@polkadot/jsonrpc": "^0.32.17",
"@polkadot/rpc-provider": "^0.32.17",
"@polkadot/types": "^0.32.17",
"@polkadot/util": "^0.33.6"
"@polkadot/util": "^0.33.7"
}
}
+3 -3
View File
@@ -30,10 +30,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.1.5",
"@polkadot/keyring": "^0.33.6",
"@polkadot/keyring": "^0.33.7",
"@polkadot/storage": "^0.32.17",
"@polkadot/util": "^0.33.6",
"@polkadot/util-crypto": "^0.33.6",
"@polkadot/util": "^0.33.7",
"@polkadot/util-crypto": "^0.33.7",
"@types/nock": "^9.3.0",
"eventemitter3": "^3.1.0",
"isomorphic-fetch": "^2.2.1",
+1 -1
View File
@@ -12,6 +12,6 @@
"dependencies": {
"@babel/runtime": "^7.1.5",
"@polkadot/types": "^0.32.17",
"@polkadot/util": "^0.33.6"
"@polkadot/util": "^0.33.7"
}
}
+3 -3
View File
@@ -30,9 +30,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-storage#readme",
"dependencies": {
"@babel/runtime": "^7.1.5",
"@polkadot/keyring": "^0.33.6",
"@polkadot/keyring": "^0.33.7",
"@polkadot/types": "^0.32.17",
"@polkadot/util": "^0.33.6",
"@polkadot/util-crypto": "^0.33.6"
"@polkadot/util": "^0.33.7",
"@polkadot/util-crypto": "^0.33.7"
}
}
+8
View File
@@ -1,3 +1,11 @@
# @polkadot/types
Implementation of the types and their (de-)serialisation via [parity-codec](https://github.com/paritytech/parity-codec).
## Substrate types
These types implement specific types that are found as part of the Substrate base: [[AccountId]], [[AccountIndex]], [[Address]], [[AuthorityId]], [[Balance]], [[Block]], [[BlockNumber]], [[Bool]], [[Bytes]], [[Data]], [[Digest]], [[Event]], [[EventRecord]], [[Extrinsic]], [[Extrinsics]], [[ExtrinsicEra]], [[ExtrinsicSignature]], [[ExtrinsicStatus]], [[Gas]], [[H256]], [[H512]], [[Hash]], [[Header]], [[Justification]], [[KeyValue]], [[Metadata]], [[Method]], [[MisbehaviorReport]], [[Moment]], [[NewAccountOutcome]], [[Nonce]], [[Null]], [[Origin]], [[ParachainId]], [[PendingExtrinsics]], [[Perbill]], [[Permill]], [[PropIndex]], [[Proposal]], [[ProposalIndex]], [[ReferendumIndex]], [[RuntimeVersion]], [[SessionKey]], [[Signature]], [[SignaturePayload]], [[SignedBlock]], [[StorageChangeSet]], [[StorageData]], [[StorageKey]], [[StoredPendingChange]], [[Text]], [[Type]], [[U8]], [[U16]], [[U32]], [[U64]], [[U128]], [[U256]], [[ValidatorPrefs]], [[VoteIndex]], [[VoteThreshold]]
## Codec types
These are the base types of the codec, typically not used directly, but rather inherited from to create specific types: [[Base]], [[Compact]], [[Enum]], [[EnumType]], [[Option]], [[Set]], [[Struct]], [[Tuple]], [[U8a]], [[U8aFixed]], [[UInt]], [[Vector]]
+2 -2
View File
@@ -30,7 +30,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.1.5",
"@polkadot/keyring": "^0.33.6",
"@polkadot/util": "^0.33.6"
"@polkadot/keyring": "^0.33.7",
"@polkadot/util": "^0.33.7"
}
}
+6
View File
@@ -40,10 +40,16 @@ export default class AccountId extends U8aFixed {
return value;
}
/**
* @description Converts the Object to JSON, typically used for RPC transfers
*/
toJSON (): any {
return this.toString();
}
/**
* @description Returns the string representation of the value
*/
toString (): string {
return AccountId.encode(this);
}
+18 -2
View File
@@ -86,26 +86,42 @@ export default class AccountIndex extends U32 {
}
}
/**
* @description Returns the BN representation of the AccountIndex
*/
toBn (): BN {
return new BN(this);
}
// Like in our decoding function, we explicitly override this to allow us to output
// LE-hex encoded numbers (generally UInt in JSON are expected as BE, these LE)
/**
* @description Returns a hex string representation of the value
*/
toHex (): string {
// Like in our decoding function, we explicitly override this to allow us to output
// LE-hex encoded numbers (generally UInt in JSON are expected as BE, these LE)
return u8aToHex(this.toU8a());
}
/**
* @description Converts the Object to JSON, typically used for RPC transfers
*/
toJSON (): any {
return this.toString();
}
/**
* @description Returns the string representation of the value
*/
toString (): string {
const length = AccountIndex.calcLength(this);
return encodeAddress(this.toU8a().subarray(0, length));
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
// HACK 15 Oct 2018 For isBare assume that we are dealing with an AccountIndex
// lookup (it is the only place where AccountIndex is used in such a manner to
+19
View File
@@ -61,6 +61,9 @@ export default class Address extends Base<AccountId | AccountIndex> {
: new AccountIndex(u8aToBn(decoded, true));
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
const rawLength = this.rawLength;
@@ -72,24 +75,40 @@ export default class Address extends Base<AccountId | AccountIndex> {
);
}
/**
* @description The length of the raw value, either AccountIndex or AccountId
*/
get rawLength (): number {
return this.raw instanceof AccountIndex
? AccountIndex.calcLength(this.raw)
: this.raw.encodedLength;
}
/**
* @description Returns a hex string representation of the value
*/
toHex (): string {
return u8aToHex(this.toU8a());
}
/**
* @description Converts the Object to JSON, typically used for RPC transfers
*/
toJSON (): any {
return this.raw.toJSON();
}
/**
* @description Returns the string representation of the value
*/
toString (): string {
return this.raw.toString();
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
const encoded = this.raw.toU8a().subarray(0, this.rawLength);
+12
View File
@@ -28,10 +28,16 @@ export class BftAuthoritySignature extends Tuple {
}, value);
}
/**
* @description The wrapped [[AuthoriyId]]
*/
get authorityId (): AuthorityId {
return this.getAtIndex(0) as AuthorityId;
}
/**
* @description The wrapped [[Signature]] value
*/
get signature (): Signature {
return this.getAtIndex(1) as Signature;
}
@@ -56,10 +62,16 @@ export class BftHashSignature extends Tuple {
}, value);
}
/**
* @description The wrapped [[Hash]]
*/
get hash (): Hash {
return this.getAtIndex(0) as Hash;
}
/**
* @description The wrapped [[Signature]]
*/
get signature (): Signature {
return this.getAtIndex(1) as Signature;
}
+9 -1
View File
@@ -29,17 +29,25 @@ export default class Block extends Struct {
}, value);
}
/**
* @description The [[Extrinsics]] conatined in the block
*/
get extrinsics (): Extrinsics {
return this.get('extrinsics') as Extrinsics;
}
// convenience, encodes the header and returns the actual hash
/**
* @description Coinvenience getter, encoded the [[Hash]] for the block
*/
get hash (): Hash {
return new Hash(
blake2AsU8a(this.toU8a(), 256)
);
}
/**
* @description The [[Header]] in the block
*/
get header (): Header {
return this.get('header') as Header;
}
+22 -5
View File
@@ -9,7 +9,8 @@ import { Codec } from './types';
/**
* @name Bool
* @description
* Representation for a boolean value in the system
* Representation for a boolean value in the system. It extends the base JS `Boolean` class
* @noInheritDoc
*/
export default class Bool extends Boolean implements Codec {
constructor (value: Bool | Boolean | Uint8Array | boolean | number = false) {
@@ -28,22 +29,38 @@ export default class Bool extends Boolean implements Codec {
return !!value;
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
return 1;
}
toJSON (): any {
return this.valueOf();
}
/**
* @description Returns a hex string representation of the value
*/
toHex (): string {
return u8aToHex(this.toU8a());
}
/**
* @description Converts the Object to JSON, typically used for RPC transfers
*/
toJSON (): any {
return this.valueOf();
}
/**
* @description Returns the string representation of the value
*/
toString (): string {
return `${this.toJSON()}`;
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
return new Uint8Array([this ? 1 : 0]);
}
+7
View File
@@ -58,10 +58,17 @@ export default class Bytes extends U8a {
return value;
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
return this.length + Compact.encodeU8a(this.length).length;
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
return isBare
? super.toU8a(isBare)
+9
View File
@@ -49,10 +49,16 @@ export class Seal extends Tuple {
}, value);
}
/**
* @description The wrapped [[Signature]]
*/
get signature (): Signature {
return this.get('signature') as Signature;
}
/**
* @description The wrapped [[U64]] slot
*/
get slot (): U64 {
return this.get('slot') as U64;
}
@@ -87,6 +93,9 @@ export default class Digest extends Struct {
}, value);
}
/**
* @description The [[DigestItem]] logs
*/
get logs (): Vector<DigestItem> {
return this.get('logs') as Vector<DigestItem>;
}
+30
View File
@@ -34,18 +34,30 @@ export class EventData extends Tuple {
this._typeDef = typeDef;
}
/**
* @description The wrapped [[EventMetadata]]
*/
get meta (): EventMetadata {
return this._meta;
}
/**
* @description The method as a string
*/
get method (): string {
return this._method;
}
/**
* @description The section as a string
*/
get section (): string {
return this._section;
}
/**
* @description The [[TypeDef]] for this event
*/
get typeDef (): Array<TypeDef> {
return this._typeDef;
}
@@ -123,26 +135,44 @@ export default class Event extends Struct {
});
}
/**
* @description The wrapped [[EventData]]
*/
get data (): EventData {
return this.get('data') as EventData;
}
/**
* @description The [[EventIndex]], identifying the raw event
*/
get index (): EventIndex {
return this.get('index') as EventIndex;
}
/**
* @description The [[EventMetadata]] with the documentation
*/
get meta (): EventMetadata {
return this.data.meta;
}
/**
* @description The method string identifying the event
*/
get method (): string {
return this.data.method;
}
/**
* @description The section string identifying the event
*/
get section (): string {
return this.data.section;
}
/**
* @description The [[TypeDef]] for the event
*/
get typeDef (): Array<TypeDef> {
return this.data.typeDef;
}
+6
View File
@@ -52,10 +52,16 @@ export default class EventRecord extends Struct {
}, value);
}
/**
* @description The [[Event]] this record refers to
*/
get event (): Event {
return this.get('event') as Event;
}
/**
* @description The [[Phase]] where the event was generated
*/
get phase (): Phase {
return this.get('phase') as Phase;
}
+46 -3
View File
@@ -63,73 +63,116 @@ export default class Extrinsic extends Struct {
return value as any;
}
// expose args so it is compatible with Method (as constructor value)
/**
* @description The arguments passed to for the call, exposes args so it is compatible with [[Method]]
*/
get args (): Array<Codec> {
return this.method.args;
}
// the actual [sectionIndex, methodIndex] as used
/**
* @description The actual `[sectionIndex, methodIndex]` as used in the Method
*/
get callIndex (): Uint8Array {
return this.method.callIndex;
}
/**
* @description The actual data for the Method
*/
get data (): Uint8Array {
return this.method.data;
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
const length = this.length;
return length + Compact.encodeU8a(length).length;
}
// convernience, encodes the extrinsic and returns the actual hash
/**
* @description Convernience function, encodes the extrinsic and returns the actual hash
*/
get hash (): Hash {
return new Hash(
blake2AsU8a(this.toU8a(), 256)
);
}
/**
* @description `true` id the extrinsic is signed
*/
get isSigned (): boolean {
return this.signature.isSigned;
}
/**
* @description The length of the encoded value
*/
get length (): number {
return this.toU8a(true).length;
}
/**
* @description The [[FunctionMetadata]] that describes the extrinsic
*/
get meta (): FunctionMetadata {
return this.method.meta;
}
/**
* @description The [[Method]] this extrinsic wraps
*/
get method (): Method {
return this.get('method') as Method;
}
/**
* @description The [[ExtrinsicSignature]]
*/
get signature (): ExtrinsicSignature {
return this.get('signature') as ExtrinsicSignature;
}
/**
* @description Add an [[ExtrinsicSignature]] to the extrinsic (already generated)
*/
addSignature (signer: Address | Uint8Array, signature: Uint8Array, nonce: AnyNumber, era?: Uint8Array): Extrinsic {
this.signature.addSignature(signer, signature, nonce, era);
return this;
}
/**
* @description Sign the extrinsic with a specific keypair
*/
sign (signerPair: KeyringPair, nonce: AnyNumber, blockHash: AnyU8a, era?: Uint8Array): Extrinsic {
this.signature.sign(this.method, signerPair, nonce, blockHash, era);
return this;
}
/**
* @description Returns a hex string representation of the value
*/
toHex (): string {
return u8aToHex(this.toU8a());
}
/**
* @description Converts the Object to JSON, typically used for RPC transfers
*/
toJSON (): any {
return this.toHex();
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
const encoded = super.toU8a();
+31
View File
@@ -65,6 +65,9 @@ export default class ExtrinsicSignature extends Struct {
return value as any;
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
// version has 1 byte, signature takes the rest
return 1 + (
@@ -74,26 +77,44 @@ export default class ExtrinsicSignature extends Struct {
);
}
/**
* @description `true` if the signature is valid
*/
get isSigned (): boolean {
return this.signature.length !== 0;
}
/**
* @description The [[ExtrinsicEra]] (mortal or immortal) this signature applies to
*/
get era (): ExtrinsicEra {
return this.get('era') as ExtrinsicEra;
}
/**
* @description The [[Nonce]] for the signature
*/
get nonce (): Nonce {
return this.get('nonce') as Nonce;
}
/**
* @description The actuall [[Signature]] hash
*/
get signature (): Signature {
return this.get('signature') as Signature;
}
/**
* @description The [[Address]] that signed
*/
get signer (): Address {
return this.get('signer') as Address;
}
/**
* @description The encoded version for the signature
*/
get version (): number {
// Version Information.
// 1 byte: version information:
@@ -115,6 +136,9 @@ export default class ExtrinsicSignature extends Struct {
return this;
}
/**
* @description Adds a raw signature
*/
addSignature (_signer: Address | Uint8Array, _signature: Uint8Array, _nonce: AnyNumber, _era: Uint8Array = IMMORTAL_ERA): ExtrinsicSignature {
const signer = new Address(_signer);
const nonce = new Nonce(_nonce);
@@ -124,6 +148,9 @@ export default class ExtrinsicSignature extends Struct {
return this.injectSignature(signature, signer, nonce, era);
}
/**
* @description Generate a payload and pplies the signature from a keypair
*/
sign (method: Method, signerPair: KeyringPair, nonce: AnyNumber, blockHash: AnyU8a, era: Uint8Array = IMMORTAL_ERA): ExtrinsicSignature {
const signer = new Address(signerPair.publicKey());
const signingPayload = new SignaturePayload({
@@ -137,6 +164,10 @@ export default class ExtrinsicSignature extends Struct {
return this.injectSignature(signature, signer, signingPayload.nonce, signingPayload.era);
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
return u8aConcat(
new Uint8Array([this.version]),
+18 -1
View File
@@ -37,29 +37,46 @@ export default class Header extends Struct {
}, value);
}
/**
* @description The wrapped [[BlockNumber]]
*/
get blockNumber (): BlockNumber {
return (this.get('number') as Compact).toBn() as BlockNumber;
}
/**
* @description The wrapped [[Digest]]
*/
get digest (): Digest {
return this.get('digest') as Digest;
}
/**
* @description The wrapped extrisics root as a [[Hash]]
*/
get extrinsicsRoot (): Hash {
return this.get('extrinsicsRoot') as Hash;
}
// convenience, encodes the header and returns the actual hash
/**
* @description Convenience method, encodes the header and calculates the [[Hash]]
*/
get hash (): Hash {
return new Hash(
blake2AsU8a(this.toU8a(), 256)
);
}
/**
* @description The wrapped parent as a [[Hash]]
*/
get parentHash (): Hash {
return this.get('parentHash') as Hash;
}
/**
* @description The wrapped state root as a [[Hash]]
*/
get stateRoot (): Hash {
return this.get('stateRoot') as Hash;
}
+9
View File
@@ -41,14 +41,23 @@ export class RhdJustification extends Struct {
]));
}
/**
* @description The justification [[Hash]]
*/
get hash (): Hash {
return this.get('hash') as Hash;
}
/**
* @description The round this justification wraps as a [[U32]]
*/
get roundNumber (): U32 {
return this.get('roundNumber') as U32;
}
/**
* @description The [[BftAuthoritySignature]] array
*/
get signatures (): Vector<BftAuthoritySignature> {
return this.get('signatures') as Vector<BftAuthoritySignature>;
}
+12
View File
@@ -31,10 +31,16 @@ export default class KeyValue extends Struct {
}, value);
}
/**
* @description The [[StorageKey]]
*/
get key (): StorageKey {
return this.get('key') as StorageKey;
}
/**
* @description The [[StorageData]]
*/
get value (): StorageData {
return this.get('value') as StorageData;
}
@@ -60,10 +66,16 @@ export class KeyValueOption extends Tuple {
}, value);
}
/**
* @description The [[StorageKey]]
*/
get key (): StorageKey {
return this.getAtIndex(0) as StorageKey;
}
/**
* @description The [[Option]] [[StorageData]]
*/
get value (): Option<StorageData> {
return this.getAtIndex(1) as Option<StorageData>;
}
+123 -1
View File
@@ -47,14 +47,23 @@ export class OuterDispatchCall extends Struct {
}, value);
}
/**
* @description The [[U16]] index for the call
*/
get index (): U16 {
return this.get('index') as U16;
}
/**
* @description The name for the call
*/
get name (): Text {
return this.get('name') as Text;
}
/**
* @description The call prefix (or section)
*/
get prefix (): Text {
return this.get('prefix') as Text;
}
@@ -68,10 +77,16 @@ export class OuterDispatchMetadata extends Struct {
}, value);
}
/**
* @description The [[OuterDispathCall]] wrapped
*/
get calls (): Vector<OuterDispatchCall> {
return this.get('calls') as Vector<OuterDispatchCall>;
}
/**
* @description The name for the dispatch
*/
get name (): Text {
return this.get('name') as Text;
}
@@ -86,14 +101,23 @@ export class EventMetadata extends Struct {
}, value);
}
/**
* @description The arguments of [[Type]]
*/
get arguments (): Vector<Type> {
return this.get('arguments') as Vector<Type>;
}
/**
* @description The [[Text]] documentation
*/
get documentation (): Vector<Text> {
return this.get('documentation') as Vector<Text>;
}
/**
* @description The name for the event
*/
get name (): Text {
return this.get('name') as Text;
}
@@ -107,10 +131,16 @@ export class OuterEventMetadataEvent extends Tuple {
}, value);
}
/**
* @description The [[EventMetadata]]
*/
get events (): Vector<EventMetadata> {
return this.getAtIndex(1) as Vector<EventMetadata>;
}
/**
* @description The name of the section
*/
get name (): Text {
return this.getAtIndex(0) as Text;
}
@@ -124,10 +154,16 @@ export class OuterEventMetadata extends Struct {
}, value);
}
/**
* @description The [[OuterEventMetadataEvent]]
*/
get events (): Vector<OuterEventMetadataEvent> {
return this.get('events') as Vector<OuterEventMetadataEvent>;
}
/**
* @description The name of the event
*/
get name (): Text {
return this.get('name') as Text;
}
@@ -141,10 +177,16 @@ export class FunctionArgumentMetadata extends Struct {
}, value);
}
/**
* @description The argument name
*/
get name (): Text {
return this.get('name') as Text;
}
/**
* @description The [[Type]]
*/
get type (): Type {
return this.get('type') as Type;
}
@@ -160,18 +202,30 @@ export class FunctionMetadata extends Struct {
}, value);
}
/**
* @description The [[FunctionArgumentMetadata]] for arguments
*/
get arguments (): Vector<FunctionArgumentMetadata> {
return this.get('arguments') as Vector<FunctionArgumentMetadata>;
}
/**
* @description The [[Text]] documentation
*/
get documentation (): Vector<Text> {
return this.get('documentation') as Vector<Text>;
}
/**
* @description The `[sectionIndex, methodIndex]` call id
*/
get id (): U16 {
return this.get('id') as U16;
}
/**
* @description The call name
*/
get name (): Text {
return this.get('name') as Text;
}
@@ -185,10 +239,16 @@ export class CallMetadata extends Struct {
}, value);
}
/**
* @description The functions available as [[FunctionMetadata]]
*/
get functions (): Vector<FunctionMetadata> {
return this.get('functions') as Vector<FunctionMetadata>;
}
/**
* @description The section name
*/
get name (): Text {
return this.get('name') as Text;
}
@@ -202,10 +262,16 @@ export class ModuleMetadata extends Struct {
}, value);
}
/**
* @description The calls as [[CallMetadata]]
*/
get call (): CallMetadata {
return this.get('call') as CallMetadata;
}
/**
* @description The name
*/
get name (): Text {
return this.get('name') as Text;
}
@@ -225,10 +291,16 @@ export class StorageFunctionType$Map extends Struct {
}, value);
}
/**
* @description The mapped key as [[Type]]
*/
get key (): Type {
return this.get('key') as Type;
}
/**
* @description The mapped value as [[Type]]
*/
get value (): Type {
return this.get('value') as Type;
}
@@ -242,18 +314,30 @@ export class StorageFunctionType extends EnumType<Type | StorageFunctionType$Map
], value, index);
}
/**
* @description `true` if the storage entry is a map
*/
get isMap (): boolean {
return this.toNumber() === 1;
}
/**
* @description The value as a mapped value
*/
get asMap (): StorageFunctionType$Map {
return this.value as StorageFunctionType$Map;
}
/**
* @description The value as a [[Type]] value
*/
get asType (): Type {
return this.value as Type;
}
/**
* @description Returns the string representation of the value
*/
toString (): string {
return this.isMap
? this.asMap.value.toString()
@@ -278,18 +362,30 @@ export class StorageFunctionMetadata extends Struct {
}, value);
}
/**
* @description The [[Text]] documentation
*/
get documentation (): Vector<Text> {
return this.get('documentation') as Vector<Text>;
}
/**
* @description The key name
*/
get name (): Text {
return this.get('name') as Text;
}
/**
* @description The modifier
*/
get modifier (): StorageFunctionModifier {
return this.get('modifier') as StorageFunctionModifier;
}
/**
* @description The [[StorageFunctionType]]
*/
get type (): StorageFunctionType {
return this.get('type') as StorageFunctionType;
}
@@ -303,10 +399,16 @@ export class StorageMetadata extends Struct {
}, value);
}
/**
* @description The [[StorageFunctionMetadata]] for the section
*/
get functions (): Vector<StorageFunctionMetadata> {
return this.get('functions') as Vector<StorageFunctionMetadata>;
}
/**
* @description The section prefix
*/
get prefix (): Text {
return this.get('prefix') as Text;
}
@@ -321,14 +423,23 @@ export class RuntimeModuleMetadata extends Struct {
}, value);
}
/**
* @description The [[ModuleMetadata]]
*/
get module (): ModuleMetadata {
return this.get('module') as ModuleMetadata;
}
/**
* @description The prefix
*/
get prefix (): Text {
return this.get('prefix') as Text;
}
/**
* @description The optional [[StorageMetadata]]
*/
get storage (): Option<StorageMetadata> {
return this.get('storage') as Option<StorageMetadata>;
}
@@ -370,19 +481,30 @@ export default class RuntimeMetadata extends Struct {
return value;
}
/**
* @description Wrapped [[OuterDispatchCall]]
*/
get calls (): Vector<OuterDispatchCall> {
return (this.get('outerDispatch') as OuterDispatchMetadata).calls;
}
/**
* @description Wrapped [[OuterEventMetadataEvent]]
*/
get events (): Vector<OuterEventMetadataEvent> {
return (this.get('outerEvent') as OuterEventMetadata).events;
}
/**
* @description Wrapped [[RuntimeModuleMetadata]]
*/
get modules (): Vector<RuntimeModuleMetadata> {
return this.get('modules') as Vector<RuntimeModuleMetadata>;
}
// Helper to retrieve a list of all type that are found, sorted and de-deuplicated
/**
* @description Helper to retrieve a list of all type that are found, sorted and de-deuplicated
*/
getUniqTypes (): Array<string> {
const events = this.events.map((module) =>
module.events.map((event) =>
+21 -1
View File
@@ -50,7 +50,12 @@ export interface Extrinsics {
const extrinsicFns: { [index: string]: ExtrinsicFunction } = {};
class MethodIndex extends U8aFixed {
/**
* @name MethodIndex
* @description
* A wrapper around the `[sectionIndex, methodIndex]` value that uniquely identifies a method
*/
export class MethodIndex extends U8aFixed {
constructor (value?: AnyU8a) {
super(value, 16);
}
@@ -185,23 +190,38 @@ export default class Method extends Struct {
);
}
/**
* @description The arguments for the function call
*/
get args (): Array<Codec> {
// FIXME This should return a Struct instead of an Array
return [...(this.get('args') as Struct).values()];
}
/**
* @description Thge argument defintions
*/
get argsDef (): ArgsDef {
return Method.getArgsDef(this.meta);
}
/**
* @description The encoded `[sectionIndex, methodIndex]` identifier
*/
get callIndex (): Uint8Array {
return (this.get('callIndex') as MethodIndex).toU8a();
}
/**
* @description The encoded data
*/
get data (): Uint8Array {
return (this.get('args') as Struct).toU8a();
}
/**
* @description The [[FunctionMetadata]]
*/
get meta (): FunctionMetadata {
return this._meta;
}
+27
View File
@@ -39,14 +39,23 @@ export class BftAtReport extends Struct {
}, value);
}
/**
* @description The first report [[BftHashSignature]]
*/
get a (): BftHashSignature {
return this.get('a') as BftHashSignature;
}
/**
* @description The second report [[BftHashSignature]]
*/
get b (): BftHashSignature {
return this.get('b') as BftHashSignature;
}
/**
* @description The round this report applies to as [[U32]]
*/
get round (): U32 {
return this.get('round') as U32;
}
@@ -65,10 +74,16 @@ export class BftProposeOutOfTurn extends Struct {
}, value);
}
/**
* @description The [[BftHashSignature]] the report applies to
*/
get a (): BftHashSignature {
return this.get('a') as BftHashSignature;
}
/**
* @description The round as [[u32]]
*/
get round (): U32 {
return this.get('round') as U32;
}
@@ -136,18 +151,30 @@ export default class MisbehaviorReport extends Struct {
}, value);
}
/**
* @description The [[MisbehaviorKind]]
*/
get misbehavior (): MisbehaviorKind {
return this.get('misbehavior') as MisbehaviorKind;
}
/**
* @description The [[Hash]] of the parent block
*/
get parentHash (): Hash {
return this.get('parentHash') as Hash;
}
/**
* @description The [[BlockNumber]] of the parent
*/
get parentNumber (): BlockNumber {
return this.get('parentNumber') as BlockNumber;
}
/**
* @description The [[authorityId]] the report applies to
*/
get target (): AuthorityId {
return this.get('target') as AuthorityId;
}
+35 -3
View File
@@ -15,11 +15,13 @@ const BITLENGTH: UIntBitLength = 64;
* @description
* A wrapper around seconds/timestamps. Internally the representation only has
* second precicion (aligning with Rust), so any numbers passed an/out are always
* per-second. For any encoding/decoding the 1000 multiplier would be applied to
* get it in line with JavaScript formats
* per-second. For any encoding/decoding the 1000 multiplier would be applied to
* get it in line with JavaScript formats. It extends the base JS `Date` object
* and has all the methods available that are applicable to any `Date`
* @noInheritDoc
*/
export default class Moment extends Date implements Codec {
public raw: Date; // FIXME Remove this once we convert all types out of Base
protected raw: Date; // FIXME Remove this once we convert all types out of Base
constructor (value: Moment | Date | AnyNumber = 0) {
super(
@@ -43,30 +45,60 @@ export default class Moment extends Date implements Codec {
);
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
return BITLENGTH / 8;
}
/**
* @description Returns the number of bits in the value
*/
bitLength (): UIntBitLength {
return BITLENGTH;
}
/**
* @description Returns the BN representation of the timestamp
*/
toBn (): BN {
return new BN(this.toNumber());
}
/**
* @description Returns a hex string representation of the value
*/
toHex (): string {
return bnToHex(this.toBn(), BITLENGTH);
}
/**
* @description Converts the Object to JSON, typically used for RPC transfers
*/
toJSON (): any {
return this.toNumber();
}
/**
* @description Returns the number representation for the timestamp
*/
toNumber (): number {
return Math.ceil(this.getTime() / 1000);
}
/**
* @description Returns the string representation of the value
*/
toString (): string {
// only included here since we do not inherit docs
return super.toString();
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
return bnToU8a(this.toNumber(), BITLENGTH, true);
}
+1 -1
View File
@@ -11,5 +11,5 @@ import U64 from './U64';
* with extrinsics to determine the order of execution. implemented as a Substrate
* [[U64]]
*/
export default class Index extends U64 {
export default class Nonce extends U64 {
}
+6
View File
@@ -10,10 +10,16 @@ import { Codec } from './types';
* Implements a type that does not contain anything (apart from `null`)
*/
export default class Null implements Codec {
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
return 0;
}
/**
* @description Returns a hex string representation of the value
*/
toHex (): string {
return '0x';
}
+24
View File
@@ -40,10 +40,16 @@ export class RuntimeVersionApi extends Tuple {
}, value);
}
/**
* @description The [[ApiId]]
*/
get id (): ApiId {
return this.getAtIndex(0) as ApiId;
}
/**
* @description The specific version as [[U32]]
*/
get version (): U32 {
return this.getAtIndex(1) as U32;
}
@@ -81,26 +87,44 @@ export default class RuntimeVersion extends Struct {
]));
}
/**
* @description The available APIs as [[RuntimeVersionApi]]
*/
get apis (): Vector<RuntimeVersionApi> {
return this.get('apis') as Vector<RuntimeVersionApi>;
}
/**
* @description The authoring version as [[U32]]
*/
get authoringVersion (): U32 {
return this.get('authoringVersion') as U32;
}
/**
* @description The implementation name
*/
get implName (): Text {
return this.get('implName') as Text;
}
/**
* @description The implementation version
*/
get implVersion (): U32 {
return this.get('implVersion') as U32;
}
/**
* @description The specification name
*/
get specName (): Text {
return this.get('specName') as Text;
}
/**
* @description The specification version
*/
get specVersion (): U32 {
return this.get('specVersion') as U32;
}
+21
View File
@@ -41,26 +41,44 @@ export default class SignaturePayload extends Struct {
}, value);
}
/**
* @description `true` if the payload refers to a valid signature
*/
get isSigned (): boolean {
return !!(this._signature && this._signature.length === 64);
}
/**
* @description The block [[Hash]] the signature applies to (mortal/immortal)
*/
get blockHash (): Hash {
return this.get('blockHash') as Hash;
}
/**
* @description The [[Method]] contained in the payload
*/
get method (): Method {
return this.get('method') as Method;
}
/**
* @description The [[ExtrinsicEra]]
*/
get era (): ExtrinsicEra {
return this.get('era') as ExtrinsicEra;
}
/**
* @description The [[Nonce]]
*/
get nonce (): Nonce {
return this.get('nonce') as Nonce;
}
/**
* @description The raw signature as a `Uint8Array`
*/
get signature (): Uint8Array {
if (!this.isSigned) {
throw new Error('Transaction is not signed');
@@ -69,6 +87,9 @@ export default class SignaturePayload extends Struct {
return this._signature as Uint8Array;
}
/**
* @description Sign the payload with the keypair
*/
sign (signerPair: KeyringPair): Uint8Array {
this._signature = signerPair.sign(this.toU8a());
+6
View File
@@ -26,10 +26,16 @@ export default class SignedBlock extends Struct {
}, value);
}
/**
* @description The wrapped [[Block]]
*/
get block (): Block {
return this.get('block') as Block;
}
/**
* @description The wrapped [[Justification]]
*/
get justification (): Justification {
return this.get('justification') as Justification;
}
+6
View File
@@ -29,10 +29,16 @@ export default class StorageChangeSet extends Struct {
}, value);
}
/**
* @description The applicable changes as [[KeyValueOption]]
*/
get changes (): Vector<KeyValueOption> {
return this.get('changes') as Vector<KeyValueOption>;
}
/**
* @description The block [[Hash]]
*/
get block (): Hash {
return this.get('block') as Hash;
}
+3
View File
@@ -60,6 +60,9 @@ export default class StorageKey extends Bytes {
return null;
}
/**
* @description The output type, `null` when not available
*/
get outputType (): string | null {
return this._outputType;
}
+32 -1
View File
@@ -11,7 +11,9 @@ import Compact from './codec/Compact';
* @name Text
* @description
* This is a string wrapper, along with the length. It is used both for strings as well
* as items such as documentation.
* as items such as documentation. It simply extends the standard JS `String` built-in
* object, inheriting all methods exposed from `String`.
* @noInheritDoc
*/
// TODO
// - Strings should probably be trimmed (docs do come through with extra padding)
@@ -39,18 +41,47 @@ export default class Text extends String implements Codec {
return `${value}`;
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
return this.length + Compact.encodeU8a(this.length).length;
}
/**
* @description The length of the value
*/
get length (): number {
// only included here since we ignore inherited docs
return super.length;
}
/**
* @description Returns a hex string representation of the value
*/
toHex (): string {
return u8aToHex(this.toU8a());
}
/**
* @description Converts the Object to JSON, typically used for RPC transfers
*/
toJSON (): any {
return this.toString();
}
/**
* @description Returns the string representation of the value
*/
toString (): string {
// only included here since we do not inherit docs
return super.toString();
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
const encoded = stringToU8a(this.toString());
+7
View File
@@ -61,6 +61,9 @@ export default class Type extends Text {
}, value).trim();
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
get encodedLength (): number {
// NOTE Length is used in the decoding calculations, so return the original (pre-cleanup)
// length of the data. Since toU8a is disabled, this does not affect encoding, but rather
@@ -68,6 +71,10 @@ export default class Type extends Text {
return this._originalLength + Compact.encodeU8a(this._originalLength).length;
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
toU8a (isBare?: boolean): Uint8Array {
// Note Since we are mangling what we get in beyond recognition, we really should
// not allow the re-encoding. Additionally, this is probably more of a decoder-only
+6
View File
@@ -26,10 +26,16 @@ export default class ValidatorPrefs extends Struct {
}, value);
}
/**
* @description The unstake threshold as [[U32]]
*/
get unstakeThreshold (): U32 {
return this.get('unstakeThreshold') as U32;
}
/**
* @description The payment config for the validator as [[Balance]]
*/
get validatorPayment (): Balance {
return this.get('validatorPayment') as Balance;
}
+12
View File
@@ -14,6 +14,7 @@ import { Codec, Constructor, ConstructorDef } from '../types';
* values in the constructor and it manages the decoding. It is important that the constructor
* values matches 100% to the order in th Rust code, i.e. don't go crazy and make it alphabetical,
* it needs to decoded in the specific defined order.
* @noInheritDoc
*/
export default class Struct<
// The actual Class structure, i.e. key -> Class
@@ -126,6 +127,9 @@ export default class Struct<
};
}
/**
* @description Returns the Type description to sthe structure
*/
get Type (): E {
return this._Types;
}
@@ -139,6 +143,14 @@ export default class Struct<
}, 0);
}
/**
* @description Returns a specific names entry in the structure
* @param name The name of the entry to retrieve
*/
get (name: keyof S): Codec | undefined {
return super.get(name);
}
/**
* @description Returns the values of a member at a specific index (Rather use get(name) for performance)
*/
+14 -2
View File
@@ -13,6 +13,7 @@ import { AnyU8a, Codec } from '../types';
* from other implementations wher it will consume the full Uint8Array as passed to
* it. As such it is meant to be subclassed where the wrapper takes care of the
* actual lengths instead of used directly.
* @noInheritDoc
*/
export default class U8a extends Uint8Array implements Codec {
constructor (value: AnyU8a) {
@@ -36,8 +37,19 @@ export default class U8a extends Uint8Array implements Codec {
return this.length;
}
// Create a new subarray from the actual buffer. This is needed
// for compat reasons since a new Uint8Array gets returned here
/**
* @description The length of the value
*/
get length (): number {
// only included here since we ignore inherited docs
return super.length;
}
/**
* @description Create a new subarray from the actual buffer. This is needed for compat reasons since a new Uint8Array gets returned here
* @param begin The position to start at
* @param end The position to end at
*/
subarray (begin: number, end?: number): Uint8Array {
return Uint8Array.from(this).subarray(begin, end);
}
+12 -1
View File
@@ -16,7 +16,9 @@ export const DEFAULT_UINT_BITS = 64;
* @description
* A generic number codec. For Substrate all numbers are LE encoded, this handles the encoding
* and decoding of those numbers. Upon construction the bitLength is provided and any additional
* use keeps the number to this length.
* use keeps the number to this length. This extends `BN`, so all methods available on a normal
* `BN` object is available here.
* @noInheritDoc
*/
// TODO:
// - Apart from encoding/decoding we don't actually keep check on the sizes, is this good enough?
@@ -86,6 +88,15 @@ export default class UInt extends BN implements Codec {
: this.toNumber();
}
/**
* @description Returns the string representation of the value
* @param base The base to use for the conversion
*/
toString (base?: number): string {
// only included here since we do not inherit docs
return super.toString(base);
}
/**
* @description Encodes the value as a Uint8Array as per the parity-codec specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
+19
View File
@@ -13,6 +13,7 @@ import { Codec, Constructor } from '../types';
* This manages codec arrays. Intrernally it keeps track of the length (as decoded) and allows
* construction with the passed `Type` in the constructor. It is an extension to Array, providing
* specific encoding/decoding on top of the base type.
* @noInheritDoc
*/
export default class Vector<
T extends Codec
@@ -74,6 +75,14 @@ export default class Vector<
}, Compact.encodeU8a(this.length).length);
}
/**
* @description The length of the value
*/
get length (): number {
// only included here since we ignore inherited docs
return super.length;
}
/**
* @description Converts the Object to an standard JavaScript Array
*/
@@ -130,10 +139,20 @@ export default class Vector<
// we want it to return an Array. We only override the methods that return a
// new instance.
/**
* @description Filters the array with the callback
* @param callbackfn The filter function
* @param thisArg The `this` object to apply the result to
*/
filter (callbackfn: (value: T, index: number, array: Array<T>) => any, thisArg?: any): Array<T> {
return this.toArray().filter(callbackfn, thisArg);
}
/**
* @description Maps the array with the callback
* @param callbackfn The mapping function
* @param thisArg The `this` onject to apply the result to
*/
map<U> (callbackfn: (value: T, index: number, array: Array<T>) => U, thisArg?: any): Array<U> {
return this.toArray().map(callbackfn, thisArg);
}
+54 -48
View File
@@ -1140,10 +1140,10 @@
inquirer "^6.2.0"
npmlog "^4.1.2"
"@lerna/publish@^3.5.0":
version "3.5.0"
resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.5.0.tgz#e6543375457846557f3cb803f7795a577333a941"
integrity sha512-CoK+wzPP/0xG54Iwf9WEbB3VgwayoiVYsubhYpC072Ue7V6mGXQh97KZMm8NzCoMDg35ZGqa85Kxpeqd5hqQlw==
"@lerna/publish@^3.5.1":
version "3.5.1"
resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.5.1.tgz#20ea36e05a76755760b67c78719d424fc129f777"
integrity sha512-ltw2YdWWzev9cZRAzons5ywZh9NJARPX67meeA95oMDVMrhD4Y9VHQNJ3T8ueec/W78/4sKlMSr3ecWyPNp5bg==
dependencies:
"@lerna/batch-packages" "^3.1.2"
"@lerna/check-working-tree" "^3.5.0"
@@ -1307,10 +1307,10 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz#54c5a964462be3d4d78af631363c18d6fa91ac26"
integrity sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==
"@polkadot/dev@^0.22.5":
version "0.22.5"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.22.5.tgz#5eb3c7c0fb4aec1be330fbda487bed073282f967"
integrity sha512-hUF4nKB3t5sMzb2etEHWNIO67LivAjgFAkGsxoB95UwUlOlvqkCv3yexDYFLv6CYGQACXRDN7zywuNOIY4Miew==
"@polkadot/dev@^0.22.6":
version "0.22.6"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.22.6.tgz#96a0930815eb687a1050428f8951ac4ad53b3c81"
integrity sha512-+WSlRZ/CkCa582ETaCetpLWb9BzpZH+RVPdb9EH3jiYPm3w2XEAw3aXn2xGbMZOCH8fnEpAfHbmgITTcfldxyw==
dependencies:
"@babel/cli" "^7.1.5"
"@babel/core" "^7.1.6"
@@ -1323,7 +1323,7 @@
"@babel/register" "^7.0.0"
"@babel/runtime" "^7.1.5"
"@types/jest" "^23.3.10"
"@types/node" "^10.12.10"
"@types/node" "^10.12.11"
babel-core "^7.0.0-bridge.0"
babel-jest "^23.6.0"
babel-plugin-module-resolver "^3.1.1"
@@ -1338,7 +1338,7 @@
gitbook-plugin-mermaid-gb3 "^2.1.0"
gitbook-plugin-sunlight-highlighter "^0.4.3"
jest "^23.6.0"
lerna "^3.5.0"
lerna "^3.5.1"
makeshift "^1.1.0"
mkdirp "^0.5.1"
rimraf "^2.6.2"
@@ -1346,42 +1346,43 @@
tslint-config-standard "^8.0.1"
typedoc "^0.13.0"
typedoc-plugin-markdown "^1.1.19"
typescript "^3.1.6"
typedoc-plugin-no-inherit "^1.0.2"
typescript "^3.2.1"
"@polkadot/keyring@^0.33.6":
version "0.33.6"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.33.6.tgz#f15976d42c1e81c04911eb17f812a5a65105d4e0"
integrity sha512-EG/lzemE8hbKATFcm0gecCxqwoEU7F+gqQjfYDLI5q4ZX4EoJyrMAg34achik3OXZTiLSlSo2/7UomRPxhEbGw==
"@polkadot/keyring@^0.33.7":
version "0.33.7"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.33.7.tgz#800e4ceeb0ab0b2e8e911169628f473b0625605c"
integrity sha512-g4qn06nsnFpQv9w7DqfUpQLzf80wlnInAtFQ/aERCxlHmXcHRBBdil6V0GRZtvpUwHYDCQubzo1cTS8xThB2aQ==
dependencies:
"@babel/runtime" "^7.1.5"
"@polkadot/util" "^0.33.6"
"@polkadot/util-crypto" "^0.33.6"
"@polkadot/util" "^0.33.7"
"@polkadot/util-crypto" "^0.33.7"
"@types/bs58" "^3.0.30"
bs58 "^4.0.1"
"@polkadot/ts@^0.1.39":
version "0.1.39"
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.39.tgz#39d3578eaafd96cbc0270b1479fabab7e16e5723"
integrity sha512-NQM1uT+qi8onV0jtGjH7QmJvDTNFNYTEzjaoVZN2tDHi1/tVu1CP66qZGSGsS19JZJSK3ERSFb0vP8CkE7EUuA==
"@polkadot/ts@^0.1.40":
version "0.1.40"
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.40.tgz#d5e8af7e37a3382165d387c2cddf5930879a4c45"
integrity sha512-OKPToc6z4NnO+i6tNh0GewhFzQZFchn87Iv1IB1AXEqhzN3kRHlYWbnJh+iQ73C0zTwrx7BxmhMyv9pnEJScHQ==
"@polkadot/util-crypto@^0.33.6":
version "0.33.6"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.33.6.tgz#42d5b54b929293abb886deefe67e9e8313c5c276"
integrity sha512-lHU0Jz0nmEdR3mfBLgX2eHjiyJTmV2R379BH5dtJfvmj5auXq+Auxjs1u2qVqlsA6MCM6KaEZ3JDBPljQwC3fg==
"@polkadot/util-crypto@^0.33.7":
version "0.33.7"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.33.7.tgz#420d7c919feb0dd20b353051e033646582f98667"
integrity sha512-xUWGXOZ+4GKABpUjfIk5e4fIH7Ep+XmSTkB3iXUrdMLa1L6DQ2Jk1pX+R4flbNNvowcVgrXwJVTJj6FZ2+2l7A==
dependencies:
"@babel/runtime" "^7.1.5"
"@polkadot/util" "^0.33.6"
"@types/bip39" "^2.4.0"
"@polkadot/util" "^0.33.7"
"@types/bip39" "^2.4.1"
bip39 "^2.5.0"
blakejs "^1.1.0"
js-sha3 "^0.8.0"
tweetnacl "^1.0.0"
xxhashjs "^0.2.2"
"@polkadot/util@^0.33.6":
version "0.33.6"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.33.6.tgz#ffab3346892ce1b8f657ba6c9aa6902eded64a1c"
integrity sha512-dm3kHloH50ASB0n7q9wyawE/tzFnEBYfPRtb2PNstCZ8xJ28pT5VS36UYgjWI6WkkozKz+v8gqYf2qsk9uxz5A==
"@polkadot/util@^0.33.7":
version "0.33.7"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.33.7.tgz#3afd410c98c22d60c73784608037e6384a0b7986"
integrity sha512-5Y76R25Euk7z3VXjk/8xYUXw2l5VSB2WMOj+Iv8Koxi5H+iKWWdqsm8b+r0r9qeTAAvOBjAY12Jay5P8vAVY2A==
dependencies:
"@babel/runtime" "^7.1.5"
"@types/bn.js" "^4.11.3"
@@ -1401,10 +1402,10 @@
resolved "http://registry.npmjs.org/@types/base-x/-/base-x-1.0.29.tgz#8a2d73e4a5c3121757a5f8870cfa4509655186b6"
integrity sha1-ii1z5KXDEhdXpfiHDPpFCWVRhrY=
"@types/bip39@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/bip39/-/bip39-2.4.0.tgz#eee31a14abc8ebbb41a1ff14575c447b18346cbc"
integrity sha512-qxJBGh55SPbSGv+91D6H3WOR8vKdA/p8Oc58oK/DTbORgjO6Ebuo8MRzdy2OWi+dw/lxtX4VWJkkCUTSQvhAnw==
"@types/bip39@^2.4.1":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@types/bip39/-/bip39-2.4.1.tgz#1a47b453b59a50d7b5856819b834c74798915eb3"
integrity sha512-QHx0qI6JaTIW/S3zxE/bXrwOWu6Boos+LZ4438xmFAHY5k+qHkExMdAnb/DENEt2RBnOdZ6c5J+SHrnLEhUohQ==
dependencies:
"@types/node" "*"
@@ -1500,10 +1501,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235"
integrity sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==
"@types/node@^10.12.10":
version "10.12.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.10.tgz#4fa76e6598b7de3f0cb6ec3abacc4f59e5b3a2ce"
integrity sha512-8xZEYckCbUVgK8Eg7lf5Iy4COKJ5uXlnIOnePN0WUwSQggy9tolM+tDJf7wMOnT/JT/W9xDYIaYggt3mRV2O5w==
"@types/node@^10.12.11":
version "10.12.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.11.tgz#715c476c99a5f6898a1ae61caf9825e43c03912e"
integrity sha512-3iIOhNiPGTdcUNVCv9e5G7GotfvJJe2pc9w2UgDXlUwnxSZ3RgcUocIU+xYm+rTU54jIKih998QE4dMOyMN1NQ==
"@types/rx-core-binding@*":
version "4.0.4"
@@ -5685,10 +5686,10 @@ left-pad@^1.3.0:
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==
lerna@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.5.0.tgz#fd989b8992701e90e10aa5b3970d6f7a3512ba64"
integrity sha512-12kZb2yCJtx3rhLycepzHTbR6suqLaqky2hSldGQh9+B7FXFgvbQJXwzoi+Y7+1cstmKHHyockdRYFLiLmiEYA==
lerna@^3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.5.1.tgz#350b24b58fc2d7bc2c1e1f4ef3058afe827cfa68"
integrity sha512-0AyxMr2UpR3RAJsyrfNtYvfcI01YVSSnbRdzum7frZAtb7S+8NSY2ip7aDbN6/YsQK2K/zOCQ4shu/nwgub8aw==
dependencies:
"@lerna/add" "^3.5.0"
"@lerna/bootstrap" "^3.5.0"
@@ -5702,7 +5703,7 @@ lerna@^3.5.0:
"@lerna/init" "^3.5.0"
"@lerna/link" "^3.5.0"
"@lerna/list" "^3.5.0"
"@lerna/publish" "^3.5.0"
"@lerna/publish" "^3.5.1"
"@lerna/run" "^3.5.0"
"@lerna/version" "^3.5.0"
import-local "^1.0.0"
@@ -9046,6 +9047,11 @@ typedoc-plugin-markdown@^1.1.19:
dependencies:
turndown "^5.0.1"
typedoc-plugin-no-inherit@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/typedoc-plugin-no-inherit/-/typedoc-plugin-no-inherit-1.0.2.tgz#d2dff762395eb66d38f47a99dab8d2a1e7838b11"
integrity sha512-+fRnc8sWLzO2wjPuJT09vUOBmGt7pDE5JJuyJ2FVG79rCBUHUChUt/8/j6yQEBwo6jWMr9yjKjaltKz4SDUrrA==
typedoc@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.13.0.tgz#9efdf352bd54873955cd161bd4b75f24a8c59dde"
@@ -9069,10 +9075,10 @@ typedoc@^0.13.0:
typedoc-default-themes "^0.5.0"
typescript "3.1.x"
typescript@3.1.x, typescript@^3.1.6:
version "3.1.6"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68"
integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==
typescript@3.1.x, typescript@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.1.tgz#0b7a04b8cf3868188de914d9568bd030f0c56192"
integrity sha512-jw7P2z/h6aPT4AENXDGjcfHTu5CSqzsbZc6YlUIebTyBAq8XaKp78x7VcSh30xwSCcsu5irZkYZUSFP1MrAMbg==
uglify-js@^3.1.4:
version "3.4.9"