PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm/core/crypto
Просмотр файла: singleKey.d.mts
import { Deserializer } from '../../bcs/deserializer.mjs';
import { Serializer } from '../../bcs/serializer.mjs';
import { AnyPublicKeyVariant } from '../../types/types.mjs';
import { a as AccountPublicKey, P as PublicKey, V as VerifySignatureArgs, A as AuthenticationKey } from '../../publicKey-BVXX1nVl.mjs';
import { Signature } from './signature.mjs';
import '../../types/indexer.mjs';
import '../../types/generated/operations.mjs';
import '../../types/generated/types.mjs';
import '../../utils/apiEndpoints.mjs';
import '../hex.mjs';
import '../common.mjs';
import '../accountAddress.mjs';
import '../../transactions/instances/transactionArgument.mjs';
/**
* Represents any public key supported by Aptos.
*
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
* `Legacy` and `Unified` authentication keys.
*
* Any unified authentication key is represented in the SDK as `AnyPublicKey`.
*/
declare class AnyPublicKey extends AccountPublicKey {
/**
* Reference to the inner public key
*/
readonly publicKey: PublicKey;
/**
* Index of the underlying enum variant
*/
readonly variant: AnyPublicKeyVariant;
/**
* Creates an instance of the signature class based on the provided signature type.
* This allows for the handling of different signature variants such as Ed25519, Secp256k1, and Keyless.
*
* @param publicKey - The publicKey object which determines the variant to be used.
* @throws Error if the provided signature type is unsupported.
*/
constructor(publicKey: PublicKey);
/**
* Verifies the provided signature against the given message.
* This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
*
* @param args - The arguments for signature verification.
* @param args.message - The message that was signed.
* @param args.signature - The signature to verify, which must be an instance of AnySignature.
* @returns A boolean indicating whether the signature is valid for the given message.
*/
verifySignature(args: VerifySignatureArgs): boolean;
/**
* Generates an authentication key from the current instance's byte representation.
* This function is essential for creating a unique identifier for authentication purposes.
*
* @returns {AuthenticationKey} The generated authentication key.
*/
authKey(): AuthenticationKey;
/**
* Get the signature in bytes (Uint8Array).
*
* This function is a warning that it will soon return the underlying signature bytes directly.
* Use AnySignature.bcsToBytes() instead.
*
* @returns Uint8Array representation of the signature.
*/
toUint8Array(): Uint8Array;
/**
* Serializes the current object using the provided serializer.
* This function helps in converting the object into a format suitable for transmission or storage.
*
* @param serializer - The serializer instance used to perform the serialization.
*/
serialize(serializer: Serializer): void;
/**
* Deserializes an AnySignature from the provided deserializer.
* This function helps in reconstructing the AnySignature object from its serialized form, allowing for further processing or validation.
*
* @param deserializer - The deserializer instance used to read the serialized data.
*/
static deserialize(deserializer: Deserializer): AnyPublicKey;
/**
* Determines if the provided public key is an instance of AnyPublicKey.
*
* @param publicKey - The public key to check.
* @deprecated Use `instanceof AnyPublicKey` instead.
*/
static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey;
/**
* Determines if the current public key is an instance of Ed25519PublicKey.
*
* @deprecated use `publicKey instanceof Ed25519PublicKey` instead.
*/
isEd25519(): boolean;
/**
* Checks if the public key is an instance of Secp256k1PublicKey.
*
* @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.
*/
isSecp256k1PublicKey(): boolean;
/**
* Determines if the provided publicKey is an instance of a valid PublicKey object.
*
* @param publicKey - The publicKey to be checked for validity.
* @param publicKey.publicKey - The actual publicKey object that needs to be validated.
* @returns True if the signature is a valid instance; otherwise, false.
*/
static isInstance(publicKey: PublicKey): publicKey is AnyPublicKey;
}
/**
* Represents a signature that utilizes the SingleKey authentication scheme.
* This class is designed to encapsulate various types of signatures, which can
* only be generated by a `SingleKeySigner` due to the shared authentication mechanism.
*
* @extends Signature
*/
declare class AnySignature extends Signature {
readonly signature: Signature;
/**
* Index of the underlying enum variant
*/
private readonly variant;
constructor(signature: Signature);
toUint8Array(): Uint8Array;
serialize(serializer: Serializer): void;
static deserialize(deserializer: Deserializer): AnySignature;
static isInstance(signature: Signature): signature is AnySignature;
}
export { AnyPublicKey, AnySignature };
Выполнить команду
Для локальной разработки. Не используйте в интернете!