/
interface.ts
183 lines (164 loc) · 5.99 KB
/
interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import { OperationContents, PreapplyParams } from '@taquito/rpc';
import {
BallotParams,
DelegateParams,
DrainDelegateParams,
IncreasePaidStorageParams,
OriginateParams,
ProposalsParams,
RegisterGlobalConstantParams,
RevealParams,
TransferParams,
TransferTicketParams,
UpdateConsensusKeyParams,
ActivationParams,
SmartRollupAddMessagesParams,
SmartRollupOriginateParams,
} from '../operations/types';
import { ContractMethod } from '../contract/contract-methods/contract-method-flat-param';
import { ContractMethodObject } from '../contract/contract-methods/contract-method-object-param';
import { ContractProvider } from '../contract/interface';
import { ParamsWithKind } from '../operations/types';
import { ForgeParams } from '@taquito/local-forging';
/**
* @description PrepareProvider is a utility class to output the prepared format of an operation
*/
export interface PreparationProvider {
/**
* @description Method to prepare an activation operation
* @param operation RPCOperation object or RPCOperation array
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
activate(params: ActivationParams): Promise<PreparedOperation>;
/**
*
* @description Method to prepare a reveal operation
* @param params reveal operation parameters
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
reveal(params: RevealParams): Promise<PreparedOperation>;
/**
* @description Method to prepare an origination operation
* @param params originate operation parameters
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
originate(params: OriginateParams): Promise<PreparedOperation>;
/**
*
* @description Method to prepare a transaction operation
*
* @param params transaction operation parameters
* @param source string or undefined source pkh
*
* @returns a PreparedOperation object
*/
transaction(params: TransferParams): Promise<PreparedOperation>;
/**
*
* @description Method to prepare a delegation operation
* @param params delegation operation parameters
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
delegation(params: DelegateParams): Promise<PreparedOperation>;
/**
* @description Method to prepare a register_global_constant operation
* @param params registerGlobalConstant operation parameters
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
registerGlobalConstant(params: RegisterGlobalConstantParams): Promise<PreparedOperation>;
/**
* @description Method to prepare an update_consensus_key operation
* @param params updateConsensusKey operation parameters
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
updateConsensusKey(params: UpdateConsensusKeyParams): Promise<PreparedOperation>;
/**
*
* @description Method to prepare a transfer_ticket operation
* @param params TransferTicketx operation parameters
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
transferTicket(params: TransferTicketParams): Promise<PreparedOperation>;
/**
* @description Method to prepare an increase_paid_storage operation
* @param params increasePaidStorage operation parameters
* @param source string or undefined source pkh
* @returns a PreparedOperation object
*/
increasePaidStorage(params: IncreasePaidStorageParams): Promise<PreparedOperation>;
/**
* @description Method to prepare a ballot operation
* @param params ballot operation parameters
* @returns a PreparedOperation object
*/
ballot(params: BallotParams): Promise<PreparedOperation>;
/**
*
* @description Method to prepare a proposals operation
* @param params proposals operation parameters
* @returns a PreparedOperation object
*/
proposals(params: ProposalsParams): Promise<PreparedOperation>;
/**
* @description Method to prepare a drain_delegate operation
* @param params drainDelegate operation parameters
* @returns a PreparedOperation object
*/
drainDelegate(params: DrainDelegateParams): Promise<PreparedOperation>;
/**
* @description Method to prepare a smart_rollup_add_messages operation
* @param params smartRollupAddMessages operation parameters
* @returns a PreparedOperation object
*/
smartRollupAddMessages(params: SmartRollupAddMessagesParams): Promise<PreparedOperation>;
/**
* @description Method to prepare a smart_rollup_originate operation
* @param params smartRollupOriginate operation parameters
* @returns a PreparedOperation object
*/
smartRollupOriginate(params: SmartRollupOriginateParams): Promise<PreparedOperation>;
/**
*
* @description Method to prepare a batch operation
* @param params x operation parameters
* @returns a PreparedOperation object
*/
batch(batchParams: ParamsWithKind[]): Promise<PreparedOperation>;
/**
* @description Method to prepare a contract call (transfer) operation
* @param contractMethod ContractMethod or ContractMethodObject retrieved from smart contract
* @returns a PreparedOperation object
*/
contractCall(
contractMethod: ContractMethod<ContractProvider> | ContractMethodObject<ContractProvider>
): Promise<PreparedOperation>;
/**
*
* @description Method to convert a PreparedOperation to the params needed for the preapplyOperation method
* @param prepared a Prepared Operation
* @returns a PreapplyParams object
*/
toPreapply(prepared: PreparedOperation): Promise<PreapplyParams>;
/**
*
* @description Method to convert a PreparedOperation to the params needed for forging
* @param param a Prepared Operation
* @returns a ForgeParams object
*/
toForge(param: PreparedOperation): ForgeParams;
}
export interface PreparedOperation {
opOb: {
branch: string;
contents: OperationContents[];
protocol: string;
};
counter: number;
}