@psalomo/jsonrpc-client 1.2.0 → 1.3.1
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/browser-standalone.js +235 -896
- package/dist/browser-standalone.min.js +1 -1
- package/dist/{chunk-GCIU6ZLN.mjs → chunk-ABZUXHR5.mjs} +1 -29
- package/dist/client.d.ts +0 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/{convenience-DFvZCHOk.d.mts → convenience-CzETQz3b.d.mts} +229 -16
- package/dist/{convenience-DFvZCHOk.d.ts → convenience-CzETQz3b.d.ts} +229 -16
- package/dist/generated-types.d.ts +228 -0
- package/dist/generated-types.d.ts.map +1 -1
- package/dist/index.d.mts +118 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -101
- package/dist/index.mjs +7 -77
- package/dist/no-validation/index.d.mts +1 -1
- package/dist/no-validation/index.js +1 -29
- package/dist/no-validation/index.mjs +1 -1
- package/dist/validated/index.d.ts +114 -0
- package/dist/validated/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/validation.d.ts +0 -14
- package/dist/validation.d.ts.map +0 -1
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
import { RpcStateChangesInBlockByTypeRequest, RpcStateChangesInBlockResponse, RpcStateChangesInBlockRequest, RpcStateChangesInBlockByTypeResponse, RpcCongestionLevelRequest, RpcCongestionLevelResponse, GenesisConfigRequest, GenesisConfig, RpcLightClientBlockProofRequest, RpcLightClientBlockProofResponse, RpcLightClientExecutionProofRequest, RpcLightClientExecutionProofResponse, RpcMaintenanceWindowsRequest, EXPERIMENTALMaintenanceWindowsResponse, RpcProtocolConfigRequest, RpcProtocolConfigResponse, RpcReceiptRequest, RpcReceiptResponse, RpcSplitStorageInfoRequest, RpcSplitStorageInfoResponse, RpcTransactionStatusRequest, RpcTransactionResponse, RpcValidatorsOrderedRequest, EXPERIMENTALValidatorsOrderedResponse, RpcBlockRequest, RpcBlockResponse, RpcSendTransactionRequest, CryptoHash, RpcChunkRequest, RpcChunkResponse, RpcClientConfigRequest, RpcClientConfigResponse, RpcGasPriceRequest, RpcGasPriceResponse, RpcHealthRequest, RpcHealthResponse, MaintenanceWindowsResponse, RpcNetworkInfoRequest, RpcNetworkInfoResponse, RpcLightClientNextBlockRequest, RpcLightClientNextBlockResponse, RpcQueryRequest, RpcQueryResponse, RpcStatusRequest, RpcStatusResponse, RpcValidatorRequest, RpcValidatorResponse, AccountView, CallResult, AccessKeyView } from '@psalomo/jsonrpc-types';
|
|
2
2
|
|
|
3
|
-
interface ValidationResult {
|
|
4
|
-
validateRequest: (request: JsonRpcRequest) => void;
|
|
5
|
-
validateResponse: (response: JsonRpcResponse) => void;
|
|
6
|
-
validateMethodRequest?: (method: string, request: JsonRpcRequest) => void;
|
|
7
|
-
validateMethodResponse?: (method: string, response: JsonRpcResponse) => void;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Enable validation for the client
|
|
11
|
-
* This function should only be called if you want to include schema validation
|
|
12
|
-
* Calling this function will include Zod schemas in your bundle
|
|
13
|
-
*/
|
|
14
|
-
declare function enableValidation(): ValidationResult;
|
|
15
|
-
|
|
16
3
|
interface ClientConfig {
|
|
17
4
|
endpoint: string;
|
|
18
5
|
headers?: Record<string, string>;
|
|
19
6
|
timeout?: number;
|
|
20
7
|
retries?: number;
|
|
21
|
-
validation?: ValidationResult;
|
|
22
8
|
}
|
|
23
9
|
interface JsonRpcRequest<T = unknown> {
|
|
24
10
|
jsonrpc: '2.0';
|
|
@@ -57,7 +43,6 @@ declare class NearRpcClient {
|
|
|
57
43
|
readonly headers: Record<string, string>;
|
|
58
44
|
readonly timeout: number;
|
|
59
45
|
readonly retries: number;
|
|
60
|
-
private readonly validation;
|
|
61
46
|
constructor(config: string | ClientConfig);
|
|
62
47
|
/**
|
|
63
48
|
* Make a raw JSON-RPC request
|
|
@@ -95,36 +80,150 @@ declare class NearRpcError extends Error {
|
|
|
95
80
|
}
|
|
96
81
|
|
|
97
82
|
interface DynamicRpcMethods {
|
|
83
|
+
/**
|
|
84
|
+
* [Deprecated] Returns changes for a given account, contract or contract code
|
|
85
|
+
* for given block height or hash. Consider using changes instead.
|
|
86
|
+
*/
|
|
98
87
|
experimentalChanges(params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* [Deprecated] Returns changes in block for given block height or hash over
|
|
90
|
+
* all transactions for all the types. Includes changes like account_touched,
|
|
91
|
+
* access_key_touched, data_touched, contract_code_touched. Consider using
|
|
92
|
+
* block_effects instead
|
|
93
|
+
*/
|
|
99
94
|
experimentalChangesInBlock(params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
95
|
+
/**
|
|
96
|
+
* Queries the congestion level of a shard. More info about congestion
|
|
97
|
+
* [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)
|
|
98
|
+
*/
|
|
100
99
|
experimentalCongestionLevel(params?: RpcCongestionLevelRequest): Promise<RpcCongestionLevelResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* [Deprecated] Get initial state and parameters for the genesis block.
|
|
102
|
+
* Consider genesis_config instead.
|
|
103
|
+
*/
|
|
101
104
|
experimentalGenesisConfig(params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
105
|
+
/** Returns the proofs for a transaction execution. */
|
|
102
106
|
experimentalLightClientBlockProof(params?: RpcLightClientBlockProofRequest): Promise<RpcLightClientBlockProofResponse>;
|
|
107
|
+
/** Returns the proofs for a transaction execution. */
|
|
103
108
|
experimentalLightClientProof(params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* [Deprecated] Returns the future windows for maintenance in current epoch
|
|
111
|
+
* for the specified account. In the maintenance windows, the node will not be
|
|
112
|
+
* block producer or chunk producer. Consider using maintenance_windows
|
|
113
|
+
* instead.
|
|
114
|
+
*/
|
|
104
115
|
experimentalMaintenanceWindows(params?: RpcMaintenanceWindowsRequest): Promise<EXPERIMENTALMaintenanceWindowsResponse>;
|
|
116
|
+
/**
|
|
117
|
+
* A configuration that defines the protocol-level parameters such as
|
|
118
|
+
* gas/storage costs, limits, feature flags, other settings
|
|
119
|
+
*/
|
|
105
120
|
experimentalProtocolConfig(params?: RpcProtocolConfigRequest): Promise<RpcProtocolConfigResponse>;
|
|
121
|
+
/** Fetches a receipt by its ID (as is, without a status or execution outcome) */
|
|
106
122
|
experimentalReceipt(params?: RpcReceiptRequest): Promise<RpcReceiptResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Contains the split storage information. More info on split storage
|
|
125
|
+
* [here](https://near-nodes.io/archival/split-storage-archival)
|
|
126
|
+
*/
|
|
107
127
|
experimentalSplitStorageInfo(params?: RpcSplitStorageInfoRequest): Promise<RpcSplitStorageInfoResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Queries status of a transaction by hash, returning the final transaction
|
|
130
|
+
* result and details of all receipts.
|
|
131
|
+
*/
|
|
108
132
|
experimentalTxStatus(params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Returns the current epoch validators ordered in the block producer order
|
|
135
|
+
* with repetition. This endpoint is solely used for bridge currently and is
|
|
136
|
+
* not intended for other external use cases.
|
|
137
|
+
*/
|
|
109
138
|
experimentalValidatorsOrdered(params?: RpcValidatorsOrderedRequest): Promise<EXPERIMENTALValidatorsOrderedResponse>;
|
|
139
|
+
/** Returns block details for given height or hash */
|
|
110
140
|
block(params?: RpcBlockRequest): Promise<RpcBlockResponse>;
|
|
141
|
+
/**
|
|
142
|
+
* Returns changes in block for given block height or hash over all
|
|
143
|
+
* transactions for all the types. Includes changes like account_touched,
|
|
144
|
+
* access_key_touched, data_touched, contract_code_touched.
|
|
145
|
+
*/
|
|
111
146
|
blockEffects(params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
147
|
+
/**
|
|
148
|
+
* [Deprecated] Sends a transaction and immediately returns transaction hash.
|
|
149
|
+
* Consider using send_tx instead.
|
|
150
|
+
*/
|
|
112
151
|
broadcastTxAsync(params?: RpcSendTransactionRequest): Promise<CryptoHash>;
|
|
152
|
+
/**
|
|
153
|
+
* [Deprecated] Sends a transaction and waits until transaction is fully
|
|
154
|
+
* complete. (Has a 10 second timeout). Consider using send_tx instead.
|
|
155
|
+
*/
|
|
113
156
|
broadcastTxCommit(params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* Returns changes for a given account, contract or contract code for given
|
|
159
|
+
* block height or hash.
|
|
160
|
+
*/
|
|
114
161
|
changes(params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
162
|
+
/**
|
|
163
|
+
* Returns details of a specific chunk. You can run a block details query to
|
|
164
|
+
* get a valid chunk hash.
|
|
165
|
+
*/
|
|
115
166
|
chunk(params?: RpcChunkRequest): Promise<RpcChunkResponse>;
|
|
167
|
+
/** Queries client node configuration */
|
|
116
168
|
clientConfig(params?: RpcClientConfigRequest): Promise<RpcClientConfigResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Returns gas price for a specific block_height or block_hash. Using [null]
|
|
171
|
+
* will return the most recent block's gas price.
|
|
172
|
+
*/
|
|
117
173
|
gasPrice(params?: RpcGasPriceRequest): Promise<RpcGasPriceResponse>;
|
|
174
|
+
/** Get initial state and parameters for the genesis block */
|
|
118
175
|
genesisConfig(params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
176
|
+
/** Returns the current health status of the RPC node the client connects to. */
|
|
119
177
|
health(params?: RpcHealthRequest): Promise<RpcHealthResponse>;
|
|
178
|
+
/** Returns the proofs for a transaction execution. */
|
|
120
179
|
lightClientProof(params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
180
|
+
/**
|
|
181
|
+
* Returns the future windows for maintenance in current epoch for the
|
|
182
|
+
* specified account. In the maintenance windows, the node will not be block
|
|
183
|
+
* producer or chunk producer.
|
|
184
|
+
*/
|
|
121
185
|
maintenanceWindows(params?: RpcMaintenanceWindowsRequest): Promise<MaintenanceWindowsResponse>;
|
|
186
|
+
/**
|
|
187
|
+
* Queries the current state of node network connections. This includes
|
|
188
|
+
* information about active peers, transmitted data, known producers, etc.
|
|
189
|
+
*/
|
|
122
190
|
networkInfo(params?: RpcNetworkInfoRequest): Promise<RpcNetworkInfoResponse>;
|
|
191
|
+
/** Returns the next light client block. */
|
|
123
192
|
nextLightClientBlock(params?: RpcLightClientNextBlockRequest): Promise<RpcLightClientNextBlockResponse>;
|
|
193
|
+
/**
|
|
194
|
+
* This module allows you to make generic requests to the network. The
|
|
195
|
+
* `RpcQueryRequest` struct takes in a
|
|
196
|
+
* [`BlockReference`](https://docs.rs/near-primitives/0.12.0/near_primitives/types/enum.BlockReference.html)
|
|
197
|
+
* and a
|
|
198
|
+
* [`QueryRequest`](https://docs.rs/near-primitives/0.12.0/near_primitives/views/enum.QueryRequest.html).
|
|
199
|
+
* The `BlockReference` enum allows you to specify a block by `Finality`,
|
|
200
|
+
* `BlockId` or `SyncCheckpoint`. The `QueryRequest` enum provides multiple
|
|
201
|
+
* variants for performing the following actions: - View an account's details
|
|
202
|
+
* - View a contract's code - View the state of an account - View the
|
|
203
|
+
* `AccessKey` of an account - View the `AccessKeyList` of an account - Call a
|
|
204
|
+
* function in a contract deployed on the network.
|
|
205
|
+
*/
|
|
124
206
|
query(params?: RpcQueryRequest): Promise<RpcQueryResponse>;
|
|
207
|
+
/**
|
|
208
|
+
* Sends transaction. Returns the guaranteed execution status and the results
|
|
209
|
+
* the blockchain can provide at the moment.
|
|
210
|
+
*/
|
|
125
211
|
sendTx(params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
212
|
+
/**
|
|
213
|
+
* Requests the status of the connected RPC node. This includes information
|
|
214
|
+
* about sync status, nearcore node version, protocol version, the current set
|
|
215
|
+
* of validators, etc.
|
|
216
|
+
*/
|
|
126
217
|
status(params?: RpcStatusRequest): Promise<RpcStatusResponse>;
|
|
218
|
+
/**
|
|
219
|
+
* Queries status of a transaction by hash and returns the final transaction
|
|
220
|
+
* result.
|
|
221
|
+
*/
|
|
127
222
|
tx(params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
223
|
+
/**
|
|
224
|
+
* Queries active validators on the network. Returns details and the state of
|
|
225
|
+
* validation on the blockchain.
|
|
226
|
+
*/
|
|
128
227
|
validators(params?: RpcValidatorRequest): Promise<RpcValidatorResponse>;
|
|
129
228
|
}
|
|
130
229
|
interface ConvenienceMethods {
|
|
@@ -150,36 +249,150 @@ interface ConvenienceMethods {
|
|
|
150
249
|
interface CompleteClientInterface extends DynamicRpcMethods, ConvenienceMethods {
|
|
151
250
|
call<TParams = unknown, TResult = unknown>(method: string, params?: TParams): Promise<TResult>;
|
|
152
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* [Deprecated] Returns changes for a given account, contract or contract code
|
|
254
|
+
* for given block height or hash. Consider using changes instead.
|
|
255
|
+
*/
|
|
153
256
|
declare function experimentalChanges(client: NearRpcClient, params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
257
|
+
/**
|
|
258
|
+
* [Deprecated] Returns changes in block for given block height or hash over
|
|
259
|
+
* all transactions for all the types. Includes changes like account_touched,
|
|
260
|
+
* access_key_touched, data_touched, contract_code_touched. Consider using
|
|
261
|
+
* block_effects instead
|
|
262
|
+
*/
|
|
154
263
|
declare function experimentalChangesInBlock(client: NearRpcClient, params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
264
|
+
/**
|
|
265
|
+
* Queries the congestion level of a shard. More info about congestion
|
|
266
|
+
* [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)
|
|
267
|
+
*/
|
|
155
268
|
declare function experimentalCongestionLevel(client: NearRpcClient, params?: RpcCongestionLevelRequest): Promise<RpcCongestionLevelResponse>;
|
|
269
|
+
/**
|
|
270
|
+
* [Deprecated] Get initial state and parameters for the genesis block.
|
|
271
|
+
* Consider genesis_config instead.
|
|
272
|
+
*/
|
|
156
273
|
declare function experimentalGenesisConfig(client: NearRpcClient, params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
274
|
+
/** Returns the proofs for a transaction execution. */
|
|
157
275
|
declare function experimentalLightClientBlockProof(client: NearRpcClient, params?: RpcLightClientBlockProofRequest): Promise<RpcLightClientBlockProofResponse>;
|
|
276
|
+
/** Returns the proofs for a transaction execution. */
|
|
158
277
|
declare function experimentalLightClientProof(client: NearRpcClient, params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
278
|
+
/**
|
|
279
|
+
* [Deprecated] Returns the future windows for maintenance in current epoch
|
|
280
|
+
* for the specified account. In the maintenance windows, the node will not be
|
|
281
|
+
* block producer or chunk producer. Consider using maintenance_windows
|
|
282
|
+
* instead.
|
|
283
|
+
*/
|
|
159
284
|
declare function experimentalMaintenanceWindows(client: NearRpcClient, params?: RpcMaintenanceWindowsRequest): Promise<EXPERIMENTALMaintenanceWindowsResponse>;
|
|
285
|
+
/**
|
|
286
|
+
* A configuration that defines the protocol-level parameters such as
|
|
287
|
+
* gas/storage costs, limits, feature flags, other settings
|
|
288
|
+
*/
|
|
160
289
|
declare function experimentalProtocolConfig(client: NearRpcClient, params?: RpcProtocolConfigRequest): Promise<RpcProtocolConfigResponse>;
|
|
290
|
+
/** Fetches a receipt by its ID (as is, without a status or execution outcome) */
|
|
161
291
|
declare function experimentalReceipt(client: NearRpcClient, params?: RpcReceiptRequest): Promise<RpcReceiptResponse>;
|
|
292
|
+
/**
|
|
293
|
+
* Contains the split storage information. More info on split storage
|
|
294
|
+
* [here](https://near-nodes.io/archival/split-storage-archival)
|
|
295
|
+
*/
|
|
162
296
|
declare function experimentalSplitStorageInfo(client: NearRpcClient, params?: RpcSplitStorageInfoRequest): Promise<RpcSplitStorageInfoResponse>;
|
|
297
|
+
/**
|
|
298
|
+
* Queries status of a transaction by hash, returning the final transaction
|
|
299
|
+
* result and details of all receipts.
|
|
300
|
+
*/
|
|
163
301
|
declare function experimentalTxStatus(client: NearRpcClient, params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
302
|
+
/**
|
|
303
|
+
* Returns the current epoch validators ordered in the block producer order
|
|
304
|
+
* with repetition. This endpoint is solely used for bridge currently and is
|
|
305
|
+
* not intended for other external use cases.
|
|
306
|
+
*/
|
|
164
307
|
declare function experimentalValidatorsOrdered(client: NearRpcClient, params?: RpcValidatorsOrderedRequest): Promise<EXPERIMENTALValidatorsOrderedResponse>;
|
|
308
|
+
/** Returns block details for given height or hash */
|
|
165
309
|
declare function block(client: NearRpcClient, params?: RpcBlockRequest): Promise<RpcBlockResponse>;
|
|
310
|
+
/**
|
|
311
|
+
* Returns changes in block for given block height or hash over all
|
|
312
|
+
* transactions for all the types. Includes changes like account_touched,
|
|
313
|
+
* access_key_touched, data_touched, contract_code_touched.
|
|
314
|
+
*/
|
|
166
315
|
declare function blockEffects(client: NearRpcClient, params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
316
|
+
/**
|
|
317
|
+
* [Deprecated] Sends a transaction and immediately returns transaction hash.
|
|
318
|
+
* Consider using send_tx instead.
|
|
319
|
+
*/
|
|
167
320
|
declare function broadcastTxAsync(client: NearRpcClient, params?: RpcSendTransactionRequest): Promise<CryptoHash>;
|
|
321
|
+
/**
|
|
322
|
+
* [Deprecated] Sends a transaction and waits until transaction is fully
|
|
323
|
+
* complete. (Has a 10 second timeout). Consider using send_tx instead.
|
|
324
|
+
*/
|
|
168
325
|
declare function broadcastTxCommit(client: NearRpcClient, params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
326
|
+
/**
|
|
327
|
+
* Returns changes for a given account, contract or contract code for given
|
|
328
|
+
* block height or hash.
|
|
329
|
+
*/
|
|
169
330
|
declare function changes(client: NearRpcClient, params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
331
|
+
/**
|
|
332
|
+
* Returns details of a specific chunk. You can run a block details query to
|
|
333
|
+
* get a valid chunk hash.
|
|
334
|
+
*/
|
|
170
335
|
declare function chunk(client: NearRpcClient, params?: RpcChunkRequest): Promise<RpcChunkResponse>;
|
|
336
|
+
/** Queries client node configuration */
|
|
171
337
|
declare function clientConfig(client: NearRpcClient, params?: RpcClientConfigRequest): Promise<RpcClientConfigResponse>;
|
|
338
|
+
/**
|
|
339
|
+
* Returns gas price for a specific block_height or block_hash. Using [null]
|
|
340
|
+
* will return the most recent block's gas price.
|
|
341
|
+
*/
|
|
172
342
|
declare function gasPrice(client: NearRpcClient, params?: RpcGasPriceRequest): Promise<RpcGasPriceResponse>;
|
|
343
|
+
/** Get initial state and parameters for the genesis block */
|
|
173
344
|
declare function genesisConfig(client: NearRpcClient, params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
345
|
+
/** Returns the current health status of the RPC node the client connects to. */
|
|
174
346
|
declare function health(client: NearRpcClient, params?: RpcHealthRequest): Promise<RpcHealthResponse>;
|
|
347
|
+
/** Returns the proofs for a transaction execution. */
|
|
175
348
|
declare function lightClientProof(client: NearRpcClient, params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
349
|
+
/**
|
|
350
|
+
* Returns the future windows for maintenance in current epoch for the
|
|
351
|
+
* specified account. In the maintenance windows, the node will not be block
|
|
352
|
+
* producer or chunk producer.
|
|
353
|
+
*/
|
|
176
354
|
declare function maintenanceWindows(client: NearRpcClient, params?: RpcMaintenanceWindowsRequest): Promise<MaintenanceWindowsResponse>;
|
|
355
|
+
/**
|
|
356
|
+
* Queries the current state of node network connections. This includes
|
|
357
|
+
* information about active peers, transmitted data, known producers, etc.
|
|
358
|
+
*/
|
|
177
359
|
declare function networkInfo(client: NearRpcClient, params?: RpcNetworkInfoRequest): Promise<RpcNetworkInfoResponse>;
|
|
360
|
+
/** Returns the next light client block. */
|
|
178
361
|
declare function nextLightClientBlock(client: NearRpcClient, params?: RpcLightClientNextBlockRequest): Promise<RpcLightClientNextBlockResponse>;
|
|
362
|
+
/**
|
|
363
|
+
* This module allows you to make generic requests to the network. The
|
|
364
|
+
* `RpcQueryRequest` struct takes in a
|
|
365
|
+
* [`BlockReference`](https://docs.rs/near-primitives/0.12.0/near_primitives/types/enum.BlockReference.html)
|
|
366
|
+
* and a
|
|
367
|
+
* [`QueryRequest`](https://docs.rs/near-primitives/0.12.0/near_primitives/views/enum.QueryRequest.html).
|
|
368
|
+
* The `BlockReference` enum allows you to specify a block by `Finality`,
|
|
369
|
+
* `BlockId` or `SyncCheckpoint`. The `QueryRequest` enum provides multiple
|
|
370
|
+
* variants for performing the following actions: - View an account's details
|
|
371
|
+
* - View a contract's code - View the state of an account - View the
|
|
372
|
+
* `AccessKey` of an account - View the `AccessKeyList` of an account - Call a
|
|
373
|
+
* function in a contract deployed on the network.
|
|
374
|
+
*/
|
|
179
375
|
declare function query(client: NearRpcClient, params?: RpcQueryRequest): Promise<RpcQueryResponse>;
|
|
376
|
+
/**
|
|
377
|
+
* Sends transaction. Returns the guaranteed execution status and the results
|
|
378
|
+
* the blockchain can provide at the moment.
|
|
379
|
+
*/
|
|
180
380
|
declare function sendTx(client: NearRpcClient, params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
381
|
+
/**
|
|
382
|
+
* Requests the status of the connected RPC node. This includes information
|
|
383
|
+
* about sync status, nearcore node version, protocol version, the current set
|
|
384
|
+
* of validators, etc.
|
|
385
|
+
*/
|
|
181
386
|
declare function status(client: NearRpcClient, params?: RpcStatusRequest): Promise<RpcStatusResponse>;
|
|
387
|
+
/**
|
|
388
|
+
* Queries status of a transaction by hash and returns the final transaction
|
|
389
|
+
* result.
|
|
390
|
+
*/
|
|
182
391
|
declare function tx(client: NearRpcClient, params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
392
|
+
/**
|
|
393
|
+
* Queries active validators on the network. Returns details and the state of
|
|
394
|
+
* validation on the blockchain.
|
|
395
|
+
*/
|
|
183
396
|
declare function validators(client: NearRpcClient, params?: RpcValidatorRequest): Promise<RpcValidatorResponse>;
|
|
184
397
|
|
|
185
398
|
declare function viewAccount(client: NearRpcClient, params: {
|
|
@@ -209,4 +422,4 @@ declare function viewFunctionAsJson<T = unknown>(client: NearRpcClient, params:
|
|
|
209
422
|
blockId?: string | number;
|
|
210
423
|
}): Promise<T>;
|
|
211
424
|
|
|
212
|
-
export {
|
|
425
|
+
export { broadcastTxAsync as A, broadcastTxCommit as B, type ConvenienceMethods as C, type DynamicRpcMethods as D, changes as E, chunk as F, clientConfig as G, gasPrice as H, genesisConfig as I, type JsonRpcRequest as J, health as K, lightClientProof as L, maintenanceWindows as M, NearRpcClient as N, networkInfo as O, nextLightClientBlock as P, query as Q, type RpcRequest as R, sendTx as S, status as T, tx as U, validators as V, viewAccount as W, viewFunction as X, viewAccessKey as Y, type CompleteClientInterface as a, type ClientConfig as b, type JsonRpcResponse as c, defaultClient as d, type JsonRpcError as e, JsonRpcClientError as f, JsonRpcNetworkError as g, type RpcResponse as h, type RpcError as i, NearRpcError as j, experimentalChanges as k, experimentalChangesInBlock as l, experimentalCongestionLevel as m, experimentalGenesisConfig as n, experimentalLightClientBlockProof as o, parseCallResultToJson as p, experimentalLightClientProof as q, experimentalMaintenanceWindows as r, experimentalProtocolConfig as s, experimentalReceipt as t, experimentalSplitStorageInfo as u, viewFunctionAsJson as v, experimentalTxStatus as w, experimentalValidatorsOrdered as x, block as y, blockEffects as z };
|
|
@@ -1,36 +1,150 @@
|
|
|
1
1
|
import type { AccessKeyView, AccountView, CallResult, CryptoHash, EXPERIMENTALMaintenanceWindowsResponse, EXPERIMENTALValidatorsOrderedResponse, GenesisConfig, GenesisConfigRequest, MaintenanceWindowsResponse, RpcBlockRequest, RpcBlockResponse, RpcChunkRequest, RpcChunkResponse, RpcClientConfigRequest, RpcClientConfigResponse, RpcCongestionLevelRequest, RpcCongestionLevelResponse, RpcGasPriceRequest, RpcGasPriceResponse, RpcHealthRequest, RpcHealthResponse, RpcLightClientBlockProofRequest, RpcLightClientBlockProofResponse, RpcLightClientExecutionProofRequest, RpcLightClientExecutionProofResponse, RpcLightClientNextBlockRequest, RpcLightClientNextBlockResponse, RpcMaintenanceWindowsRequest, RpcNetworkInfoRequest, RpcNetworkInfoResponse, RpcProtocolConfigRequest, RpcProtocolConfigResponse, RpcQueryRequest, RpcQueryResponse, RpcReceiptRequest, RpcReceiptResponse, RpcSendTransactionRequest, RpcSplitStorageInfoRequest, RpcSplitStorageInfoResponse, RpcStateChangesInBlockByTypeRequest, RpcStateChangesInBlockByTypeResponse, RpcStateChangesInBlockRequest, RpcStateChangesInBlockResponse, RpcStatusRequest, RpcStatusResponse, RpcTransactionResponse, RpcTransactionStatusRequest, RpcValidatorRequest, RpcValidatorResponse, RpcValidatorsOrderedRequest } from '@psalomo/jsonrpc-types';
|
|
2
2
|
import type { NearRpcClient } from './client';
|
|
3
3
|
export interface DynamicRpcMethods {
|
|
4
|
+
/**
|
|
5
|
+
* [Deprecated] Returns changes for a given account, contract or contract code
|
|
6
|
+
* for given block height or hash. Consider using changes instead.
|
|
7
|
+
*/
|
|
4
8
|
experimentalChanges(params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* [Deprecated] Returns changes in block for given block height or hash over
|
|
11
|
+
* all transactions for all the types. Includes changes like account_touched,
|
|
12
|
+
* access_key_touched, data_touched, contract_code_touched. Consider using
|
|
13
|
+
* block_effects instead
|
|
14
|
+
*/
|
|
5
15
|
experimentalChangesInBlock(params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* Queries the congestion level of a shard. More info about congestion
|
|
18
|
+
* [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)
|
|
19
|
+
*/
|
|
6
20
|
experimentalCongestionLevel(params?: RpcCongestionLevelRequest): Promise<RpcCongestionLevelResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* [Deprecated] Get initial state and parameters for the genesis block.
|
|
23
|
+
* Consider genesis_config instead.
|
|
24
|
+
*/
|
|
7
25
|
experimentalGenesisConfig(params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
26
|
+
/** Returns the proofs for a transaction execution. */
|
|
8
27
|
experimentalLightClientBlockProof(params?: RpcLightClientBlockProofRequest): Promise<RpcLightClientBlockProofResponse>;
|
|
28
|
+
/** Returns the proofs for a transaction execution. */
|
|
9
29
|
experimentalLightClientProof(params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* [Deprecated] Returns the future windows for maintenance in current epoch
|
|
32
|
+
* for the specified account. In the maintenance windows, the node will not be
|
|
33
|
+
* block producer or chunk producer. Consider using maintenance_windows
|
|
34
|
+
* instead.
|
|
35
|
+
*/
|
|
10
36
|
experimentalMaintenanceWindows(params?: RpcMaintenanceWindowsRequest): Promise<EXPERIMENTALMaintenanceWindowsResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* A configuration that defines the protocol-level parameters such as
|
|
39
|
+
* gas/storage costs, limits, feature flags, other settings
|
|
40
|
+
*/
|
|
11
41
|
experimentalProtocolConfig(params?: RpcProtocolConfigRequest): Promise<RpcProtocolConfigResponse>;
|
|
42
|
+
/** Fetches a receipt by its ID (as is, without a status or execution outcome) */
|
|
12
43
|
experimentalReceipt(params?: RpcReceiptRequest): Promise<RpcReceiptResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Contains the split storage information. More info on split storage
|
|
46
|
+
* [here](https://near-nodes.io/archival/split-storage-archival)
|
|
47
|
+
*/
|
|
13
48
|
experimentalSplitStorageInfo(params?: RpcSplitStorageInfoRequest): Promise<RpcSplitStorageInfoResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Queries status of a transaction by hash, returning the final transaction
|
|
51
|
+
* result and details of all receipts.
|
|
52
|
+
*/
|
|
14
53
|
experimentalTxStatus(params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the current epoch validators ordered in the block producer order
|
|
56
|
+
* with repetition. This endpoint is solely used for bridge currently and is
|
|
57
|
+
* not intended for other external use cases.
|
|
58
|
+
*/
|
|
15
59
|
experimentalValidatorsOrdered(params?: RpcValidatorsOrderedRequest): Promise<EXPERIMENTALValidatorsOrderedResponse>;
|
|
60
|
+
/** Returns block details for given height or hash */
|
|
16
61
|
block(params?: RpcBlockRequest): Promise<RpcBlockResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Returns changes in block for given block height or hash over all
|
|
64
|
+
* transactions for all the types. Includes changes like account_touched,
|
|
65
|
+
* access_key_touched, data_touched, contract_code_touched.
|
|
66
|
+
*/
|
|
17
67
|
blockEffects(params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* [Deprecated] Sends a transaction and immediately returns transaction hash.
|
|
70
|
+
* Consider using send_tx instead.
|
|
71
|
+
*/
|
|
18
72
|
broadcastTxAsync(params?: RpcSendTransactionRequest): Promise<CryptoHash>;
|
|
73
|
+
/**
|
|
74
|
+
* [Deprecated] Sends a transaction and waits until transaction is fully
|
|
75
|
+
* complete. (Has a 10 second timeout). Consider using send_tx instead.
|
|
76
|
+
*/
|
|
19
77
|
broadcastTxCommit(params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Returns changes for a given account, contract or contract code for given
|
|
80
|
+
* block height or hash.
|
|
81
|
+
*/
|
|
20
82
|
changes(params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Returns details of a specific chunk. You can run a block details query to
|
|
85
|
+
* get a valid chunk hash.
|
|
86
|
+
*/
|
|
21
87
|
chunk(params?: RpcChunkRequest): Promise<RpcChunkResponse>;
|
|
88
|
+
/** Queries client node configuration */
|
|
22
89
|
clientConfig(params?: RpcClientConfigRequest): Promise<RpcClientConfigResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* Returns gas price for a specific block_height or block_hash. Using [null]
|
|
92
|
+
* will return the most recent block's gas price.
|
|
93
|
+
*/
|
|
23
94
|
gasPrice(params?: RpcGasPriceRequest): Promise<RpcGasPriceResponse>;
|
|
95
|
+
/** Get initial state and parameters for the genesis block */
|
|
24
96
|
genesisConfig(params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
97
|
+
/** Returns the current health status of the RPC node the client connects to. */
|
|
25
98
|
health(params?: RpcHealthRequest): Promise<RpcHealthResponse>;
|
|
99
|
+
/** Returns the proofs for a transaction execution. */
|
|
26
100
|
lightClientProof(params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the future windows for maintenance in current epoch for the
|
|
103
|
+
* specified account. In the maintenance windows, the node will not be block
|
|
104
|
+
* producer or chunk producer.
|
|
105
|
+
*/
|
|
27
106
|
maintenanceWindows(params?: RpcMaintenanceWindowsRequest): Promise<MaintenanceWindowsResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Queries the current state of node network connections. This includes
|
|
109
|
+
* information about active peers, transmitted data, known producers, etc.
|
|
110
|
+
*/
|
|
28
111
|
networkInfo(params?: RpcNetworkInfoRequest): Promise<RpcNetworkInfoResponse>;
|
|
112
|
+
/** Returns the next light client block. */
|
|
29
113
|
nextLightClientBlock(params?: RpcLightClientNextBlockRequest): Promise<RpcLightClientNextBlockResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* This module allows you to make generic requests to the network. The
|
|
116
|
+
* `RpcQueryRequest` struct takes in a
|
|
117
|
+
* [`BlockReference`](https://docs.rs/near-primitives/0.12.0/near_primitives/types/enum.BlockReference.html)
|
|
118
|
+
* and a
|
|
119
|
+
* [`QueryRequest`](https://docs.rs/near-primitives/0.12.0/near_primitives/views/enum.QueryRequest.html).
|
|
120
|
+
* The `BlockReference` enum allows you to specify a block by `Finality`,
|
|
121
|
+
* `BlockId` or `SyncCheckpoint`. The `QueryRequest` enum provides multiple
|
|
122
|
+
* variants for performing the following actions: - View an account's details
|
|
123
|
+
* - View a contract's code - View the state of an account - View the
|
|
124
|
+
* `AccessKey` of an account - View the `AccessKeyList` of an account - Call a
|
|
125
|
+
* function in a contract deployed on the network.
|
|
126
|
+
*/
|
|
30
127
|
query(params?: RpcQueryRequest): Promise<RpcQueryResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Sends transaction. Returns the guaranteed execution status and the results
|
|
130
|
+
* the blockchain can provide at the moment.
|
|
131
|
+
*/
|
|
31
132
|
sendTx(params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Requests the status of the connected RPC node. This includes information
|
|
135
|
+
* about sync status, nearcore node version, protocol version, the current set
|
|
136
|
+
* of validators, etc.
|
|
137
|
+
*/
|
|
32
138
|
status(params?: RpcStatusRequest): Promise<RpcStatusResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Queries status of a transaction by hash and returns the final transaction
|
|
141
|
+
* result.
|
|
142
|
+
*/
|
|
33
143
|
tx(params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
144
|
+
/**
|
|
145
|
+
* Queries active validators on the network. Returns details and the state of
|
|
146
|
+
* validation on the blockchain.
|
|
147
|
+
*/
|
|
34
148
|
validators(params?: RpcValidatorRequest): Promise<RpcValidatorResponse>;
|
|
35
149
|
}
|
|
36
150
|
export interface ConvenienceMethods {
|
|
@@ -56,35 +170,149 @@ export interface ConvenienceMethods {
|
|
|
56
170
|
export interface CompleteClientInterface extends DynamicRpcMethods, ConvenienceMethods {
|
|
57
171
|
call<TParams = unknown, TResult = unknown>(method: string, params?: TParams): Promise<TResult>;
|
|
58
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* [Deprecated] Returns changes for a given account, contract or contract code
|
|
175
|
+
* for given block height or hash. Consider using changes instead.
|
|
176
|
+
*/
|
|
59
177
|
export declare function experimentalChanges(client: NearRpcClient, params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
178
|
+
/**
|
|
179
|
+
* [Deprecated] Returns changes in block for given block height or hash over
|
|
180
|
+
* all transactions for all the types. Includes changes like account_touched,
|
|
181
|
+
* access_key_touched, data_touched, contract_code_touched. Consider using
|
|
182
|
+
* block_effects instead
|
|
183
|
+
*/
|
|
60
184
|
export declare function experimentalChangesInBlock(client: NearRpcClient, params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
185
|
+
/**
|
|
186
|
+
* Queries the congestion level of a shard. More info about congestion
|
|
187
|
+
* [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)
|
|
188
|
+
*/
|
|
61
189
|
export declare function experimentalCongestionLevel(client: NearRpcClient, params?: RpcCongestionLevelRequest): Promise<RpcCongestionLevelResponse>;
|
|
190
|
+
/**
|
|
191
|
+
* [Deprecated] Get initial state and parameters for the genesis block.
|
|
192
|
+
* Consider genesis_config instead.
|
|
193
|
+
*/
|
|
62
194
|
export declare function experimentalGenesisConfig(client: NearRpcClient, params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
195
|
+
/** Returns the proofs for a transaction execution. */
|
|
63
196
|
export declare function experimentalLightClientBlockProof(client: NearRpcClient, params?: RpcLightClientBlockProofRequest): Promise<RpcLightClientBlockProofResponse>;
|
|
197
|
+
/** Returns the proofs for a transaction execution. */
|
|
64
198
|
export declare function experimentalLightClientProof(client: NearRpcClient, params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
199
|
+
/**
|
|
200
|
+
* [Deprecated] Returns the future windows for maintenance in current epoch
|
|
201
|
+
* for the specified account. In the maintenance windows, the node will not be
|
|
202
|
+
* block producer or chunk producer. Consider using maintenance_windows
|
|
203
|
+
* instead.
|
|
204
|
+
*/
|
|
65
205
|
export declare function experimentalMaintenanceWindows(client: NearRpcClient, params?: RpcMaintenanceWindowsRequest): Promise<EXPERIMENTALMaintenanceWindowsResponse>;
|
|
206
|
+
/**
|
|
207
|
+
* A configuration that defines the protocol-level parameters such as
|
|
208
|
+
* gas/storage costs, limits, feature flags, other settings
|
|
209
|
+
*/
|
|
66
210
|
export declare function experimentalProtocolConfig(client: NearRpcClient, params?: RpcProtocolConfigRequest): Promise<RpcProtocolConfigResponse>;
|
|
211
|
+
/** Fetches a receipt by its ID (as is, without a status or execution outcome) */
|
|
67
212
|
export declare function experimentalReceipt(client: NearRpcClient, params?: RpcReceiptRequest): Promise<RpcReceiptResponse>;
|
|
213
|
+
/**
|
|
214
|
+
* Contains the split storage information. More info on split storage
|
|
215
|
+
* [here](https://near-nodes.io/archival/split-storage-archival)
|
|
216
|
+
*/
|
|
68
217
|
export declare function experimentalSplitStorageInfo(client: NearRpcClient, params?: RpcSplitStorageInfoRequest): Promise<RpcSplitStorageInfoResponse>;
|
|
218
|
+
/**
|
|
219
|
+
* Queries status of a transaction by hash, returning the final transaction
|
|
220
|
+
* result and details of all receipts.
|
|
221
|
+
*/
|
|
69
222
|
export declare function experimentalTxStatus(client: NearRpcClient, params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
223
|
+
/**
|
|
224
|
+
* Returns the current epoch validators ordered in the block producer order
|
|
225
|
+
* with repetition. This endpoint is solely used for bridge currently and is
|
|
226
|
+
* not intended for other external use cases.
|
|
227
|
+
*/
|
|
70
228
|
export declare function experimentalValidatorsOrdered(client: NearRpcClient, params?: RpcValidatorsOrderedRequest): Promise<EXPERIMENTALValidatorsOrderedResponse>;
|
|
229
|
+
/** Returns block details for given height or hash */
|
|
71
230
|
export declare function block(client: NearRpcClient, params?: RpcBlockRequest): Promise<RpcBlockResponse>;
|
|
231
|
+
/**
|
|
232
|
+
* Returns changes in block for given block height or hash over all
|
|
233
|
+
* transactions for all the types. Includes changes like account_touched,
|
|
234
|
+
* access_key_touched, data_touched, contract_code_touched.
|
|
235
|
+
*/
|
|
72
236
|
export declare function blockEffects(client: NearRpcClient, params?: RpcStateChangesInBlockRequest): Promise<RpcStateChangesInBlockByTypeResponse>;
|
|
237
|
+
/**
|
|
238
|
+
* [Deprecated] Sends a transaction and immediately returns transaction hash.
|
|
239
|
+
* Consider using send_tx instead.
|
|
240
|
+
*/
|
|
73
241
|
export declare function broadcastTxAsync(client: NearRpcClient, params?: RpcSendTransactionRequest): Promise<CryptoHash>;
|
|
242
|
+
/**
|
|
243
|
+
* [Deprecated] Sends a transaction and waits until transaction is fully
|
|
244
|
+
* complete. (Has a 10 second timeout). Consider using send_tx instead.
|
|
245
|
+
*/
|
|
74
246
|
export declare function broadcastTxCommit(client: NearRpcClient, params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
247
|
+
/**
|
|
248
|
+
* Returns changes for a given account, contract or contract code for given
|
|
249
|
+
* block height or hash.
|
|
250
|
+
*/
|
|
75
251
|
export declare function changes(client: NearRpcClient, params?: RpcStateChangesInBlockByTypeRequest): Promise<RpcStateChangesInBlockResponse>;
|
|
252
|
+
/**
|
|
253
|
+
* Returns details of a specific chunk. You can run a block details query to
|
|
254
|
+
* get a valid chunk hash.
|
|
255
|
+
*/
|
|
76
256
|
export declare function chunk(client: NearRpcClient, params?: RpcChunkRequest): Promise<RpcChunkResponse>;
|
|
257
|
+
/** Queries client node configuration */
|
|
77
258
|
export declare function clientConfig(client: NearRpcClient, params?: RpcClientConfigRequest): Promise<RpcClientConfigResponse>;
|
|
259
|
+
/**
|
|
260
|
+
* Returns gas price for a specific block_height or block_hash. Using [null]
|
|
261
|
+
* will return the most recent block's gas price.
|
|
262
|
+
*/
|
|
78
263
|
export declare function gasPrice(client: NearRpcClient, params?: RpcGasPriceRequest): Promise<RpcGasPriceResponse>;
|
|
264
|
+
/** Get initial state and parameters for the genesis block */
|
|
79
265
|
export declare function genesisConfig(client: NearRpcClient, params?: GenesisConfigRequest): Promise<GenesisConfig>;
|
|
266
|
+
/** Returns the current health status of the RPC node the client connects to. */
|
|
80
267
|
export declare function health(client: NearRpcClient, params?: RpcHealthRequest): Promise<RpcHealthResponse>;
|
|
268
|
+
/** Returns the proofs for a transaction execution. */
|
|
81
269
|
export declare function lightClientProof(client: NearRpcClient, params?: RpcLightClientExecutionProofRequest): Promise<RpcLightClientExecutionProofResponse>;
|
|
270
|
+
/**
|
|
271
|
+
* Returns the future windows for maintenance in current epoch for the
|
|
272
|
+
* specified account. In the maintenance windows, the node will not be block
|
|
273
|
+
* producer or chunk producer.
|
|
274
|
+
*/
|
|
82
275
|
export declare function maintenanceWindows(client: NearRpcClient, params?: RpcMaintenanceWindowsRequest): Promise<MaintenanceWindowsResponse>;
|
|
276
|
+
/**
|
|
277
|
+
* Queries the current state of node network connections. This includes
|
|
278
|
+
* information about active peers, transmitted data, known producers, etc.
|
|
279
|
+
*/
|
|
83
280
|
export declare function networkInfo(client: NearRpcClient, params?: RpcNetworkInfoRequest): Promise<RpcNetworkInfoResponse>;
|
|
281
|
+
/** Returns the next light client block. */
|
|
84
282
|
export declare function nextLightClientBlock(client: NearRpcClient, params?: RpcLightClientNextBlockRequest): Promise<RpcLightClientNextBlockResponse>;
|
|
283
|
+
/**
|
|
284
|
+
* This module allows you to make generic requests to the network. The
|
|
285
|
+
* `RpcQueryRequest` struct takes in a
|
|
286
|
+
* [`BlockReference`](https://docs.rs/near-primitives/0.12.0/near_primitives/types/enum.BlockReference.html)
|
|
287
|
+
* and a
|
|
288
|
+
* [`QueryRequest`](https://docs.rs/near-primitives/0.12.0/near_primitives/views/enum.QueryRequest.html).
|
|
289
|
+
* The `BlockReference` enum allows you to specify a block by `Finality`,
|
|
290
|
+
* `BlockId` or `SyncCheckpoint`. The `QueryRequest` enum provides multiple
|
|
291
|
+
* variants for performing the following actions: - View an account's details
|
|
292
|
+
* - View a contract's code - View the state of an account - View the
|
|
293
|
+
* `AccessKey` of an account - View the `AccessKeyList` of an account - Call a
|
|
294
|
+
* function in a contract deployed on the network.
|
|
295
|
+
*/
|
|
85
296
|
export declare function query(client: NearRpcClient, params?: RpcQueryRequest): Promise<RpcQueryResponse>;
|
|
297
|
+
/**
|
|
298
|
+
* Sends transaction. Returns the guaranteed execution status and the results
|
|
299
|
+
* the blockchain can provide at the moment.
|
|
300
|
+
*/
|
|
86
301
|
export declare function sendTx(client: NearRpcClient, params?: RpcSendTransactionRequest): Promise<RpcTransactionResponse>;
|
|
302
|
+
/**
|
|
303
|
+
* Requests the status of the connected RPC node. This includes information
|
|
304
|
+
* about sync status, nearcore node version, protocol version, the current set
|
|
305
|
+
* of validators, etc.
|
|
306
|
+
*/
|
|
87
307
|
export declare function status(client: NearRpcClient, params?: RpcStatusRequest): Promise<RpcStatusResponse>;
|
|
308
|
+
/**
|
|
309
|
+
* Queries status of a transaction by hash and returns the final transaction
|
|
310
|
+
* result.
|
|
311
|
+
*/
|
|
88
312
|
export declare function tx(client: NearRpcClient, params?: RpcTransactionStatusRequest): Promise<RpcTransactionResponse>;
|
|
313
|
+
/**
|
|
314
|
+
* Queries active validators on the network. Returns details and the state of
|
|
315
|
+
* validation on the blockchain.
|
|
316
|
+
*/
|
|
89
317
|
export declare function validators(client: NearRpcClient, params?: RpcValidatorRequest): Promise<RpcValidatorResponse>;
|
|
90
318
|
//# sourceMappingURL=generated-types.d.ts.map
|