UNPKG

5.96 kBTypeScriptView Raw
1/// <reference types="node" />
2import { BinaryWriter, MinerTransactionJSON, TransactionBaseModel } from '@neo-one/client-common';
3import { Constructor } from '@neo-one/utils';
4import BN from 'bn.js';
5import { DeserializeWireBaseOptions, SerializeJSONContext } from '../Serializable';
6import { VerifyScriptResult } from '../vm';
7import { Witness } from '../Witness';
8import { Attribute } from './attribute';
9import { Input } from './Input';
10import { Output } from './Output';
11import { FeeContext, TransactionBaseAdd, TransactionVerifyOptions } from './TransactionBase';
12import { TransactionType } from './TransactionType';
13export interface MinerTransactionAdd extends TransactionBaseAdd {
14 readonly nonce: number;
15}
16declare const MinerTransaction_base: {
17 new (...args: any[]): {
18 readonly equals: import("..").Equals;
19 readonly toKeyString: () => string;
20 readonly getSortedScriptHashesForVerifying: (input: import("./TransactionBase").TransactionGetScriptHashesForVerifyingOptions) => Promise<string[]>;
21 readonly sizeInternal: () => number;
22 readonly networkFee: (input: FeeContext) => Promise<BN>;
23 readonly getReferencesInternal: (input: import("./TransactionBase").GetReferencesOptions) => Promise<Output[]>;
24 readonly getTransactionResultsInternal: (input: import("./TransactionBase").GetTransactionResultsOptions) => Promise<{
25 readonly [x: string]: BN | undefined;
26 }>;
27 readonly baseGetScriptHashesForVerifyingInternal: (input: import("./TransactionBase").TransactionGetScriptHashesForVerifyingOptions) => Promise<Set<string>>;
28 readonly size: number;
29 serializeTransactionBaseJSON(context: SerializeJSONContext): Promise<import("@neo-one/client-common").TransactionBaseJSON>;
30 serializeJSON(_context: SerializeJSONContext): Promise<MinerTransactionJSON>;
31 getNetworkFee(context: FeeContext): Promise<BN>;
32 getSystemFee({ fees }: FeeContext): BN;
33 getReferences(options: import("./TransactionBase").GetReferencesOptions): Promise<readonly Output[]>;
34 getTransactionResults(options: import("./TransactionBase").GetTransactionResultsOptions): Promise<{
35 readonly [key: string]: BN;
36 }>;
37 getScriptHashesForVerifying(options: import("./TransactionBase").TransactionGetScriptHashesForVerifyingOptions): Promise<Set<string>>;
38 verify(options: TransactionVerifyOptions): Promise<readonly VerifyScriptResult[]>;
39 readonly sizeExclusive: () => number;
40 verifyDoubleSpend({ isSpent }: TransactionVerifyOptions): Promise<void>;
41 verifyOutputs({ getAsset, currentHeight }: TransactionVerifyOptions): Promise<void>;
42 verifyTransactionResults({ getOutput, utilityToken, governingToken, fees, registerValidatorFee, }: TransactionVerifyOptions): Promise<void>;
43 verifyScripts({ getAsset, getOutput, verifyScript, }: TransactionVerifyOptions): Promise<readonly VerifyScriptResult[]>;
44 readonly type: TransactionType.Miner;
45 readonly version: number;
46 readonly attributes: readonly Attribute[];
47 readonly inputs: readonly Input[];
48 readonly outputs: readonly Output[];
49 readonly scripts: readonly Witness[];
50 readonly serializeWire: import("@neo-one/client-common").SerializeWire;
51 readonly serializeUnsigned: import("@neo-one/client-common").SerializeWire;
52 readonly hashInternal: any;
53 readonly hashHexInternal: any;
54 readonly messageInternal: any;
55 clone(options: {
56 readonly scripts?: readonly Witness[] | undefined;
57 readonly attributes?: readonly Attribute[] | undefined;
58 readonly inputs?: readonly Input[] | undefined;
59 readonly outputs?: readonly Output[] | undefined;
60 }): any;
61 readonly hash: import("@neo-one/client-common").UInt256;
62 readonly hashHex: string;
63 readonly message: Buffer;
64 sign(key: import("@neo-one/client-common").PrivateKey): any;
65 signWithSignature(signature: Buffer, publicKey: import("@neo-one/client-common").ECPoint): any;
66 serializeExclusiveBase(_writer: BinaryWriter): void;
67 serializeUnsignedBase(writer: BinaryWriter): void;
68 serializeWireBase(writer: BinaryWriter): void;
69 };
70 deserializeTransactionBaseStartWireBase({ reader, }: DeserializeWireBaseOptions): {
71 readonly type: TransactionType;
72 readonly version: number;
73 };
74 deserializeTransactionBaseEndWireBase(options: DeserializeWireBaseOptions): {
75 readonly attributes: readonly Attribute[];
76 readonly inputs: readonly Input[];
77 readonly outputs: readonly Output[];
78 readonly scripts: readonly Witness[];
79 };
80 deserializeWireBase(_options: DeserializeWireBaseOptions): any;
81 deserializeWire(options: import("../Serializable").DeserializeWireOptions): any;
82 readonly WitnessConstructor: Constructor<Witness>;
83} & Constructor<TransactionBaseModel<TransactionType.Miner, Attribute, Input, Output, Witness>>;
84export declare class MinerTransaction extends MinerTransaction_base {
85 static deserializeWireBase(options: DeserializeWireBaseOptions): MinerTransaction;
86 readonly nonce: number;
87 protected readonly sizeExclusive: () => number;
88 constructor({ version, attributes, inputs, outputs, scripts, hash, nonce }: MinerTransactionAdd);
89 clone({ scripts, attributes, inputs, outputs, }: {
90 readonly scripts?: readonly Witness[];
91 readonly attributes?: readonly Attribute[];
92 readonly inputs?: readonly Input[];
93 readonly outputs?: readonly Output[];
94 }): this;
95 serializeExclusiveBase(writer: BinaryWriter): void;
96 serializeJSON(context: SerializeJSONContext): Promise<MinerTransactionJSON>;
97 getNetworkFee(_context: FeeContext): Promise<BN>;
98 verify(options: TransactionVerifyOptions): Promise<readonly VerifyScriptResult[]>;
99 private verifyInternal;
100}
101export {};