name: Set
description: An Set is an array of string values, represented an an encoded type by a bitwise representation of the values.
Hierarchy
Base<Array<string>>
↳ Set
Implements
Constructors
constructor
⊕ new Set(setValues: SetValues, value?: Array<string> | Uint8Array | number): Set
Overrides Base.constructor
Defined in codec/Set.ts:23
Parameters:
| Name | Type |
|---|---|
| setValues | SetValues |
Optional value | Array<string> | Uint8Array | number |
Returns: Set
Accessors
encodedLength
get encodedLength(): number
Defined in codec/Set.ts:73
description: The length of the value when encoded as a Uint8Array
Returns: number
isEmpty
get isEmpty(): boolean
Defined in codec/Set.ts:80
description: true is the Set contains no values
Returns: boolean
valueEncoded
get valueEncoded(): number
Defined in codec/Set.ts:94
description: The encoded value for the set members
Returns: number
values
get values(): Array<string>
Defined in codec/Set.ts:87
description: The actual set values as a Array
Returns: Array<string>
Methods
eq
▸ eq(other?: any): boolean
Defined in codec/Set.ts:101
description: Compares the value of the input to see if there is a match
Parameters:
| Name | Type |
|---|---|
Optional other | any |
Returns: boolean
toHex
▸ toHex(): string
Defined in codec/Set.ts:117
description: Returns a hex string representation of the value
Returns: string
toJSON
▸ toJSON(): any
Implementation of Codec.toJSON
Defined in codec/Set.ts:124
description: Converts the Object to JSON, typically used for RPC transfers
Returns: any
toString
▸ toString(): string
Implementation of Codec.toString
Defined in codec/Set.ts:131
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Defined in codec/Set.ts:139
description: Encodes the value as a Uint8Array as per the parity-codec specifications
Parameters:
| Name | Type | Description |
|---|---|---|
Optional isBare | undefined | false | true | true when the value has none of the type-specific prefixes (internal) |
Returns: Uint8Array
<Static> decodeSet
▸ decodeSet(setValues: SetValues, value?: Array<string> | Uint8Array | number): Array<string>
Defined in codec/Set.ts:33
Parameters:
| Name | Type | Default value |
|---|---|---|
| setValues | SetValues | - |
Default value value | Array<string> | Uint8Array | number | 0 |
Returns: Array<string>
<Static> encodeSet
▸ encodeSet(setValues: SetValues, value: Array<string>): number
Defined in codec/Set.ts:64
Parameters:
| Name | Type |
|---|---|
| setValues | SetValues |
| value | Array<string> |
Returns: number