Skip to content

Commit 65eefe2

Browse files
fix: update dependencies
1 parent 8bce42d commit 65eefe2

File tree

7 files changed

+196
-15
lines changed

7 files changed

+196
-15
lines changed

example/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ serde = "1.0.218"
1111
serde_json = "1.0.139"
1212
tokio = { version = "1", features = ["full"] }
1313
near-sandbox-utils = "0.15"
14-
near-primitives = { version = "0.30.1", features = ["test_utils"] }
14+
near-primitives = { version = "0.34.0", features = ["test_utils"] }
1515
base64 = "0.21"
1616
borsh = "1.5.7"
17-
near-crypto = "0.30.1"
17+
near-crypto = "0.34.0"
1818

1919
[workspace]

example/tests/tests.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -912,12 +912,11 @@ async fn prepare_blockchain(
912912
args: serde_json::to_vec(&serde_json::json!({
913913
"greeting": "hola"
914914
}))?,
915-
gas: 300_000_000_000_000,
916-
deposit: 0,
915+
gas: near_primitives::types::Gas::from_teragas(300),
916+
deposit: near_primitives::types::Balance::ZERO,
917917
},
918918
));
919919

920-
let transfer_amount = 1_000_000_000_000_000_000_000_000; // 1 NEAR in yocto
921920
let tx = Transaction::V0(TransactionV0 {
922921
signer_id: sender_account_id.clone(),
923922
public_key: signer.public_key(),
@@ -926,13 +925,13 @@ async fn prepare_blockchain(
926925
receiver_id: sender_account_id.clone(),
927926
actions: vec![
928927
Action::Transfer(TransferAction {
929-
deposit: transfer_amount,
928+
deposit: near_primitives::types::Balance::from_near(1),
930929
}),
931930
deploy_contract_action,
932931
function_call_action,
933932
],
934933
});
935-
let signed_tx = tx.sign(&signer);
934+
let signed_tx = tx.sign(signer);
936935
let base64_signed_tx = near_primitives::serialize::to_base64(&borsh::to_vec(&signed_tx)?);
937936

938937
let payload_send_tx = client::types::JsonRpcRequestForSendTx {

near-openapi-client/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE
403403
#[allow(unused_imports)]
404404
pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
405405
#[derive(Clone, Debug)]
406-
#[doc = "Client for NEAR Protocol JSON RPC API\n\nVersion: 1.2.1"]
406+
#[doc = "Client for NEAR Protocol JSON RPC API\n\nVersion: 1.2.2"]
407407
pub struct Client {
408408
pub(crate) baseurl: String,
409409
pub(crate) client: reqwest::Client,
@@ -441,7 +441,7 @@ impl Client {
441441
}
442442
impl ClientInfo<()> for Client {
443443
fn api_version() -> &'static str {
444-
"1.2.1"
444+
"1.2.2"
445445
}
446446
fn baseurl(&self) -> &str {
447447
self.baseurl.as_str()

near-openapi-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Types for progenitor-generated client of NEAR JSON RPC API"
88

99

1010
[dependencies]
11-
chrono = { version = "0.4", default-features = false, features = ["serde"] }
11+
chrono = { version = "0.4", default-features=false, features = ["serde"] }
1212
serde = { version = "1.0", features = ["derive"] }
1313
serde_json = "1.0"
1414

near-openapi-types/src/lib.rs

Lines changed: 108 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19759,6 +19759,16 @@ impl ::std::convert::From<&RangeOfUint64> for RangeOfUint64 {
1975919759
#[doc = " \"$ref\": \"#/components/schemas/DataReceiverView\""]
1976019760
#[doc = " }"]
1976119761
#[doc = " },"]
19762+
#[doc = " \"refund_to\": {"]
19763+
#[doc = " \"anyOf\": ["]
19764+
#[doc = " {"]
19765+
#[doc = " \"$ref\": \"#/components/schemas/AccountId\""]
19766+
#[doc = " },"]
19767+
#[doc = " {"]
19768+
#[doc = " \"type\": \"null\""]
19769+
#[doc = " }"]
19770+
#[doc = " ]"]
19771+
#[doc = " },"]
1976219772
#[doc = " \"signer_id\": {"]
1976319773
#[doc = " \"$ref\": \"#/components/schemas/AccountId\""]
1976419774
#[doc = " },"]
@@ -19848,6 +19858,8 @@ pub enum ReceiptEnumView {
1984819858
#[serde(default)]
1984919859
is_promise_yield: bool,
1985019860
output_data_receivers: ::std::vec::Vec<DataReceiverView>,
19861+
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
19862+
refund_to: ::std::option::Option<AccountId>,
1985119863
signer_id: AccountId,
1985219864
signer_public_key: PublicKey,
1985319865
},
@@ -20825,6 +20837,12 @@ impl ::std::convert::From<()> for RpcClientConfigRequest {
2082520837
#[doc = " \"maxItems\": 2,"]
2082620838
#[doc = " \"minItems\": 2"]
2082720839
#[doc = " },"]
20840+
#[doc = " \"chunks_cache_height_horizon\": {"]
20841+
#[doc = " \"description\": \"Height horizon for the chunk cache. A chunk is removed from the cache\\nif its height + chunks_cache_height_horizon < largest_seen_height.\\nThe default value is DEFAULT_CHUNKS_CACHE_HEIGHT_HORIZON.\","]
20842+
#[doc = " \"type\": \"integer\","]
20843+
#[doc = " \"format\": \"uint64\","]
20844+
#[doc = " \"minimum\": 0.0"]
20845+
#[doc = " },"]
2082820846
#[doc = " \"client_background_migration_threads\": {"]
2082920847
#[doc = " \"description\": \"Number of threads to execute background migration work in client.\","]
2083020848
#[doc = " \"type\": \"integer\","]
@@ -21288,6 +21306,9 @@ pub struct RpcClientConfigResponse {
2128821306
#[doc = "Multiplier for the wait time for all chunks to be received."]
2128921307
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2129021308
pub chunk_wait_mult: ::std::option::Option<[i32; 2usize]>,
21309+
#[doc = "Height horizon for the chunk cache. A chunk is removed from the cache\nif its height + chunks_cache_height_horizon < largest_seen_height.\nThe default value is DEFAULT_CHUNKS_CACHE_HEIGHT_HORIZON."]
21310+
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
21311+
pub chunks_cache_height_horizon: ::std::option::Option<u64>,
2129121312
#[doc = "Number of threads to execute background migration work in client."]
2129221313
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2129321314
pub client_background_migration_threads: ::std::option::Option<u32>,
@@ -21480,6 +21501,7 @@ impl ::std::default::Default for RpcClientConfigResponse {
2148021501
chunk_request_retry_period: Default::default(),
2148121502
chunk_validation_threads: Default::default(),
2148221503
chunk_wait_mult: Default::default(),
21504+
chunks_cache_height_horizon: Default::default(),
2148321505
client_background_migration_threads: Default::default(),
2148421506
cloud_archival_writer: Default::default(),
2148521507
disable_tx_routing: Default::default(),
@@ -28026,7 +28048,7 @@ impl ::std::default::Default for RpcValidatorsOrderedRequest {
2802628048
#[doc = " ]"]
2802728049
#[doc = " },"]
2802828050
#[doc = " \"storage_amount_per_byte\": {"]
28029-
#[doc = " \"description\": \"Amount of yN per byte required to have on the account. See\\n<https://nomicon.io/Economics/Economic#state-stake> for details.\","]
28051+
#[doc = " \"description\": \"Amount of yN per byte required to have on the account. See\\n<https://nomicon.io/Economics/Economics.html#state-stake> for details.\","]
2803028052
#[doc = " \"allOf\": ["]
2803128053
#[doc = " {"]
2803228054
#[doc = " \"$ref\": \"#/components/schemas/NearToken\""]
@@ -28069,7 +28091,7 @@ pub struct RuntimeConfigView {
2806928091
#[doc = "The configuration for congestion control."]
2807028092
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2807128093
pub congestion_control_config: ::std::option::Option<CongestionControlConfigView>,
28072-
#[doc = "Amount of yN per byte required to have on the account. See\n<https://nomicon.io/Economics/Economic#state-stake> for details."]
28094+
#[doc = "Amount of yN per byte required to have on the account. See\n<https://nomicon.io/Economics/Economics.html#state-stake> for details."]
2807328095
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2807428096
pub storage_amount_per_byte: ::std::option::Option<NearToken>,
2807528097
#[doc = "Costs of different actions that need to be performed when sending and\nprocessing transaction and receipts."]
@@ -28311,6 +28333,18 @@ impl ::std::fmt::Display for ShardId {
2831128333
#[doc = " }"]
2831228334
#[doc = " },"]
2831328335
#[doc = " \"additionalProperties\": false"]
28336+
#[doc = " },"]
28337+
#[doc = " {"]
28338+
#[doc = " \"type\": \"object\","]
28339+
#[doc = " \"required\": ["]
28340+
#[doc = " \"V3\""]
28341+
#[doc = " ],"]
28342+
#[doc = " \"properties\": {"]
28343+
#[doc = " \"V3\": {"]
28344+
#[doc = " \"$ref\": \"#/components/schemas/ShardLayoutV3\""]
28345+
#[doc = " }"]
28346+
#[doc = " },"]
28347+
#[doc = " \"additionalProperties\": false"]
2831428348
#[doc = " }"]
2831528349
#[doc = " ]"]
2831628350
#[doc = "}"]
@@ -28321,6 +28355,7 @@ pub enum ShardLayout {
2832128355
V0(ShardLayoutV0),
2832228356
V1(ShardLayoutV1),
2832328357
V2(ShardLayoutV2),
28358+
V3(ShardLayoutV3),
2832428359
}
2832528360
impl ::std::convert::From<&Self> for ShardLayout {
2832628361
fn from(value: &ShardLayout) -> Self {
@@ -28342,6 +28377,11 @@ impl ::std::convert::From<ShardLayoutV2> for ShardLayout {
2834228377
Self::V2(value)
2834328378
}
2834428379
}
28380+
impl ::std::convert::From<ShardLayoutV3> for ShardLayout {
28381+
fn from(value: ShardLayoutV3) -> Self {
28382+
Self::V3(value)
28383+
}
28384+
}
2834528385
#[doc = "A shard layout that maps accounts evenly across all shards -- by calculate the hash of account\nid and mod number of shards. This is added to capture the old `account_id_to_shard_id` algorithm,\nto keep backward compatibility for some existing tests.\n`parent_shards` for `ShardLayoutV1` is always `None`, meaning it can only be the first shard layout\na chain uses."]
2834628386
#[doc = r""]
2834728387
#[doc = r" <details><summary>JSON schema</summary>"]
@@ -28545,6 +28585,72 @@ impl ::std::convert::From<&ShardLayoutV2> for ShardLayoutV2 {
2854528585
value.clone()
2854628586
}
2854728587
}
28588+
#[doc = "Counterpart to `ShardLayoutV3` composed of maps with string keys to aid\nserde serialization."]
28589+
#[doc = r""]
28590+
#[doc = r" <details><summary>JSON schema</summary>"]
28591+
#[doc = r""]
28592+
#[doc = r" ```json"]
28593+
#[doc = "{"]
28594+
#[doc = " \"description\": \"Counterpart to `ShardLayoutV3` composed of maps with string keys to aid\\nserde serialization.\","]
28595+
#[doc = " \"type\": \"object\","]
28596+
#[doc = " \"required\": ["]
28597+
#[doc = " \"boundary_accounts\","]
28598+
#[doc = " \"id_to_index_map\","]
28599+
#[doc = " \"last_split\","]
28600+
#[doc = " \"shard_ids\","]
28601+
#[doc = " \"shards_split_map\""]
28602+
#[doc = " ],"]
28603+
#[doc = " \"properties\": {"]
28604+
#[doc = " \"boundary_accounts\": {"]
28605+
#[doc = " \"type\": \"array\","]
28606+
#[doc = " \"items\": {"]
28607+
#[doc = " \"$ref\": \"#/components/schemas/AccountId\""]
28608+
#[doc = " }"]
28609+
#[doc = " },"]
28610+
#[doc = " \"id_to_index_map\": {"]
28611+
#[doc = " \"type\": \"object\","]
28612+
#[doc = " \"additionalProperties\": {"]
28613+
#[doc = " \"type\": \"integer\","]
28614+
#[doc = " \"format\": \"uint\","]
28615+
#[doc = " \"minimum\": 0.0"]
28616+
#[doc = " }"]
28617+
#[doc = " },"]
28618+
#[doc = " \"last_split\": {"]
28619+
#[doc = " \"$ref\": \"#/components/schemas/ShardId\""]
28620+
#[doc = " },"]
28621+
#[doc = " \"shard_ids\": {"]
28622+
#[doc = " \"type\": \"array\","]
28623+
#[doc = " \"items\": {"]
28624+
#[doc = " \"$ref\": \"#/components/schemas/ShardId\""]
28625+
#[doc = " }"]
28626+
#[doc = " },"]
28627+
#[doc = " \"shards_split_map\": {"]
28628+
#[doc = " \"type\": \"object\","]
28629+
#[doc = " \"additionalProperties\": {"]
28630+
#[doc = " \"type\": \"array\","]
28631+
#[doc = " \"items\": {"]
28632+
#[doc = " \"$ref\": \"#/components/schemas/ShardId\""]
28633+
#[doc = " }"]
28634+
#[doc = " }"]
28635+
#[doc = " }"]
28636+
#[doc = " }"]
28637+
#[doc = "}"]
28638+
#[doc = r" ```"]
28639+
#[doc = r" </details>"]
28640+
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
28641+
pub struct ShardLayoutV3 {
28642+
pub boundary_accounts: ::std::vec::Vec<AccountId>,
28643+
pub id_to_index_map: ::std::collections::HashMap<::std::string::String, u32>,
28644+
pub last_split: ShardId,
28645+
pub shard_ids: ::std::vec::Vec<ShardId>,
28646+
pub shards_split_map:
28647+
::std::collections::HashMap<::std::string::String, ::std::vec::Vec<ShardId>>,
28648+
}
28649+
impl ::std::convert::From<&ShardLayoutV3> for ShardLayoutV3 {
28650+
fn from(value: &ShardLayoutV3) -> Self {
28651+
value.clone()
28652+
}
28653+
}
2854828654
#[doc = "`ShardUId` is a unique representation for shards from different shard layouts.\n\nComparing to `ShardId`, which is just an ordinal number ranging from 0 to NUM_SHARDS-1,\n`ShardUId` provides a way to unique identify shards when shard layouts may change across epochs.\nThis is important because we store states indexed by shards in our database, so we need a\nway to unique identify shard even when shards change across epochs.\nAnother difference between `ShardUId` and `ShardId` is that `ShardUId` should only exist in\na node's internal state while `ShardId` can be exposed to outside APIs and used in protocol\nlevel information (for example, `ShardChunkHeader` contains `ShardId` instead of `ShardUId`)"]
2854928655
#[doc = r""]
2855028656
#[doc = r" <details><summary>JSON schema</summary>"]

openapi.json

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.0",
33
"info": {
44
"title": "NEAR Protocol JSON RPC API",
5-
"version": "1.2.1"
5+
"version": "1.2.2"
66
},
77
"paths": {
88
"/EXPERIMENTAL_changes": {
@@ -10575,6 +10575,19 @@
1057510575
},
1057610576
"type": "array"
1057710577
},
10578+
"refund_to": {
10579+
"anyOf": [
10580+
{
10581+
"$ref": "#/components/schemas/AccountId"
10582+
},
10583+
{
10584+
"enum": [
10585+
null
10586+
],
10587+
"nullable": true
10588+
}
10589+
]
10590+
},
1057810591
"signer_id": {
1057910592
"$ref": "#/components/schemas/AccountId"
1058010593
},
@@ -11317,6 +11330,12 @@
1131711330
"minItems": 2,
1131811331
"type": "array"
1131911332
},
11333+
"chunks_cache_height_horizon": {
11334+
"description": "Height horizon for the chunk cache. A chunk is removed from the cache\nif its height + chunks_cache_height_horizon < largest_seen_height.\nThe default value is DEFAULT_CHUNKS_CACHE_HEIGHT_HORIZON.",
11335+
"format": "uint64",
11336+
"minimum": 0,
11337+
"type": "integer"
11338+
},
1132011339
"client_background_migration_threads": {
1132111340
"description": "Number of threads to execute background migration work in client.",
1132211341
"format": "uint",
@@ -16170,7 +16189,7 @@
1617016189
"$ref": "#/components/schemas/NearToken"
1617116190
}
1617216191
],
16173-
"description": "Amount of yN per byte required to have on the account. See\n<https://nomicon.io/Economics/Economic#state-stake> for details."
16192+
"description": "Amount of yN per byte required to have on the account. See\n<https://nomicon.io/Economics/Economics.html#state-stake> for details."
1617416193
},
1617516194
"transaction_costs": {
1617616195
"allOf": [
@@ -16301,6 +16320,18 @@
1630116320
"V2"
1630216321
],
1630316322
"type": "object"
16323+
},
16324+
{
16325+
"additionalProperties": false,
16326+
"properties": {
16327+
"V3": {
16328+
"$ref": "#/components/schemas/ShardLayoutV3"
16329+
}
16330+
},
16331+
"required": [
16332+
"V3"
16333+
],
16334+
"type": "object"
1630416335
}
1630516336
]
1630616337
},
@@ -16428,6 +16459,51 @@
1642816459
],
1642916460
"type": "object"
1643016461
},
16462+
"ShardLayoutV3": {
16463+
"description": "Counterpart to `ShardLayoutV3` composed of maps with string keys to aid\nserde serialization.",
16464+
"properties": {
16465+
"boundary_accounts": {
16466+
"items": {
16467+
"$ref": "#/components/schemas/AccountId"
16468+
},
16469+
"type": "array"
16470+
},
16471+
"id_to_index_map": {
16472+
"additionalProperties": {
16473+
"format": "uint",
16474+
"minimum": 0,
16475+
"type": "integer"
16476+
},
16477+
"type": "object"
16478+
},
16479+
"last_split": {
16480+
"$ref": "#/components/schemas/ShardId"
16481+
},
16482+
"shard_ids": {
16483+
"items": {
16484+
"$ref": "#/components/schemas/ShardId"
16485+
},
16486+
"type": "array"
16487+
},
16488+
"shards_split_map": {
16489+
"additionalProperties": {
16490+
"items": {
16491+
"$ref": "#/components/schemas/ShardId"
16492+
},
16493+
"type": "array"
16494+
},
16495+
"type": "object"
16496+
}
16497+
},
16498+
"required": [
16499+
"boundary_accounts",
16500+
"shard_ids",
16501+
"id_to_index_map",
16502+
"shards_split_map",
16503+
"last_split"
16504+
],
16505+
"type": "object"
16506+
},
1643116507
"ShardUId": {
1643216508
"description": "`ShardUId` is a unique representation for shards from different shard layouts.\n\nComparing to `ShardId`, which is just an ordinal number ranging from 0 to NUM_SHARDS-1,\n`ShardUId` provides a way to unique identify shards when shard layouts may change across epochs.\nThis is important because we store states indexed by shards in our database, so we need a\nway to unique identify shard even when shards change across epochs.\nAnother difference between `ShardUId` and `ShardId` is that `ShardUId` should only exist in\na node's internal state while `ShardId` can be exposed to outside APIs and used in protocol\nlevel information (for example, `ShardChunkHeader` contains `ShardId` instead of `ShardUId`)",
1643316509
"properties": {

progenitor_fixes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def add_error_derives(m):
169169
types_cargo_toml = re.sub(r'progenitor-client = "[^"]+"\n', '', types_cargo_toml)
170170
types_cargo_toml = re.sub(r'reqwest = \{[^}]+\}\n', '', types_cargo_toml)
171171
types_cargo_toml = re.sub(r'serde_urlencoded = "[^"]+"\n', '', types_cargo_toml)
172-
types_cargo_toml += 'near-account-id = { version = "1.1.1", features = ["serde"] }\nnear-gas = { version = "0.3.2", features = ["serde"] }\nnear-token = { version = "0.3.1", features = ["serde"] }\nthiserror = "2.0.17"\nstrum_macros = "0.27.2"\n'
172+
types_cargo_toml += 'near-account-id = { version = "2.0", features = ["serde"] }\nnear-gas = { version = "0.3.2", features = ["serde"] }\nnear-token = { version = "0.3.1", features = ["serde"] }\nthiserror = "2.0.17"\nstrum_macros = "0.27.2"\n'
173173

174174
client_cargo_toml_file = open('./near-openapi-client/Cargo.toml', 'w')
175175
client_cargo_toml_file.write(client_cargo_toml)

0 commit comments

Comments
 (0)