@taquito/rpc 12.1.0 → 13.0.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.
- package/dist/lib/opkind.js +9 -0
- package/dist/lib/opkind.js.map +1 -1
- package/dist/lib/rpc-client-interface.js +38 -1
- package/dist/lib/rpc-client-interface.js.map +1 -1
- package/dist/lib/rpc-client-modules/rpc-cache.js +156 -79
- package/dist/lib/rpc-client-modules/rpc-cache.js.map +1 -1
- package/dist/lib/taquito-rpc.js +36 -0
- package/dist/lib/taquito-rpc.js.map +1 -1
- package/dist/lib/types.js +8 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/version.js +2 -2
- package/dist/taquito-rpc.es6.js +211 -46
- package/dist/taquito-rpc.es6.js.map +1 -1
- package/dist/taquito-rpc.umd.js +210 -45
- package/dist/taquito-rpc.umd.js.map +1 -1
- package/dist/types/opkind.d.ts +10 -1
- package/dist/types/rpc-client-interface.d.ts +39 -1
- package/dist/types/rpc-client-modules/rpc-cache.d.ts +7 -1
- package/dist/types/taquito-rpc.d.ts +26 -1
- package/dist/types/types.d.ts +487 -17
- package/package.json +4 -4
package/dist/lib/opkind.js
CHANGED
|
@@ -20,5 +20,14 @@ var OpKind;
|
|
|
20
20
|
OpKind["BALLOT"] = "ballot";
|
|
21
21
|
OpKind["FAILING_NOOP"] = "failing_noop";
|
|
22
22
|
OpKind["REGISTER_GLOBAL_CONSTANT"] = "register_global_constant";
|
|
23
|
+
OpKind["TX_ROLLUP_ORIGINATION"] = "tx_rollup_origination";
|
|
24
|
+
OpKind["TX_ROLLUP_SUBMIT_BATCH"] = "tx_rollup_submit_batch";
|
|
25
|
+
OpKind["TX_ROLLUP_COMMIT"] = "tx_rollup_commit";
|
|
26
|
+
OpKind["TX_ROLLUP_RETURN_BOND"] = "tx_rollup_return_bond";
|
|
27
|
+
OpKind["TX_ROLLUP_FINALIZE_COMMITMENT"] = "tx_rollup_finalize_commitment";
|
|
28
|
+
OpKind["TX_ROLLUP_REMOVE_COMMITMENT"] = "tx_rollup_remove_commitment";
|
|
29
|
+
OpKind["TX_ROLLUP_REJECTION"] = "tx_rollup_rejection";
|
|
30
|
+
OpKind["TX_ROLLUP_DISPATCH_TICKETS"] = "tx_rollup_dispatch_tickets";
|
|
31
|
+
OpKind["TRANSFER_TICKET"] = "transfer_ticket";
|
|
23
32
|
})(OpKind = exports.OpKind || (exports.OpKind = {}));
|
|
24
33
|
//# sourceMappingURL=opkind.js.map
|
package/dist/lib/opkind.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opkind.js","sourceRoot":"","sources":["../../src/opkind.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"opkind.js","sourceRoot":"","sources":["../../src/opkind.ts"],"names":[],"mappings":";;;AAAA,IAAY,MA2BX;AA3BD,WAAY,MAAM;IAChB,qCAA2B,CAAA;IAC3B,mCAAyB,CAAA;IACzB,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,yCAA+B,CAAA;IAC/B,qCAA2B,CAAA;IAC3B,2CAAiC,CAAA;IACjC,mDAAyC,CAAA;IACzC,2EAAiE,CAAA;IACjE,yDAA+C,CAAA;IAC/C,yDAA+C,CAAA;IAC/C,qEAA2D,CAAA;IAC3D,2DAAiD,CAAA;IACjD,iCAAuB,CAAA;IACvB,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,+DAAqD,CAAA;IACrD,yDAA+C,CAAA;IAC/C,2DAAiD,CAAA;IACjD,+CAAqC,CAAA;IACrC,yDAA+C,CAAA;IAC/C,yEAA+D,CAAA;IAC/D,qEAA2D,CAAA;IAC3D,qDAA2C,CAAA;IAC3C,mEAAyD,CAAA;IACzD,6CAAmC,CAAA;AACrC,CAAC,EA3BW,MAAM,GAAN,cAAM,KAAN,cAAM,QA2BjB"}
|
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultRPCOptions = exports.defaultChain = void 0;
|
|
3
|
+
exports.RPCMethodName = exports.defaultRPCOptions = exports.defaultChain = void 0;
|
|
4
4
|
exports.defaultChain = 'main';
|
|
5
5
|
exports.defaultRPCOptions = { block: 'head' };
|
|
6
|
+
var RPCMethodName;
|
|
7
|
+
(function (RPCMethodName) {
|
|
8
|
+
RPCMethodName["GET_BAKING_RIGHTS"] = "getBakingRights";
|
|
9
|
+
RPCMethodName["GET_BALLOTS"] = "getBallots";
|
|
10
|
+
RPCMethodName["GET_BALLOT_LIST"] = "getBallotList";
|
|
11
|
+
RPCMethodName["GET_BIG_MAP_KEY"] = "getBigMapKey";
|
|
12
|
+
RPCMethodName["GET_BIG_MAP_EXPR"] = "getBigMapExpr";
|
|
13
|
+
RPCMethodName["GET_BLOCK_HASH"] = "getBlockHash";
|
|
14
|
+
RPCMethodName["GET_BLOCK"] = "getBlock";
|
|
15
|
+
RPCMethodName["GET_BLOCK_HEADER"] = "getBlockHeader";
|
|
16
|
+
RPCMethodName["GET_BLOCK_METADATA"] = "getBlockMetadata";
|
|
17
|
+
RPCMethodName["GET_BALANCE"] = "getBalance";
|
|
18
|
+
RPCMethodName["GET_CHAIN_ID"] = "getChainId";
|
|
19
|
+
RPCMethodName["GET_CONSTANTS"] = "getConstants";
|
|
20
|
+
RPCMethodName["GET_CONTRACT"] = "getContract";
|
|
21
|
+
RPCMethodName["GET_CURRENT_PERIOD"] = "getCurrentPeriod";
|
|
22
|
+
RPCMethodName["GET_CURRENT_PROPOSAL"] = "getCurrentProposal";
|
|
23
|
+
RPCMethodName["GET_CURRENT_QUORUM"] = "getCurrentQuorum";
|
|
24
|
+
RPCMethodName["GET_DELEGATE"] = "getDelegate";
|
|
25
|
+
RPCMethodName["GET_DELEGATES"] = "getDelegates";
|
|
26
|
+
RPCMethodName["GET_ENDORSING_RIGHTS"] = "getEndorsingRights";
|
|
27
|
+
RPCMethodName["GET_ENTRYPOINTS"] = "getEntrypoints";
|
|
28
|
+
RPCMethodName["GET_LIVE_BLOCKS"] = "getLiveBlocks";
|
|
29
|
+
RPCMethodName["GET_MANAGER_KEY"] = "getManagerKey";
|
|
30
|
+
RPCMethodName["GET_NORMALIZED_SCRIPT"] = "getNormalizedScript";
|
|
31
|
+
RPCMethodName["GET_PROPOSALS"] = "getProposals";
|
|
32
|
+
RPCMethodName["GET_PROTOCOLS"] = "getProtocols";
|
|
33
|
+
RPCMethodName["GET_SAPLING_DIFF_BY_CONTRACT"] = "getSaplingDiffByContract";
|
|
34
|
+
RPCMethodName["GET_SAPLING_DIFF_BY_ID"] = "getSaplingDiffById";
|
|
35
|
+
RPCMethodName["GET_SCRIPT"] = "getScript";
|
|
36
|
+
RPCMethodName["GET_STORAGE"] = "getStorage";
|
|
37
|
+
RPCMethodName["GET_SUCCESSOR_PERIOD"] = "getSuccessorPeriod";
|
|
38
|
+
RPCMethodName["GET_TX_ROLLUP_INBOX"] = "getTxRollupInbox";
|
|
39
|
+
RPCMethodName["GET_TX_ROLLUP_STATE"] = "getTxRollupState";
|
|
40
|
+
RPCMethodName["GET_VOTES_LISTINGS"] = "getVotesListings";
|
|
41
|
+
RPCMethodName["PACK_DATA"] = "packData";
|
|
42
|
+
})(RPCMethodName = exports.RPCMethodName || (exports.RPCMethodName = {}));
|
|
6
43
|
//# sourceMappingURL=rpc-client-interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client-interface.js","sourceRoot":"","sources":["../../src/rpc-client-interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"rpc-client-interface.js","sourceRoot":"","sources":["../../src/rpc-client-interface.ts"],"names":[],"mappings":";;;AAiDa,QAAA,YAAY,GAAG,MAAM,CAAC;AACtB,QAAA,iBAAiB,GAAe,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AA+D/D,IAAY,aAmCX;AAnCD,WAAY,aAAa;IACvB,sDAAqC,CAAA;IACrC,2CAA0B,CAAA;IAC1B,kDAAiC,CAAA;IACjC,iDAAgC,CAAA;IAChC,mDAAkC,CAAA;IAClC,gDAA+B,CAAA;IAC/B,uCAAsB,CAAA;IACtB,oDAAmC,CAAA;IACnC,wDAAuC,CAAA;IACvC,2CAA0B,CAAA;IAC1B,4CAA2B,CAAA;IAC3B,+CAA8B,CAAA;IAC9B,6CAA4B,CAAA;IAC5B,wDAAuC,CAAA;IACvC,4DAA2C,CAAA;IAC3C,wDAAuC,CAAA;IACvC,6CAA4B,CAAA;IAC5B,+CAA8B,CAAA;IAC9B,4DAA2C,CAAA;IAC3C,mDAAkC,CAAA;IAClC,kDAAiC,CAAA;IACjC,kDAAiC,CAAA;IACjC,8DAA6C,CAAA;IAC7C,+CAA8B,CAAA;IAC9B,+CAA8B,CAAA;IAC9B,0EAAyD,CAAA;IACzD,8DAA6C,CAAA;IAC7C,yCAAwB,CAAA;IACxB,2CAA0B,CAAA;IAC1B,4DAA2C,CAAA;IAC3C,yDAAwC,CAAA;IACxC,yDAAwC,CAAA;IACxC,wDAAuC,CAAA;IACvC,uCAAsB,CAAA;AACxB,CAAC,EAnCW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAmCxB"}
|
|
@@ -21,7 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.RpcClientCache = void 0;
|
|
24
|
-
const rpc_client_interface_1 = require("
|
|
24
|
+
const rpc_client_interface_1 = require("./../rpc-client-interface");
|
|
25
|
+
const rpc_client_interface_2 = require("../rpc-client-interface");
|
|
25
26
|
const utils_1 = require("@taquito/utils");
|
|
26
27
|
const defaultTtl = 1000;
|
|
27
28
|
/***
|
|
@@ -99,9 +100,11 @@ class RpcClientCache {
|
|
|
99
100
|
*
|
|
100
101
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-hash
|
|
101
102
|
*/
|
|
102
|
-
getBlockHash({ block } =
|
|
103
|
+
getBlockHash({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
103
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
105
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BLOCK_HASH, [
|
|
106
|
+
block,
|
|
107
|
+
]);
|
|
105
108
|
if (this.has(key)) {
|
|
106
109
|
return this.get(key);
|
|
107
110
|
}
|
|
@@ -120,9 +123,11 @@ class RpcClientCache {
|
|
|
120
123
|
*
|
|
121
124
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-live-blocks
|
|
122
125
|
*/
|
|
123
|
-
getLiveBlocks({ block } =
|
|
126
|
+
getLiveBlocks({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
124
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
128
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_LIVE_BLOCKS, [
|
|
129
|
+
block,
|
|
130
|
+
]);
|
|
126
131
|
if (this.has(key)) {
|
|
127
132
|
return this.get(key);
|
|
128
133
|
}
|
|
@@ -142,10 +147,13 @@ class RpcClientCache {
|
|
|
142
147
|
*
|
|
143
148
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance
|
|
144
149
|
*/
|
|
145
|
-
getBalance(address, { block } =
|
|
150
|
+
getBalance(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
146
151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
152
|
this.validateAddress(address);
|
|
148
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
153
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BALANCE, [
|
|
154
|
+
block,
|
|
155
|
+
address,
|
|
156
|
+
]);
|
|
149
157
|
if (this.has(key)) {
|
|
150
158
|
return this.get(key);
|
|
151
159
|
}
|
|
@@ -165,10 +173,13 @@ class RpcClientCache {
|
|
|
165
173
|
*
|
|
166
174
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-storage
|
|
167
175
|
*/
|
|
168
|
-
getStorage(address, { block } =
|
|
176
|
+
getStorage(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
169
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
178
|
this.validateContract(address);
|
|
171
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
179
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_STORAGE, [
|
|
180
|
+
block,
|
|
181
|
+
address,
|
|
182
|
+
]);
|
|
172
183
|
if (this.has(key)) {
|
|
173
184
|
return this.get(key);
|
|
174
185
|
}
|
|
@@ -188,10 +199,13 @@ class RpcClientCache {
|
|
|
188
199
|
*
|
|
189
200
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-script
|
|
190
201
|
*/
|
|
191
|
-
getScript(address, { block } =
|
|
202
|
+
getScript(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
192
203
|
return __awaiter(this, void 0, void 0, function* () {
|
|
193
204
|
this.validateContract(address);
|
|
194
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
205
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_SCRIPT, [
|
|
206
|
+
block,
|
|
207
|
+
address,
|
|
208
|
+
]);
|
|
195
209
|
if (this.has(key)) {
|
|
196
210
|
return this.get(key);
|
|
197
211
|
}
|
|
@@ -211,14 +225,10 @@ class RpcClientCache {
|
|
|
211
225
|
* @description Access the script of the contract and normalize it using the requested unparsing mode.
|
|
212
226
|
*
|
|
213
227
|
*/
|
|
214
|
-
getNormalizedScript(address, unparsingMode = { unparsing_mode: 'Readable' }, { block } =
|
|
228
|
+
getNormalizedScript(address, unparsingMode = { unparsing_mode: 'Readable' }, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
215
229
|
return __awaiter(this, void 0, void 0, function* () {
|
|
216
230
|
this.validateContract(address);
|
|
217
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
218
|
-
block,
|
|
219
|
-
address,
|
|
220
|
-
unparsingMode,
|
|
221
|
-
]);
|
|
231
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_NORMALIZED_SCRIPT, [block, address, unparsingMode]);
|
|
222
232
|
if (this.has(key)) {
|
|
223
233
|
return this.get(key);
|
|
224
234
|
}
|
|
@@ -238,10 +248,13 @@ class RpcClientCache {
|
|
|
238
248
|
*
|
|
239
249
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id
|
|
240
250
|
*/
|
|
241
|
-
getContract(address, { block } =
|
|
251
|
+
getContract(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
242
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
243
253
|
this.validateAddress(address);
|
|
244
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
254
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_CONTRACT, [
|
|
255
|
+
block,
|
|
256
|
+
address,
|
|
257
|
+
]);
|
|
245
258
|
if (this.has(key)) {
|
|
246
259
|
return this.get(key);
|
|
247
260
|
}
|
|
@@ -261,10 +274,13 @@ class RpcClientCache {
|
|
|
261
274
|
*
|
|
262
275
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-manager-key
|
|
263
276
|
*/
|
|
264
|
-
getManagerKey(address, { block } =
|
|
277
|
+
getManagerKey(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
265
278
|
return __awaiter(this, void 0, void 0, function* () {
|
|
266
279
|
this.validateAddress(address);
|
|
267
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
280
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_MANAGER_KEY, [
|
|
281
|
+
block,
|
|
282
|
+
address,
|
|
283
|
+
]);
|
|
268
284
|
if (this.has(key)) {
|
|
269
285
|
return this.get(key);
|
|
270
286
|
}
|
|
@@ -284,10 +300,13 @@ class RpcClientCache {
|
|
|
284
300
|
*
|
|
285
301
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-delegate
|
|
286
302
|
*/
|
|
287
|
-
getDelegate(address, { block } =
|
|
303
|
+
getDelegate(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
288
304
|
return __awaiter(this, void 0, void 0, function* () {
|
|
289
305
|
this.validateAddress(address);
|
|
290
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
306
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_DELEGATE, [
|
|
307
|
+
block,
|
|
308
|
+
address,
|
|
309
|
+
]);
|
|
291
310
|
if (this.has(key)) {
|
|
292
311
|
return this.get(key);
|
|
293
312
|
}
|
|
@@ -309,10 +328,10 @@ class RpcClientCache {
|
|
|
309
328
|
*
|
|
310
329
|
* @see https://tezos.gitlab.io/api/rpc.html#post-block-id-context-contracts-contract-id-big-map-get
|
|
311
330
|
*/
|
|
312
|
-
getBigMapKey(address, key, { block } =
|
|
331
|
+
getBigMapKey(address, key, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
313
332
|
return __awaiter(this, void 0, void 0, function* () {
|
|
314
333
|
this.validateAddress(address);
|
|
315
|
-
const keyUrl = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
334
|
+
const keyUrl = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BIG_MAP_KEY, [
|
|
316
335
|
block,
|
|
317
336
|
address,
|
|
318
337
|
key,
|
|
@@ -337,9 +356,13 @@ class RpcClientCache {
|
|
|
337
356
|
*
|
|
338
357
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-big-maps-big-map-id-script-expr
|
|
339
358
|
*/
|
|
340
|
-
getBigMapExpr(id, expr, { block } =
|
|
359
|
+
getBigMapExpr(id, expr, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
341
360
|
return __awaiter(this, void 0, void 0, function* () {
|
|
342
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
361
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BIG_MAP_EXPR, [
|
|
362
|
+
block,
|
|
363
|
+
id,
|
|
364
|
+
expr,
|
|
365
|
+
]);
|
|
343
366
|
if (this.has(key)) {
|
|
344
367
|
return this.get(key);
|
|
345
368
|
}
|
|
@@ -359,10 +382,13 @@ class RpcClientCache {
|
|
|
359
382
|
*
|
|
360
383
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates-pkh
|
|
361
384
|
*/
|
|
362
|
-
getDelegates(address, { block } =
|
|
385
|
+
getDelegates(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
363
386
|
return __awaiter(this, void 0, void 0, function* () {
|
|
364
387
|
this.validateAddress(address);
|
|
365
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
388
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_DELEGATES, [
|
|
389
|
+
block,
|
|
390
|
+
address,
|
|
391
|
+
]);
|
|
366
392
|
if (this.has(key)) {
|
|
367
393
|
return this.get(key);
|
|
368
394
|
}
|
|
@@ -381,9 +407,11 @@ class RpcClientCache {
|
|
|
381
407
|
*
|
|
382
408
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-constants
|
|
383
409
|
*/
|
|
384
|
-
getConstants({ block } =
|
|
410
|
+
getConstants({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
385
411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
412
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_CONSTANTS, [
|
|
413
|
+
block,
|
|
414
|
+
]);
|
|
387
415
|
if (this.has(key)) {
|
|
388
416
|
return this.get(key);
|
|
389
417
|
}
|
|
@@ -405,9 +433,9 @@ class RpcClientCache {
|
|
|
405
433
|
* @example getBlock({ block: head~2 }) will return an offset of 2 blocks.
|
|
406
434
|
* @example getBlock({ block: BL8fTiWcSxWCjiMVnDkbh6EuhqVPZzgWheJ2dqwrxYRm9AephXh~2 }) will return an offset of 2 blocks from given block hash..
|
|
407
435
|
*/
|
|
408
|
-
getBlock({ block } =
|
|
436
|
+
getBlock({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
409
437
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
438
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BLOCK, [block]);
|
|
411
439
|
if (this.has(key)) {
|
|
412
440
|
return this.get(key);
|
|
413
441
|
}
|
|
@@ -426,9 +454,11 @@ class RpcClientCache {
|
|
|
426
454
|
*
|
|
427
455
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-header
|
|
428
456
|
*/
|
|
429
|
-
getBlockHeader({ block } =
|
|
457
|
+
getBlockHeader({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
430
458
|
return __awaiter(this, void 0, void 0, function* () {
|
|
431
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
459
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BLOCK_HEADER, [
|
|
460
|
+
block,
|
|
461
|
+
]);
|
|
432
462
|
if (this.has(key)) {
|
|
433
463
|
return this.get(key);
|
|
434
464
|
}
|
|
@@ -447,9 +477,11 @@ class RpcClientCache {
|
|
|
447
477
|
*
|
|
448
478
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-metadata
|
|
449
479
|
*/
|
|
450
|
-
getBlockMetadata({ block } =
|
|
480
|
+
getBlockMetadata({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
451
481
|
return __awaiter(this, void 0, void 0, function* () {
|
|
452
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
482
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BLOCK_METADATA, [
|
|
483
|
+
block,
|
|
484
|
+
]);
|
|
453
485
|
if (this.has(key)) {
|
|
454
486
|
return this.get(key);
|
|
455
487
|
}
|
|
@@ -469,9 +501,12 @@ class RpcClientCache {
|
|
|
469
501
|
*
|
|
470
502
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-baking-rights
|
|
471
503
|
*/
|
|
472
|
-
getBakingRights(args = {}, { block } =
|
|
504
|
+
getBakingRights(args = {}, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
473
505
|
return __awaiter(this, void 0, void 0, function* () {
|
|
474
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
506
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BAKING_RIGHTS, [
|
|
507
|
+
block,
|
|
508
|
+
args,
|
|
509
|
+
]);
|
|
475
510
|
if (this.has(key)) {
|
|
476
511
|
return this.get(key);
|
|
477
512
|
}
|
|
@@ -491,12 +526,9 @@ class RpcClientCache {
|
|
|
491
526
|
*
|
|
492
527
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-endorsing-rights
|
|
493
528
|
*/
|
|
494
|
-
getEndorsingRights(args = {}, { block } =
|
|
529
|
+
getEndorsingRights(args = {}, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
495
530
|
return __awaiter(this, void 0, void 0, function* () {
|
|
496
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
497
|
-
block,
|
|
498
|
-
args,
|
|
499
|
-
]);
|
|
531
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_ENDORSING_RIGHTS, [block, args]);
|
|
500
532
|
if (this.has(key)) {
|
|
501
533
|
return this.get(key);
|
|
502
534
|
}
|
|
@@ -514,9 +546,11 @@ class RpcClientCache {
|
|
|
514
546
|
*
|
|
515
547
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-ballot-list
|
|
516
548
|
*/
|
|
517
|
-
getBallotList({ block } =
|
|
549
|
+
getBallotList({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
518
550
|
return __awaiter(this, void 0, void 0, function* () {
|
|
519
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
551
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BALLOT_LIST, [
|
|
552
|
+
block,
|
|
553
|
+
]);
|
|
520
554
|
if (this.has(key)) {
|
|
521
555
|
return this.get(key);
|
|
522
556
|
}
|
|
@@ -535,9 +569,9 @@ class RpcClientCache {
|
|
|
535
569
|
*
|
|
536
570
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-ballots
|
|
537
571
|
*/
|
|
538
|
-
getBallots({ block } =
|
|
572
|
+
getBallots({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
539
573
|
return __awaiter(this, void 0, void 0, function* () {
|
|
540
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
574
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_BALLOTS, [block]);
|
|
541
575
|
if (this.has(key)) {
|
|
542
576
|
return this.get(key);
|
|
543
577
|
}
|
|
@@ -556,9 +590,9 @@ class RpcClientCache {
|
|
|
556
590
|
*
|
|
557
591
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-proposal
|
|
558
592
|
*/
|
|
559
|
-
getCurrentProposal({ block, } =
|
|
593
|
+
getCurrentProposal({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
560
594
|
return __awaiter(this, void 0, void 0, function* () {
|
|
561
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
595
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_CURRENT_PROPOSAL, [block]);
|
|
562
596
|
if (this.has(key)) {
|
|
563
597
|
return this.get(key);
|
|
564
598
|
}
|
|
@@ -577,9 +611,11 @@ class RpcClientCache {
|
|
|
577
611
|
*
|
|
578
612
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-quorum
|
|
579
613
|
*/
|
|
580
|
-
getCurrentQuorum({ block, } =
|
|
614
|
+
getCurrentQuorum({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
581
615
|
return __awaiter(this, void 0, void 0, function* () {
|
|
582
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
616
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_CURRENT_QUORUM, [
|
|
617
|
+
block,
|
|
618
|
+
]);
|
|
583
619
|
if (this.has(key)) {
|
|
584
620
|
return this.get(key);
|
|
585
621
|
}
|
|
@@ -598,9 +634,11 @@ class RpcClientCache {
|
|
|
598
634
|
*
|
|
599
635
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-listings
|
|
600
636
|
*/
|
|
601
|
-
getVotesListings({ block, } =
|
|
637
|
+
getVotesListings({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
602
638
|
return __awaiter(this, void 0, void 0, function* () {
|
|
603
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
639
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_VOTES_LISTINGS, [
|
|
640
|
+
block,
|
|
641
|
+
]);
|
|
604
642
|
if (this.has(key)) {
|
|
605
643
|
return this.get(key);
|
|
606
644
|
}
|
|
@@ -619,9 +657,11 @@ class RpcClientCache {
|
|
|
619
657
|
*
|
|
620
658
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-proposals
|
|
621
659
|
*/
|
|
622
|
-
getProposals({ block } =
|
|
660
|
+
getProposals({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
623
661
|
return __awaiter(this, void 0, void 0, function* () {
|
|
624
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
662
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_PROPOSALS, [
|
|
663
|
+
block,
|
|
664
|
+
]);
|
|
625
665
|
if (this.has(key)) {
|
|
626
666
|
return this.get(key);
|
|
627
667
|
}
|
|
@@ -641,7 +681,7 @@ class RpcClientCache {
|
|
|
641
681
|
*
|
|
642
682
|
* @see https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-forge-operations
|
|
643
683
|
*/
|
|
644
|
-
forgeOperations(data, { block } =
|
|
684
|
+
forgeOperations(data, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
645
685
|
return __awaiter(this, void 0, void 0, function* () {
|
|
646
686
|
return this.rpcClient.forgeOperations(data, { block });
|
|
647
687
|
});
|
|
@@ -668,7 +708,7 @@ class RpcClientCache {
|
|
|
668
708
|
*
|
|
669
709
|
* @see https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-preapply-operations
|
|
670
710
|
*/
|
|
671
|
-
preapplyOperations(ops, { block } =
|
|
711
|
+
preapplyOperations(ops, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
672
712
|
return __awaiter(this, void 0, void 0, function* () {
|
|
673
713
|
return this.rpcClient.preapplyOperations(ops, { block });
|
|
674
714
|
});
|
|
@@ -683,10 +723,10 @@ class RpcClientCache {
|
|
|
683
723
|
*
|
|
684
724
|
* @version 005_PsBABY5H
|
|
685
725
|
*/
|
|
686
|
-
getEntrypoints(contract, { block } =
|
|
726
|
+
getEntrypoints(contract, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
687
727
|
return __awaiter(this, void 0, void 0, function* () {
|
|
688
728
|
this.validateContract(contract);
|
|
689
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
729
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_ENTRYPOINTS, [
|
|
690
730
|
block,
|
|
691
731
|
contract,
|
|
692
732
|
]);
|
|
@@ -708,7 +748,7 @@ class RpcClientCache {
|
|
|
708
748
|
*
|
|
709
749
|
* @see https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-scripts-run-operation
|
|
710
750
|
*/
|
|
711
|
-
runOperation(op, { block } =
|
|
751
|
+
runOperation(op, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
712
752
|
return __awaiter(this, void 0, void 0, function* () {
|
|
713
753
|
return this.rpcClient.runOperation(op, { block });
|
|
714
754
|
});
|
|
@@ -721,7 +761,7 @@ class RpcClientCache {
|
|
|
721
761
|
*
|
|
722
762
|
* @see https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-scripts-run-code
|
|
723
763
|
*/
|
|
724
|
-
runCode(code, { block } =
|
|
764
|
+
runCode(code, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
725
765
|
return __awaiter(this, void 0, void 0, function* () {
|
|
726
766
|
return this.rpcClient.runCode(code, { block });
|
|
727
767
|
});
|
|
@@ -733,7 +773,7 @@ class RpcClientCache {
|
|
|
733
773
|
* @description Simulate a call to a view following the TZIP-4 standard. See https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints.
|
|
734
774
|
*
|
|
735
775
|
*/
|
|
736
|
-
runView(_a, { block } =
|
|
776
|
+
runView(_a, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
737
777
|
var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
|
|
738
778
|
return __awaiter(this, void 0, void 0, function* () {
|
|
739
779
|
return this.rpcClient.runView(Object.assign({ unparsing_mode }, rest), { block });
|
|
@@ -741,7 +781,7 @@ class RpcClientCache {
|
|
|
741
781
|
}
|
|
742
782
|
getChainId() {
|
|
743
783
|
return __awaiter(this, void 0, void 0, function* () {
|
|
744
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
784
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_CHAIN_ID, []);
|
|
745
785
|
if (this.has(key)) {
|
|
746
786
|
return this.get(key);
|
|
747
787
|
}
|
|
@@ -763,9 +803,12 @@ class RpcClientCache {
|
|
|
763
803
|
*
|
|
764
804
|
* @see https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-scripts-pack-data
|
|
765
805
|
*/
|
|
766
|
-
packData(data, { block } =
|
|
806
|
+
packData(data, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
767
807
|
return __awaiter(this, void 0, void 0, function* () {
|
|
768
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
808
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.PACK_DATA, [
|
|
809
|
+
block,
|
|
810
|
+
data,
|
|
811
|
+
]);
|
|
769
812
|
if (this.has(key)) {
|
|
770
813
|
return this.get(key);
|
|
771
814
|
}
|
|
@@ -793,9 +836,11 @@ class RpcClientCache {
|
|
|
793
836
|
*
|
|
794
837
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-period
|
|
795
838
|
*/
|
|
796
|
-
getCurrentPeriod({ block, } =
|
|
839
|
+
getCurrentPeriod({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
797
840
|
return __awaiter(this, void 0, void 0, function* () {
|
|
798
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
841
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_CURRENT_PERIOD, [
|
|
842
|
+
block,
|
|
843
|
+
]);
|
|
799
844
|
if (this.has(key)) {
|
|
800
845
|
return this.get(key);
|
|
801
846
|
}
|
|
@@ -816,9 +861,9 @@ class RpcClientCache {
|
|
|
816
861
|
*
|
|
817
862
|
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-successor-period
|
|
818
863
|
*/
|
|
819
|
-
getSuccessorPeriod({ block, } =
|
|
864
|
+
getSuccessorPeriod({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
820
865
|
return __awaiter(this, void 0, void 0, function* () {
|
|
821
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
866
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_SUCCESSOR_PERIOD, [block]);
|
|
822
867
|
if (this.has(key)) {
|
|
823
868
|
return this.get(key);
|
|
824
869
|
}
|
|
@@ -838,9 +883,9 @@ class RpcClientCache {
|
|
|
838
883
|
*
|
|
839
884
|
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-sapling-sapling-state-id-get-diff
|
|
840
885
|
*/
|
|
841
|
-
getSaplingDiffById(id, { block } =
|
|
886
|
+
getSaplingDiffById(id, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
842
887
|
return __awaiter(this, void 0, void 0, function* () {
|
|
843
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
888
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_SAPLING_DIFF_BY_ID, [block, id]);
|
|
844
889
|
if (this.has(key)) {
|
|
845
890
|
return this.get(key);
|
|
846
891
|
}
|
|
@@ -860,12 +905,9 @@ class RpcClientCache {
|
|
|
860
905
|
*
|
|
861
906
|
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-single-sapling-get-diff
|
|
862
907
|
*/
|
|
863
|
-
getSaplingDiffByContract(contract, { block } =
|
|
908
|
+
getSaplingDiffByContract(contract, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
864
909
|
return __awaiter(this, void 0, void 0, function* () {
|
|
865
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
866
|
-
block,
|
|
867
|
-
contract,
|
|
868
|
-
]);
|
|
910
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_SAPLING_DIFF_BY_CONTRACT, [block, contract]);
|
|
869
911
|
if (this.has(key)) {
|
|
870
912
|
return this.get(key);
|
|
871
913
|
}
|
|
@@ -876,9 +918,11 @@ class RpcClientCache {
|
|
|
876
918
|
}
|
|
877
919
|
});
|
|
878
920
|
}
|
|
879
|
-
getProtocols({ block } =
|
|
921
|
+
getProtocols({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
880
922
|
return __awaiter(this, void 0, void 0, function* () {
|
|
881
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(),
|
|
923
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_PROTOCOLS, [
|
|
924
|
+
block,
|
|
925
|
+
]);
|
|
882
926
|
if (this.has(key)) {
|
|
883
927
|
return this.get(key);
|
|
884
928
|
}
|
|
@@ -889,6 +933,39 @@ class RpcClientCache {
|
|
|
889
933
|
}
|
|
890
934
|
});
|
|
891
935
|
}
|
|
936
|
+
getTxRollupState(txRollupId, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
937
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
938
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_TX_ROLLUP_STATE, [
|
|
939
|
+
block,
|
|
940
|
+
txRollupId,
|
|
941
|
+
]);
|
|
942
|
+
if (this.has(key)) {
|
|
943
|
+
return this.get(key);
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
const response = this.rpcClient.getTxRollupState(txRollupId, { block });
|
|
947
|
+
this.put(key, response);
|
|
948
|
+
return response;
|
|
949
|
+
}
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
getTxRollupInbox(txRollupId, blockLevel, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
953
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
954
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_TX_ROLLUP_INBOX, [
|
|
955
|
+
block,
|
|
956
|
+
txRollupId,
|
|
957
|
+
blockLevel,
|
|
958
|
+
]);
|
|
959
|
+
if (this.has(key)) {
|
|
960
|
+
return this.get(key);
|
|
961
|
+
}
|
|
962
|
+
else {
|
|
963
|
+
const response = this.rpcClient.getTxRollupInbox(txRollupId, blockLevel, { block });
|
|
964
|
+
this.put(key, response);
|
|
965
|
+
return response;
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
}
|
|
892
969
|
}
|
|
893
970
|
exports.RpcClientCache = RpcClientCache;
|
|
894
971
|
//# sourceMappingURL=rpc-cache.js.map
|