import { NodeProvider } from '../api'; import { node } from '../api'; import { Token } from '../api/api-alephium'; export interface SignResult { fromGroup: number; toGroup: number; unsignedTx: string; txId: string; signature: string; } export interface Account { address: string; group: number; publicKey: string; } export declare type SubmitTx = { submitTx?: boolean; }; export declare type SignerAddress = { signerAddress: string; }; export declare type GetAccountsParams = undefined; export declare type GetAccountsResult = Account[]; export interface SignTransferTxParams { signerAddress: string; destinations: node.Destination[]; utxos?: node.OutputRef[]; gasAmount?: number; gasPrice?: string; submitTx?: boolean; } export interface SignTransferTxResult { fromGroup: number; toGroup: number; unsignedTx: string; txId: string; signature: string; } export interface SignDeployContractTxParams { signerAddress: string; bytecode: string; initialAlphAmount?: string; initialTokenAmounts?: Token[]; issueTokenAmount?: string; gasAmount?: number; gasPrice?: string; submitTx?: boolean; } export interface SignDeployContractTxResult { fromGroup: number; toGroup: number; unsignedTx: string; txId: string; signature: string; contractId: string; contractAddress: string; } export interface SignExecuteScriptTxParams { signerAddress: string; bytecode: string; alphAmount?: string; tokens?: node.Token[]; gasAmount?: number; gasPrice?: string; submitTx?: boolean; } export interface SignExecuteScriptTxResult { fromGroup: number; toGroup: number; unsignedTx: string; txId: string; signature: string; } export interface SignUnsignedTxParams { signerAddress: string; unsignedTx: string; submitTx?: boolean; } export interface SignUnsignedTxResult { fromGroup: number; toGroup: number; unsignedTx: string; txId: string; signature: string; } export interface SignHexStringParams { signerAddress: string; hexString: string; } export interface SignHexStringResult { signature: string; } export interface SignMessageParams { signerAddress: string; message: string; } export interface SignMessageResult { signature: string; } export interface SignerProvider { getAccounts(): Promise; signTransferTx(params: SignTransferTxParams): Promise; signDeployContractTx(params: SignDeployContractTxParams): Promise; signExecuteScriptTx(params: SignExecuteScriptTxParams): Promise; signUnsignedTx(params: SignUnsignedTxParams): Promise; signHexString(params: SignHexStringParams): Promise; signMessage(params: SignMessageParams): Promise; } export declare abstract class SignerWithNodeProvider implements SignerProvider { readonly provider: NodeProvider; alwaysSubmitTx: boolean; abstract getAccounts(): Promise; getAccount(signerAddress: string): Promise; constructor(provider: NodeProvider, alwaysSubmitTx: boolean); private defaultSignerAddress; submitTransaction(unsignedTx: string, txHash: string, signerAddress?: string): Promise; private shouldSubmitTx; private usePublicKey; signTransferTx(params: SignTransferTxParams): Promise; buildTransferTx(params: SignTransferTxParams): Promise; signDeployContractTx(params: SignDeployContractTxParams): Promise; buildContractCreationTx(params: SignDeployContractTxParams): Promise; signExecuteScriptTx(params: SignExecuteScriptTxParams): Promise; buildScriptTx(params: SignExecuteScriptTxParams): Promise; signUnsignedTx(params: SignUnsignedTxParams): Promise; protected handleSign(response: { fromGroup: number; toGroup: number; signerAddress: string; unsignedTx: string; txId: string; }, submitTx: boolean): Promise; signHexString(params: SignHexStringParams): Promise; signMessage(params: SignMessageParams): Promise; abstract signRaw(signerAddress: string, hexString: string): Promise; } export interface SubmissionResult { txId: string; fromGroup: number; toGroup: number; } export declare function verifyHexString(hexString: string, publicKey: string, signature: string): boolean; export declare function verifySignedMessage(message: string, publicKey: string, signature: string): boolean;