import * as oasis from '@oasisprotocol/client'; import * as signatureSecp256k1 from './signature_secp256k1'; import * as types from './types'; /** * Transaction signature domain separation context base. */ export declare const SIGNATURE_CONTEXT_BASE = "oasis-runtime-sdk/tx: v0"; /** * The latest transaction format version. */ export declare const LATEST_TRANSACTION_VERSION = 1; /** * Plain text call data. */ export declare const CALLFORMAT_PLAIN = 0; /** * Encrypted call data using X25519 for key exchange and Deoxys-II for symmetric encryption. */ export declare const CALLFORMAT_ENCRYPTED_X25519DEOXYSII = 1; /** * A union of signer types from different algorithms. * Because they all tend to look the same (e.g. have a `sign` method), code * that accepts an AnySigner should consult separate metadata such, such as an * associated {@link types.PublicKey}, to know what algorithm it is. */ export type AnySigner = oasis.signature.ContextSigner | signatureSecp256k1.ContextSigner; /** * An array of signers for producing a multisig {@link types.AuthProof}. * The indicies match the corresponding {@link types.MultisigConfig}'s * signers. * Set each element to an {@link AnySigner} to sign with that signer or `null` * to exclude that signature. */ export type MultisigSignerSet = AnySigner[]; /** * A union of types for producing an {@link types.AuthProof}. * Use {@link AnySigner} for a signature proof and {@link MultisigSignerSet} * for a multisig proof. */ export type ProofProvider = AnySigner | MultisigSignerSet; export declare function deriveChainContext(runtimeID: Uint8Array, consensusChainContext: string): string; export declare function signAny(pk: types.PublicKey, signer: AnySigner, context: string, body: Uint8Array): Promise; export declare function proveSignature(spec: types.SignatureAddressSpec, signer: AnySigner, context: string, body: Uint8Array): Promise<{ signature: Uint8Array; }>; export declare function proveMultisig(config: types.MultisigConfig, signerSet: MultisigSignerSet, context: string, body: Uint8Array): Promise<{ multisig: (Uint8Array | null)[]; }>; export declare function proveAny(addressSpec: types.AddressSpec, proofProvider: ProofProvider, context: string, body: Uint8Array): Promise<{ signature: Uint8Array; } | { multisig: (Uint8Array | null)[]; }>; /** * @param proofProviders An array of providers matching the layout of the * transaction's signer info. */ export declare function signUnverifiedTransaction(proofProviders: ProofProvider[], runtimeID: Uint8Array, consensusChainContext: string, transaction: types.Transaction): Promise; /** * Use this as a part of a {@link signature.MessageHandlersWithChainContext}. */ export type SignatureMessageHandlersWithChainContext = { [SIGNATURE_CONTEXT_BASE]?: oasis.signature.MessageHandlerWithChainContext; }; export type CallHandler = (body: BODY) => void; export type CallHandlers = { [method: string]: CallHandler; }; export declare function visitCall(handlers: CallHandlers, call: types.Call): boolean;