@polkadot/types-codec 7.4.1 → 7.4.2-11

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.
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, Codec, CodecRegistry, IU8a, IVec } from '../types';
2
+ import type { AnyJson, Codec, IU8a, IVec, Registry } from '../types';
3
3
  /**
4
4
  * @name AbstractArray
5
5
  * @description
@@ -8,10 +8,10 @@ import type { AnyJson, Codec, CodecRegistry, IU8a, IVec } from '../types';
8
8
  * @noInheritDoc
9
9
  */
10
10
  export declare abstract class AbstractArray<T extends Codec> extends Array<T> implements IVec<T> {
11
- readonly registry: CodecRegistry;
11
+ readonly registry: Registry;
12
12
  createdAtHash?: IU8a;
13
13
  readonly initialU8aLength?: number;
14
- protected constructor(registry: CodecRegistry, values: T[], initialU8aLength?: number);
14
+ protected constructor(registry: Registry, values: T[], initialU8aLength?: number);
15
15
  /**
16
16
  * @description The length of the value when encoded as a Uint8Array
17
17
  */
@@ -1,6 +1,6 @@
1
1
  /// <reference types="bn.js" />
2
2
  import type { HexString } from '@polkadot/util/types';
3
- import type { AnyNumber, CodecRegistry, INumber, IU8a, UIntBitLength } from '../types';
3
+ import type { AnyNumber, INumber, IU8a, Registry, UIntBitLength } from '../types';
4
4
  import { BN } from '@polkadot/util';
5
5
  export declare const DEFAULT_UINT_BITS = 64;
6
6
  /**
@@ -10,10 +10,10 @@ export declare const DEFAULT_UINT_BITS = 64;
10
10
  */
11
11
  export declare abstract class AbstractInt extends BN implements INumber {
12
12
  #private;
13
- readonly registry: CodecRegistry;
13
+ readonly registry: Registry;
14
14
  createdAtHash?: IU8a;
15
15
  readonly encodedLength: number;
16
- constructor(registry: CodecRegistry, value?: AnyNumber, bitLength?: UIntBitLength, isSigned?: boolean);
16
+ constructor(registry: Registry, value?: AnyNumber, bitLength?: UIntBitLength, isSigned?: boolean);
17
17
  /**
18
18
  * @description returns a hash of the contents
19
19
  */
package/base/Base.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, BareOpts, Codec, CodecRegistry, IU8a } from '../types';
2
+ import type { AnyJson, BareOpts, Codec, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name Base
5
5
  * @description A type extends the Base class, when it holds a value
@@ -8,7 +8,7 @@ export declare abstract class Base<T extends Codec> implements Codec {
8
8
  #private;
9
9
  createdAtHash?: IU8a;
10
10
  readonly initialU8aLength?: number;
11
- protected constructor(registry: CodecRegistry, value: T, initialU8aLength?: number);
11
+ protected constructor(registry: Registry, value: T, initialU8aLength?: number);
12
12
  /**
13
13
  * @description The length of the value when encoded as a Uint8Array
14
14
  */
@@ -22,7 +22,7 @@ export declare abstract class Base<T extends Codec> implements Codec {
22
22
  * @description Checks if the value is an empty value
23
23
  */
24
24
  get isEmpty(): boolean;
25
- get registry(): CodecRegistry;
25
+ get registry(): Registry;
26
26
  /**
27
27
  * @description Compares the value of the input to see if there is a match
28
28
  */
package/base/Compact.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="bn.js" />
2
2
  import type { BN } from '@polkadot/util';
3
3
  import type { HexString } from '@polkadot/util/types';
4
- import type { AnyJson, AnyNumber, CodecClass, CodecRegistry, ICompact, INumber, IU8a } from '../types';
4
+ import type { AnyJson, AnyNumber, CodecClass, ICompact, INumber, IU8a, Registry } from '../types';
5
5
  /**
6
6
  * @name Compact
7
7
  * @description
@@ -12,13 +12,13 @@ import type { AnyJson, AnyNumber, CodecClass, CodecRegistry, ICompact, INumber,
12
12
  */
13
13
  export declare class Compact<T extends INumber> implements ICompact<T> {
14
14
  #private;
15
- readonly registry: CodecRegistry;
15
+ readonly registry: Registry;
16
16
  createdAtHash?: IU8a;
17
17
  readonly initialU8aLength?: number;
18
- constructor(registry: CodecRegistry, Type: CodecClass<T> | string, value?: Compact<T> | AnyNumber);
18
+ constructor(registry: Registry, Type: CodecClass<T> | string, value?: Compact<T> | AnyNumber);
19
19
  static with<T extends INumber>(Type: CodecClass<T> | string): CodecClass<Compact<T>>;
20
20
  /** @internal */
21
- static decodeCompact<T extends INumber>(registry: CodecRegistry, Type: CodecClass<T>, value: Compact<T> | AnyNumber): [T, number];
21
+ static decodeCompact<T extends INumber>(registry: Registry, Type: CodecClass<T>, value: Compact<T> | AnyNumber): [T, number];
22
22
  /**
23
23
  * @description The length of the value when encoded as a Uint8Array
24
24
  */
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, Codec, CodecClass, CodecRegistry, IU8a } from '../types';
2
+ import type { AnyJson, Codec, CodecClass, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name DoNotConstruct
5
5
  * @description
@@ -7,9 +7,9 @@ import type { AnyJson, Codec, CodecClass, CodecRegistry, IU8a } from '../types';
7
7
  */
8
8
  export declare class DoNotConstruct implements Codec {
9
9
  #private;
10
- readonly registry: CodecRegistry;
10
+ readonly registry: Registry;
11
11
  createdAtHash?: IU8a;
12
- constructor(registry: CodecRegistry, typeName?: string);
12
+ constructor(registry: Registry, typeName?: string);
13
13
  static with(typeName?: string): CodecClass;
14
14
  /**
15
15
  * @description The length of the value when encoded as a Uint8Array
package/base/Enum.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, Codec, CodecClass, CodecRegistry, IEnum, IU8a } from '../types';
2
+ import type { AnyJson, Codec, CodecClass, IEnum, IU8a, Registry } from '../types';
3
3
  export interface EnumCodecClass<T = Codec> {
4
- new (registry: CodecRegistry, value?: any, index?: number): T;
4
+ new (registry: Registry, value?: any, index?: number): T;
5
5
  }
6
6
  /**
7
7
  * @name Enum
@@ -11,10 +11,10 @@ export interface EnumCodecClass<T = Codec> {
11
11
  */
12
12
  export declare class Enum implements IEnum {
13
13
  #private;
14
- readonly registry: CodecRegistry;
14
+ readonly registry: Registry;
15
15
  createdAtHash?: IU8a;
16
16
  readonly initialU8aLength?: number;
17
- constructor(registry: CodecRegistry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number);
17
+ constructor(registry: Registry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number);
18
18
  static with(Types: Record<string, string | CodecClass> | Record<string, number> | string[]): EnumCodecClass<Enum>;
19
19
  /**
20
20
  * @description The length of the value when encoded as a Uint8Array
package/base/Int.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AnyNumber, CodecClass, CodecRegistry, UIntBitLength } from '../types';
1
+ import type { AnyNumber, CodecClass, Registry, UIntBitLength } from '../types';
2
2
  import { AbstractInt } from '../abstract/AbstractInt';
3
3
  /**
4
4
  * @name Int
@@ -11,6 +11,6 @@ import { AbstractInt } from '../abstract/AbstractInt';
11
11
  * @noInheritDoc
12
12
  */
13
13
  export declare class Int extends AbstractInt {
14
- constructor(registry: CodecRegistry, value?: AnyNumber, bitLength?: UIntBitLength);
14
+ constructor(registry: Registry, value?: AnyNumber, bitLength?: UIntBitLength);
15
15
  static with(bitLength: UIntBitLength, typeName?: string): CodecClass<Int>;
16
16
  }
package/base/Null.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { Codec, CodecRegistry, IU8a } from '../types';
2
+ import type { Codec, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name Null
5
5
  * @description
6
6
  * Implements a type that does not contain anything (apart from `null`)
7
7
  */
8
8
  export declare class Null implements Codec {
9
- readonly registry: CodecRegistry;
9
+ readonly registry: Registry;
10
10
  createdAtHash?: IU8a;
11
11
  readonly initialU8aLength = 0;
12
- constructor(registry: CodecRegistry);
12
+ constructor(registry: Registry);
13
13
  /**
14
14
  * @description The length of the value when encoded as a Uint8Array
15
15
  */
package/base/Option.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, Codec, CodecClass, CodecRegistry, IOption, IU8a } from '../types';
2
+ import type { AnyJson, Codec, CodecClass, IOption, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name Option
5
5
  * @description
@@ -10,9 +10,9 @@ import type { AnyJson, Codec, CodecClass, CodecRegistry, IOption, IU8a } from '.
10
10
  */
11
11
  export declare class Option<T extends Codec> implements IOption<T> {
12
12
  #private;
13
- readonly registry: CodecRegistry;
13
+ readonly registry: Registry;
14
14
  createdAtHash?: IU8a;
15
- constructor(registry: CodecRegistry, typeName: CodecClass<T> | string, value?: unknown);
15
+ constructor(registry: Registry, typeName: CodecClass<T> | string, value?: unknown);
16
16
  static with<O extends Codec>(Type: CodecClass<O> | string): CodecClass<Option<O>>;
17
17
  /**
18
18
  * @description The length of the value when encoded as a Uint8Array
package/base/Result.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Codec, CodecClass, CodecRegistry, IResult } from '../types';
1
+ import type { Codec, CodecClass, IResult, Registry } from '../types';
2
2
  import { Enum } from './Enum';
3
3
  /**
4
4
  * @name Result
@@ -6,7 +6,7 @@ import { Enum } from './Enum';
6
6
  * A Result maps to the Rust Result type, that can either wrap a success or error value
7
7
  */
8
8
  export declare class Result<O extends Codec, E extends Codec> extends Enum implements IResult<O, E> {
9
- constructor(registry: CodecRegistry, Ok: CodecClass<O> | string, Err: CodecClass<E> | string, value?: unknown);
9
+ constructor(registry: Registry, Ok: CodecClass<O> | string, Err: CodecClass<E> | string, value?: unknown);
10
10
  static with<O extends Codec, E extends Codec>(Types: {
11
11
  Ok: CodecClass<O> | string;
12
12
  Err: CodecClass<E> | string;
package/base/Tuple.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AnyTupleValue, Codec, CodecClass, CodecRegistry, ITuple } from '../types';
1
+ import type { AnyTupleValue, Codec, CodecClass, ITuple, Registry } from '../types';
2
2
  import { AbstractArray } from '../abstract/AbstractArray';
3
3
  declare type TupleType = (CodecClass | string);
4
4
  declare type TupleTypes = TupleType[] | {
@@ -12,7 +12,7 @@ declare type TupleTypes = TupleType[] | {
12
12
  */
13
13
  export declare class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
14
14
  #private;
15
- constructor(registry: CodecRegistry, Types: TupleTypes | TupleType, value?: AnyTupleValue);
15
+ constructor(registry: Registry, Types: TupleTypes | TupleType, value?: AnyTupleValue);
16
16
  static with(Types: TupleTypes | TupleType): CodecClass<Tuple>;
17
17
  /**
18
18
  * @description The length of the value when encoded as a Uint8Array
package/base/Vec.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { Codec, CodecClass, CodecRegistry } from '../types';
2
+ import type { Codec, CodecClass, Registry } from '../types';
3
3
  import { AbstractArray } from '../abstract/AbstractArray';
4
- export declare function decodeVec<T extends Codec>(registry: CodecRegistry, Type: CodecClass<T>, value: Uint8Array | HexString | unknown[], length?: number): [T[], number, number];
4
+ export declare function decodeVec<T extends Codec>(registry: Registry, Type: CodecClass<T>, value: Uint8Array | HexString | unknown[], length?: number): [T[], number, number];
5
5
  /**
6
6
  * @name Vec
7
7
  * @description
@@ -11,7 +11,7 @@ export declare function decodeVec<T extends Codec>(registry: CodecRegistry, Type
11
11
  */
12
12
  export declare class Vec<T extends Codec> extends AbstractArray<T> {
13
13
  #private;
14
- constructor(registry: CodecRegistry, Type: CodecClass<T> | string, value?: Uint8Array | HexString | unknown[]);
14
+ constructor(registry: Registry, Type: CodecClass<T> | string, value?: Uint8Array | HexString | unknown[]);
15
15
  static with<O extends Codec>(Type: CodecClass<O> | string): CodecClass<Vec<O>>;
16
16
  /**
17
17
  * @description The type for the items
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { Codec, CodecClass, CodecRegistry } from '../types';
2
+ import type { Codec, CodecClass, Registry } from '../types';
3
3
  import { AbstractArray } from '../abstract/AbstractArray';
4
4
  /**
5
5
  * @name VecFixed
@@ -8,7 +8,7 @@ import { AbstractArray } from '../abstract/AbstractArray';
8
8
  */
9
9
  export declare class VecFixed<T extends Codec> extends AbstractArray<T> {
10
10
  #private;
11
- constructor(registry: CodecRegistry, Type: CodecClass<T> | string, length: number, value?: Uint8Array | HexString | unknown[]);
11
+ constructor(registry: Registry, Type: CodecClass<T> | string, length: number, value?: Uint8Array | HexString | unknown[]);
12
12
  static with<O extends Codec>(Type: CodecClass<O> | string, length: number): CodecClass<VecFixed<O>>;
13
13
  /**
14
14
  * @description The type for the items
@@ -1,11 +1,11 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, Codec, CodecClass, CodecRegistry, ISet, IU8a } from '../types';
2
+ import type { AnyJson, Codec, CodecClass, ISet, IU8a, Registry } from '../types';
3
3
  export declare class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V> {
4
4
  #private;
5
- readonly registry: CodecRegistry;
5
+ readonly registry: Registry;
6
6
  createdAtHash?: IU8a;
7
7
  readonly initialU8aLength?: number;
8
- constructor(registry: CodecRegistry, valType: CodecClass<V> | string, rawValue?: Uint8Array | string | string[] | Set<any>);
8
+ constructor(registry: Registry, valType: CodecClass<V> | string, rawValue?: Uint8Array | string | string[] | Set<any>);
9
9
  static with<V extends Codec>(valType: CodecClass<V> | string): CodecClass<BTreeSet<V>>;
10
10
  /**
11
11
  * @description The length of the value when encoded as a Uint8Array
@@ -1,4 +1,4 @@
1
- import type { AnyU8a, CodecRegistry } from '../types';
1
+ import type { AnyU8a, Registry } from '../types';
2
2
  import { Raw } from '../native/Raw';
3
3
  /**
4
4
  * @name BitVec
@@ -8,7 +8,7 @@ import { Raw } from '../native/Raw';
8
8
  */
9
9
  export declare class BitVec extends Raw {
10
10
  #private;
11
- constructor(registry: CodecRegistry, value?: AnyU8a);
11
+ constructor(registry: Registry, value?: AnyU8a);
12
12
  /**
13
13
  * @description The length of the value when encoded as a Uint8Array
14
14
  */
@@ -1,4 +1,4 @@
1
- import type { AnyU8a, CodecRegistry } from '../types';
1
+ import type { AnyU8a, Registry } from '../types';
2
2
  import { Raw } from '../native/Raw';
3
3
  /**
4
4
  * @name Bytes
@@ -8,7 +8,7 @@ import { Raw } from '../native/Raw';
8
8
  * as what is found in [[Text]] and [[Vec]])
9
9
  */
10
10
  export declare class Bytes extends Raw {
11
- constructor(registry: CodecRegistry, value?: AnyU8a);
11
+ constructor(registry: Registry, value?: AnyU8a);
12
12
  /**
13
13
  * @description The length of the value when encoded as a Uint8Array
14
14
  */
@@ -1,4 +1,4 @@
1
- import type { Codec, CodecClass, CodecRegistry } from '../types';
1
+ import type { Codec, CodecClass, Registry } from '../types';
2
2
  import { Option } from '../base/Option';
3
3
  import { Tuple } from '../base/Tuple';
4
4
  import { Struct } from '../native/Struct';
@@ -8,7 +8,7 @@ declare type TypeWithValues = [CodecClass, any[]];
8
8
  * @description The wrapper for the result from a LinkedMap
9
9
  */
10
10
  export declare class Linkage<T extends Codec> extends Struct {
11
- constructor(registry: CodecRegistry, Type: CodecClass | string, value?: unknown);
11
+ constructor(registry: Registry, Type: CodecClass | string, value?: unknown);
12
12
  static withKey<O extends Codec>(Type: CodecClass | string): CodecClass<Linkage<O>>;
13
13
  get previous(): Option<T>;
14
14
  get next(): Option<T>;
@@ -26,6 +26,6 @@ export declare class Linkage<T extends Codec> extends Struct {
26
26
  * @description A Linkage keys/Values tuple
27
27
  */
28
28
  export declare class LinkageResult extends Tuple {
29
- constructor(registry: CodecRegistry, [TypeKey, keys]: TypeWithValues, [TypeValue, values]: TypeWithValues);
29
+ constructor(registry: Registry, [TypeKey, keys]: TypeWithValues, [TypeValue, values]: TypeWithValues);
30
30
  }
31
31
  export {};
package/extended/Map.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, Codec, CodecClass, CodecRegistry, IMap, IU8a } from '../types';
2
+ import type { AnyJson, Codec, CodecClass, IMap, IU8a, Registry } from '../types';
3
3
  export declare class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends Map<K, V> implements IMap<K, V> {
4
4
  #private;
5
- readonly registry: CodecRegistry;
5
+ readonly registry: Registry;
6
6
  createdAtHash?: IU8a;
7
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');
8
+ constructor(registry: Registry, keyType: CodecClass<K> | string, valType: CodecClass<V> | string, rawValue: Uint8Array | string | Map<any, any> | undefined, type?: 'BTreeMap' | 'HashMap');
9
9
  /**
10
10
  * @description The length of the value when encoded as a Uint8Array
11
11
  */
@@ -1,4 +1,4 @@
1
- import type { AnyTuple, CodecClass, CodecRegistry, INumber } from '../types';
1
+ import type { AnyTuple, CodecClass, INumber, Registry } from '../types';
2
2
  import { Tuple } from '../base/Tuple';
3
3
  declare type RangeType = 'Range' | 'RangeInclusive';
4
4
  /**
@@ -8,7 +8,7 @@ declare type RangeType = 'Range' | 'RangeInclusive';
8
8
  */
9
9
  export declare class Range<T extends INumber> extends Tuple {
10
10
  #private;
11
- constructor(registry: CodecRegistry, Type: CodecClass<T> | string, value?: AnyTuple, rangeName?: RangeType);
11
+ constructor(registry: Registry, Type: CodecClass<T> | string, value?: AnyTuple, rangeName?: RangeType);
12
12
  static with<T extends INumber>(Types: CodecClass<T> | string): CodecClass<Range<T>>;
13
13
  /**
14
14
  * @description Returns the starting range value
@@ -24,7 +24,7 @@ export declare class Range<T extends INumber> extends Tuple {
24
24
  toRawType(): string;
25
25
  }
26
26
  export declare class RangeInclusive<T extends INumber = INumber> extends Range<T> {
27
- constructor(registry: CodecRegistry, Type: CodecClass<T> | string, value?: AnyTuple);
27
+ constructor(registry: Registry, Type: CodecClass<T> | string, value?: AnyTuple);
28
28
  static with<T extends INumber>(Type: CodecClass<T> | string): CodecClass<RangeInclusive<T>>;
29
29
  }
30
30
  export {};
@@ -1,4 +1,4 @@
1
- import type { CodecRegistry } from '../types';
1
+ import type { Registry } from '../types';
2
2
  import { Text } from '../native/Text';
3
3
  /**
4
4
  * @name Type
@@ -8,7 +8,7 @@ import { Text } from '../native/Text';
8
8
  * i.e. we remove the `T::` prefixes found in some types for consistency across implementation.
9
9
  */
10
10
  export declare class Type extends Text {
11
- constructor(registry: CodecRegistry, value?: Text | Uint8Array | string);
11
+ constructor(registry: Registry, value?: Text | Uint8Array | string);
12
12
  /**
13
13
  * @description Returns the base runtime type name for this instance
14
14
  */
@@ -1,4 +1,4 @@
1
- import type { AnyU8a, CodecClass, CodecRegistry, U8aBitLength } from '../types';
1
+ import type { AnyU8a, CodecClass, Registry, U8aBitLength } from '../types';
2
2
  import { Raw } from '../native/Raw';
3
3
  /**
4
4
  * @name U8aFixed
@@ -7,7 +7,7 @@ import { Raw } from '../native/Raw';
7
7
  * to be used directly, rather is should be subclassed with the specific lengths.
8
8
  */
9
9
  export declare class U8aFixed extends Raw {
10
- constructor(registry: CodecRegistry, value?: AnyU8a, bitLength?: U8aBitLength);
10
+ constructor(registry: Registry, value?: AnyU8a, bitLength?: U8aBitLength);
11
11
  static with(bitLength: U8aBitLength, typeName?: string): CodecClass<U8aFixed>;
12
12
  /**
13
13
  * @description Returns the base runtime type name for this instance
@@ -1,8 +1,8 @@
1
- import type { AnyJson, AnyU8a, Codec, CodecClass, CodecRegistry } from '../types';
1
+ import type { AnyJson, AnyU8a, Codec, CodecClass, Registry } from '../types';
2
2
  import { Bytes } from './Bytes';
3
3
  export declare class WrapperKeepOpaque<T extends Codec> extends Bytes {
4
4
  #private;
5
- constructor(registry: CodecRegistry, typeName: CodecClass<T> | string, value?: AnyU8a | Codec);
5
+ constructor(registry: Registry, typeName: CodecClass<T> | string, value?: AnyU8a | Codec);
6
6
  static with<T extends Codec>(Type: CodecClass<T> | string): CodecClass<WrapperKeepOpaque<T>>;
7
7
  /**
8
8
  * @description Checks if the wrapper is decodable
@@ -1,7 +1,7 @@
1
- import type { Codec, CodecClass, CodecRegistry } from '../types';
1
+ import type { Codec, CodecClass, Registry } from '../types';
2
2
  import { Base } from '../base/Base';
3
3
  export declare class WrapperOpaque<T extends Codec> extends Base<T> {
4
- constructor(registry: CodecRegistry, Type: CodecClass<T> | string, value?: unknown);
4
+ constructor(registry: Registry, Type: CodecClass<T> | string, value?: unknown);
5
5
  static with<T extends Codec>(Type: CodecClass<T> | string): CodecClass<WrapperOpaque<T>>;
6
6
  /**
7
7
  * @description Returns the base runtime type name for this instance
package/native/Bool.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { Codec, CodecRegistry, IU8a } from '../types';
2
+ import type { Codec, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name bool
5
5
  * @description
@@ -7,9 +7,9 @@ import type { Codec, CodecRegistry, IU8a } from '../types';
7
7
  * @noInheritDoc
8
8
  */
9
9
  export declare class bool extends Boolean implements Codec {
10
- readonly registry: CodecRegistry;
10
+ readonly registry: Registry;
11
11
  createdAtHash?: IU8a;
12
- constructor(registry: CodecRegistry, value?: bool | Boolean | Uint8Array | boolean | number);
12
+ constructor(registry: Registry, value?: bool | Boolean | Uint8Array | boolean | number);
13
13
  /**
14
14
  * @description The length of the value when encoded as a Uint8Array
15
15
  */
package/native/Date.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="bn.js" />
2
2
  import type { HexString } from '@polkadot/util/types';
3
- import type { AnyNumber, CodecRegistry, INumber, IU8a, UIntBitLength } from '../types';
3
+ import type { AnyNumber, INumber, IU8a, Registry, UIntBitLength } from '../types';
4
4
  import { BN } from '@polkadot/util';
5
5
  /**
6
6
  * @name Date
@@ -13,9 +13,9 @@ import { BN } from '@polkadot/util';
13
13
  * @noInheritDoc
14
14
  */
15
15
  export declare class CodecDate extends Date implements INumber {
16
- readonly registry: CodecRegistry;
16
+ readonly registry: Registry;
17
17
  createdAtHash?: IU8a;
18
- constructor(registry: CodecRegistry, value?: CodecDate | Date | AnyNumber);
18
+ constructor(registry: Registry, value?: CodecDate | Date | AnyNumber);
19
19
  /**
20
20
  * @description The length of the value when encoded as a Uint8Array
21
21
  */
package/native/Json.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, Codec, CodecRegistry, IU8a } from '../types';
2
+ import type { AnyJson, Codec, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name Json
5
5
  * @description
@@ -9,9 +9,9 @@ import type { AnyJson, Codec, CodecRegistry, IU8a } from '../types';
9
9
  * @noInheritDoc
10
10
  */
11
11
  export declare class Json extends Map<string, any> implements Codec {
12
- readonly registry: CodecRegistry;
12
+ readonly registry: Registry;
13
13
  createdAtHash?: IU8a;
14
- constructor(registry: CodecRegistry, value?: Record<string, unknown> | null);
14
+ constructor(registry: Registry, value?: Record<string, unknown> | null);
15
15
  /**
16
16
  * @description Always 0, never encodes as a Uint8Array
17
17
  */
package/native/Raw.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, AnyU8a, CodecRegistry, IU8a } from '../types';
2
+ import type { AnyJson, AnyU8a, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name Raw
5
5
  * @description
@@ -10,10 +10,10 @@ import type { AnyJson, AnyU8a, CodecRegistry, IU8a } from '../types';
10
10
  * @noInheritDoc
11
11
  */
12
12
  export declare class Raw extends Uint8Array implements IU8a {
13
- readonly registry: CodecRegistry;
13
+ readonly registry: Registry;
14
14
  createdAtHash?: IU8a;
15
15
  readonly initialU8aLength?: number;
16
- constructor(registry: CodecRegistry, value?: AnyU8a, initialU8aLength?: number);
16
+ constructor(registry: Registry, value?: AnyU8a, initialU8aLength?: number);
17
17
  /**
18
18
  * @description The length of the value when encoded as a Uint8Array
19
19
  */
package/native/Set.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="bn.js" />
2
2
  import type { HexString } from '@polkadot/util/types';
3
- import type { CodecClass, CodecRegistry, ISet, IU8a } from '../types';
3
+ import type { CodecClass, ISet, IU8a, Registry } from '../types';
4
4
  import { BN } from '@polkadot/util';
5
5
  declare type SetValues = Record<string, number | BN>;
6
6
  /**
@@ -11,9 +11,9 @@ declare type SetValues = Record<string, number | BN>;
11
11
  */
12
12
  export declare class CodecSet extends Set<string> implements ISet<string> {
13
13
  #private;
14
- readonly registry: CodecRegistry;
14
+ readonly registry: Registry;
15
15
  createdAtHash?: IU8a;
16
- constructor(registry: CodecRegistry, setValues: SetValues, value?: string[] | Set<string> | Uint8Array | BN | number | string, bitLength?: number);
16
+ constructor(registry: Registry, setValues: SetValues, value?: string[] | Set<string> | Uint8Array | BN | number | string, bitLength?: number);
17
17
  static with(values: SetValues, bitLength?: number): CodecClass<CodecSet>;
18
18
  /**
19
19
  * @description The length of the value when encoded as a Uint8Array
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyJson, BareOpts, Codec, CodecClass, CodecRegistry, IStruct, IU8a } from '../types';
2
+ import type { AnyJson, BareOpts, Codec, CodecClass, IStruct, IU8a, Registry } from '../types';
3
3
  declare type TypesDef<T = Codec> = Record<string, string | CodecClass<T>>;
4
4
  /**
5
5
  * @name Struct
@@ -23,7 +23,7 @@ export declare class Struct<S extends TypesDef = TypesDef, V extends {
23
23
  #private;
24
24
  createdAtHash?: IU8a;
25
25
  readonly initialU8aLength?: number;
26
- constructor(registry: CodecRegistry, Types: S, value?: V | Map<unknown, unknown> | unknown[] | HexString | null, jsonMap?: Map<string, string>);
26
+ constructor(registry: Registry, Types: S, value?: V | Map<unknown, unknown> | unknown[] | HexString | null, jsonMap?: Map<string, string>);
27
27
  static with<S extends TypesDef>(Types: S, jsonMap?: Map<string, string>): CodecClass<Struct<S>>;
28
28
  /**
29
29
  * @description The available keys for this struct
@@ -46,7 +46,7 @@ export declare class Struct<S extends TypesDef = TypesDef, V extends {
46
46
  * @description returns a hash of the contents
47
47
  */
48
48
  get hash(): IU8a;
49
- get registry(): CodecRegistry;
49
+ get registry(): Registry;
50
50
  /**
51
51
  * @description Compares the value of the input to see if there is a match
52
52
  */
package/native/Text.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
- import type { AnyU8a, Codec, CodecRegistry, IU8a } from '../types';
2
+ import type { AnyU8a, Codec, IU8a, Registry } from '../types';
3
3
  /**
4
4
  * @name Text
5
5
  * @description
@@ -10,9 +10,9 @@ import type { AnyU8a, Codec, CodecRegistry, IU8a } from '../types';
10
10
  */
11
11
  export declare class Text extends String implements Codec {
12
12
  #private;
13
- readonly registry: CodecRegistry;
13
+ readonly registry: Registry;
14
14
  createdAtHash?: IU8a;
15
- constructor(registry: CodecRegistry, value?: null | Text | string | AnyU8a | {
15
+ constructor(registry: Registry, value?: null | Text | string | AnyU8a | {
16
16
  toString: () => string;
17
17
  });
18
18
  /**
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./detectPackage.cjs"
21
21
  ],
22
22
  "type": "module",
23
- "version": "7.4.1",
23
+ "version": "7.4.2-11",
24
24
  "main": "index.cjs",
25
25
  "module": "index.js",
26
26
  "types": "index.d.ts",
package/packageInfo.cjs CHANGED
@@ -11,6 +11,6 @@ const packageInfo = {
11
11
  name: '@polkadot/types-codec',
12
12
  path: typeof __dirname === 'string' ? __dirname : 'auto',
13
13
  type: 'cjs',
14
- version: '7.4.1'
14
+ version: '7.4.2-11'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
package/packageInfo.js CHANGED
@@ -5,5 +5,5 @@ export const packageInfo = {
5
5
  name: '@polkadot/types-codec',
6
6
  path: new URL('.', import.meta.url).pathname,
7
7
  type: 'esm',
8
- version: '7.4.1'
8
+ version: '7.4.2-11'
9
9
  };
@@ -1,4 +1,4 @@
1
- import type { CodecRegistry } from '../types';
1
+ import type { Registry } from '../types';
2
2
  import { u32 } from './U32';
3
3
  /**
4
4
  * @name USize
@@ -8,5 +8,5 @@ import { u32 } from './U32';
8
8
  * It is not to be used, since it created consensus mismatches.
9
9
  */
10
10
  export declare class usize extends u32 {
11
- constructor(registry: CodecRegistry, value?: unknown);
11
+ constructor(registry: Registry, value?: unknown);
12
12
  }
package/types/codec.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
2
  import type { AnyJson } from './helpers';
3
3
  import type { IU8a } from './interfaces';
4
- import type { CodecRegistry } from './registry';
4
+ import type { Registry } from './registry';
5
5
  export declare type BareOpts = boolean | Record<string, boolean>;
6
6
  /**
7
7
  * @name Codec
@@ -30,7 +30,7 @@ export interface Codec {
30
30
  /**
31
31
  * @description The registry associated with this object
32
32
  */
33
- readonly registry: CodecRegistry;
33
+ readonly registry: Registry;
34
34
  /**
35
35
  * @description The block at which this value was retrieved/created (set to non-empty when retrieved from storage)
36
36
  */
@@ -70,7 +70,7 @@ export interface CodecClass<T = Codec> {
70
70
  * @description An internal fallback type (previous generation) if encoding fails
71
71
  */
72
72
  readonly __fallbackType?: string;
73
- new (registry: CodecRegistry, ...args: any[]): T;
73
+ new (registry: Registry, ...args: any[]): T;
74
74
  }
75
75
  export declare type CodecClassDef<T = Codec> = Record<string, CodecClass<T>>;
76
76
  export declare type CodecTo = 'toHex' | 'toJSON' | 'toString' | 'toU8a';
@@ -30,7 +30,7 @@ export interface CallBase<A extends AnyTuple, M = any> extends IMethod<A, M> {
30
30
  export interface CallFunction<A extends AnyTuple = AnyTuple, M = any> extends CallBase<A, M> {
31
31
  (...args: any[]): IMethod<A, M>;
32
32
  }
33
- export interface CodecRegistry {
33
+ export interface Registry {
34
34
  readonly chainDecimals: number[];
35
35
  readonly chainSS58: number | undefined;
36
36
  readonly chainTokens: string[];
@@ -1,4 +1,4 @@
1
- import type { Codec, CodecClass, CodecRegistry } from '../types';
1
+ import type { Codec, CodecClass, Registry } from '../types';
2
2
  /**
3
3
  * Given an u8a, and an array of Type constructors, decode the u8a against the
4
4
  * types, and return an array of decoded values.
@@ -7,7 +7,7 @@ import type { Codec, CodecClass, CodecRegistry } from '../types';
7
7
  * @param result - The result array (will be returned with values pushed)
8
8
  * @param types - The array of CodecClass to decode the U8a against.
9
9
  */
10
- export declare function decodeU8a<T extends Codec = Codec, E = T>(registry: CodecRegistry, u8a: Uint8Array, types: CodecClass[] | {
10
+ export declare function decodeU8a<T extends Codec = Codec, E = T>(registry: Registry, u8a: Uint8Array, types: CodecClass[] | {
11
11
  [index: string]: CodecClass;
12
12
  }, withZip?: boolean): [E[], number];
13
- export declare function decodeU8aVec<T extends Codec = Codec>(registry: CodecRegistry, u8a: Uint8Array, start: number, Type: CodecClass<T>, count: number): [T[], number, number];
13
+ export declare function decodeU8aVec<T extends Codec = Codec>(registry: Registry, u8a: Uint8Array, start: number, Type: CodecClass<T>, count: number): [T[], number, number];
@@ -1,5 +1,5 @@
1
- import type { CodecClass, CodecRegistry } from '../types';
1
+ import type { CodecClass, Registry } from '../types';
2
2
  /**
3
3
  * @description takes an input map of the form `{ [string]: string | CodecClass }` and returns a map of `{ [string]: CodecClass }`
4
4
  */
5
- export declare function mapToTypeMap(registry: CodecRegistry, input: Record<string, string | CodecClass>): Record<string, CodecClass>;
5
+ export declare function mapToTypeMap(registry: Registry, input: Record<string, string | CodecClass>): Record<string, CodecClass>;
@@ -1,2 +1,2 @@
1
- import type { Codec, CodecClass, CodecRegistry } from '../types';
2
- export declare function typeToConstructor<T extends Codec = Codec>(registry: CodecRegistry, type: string | CodecClass<T>): CodecClass<T>;
1
+ import type { Codec, CodecClass, Registry } from '../types';
2
+ export declare function typeToConstructor<T extends Codec = Codec>(registry: Registry, type: string | CodecClass<T>): CodecClass<T>;
@@ -1,2 +1,2 @@
1
- import type { CodecClass, CodecRegistry } from '../types';
2
- export declare function typesToMap(registry: CodecRegistry, Types: Record<string, CodecClass>): Record<string, string>;
1
+ import type { CodecClass, Registry } from '../types';
2
+ export declare function typesToMap(registry: Registry, Types: Record<string, CodecClass>): Record<string, string>;