@taquito/contracts-library 11.1.0 → 12.0.0-beta-RC.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,356 +8,235 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
37
21
  };
38
22
  Object.defineProperty(exports, "__esModule", { value: true });
39
23
  exports.RpcWrapperContractsLibrary = void 0;
40
- var rpc_1 = require("@taquito/rpc");
41
- var RpcWrapperContractsLibrary = /** @class */ (function () {
42
- function RpcWrapperContractsLibrary(rpc, contractslibrary) {
24
+ const rpc_1 = require("@taquito/rpc");
25
+ /**
26
+ * @deprecated RpcWrapperContractsLibrary has been deprecated in favor of ReadWrapperContractsLibrary
27
+ *
28
+ */
29
+ class RpcWrapperContractsLibrary {
30
+ constructor(rpc, contractslibrary) {
43
31
  this.rpc = rpc;
44
32
  this.contractslibrary = contractslibrary;
45
33
  }
46
- RpcWrapperContractsLibrary.prototype.getNormalizedScript = function (address, unparsingMode, _a) {
47
- if (unparsingMode === void 0) { unparsingMode = { unparsing_mode: 'Readable' }; }
48
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
49
- return __awaiter(this, void 0, void 0, function () {
50
- var contractData;
51
- return __generator(this, function (_c) {
52
- contractData = this.contractslibrary.getContract(address);
53
- if (contractData) {
54
- return [2 /*return*/, contractData.script];
55
- }
56
- else {
57
- return [2 /*return*/, this.rpc.getNormalizedScript(address, unparsingMode, { block: block })];
58
- }
59
- return [2 /*return*/];
60
- });
61
- });
62
- };
63
- RpcWrapperContractsLibrary.prototype.getEntrypoints = function (contract, _a) {
64
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
65
- return __awaiter(this, void 0, void 0, function () {
66
- var contractData;
67
- return __generator(this, function (_c) {
68
- contractData = this.contractslibrary.getContract(contract);
69
- if (contractData) {
70
- return [2 /*return*/, contractData.entrypoints];
71
- }
72
- else {
73
- return [2 /*return*/, this.rpc.getEntrypoints(contract, { block: block })];
74
- }
75
- return [2 /*return*/];
76
- });
77
- });
78
- };
79
- RpcWrapperContractsLibrary.prototype.getBalance = function (address, _a) {
80
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
81
- return __awaiter(this, void 0, void 0, function () {
82
- return __generator(this, function (_c) {
83
- return [2 /*return*/, this.rpc.getBalance(address, { block: block })];
84
- });
85
- });
86
- };
87
- RpcWrapperContractsLibrary.prototype.getBlockHash = function (_a) {
88
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
89
- return __awaiter(this, void 0, void 0, function () {
90
- return __generator(this, function (_c) {
91
- return [2 /*return*/, this.rpc.getBlockHash({ block: block })];
92
- });
93
- });
94
- };
95
- RpcWrapperContractsLibrary.prototype.getLiveBlocks = function (_a) {
96
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
97
- return __awaiter(this, void 0, void 0, function () {
98
- return __generator(this, function (_c) {
99
- return [2 /*return*/, this.rpc.getLiveBlocks({ block: block })];
100
- });
101
- });
102
- };
103
- RpcWrapperContractsLibrary.prototype.getStorage = function (address, _a) {
104
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
105
- return __awaiter(this, void 0, void 0, function () {
106
- return __generator(this, function (_c) {
107
- return [2 /*return*/, this.rpc.getStorage(address, { block: block })];
108
- });
109
- });
110
- };
111
- RpcWrapperContractsLibrary.prototype.getScript = function (address, _a) {
112
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
113
- return __awaiter(this, void 0, void 0, function () {
114
- return __generator(this, function (_c) {
115
- return [2 /*return*/, this.rpc.getScript(address, { block: block })];
116
- });
117
- });
118
- };
119
- RpcWrapperContractsLibrary.prototype.getContract = function (address, _a) {
120
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
121
- return __awaiter(this, void 0, void 0, function () {
122
- return __generator(this, function (_c) {
123
- return [2 /*return*/, this.rpc.getContract(address, { block: block })];
124
- });
125
- });
126
- };
127
- RpcWrapperContractsLibrary.prototype.getManagerKey = function (address, _a) {
128
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
129
- return __awaiter(this, void 0, void 0, function () {
130
- return __generator(this, function (_c) {
131
- return [2 /*return*/, this.rpc.getManagerKey(address, { block: block })];
132
- });
133
- });
134
- };
135
- RpcWrapperContractsLibrary.prototype.getDelegate = function (address, _a) {
136
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
137
- return __awaiter(this, void 0, void 0, function () {
138
- return __generator(this, function (_c) {
139
- return [2 /*return*/, this.rpc.getDelegate(address, { block: block })];
140
- });
141
- });
142
- };
143
- RpcWrapperContractsLibrary.prototype.getBigMapKey = function (address, key, _a) {
144
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
145
- return __awaiter(this, void 0, void 0, function () {
146
- return __generator(this, function (_c) {
147
- return [2 /*return*/, this.rpc.getBigMapKey(address, key, { block: block })];
148
- });
149
- });
150
- };
151
- RpcWrapperContractsLibrary.prototype.getBigMapExpr = function (id, expr, _a) {
152
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
153
- return __awaiter(this, void 0, void 0, function () {
154
- return __generator(this, function (_c) {
155
- return [2 /*return*/, this.rpc.getBigMapExpr(id, expr, { block: block })];
156
- });
157
- });
158
- };
159
- RpcWrapperContractsLibrary.prototype.getDelegates = function (address, _a) {
160
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
161
- return __awaiter(this, void 0, void 0, function () {
162
- return __generator(this, function (_c) {
163
- return [2 /*return*/, this.rpc.getDelegates(address, { block: block })];
164
- });
165
- });
166
- };
167
- RpcWrapperContractsLibrary.prototype.getConstants = function (_a) {
168
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
169
- return __awaiter(this, void 0, void 0, function () {
170
- return __generator(this, function (_c) {
171
- return [2 /*return*/, this.rpc.getConstants({ block: block })];
172
- });
173
- });
174
- };
175
- RpcWrapperContractsLibrary.prototype.getBlock = function (_a) {
176
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
177
- return __awaiter(this, void 0, void 0, function () {
178
- return __generator(this, function (_c) {
179
- return [2 /*return*/, this.rpc.getBlock({ block: block })];
180
- });
181
- });
182
- };
183
- RpcWrapperContractsLibrary.prototype.getBlockHeader = function (_a) {
184
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
185
- return __awaiter(this, void 0, void 0, function () {
186
- return __generator(this, function (_c) {
187
- return [2 /*return*/, this.rpc.getBlockHeader({ block: block })];
188
- });
189
- });
190
- };
191
- RpcWrapperContractsLibrary.prototype.getBlockMetadata = function (_a) {
192
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
193
- return __awaiter(this, void 0, void 0, function () {
194
- return __generator(this, function (_c) {
195
- return [2 /*return*/, this.rpc.getBlockMetadata({ block: block })];
196
- });
197
- });
198
- };
199
- RpcWrapperContractsLibrary.prototype.getBakingRights = function (args, _a) {
200
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
201
- return __awaiter(this, void 0, void 0, function () {
202
- return __generator(this, function (_c) {
203
- return [2 /*return*/, this.rpc.getBakingRights(args, { block: block })];
204
- });
205
- });
206
- };
207
- RpcWrapperContractsLibrary.prototype.getEndorsingRights = function (args, _a) {
208
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
209
- return __awaiter(this, void 0, void 0, function () {
210
- return __generator(this, function (_c) {
211
- return [2 /*return*/, this.rpc.getEndorsingRights(args, { block: block })];
212
- });
213
- });
214
- };
215
- RpcWrapperContractsLibrary.prototype.getBallotList = function (_a) {
216
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
217
- return __awaiter(this, void 0, void 0, function () {
218
- return __generator(this, function (_c) {
219
- return [2 /*return*/, this.rpc.getBallotList({ block: block })];
220
- });
221
- });
222
- };
223
- RpcWrapperContractsLibrary.prototype.getBallots = function (_a) {
224
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
225
- return __awaiter(this, void 0, void 0, function () {
226
- return __generator(this, function (_c) {
227
- return [2 /*return*/, this.rpc.getBallots({ block: block })];
228
- });
229
- });
230
- };
231
- RpcWrapperContractsLibrary.prototype.getCurrentPeriodKind = function (_a) {
232
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
233
- return __awaiter(this, void 0, void 0, function () {
234
- return __generator(this, function (_c) {
235
- return [2 /*return*/, this.rpc.getCurrentPeriodKind({ block: block })];
236
- });
237
- });
238
- };
239
- RpcWrapperContractsLibrary.prototype.getCurrentProposal = function (_a) {
240
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
241
- return __awaiter(this, void 0, void 0, function () {
242
- return __generator(this, function (_c) {
243
- return [2 /*return*/, this.rpc.getCurrentProposal({ block: block })];
244
- });
245
- });
246
- };
247
- RpcWrapperContractsLibrary.prototype.getCurrentQuorum = function (_a) {
248
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
249
- return __awaiter(this, void 0, void 0, function () {
250
- return __generator(this, function (_c) {
251
- return [2 /*return*/, this.rpc.getCurrentQuorum({ block: block })];
252
- });
253
- });
254
- };
255
- RpcWrapperContractsLibrary.prototype.getVotesListings = function (_a) {
256
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
257
- return __awaiter(this, void 0, void 0, function () {
258
- return __generator(this, function (_c) {
259
- return [2 /*return*/, this.rpc.getVotesListings({ block: block })];
260
- });
261
- });
262
- };
263
- RpcWrapperContractsLibrary.prototype.getProposals = function (_a) {
264
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
265
- return __awaiter(this, void 0, void 0, function () {
266
- return __generator(this, function (_c) {
267
- return [2 /*return*/, this.rpc.getProposals({ block: block })];
268
- });
269
- });
270
- };
271
- RpcWrapperContractsLibrary.prototype.forgeOperations = function (data, _a) {
272
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
273
- return __awaiter(this, void 0, void 0, function () {
274
- return __generator(this, function (_c) {
275
- return [2 /*return*/, this.rpc.forgeOperations(data, { block: block })];
276
- });
277
- });
278
- };
279
- RpcWrapperContractsLibrary.prototype.injectOperation = function (signedOpBytes) {
280
- return __awaiter(this, void 0, void 0, function () {
281
- return __generator(this, function (_a) {
282
- return [2 /*return*/, this.rpc.injectOperation(signedOpBytes)];
283
- });
284
- });
285
- };
286
- RpcWrapperContractsLibrary.prototype.packData = function (data, _a) {
287
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
288
- return __awaiter(this, void 0, void 0, function () {
289
- return __generator(this, function (_c) {
290
- return [2 /*return*/, this.rpc.packData(data, { block: block })];
291
- });
292
- });
293
- };
294
- RpcWrapperContractsLibrary.prototype.preapplyOperations = function (ops, _a) {
295
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
296
- return __awaiter(this, void 0, void 0, function () {
297
- return __generator(this, function (_c) {
298
- return [2 /*return*/, this.rpc.preapplyOperations(ops, { block: block })];
299
- });
300
- });
301
- };
302
- RpcWrapperContractsLibrary.prototype.runOperation = function (op, _a) {
303
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
304
- return __awaiter(this, void 0, void 0, function () {
305
- return __generator(this, function (_c) {
306
- return [2 /*return*/, this.rpc.runOperation(op, { block: block })];
307
- });
308
- });
309
- };
310
- RpcWrapperContractsLibrary.prototype.runCode = function (code, _a) {
311
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
312
- return __awaiter(this, void 0, void 0, function () {
313
- return __generator(this, function (_c) {
314
- return [2 /*return*/, this.rpc.runCode(code, { block: block })];
315
- });
316
- });
317
- };
318
- RpcWrapperContractsLibrary.prototype.getChainId = function () {
319
- return __awaiter(this, void 0, void 0, function () {
320
- return __generator(this, function (_a) {
321
- return [2 /*return*/, this.rpc.getChainId()];
322
- });
323
- });
324
- };
325
- RpcWrapperContractsLibrary.prototype.getRpcUrl = function () {
34
+ getNormalizedScript(address, unparsingMode = { unparsing_mode: 'Readable' }, { block } = rpc_1.defaultRPCOptions) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ const contractData = this.contractslibrary.getContract(address);
37
+ if (contractData) {
38
+ return contractData.script;
39
+ }
40
+ else {
41
+ return this.rpc.getNormalizedScript(address, unparsingMode, { block });
42
+ }
43
+ });
44
+ }
45
+ getEntrypoints(contract, { block } = rpc_1.defaultRPCOptions) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ const contractData = this.contractslibrary.getContract(contract);
48
+ if (contractData) {
49
+ return contractData.entrypoints;
50
+ }
51
+ else {
52
+ return this.rpc.getEntrypoints(contract, { block });
53
+ }
54
+ });
55
+ }
56
+ getBalance(address, { block } = rpc_1.defaultRPCOptions) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return this.rpc.getBalance(address, { block });
59
+ });
60
+ }
61
+ getBlockHash({ block } = rpc_1.defaultRPCOptions) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ return this.rpc.getBlockHash({ block });
64
+ });
65
+ }
66
+ getLiveBlocks({ block } = rpc_1.defaultRPCOptions) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ return this.rpc.getLiveBlocks({ block });
69
+ });
70
+ }
71
+ getStorage(address, { block } = rpc_1.defaultRPCOptions) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ return this.rpc.getStorage(address, { block });
74
+ });
75
+ }
76
+ getScript(address, { block } = rpc_1.defaultRPCOptions) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ return this.rpc.getScript(address, { block });
79
+ });
80
+ }
81
+ getContract(address, { block } = rpc_1.defaultRPCOptions) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ return this.rpc.getContract(address, { block });
84
+ });
85
+ }
86
+ getManagerKey(address, { block } = rpc_1.defaultRPCOptions) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ return this.rpc.getManagerKey(address, { block });
89
+ });
90
+ }
91
+ getDelegate(address, { block } = rpc_1.defaultRPCOptions) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ return this.rpc.getDelegate(address, { block });
94
+ });
95
+ }
96
+ getBigMapKey(address, key, { block } = rpc_1.defaultRPCOptions) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ return this.rpc.getBigMapKey(address, key, { block });
99
+ });
100
+ }
101
+ getBigMapExpr(id, expr, { block } = rpc_1.defaultRPCOptions) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ return this.rpc.getBigMapExpr(id, expr, { block });
104
+ });
105
+ }
106
+ getDelegates(address, { block } = rpc_1.defaultRPCOptions) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return this.rpc.getDelegates(address, { block });
109
+ });
110
+ }
111
+ getConstants({ block } = rpc_1.defaultRPCOptions) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ return this.rpc.getConstants({ block });
114
+ });
115
+ }
116
+ getBlock({ block } = rpc_1.defaultRPCOptions) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ return this.rpc.getBlock({ block });
119
+ });
120
+ }
121
+ getBlockHeader({ block } = rpc_1.defaultRPCOptions) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ return this.rpc.getBlockHeader({ block });
124
+ });
125
+ }
126
+ getBlockMetadata({ block } = rpc_1.defaultRPCOptions) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ return this.rpc.getBlockMetadata({ block });
129
+ });
130
+ }
131
+ getBakingRights(args, { block } = rpc_1.defaultRPCOptions) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ return this.rpc.getBakingRights(args, { block });
134
+ });
135
+ }
136
+ getEndorsingRights(args, { block } = rpc_1.defaultRPCOptions) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ return this.rpc.getEndorsingRights(args, { block });
139
+ });
140
+ }
141
+ getBallotList({ block } = rpc_1.defaultRPCOptions) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ return this.rpc.getBallotList({ block });
144
+ });
145
+ }
146
+ getBallots({ block } = rpc_1.defaultRPCOptions) {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ return this.rpc.getBallots({ block });
149
+ });
150
+ }
151
+ getCurrentProposal({ block, } = rpc_1.defaultRPCOptions) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ return this.rpc.getCurrentProposal({ block });
154
+ });
155
+ }
156
+ getCurrentQuorum({ block } = rpc_1.defaultRPCOptions) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ return this.rpc.getCurrentQuorum({ block });
159
+ });
160
+ }
161
+ getVotesListings({ block, } = rpc_1.defaultRPCOptions) {
162
+ return __awaiter(this, void 0, void 0, function* () {
163
+ return this.rpc.getVotesListings({ block });
164
+ });
165
+ }
166
+ getProposals({ block } = rpc_1.defaultRPCOptions) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ return this.rpc.getProposals({ block });
169
+ });
170
+ }
171
+ forgeOperations(data, { block } = rpc_1.defaultRPCOptions) {
172
+ return __awaiter(this, void 0, void 0, function* () {
173
+ return this.rpc.forgeOperations(data, { block });
174
+ });
175
+ }
176
+ injectOperation(signedOpBytes) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ return this.rpc.injectOperation(signedOpBytes);
179
+ });
180
+ }
181
+ packData(data, { block } = rpc_1.defaultRPCOptions) {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ return this.rpc.packData(data, { block });
184
+ });
185
+ }
186
+ preapplyOperations(ops, { block } = rpc_1.defaultRPCOptions) {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ return this.rpc.preapplyOperations(ops, { block });
189
+ });
190
+ }
191
+ runOperation(op, { block } = rpc_1.defaultRPCOptions) {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ return this.rpc.runOperation(op, { block });
194
+ });
195
+ }
196
+ runCode(code, { block } = rpc_1.defaultRPCOptions) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ return this.rpc.runCode(code, { block });
199
+ });
200
+ }
201
+ runView(_a, { block } = rpc_1.defaultRPCOptions) {
202
+ var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
203
+ return __awaiter(this, void 0, void 0, function* () {
204
+ return this.rpc.runView(Object.assign({ unparsing_mode }, rest), { block });
205
+ });
206
+ }
207
+ getChainId() {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ return this.rpc.getChainId();
210
+ });
211
+ }
212
+ getRpcUrl() {
326
213
  return this.rpc.getRpcUrl();
327
- };
328
- RpcWrapperContractsLibrary.prototype.getCurrentPeriod = function (_a) {
329
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
330
- return __awaiter(this, void 0, void 0, function () {
331
- return __generator(this, function (_c) {
332
- return [2 /*return*/, this.rpc.getCurrentPeriod({ block: block })];
333
- });
334
- });
335
- };
336
- RpcWrapperContractsLibrary.prototype.getSuccessorPeriod = function (_a) {
337
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
338
- return __awaiter(this, void 0, void 0, function () {
339
- return __generator(this, function (_c) {
340
- return [2 /*return*/, this.rpc.getSuccessorPeriod({ block: block })];
341
- });
342
- });
343
- };
344
- RpcWrapperContractsLibrary.prototype.getSaplingDiffById = function (id, _a) {
345
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
346
- return __awaiter(this, void 0, void 0, function () {
347
- return __generator(this, function (_c) {
348
- return [2 /*return*/, this.rpc.getSaplingDiffById(id, { block: block })];
349
- });
350
- });
351
- };
352
- RpcWrapperContractsLibrary.prototype.getSaplingDiffByContract = function (contract, _a) {
353
- var _b = _a === void 0 ? rpc_1.defaultRPCOptions : _a, block = _b.block;
354
- return __awaiter(this, void 0, void 0, function () {
355
- return __generator(this, function (_c) {
356
- return [2 /*return*/, this.rpc.getSaplingDiffByContract(contract, { block: block })];
357
- });
358
- });
359
- };
360
- return RpcWrapperContractsLibrary;
361
- }());
214
+ }
215
+ getCurrentPeriod({ block, } = rpc_1.defaultRPCOptions) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ return this.rpc.getCurrentPeriod({ block });
218
+ });
219
+ }
220
+ getSuccessorPeriod({ block, } = rpc_1.defaultRPCOptions) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ return this.rpc.getSuccessorPeriod({ block });
223
+ });
224
+ }
225
+ getSaplingDiffById(id, { block } = rpc_1.defaultRPCOptions) {
226
+ return __awaiter(this, void 0, void 0, function* () {
227
+ return this.rpc.getSaplingDiffById(id, { block });
228
+ });
229
+ }
230
+ getSaplingDiffByContract(contract, { block } = rpc_1.defaultRPCOptions) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ return this.rpc.getSaplingDiffByContract(contract, { block });
233
+ });
234
+ }
235
+ getProtocols({ block } = rpc_1.defaultRPCOptions) {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ return this.rpc.getProtocols({ block });
238
+ });
239
+ }
240
+ }
362
241
  exports.RpcWrapperContractsLibrary = RpcWrapperContractsLibrary;
363
242
  //# sourceMappingURL=rpc-wrapper.js.map