@taquito/contracts-library 11.0.2 → 11.2.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.
@@ -1,37 +1,16 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
2
  Object.defineProperty(exports, "__esModule", { value: true });
16
3
  exports.InvalidScriptFormatError = exports.InvalidAddressError = void 0;
17
- var InvalidAddressError = /** @class */ (function (_super) {
18
- __extends(InvalidAddressError, _super);
19
- function InvalidAddressError(message) {
20
- var _this = _super.call(this, message) || this;
21
- Object.setPrototypeOf(_this, InvalidAddressError.prototype);
22
- return _this;
4
+ class InvalidAddressError extends Error {
5
+ constructor(message) {
6
+ super(message);
23
7
  }
24
- return InvalidAddressError;
25
- }(Error));
8
+ }
26
9
  exports.InvalidAddressError = InvalidAddressError;
27
- var InvalidScriptFormatError = /** @class */ (function (_super) {
28
- __extends(InvalidScriptFormatError, _super);
29
- function InvalidScriptFormatError(message) {
30
- var _this = _super.call(this, message) || this;
31
- Object.setPrototypeOf(_this, InvalidScriptFormatError.prototype);
32
- return _this;
10
+ class InvalidScriptFormatError extends Error {
11
+ constructor(message) {
12
+ super(message);
33
13
  }
34
- return InvalidScriptFormatError;
35
- }(Error));
14
+ }
36
15
  exports.InvalidScriptFormatError = InvalidScriptFormatError;
37
16
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;IAAyC,uCAAK;IAC1C,6BAAY,OAAe;QAA3B,YACI,kBAAM,OAAO,CAAC,SAEjB;QADG,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA;;IAC9D,CAAC;IACL,0BAAC;AAAD,CAAC,AALD,CAAyC,KAAK,GAK7C;AALY,kDAAmB;AAOhC;IAA8C,4CAAK;IAC/C,kCAAY,OAAe;QAA3B,YACI,kBAAM,OAAO,CAAC,SAEjB;QADG,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAA;;IACnE,CAAC;IACL,+BAAC;AAAD,CAAC,AALD,CAA8C,KAAK,GAKlD;AALY,4DAAwB"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAJD,kDAIC;AAED,MAAa,wBAAyB,SAAQ,KAAK;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAJD,4DAIC"}
@@ -8,356 +8,214 @@ 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
- }
37
- };
38
11
  Object.defineProperty(exports, "__esModule", { value: true });
39
12
  exports.RpcWrapperContractsLibrary = void 0;
