UNPKG

wowok

Version:

Wowok Blockchain TypeScript API

40 lines (39 loc) 1.71 kB
import type { IntentScope } from "./intent.js"; import type { PublicKey } from "./publickey.js"; import type { SignatureScheme } from "./signature-scheme.js"; import type { Transaction } from "../transactions/Transaction.js"; import type { ClientWithCoreApi, Experimental_WowClientTypes } from "../experimental/index.js"; export declare const FALCON512_PRIVATE_KEY_SIZE = 1281; export declare const PRIVATE_KEY_SIZE = 1281; export declare const W_PRIVATE_KEY_PREFIX = "wowprivkey"; export type ParsedKeypair = { scheme: SignatureScheme; secretKey: Uint8Array; }; export interface SignatureWithBytes { bytes: string; signature: string; } export interface SignAndExecuteOptions { transaction: Transaction; client: ClientWithCoreApi; } export declare abstract class Signer { abstract sign(bytes: Uint8Array): Promise<Uint8Array<ArrayBuffer>>; signWithIntent(bytes: Uint8Array, intent: IntentScope): Promise<SignatureWithBytes>; signTransaction(bytes: Uint8Array): Promise<SignatureWithBytes>; signPersonalMessage(bytes: Uint8Array): Promise<{ bytes: string; signature: string; }>; signAndExecuteTransaction({ transaction, client, }: SignAndExecuteOptions): Promise<Omit<Experimental_WowClientTypes.TransactionResponse, "balanceChanges">>; toWowAddress(): string; toWAddress(): string; abstract getKeyScheme(): SignatureScheme; abstract getPublicKey(): PublicKey; } export declare abstract class Keypair extends Signer { abstract getSecretKey(): string; } export declare function decodeWowPrivateKey(value: string): ParsedKeypair; export declare function encodeWowPrivateKey(bytes: Uint8Array, scheme: SignatureScheme): string;