@taquito/rpc 19.2.1-beta.0 → 20.0.0-beta.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/rpc-client-interface.js +6 -1
- package/dist/lib/rpc-client-modules/rpc-cache.js +166 -61
- package/dist/lib/taquito-rpc.js +155 -59
- package/dist/lib/types.js +1 -0
- package/dist/lib/version.js +2 -2
- package/dist/taquito-rpc.es6.js +330 -123
- package/dist/taquito-rpc.es6.js.map +1 -1
- package/dist/taquito-rpc.umd.js +330 -123
- package/dist/taquito-rpc.umd.js.map +1 -1
- package/dist/types/rpc-client-interface.d.ts +13 -3
- package/dist/types/rpc-client-modules/rpc-cache.d.ts +84 -50
- package/dist/types/taquito-rpc.d.ts +88 -51
- package/dist/types/types.d.ts +112 -35
- package/package.json +5 -5
|
@@ -15,6 +15,11 @@ var RPCMethodName;
|
|
|
15
15
|
RPCMethodName["GET_BLOCK_HEADER"] = "getBlockHeader";
|
|
16
16
|
RPCMethodName["GET_BLOCK_METADATA"] = "getBlockMetadata";
|
|
17
17
|
RPCMethodName["GET_BALANCE"] = "getBalance";
|
|
18
|
+
RPCMethodName["GET_FULL_BALANCE"] = "getFullBalance";
|
|
19
|
+
RPCMethodName["GET_STAKED_BALANCE"] = "getStakedBalance";
|
|
20
|
+
RPCMethodName["GET_UNSTAKED_FINALIZABLE_BALANCE"] = "getUnstakedFinalizableBalance";
|
|
21
|
+
RPCMethodName["GET_UNSTAKED_FROZEN_BALANCE"] = "getUnstakedFrozenBalance";
|
|
22
|
+
RPCMethodName["GET_UNSTAKE_REQUESTS"] = "getUnstakeRequests";
|
|
18
23
|
RPCMethodName["GET_CHAIN_ID"] = "getChainId";
|
|
19
24
|
RPCMethodName["GET_CONSTANTS"] = "getConstants";
|
|
20
25
|
RPCMethodName["GET_CONTRACT"] = "getContract";
|
|
@@ -25,7 +30,6 @@ var RPCMethodName;
|
|
|
25
30
|
RPCMethodName["GET_DELEGATES"] = "getDelegates";
|
|
26
31
|
RPCMethodName["GET_VOTING_INFO"] = "getVotingInfo";
|
|
27
32
|
RPCMethodName["GET_ATTESTATION_RIGHTS"] = "getAttestationRights";
|
|
28
|
-
RPCMethodName["GET_ENDORSING_RIGHTS"] = "getEndorsingRights";
|
|
29
33
|
RPCMethodName["GET_ENTRYPOINTS"] = "getEntrypoints";
|
|
30
34
|
RPCMethodName["GET_LIVE_BLOCKS"] = "getLiveBlocks";
|
|
31
35
|
RPCMethodName["GET_MANAGER_KEY"] = "getManagerKey";
|
|
@@ -43,5 +47,6 @@ var RPCMethodName;
|
|
|
43
47
|
RPCMethodName["GET_STORAGE_PAID_SPACE"] = "getStoragePaidSpace";
|
|
44
48
|
RPCMethodName["GET_TICKET_BALANCE"] = "getTicketBalance";
|
|
45
49
|
RPCMethodName["GET_ALL_TICKET_BALANCES"] = "getAllTicketBalances";
|
|
50
|
+
RPCMethodName["GET_ADAPTIVE_ISSUANCE_LAUNCH_CYCLE"] = "getAdaptiveIssuanceLaunchCycle";
|
|
46
51
|
RPCMethodName["GET_PENDING_OPERATIONS"] = "getPendingOperations";
|
|
47
52
|
})(RPCMethodName || (exports.RPCMethodName = RPCMethodName = {}));
|
|
@@ -98,7 +98,7 @@ class RpcClientCache {
|
|
|
98
98
|
/**
|
|
99
99
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
100
100
|
* @description Get the block's hash, its unique identifier.
|
|
101
|
-
* @see https://tezos.gitlab.io/
|
|
101
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-hash
|
|
102
102
|
*/
|
|
103
103
|
getBlockHash({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
104
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -118,7 +118,7 @@ class RpcClientCache {
|
|
|
118
118
|
/**
|
|
119
119
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
120
120
|
* @description List the ancestors of the given block which, if referred to as the branch in an operation header, are recent enough for that operation to be included in the current block.
|
|
121
|
-
* @see https://tezos.gitlab.io/
|
|
121
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-live-blocks
|
|
122
122
|
*/
|
|
123
123
|
getLiveBlocks({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
124
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -139,7 +139,7 @@ class RpcClientCache {
|
|
|
139
139
|
* @param address address from which we want to retrieve the balance
|
|
140
140
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
141
141
|
* @description Access the spendable balance of a contract, excluding frozen bonds
|
|
142
|
-
* @see https://tezos.gitlab.io/
|
|
142
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-balance
|
|
143
143
|
*/
|
|
144
144
|
getBalance(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
145
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -158,11 +158,117 @@ class RpcClientCache {
|
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* @param address address from which we want to retrieve the full balance
|
|
163
|
+
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
164
|
+
* @description Access the full balance of a contract, including frozen bonds and stake.
|
|
165
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-full-balance
|
|
166
|
+
*/
|
|
167
|
+
getFullBalance(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
this.validateAddress(address);
|
|
170
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_FULL_BALANCE, [
|
|
171
|
+
block,
|
|
172
|
+
address,
|
|
173
|
+
]);
|
|
174
|
+
if (this.has(key)) {
|
|
175
|
+
return this.get(key);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
const response = this.rpcClient.getFullBalance(address, { block });
|
|
179
|
+
this.put(key, response);
|
|
180
|
+
return response;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @param address address from which we want to retrieve the staked balance
|
|
186
|
+
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
187
|
+
* @description Access the staked balance of a contract. Returns None if the contract is originated, or neither delegated nor a delegate.
|
|
188
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-staked-balance
|
|
189
|
+
*/
|
|
190
|
+
getStakedBalance(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
this.validateAddress(address);
|
|
193
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_STAKED_BALANCE, [
|
|
194
|
+
block,
|
|
195
|
+
address,
|
|
196
|
+
]);
|
|
197
|
+
if (this.has(key)) {
|
|
198
|
+
return this.get(key);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
const response = this.rpcClient.getStakedBalance(address, { block });
|
|
202
|
+
this.put(key, response);
|
|
203
|
+
return response;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @param address address from which we want to retrieve the unstaked finalizable balance
|
|
209
|
+
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
210
|
+
* @description Access the balance of a contract that was requested for an unstake operation, and is no longer frozen, which means it will appear in the spendable balance of the contract after any stake/unstake/finalize_unstake operation. Returns None if the contract is originated.
|
|
211
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-unstaked-finalizable-balance
|
|
212
|
+
*/
|
|
213
|
+
getUnstakedFinalizableBalance(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
this.validateAddress(address);
|
|
216
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_UNSTAKED_FINALIZABLE_BALANCE, [block, address]);
|
|
217
|
+
if (this.has(key)) {
|
|
218
|
+
return this.get(key);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
const response = this.rpcClient.getUnstakedFinalizableBalance(address, { block });
|
|
222
|
+
this.put(key, response);
|
|
223
|
+
return response;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @param address address from which we want to retrieve the unstaked frozen balance
|
|
229
|
+
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
230
|
+
* @description Access the balance of a contract that was requested for an unstake operation, but is still frozen for the duration of the slashing period. Returns None if the contract is originated.
|
|
231
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-unstaked-frozen-balance
|
|
232
|
+
*/
|
|
233
|
+
getUnstakedFrozenBalance(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
234
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
this.validateAddress(address);
|
|
236
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_UNSTAKED_FROZEN_BALANCE, [block, address]);
|
|
237
|
+
if (this.has(key)) {
|
|
238
|
+
return this.get(key);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
const response = this.rpcClient.getUnstakedFrozenBalance(address, { block });
|
|
242
|
+
this.put(key, response);
|
|
243
|
+
return response;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @param address address from which we want to retrieve the unstake requests
|
|
249
|
+
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
250
|
+
* @description Access the unstake requests of the contract. The requests that appear in the finalizable field can be finalized, which means that the contract can transfer these (no longer frozen) funds to their spendable balance with a [finalize_unstake] operation call. Returns null if there is no unstake request pending.
|
|
251
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-unstake-requests
|
|
252
|
+
*/
|
|
253
|
+
getUnstakeRequests(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
254
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
this.validateAddress(address);
|
|
256
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_UNSTAKE_REQUESTS, [block, address]);
|
|
257
|
+
if (this.has(key)) {
|
|
258
|
+
return this.get(key);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
const response = this.rpcClient.getUnstakeRequests(address, { block });
|
|
262
|
+
this.put(key, response);
|
|
263
|
+
return response;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
161
267
|
/**
|
|
162
268
|
* @param address contract address from which we want to retrieve the storage
|
|
163
269
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
164
270
|
* @description Access the data of the contract.
|
|
165
|
-
* @see https://tezos.gitlab.io/
|
|
271
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-storage
|
|
166
272
|
*/
|
|
167
273
|
getStorage(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
168
274
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -185,7 +291,7 @@ class RpcClientCache {
|
|
|
185
291
|
* @param address contract address from which we want to retrieve the script
|
|
186
292
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
187
293
|
* @description Access the code and data of the contract.
|
|
188
|
-
* @see https://tezos.gitlab.io/
|
|
294
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-script
|
|
189
295
|
*/
|
|
190
296
|
getScript(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
191
297
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -228,7 +334,7 @@ class RpcClientCache {
|
|
|
228
334
|
* @param address contract address from which we want to retrieve
|
|
229
335
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
230
336
|
* @description Access the complete status of a contract.
|
|
231
|
-
* @see https://tezos.gitlab.io/
|
|
337
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id
|
|
232
338
|
*/
|
|
233
339
|
getContract(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
234
340
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -251,7 +357,7 @@ class RpcClientCache {
|
|
|
251
357
|
* @param address contract address from which we want to retrieve the manager
|
|
252
358
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
253
359
|
* @description Access the manager of an implicit contract
|
|
254
|
-
* @see https://tezos.gitlab.io/
|
|
360
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-manager-key
|
|
255
361
|
*/
|
|
256
362
|
getManagerKey(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
257
363
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -274,7 +380,7 @@ class RpcClientCache {
|
|
|
274
380
|
* @param address contract address from which we want to retrieve the delegate (baker)
|
|
275
381
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
276
382
|
* @description Access the delegate of a contract, if any
|
|
277
|
-
* @see https://tezos.gitlab.io/
|
|
383
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-delegate
|
|
278
384
|
*/
|
|
279
385
|
getDelegate(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
280
386
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -298,7 +404,7 @@ class RpcClientCache {
|
|
|
298
404
|
* @param address contract address from which we want to retrieve the big map key
|
|
299
405
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
300
406
|
* @description Access the value associated with a key in the big map storage of the contract.
|
|
301
|
-
* @see https://tezos.gitlab.io/
|
|
407
|
+
* @see https://tezos.gitlab.io/active/rpc.html#post-block-id-context-contracts-contract-id-big-map-get
|
|
302
408
|
*/
|
|
303
409
|
getBigMapKey(address, key, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
304
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -319,7 +425,7 @@ class RpcClientCache {
|
|
|
319
425
|
* @param expr Expression hash to query (A b58check encoded Blake2b hash of the expression (The expression can be packed using the pack_data method))
|
|
320
426
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
321
427
|
* @description Access the value associated with a key in a big map.
|
|
322
|
-
* @see https://tezos.gitlab.io/
|
|
428
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-big-maps-big-map-id-script-expr
|
|
323
429
|
*/
|
|
324
430
|
getBigMapExpr(id, expr, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
325
431
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -342,7 +448,7 @@ class RpcClientCache {
|
|
|
342
448
|
* @param address delegate address which we want to retrieve
|
|
343
449
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
344
450
|
* @description Everything about a delegate
|
|
345
|
-
* @see https://tezos.gitlab.io/
|
|
451
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-delegates-pkh
|
|
346
452
|
*/
|
|
347
453
|
getDelegates(address, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
348
454
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -387,7 +493,7 @@ class RpcClientCache {
|
|
|
387
493
|
/**
|
|
388
494
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
389
495
|
* @description All constants
|
|
390
|
-
* @see https://tezos.gitlab.io/
|
|
496
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-constants
|
|
391
497
|
*/
|
|
392
498
|
getConstants({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
393
499
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -407,7 +513,7 @@ class RpcClientCache {
|
|
|
407
513
|
/**
|
|
408
514
|
* @param options contains generic configuration for rpc calls to specified block (default to head) and version.
|
|
409
515
|
* @description All the information about a block
|
|
410
|
-
* @see https://tezos.gitlab.io/
|
|
516
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id
|
|
411
517
|
* @example getBlock() will default to `/main/chains/block/head?version=0` which shows { kind: endorsement }
|
|
412
518
|
* @example getBlock({ block: 'head~2', version: 1 }) will return an offset of 2 from head blocks and shows { kind: attestation }
|
|
413
519
|
* @example getBlock({ block: 'BL8fTiWcSxWCjiMVnDkbh6EuhqVPZzgWheJ2dqwrxYRm9AephXh~2' }) will return an offset of 2 blocks from given block hash..
|
|
@@ -428,7 +534,7 @@ class RpcClientCache {
|
|
|
428
534
|
/**
|
|
429
535
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
430
536
|
* @description The whole block header
|
|
431
|
-
* @see https://tezos.gitlab.io/
|
|
537
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-header
|
|
432
538
|
*/
|
|
433
539
|
getBlockHeader({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
434
540
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -448,7 +554,7 @@ class RpcClientCache {
|
|
|
448
554
|
/**
|
|
449
555
|
* @param options contains generic configuration for rpc calls to specified block (default to head) and version
|
|
450
556
|
* @description All the metadata associated to the block
|
|
451
|
-
* @see https://tezos.gitlab.io/
|
|
557
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-metadata
|
|
452
558
|
*/
|
|
453
559
|
getBlockMetadata({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
454
560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -469,7 +575,7 @@ class RpcClientCache {
|
|
|
469
575
|
* @param args contains optional query arguments (level, cycle, delegate, consensus_key, and max_round)
|
|
470
576
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
471
577
|
* @description Retrieves the list of delegates allowed to bake a block.
|
|
472
|
-
* @see https://
|
|
578
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
473
579
|
*/
|
|
474
580
|
getBakingRights(args = {}, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
475
581
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -491,7 +597,7 @@ class RpcClientCache {
|
|
|
491
597
|
* @param args contains optional query arguments (level, cycle, delegate, and consensus_key)
|
|
492
598
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
493
599
|
* @description Retrieves the delegates allowed to attest a block
|
|
494
|
-
* @see https://
|
|
600
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
495
601
|
*/
|
|
496
602
|
getAttestationRights(args = {}, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
497
603
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -506,30 +612,10 @@ class RpcClientCache {
|
|
|
506
612
|
}
|
|
507
613
|
});
|
|
508
614
|
}
|
|
509
|
-
/**
|
|
510
|
-
* @deprecated Deprecated in favor of getAttestationRights
|
|
511
|
-
* @param args contains optional query arguments (level, cycle, delegate, and consensus_key)
|
|
512
|
-
* @param options contains generic configuration for rpc calls
|
|
513
|
-
* @description Retrieves the delegates allowed to endorse a block
|
|
514
|
-
* @see https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-endorsing-rights
|
|
515
|
-
*/
|
|
516
|
-
getEndorsingRights(args = {}, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
517
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
518
|
-
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_ENDORSING_RIGHTS, [block, args]);
|
|
519
|
-
if (this.has(key)) {
|
|
520
|
-
return this.get(key);
|
|
521
|
-
}
|
|
522
|
-
else {
|
|
523
|
-
const response = this.rpcClient.getEndorsingRights(args, { block });
|
|
524
|
-
this.put(key, response);
|
|
525
|
-
return response;
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
615
|
/**
|
|
530
616
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
531
617
|
* @description Ballots casted so far during a voting period
|
|
532
|
-
* @see https://tezos.gitlab.io/
|
|
618
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-ballot-list
|
|
533
619
|
*/
|
|
534
620
|
getBallotList({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
535
621
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -549,7 +635,7 @@ class RpcClientCache {
|
|
|
549
635
|
/**
|
|
550
636
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
551
637
|
* @description Sum of ballots casted so far during a voting period
|
|
552
|
-
* @see https://tezos.gitlab.io/
|
|
638
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-ballots
|
|
553
639
|
*/
|
|
554
640
|
getBallots({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
555
641
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -567,7 +653,7 @@ class RpcClientCache {
|
|
|
567
653
|
/**
|
|
568
654
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
569
655
|
* @description Current proposal under evaluation.
|
|
570
|
-
* @see https://tezos.gitlab.io/
|
|
656
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-current-proposal
|
|
571
657
|
*/
|
|
572
658
|
getCurrentProposal({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
573
659
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -585,7 +671,7 @@ class RpcClientCache {
|
|
|
585
671
|
/**
|
|
586
672
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
587
673
|
* @description Current expected quorum.
|
|
588
|
-
* @see https://tezos.gitlab.io/
|
|
674
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-current-quorum
|
|
589
675
|
*/
|
|
590
676
|
getCurrentQuorum({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
591
677
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -605,7 +691,7 @@ class RpcClientCache {
|
|
|
605
691
|
/**
|
|
606
692
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
607
693
|
* @description List of delegates with their voting power
|
|
608
|
-
* @see https://tezos.gitlab.io/
|
|
694
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-listings
|
|
609
695
|
*/
|
|
610
696
|
getVotesListings({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
611
697
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -625,7 +711,7 @@ class RpcClientCache {
|
|
|
625
711
|
/**
|
|
626
712
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
627
713
|
* @description List of proposals with number of supporters
|
|
628
|
-
* @see https://tezos.gitlab.io/
|
|
714
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-proposals
|
|
629
715
|
*/
|
|
630
716
|
getProposals({ block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
631
717
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -646,7 +732,7 @@ class RpcClientCache {
|
|
|
646
732
|
* @param data operation contents to forge
|
|
647
733
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
648
734
|
* @description Forge an operation returning the unsigned bytes
|
|
649
|
-
* @see https://
|
|
735
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
650
736
|
*/
|
|
651
737
|
forgeOperations(data, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
652
738
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -656,7 +742,7 @@ class RpcClientCache {
|
|
|
656
742
|
/**
|
|
657
743
|
* @param signedOpBytes signed bytes to inject
|
|
658
744
|
* @description Inject an operation in node and broadcast it and return the ID of the operation
|
|
659
|
-
* @see https://tezos.gitlab.io/
|
|
745
|
+
* @see https://tezos.gitlab.io/shell/rpc.html#post-injection-operation
|
|
660
746
|
*/
|
|
661
747
|
injectOperation(signedOpBytes) {
|
|
662
748
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -667,7 +753,7 @@ class RpcClientCache {
|
|
|
667
753
|
* @param ops Operations to apply
|
|
668
754
|
* @param options contains generic configuration for rpc calls to specified block and version
|
|
669
755
|
* @description Simulate the application of the operations with the context of the given block and return the result of each operation application
|
|
670
|
-
* @see https://tezos.gitlab.io/
|
|
756
|
+
* @see https://tezos.gitlab.io/active/rpc.html#post-block-id-helpers-preapply-operations
|
|
671
757
|
*/
|
|
672
758
|
preapplyOperations(ops, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
673
759
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -678,7 +764,7 @@ class RpcClientCache {
|
|
|
678
764
|
* @param contract address of the contract we want to get the entrypoints of
|
|
679
765
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
680
766
|
* @description Return the list of entrypoints of the contract
|
|
681
|
-
* @see https://tezos.gitlab.io/
|
|
767
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-contracts-contract-id-entrypoints
|
|
682
768
|
* @version 005_PsBABY5H
|
|
683
769
|
*/
|
|
684
770
|
getEntrypoints(contract, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
@@ -703,7 +789,7 @@ class RpcClientCache {
|
|
|
703
789
|
* @param op Operation to run
|
|
704
790
|
* @param options contains generic configuration for rpc calls to specified block and version
|
|
705
791
|
* @description Run an operation with the context of the given block and without signature checks and return the operation application result, including the consumed gas.
|
|
706
|
-
* @see https://
|
|
792
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
707
793
|
*/
|
|
708
794
|
runOperation(op, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
709
795
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -714,7 +800,7 @@ class RpcClientCache {
|
|
|
714
800
|
* @param op Operation to simulate
|
|
715
801
|
* @param options contains generic configuration for rpc calls to specified block and version
|
|
716
802
|
* @description Simulate running an operation at some future moment (based on the number of blocks given in the `latency` argument), and return the operation application result.
|
|
717
|
-
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/
|
|
803
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
718
804
|
*/
|
|
719
805
|
simulateOperation(op, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
720
806
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -725,7 +811,7 @@ class RpcClientCache {
|
|
|
725
811
|
* @param code Code to run
|
|
726
812
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
727
813
|
* @description Run a Michelson script in the current context
|
|
728
|
-
* @see https://
|
|
814
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
729
815
|
*/
|
|
730
816
|
runCode(code, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
731
817
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -736,6 +822,7 @@ class RpcClientCache {
|
|
|
736
822
|
* @param viewScriptParams Parameters of the script view to run
|
|
737
823
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
738
824
|
* @description Simulate a call to a michelson view
|
|
825
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
739
826
|
*/
|
|
740
827
|
runScriptView(_a, _b) {
|
|
741
828
|
var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
|
|
@@ -747,7 +834,8 @@ class RpcClientCache {
|
|
|
747
834
|
/**
|
|
748
835
|
* @param viewParams Parameters of the view to run
|
|
749
836
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
750
|
-
* @description Simulate a call to a view following the TZIP-4 standard.
|
|
837
|
+
* @description Simulate a call to a view following the TZIP-4 standard.
|
|
838
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
751
839
|
*/
|
|
752
840
|
runView(_a, _b) {
|
|
753
841
|
var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
|
|
@@ -778,7 +866,7 @@ class RpcClientCache {
|
|
|
778
866
|
* A node that is operated by a bad actor, or compromised by a bad actor could return a fully formed operation that does not correspond to the input provided to the RPC endpoint.
|
|
779
867
|
* A safer solution to pack and sign data would be to use the `packDataBytes` function available in the `@taquito/michel-codec` package.
|
|
780
868
|
* @example packData({ data: { string: "test" }, type: { prim: "string" } })
|
|
781
|
-
* @see https://
|
|
869
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
782
870
|
*/
|
|
783
871
|
packData(data, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
784
872
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -803,7 +891,7 @@ class RpcClientCache {
|
|
|
803
891
|
/**
|
|
804
892
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
805
893
|
* @description Returns the voting period (index, kind, starting position) and related information (position, remaining) of the interrogated block
|
|
806
|
-
* @see https://tezos.gitlab.io/
|
|
894
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-current-period
|
|
807
895
|
*/
|
|
808
896
|
getCurrentPeriod({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
809
897
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -824,7 +912,7 @@ class RpcClientCache {
|
|
|
824
912
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
825
913
|
* @description Returns the voting period (index, kind, starting position) and related information (position, remaining) of the next block.Useful to craft operations that will be valid in the next block
|
|
826
914
|
* @example getSuccessorPeriod() will default to successor voting period for /main/chains/block/head.
|
|
827
|
-
* @see https://tezos.gitlab.io/
|
|
915
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-votes-successor-period
|
|
828
916
|
*/
|
|
829
917
|
getSuccessorPeriod({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
830
918
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -901,7 +989,7 @@ class RpcClientCache {
|
|
|
901
989
|
* @param contract address of the contract we want to retrieve storage information of
|
|
902
990
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
903
991
|
* @description Access the used storage space of the contract
|
|
904
|
-
* @see https://
|
|
992
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
905
993
|
*/
|
|
906
994
|
getStorageUsedSpace(contract, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
907
995
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -920,7 +1008,7 @@ class RpcClientCache {
|
|
|
920
1008
|
* @param contract address of the contract we want to retrieve storage information of
|
|
921
1009
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
922
1010
|
= * @description Access the paid storage space of the contract
|
|
923
|
-
* @see https://
|
|
1011
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
924
1012
|
*/
|
|
925
1013
|
getStoragePaidSpace(contract, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
926
1014
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -941,7 +1029,7 @@ class RpcClientCache {
|
|
|
941
1029
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
942
1030
|
* @description Access the contract's balance of ticket with specified ticketer, content type, and content.
|
|
943
1031
|
* @example ticket { ticketer: 'address', content_type: { prim: "string" }, content: { string: 'ticket1' } }
|
|
944
|
-
* @see https://
|
|
1032
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
945
1033
|
*/
|
|
946
1034
|
getTicketBalance(contract, ticket, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
947
1035
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -960,7 +1048,7 @@ class RpcClientCache {
|
|
|
960
1048
|
* @param contract originated address we want to retrieve ticket balances of
|
|
961
1049
|
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
962
1050
|
* @description Access the complete list of tickets owned by the given contract by scanning the contract's storage.
|
|
963
|
-
* @see https://
|
|
1051
|
+
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-openapi-rc.json
|
|
964
1052
|
*/
|
|
965
1053
|
getAllTicketBalances(contract, { block } = rpc_client_interface_2.defaultRPCOptions) {
|
|
966
1054
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -975,11 +1063,28 @@ class RpcClientCache {
|
|
|
975
1063
|
}
|
|
976
1064
|
});
|
|
977
1065
|
}
|
|
1066
|
+
/**
|
|
1067
|
+
* @description Returns the cycle at which the launch of the Adaptive Issuance feature is set to happen. A result of null means that the feature is not yet set to launch.
|
|
1068
|
+
* @param options contains generic configuration for rpc calls to specified block (default to head)
|
|
1069
|
+
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id-context-adaptive-issuance-launch-cycle
|
|
1070
|
+
*/
|
|
1071
|
+
getAdaptiveIssuanceLaunchCycle({ block, } = rpc_client_interface_2.defaultRPCOptions) {
|
|
1072
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1073
|
+
const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), rpc_client_interface_1.RPCMethodName.GET_ADAPTIVE_ISSUANCE_LAUNCH_CYCLE, [block]);
|
|
1074
|
+
if (this.has(key)) {
|
|
1075
|
+
return this.get(key);
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
const response = this.rpcClient.getAdaptiveIssuanceLaunchCycle({ block });
|
|
1079
|
+
this.put(key, response);
|
|
1080
|
+
return response;
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
978
1084
|
/**
|
|
979
1085
|
* @description List the prevalidated operations in mempool (accessibility of mempool depends on each rpc endpoint)
|
|
980
|
-
* @param args has 5 optional properties. We support version 1
|
|
981
|
-
* @default args { version: '
|
|
982
|
-
* @see https://tezos.gitlab.io/CHANGES.html?highlight=pending_operations#id4
|
|
1086
|
+
* @param args has 5 optional properties. We support version 1 & 2
|
|
1087
|
+
* @default args { version: '2', validated: true, refused: true, outdated, true, branchRefused: true, branchDelayed: true, validationPass: undefined }
|
|
983
1088
|
*/
|
|
984
1089
|
getPendingOperations(args = {}) {
|
|
985
1090
|
return __awaiter(this, void 0, void 0, function* () {
|