@polkadot/types-codec 6.12.2-18 → 6.12.2-21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -78
- package/packageInfo.cjs +1 -1
- package/packageInfo.js +1 -1
- package/abstract/AbstractArray.d.ts +0 -84
- package/abstract/AbstractInt.d.ts +0 -75
- package/abstract/index.d.ts +0 -2
- package/base/Base.d.ts +0 -56
- package/base/Compact.d.ts +0 -83
- package/base/DoNotConstruct.d.ts +0 -33
- package/base/Enum.d.ts +0 -105
- package/base/Int.d.ts +0 -16
- package/base/Null.d.ts +0 -54
- package/base/Option.d.ts +0 -88
- package/base/Result.d.ts +0 -46
- package/base/Tuple.d.ts +0 -39
- package/base/UInt.d.ts +0 -15
- package/base/Vec.d.ts +0 -28
- package/base/VecAny.d.ts +0 -15
- package/base/VecFixed.d.ts +0 -26
- package/base/index.d.ts +0 -13
- package/bundle.d.ts +0 -7
- package/checkTypes.manual.cjs +0 -12
- package/checkTypes.manual.js +0 -7
- package/detectPackage.d.ts +0 -1
- package/extended/BTreeMap.d.ts +0 -5
- package/extended/BTreeSet.d.ts +0 -55
- package/extended/BitVec.d.ts +0 -26
- package/extended/Bytes.d.ts +0 -25
- package/extended/HashMap.d.ts +0 -5
- package/extended/Linkage.d.ts +0 -31
- package/extended/Map.d.ts +0 -50
- package/extended/Range.d.ts +0 -30
- package/extended/Type.d.ts +0 -16
- package/extended/U8aFixed.d.ts +0 -16
- package/extended/WrapperOpaque.d.ts +0 -14
- package/extended/index.d.ts +0 -11
- package/index.d.ts +0 -2
- package/native/Bool.d.ts +0 -62
- package/native/Date.d.ts +0 -76
- package/native/Json.d.ts +0 -56
- package/native/Raw.d.ts +0 -90
- package/native/Set.d.ts +0 -76
- package/native/Struct.d.ts +0 -93
- package/native/Text.d.ts +0 -71
- package/native/index.d.ts +0 -7
- package/packageInfo.d.ts +0 -4
- package/primitive/I128.d.ts +0 -11
- package/primitive/I16.d.ts +0 -11
- package/primitive/I256.d.ts +0 -11
- package/primitive/I32.d.ts +0 -11
- package/primitive/I64.d.ts +0 -11
- package/primitive/I8.d.ts +0 -11
- package/primitive/U128.d.ts +0 -11
- package/primitive/U16.d.ts +0 -11
- package/primitive/U256.d.ts +0 -11
- package/primitive/U32.d.ts +0 -11
- package/primitive/U64.d.ts +0 -11
- package/primitive/U8.d.ts +0 -11
- package/primitive/USize.d.ts +0 -12
- package/primitive/index.d.ts +0 -13
- package/types/codec.d.ts +0 -77
- package/types/helpers.d.ts +0 -14
- package/types/index.d.ts +0 -4
- package/types/interfaces.d.ts +0 -69
- package/types/registry.d.ts +0 -61
- package/utils/compareArray.d.ts +0 -1
- package/utils/compareMap.d.ts +0 -1
- package/utils/compareSet.d.ts +0 -1
- package/utils/decodeU8a.d.ts +0 -13
- package/utils/index.d.ts +0 -9
- package/utils/mapToTypeMap.d.ts +0 -5
- package/utils/sanitize.d.ts +0 -16
- package/utils/sortValues.d.ts +0 -13
- package/utils/typeToConstructor.d.ts +0 -2
- package/utils/typesToMap.d.ts +0 -2
- package/utils/util.d.ts +0 -3
package/extended/BitVec.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { AnyU8a, CodecRegistry } from '../types';
|
|
2
|
-
import { Raw } from '../native/Raw';
|
|
3
|
-
/**
|
|
4
|
-
* @name BitVec
|
|
5
|
-
* @description
|
|
6
|
-
* A BitVec that represents an array of bits. The bits are however stored encoded. The difference between this
|
|
7
|
-
* and a normal Bytes would be that the length prefix indicates the number of bits encoded, not the bytes
|
|
8
|
-
*/
|
|
9
|
-
export declare class BitVec extends Raw {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(registry: CodecRegistry, value?: AnyU8a);
|
|
12
|
-
/**
|
|
13
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
14
|
-
*/
|
|
15
|
-
get encodedLength(): number;
|
|
16
|
-
toHuman(): string;
|
|
17
|
-
/**
|
|
18
|
-
* @description Returns the base runtime type name for this instance
|
|
19
|
-
*/
|
|
20
|
-
toRawType(): string;
|
|
21
|
-
/**
|
|
22
|
-
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
23
|
-
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
24
|
-
*/
|
|
25
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
26
|
-
}
|
package/extended/Bytes.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { AnyU8a, CodecRegistry } from '../types';
|
|
2
|
-
import { Raw } from '../native/Raw';
|
|
3
|
-
/**
|
|
4
|
-
* @name Bytes
|
|
5
|
-
* @description
|
|
6
|
-
* A Bytes wrapper for Vec<u8>. The significant difference between this and a normal Uint8Array
|
|
7
|
-
* is that this version allows for length-encoding. (i.e. it is a variable-item codec, the same
|
|
8
|
-
* as what is found in [[Text]] and [[Vec]])
|
|
9
|
-
*/
|
|
10
|
-
export declare class Bytes extends Raw {
|
|
11
|
-
constructor(registry: CodecRegistry, value?: AnyU8a);
|
|
12
|
-
/**
|
|
13
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
14
|
-
*/
|
|
15
|
-
get encodedLength(): number;
|
|
16
|
-
/**
|
|
17
|
-
* @description Returns the base runtime type name for this instance
|
|
18
|
-
*/
|
|
19
|
-
toRawType(): string;
|
|
20
|
-
/**
|
|
21
|
-
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
22
|
-
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
23
|
-
*/
|
|
24
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
25
|
-
}
|
package/extended/HashMap.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Codec, CodecClass } from '../types';
|
|
2
|
-
import { CodecMap } from './Map';
|
|
3
|
-
export declare class HashMap<K extends Codec = Codec, V extends Codec = Codec> extends CodecMap<K, V> {
|
|
4
|
-
static with<K extends Codec, V extends Codec>(keyType: CodecClass<K> | string, valType: CodecClass<V> | string): CodecClass<CodecMap<K, V>>;
|
|
5
|
-
}
|
package/extended/Linkage.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Codec, CodecClass, CodecRegistry } from '../types';
|
|
2
|
-
import { Option } from '../base/Option';
|
|
3
|
-
import { Tuple } from '../base/Tuple';
|
|
4
|
-
import { Struct } from '../native/Struct';
|
|
5
|
-
declare type TypeWithValues = [CodecClass, any[]];
|
|
6
|
-
/**
|
|
7
|
-
* @name Linkage
|
|
8
|
-
* @description The wrapper for the result from a LinkedMap
|
|
9
|
-
*/
|
|
10
|
-
export declare class Linkage<T extends Codec> extends Struct {
|
|
11
|
-
constructor(registry: CodecRegistry, Type: CodecClass | string, value?: unknown);
|
|
12
|
-
static withKey<O extends Codec>(Type: CodecClass | string): CodecClass<Linkage<O>>;
|
|
13
|
-
get previous(): Option<T>;
|
|
14
|
-
get next(): Option<T>;
|
|
15
|
-
/**
|
|
16
|
-
* @description Returns the base runtime type name for this instance
|
|
17
|
-
*/
|
|
18
|
-
toRawType(): string;
|
|
19
|
-
/**
|
|
20
|
-
* @description Custom toU8a which with bare mode does not return the linkage if empty
|
|
21
|
-
*/
|
|
22
|
-
toU8a(): Uint8Array;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @name LinkageResult
|
|
26
|
-
* @description A Linkage keys/Values tuple
|
|
27
|
-
*/
|
|
28
|
-
export declare class LinkageResult extends Tuple {
|
|
29
|
-
constructor(registry: CodecRegistry, [TypeKey, keys]: TypeWithValues, [TypeValue, values]: TypeWithValues);
|
|
30
|
-
}
|
|
31
|
-
export {};
|
package/extended/Map.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { AnyJson, Codec, CodecClass, CodecRegistry, IMap, IU8a } from '../types';
|
|
3
|
-
export declare class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends Map<K, V> implements IMap<K, V> {
|
|
4
|
-
#private;
|
|
5
|
-
readonly registry: CodecRegistry;
|
|
6
|
-
createdAtHash?: IU8a;
|
|
7
|
-
readonly initialU8aLength?: number;
|
|
8
|
-
constructor(registry: CodecRegistry, keyType: CodecClass<K> | string, valType: CodecClass<V> | string, rawValue: Uint8Array | string | Map<any, any> | undefined, type?: 'BTreeMap' | 'HashMap');
|
|
9
|
-
/**
|
|
10
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
11
|
-
*/
|
|
12
|
-
get encodedLength(): number;
|
|
13
|
-
/**
|
|
14
|
-
* @description Returns a hash of the value
|
|
15
|
-
*/
|
|
16
|
-
get hash(): IU8a;
|
|
17
|
-
/**
|
|
18
|
-
* @description Checks if the value is an empty value
|
|
19
|
-
*/
|
|
20
|
-
get isEmpty(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* @description Compares the value of the input to see if there is a match
|
|
23
|
-
*/
|
|
24
|
-
eq(other?: unknown): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
|
27
|
-
*/
|
|
28
|
-
toHex(): HexString;
|
|
29
|
-
/**
|
|
30
|
-
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
31
|
-
*/
|
|
32
|
-
toHuman(isExtended?: boolean): Record<string, AnyJson>;
|
|
33
|
-
/**
|
|
34
|
-
* @description Converts the Object to JSON, typically used for RPC transfers
|
|
35
|
-
*/
|
|
36
|
-
toJSON(): Record<string, AnyJson>;
|
|
37
|
-
/**
|
|
38
|
-
* @description Returns the base runtime type name for this instance
|
|
39
|
-
*/
|
|
40
|
-
toRawType(): string;
|
|
41
|
-
/**
|
|
42
|
-
* @description Returns the string representation of the value
|
|
43
|
-
*/
|
|
44
|
-
toString(): string;
|
|
45
|
-
/**
|
|
46
|
-
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
47
|
-
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
48
|
-
*/
|
|
49
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
50
|
-
}
|
package/extended/Range.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { AnyTuple, CodecClass, CodecRegistry, INumber } from '../types';
|
|
2
|
-
import { Tuple } from '../base/Tuple';
|
|
3
|
-
declare type RangeType = 'Range' | 'RangeInclusive';
|
|
4
|
-
/**
|
|
5
|
-
* @name Range
|
|
6
|
-
* @description
|
|
7
|
-
* Rust `Range<T>` representation
|
|
8
|
-
*/
|
|
9
|
-
export declare class Range<T extends INumber> extends Tuple {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(registry: CodecRegistry, Type: CodecClass<T> | string, value?: AnyTuple, rangeName?: RangeType);
|
|
12
|
-
static with<T extends INumber>(Types: CodecClass<T> | string): CodecClass<Range<T>>;
|
|
13
|
-
/**
|
|
14
|
-
* @description Returns the starting range value
|
|
15
|
-
*/
|
|
16
|
-
get start(): T;
|
|
17
|
-
/**
|
|
18
|
-
* @description Returns the ending range value
|
|
19
|
-
*/
|
|
20
|
-
get end(): T;
|
|
21
|
-
/**
|
|
22
|
-
* @description Returns the base runtime type name for this instance
|
|
23
|
-
*/
|
|
24
|
-
toRawType(): string;
|
|
25
|
-
}
|
|
26
|
-
export declare class RangeInclusive<T extends INumber = INumber> extends Range<T> {
|
|
27
|
-
constructor(registry: CodecRegistry, type: CodecClass<T> | string, value?: AnyTuple);
|
|
28
|
-
static with<T extends INumber>(Types: CodecClass<T> | string): CodecClass<RangeInclusive<T>>;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
package/extended/Type.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { CodecRegistry } from '../types';
|
|
2
|
-
import { Text } from '../native/Text';
|
|
3
|
-
/**
|
|
4
|
-
* @name Type
|
|
5
|
-
* @description
|
|
6
|
-
* This is a extended version of Text, specifically to handle types. Here we rely fully
|
|
7
|
-
* on what Text provides us, however we also adjust the types received from the runtime,
|
|
8
|
-
* i.e. we remove the `T::` prefixes found in some types for consistency across implementation.
|
|
9
|
-
*/
|
|
10
|
-
export declare class Type extends Text {
|
|
11
|
-
constructor(registry: CodecRegistry, value?: Text | Uint8Array | string);
|
|
12
|
-
/**
|
|
13
|
-
* @description Returns the base runtime type name for this instance
|
|
14
|
-
*/
|
|
15
|
-
toRawType(): string;
|
|
16
|
-
}
|
package/extended/U8aFixed.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AnyU8a, CodecClass, CodecRegistry, U8aBitLength } from '../types';
|
|
2
|
-
import { Raw } from '../native/Raw';
|
|
3
|
-
/**
|
|
4
|
-
* @name U8aFixed
|
|
5
|
-
* @description
|
|
6
|
-
* A U8a that manages a a sequence of bytes up to the specified bitLength. Not meant
|
|
7
|
-
* to be used directly, rather is should be subclassed with the specific lengths.
|
|
8
|
-
*/
|
|
9
|
-
export declare class U8aFixed extends Raw {
|
|
10
|
-
constructor(registry: CodecRegistry, value?: AnyU8a, bitLength?: U8aBitLength);
|
|
11
|
-
static with(bitLength: U8aBitLength, typeName?: string): CodecClass<U8aFixed>;
|
|
12
|
-
/**
|
|
13
|
-
* @description Returns the base runtime type name for this instance
|
|
14
|
-
*/
|
|
15
|
-
toRawType(): string;
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Codec, CodecClass, CodecRegistry } from '../types';
|
|
2
|
-
import { Base } from '../base/Base';
|
|
3
|
-
export declare class WrapperOpaque<T extends Codec> extends Base<T> {
|
|
4
|
-
constructor(registry: CodecRegistry, Type: CodecClass<T> | string, value?: unknown);
|
|
5
|
-
static with<T extends Codec>(Type: CodecClass<T> | string): CodecClass<WrapperOpaque<T>>;
|
|
6
|
-
/**
|
|
7
|
-
* @description Returns the base runtime type name for this instance
|
|
8
|
-
*/
|
|
9
|
-
toRawType(): string;
|
|
10
|
-
/**
|
|
11
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
12
|
-
*/
|
|
13
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
14
|
-
}
|
package/extended/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { BitVec } from './BitVec';
|
|
2
|
-
export { BTreeMap } from './BTreeMap';
|
|
3
|
-
export { BTreeSet } from './BTreeSet';
|
|
4
|
-
export { Bytes } from './Bytes';
|
|
5
|
-
export { HashMap } from './HashMap';
|
|
6
|
-
export { Linkage } from './Linkage';
|
|
7
|
-
export { CodecMap, CodecMap as Map } from './Map';
|
|
8
|
-
export { Range, RangeInclusive } from './Range';
|
|
9
|
-
export { Type } from './Type';
|
|
10
|
-
export { U8aFixed } from './U8aFixed';
|
|
11
|
-
export { WrapperOpaque } from './WrapperOpaque';
|
package/index.d.ts
DELETED
package/native/Bool.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { Codec, CodecRegistry, IU8a } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* @name bool
|
|
5
|
-
* @description
|
|
6
|
-
* Representation for a boolean value in the system. It extends the base JS `Boolean` class
|
|
7
|
-
* @noInheritDoc
|
|
8
|
-
*/
|
|
9
|
-
export declare class bool extends Boolean implements Codec {
|
|
10
|
-
readonly registry: CodecRegistry;
|
|
11
|
-
createdAtHash?: IU8a;
|
|
12
|
-
constructor(registry: CodecRegistry, value?: bool | Boolean | Uint8Array | boolean | number);
|
|
13
|
-
/**
|
|
14
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
15
|
-
*/
|
|
16
|
-
get encodedLength(): number;
|
|
17
|
-
/**
|
|
18
|
-
* @description returns a hash of the contents
|
|
19
|
-
*/
|
|
20
|
-
get hash(): IU8a;
|
|
21
|
-
/**
|
|
22
|
-
* @description Checks if the value is an empty value (true when it wraps false/default)
|
|
23
|
-
*/
|
|
24
|
-
get isEmpty(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @description Checks if the value is an empty value (always false)
|
|
27
|
-
*/
|
|
28
|
-
get isFalse(): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* @description Checks if the value is an empty value (always false)
|
|
31
|
-
*/
|
|
32
|
-
get isTrue(): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @description Compares the value of the input to see if there is a match
|
|
35
|
-
*/
|
|
36
|
-
eq(other?: unknown): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* @description Returns a hex string representation of the value
|
|
39
|
-
*/
|
|
40
|
-
toHex(): HexString;
|
|
41
|
-
/**
|
|
42
|
-
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
43
|
-
*/
|
|
44
|
-
toHuman(): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* @description Converts the Object to JSON, typically used for RPC transfers
|
|
47
|
-
*/
|
|
48
|
-
toJSON(): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* @description Returns the base runtime type name for this instance
|
|
51
|
-
*/
|
|
52
|
-
toRawType(): string;
|
|
53
|
-
/**
|
|
54
|
-
* @description Returns the string representation of the value
|
|
55
|
-
*/
|
|
56
|
-
toString(): string;
|
|
57
|
-
/**
|
|
58
|
-
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
59
|
-
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
60
|
-
*/
|
|
61
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
62
|
-
}
|
package/native/Date.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
|
-
import type { HexString } from '@polkadot/util/types';
|
|
3
|
-
import type { AnyNumber, CodecRegistry, INumber, IU8a, UIntBitLength } from '../types';
|
|
4
|
-
import { BN } from '@polkadot/util';
|
|
5
|
-
/**
|
|
6
|
-
* @name Date
|
|
7
|
-
* @description
|
|
8
|
-
* A wrapper around seconds/timestamps. Internally the representation only has
|
|
9
|
-
* second precicion (aligning with Rust), so any numbers passed an/out are always
|
|
10
|
-
* per-second. For any encoding/decoding the 1000 multiplier would be applied to
|
|
11
|
-
* get it in line with JavaScript formats. It extends the base JS `Date` object
|
|
12
|
-
* and has all the methods available that are applicable to any `Date`
|
|
13
|
-
* @noInheritDoc
|
|
14
|
-
*/
|
|
15
|
-
export declare class CodecDate extends Date implements INumber {
|
|
16
|
-
readonly registry: CodecRegistry;
|
|
17
|
-
createdAtHash?: IU8a;
|
|
18
|
-
constructor(registry: CodecRegistry, value?: CodecDate | Date | AnyNumber);
|
|
19
|
-
/**
|
|
20
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
21
|
-
*/
|
|
22
|
-
get encodedLength(): number;
|
|
23
|
-
/**
|
|
24
|
-
* @description returns a hash of the contents
|
|
25
|
-
*/
|
|
26
|
-
get hash(): IU8a;
|
|
27
|
-
/**
|
|
28
|
-
* @description Checks if the value is an empty value
|
|
29
|
-
*/
|
|
30
|
-
get isEmpty(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* @description Compares the value of the input to see if there is a match
|
|
33
|
-
*/
|
|
34
|
-
eq(other?: unknown): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* @description Returns the number of bits in the value
|
|
37
|
-
*/
|
|
38
|
-
bitLength(): UIntBitLength;
|
|
39
|
-
/**
|
|
40
|
-
* @description Returns a BigInt representation of the number
|
|
41
|
-
*/
|
|
42
|
-
toBigInt(): bigint;
|
|
43
|
-
/**
|
|
44
|
-
* @description Returns the BN representation of the timestamp
|
|
45
|
-
*/
|
|
46
|
-
toBn(): BN;
|
|
47
|
-
/**
|
|
48
|
-
* @description Returns a hex string representation of the value
|
|
49
|
-
*/
|
|
50
|
-
toHex(isLe?: boolean): HexString;
|
|
51
|
-
/**
|
|
52
|
-
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
53
|
-
*/
|
|
54
|
-
toHuman(): string;
|
|
55
|
-
/**
|
|
56
|
-
* @description Converts the Object to JSON, typically used for RPC transfers
|
|
57
|
-
*/
|
|
58
|
-
toJSON(): any;
|
|
59
|
-
/**
|
|
60
|
-
* @description Returns the number representation for the timestamp
|
|
61
|
-
*/
|
|
62
|
-
toNumber(): number;
|
|
63
|
-
/**
|
|
64
|
-
* @description Returns the base runtime type name for this instance
|
|
65
|
-
*/
|
|
66
|
-
toRawType(): string;
|
|
67
|
-
/**
|
|
68
|
-
* @description Returns the string representation of the value
|
|
69
|
-
*/
|
|
70
|
-
toString(): string;
|
|
71
|
-
/**
|
|
72
|
-
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
73
|
-
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
74
|
-
*/
|
|
75
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
76
|
-
}
|
package/native/Json.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { AnyJson, Codec, CodecRegistry, IU8a } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* @name Json
|
|
5
|
-
* @description
|
|
6
|
-
* Wraps the a JSON structure retrieve via RPC. It extends the standard JS Map with. While it
|
|
7
|
-
* implements a Codec, it is limited in that it can only be used with input objects via RPC,
|
|
8
|
-
* i.e. no hex decoding. Unlike a struct, this waps a JSON object with unknown keys
|
|
9
|
-
* @noInheritDoc
|
|
10
|
-
*/
|
|
11
|
-
export declare class Json extends Map<string, any> implements Codec {
|
|
12
|
-
readonly registry: CodecRegistry;
|
|
13
|
-
createdAtHash?: IU8a;
|
|
14
|
-
constructor(registry: CodecRegistry, value?: Record<string, unknown> | null);
|
|
15
|
-
/**
|
|
16
|
-
* @description Always 0, never encodes as a Uint8Array
|
|
17
|
-
*/
|
|
18
|
-
get encodedLength(): number;
|
|
19
|
-
/**
|
|
20
|
-
* @description returns a hash of the contents
|
|
21
|
-
*/
|
|
22
|
-
get hash(): IU8a;
|
|
23
|
-
/**
|
|
24
|
-
* @description Checks if the value is an empty value
|
|
25
|
-
*/
|
|
26
|
-
get isEmpty(): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* @description Compares the value of the input to see if there is a match
|
|
29
|
-
*/
|
|
30
|
-
eq(other?: unknown): boolean;
|
|
31
|
-
getT<T>(key: string): T;
|
|
32
|
-
/**
|
|
33
|
-
* @description Unimplemented, will throw
|
|
34
|
-
*/
|
|
35
|
-
toHex(): HexString;
|
|
36
|
-
/**
|
|
37
|
-
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
38
|
-
*/
|
|
39
|
-
toHuman(): Record<string, AnyJson>;
|
|
40
|
-
/**
|
|
41
|
-
* @description Converts the Object to JSON, typically used for RPC transfers
|
|
42
|
-
*/
|
|
43
|
-
toJSON(): Record<string, AnyJson>;
|
|
44
|
-
/**
|
|
45
|
-
* @description Returns the base runtime type name for this instance
|
|
46
|
-
*/
|
|
47
|
-
toRawType(): string;
|
|
48
|
-
/**
|
|
49
|
-
* @description Returns the string representation of the value
|
|
50
|
-
*/
|
|
51
|
-
toString(): string;
|
|
52
|
-
/**
|
|
53
|
-
* @description Unimplemented, will throw
|
|
54
|
-
*/
|
|
55
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
56
|
-
}
|
package/native/Raw.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { AnyJson, AnyU8a, CodecRegistry, IU8a } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* @name Raw
|
|
5
|
-
* @description
|
|
6
|
-
* A basic wrapper around Uint8Array, with no frills and no fuss. It does differ
|
|
7
|
-
* from other implementations where it will consume the full Uint8Array as passed to it.
|
|
8
|
-
* As such it is meant to be subclassed where the wrapper takes care of the
|
|
9
|
-
* actual lengths instead of used directly.
|
|
10
|
-
* @noInheritDoc
|
|
11
|
-
*/
|
|
12
|
-
export declare class Raw extends Uint8Array implements IU8a {
|
|
13
|
-
readonly registry: CodecRegistry;
|
|
14
|
-
createdAtHash?: IU8a;
|
|
15
|
-
readonly initialU8aLength?: number;
|
|
16
|
-
constructor(registry: CodecRegistry, value?: AnyU8a, initialU8aLength?: number);
|
|
17
|
-
/**
|
|
18
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
19
|
-
*/
|
|
20
|
-
get encodedLength(): number;
|
|
21
|
-
/**
|
|
22
|
-
* @description returns a hash of the contents
|
|
23
|
-
*/
|
|
24
|
-
get hash(): IU8a;
|
|
25
|
-
/**
|
|
26
|
-
* @description Returns true if the wrapped value contains only ASCII printable characters
|
|
27
|
-
*/
|
|
28
|
-
get isAscii(): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* @description Returns true if the type wraps an empty/default all-0 value
|
|
31
|
-
*/
|
|
32
|
-
get isEmpty(): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @description Returns true if the wrapped value contains only utf8 characters
|
|
35
|
-
*/
|
|
36
|
-
get isUtf8(): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* @description The length of the value
|
|
39
|
-
*/
|
|
40
|
-
get length(): number;
|
|
41
|
-
/**
|
|
42
|
-
* @description Returns the number of bits in the value
|
|
43
|
-
*/
|
|
44
|
-
bitLength(): number;
|
|
45
|
-
/**
|
|
46
|
-
* @description Compares the value of the input to see if there is a match
|
|
47
|
-
*/
|
|
48
|
-
eq(other?: unknown): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* @description Create a new slice from the actual buffer. (compat)
|
|
51
|
-
* @param start The position to start at
|
|
52
|
-
* @param end The position to end at
|
|
53
|
-
*/
|
|
54
|
-
slice(start?: number, end?: number): Uint8Array;
|
|
55
|
-
/**
|
|
56
|
-
* @description Create a new subarray from the actual buffer. (compat)
|
|
57
|
-
* @param begin The position to start at
|
|
58
|
-
* @param end The position to end at
|
|
59
|
-
*/
|
|
60
|
-
subarray(begin?: number, end?: number): Uint8Array;
|
|
61
|
-
/**
|
|
62
|
-
* @description Returns a hex string representation of the value
|
|
63
|
-
*/
|
|
64
|
-
toHex(): HexString;
|
|
65
|
-
/**
|
|
66
|
-
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
67
|
-
*/
|
|
68
|
-
toHuman(): AnyJson;
|
|
69
|
-
/**
|
|
70
|
-
* @description Converts the Object to JSON, typically used for RPC transfers
|
|
71
|
-
*/
|
|
72
|
-
toJSON(): string;
|
|
73
|
-
/**
|
|
74
|
-
* @description Returns the base runtime type name for this instance
|
|
75
|
-
*/
|
|
76
|
-
toRawType(): string;
|
|
77
|
-
/**
|
|
78
|
-
* @description Returns the string representation of the value
|
|
79
|
-
*/
|
|
80
|
-
toString(): string;
|
|
81
|
-
/**
|
|
82
|
-
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
83
|
-
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
84
|
-
*/
|
|
85
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
86
|
-
/**
|
|
87
|
-
* @description Returns the wrapped data as a UTF-8 string
|
|
88
|
-
*/
|
|
89
|
-
toUtf8(): string;
|
|
90
|
-
}
|
package/native/Set.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
|
-
import type { HexString } from '@polkadot/util/types';
|
|
3
|
-
import type { CodecClass, CodecRegistry, ISet, IU8a } from '../types';
|
|
4
|
-
import { BN } from '@polkadot/util';
|
|
5
|
-
declare type SetValues = Record<string, number | BN>;
|
|
6
|
-
/**
|
|
7
|
-
* @name Set
|
|
8
|
-
* @description
|
|
9
|
-
* An Set is an array of string values, represented an an encoded type by
|
|
10
|
-
* a bitwise representation of the values.
|
|
11
|
-
*/
|
|
12
|
-
export declare class CodecSet extends Set<string> implements ISet<string> {
|
|
13
|
-
#private;
|
|
14
|
-
readonly registry: CodecRegistry;
|
|
15
|
-
createdAtHash?: IU8a;
|
|
16
|
-
constructor(registry: CodecRegistry, setValues: SetValues, value?: string[] | Set<string> | Uint8Array | BN | number | string, bitLength?: number);
|
|
17
|
-
static with(values: SetValues, bitLength?: number): CodecClass<CodecSet>;
|
|
18
|
-
/**
|
|
19
|
-
* @description The length of the value when encoded as a Uint8Array
|
|
20
|
-
*/
|
|
21
|
-
get encodedLength(): number;
|
|
22
|
-
/**
|
|
23
|
-
* @description returns a hash of the contents
|
|
24
|
-
*/
|
|
25
|
-
get hash(): IU8a;
|
|
26
|
-
/**
|
|
27
|
-
* @description true is the Set contains no values
|
|
28
|
-
*/
|
|
29
|
-
get isEmpty(): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* @description The actual set values as a string[]
|
|
32
|
-
*/
|
|
33
|
-
get strings(): string[];
|
|
34
|
-
/**
|
|
35
|
-
* @description The encoded value for the set members
|
|
36
|
-
*/
|
|
37
|
-
get valueEncoded(): BN;
|
|
38
|
-
/**
|
|
39
|
-
* @description adds a value to the Set (extended to allow for validity checking)
|
|
40
|
-
*/
|
|
41
|
-
add: (key: string) => this;
|
|
42
|
-
/**
|
|
43
|
-
* @description Compares the value of the input to see if there is a match
|
|
44
|
-
*/
|
|
45
|
-
eq(other?: unknown): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* @description Returns a hex string representation of the value
|
|
48
|
-
*/
|
|
49
|
-
toHex(): HexString;
|
|
50
|
-
/**
|
|
51
|
-
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
52
|
-
*/
|
|
53
|
-
toHuman(): string[];
|
|
54
|
-
/**
|
|
55
|
-
* @description Converts the Object to JSON, typically used for RPC transfers
|
|
56
|
-
*/
|
|
57
|
-
toJSON(): string[];
|
|
58
|
-
/**
|
|
59
|
-
* @description The encoded value for the set members
|
|
60
|
-
*/
|
|
61
|
-
toNumber(): number;
|
|
62
|
-
/**
|
|
63
|
-
* @description Returns the base runtime type name for this instance
|
|
64
|
-
*/
|
|
65
|
-
toRawType(): string;
|
|
66
|
-
/**
|
|
67
|
-
* @description Returns the string representation of the value
|
|
68
|
-
*/
|
|
69
|
-
toString(): string;
|
|
70
|
-
/**
|
|
71
|
-
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
72
|
-
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
73
|
-
*/
|
|
74
|
-
toU8a(isBare?: boolean): Uint8Array;
|
|
75
|
-
}
|
|
76
|
-
export {};
|