UNPKG

@pact-toolbox/crypto

Version:
391 lines (390 loc) 24.1 kB
import { blake2b } from "blakejs"; //#region src/codecs/types.d.ts type TypedArrayMutableProperties = "copyWithin" | "fill" | "reverse" | "set" | "sort"; interface ReadonlyUint8Array extends Omit<Uint8Array, TypedArrayMutableProperties> { readonly [n: number]: number; } //#endregion //#region src/codecs/core.d.ts /** * Defines an offset in bytes. */ type Offset = number; type BaseEncoder<TFrom> = { /** Encode the provided value and return the encoded bytes directly. */ readonly encode: (value: TFrom) => ReadonlyUint8Array; /** * Writes the encoded value into the provided byte array at the given offset. * Returns the offset of the next byte after the encoded value. */ readonly write: (value: TFrom, bytes: Uint8Array, offset: Offset) => Offset; }; type FixedSizeEncoder<TFrom, TSize extends number = number> = BaseEncoder<TFrom> & { /** The fixed size of the encoded value in bytes. */ readonly fixedSize: TSize; }; type VariableSizeEncoder<TFrom> = BaseEncoder<TFrom> & { /** The total size of the encoded value in bytes. */ readonly getSizeFromValue: (value: TFrom) => number; /** The maximum size an encoded value can be in bytes, if applicable. */ readonly maxSize?: number; }; /** * An object that can encode a value to a `Uint8Array`. */ type Encoder<TFrom> = FixedSizeEncoder<TFrom> | VariableSizeEncoder<TFrom>; type BaseDecoder<TTo> = { /** Decodes the provided byte array at the given offset (or zero) and returns the value directly. */ readonly decode: (bytes: ReadonlyUint8Array | Uint8Array, offset?: Offset) => TTo; /** * Reads the encoded value from the provided byte array at the given offset. * Returns the decoded value and the offset of the next byte after the encoded value. */ readonly read: (bytes: ReadonlyUint8Array | Uint8Array, offset: Offset) => [TTo, Offset]; }; type FixedSizeDecoder<TTo, TSize extends number = number> = BaseDecoder<TTo> & { /** The fixed size of the encoded value in bytes. */ readonly fixedSize: TSize; }; type VariableSizeDecoder<TTo> = BaseDecoder<TTo> & { /** The maximum size an encoded value can be in bytes, if applicable. */ readonly maxSize?: number; }; /** * An object that can decode a value from a `Uint8Array`. */ type Decoder<TTo> = FixedSizeDecoder<TTo> | VariableSizeDecoder<TTo>; type FixedSizeCodec<TFrom, TTo extends TFrom = TFrom, TSize extends number = number> = FixedSizeDecoder<TTo, TSize> & FixedSizeEncoder<TFrom, TSize>; type VariableSizeCodec<TFrom, TTo extends TFrom = TFrom> = VariableSizeDecoder<TTo> & VariableSizeEncoder<TFrom>; /** * An object that can encode and decode a value to and from a `Uint8Array`. * It supports encoding looser types than it decodes for convenience. * For example, a `bigint` encoder will always decode to a `bigint` * but can be used to encode a `number`. * * @typeParam TFrom - The type of the value to encode. * @typeParam TTo - The type of the decoded value. Defaults to `TFrom`. */ type Codec<TFrom, TTo extends TFrom = TFrom> = FixedSizeCodec<TFrom, TTo> | VariableSizeCodec<TFrom, TTo>; /** * Get the encoded size of a given value in bytes. */ declare function getEncodedSize<TFrom>(value: TFrom, encoder: { fixedSize: number; } | { getSizeFromValue: (value: TFrom) => number; }): number; /** Fills the missing `encode` function using the existing `write` function. */ declare function createEncoder<TFrom, TSize extends number>(encoder: Omit<FixedSizeEncoder<TFrom, TSize>, "encode">): FixedSizeEncoder<TFrom, TSize>; declare function createEncoder<TFrom>(encoder: Omit<VariableSizeEncoder<TFrom>, "encode">): VariableSizeEncoder<TFrom>; declare function createEncoder<TFrom>(encoder: Omit<FixedSizeEncoder<TFrom>, "encode"> | Omit<VariableSizeEncoder<TFrom>, "encode">): Encoder<TFrom>; /** Fills the missing `decode` function using the existing `read` function. */ declare function createDecoder<TTo, TSize extends number>(decoder: Omit<FixedSizeDecoder<TTo, TSize>, "decode">): FixedSizeDecoder<TTo, TSize>; declare function createDecoder<TTo>(decoder: Omit<VariableSizeDecoder<TTo>, "decode">): VariableSizeDecoder<TTo>; declare function createDecoder<TTo>(decoder: Omit<FixedSizeDecoder<TTo>, "decode"> | Omit<VariableSizeDecoder<TTo>, "decode">): Decoder<TTo>; /** Fills the missing `encode` and `decode` function using the existing `write` and `read` functions. */ declare function createCodec<TFrom, TTo extends TFrom = TFrom, TSize extends number = number>(codec: Omit<FixedSizeCodec<TFrom, TTo, TSize>, "decode" | "encode">): FixedSizeCodec<TFrom, TTo, TSize>; declare function createCodec<TFrom, TTo extends TFrom = TFrom>(codec: Omit<VariableSizeCodec<TFrom, TTo>, "decode" | "encode">): VariableSizeCodec<TFrom, TTo>; declare function createCodec<TFrom, TTo extends TFrom = TFrom>(codec: Omit<FixedSizeCodec<TFrom, TTo>, "decode" | "encode"> | Omit<VariableSizeCodec<TFrom, TTo>, "decode" | "encode">): Codec<TFrom, TTo>; declare function isFixedSize<TFrom, TSize extends number>(encoder: FixedSizeEncoder<TFrom, TSize> | VariableSizeEncoder<TFrom>): encoder is FixedSizeEncoder<TFrom, TSize>; declare function isFixedSize<TTo, TSize extends number>(decoder: FixedSizeDecoder<TTo, TSize> | VariableSizeDecoder<TTo>): decoder is FixedSizeDecoder<TTo, TSize>; declare function isFixedSize<TFrom, TTo extends TFrom, TSize extends number>(codec: FixedSizeCodec<TFrom, TTo, TSize> | VariableSizeCodec<TFrom, TTo>): codec is FixedSizeCodec<TFrom, TTo, TSize>; declare function isFixedSize<TSize extends number>(codec: { fixedSize: TSize; } | { maxSize?: number; }): codec is { fixedSize: TSize; }; declare function assertIsFixedSize<TFrom, TSize extends number>(encoder: FixedSizeEncoder<TFrom, TSize> | VariableSizeEncoder<TFrom>): asserts encoder is FixedSizeEncoder<TFrom, TSize>; declare function assertIsFixedSize<TTo, TSize extends number>(decoder: FixedSizeDecoder<TTo, TSize> | VariableSizeDecoder<TTo>): asserts decoder is FixedSizeDecoder<TTo, TSize>; declare function assertIsFixedSize<TFrom, TTo extends TFrom, TSize extends number>(codec: FixedSizeCodec<TFrom, TTo, TSize> | VariableSizeCodec<TFrom, TTo>): asserts codec is FixedSizeCodec<TFrom, TTo, TSize>; declare function assertIsFixedSize<TSize extends number>(codec: { fixedSize: TSize; } | { maxSize?: number; }): asserts codec is { fixedSize: TSize; }; declare function isVariableSize<TFrom>(encoder: Encoder<TFrom>): encoder is VariableSizeEncoder<TFrom>; declare function isVariableSize<TTo>(decoder: Decoder<TTo>): decoder is VariableSizeDecoder<TTo>; declare function isVariableSize<TFrom, TTo extends TFrom>(codec: Codec<TFrom, TTo>): codec is VariableSizeCodec<TFrom, TTo>; declare function isVariableSize(codec: { fixedSize: number; } | { maxSize?: number; }): codec is { maxSize?: number; }; declare function assertIsVariableSize<T>(encoder: Encoder<T>): asserts encoder is VariableSizeEncoder<T>; declare function assertIsVariableSize<T>(decoder: Decoder<T>): asserts decoder is VariableSizeDecoder<T>; declare function assertIsVariableSize<TFrom, TTo extends TFrom>(codec: Codec<TFrom, TTo>): asserts codec is VariableSizeCodec<TFrom, TTo>; declare function assertIsVariableSize(codec: { fixedSize: number; } | { maxSize?: number; }): asserts codec is { maxSize?: number; }; /** * Converts an encoder A to a encoder B by mapping their values. */ declare function transformEncoder<TOldFrom, TNewFrom, TSize extends number>(encoder: FixedSizeEncoder<TOldFrom, TSize>, unmap: (value: TNewFrom) => TOldFrom): FixedSizeEncoder<TNewFrom, TSize>; declare function transformEncoder<TOldFrom, TNewFrom>(encoder: VariableSizeEncoder<TOldFrom>, unmap: (value: TNewFrom) => TOldFrom): VariableSizeEncoder<TNewFrom>; declare function transformEncoder<TOldFrom, TNewFrom>(encoder: Encoder<TOldFrom>, unmap: (value: TNewFrom) => TOldFrom): Encoder<TNewFrom>; /** * Converts an decoder A to a decoder B by mapping their values. */ declare function transformDecoder<TOldTo, TNewTo, TSize extends number>(decoder: FixedSizeDecoder<TOldTo, TSize>, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): FixedSizeDecoder<TNewTo, TSize>; declare function transformDecoder<TOldTo, TNewTo>(decoder: VariableSizeDecoder<TOldTo>, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): VariableSizeDecoder<TNewTo>; declare function transformDecoder<TOldTo, TNewTo>(decoder: Decoder<TOldTo>, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): Decoder<TNewTo>; /** * Combines an encoder and a decoder into a codec. * The encoder and decoder must have the same fixed size, max size and description. * If a description is provided, it will override the encoder and decoder descriptions. */ declare function combineCodec<TFrom, TTo extends TFrom, TSize extends number>(encoder: FixedSizeEncoder<TFrom, TSize>, decoder: FixedSizeDecoder<TTo, TSize>): FixedSizeCodec<TFrom, TTo, TSize>; declare function combineCodec<TFrom, TTo extends TFrom>(encoder: VariableSizeEncoder<TFrom>, decoder: VariableSizeDecoder<TTo>): VariableSizeCodec<TFrom, TTo>; declare function combineCodec<TFrom, TTo extends TFrom>(encoder: Encoder<TFrom>, decoder: Decoder<TTo>): Codec<TFrom, TTo>; /** * Converts a codec A to a codec B by mapping their values. */ declare function transformCodec<TOldFrom, TNewFrom, TTo extends TNewFrom & TOldFrom, TSize extends number>(codec: FixedSizeCodec<TOldFrom, TTo, TSize>, unmap: (value: TNewFrom) => TOldFrom): FixedSizeCodec<TNewFrom, TTo, TSize>; declare function transformCodec<TOldFrom, TNewFrom, TTo extends TNewFrom & TOldFrom>(codec: VariableSizeCodec<TOldFrom, TTo>, unmap: (value: TNewFrom) => TOldFrom): VariableSizeCodec<TNewFrom, TTo>; declare function transformCodec<TOldFrom, TNewFrom, TTo extends TNewFrom & TOldFrom>(codec: Codec<TOldFrom, TTo>, unmap: (value: TNewFrom) => TOldFrom): Codec<TNewFrom, TTo>; declare function transformCodec<TOldFrom, TNewFrom, TOldTo extends TOldFrom, TNewTo extends TNewFrom, TSize extends number>(codec: FixedSizeCodec<TOldFrom, TOldTo, TSize>, unmap: (value: TNewFrom) => TOldFrom, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): FixedSizeCodec<TNewFrom, TNewTo, TSize>; declare function transformCodec<TOldFrom, TNewFrom, TOldTo extends TOldFrom, TNewTo extends TNewFrom>(codec: VariableSizeCodec<TOldFrom, TOldTo>, unmap: (value: TNewFrom) => TOldFrom, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): VariableSizeCodec<TNewFrom, TNewTo>; declare function transformCodec<TOldFrom, TNewFrom, TOldTo extends TOldFrom, TNewTo extends TNewFrom>(codec: Codec<TOldFrom, TOldTo>, unmap: (value: TNewFrom) => TOldFrom, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): Codec<TNewFrom, TNewTo>; /** * Concatenates an array of `Uint8Array`s into a single `Uint8Array`. * Reuses the original byte array when applicable. */ declare const mergeBytes: (byteArrays: Uint8Array[]) => Uint8Array; /** * Pads a `Uint8Array` with zeroes to the specified length. * If the array is longer than the specified length, it is returned as-is. */ declare const padBytes: (bytes: ReadonlyUint8Array | Uint8Array, length: number) => ReadonlyUint8Array | Uint8Array; /** * Fixes a `Uint8Array` to the specified length. * If the array is longer than the specified length, it is truncated. * If the array is shorter than the specified length, it is padded with zeroes. */ declare const fixBytes: (bytes: ReadonlyUint8Array | Uint8Array, length: number) => ReadonlyUint8Array | Uint8Array; /** * Returns true if and only if the provided `data` byte array contains * the provided `bytes` byte array at the specified `offset`. */ declare function containsBytes(data: ReadonlyUint8Array | Uint8Array, bytes: ReadonlyUint8Array | Uint8Array, offset: number): boolean; /** * Creates a fixed-size encoder from a given encoder. * * @param encoder - The encoder to wrap into a fixed-size encoder. * @param fixedBytes - The fixed number of bytes to write. */ declare function fixEncoderSize<TFrom, TSize extends number>(encoder: Encoder<TFrom>, fixedBytes: TSize): FixedSizeEncoder<TFrom, TSize>; /** * Creates a fixed-size decoder from a given decoder. * * @param decoder - The decoder to wrap into a fixed-size decoder. * @param fixedBytes - The fixed number of bytes to read. */ declare function fixDecoderSize<TTo, TSize extends number>(decoder: Decoder<TTo>, fixedBytes: TSize): FixedSizeDecoder<TTo, TSize>; /** * Creates a fixed-size codec from a given codec. * * @param codec - The codec to wrap into a fixed-size codec. * @param fixedBytes - The fixed number of bytes to read/write. */ declare function fixCodecSize<TFrom, TTo extends TFrom, TSize extends number>(codec: Codec<TFrom, TTo>, fixedBytes: TSize): FixedSizeCodec<TFrom, TTo, TSize>; //#endregion //#region src/address.d.ts type Address<TAddress extends string = string> = TAddress & { readonly __brand: unique symbol; }; declare function isAddress(putativeAddress: string): putativeAddress is Address<typeof putativeAddress>; declare function assertIsAddress(putativeAddress: string): asserts putativeAddress is Address<typeof putativeAddress>; declare function address<TAddress extends string = string>(putativeAddress: TAddress): Address<TAddress>; declare function getAddressEncoder(): FixedSizeEncoder<Address, 32>; declare function getAddressDecoder(): FixedSizeDecoder<Address, 32>; declare function getAddressCodec(): FixedSizeCodec<Address, Address, 32>; declare function getAddressComparator(): (x: string, y: string) => number; declare function exportBase16Key(key: CryptoKey): Promise<string>; type KAccount = `k:${Address<string>}` & { readonly __brand: unique symbol; }; declare function isKAccount(putativeAccount: string): putativeAccount is KAccount; declare function assertIsKAccount(putativeAccount: string): asserts putativeAccount is KAccount; declare function kAccount(putativeAccount: string): KAccount; declare function getKAccountFromPublicKey(publicKey: CryptoKey): Promise<KAccount>; interface KeyPair { publicKey: string; privateKey: string; } declare function genKeyPair(): Promise<KeyPair>; //#endregion //#region src/assertions.d.ts declare function assertDigestCapabilityIsAvailable(): void; declare function assertKeyGenerationIsAvailable(): Promise<void>; declare function assertKeyExporterIsAvailable(): void; declare function assertSigningCapabilityIsAvailable(): void; declare function assertVerificationCapabilityIsAvailable(): void; declare function assertPRNGIsAvailable(): void; /** * Asserts that a given byte array is not empty. */ declare function assertByteArrayIsNotEmptyForCodec(codecDescription: string, bytes: ReadonlyUint8Array | Uint8Array, offset?: number): void; /** * Asserts that a given byte array has enough bytes to decode. */ declare function assertByteArrayHasEnoughBytesForCodec(codecDescription: string, expected: number, bytes: ReadonlyUint8Array | Uint8Array, offset?: number): void; /** * Asserts that a given offset is within the byte array bounds. * This range is between 0 and the byte array length and is inclusive. * An offset equals to the byte array length is considered a valid offset * as it allows the post-offset of codecs to signal the end of the byte array. */ declare function assertByteArrayOffsetIsNotOutOfRange(codecDescription: string, offset: number, bytesLength: number): void; /** * Asserts that a given string matches a given alphabet. */ declare function assertValidBaseString(alphabet: string, testValue: string, givenValue?: string): void; //#endregion //#region src/codecs/strings/base10.d.ts /** Encodes strings in base10. */ declare function getBase10Encoder(): VariableSizeEncoder<string>; /** Decodes strings in base10. */ declare function getBase10Decoder(): VariableSizeDecoder<string>; /** Encodes and decodes strings in base10. */ declare function getBase10Codec(): VariableSizeCodec<string>; declare const base10: VariableSizeCodec<string>; //#endregion //#region src/codecs/strings/base16.d.ts /** Encodes strings in base16. */ declare function getBase16Encoder(): VariableSizeEncoder<string>; /** Decodes strings in base16. */ declare function getBase16Decoder(): VariableSizeDecoder<string>; /** Encodes and decodes strings in base16. */ declare function getBase16Codec(): VariableSizeCodec<string>; declare const base16: VariableSizeCodec<string>; //#endregion //#region src/codecs/strings/base58.d.ts /** Encodes strings in base58. */ declare function getBase58Encoder(): VariableSizeEncoder<string>; /** Decodes strings in base58. */ declare function getBase58Decoder(): VariableSizeDecoder<string>; /** Encodes and decodes strings in base58. */ declare function getBase58Codec(): VariableSizeCodec<string>; declare const base58: VariableSizeCodec<string>; //#endregion //#region src/codecs/strings/base64.d.ts /** Encodes strings in base64. */ declare function getBase64Encoder(): VariableSizeEncoder<string>; /** Decodes strings in base64. */ declare function getBase64Decoder(): VariableSizeDecoder<string>; /** Encodes and decodes strings in base64. */ declare function getBase64Codec(): VariableSizeCodec<string>; //#endregion //#region src/codecs/strings/base64-url.d.ts /** Encodes strings in base64url. */ declare function getBase64UrlEncoder(): VariableSizeEncoder<string>; /** Decodes strings in base64url. */ declare function getBase64UrlDecoder(): VariableSizeDecoder<string>; /** Encodes and decodes strings in base64url. */ declare function getBase64UrlCodec(): VariableSizeCodec<string>; declare const base64Url: VariableSizeCodec<string>; //#endregion //#region src/codecs/strings/baseX.d.ts /** * Encodes a string using a custom alphabet by dividing * by the base and handling leading zeroes. * @see {@link getBaseXCodec} for a more detailed description. */ declare const getBaseXEncoder: (alphabet: string) => VariableSizeEncoder<string>; /** * Decodes a string using a custom alphabet by dividing * by the base and handling leading zeroes. * @see {@link getBaseXCodec} for a more detailed description. */ declare const getBaseXDecoder: (alphabet: string) => VariableSizeDecoder<string>; /** * A string codec that requires a custom alphabet and uses * the length of that alphabet as the base. It then divides * the input by the base as many times as necessary to get * the output. It also supports leading zeroes by using the * first character of the alphabet as the zero character. * * This can be used to create codecs such as base10 or base58. */ declare const getBaseXCodec: (alphabet: string) => VariableSizeCodec<string>; //#endregion //#region src/codecs/strings/baseX-reslice.d.ts /** * Encodes a string using a custom alphabet by reslicing the bits of the byte array. * @see {@link getBaseXResliceCodec} for a more detailed description. */ declare function getBaseXResliceEncoder(alphabet: string, bits: number): VariableSizeEncoder<string>; /** * Decodes a string using a custom alphabet by reslicing the bits of the byte array. * @see {@link getBaseXResliceCodec} for a more detailed description. */ declare function getBaseXResliceDecoder(alphabet: string, bits: number): VariableSizeDecoder<string>; /** * A string serializer that reslices bytes into custom chunks * of bits that are then mapped to a custom alphabet. * * This can be used to create serializers whose alphabet * is a power of 2 such as base16 or base64. */ declare function getBaseXResliceCodec(alphabet: string, bits: number): VariableSizeCodec<string>; //#endregion //#region src/codecs/strings/null.d.ts /**Removes null characters from a string. */ declare function removeNullCharacters(value: string): string; /** Pads a string with null characters at the end. */ declare function padNullCharacters(value: string, chars: number): string; //#endregion //#region src/codecs/strings/utf-8.d.ts /** Encodes UTF-8 strings using the native `TextEncoder` API. */ declare function getUtf8Encoder(): VariableSizeEncoder<string>; /** Decodes UTF-8 strings using the native `TextDecoder` API. */ declare function getUtf8Decoder(): VariableSizeDecoder<string>; /** Encodes and decodes UTF-8 strings using the native `TextEncoder` and `TextDecoder` API. */ declare function getUtf8Codec(): VariableSizeCodec<string>; declare const utf8: VariableSizeCodec<string>; //#endregion //#region src/codecs/text.d.ts // TODO: fix this for react native declare const TextDecoder: typeof globalThis.TextDecoder; declare const TextEncoder: typeof globalThis.TextEncoder; //#endregion //#region src/hash/base64-url-blake2b.d.ts declare function blake2bBase64Url(input: string | Uint8Array): string; //#endregion //#region src/keys/keys.d.ts declare function createPrivateKeyFromBytes(bytes: ReadonlyUint8Array, extractable?: boolean): Promise<CryptoKey>; declare function getPublicKeyFromPrivateKey(privateKey: CryptoKey, extractable?: boolean): Promise<CryptoKey>; declare function generateKeyPair(): Promise<CryptoKeyPair>; declare function generateExtractableKeyPair(): Promise<CryptoKeyPair>; declare function createKeyPairFromBytes(bytes: ReadonlyUint8Array, extractable?: boolean): Promise<CryptoKeyPair>; declare function createKeyPairFromPrivateKeyBytes(bytes: ReadonlyUint8Array, extractable?: boolean): Promise<CryptoKeyPair>; //#endregion //#region src/keys/signatures.d.ts type Signature = string & { readonly __brand: unique symbol; }; type SignatureBytes = Uint8Array & { readonly __brand: unique symbol; }; declare function assertIsSignature(putativeSignature: string): asserts putativeSignature is Signature; declare function isSignature(putativeSignature: string): putativeSignature is Signature; declare function signBytes(key: CryptoKey, data: ReadonlyUint8Array): Promise<SignatureBytes>; declare function signature(putativeSignature: string): Signature; declare function verifySignature(key: CryptoKey, signature: SignatureBytes, data: ReadonlyUint8Array | Uint8Array): Promise<boolean>; //#endregion //#region src/stringify.d.ts declare function fastStableStringify(val: Function | undefined): undefined; declare function fastStableStringify(val: unknown): string; //#endregion export { Address, Codec, Decoder, Encoder, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, KAccount, Offset, ReadonlyUint8Array, Signature, SignatureBytes, TextDecoder, TextEncoder, VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder, address, assertByteArrayHasEnoughBytesForCodec, assertByteArrayIsNotEmptyForCodec, assertByteArrayOffsetIsNotOutOfRange, assertDigestCapabilityIsAvailable, assertIsAddress, assertIsFixedSize, assertIsKAccount, assertIsSignature, assertIsVariableSize, assertKeyExporterIsAvailable, assertKeyGenerationIsAvailable, assertPRNGIsAvailable, assertSigningCapabilityIsAvailable, assertValidBaseString, assertVerificationCapabilityIsAvailable, base10, base16, base58, base64Url, blake2b, blake2bBase64Url, combineCodec, containsBytes, createCodec, createDecoder, createEncoder, createKeyPairFromBytes, createKeyPairFromPrivateKeyBytes, createPrivateKeyFromBytes, exportBase16Key, fastStableStringify, fixBytes, fixCodecSize, fixDecoderSize, fixEncoderSize, genKeyPair, generateExtractableKeyPair, generateKeyPair, getAddressCodec, getAddressComparator, getAddressDecoder, getAddressEncoder, getBase10Codec, getBase10Decoder, getBase10Encoder, getBase16Codec, getBase16Decoder, getBase16Encoder, getBase58Codec, getBase58Decoder, getBase58Encoder, getBase64Codec, getBase64Decoder, getBase64Encoder, getBase64UrlCodec, getBase64UrlDecoder, getBase64UrlEncoder, getBaseXCodec, getBaseXDecoder, getBaseXEncoder, getBaseXResliceCodec, getBaseXResliceDecoder, getBaseXResliceEncoder, getEncodedSize, getKAccountFromPublicKey, getPublicKeyFromPrivateKey, getUtf8Codec, getUtf8Decoder, getUtf8Encoder, isAddress, isFixedSize, isKAccount, isSignature, isVariableSize, kAccount, mergeBytes, padBytes, padNullCharacters, removeNullCharacters, signBytes, signature, transformCodec, transformDecoder, transformEncoder, utf8, verifySignature }; //# sourceMappingURL=index.d.cts.map