PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@near-js/crypto/lib/commonjs
Просмотр файла: key_pair_secp256k1.d.cts
import { KeyPairString } from './constants.cjs';
import { KeyPairBase, Signature } from './key_pair_base.cjs';
import { PublicKey } from './public_key.cjs';
/**
* This class provides key pair functionality for secp256k1 curve:
* generating key pairs, encoding key pairs, signing and verifying.
* nearcore expects secp256k1 public keys to be 64 bytes at all times,
* even when string encoded the secp256k1 library returns 65 byte keys
* (including a 1 byte header that indicates how the pubkey was encoded).
* We'll force the secp256k1 library to always encode uncompressed
* keys with the corresponding 0x04 header byte, then manually
* insert/remove that byte as needed.
*/
declare class KeyPairSecp256k1 extends KeyPairBase {
readonly publicKey: PublicKey;
readonly secretKey: string;
readonly extendedSecretKey: string;
/**
* Construct an instance of key pair given a secret key.
* It's generally assumed that these are encoded in base58.
* @param {string} extendedSecretKey
*/
constructor(extendedSecretKey: string);
/**
* Generate a new random keypair.
* @example
* const keyRandom = KeyPair.fromRandom();
* keyRandom.publicKey
* // returns [PUBLIC_KEY]
*
* keyRandom.secretKey
* // returns [SECRET_KEY]
*/
static fromRandom(): KeyPairSecp256k1;
sign(message: Uint8Array): Signature;
verify(message: Uint8Array, signature: Uint8Array): boolean;
toString(): KeyPairString;
getPublicKey(): PublicKey;
}
export { KeyPairSecp256k1 };
Выполнить команду
Для локальной разработки. Не используйте в интернете!