crypto.d.ts 2.0 KB

12345678910111213141516171819202122232425
  1. import type { TypedDataDomain, TypedDataField } from 'ethers';
  2. import { SignedTransaction } from '../types/Transaction.js';
  3. import type { BytesLike } from '../types/UtilsTypes.js';
  4. export declare function getBase58CheckAddress(addressBytes: number[]): string;
  5. export declare function decodeBase58Address(base58Sting: string): false | number[];
  6. export declare function signTransaction(priKeyBytes: string | BytesLike, transaction: any): SignedTransaction;
  7. export declare function ecRecover(signedData: string, signature: string): string;
  8. export declare function arrayToBase64String(a: number[]): string;
  9. export declare function signBytes(privateKey: string | BytesLike, contents: BytesLike): string;
  10. export declare function _signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>, privateKey: string): string;
  11. export declare function getRowBytesFromTransactionBase64(base64Data: string): Uint8Array;
  12. export declare function genPriKey(): number[];
  13. export declare function computeAddress(pubBytes: BytesLike): number[];
  14. export declare function getAddressFromPriKey(priKeyBytes: BytesLike): number[];
  15. export declare function decode58Check(addressStr: string): false | number[];
  16. export declare function isAddressValid(base58Str: string): boolean;
  17. export declare function getBase58CheckAddressFromPriKeyBase64String(priKeyBase64String: string): string;
  18. export declare function getHexStrAddressFromPriKeyBase64String(priKeyBase64String: string): string;
  19. export declare function getAddressFromPriKeyBase64String(priKeyBase64String: string): string;
  20. export declare function getPubKeyFromPriKey(priKeyBytes: BytesLike): number[];
  21. export declare function ECKeySign(hashBytes: BytesLike, priKeyBytes: BytesLike): string;
  22. export declare function SHA256(msgBytes: BytesLike): number[];
  23. export declare function passwordToAddress(password: string): string;
  24. export declare function pkToAddress(privateKey: string, strict?: boolean): string;
  25. export declare function sha3(string: string, prefix?: boolean): string;