import { TransactionContextCommon } from '../../../transaction/transaction-types'; import { Operation } from '../../virtual-machine'; import { AuthenticationProgramStateAlternateStack, AuthenticationProgramStateCommon, AuthenticationProgramStateError, AuthenticationProgramStateExecutionStack, AuthenticationProgramStateInternalCommon, AuthenticationProgramStateStack, AuthenticationProgramTransactionContextCommon } from '../../vm-types'; import { AuthenticationInstruction } from '../instruction-sets-types'; import { Ripemd160, Secp256k1, Sha1, Sha256 } from './crypto'; import { AuthenticationErrorCommon } from './errors'; export * from './arithmetic'; export * from './bitwise'; export * from './combinators'; export * from './crypto'; export * from './descriptions'; export * from './encoding'; export * from './errors'; export * from './flow-control'; export * from './nop'; export * from './opcodes'; export * from './push'; export * from './signing-serialization'; export * from './splice'; export * from './stack'; export * from './time'; export * from './types'; export declare enum ConsensusCommon { /** * A.K.A. `MAX_SCRIPT_ELEMENT_SIZE` */ maximumStackItemLength = 520, maximumScriptNumberLength = 4, /** * A.K.A. `MAX_OPS_PER_SCRIPT` */ maximumOperationCount = 201, /** * A.K.A. `MAX_SCRIPT_SIZE` */ maximumBytecodeLength = 10000, /** * A.K.A. `MAX_STACK_SIZE` */ maximumStackDepth = 1000 } export declare const undefinedOperation: , Errors>() => { undefined: Operation; }; export declare const checkLimitsCommon: & AuthenticationProgramStateStack & AuthenticationProgramStateAlternateStack & { operationCount: number; }, Errors>(operation: Operation) => Operation; export declare const commonOperations: , Errors>({ flags, ripemd160, secp256k1, sha1, sha256, }: { sha1: { hash: Sha1['hash']; }; sha256: { hash: Sha256['hash']; }; ripemd160: { hash: Ripemd160['hash']; }; secp256k1: { verifySignatureSchnorr: Secp256k1['verifySignatureSchnorr']; verifySignatureDERLowS: Secp256k1['verifySignatureDERLowS']; }; flags: { disallowUpgradableNops: boolean; requireBugValueZero: boolean; requireMinimalEncoding: boolean; requireNullSignatureFailures: boolean; }; }) => { readonly [opcodes: number]: Operation; }; export declare const cloneStack: (stack: readonly Readonly[]) => Uint8Array[]; export declare const createAuthenticationProgramInternalStateCommon: ({ instructions, stack, }: { instructions: readonly AuthenticationInstruction[]; stack?: Uint8Array[] | undefined; }) => AuthenticationProgramStateInternalCommon; export declare const createTransactionContextCommon: (program: AuthenticationProgramTransactionContextCommon) => TransactionContextCommon; export declare const createAuthenticationProgramStateCommon: ({ transactionContext, instructions, stack, }: { transactionContext: TransactionContextCommon; instructions: readonly AuthenticationInstruction[]; stack: Uint8Array[]; }) => AuthenticationProgramStateCommon; /** * Note: this implementation does not safely clone elements within array * properties. Mutating values within arrays will mutate those values in cloned * program states. */ export declare const cloneAuthenticationProgramStateCommon: , Errors>(state: State) => { alternateStack: Uint8Array[]; correspondingOutput: Uint8Array | undefined; executionStack: boolean[]; instructions: AuthenticationInstruction[]; ip: number; lastCodeSeparator: number; locktime: number; operationCount: number; outpointIndex: number; outpointTransactionHash: Uint8Array; outputValue: Uint8Array; sequenceNumber: number; signatureOperationsCount: number; signedMessages: Uint8Array[]; stack: Uint8Array[]; transactionOutpoints: Uint8Array; transactionOutputs: Uint8Array; transactionSequenceNumbers: Uint8Array; version: number; error?: AuthenticationErrorCommon | Errors; }; /** * This is a meaningless but complete `TransactionContextCommon` which uses `0` * values for each property. */ export declare const createTransactionContextCommonEmpty: () => { correspondingOutput: Uint8Array; locktime: number; outpointIndex: number; outpointTransactionHash: Uint8Array; outputValue: Uint8Array; sequenceNumber: number; transactionOutpoints: Uint8Array; transactionOutputs: Uint8Array; transactionSequenceNumbers: Uint8Array; version: number; }; /** * This is a meaningless but complete `TransactionContextCommon` which uses a * different value for each property. This is useful for testing and debugging. */ export declare const createTransactionContextCommonTesting: () => { correspondingOutput: Uint8Array; locktime: number; outpointIndex: number; outpointTransactionHash: Uint8Array; outputValue: Uint8Array; sequenceNumber: number; transactionOutpoints: Uint8Array; transactionOutputs: Uint8Array; transactionSequenceNumbers: Uint8Array; version: number; }; /** * Create an "empty" common authentication program state, suitable for testing a * VM/compiler. */ export declare const createAuthenticationProgramStateCommonEmpty: ({ instructions, stack, }: { instructions: readonly AuthenticationInstruction[]; stack?: Uint8Array[] | undefined; }) => AuthenticationProgramStateCommon; //# sourceMappingURL=common.d.ts.map