UNPKG

6.21 kBTypeScriptView Raw
1/// <reference types="node" />
2import { BinaryWriter, StateTransactionJSON, TransactionBaseModel, UInt160Hex } 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 { StateDescriptor } from './state';
12import { FeeContext, TransactionBaseAdd, TransactionGetScriptHashesForVerifyingOptions, TransactionVerifyOptions } from './TransactionBase';
13import { TransactionType } from './TransactionType';
14export interface StateTransactionAdd extends TransactionBaseAdd {
15 readonly descriptors: readonly StateDescriptor[];
16}
17declare const StateTransaction_base: {
18 new (...args: any[]): {
19 readonly equals: import("..").Equals;
20 readonly toKeyString: () => string;
21 readonly getSortedScriptHashesForVerifying: (input: 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: TransactionGetScriptHashesForVerifyingOptions) => Promise<Set<string>>;
29 readonly size: number;
30 serializeTransactionBaseJSON(context: SerializeJSONContext): Promise<import("@neo-one/client-common").TransactionBaseJSON>;
31 serializeJSON(_context: SerializeJSONContext): Promise<StateTransactionJSON>;
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: 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.State;
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("@neo-one/client-common").SerializeWire;
52 readonly serializeUnsigned: import("@neo-one/client-common").SerializeWire;
53 readonly hashInternal: any;
54 readonly hashHexInternal: any;
55 readonly messageInternal: any;
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.State, Attribute, Input, Output, Witness>>;
85export declare class StateTransaction extends StateTransaction_base {
86 static deserializeWireBase(options: DeserializeWireBaseOptions): StateTransaction;
87 readonly descriptors: readonly StateDescriptor[];
88 protected readonly sizeExclusive: () => number;
89 private readonly stateGetScriptHashesForVerifyingInternal;
90 constructor({ version, attributes, inputs, outputs, scripts, hash, descriptors }: StateTransactionAdd);
91 getSystemFee(context: FeeContext): BN;
92 getScriptHashesForVerifying(options: TransactionGetScriptHashesForVerifyingOptions): Promise<Set<UInt160Hex>>;
93 clone({ scripts, attributes, inputs, outputs, }: {
94 readonly scripts?: readonly Witness[];
95 readonly attributes?: readonly Attribute[];
96 readonly inputs?: readonly Input[];
97 readonly outputs?: readonly Output[];
98 }): this;
99 serializeExclusiveBase(writer: BinaryWriter): void;
100 serializeJSON(context: SerializeJSONContext): Promise<StateTransactionJSON>;
101 verify(options: TransactionVerifyOptions): Promise<readonly VerifyScriptResult[]>;
102 private verifyInternal;
103}
104export {};