UNPKG

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