Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ thiserror = "2.0"
serde_json = "1.0.85"
lazy_static = "1.4.0"

near-crypto = "0.33"
near-primitives = { version = "0.33", features = ["test_utils"] }
near-chain-configs = "0.33"
near-jsonrpc-primitives = "0.33"
near-crypto = "0.34"
near-primitives = { version = "0.34", features = ["test_utils"] }
near-chain-configs = "0.34"
near-jsonrpc-primitives = "0.34"

[dev-dependencies]
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
Expand Down
7 changes: 4 additions & 3 deletions examples/contract_change_method.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use near_jsonrpc_client::{methods, JsonRpcClient};
use near_jsonrpc_primitives::types::query::QueryResponseKind;
use near_jsonrpc_primitives::types::transactions::{RpcTransactionError, TransactionInfo};
use near_primitives::gas::Gas;
use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
use near_primitives::types::BlockReference;
use near_primitives::types::{Balance, BlockReference};
use near_primitives::views::TxExecutionStatus;

use serde_json::json;
Expand Down Expand Up @@ -53,8 +54,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
})
.to_string()
.into_bytes(),
gas: 100_000_000_000_000, // 100 TeraGas
deposit: 0,
gas: Gas::from_teragas(100),
deposit: Balance::ZERO,
}))],
};

Expand Down
7 changes: 4 additions & 3 deletions examples/contract_change_method_commit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use near_jsonrpc_client::{methods, JsonRpcClient};
use near_jsonrpc_primitives::types::query::QueryResponseKind;
use near_primitives::gas::Gas;
use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
use near_primitives::types::BlockReference;
use near_primitives::types::{Balance, BlockReference};

use serde_json::json;

Expand Down Expand Up @@ -50,8 +51,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
})
.to_string()
.into_bytes(),
gas: 100_000_000_000_000, // 100 TeraGas
deposit: 0,
gas: Gas::from_teragas(100),
deposit: Balance::ZERO,
}))],
};

Expand Down
9 changes: 5 additions & 4 deletions examples/create_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ use near_jsonrpc_client::methods::broadcast_tx_commit::RpcTransactionError;
use near_jsonrpc_client::{methods, JsonRpcClient};
use near_jsonrpc_primitives::types::query::QueryResponseKind;
use near_jsonrpc_primitives::types::transactions::TransactionInfo;
use near_primitives::gas::Gas;
use near_primitives::hash::CryptoHash;
use near_primitives::transaction::{
Action, AddKeyAction, CreateAccountAction, FunctionCallAction, Transaction, TransactionV0,
TransferAction,
};
use near_primitives::types::{AccountId, BlockReference};
use near_primitives::types::{AccountId, Balance, BlockReference};
use near_primitives::views::{FinalExecutionStatus, TxExecutionStatus};

use serde_json::json;
Expand Down Expand Up @@ -151,7 +152,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
public_key: new_key_pair.public_key(),
})),
Action::Transfer(TransferAction {
deposit: initial_deposit,
deposit: Balance::from_yoctonear(initial_deposit),
}),
],
},
Expand Down Expand Up @@ -180,8 +181,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
})
.to_string()
.into_bytes(),
gas: 300_000_000_000_000,
deposit: initial_deposit,
gas: Gas::from_teragas(300),
deposit: Balance::from_yoctonear(initial_deposit),
}))],
},
b"true".to_vec(),
Expand Down
7 changes: 4 additions & 3 deletions examples/send_tx.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use near_jsonrpc_client::{methods, JsonRpcClient};
use near_jsonrpc_primitives::types::query::QueryResponseKind;
use near_jsonrpc_primitives::types::transactions::{RpcTransactionError, TransactionInfo};
use near_primitives::gas::Gas;
use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
use near_primitives::types::BlockReference;
use near_primitives::types::{Balance, BlockReference};
use near_primitives::views::TxExecutionStatus;
use tokio::time;

Expand Down Expand Up @@ -53,8 +54,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
})
.to_string()
.into_bytes(),
gas: 100_000_000_000_000, // 100 TeraGas
deposit: 0,
gas: Gas::from_teragas(100),
deposit: Balance::ZERO,
}))],
});
let tx_hash = transaction.get_hash_and_size().0;
Expand Down
7 changes: 4 additions & 3 deletions src/methods/broadcast_tx_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
//!
//! ```no_run
//! use near_jsonrpc_client::{methods, JsonRpcClient};
//! use near_primitives::types::{AccountId};
//! use near_primitives::gas::Gas;
//! use near_primitives::types::{AccountId, Balance};
//! use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
//! use near_crypto::SecretKey;
//! use core::str::FromStr;
Expand Down Expand Up @@ -42,8 +43,8 @@
//! })
//! .to_string()
//! .into_bytes(),
//! gas: 100_000_000_000_000, // 100 TeraGas
//! deposit: 0,
//! gas: Gas::from_teragas(100),
//! deposit: Balance::ZERO,
//! }))],
//! });
//!
Expand Down
7 changes: 4 additions & 3 deletions src/methods/broadcast_tx_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
//! ```no_run
//! use near_jsonrpc_client::{methods, JsonRpcClient};
//! use near_jsonrpc_primitives::types::{query::QueryResponseKind, transactions::TransactionInfo};
//! use near_primitives::types::{AccountId, BlockReference};
//! use near_primitives::gas::Gas;
//! use near_primitives::types::{AccountId, Balance, BlockReference};
//! use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
//! use serde_json::json;
//!
Expand Down Expand Up @@ -43,8 +44,8 @@
//! })
//! .to_string()
//! .into_bytes(),
//! gas: 100_000_000_000_000, // 100 TeraGas
//! deposit: 0,
//! gas: Gas::from_teragas(100),
//! deposit: Balance::ZERO,
//! }))],
//! });
//!
Expand Down
7 changes: 4 additions & 3 deletions src/methods/send_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
//!
//! ```no_run
//! use near_jsonrpc_client::{methods, JsonRpcClient};
//! use near_primitives::gas::Gas;
//! use near_jsonrpc_primitives::types::{query::QueryResponseKind, transactions::TransactionInfo};
//! use near_primitives::types::{AccountId, BlockReference};
//! use near_primitives::types::{AccountId, Balance, BlockReference};
//! use near_primitives::transaction::{Action, FunctionCallAction, Transaction, TransactionV0};
//! use serde_json::json;
//!
Expand Down Expand Up @@ -44,8 +45,8 @@
//! })
//! .to_string()
//! .into_bytes(),
//! gas: 100_000_000_000_000, // 100 TeraGas
//! deposit: 0,
//! gas: Gas::from_teragas(100),
//! deposit: Balance::ZERO,
//! }))],
//! });
//!
Expand Down