UNPKG

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