@psalomo/jsonrpc-client 1.2.0 → 1.3.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/browser-standalone.js +230 -33
- package/dist/{convenience-DFvZCHOk.d.mts → convenience-5WSFl5pu.d.mts} +228 -0
- package/dist/{convenience-DFvZCHOk.d.ts → convenience-5WSFl5pu.d.ts} +228 -0
- package/dist/generated-types.d.ts +228 -0
- package/dist/generated-types.d.ts.map +1 -1
- package/dist/index.d.mts +116 -2
- package/dist/no-validation/index.d.mts +1 -1
- package/dist/validated/index.d.ts +114 -0
- package/dist/validated/index.d.ts.map +1 -1
- package/package.json +2 -2
@@ -4890,132 +4890,215 @@ Object.entries(PATH_TO_METHOD_MAP).forEach(([path, method]) => {
|
|
4890
4890
|
var RPC_METHODS = Object.values(PATH_TO_METHOD_MAP);
|
4891
4891
|
|
4892
4892
|
// Auto-generated static RPC functions for tree-shaking
|
4893
|
-
// Generated at: 2025-
|
4893
|
+
// Generated at: 2025-08-03T18:51:29.359Z
|
4894
4894
|
// Total functions: 31
|
4895
4895
|
//
|
4896
4896
|
// This file is automatically generated by tools/codegen/generate-client-interface.ts
|
4897
4897
|
// Do not edit manually - changes will be overwritten
|
4898
|
-
|
4898
|
+
/**
|
4899
|
+
* [Deprecated] Returns changes for a given account, contract or contract code
|
4900
|
+
* for given block height or hash. Consider using changes instead.
|
4901
|
+
*/
|
4899
4902
|
async function experimentalChanges$1(client, params) {
|
4900
4903
|
return client.makeRequest('EXPERIMENTAL_changes', params);
|
4901
4904
|
}
|
4902
|
-
|
4905
|
+
/**
|
4906
|
+
* [Deprecated] Returns changes in block for given block height or hash over
|
4907
|
+
* all transactions for all the types. Includes changes like account_touched,
|
4908
|
+
* access_key_touched, data_touched, contract_code_touched. Consider using
|
4909
|
+
* block_effects instead
|
4910
|
+
*/
|
4903
4911
|
async function experimentalChangesInBlock$1(client, params) {
|
4904
4912
|
return client.makeRequest('EXPERIMENTAL_changes_in_block', params);
|
4905
4913
|
}
|
4906
|
-
|
4914
|
+
/**
|
4915
|
+
* Queries the congestion level of a shard. More info about congestion
|
4916
|
+
* [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)
|
4917
|
+
*/
|
4907
4918
|
async function experimentalCongestionLevel$1(client, params) {
|
4908
4919
|
return client.makeRequest('EXPERIMENTAL_congestion_level', params);
|
4909
4920
|
}
|
4910
|
-
|
4921
|
+
/**
|
4922
|
+
* [Deprecated] Get initial state and parameters for the genesis block.
|
4923
|
+
* Consider genesis_config instead.
|
4924
|
+
*/
|
4911
4925
|
async function experimentalGenesisConfig$1(client, params) {
|
4912
4926
|
return client.makeRequest('EXPERIMENTAL_genesis_config', params);
|
4913
4927
|
}
|
4914
|
-
|
4928
|
+
/** Returns the proofs for a transaction execution. */
|
4915
4929
|
async function experimentalLightClientBlockProof$1(client, params) {
|
4916
4930
|
return client.makeRequest('EXPERIMENTAL_light_client_block_proof', params);
|
4917
4931
|
}
|
4918
|
-
|
4932
|
+
/** Returns the proofs for a transaction execution. */
|
4919
4933
|
async function experimentalLightClientProof$1(client, params) {
|
4920
4934
|
return client.makeRequest('EXPERIMENTAL_light_client_proof', params);
|
4921
4935
|
}
|
4922
|
-
|
4936
|
+
/**
|
4937
|
+
* [Deprecated] Returns the future windows for maintenance in current epoch
|
4938
|
+
* for the specified account. In the maintenance windows, the node will not be
|
4939
|
+
* block producer or chunk producer. Consider using maintenance_windows
|
4940
|
+
* instead.
|
4941
|
+
*/
|
4923
4942
|
async function experimentalMaintenanceWindows$1(client, params) {
|
4924
4943
|
return client.makeRequest('EXPERIMENTAL_maintenance_windows', params);
|
4925
4944
|
}
|
4926
|
-
|
4945
|
+
/**
|
4946
|
+
* A configuration that defines the protocol-level parameters such as
|
4947
|
+
* gas/storage costs, limits, feature flags, other settings
|
4948
|
+
*/
|
4927
4949
|
async function experimentalProtocolConfig$1(client, params) {
|
4928
4950
|
return client.makeRequest('EXPERIMENTAL_protocol_config', params);
|
4929
4951
|
}
|
4930
|
-
|
4952
|
+
/** Fetches a receipt by its ID (as is, without a status or execution outcome) */
|
4931
4953
|
async function experimentalReceipt$1(client, params) {
|
4932
4954
|
return client.makeRequest('EXPERIMENTAL_receipt', params);
|
4933
4955
|
}
|
4934
|
-
|
4956
|
+
/**
|
4957
|
+
* Contains the split storage information. More info on split storage
|
4958
|
+
* [here](https://near-nodes.io/archival/split-storage-archival)
|
4959
|
+
*/
|
4935
4960
|
async function experimentalSplitStorageInfo$1(client, params) {
|
4936
4961
|
return client.makeRequest('EXPERIMENTAL_split_storage_info', params);
|
4937
4962
|
}
|
4938
|
-
|
4963
|
+
/**
|
4964
|
+
* Queries status of a transaction by hash, returning the final transaction
|
4965
|
+
* result and details of all receipts.
|
4966
|
+
*/
|
4939
4967
|
async function experimentalTxStatus$1(client, params) {
|
4940
4968
|
return client.makeRequest('EXPERIMENTAL_tx_status', params);
|
4941
4969
|
}
|
4942
|
-
|
4970
|
+
/**
|
4971
|
+
* Returns the current epoch validators ordered in the block producer order
|
4972
|
+
* with repetition. This endpoint is solely used for bridge currently and is
|
4973
|
+
* not intended for other external use cases.
|
4974
|
+
*/
|
4943
4975
|
async function experimentalValidatorsOrdered$1(client, params) {
|
4944
4976
|
return client.makeRequest('EXPERIMENTAL_validators_ordered', params);
|
4945
4977
|
}
|
4946
|
-
|
4978
|
+
/** Returns block details for given height or hash */
|
4947
4979
|
async function block$1(client, params) {
|
4948
4980
|
return client.makeRequest('block', params);
|
4949
4981
|
}
|
4950
|
-
|
4982
|
+
/**
|
4983
|
+
* Returns changes in block for given block height or hash over all
|
4984
|
+
* transactions for all the types. Includes changes like account_touched,
|
4985
|
+
* access_key_touched, data_touched, contract_code_touched.
|
4986
|
+
*/
|
4951
4987
|
async function blockEffects$1(client, params) {
|
4952
4988
|
return client.makeRequest('block_effects', params);
|
4953
4989
|
}
|
4954
|
-
|
4990
|
+
/**
|
4991
|
+
* [Deprecated] Sends a transaction and immediately returns transaction hash.
|
4992
|
+
* Consider using send_tx instead.
|
4993
|
+
*/
|
4955
4994
|
async function broadcastTxAsync$1(client, params) {
|
4956
4995
|
return client.makeRequest('broadcast_tx_async', params);
|
4957
4996
|
}
|
4958
|
-
|
4997
|
+
/**
|
4998
|
+
* [Deprecated] Sends a transaction and waits until transaction is fully
|
4999
|
+
* complete. (Has a 10 second timeout). Consider using send_tx instead.
|
5000
|
+
*/
|
4959
5001
|
async function broadcastTxCommit$1(client, params) {
|
4960
5002
|
return client.makeRequest('broadcast_tx_commit', params);
|
4961
5003
|
}
|
4962
|
-
|
5004
|
+
/**
|
5005
|
+
* Returns changes for a given account, contract or contract code for given
|
5006
|
+
* block height or hash.
|
5007
|
+
*/
|
4963
5008
|
async function changes$1(client, params) {
|
4964
5009
|
return client.makeRequest('changes', params);
|
4965
5010
|
}
|
4966
|
-
|
5011
|
+
/**
|
5012
|
+
* Returns details of a specific chunk. You can run a block details query to
|
5013
|
+
* get a valid chunk hash.
|
5014
|
+
*/
|
4967
5015
|
async function chunk$1(client, params) {
|
4968
5016
|
return client.makeRequest('chunk', params);
|
4969
5017
|
}
|
4970
|
-
|
5018
|
+
/** Queries client node configuration */
|
4971
5019
|
async function clientConfig$1(client, params) {
|
4972
5020
|
return client.makeRequest('client_config', params);
|
4973
5021
|
}
|
4974
|
-
|
5022
|
+
/**
|
5023
|
+
* Returns gas price for a specific block_height or block_hash. Using [null]
|
5024
|
+
* will return the most recent block's gas price.
|
5025
|
+
*/
|
4975
5026
|
async function gasPrice$1(client, params) {
|
4976
5027
|
return client.makeRequest('gas_price', params);
|
4977
5028
|
}
|
4978
|
-
|
5029
|
+
/** Get initial state and parameters for the genesis block */
|
4979
5030
|
async function genesisConfig$1(client, params) {
|
4980
5031
|
return client.makeRequest('genesis_config', params);
|
4981
5032
|
}
|
4982
|
-
|
5033
|
+
/** Returns the current health status of the RPC node the client connects to. */
|
4983
5034
|
async function health$1(client, params) {
|
4984
5035
|
return client.makeRequest('health', params);
|
4985
5036
|
}
|
4986
|
-
|
5037
|
+
/** Returns the proofs for a transaction execution. */
|
4987
5038
|
async function lightClientProof$1(client, params) {
|
4988
5039
|
return client.makeRequest('light_client_proof', params);
|
4989
5040
|
}
|
4990
|
-
|
5041
|
+
/**
|
5042
|
+
* Returns the future windows for maintenance in current epoch for the
|
5043
|
+
* specified account. In the maintenance windows, the node will not be block
|
5044
|
+
* producer or chunk producer.
|
5045
|
+
*/
|
4991
5046
|
async function maintenanceWindows$1(client, params) {
|
4992
5047
|
return client.makeRequest('maintenance_windows', params);
|
4993
5048
|
}
|
4994
|
-
|
5049
|
+
/**
|
5050
|
+
* Queries the current state of node network connections. This includes
|
5051
|
+
* information about active peers, transmitted data, known producers, etc.
|
5052
|
+
*/
|
4995
5053
|
async function networkInfo$1(client, params) {
|
4996
5054
|
return client.makeRequest('network_info', params);
|
4997
5055
|
}
|
4998
|
-
|
5056
|
+
/** Returns the next light client block. */
|
4999
5057
|
async function nextLightClientBlock$1(client, params) {
|
5000
5058
|
return client.makeRequest('next_light_client_block', params);
|
5001
5059
|
}
|
5002
|
-
|
5060
|
+
/**
|
5061
|
+
* This module allows you to make generic requests to the network. The
|
5062
|
+
* `RpcQueryRequest` struct takes in a
|
5063
|
+
* [`BlockReference`](https://docs.rs/near-primitives/0.12.0/near_primitives/types/enum.BlockReference.html)
|
5064
|
+
* and a
|
5065
|
+
* [`QueryRequest`](https://docs.rs/near-primitives/0.12.0/near_primitives/views/enum.QueryRequest.html).
|
5066
|
+
* The `BlockReference` enum allows you to specify a block by `Finality`,
|
5067
|
+
* `BlockId` or `SyncCheckpoint`. The `QueryRequest` enum provides multiple
|
5068
|
+
* variants for performing the following actions: - View an account's details
|
5069
|
+
* - View a contract's code - View the state of an account - View the
|
5070
|
+
* `AccessKey` of an account - View the `AccessKeyList` of an account - Call a
|
5071
|
+
* function in a contract deployed on the network.
|
5072
|
+
*/
|
5003
5073
|
async function query$1(client, params) {
|
5004
5074
|
return client.makeRequest('query', params);
|
5005
5075
|
}
|
5006
|
-
|
5076
|
+
/**
|
5077
|
+
* Sends transaction. Returns the guaranteed execution status and the results
|
5078
|
+
* the blockchain can provide at the moment.
|
5079
|
+
*/
|
5007
5080
|
async function sendTx$1(client, params) {
|
5008
5081
|
return client.makeRequest('send_tx', params);
|
5009
5082
|
}
|
5010
|
-
|
5083
|
+
/**
|
5084
|
+
* Requests the status of the connected RPC node. This includes information
|
5085
|
+
* about sync status, nearcore node version, protocol version, the current set
|
5086
|
+
* of validators, etc.
|
5087
|
+
*/
|
5011
5088
|
async function status$1(client, params) {
|
5012
5089
|
return client.makeRequest('status', params);
|
5013
5090
|
}
|
5014
|
-
|
5091
|
+
/**
|
5092
|
+
* Queries status of a transaction by hash and returns the final transaction
|
5093
|
+
* result.
|
5094
|
+
*/
|
5015
5095
|
async function tx$1(client, params) {
|
5016
5096
|
return client.makeRequest('tx', params);
|
5017
5097
|
}
|
5018
|
-
|
5098
|
+
/**
|
5099
|
+
* Queries active validators on the network. Returns details and the state of
|
5100
|
+
* validation on the blockchain.
|
5101
|
+
*/
|
5019
5102
|
async function validators$1(client, params) {
|
5020
5103
|
return client.makeRequest('validators', params);
|
5021
5104
|
}
|
@@ -5044,7 +5127,7 @@ async function viewFunctionAsJson(client, params) {
|
|
5044
5127
|
}
|
5045
5128
|
|
5046
5129
|
// Auto-generated validation wrapper functions
|
5047
|
-
// Generated at: 2025-
|
5130
|
+
// Generated at: 2025-08-03T18:51:29.361Z
|
5048
5131
|
// Total functions: 31
|
5049
5132
|
//
|
5050
5133
|
// This file is automatically generated by tools/codegen/generate-validation-wrappers.ts
|
@@ -5096,6 +5179,10 @@ async function viewAccessKey(client, params) {
|
|
5096
5179
|
return query(client, queryParams);
|
5097
5180
|
}
|
5098
5181
|
// Validation wrapper functions
|
5182
|
+
/**
|
5183
|
+
* [Deprecated] Returns changes for a given account, contract or contract code
|
5184
|
+
* for given block height or hash. Consider using changes instead.
|
5185
|
+
*/
|
5099
5186
|
async function experimentalChanges(client, params) {
|
5100
5187
|
// Validate request parameters
|
5101
5188
|
const requestSchema = RpcStateChangesInBlockByTypeRequestSchema();
|
@@ -5120,6 +5207,12 @@ async function experimentalChanges(client, params) {
|
|
5120
5207
|
}
|
5121
5208
|
return result;
|
5122
5209
|
}
|
5210
|
+
/**
|
5211
|
+
* [Deprecated] Returns changes in block for given block height or hash over
|
5212
|
+
* all transactions for all the types. Includes changes like account_touched,
|
5213
|
+
* access_key_touched, data_touched, contract_code_touched. Consider using
|
5214
|
+
* block_effects instead
|
5215
|
+
*/
|
5123
5216
|
async function experimentalChangesInBlock(client, params) {
|
5124
5217
|
// Validate request parameters
|
5125
5218
|
const requestSchema = RpcStateChangesInBlockRequestSchema();
|
@@ -5144,6 +5237,10 @@ async function experimentalChangesInBlock(client, params) {
|
|
5144
5237
|
}
|
5145
5238
|
return result;
|
5146
5239
|
}
|
5240
|
+
/**
|
5241
|
+
* Queries the congestion level of a shard. More info about congestion
|
5242
|
+
* [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)
|
5243
|
+
*/
|
5147
5244
|
async function experimentalCongestionLevel(client, params) {
|
5148
5245
|
// Validate request parameters
|
5149
5246
|
const requestSchema = RpcCongestionLevelRequestSchema();
|
@@ -5168,6 +5265,10 @@ async function experimentalCongestionLevel(client, params) {
|
|
5168
5265
|
}
|
5169
5266
|
return result;
|
5170
5267
|
}
|
5268
|
+
/**
|
5269
|
+
* [Deprecated] Get initial state and parameters for the genesis block.
|
5270
|
+
* Consider genesis_config instead.
|
5271
|
+
*/
|
5171
5272
|
async function experimentalGenesisConfig(client, params) {
|
5172
5273
|
// Validate request parameters
|
5173
5274
|
const requestSchema = GenesisConfigRequestSchema();
|
@@ -5192,6 +5293,7 @@ async function experimentalGenesisConfig(client, params) {
|
|
5192
5293
|
}
|
5193
5294
|
return result;
|
5194
5295
|
}
|
5296
|
+
/** Returns the proofs for a transaction execution. */
|
5195
5297
|
async function experimentalLightClientBlockProof(client, params) {
|
5196
5298
|
// Validate request parameters
|
5197
5299
|
const requestSchema = RpcLightClientBlockProofRequestSchema();
|
@@ -5216,6 +5318,7 @@ async function experimentalLightClientBlockProof(client, params) {
|
|
5216
5318
|
}
|
5217
5319
|
return result;
|
5218
5320
|
}
|
5321
|
+
/** Returns the proofs for a transaction execution. */
|
5219
5322
|
async function experimentalLightClientProof(client, params) {
|
5220
5323
|
// Validate request parameters
|
5221
5324
|
const requestSchema = RpcLightClientExecutionProofRequestSchema();
|
@@ -5240,6 +5343,12 @@ async function experimentalLightClientProof(client, params) {
|
|
5240
5343
|
}
|
5241
5344
|
return result;
|
5242
5345
|
}
|
5346
|
+
/**
|
5347
|
+
* [Deprecated] Returns the future windows for maintenance in current epoch
|
5348
|
+
* for the specified account. In the maintenance windows, the node will not be
|
5349
|
+
* block producer or chunk producer. Consider using maintenance_windows
|
5350
|
+
* instead.
|
5351
|
+
*/
|
5243
5352
|
async function experimentalMaintenanceWindows(client, params) {
|
5244
5353
|
// Validate request parameters
|
5245
5354
|
const requestSchema = RpcMaintenanceWindowsRequestSchema();
|
@@ -5254,6 +5363,10 @@ async function experimentalMaintenanceWindows(client, params) {
|
|
5254
5363
|
// Call the base function (no response validation needed)
|
5255
5364
|
return experimentalMaintenanceWindows$1(client, params);
|
5256
5365
|
}
|
5366
|
+
/**
|
5367
|
+
* A configuration that defines the protocol-level parameters such as
|
5368
|
+
* gas/storage costs, limits, feature flags, other settings
|
5369
|
+
*/
|
5257
5370
|
async function experimentalProtocolConfig(client, params) {
|
5258
5371
|
// Validate request parameters
|
5259
5372
|
const requestSchema = RpcProtocolConfigRequestSchema();
|
@@ -5278,6 +5391,7 @@ async function experimentalProtocolConfig(client, params) {
|
|
5278
5391
|
}
|
5279
5392
|
return result;
|
5280
5393
|
}
|
5394
|
+
/** Fetches a receipt by its ID (as is, without a status or execution outcome) */
|
5281
5395
|
async function experimentalReceipt(client, params) {
|
5282
5396
|
// Validate request parameters
|
5283
5397
|
const requestSchema = RpcReceiptRequestSchema();
|
@@ -5302,6 +5416,10 @@ async function experimentalReceipt(client, params) {
|
|
5302
5416
|
}
|
5303
5417
|
return result;
|
5304
5418
|
}
|
5419
|
+
/**
|
5420
|
+
* Contains the split storage information. More info on split storage
|
5421
|
+
* [here](https://near-nodes.io/archival/split-storage-archival)
|
5422
|
+
*/
|
5305
5423
|
async function experimentalSplitStorageInfo(client, params) {
|
5306
5424
|
// Validate request parameters
|
5307
5425
|
const requestSchema = RpcSplitStorageInfoRequestSchema();
|
@@ -5326,6 +5444,10 @@ async function experimentalSplitStorageInfo(client, params) {
|
|
5326
5444
|
}
|
5327
5445
|
return result;
|
5328
5446
|
}
|
5447
|
+
/**
|
5448
|
+
* Queries status of a transaction by hash, returning the final transaction
|
5449
|
+
* result and details of all receipts.
|
5450
|
+
*/
|
5329
5451
|
async function experimentalTxStatus(client, params) {
|
5330
5452
|
// Validate request parameters
|
5331
5453
|
const requestSchema = RpcTransactionStatusRequestSchema();
|
@@ -5350,6 +5472,11 @@ async function experimentalTxStatus(client, params) {
|
|
5350
5472
|
}
|
5351
5473
|
return result;
|
5352
5474
|
}
|
5475
|
+
/**
|
5476
|
+
* Returns the current epoch validators ordered in the block producer order
|
5477
|
+
* with repetition. This endpoint is solely used for bridge currently and is
|
5478
|
+
* not intended for other external use cases.
|
5479
|
+
*/
|
5353
5480
|
async function experimentalValidatorsOrdered(client, params) {
|
5354
5481
|
// Validate request parameters
|
5355
5482
|
const requestSchema = RpcValidatorsOrderedRequestSchema();
|
@@ -5364,6 +5491,7 @@ async function experimentalValidatorsOrdered(client, params) {
|
|
5364
5491
|
// Call the base function (no response validation needed)
|
5365
5492
|
return experimentalValidatorsOrdered$1(client, params);
|
5366
5493
|
}
|
5494
|
+
/** Returns block details for given height or hash */
|
5367
5495
|
async function block(client, params) {
|
5368
5496
|
// Validate request parameters
|
5369
5497
|
const requestSchema = RpcBlockRequestSchema();
|
@@ -5388,6 +5516,11 @@ async function block(client, params) {
|
|
5388
5516
|
}
|
5389
5517
|
return result;
|
5390
5518
|
}
|
5519
|
+
/**
|
5520
|
+
* Returns changes in block for given block height or hash over all
|
5521
|
+
* transactions for all the types. Includes changes like account_touched,
|
5522
|
+
* access_key_touched, data_touched, contract_code_touched.
|
5523
|
+
*/
|
5391
5524
|
async function blockEffects(client, params) {
|
5392
5525
|
// Validate request parameters
|
5393
5526
|
const requestSchema = RpcStateChangesInBlockRequestSchema();
|
@@ -5412,6 +5545,10 @@ async function blockEffects(client, params) {
|
|
5412
5545
|
}
|
5413
5546
|
return result;
|
5414
5547
|
}
|
5548
|
+
/**
|
5549
|
+
* [Deprecated] Sends a transaction and immediately returns transaction hash.
|
5550
|
+
* Consider using send_tx instead.
|
5551
|
+
*/
|
5415
5552
|
async function broadcastTxAsync(client, params) {
|
5416
5553
|
// Validate request parameters
|
5417
5554
|
const requestSchema = RpcSendTransactionRequestSchema();
|
@@ -5436,6 +5573,10 @@ async function broadcastTxAsync(client, params) {
|
|
5436
5573
|
}
|
5437
5574
|
return result;
|
5438
5575
|
}
|
5576
|
+
/**
|
5577
|
+
* [Deprecated] Sends a transaction and waits until transaction is fully
|
5578
|
+
* complete. (Has a 10 second timeout). Consider using send_tx instead.
|
5579
|
+
*/
|
5439
5580
|
async function broadcastTxCommit(client, params) {
|
5440
5581
|
// Validate request parameters
|
5441
5582
|
const requestSchema = RpcSendTransactionRequestSchema();
|
@@ -5460,6 +5601,10 @@ async function broadcastTxCommit(client, params) {
|
|
5460
5601
|
}
|
5461
5602
|
return result;
|
5462
5603
|
}
|
5604
|
+
/**
|
5605
|
+
* Returns changes for a given account, contract or contract code for given
|
5606
|
+
* block height or hash.
|
5607
|
+
*/
|
5463
5608
|
async function changes(client, params) {
|
5464
5609
|
// Validate request parameters
|
5465
5610
|
const requestSchema = RpcStateChangesInBlockByTypeRequestSchema();
|
@@ -5484,6 +5629,10 @@ async function changes(client, params) {
|
|
5484
5629
|
}
|
5485
5630
|
return result;
|
5486
5631
|
}
|
5632
|
+
/**
|
5633
|
+
* Returns details of a specific chunk. You can run a block details query to
|
5634
|
+
* get a valid chunk hash.
|
5635
|
+
*/
|
5487
5636
|
async function chunk(client, params) {
|
5488
5637
|
// Validate request parameters
|
5489
5638
|
const requestSchema = RpcChunkRequestSchema();
|
@@ -5508,6 +5657,7 @@ async function chunk(client, params) {
|
|
5508
5657
|
}
|
5509
5658
|
return result;
|
5510
5659
|
}
|
5660
|
+
/** Queries client node configuration */
|
5511
5661
|
async function clientConfig(client, params) {
|
5512
5662
|
// Validate request parameters
|
5513
5663
|
const requestSchema = RpcClientConfigRequestSchema();
|
@@ -5532,6 +5682,10 @@ async function clientConfig(client, params) {
|
|
5532
5682
|
}
|
5533
5683
|
return result;
|
5534
5684
|
}
|
5685
|
+
/**
|
5686
|
+
* Returns gas price for a specific block_height or block_hash. Using [null]
|
5687
|
+
* will return the most recent block's gas price.
|
5688
|
+
*/
|
5535
5689
|
async function gasPrice(client, params) {
|
5536
5690
|
// Validate request parameters
|
5537
5691
|
const requestSchema = RpcGasPriceRequestSchema();
|
@@ -5556,6 +5710,7 @@ async function gasPrice(client, params) {
|
|
5556
5710
|
}
|
5557
5711
|
return result;
|
5558
5712
|
}
|
5713
|
+
/** Get initial state and parameters for the genesis block */
|
5559
5714
|
async function genesisConfig(client, params) {
|
5560
5715
|
// Validate request parameters
|
5561
5716
|
const requestSchema = GenesisConfigRequestSchema();
|
@@ -5580,6 +5735,7 @@ async function genesisConfig(client, params) {
|
|
5580
5735
|
}
|
5581
5736
|
return result;
|
5582
5737
|
}
|
5738
|
+
/** Returns the current health status of the RPC node the client connects to. */
|
5583
5739
|
async function health(client, params) {
|
5584
5740
|
// Validate request parameters
|
5585
5741
|
const requestSchema = RpcHealthRequestSchema();
|
@@ -5604,6 +5760,7 @@ async function health(client, params) {
|
|
5604
5760
|
}
|
5605
5761
|
return result;
|
5606
5762
|
}
|
5763
|
+
/** Returns the proofs for a transaction execution. */
|
5607
5764
|
async function lightClientProof(client, params) {
|
5608
5765
|
// Validate request parameters
|
5609
5766
|
const requestSchema = RpcLightClientExecutionProofRequestSchema();
|
@@ -5628,6 +5785,11 @@ async function lightClientProof(client, params) {
|
|
5628
5785
|
}
|
5629
5786
|
return result;
|
5630
5787
|
}
|
5788
|
+
/**
|
5789
|
+
* Returns the future windows for maintenance in current epoch for the
|
5790
|
+
* specified account. In the maintenance windows, the node will not be block
|
5791
|
+
* producer or chunk producer.
|
5792
|
+
*/
|
5631
5793
|
async function maintenanceWindows(client, params) {
|
5632
5794
|
// Validate request parameters
|
5633
5795
|
const requestSchema = RpcMaintenanceWindowsRequestSchema();
|
@@ -5642,6 +5804,10 @@ async function maintenanceWindows(client, params) {
|
|
5642
5804
|
// Call the base function (no response validation needed)
|
5643
5805
|
return maintenanceWindows$1(client, params);
|
5644
5806
|
}
|
5807
|
+
/**
|
5808
|
+
* Queries the current state of node network connections. This includes
|
5809
|
+
* information about active peers, transmitted data, known producers, etc.
|
5810
|
+
*/
|
5645
5811
|
async function networkInfo(client, params) {
|
5646
5812
|
// Validate request parameters
|
5647
5813
|
const requestSchema = RpcNetworkInfoRequestSchema();
|
@@ -5666,6 +5832,7 @@ async function networkInfo(client, params) {
|
|
5666
5832
|
}
|
5667
5833
|
return result;
|
5668
5834
|
}
|
5835
|
+
/** Returns the next light client block. */
|
5669
5836
|
async function nextLightClientBlock(client, params) {
|
5670
5837
|
// Validate request parameters
|
5671
5838
|
const requestSchema = RpcLightClientNextBlockRequestSchema();
|
@@ -5690,6 +5857,19 @@ async function nextLightClientBlock(client, params) {
|
|
5690
5857
|
}
|
5691
5858
|
return result;
|
5692
5859
|
}
|
5860
|
+
/**
|
5861
|
+
* This module allows you to make generic requests to the network. The
|
5862
|
+
* `RpcQueryRequest` struct takes in a
|
5863
|
+
* [`BlockReference`](https://docs.rs/near-primitives/0.12.0/near_primitives/types/enum.BlockReference.html)
|
5864
|
+
* and a
|
5865
|
+
* [`QueryRequest`](https://docs.rs/near-primitives/0.12.0/near_primitives/views/enum.QueryRequest.html).
|
5866
|
+
* The `BlockReference` enum allows you to specify a block by `Finality`,
|
5867
|
+
* `BlockId` or `SyncCheckpoint`. The `QueryRequest` enum provides multiple
|
5868
|
+
* variants for performing the following actions: - View an account's details
|
5869
|
+
* - View a contract's code - View the state of an account - View the
|
5870
|
+
* `AccessKey` of an account - View the `AccessKeyList` of an account - Call a
|
5871
|
+
* function in a contract deployed on the network.
|
5872
|
+
*/
|
5693
5873
|
async function query(client, params) {
|
5694
5874
|
// Validate request parameters
|
5695
5875
|
const requestSchema = RpcQueryRequestSchema();
|
@@ -5714,6 +5894,10 @@ async function query(client, params) {
|
|
5714
5894
|
}
|
5715
5895
|
return result;
|
5716
5896
|
}
|
5897
|
+
/**
|
5898
|
+
* Sends transaction. Returns the guaranteed execution status and the results
|
5899
|
+
* the blockchain can provide at the moment.
|
5900
|
+
*/
|
5717
5901
|
async function sendTx(client, params) {
|
5718
5902
|
// Validate request parameters
|
5719
5903
|
const requestSchema = RpcSendTransactionRequestSchema();
|
@@ -5738,6 +5922,11 @@ async function sendTx(client, params) {
|
|
5738
5922
|
}
|
5739
5923
|
return result;
|
5740
5924
|
}
|
5925
|
+
/**
|
5926
|
+
* Requests the status of the connected RPC node. This includes information
|
5927
|
+
* about sync status, nearcore node version, protocol version, the current set
|
5928
|
+
* of validators, etc.
|
5929
|
+
*/
|
5741
5930
|
async function status(client, params) {
|
5742
5931
|
// Validate request parameters
|
5743
5932
|
const requestSchema = RpcStatusRequestSchema();
|
@@ -5762,6 +5951,10 @@ async function status(client, params) {
|
|
5762
5951
|
}
|
5763
5952
|
return result;
|
5764
5953
|
}
|
5954
|
+
/**
|
5955
|
+
* Queries status of a transaction by hash and returns the final transaction
|
5956
|
+
* result.
|
5957
|
+
*/
|
5765
5958
|
async function tx(client, params) {
|
5766
5959
|
// Validate request parameters
|
5767
5960
|
const requestSchema = RpcTransactionStatusRequestSchema();
|
@@ -5786,6 +5979,10 @@ async function tx(client, params) {
|
|
5786
5979
|
}
|
5787
5980
|
return result;
|
5788
5981
|
}
|
5982
|
+
/**
|
5983
|
+
* Queries active validators on the network. Returns details and the state of
|
5984
|
+
* validation on the blockchain.
|
5985
|
+
*/
|
5789
5986
|
async function validators(client, params) {
|
5790
5987
|
// Validate request parameters
|
5791
5988
|
const requestSchema = RpcValidatorRequestSchema();
|