40
- var rpc_1 = require("@taquito/rpc");
41
- var RpcWrapperContractsLibrary = /** @class */ (function () {
42
- function RpcWrapperContractsLibrary(rpc, contractslibrary) {
13
+ const rpc_1 = require("@taquito/rpc");
14
+ class RpcWrapperContractsLibrary {
15
+ constructor(rpc, contractslibrary) {
43
16
  this.rpc = rpc;
44
17
  this.contractslibrary = contractslibrary;
45
18
  }
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 () {
19
+ getNormalizedScript(address, unparsingMode = { unparsing_mode: 'Readable' }, { block } = rpc_1.defaultRPCOptions) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const contractData = this.contractslibrary.getContract(address);
22
+ if (contractData) {
23
+ return contractData.script;
24
+ }
25
+ else {
26
+ return this.rpc.getNormalizedScript(address, unparsingMode, { block });
27
+ }
28
+ });
29
+ }
30
+ getEntrypoints(contract, { block } = rpc_1.defaultRPCOptions) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ const contractData = this.contractslibrary.getContract(contract);
33
+ if (contractData) {
34
+ return contractData.entrypoints;
35
+ }
36
+ else {
37
+ return this.rpc.getEntrypoints(contract, { block });
38
+ }
39
+ });
40
+ }
41
+ getBalance(address, { block } = rpc_1.defaultRPCOptions) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ return this.rpc.getBalance(address, { block });
44
+ });
45
+ }
46
+ getBlockHash({ block } = rpc_1.defaultRPCOptions) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ return this.rpc.getBlockHash({ block });
49
+ });
50
+ }
51
+ getLiveBlocks({ block } = rpc_1.defaultRPCOptions) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ return this.rpc.getLiveBlocks({ block });
54
+ });
55
+ }
56
+ getStorage(address, { block } = rpc_1.defaultRPCOptions) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return this.rpc.getStorage(address, { block });
59
+ });
60
+ }
61
+ getScript(address, { block } = rpc_1.defaultRPCOptions) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ return this.rpc.getScript(address, { block });
64
+ });
65
+ }
66
+ getContract(address, { block } = rpc_1.defaultRPCOptions) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ return this.rpc.getContract(address, { block });
69
+ });
70
+ }
71
+ getManagerKey(address, { block } = rpc_1.defaultRPCOptions) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ return this.rpc.getManagerKey(address, { block });
74
+ });
75
+ }
76
+ getDelegate(address, { block } = rpc_1.defaultRPCOptions) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ return this.rpc.getDelegate(address, { block });
79
+ });
80
+ }
81
+ getBigMapKey(address, key, { block } = rpc_1.defaultRPCOptions) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ return this.rpc.getBigMapKey(address, key, { block });
84
+ });
85
+ }
86
+ getBigMapExpr(id, expr, { block } = rpc_1.defaultRPCOptions) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ return this.rpc.getBigMapExpr(id, expr, { block });
89
+ });
90
+ }
91
+ getDelegates(address, { block } = rpc_1.defaultRPCOptions) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ return this.rpc.getDelegates(address, { block });
94
+ });
95
+ }
96
+ getConstants({ block } = rpc_1.defaultRPCOptions) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ return this.rpc.getConstants({ block });
99
+ });
100
+ }
101
+ getBlock({ block } = rpc_1.defaultRPCOptions) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ return this.rpc.getBlock({ block });
104
+ });
105
+ }
106
+ getBlockHeader({ block } = rpc_1.defaultRPCOptions) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return this.rpc.getBlockHeader({ block });
109
+ });
110
+ }
111
+ getBlockMetadata({ block } = rpc_1.defaultRPCOptions) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ return this.rpc.getBlockMetadata({ block });
114
+ });
115
+ }
116
+ getBakingRights(args, { block } = rpc_1.defaultRPCOptions) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ return this.rpc.getBakingRights(args, { block });
119
+ });
120
+ }
121
+ getEndorsingRights(args, { block } = rpc_1.defaultRPCOptions) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ return this.rpc.getEndorsingRights(args, { block });
124
+ });
125
+ }
126
+ getBallotList({ block } = rpc_1.defaultRPCOptions) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ return this.rpc.getBallotList({ block });
129
+ });
130
+ }
131
+ getBallots({ block } = rpc_1.defaultRPCOptions) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ return this.rpc.getBallots({ block });
134
+ });
135
+ }
136
+ getCurrentPeriodKind({ block, } = rpc_1.defaultRPCOptions) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ return this.rpc.getCurrentPeriodKind({ block });
139
+ });
140
+ }
141
+ getCurrentProposal({ block, } = rpc_1.defaultRPCOptions) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ return this.rpc.getCurrentProposal({ block });
144
+ });
145
+ }
146
+ getCurrentQuorum({ block } = rpc_1.defaultRPCOptions) {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ return this.rpc.getCurrentQuorum({ block });
149
+ });
150
+ }
151
+ getVotesListings({ block, } = rpc_1.defaultRPCOptions) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ return this.rpc.getVotesListings({ block });
154
+ });
155
+ }
156
+ getProposals({ block } = rpc_1.defaultRPCOptions) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ return this.rpc.getProposals({ block });
159
+ });
160
+ }
161
+ forgeOperations(data, { block } = rpc_1.defaultRPCOptions) {
162
+ return __awaiter(this, void 0, void 0, function* () {
163
+ return this.rpc.forgeOperations(data, { block });
164
+ });
165
+ }
166
+ injectOperation(signedOpBytes) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ return this.rpc.injectOperation(signedOpBytes);
169
+ });
170
+ }
171
+ packData(data, { block } = rpc_1.defaultRPCOptions) {
172
+ return __awaiter(this, void 0, void 0, function* () {
173
+ return this.rpc.packData(data, { block });
174
+ });
175
+ }
176
+ preapplyOperations(ops, { block } = rpc_1.defaultRPCOptions) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ return this.rpc.preapplyOperations(ops, { block });
179
+ });
180
+ }
181
+ runOperation(op, { block } = rpc_1.defaultRPCOptions) {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ return this.rpc.runOperation(op, { block });
184
+ });
185
+ }
186
+ runCode(code, { block } = rpc_1.defaultRPCOptions) {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ return this.rpc.runCode(code, { block });
189
+ });
190
+ }
191
+ getChainId() {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ return this.rpc.getChainId();
194
+ });
195
+ }
196
+ getRpcUrl() {
326
197
  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
- }());
198
+ }
199
+ getCurrentPeriod({ block, } = rpc_1.defaultRPCOptions) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ return this.rpc.getCurrentPeriod({ block });
202
+ });
203
+ }
204
+ getSuccessorPeriod({ block, } = rpc_1.defaultRPCOptions) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ return this.rpc.getSuccessorPeriod({ block });
207
+ });
208
+ }
209
+ getSaplingDiffById(id, { block } = rpc_1.defaultRPCOptions) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ return this.rpc.getSaplingDiffById(id, { block });
212
+ });
213
+ }
214
+ getSaplingDiffByContract(contract, { block } = rpc_1.defaultRPCOptions) {
215
+ return __awaiter(this, void 0, void 0, function* () {
216
+ return this.rpc.getSaplingDiffByContract(contract, { block });
217
+ });
218
+ }
219
+ }
362
220
  exports.RpcWrapperContractsLibrary = RpcWrapperContractsLibrary;
363
221
  //# sourceMappingURL=rpc-wrapper.js.map