• Const
defaultConsensusKey: "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298"
packages/utils/src/utils/defaultSnapshotConfigs.ts:12
• Const
defaultSnapshotConfigs: SnapshotConfigs
packages/utils/src/utils/defaultSnapshotConfigs.ts:6
▸ arrayify(value
, name?
, copy?
): Uint8Array
Get a typed Uint8Array from a BytesLike object.
Name | Type | Default value | Description |
---|---|---|---|
value | BytesLike | undefined | the BytesLike data. |
name? | string | undefined | a display name for the error result. |
copy | boolean | true | create a copy of the original data (if applicable). |
Uint8Array
packages/utils/src/utils/arrayify.ts:12
▸ capitalizeString(str
): string
Name | Type |
---|---|
str | string |
string
packages/utils/src/utils/capitalizeString.ts:1
▸ chunkAndPadBytes(bytes
, chunkSize
): Uint8Array
[]
Function to take a byte array and split into chunks of a given size
Name | Type | Description |
---|---|---|
bytes | Uint8Array | The byte array to chunk |
chunkSize | number | The size of each chunk |
Uint8Array
[]
An array of byte arrays of a specified size
packages/utils/src/utils/chunkAndPadBytes.ts:8
▸ concat(arrays
): Uint8Array
Concatenates multiple BytesLike into a single Uint8Array.
Name | Type | Description |
---|---|---|
arrays | readonly BytesLike [] | The arrays to concatenate. |
Uint8Array
packages/utils/src/utils/concat.ts:38
▸ concatBytes(arrays
): Uint8Array
Concatenates multiple Uint8Arrays into a single Uint8Array.
Name | Type | Description |
---|---|---|
arrays | readonly Uint8Array [] | readonly number [][] | The arrays to concatenate. |
Uint8Array
packages/utils/src/utils/concat.ts:11
▸ dataSlice(data
, start?
, end?
): string
Returns a hex string by slicing data from the start offset to the end offset.
Name | Type | Description |
---|---|---|
data | BytesLike | the data to be sliced. |
start? | number | the start offset (default: 0). |
end? | number | the end offset (default: length of data). |
string
packages/utils/src/utils/dataSlice.ts:15
▸ decodeBase58(value
): BN
Name | Type |
---|---|
value | string |
BN
packages/utils/src/utils/base58.ts:51
▸ encodeBase58(_value
): string
Encode value as a Base58-encoded string.
Name | Type |
---|---|
_value | BytesLike |
string
packages/utils/src/utils/base58.ts:30
▸ hexlify(data
): string
Returns a hex representation of the inputted bytes.
Name | Type |
---|---|
data | BytesLike |
string
packages/utils/src/utils/hexlify.ts:10
▸ isDefined<T
>(value
): value is T
Name |
---|
T |
Name | Type |
---|---|
value | undefined | T |
value is T
packages/utils/src/utils/isDefined.ts:1
▸ normalizeString(str
): string
Converts some.string-value
into SomeStringValue
.
Examples: my-simple.test —— MySimpleTest myFile.ts —— MyFileTs my-abi.json —— MyAbiJson
Name | Type |
---|---|
str | string |
string
packages/utils/src/utils/normalizeString.ts:11
▸ sleep(time
): Promise
<unknown
>
Name | Type |
---|---|
time | number |
Promise
<unknown
>
packages/utils/src/utils/sleep.ts:1
▸ toUtf8Bytes(stri
, form?
): Uint8Array
Returns the UTF-8 byte representation of str.
If form is disabled, the string is not normalized.
Name | Type | Default value | Description |
---|---|---|---|
stri | string | undefined | the string to convert to UTF-8 bytes. |
form | boolean | true | whether to normalize the string. |
Uint8Array
packages/utils/src/utils/toUtf8Bytes.ts:11
▸ toUtf8String(bytes
): string
Returns the string represented by the UTF-8 data bytes.
Name | Type | Description |
---|---|---|
bytes | BytesLike | the UTF-8 data bytes |
string
the string represented by the UTF-8 data bytes