UNPKG

2.41 kBTypeScriptView Raw
1import { ECPoint, TransactionBaseModelAdd, TransactionBaseModelAddWithType } from '@neo-one/client-common';
2import BN from 'bn.js';
3import { Account, AccountKey } from '../Account';
4import { Asset, AssetKey } from '../Asset';
5import { Validator } from '../Validator';
6import { VerifyScript } from '../vm';
7import { Witness } from '../Witness';
8import { Attribute } from './attribute';
9import { Input } from './Input';
10import { Output, OutputKey } from './Output';
11import { RegisterTransaction } from './RegisterTransaction';
12import { Transaction } from './Transaction';
13import { TransactionType } from './TransactionType';
14export interface TransactionBaseAdd extends TransactionBaseModelAdd<Attribute, Input, Output, Witness> {
15}
16export interface TransactionBaseAddWithType<Type extends TransactionType> extends TransactionBaseModelAddWithType<Type, Attribute, Input, Output, Witness> {
17}
18export interface FeeContext {
19 readonly getOutput: (input: Input) => Promise<Output>;
20 readonly governingToken: RegisterTransaction;
21 readonly utilityToken: RegisterTransaction;
22 readonly fees: {
23 [K in TransactionType]?: BN;
24 };
25 readonly registerValidatorFee: BN;
26}
27export interface TransactionGetScriptHashesForVerifyingOptions {
28 readonly getOutput: (key: OutputKey) => Promise<Output>;
29 readonly getAsset: (key: AssetKey) => Promise<Asset>;
30}
31export interface GetReferencesOptions {
32 readonly getOutput: (key: OutputKey) => Promise<Output>;
33}
34export interface GetTransactionResultsOptions {
35 readonly getOutput: (key: OutputKey) => Promise<Output>;
36}
37export interface TransactionVerifyOptions {
38 readonly calculateClaimAmount: (inputs: readonly Input[]) => Promise<BN>;
39 readonly isSpent: (key: OutputKey) => Promise<boolean>;
40 readonly getAsset: (key: AssetKey) => Promise<Asset>;
41 readonly getOutput: (key: OutputKey) => Promise<Output>;
42 readonly tryGetAccount: (key: AccountKey) => Promise<Account | undefined>;
43 readonly standbyValidators: readonly ECPoint[];
44 readonly getAllValidators: () => Promise<readonly Validator[]>;
45 readonly verifyScript: VerifyScript;
46 readonly currentHeight: number;
47 readonly governingToken: RegisterTransaction;
48 readonly utilityToken: RegisterTransaction;
49 readonly fees: {
50 [K in TransactionType]?: BN;
51 };
52 readonly registerValidatorFee: BN;
53 readonly memPool?: readonly Transaction[];
54}