UNPKG

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