repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/get_public_key/from_ledger/mod.rs | src/commands/account/get_public_key/from_ledger/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = PublicKeyFromLedgerContext)]
pub struct PublicKeyFromLedger {
#[interactive_clap(long)]
#[interactive_clap(skip_default_input_arg)]
seed_phrase_hd_path: cr... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/get_public_key/from_plaintext_private_key/mod.rs | src/commands/account/get_public_key/from_plaintext_private_key/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = PublicKeyFromPlaintextPrivateKeyContext)]
pub struct PublicKeyFromPlaintextPrivateKey {
/// Enter your private (secret) key:
private_key: crate::types::secret_... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/get_public_key/from_legacy_keychain/mod.rs | src/commands/account/get_public_key/from_legacy_keychain/mod.rs | use color_eyre::eyre::WrapErr;
use crate::common::JsonRpcClientExt;
use crate::common::RpcQueryResponseExt;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = PublicKeyFromLegacyKeychainContext)]
pub struct PublicKey... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/view_account_summary/mod.rs | src/commands/account/view_account_summary/mod.rs | use color_eyre::eyre::Context;
use futures::{StreamExt, TryStreamExt};
use tracing_indicatif::span_ext::IndicatifSpanExt;
use crate::common::{CallResultExt, JsonRpcClientExt, RpcQueryResponseExt};
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[in... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/storage_management/storage_deposit.rs | src/commands/account/storage_management/storage_deposit.rs | use inquire::Select;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::ContractContext)]
#[interactive_clap(output_context = DepositArgsContext)]
pub struct DepositArgs {
#[interactive_clap(skip_default_input_arg)]
/// Which account ID do you want to add a dep... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/storage_management/storage_withdraw.rs | src/commands/account/storage_management/storage_withdraw.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::ContractContext)]
#[interactive_clap(output_context = WithdrawArgsContext)]
pub struct WithdrawArgs {
/// Enter the amount to withdraw from the storage (example: 10 NEAR or 0.5 NEAR or 10000 yoctonear):
amount: ... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/storage_management/mod.rs | src/commands/account/storage_management/mod.rs | use strum::{EnumDiscriminants, EnumIter, EnumMessage};
mod storage_deposit;
mod storage_withdraw;
mod view_storage_balance;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = ContractContext)]
pub struct Contract {
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/account/storage_management/view_storage_balance.rs | src/commands/account/storage_management/view_storage_balance.rs | use color_eyre::eyre::WrapErr;
use tracing_indicatif::span_ext::IndicatifSpanExt;
use crate::common::{CallResultExt, JsonRpcClientExt};
const STORAGE_COST_PER_BYTE: u128 = 10u128.pow(19);
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::ContractContext)]
#[interact... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/mod.rs | src/commands/tokens/mod.rs | use strum::{EnumDiscriminants, EnumIter, EnumMessage};
mod send_ft;
mod send_near;
mod send_nft;
mod view_ft_balance;
mod view_near_balance;
mod view_nft_assets;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = Tok... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/view_nft_assets/mod.rs | src/commands/tokens/view_nft_assets/mod.rs | use color_eyre::eyre::Context;
use serde_json::json;
use crate::common::CallResultExt;
use crate::common::JsonRpcClientExt;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::TokensCommandsContext)]
#[interactive_clap(output_context = ViewNftAssetsContext)]
pub struct... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/send_near/mod.rs | src/commands/tokens/send_near/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::TokensCommandsContext)]
#[interactive_clap(output_context = SendNearCommandContext)]
pub struct SendNearCommand {
#[interactive_clap(skip_default_input_arg)]
/// What is the receiver account ID?
receiver_acc... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/view_ft_balance/mod.rs | src/commands/tokens/view_ft_balance/mod.rs | use color_eyre::eyre::Context;
use serde_json::json;
use crate::common::CallResultExt;
use crate::common::JsonRpcClientExt;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::TokensCommandsContext)]
#[interactive_clap(output_context = ViewFtBalanceContext)]
pub struct... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/send_nft/mod.rs | src/commands/tokens/send_nft/mod.rs | use serde_json::json;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::TokensCommandsContext)]
#[interactive_clap(output_context = SendNftCommandContext)]
pub struct SendNftCommand {
#[interactive_clap(skip_default_input_arg)]
/// What is the nft-contract acc... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/view_near_balance/mod.rs | src/commands/tokens/view_near_balance/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::TokensCommandsContext)]
#[interactive_clap(output_context = ViewNearBalanceContext)]
pub struct ViewNearBalance {
#[interactive_clap(named_arg)]
/// Select network
network_config: crate::network_view_at_bloc... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/send_ft/mod.rs | src/commands/tokens/send_ft/mod.rs | use color_eyre::eyre::Context;
use serde_json::{json, Value};
use crate::common::CallResultExt;
use crate::common::JsonRpcClientExt;
use super::view_ft_balance::get_ft_balance;
mod amount_ft;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::TokensCommandsContext)]... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/tokens/send_ft/amount_ft.rs | src/commands/tokens/send_ft/amount_ft.rs | use color_eyre::eyre::ContextCompat;
use inquire::CustomType;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::SendFtCommandContext)]
#[interactive_clap(output_context = AmountFtContext)]
pub struct AmountFt {
#[interactive_clap(skip_default_input_arg)]
/// E... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/mod.rs | src/commands/message/mod.rs | use strum::{EnumDiscriminants, EnumIter, EnumMessage};
pub mod sign_nep413;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(context = crate::GlobalContext)]
pub struct MessageCommand {
#[interactive_clap(subcommand)]
pub message_actions: MessageActions,
}
#[derive(Debug, EnumDis... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/mod.rs | src/commands/message/sign_nep413/mod.rs | use near_crypto::{SecretKey, Signature};
use near_primitives::borsh::{self, BorshDeserialize, BorshSerialize};
use near_primitives::hash::hash;
use serde::Serialize;
pub mod message_type;
pub mod nonce;
pub mod recipient;
pub mod signature_options;
pub mod signer;
#[derive(Debug, Clone, BorshDeserialize, BorshSeriali... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/nonce/mod.rs | src/commands/message/sign_nep413/nonce/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(_context = NonceContext)]
#[interactive_clap(output_context = NonceWrapperContext)]
pub struct Nonce {
/// A 32-byte nonce as a base64-encoded string:
nonce: crate::types::nonce32_bytes::Nonce32,
#[interactive_clap(named_arg)]
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signature_options/sign_with_legacy_keychain.rs | src/commands/message/sign_nep413/signature_options/sign_with_legacy_keychain.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::FinalSignNep413Context)]
#[interactive_clap(output_context = SignLegacyKeychainContext)]
pub struct SignLegacyKeychain {
#[interactive_clap(named_arg)]
/// Select network
network_config: crate::networ... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signature_options/sign_with_keychain.rs | src/commands/message/sign_nep413/signature_options/sign_with_keychain.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::FinalSignNep413Context)]
#[interactive_clap(output_context = SignKeychainContext)]
pub struct SignKeychain {
#[interactive_clap(named_arg)]
/// Select network
network_config: crate::network::Network,
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signature_options/sign_with_seed_phrase.rs | src/commands/message/sign_nep413/signature_options/sign_with_seed_phrase.rs | use std::str::FromStr;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::FinalSignNep413Context)]
#[interactive_clap(output_context = SignSeedPhraseContext)]
pub struct SignSeedPhrase {
/// Enter the seed-phrase for this account:
master_seed_phrase: Stri... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signature_options/sign_with_access_key_file.rs | src/commands/message/sign_nep413/signature_options/sign_with_access_key_file.rs | use color_eyre::eyre::WrapErr;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::FinalSignNep413Context)]
#[interactive_clap(output_context = SignAccessKeyFileContext)]
pub struct SignAccessKeyFile {
/// What is the location of the account access key file?
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signature_options/sign_with_ledger.rs | src/commands/message/sign_nep413/signature_options/sign_with_ledger.rs | use color_eyre::eyre::WrapErr;
use near_crypto::Signature;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::FinalSignNep413Context)]
#[interactive_clap(output_context = SignLedgerContext)]
pub struct SignLedger {
#[interactive_clap(long)]
#[interactive... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signature_options/mod.rs | src/commands/message/sign_nep413/signature_options/mod.rs | use strum::{EnumDiscriminants, EnumIter, EnumMessage};
pub mod sign_with_access_key_file;
pub mod sign_with_keychain;
#[cfg(feature = "ledger")]
pub mod sign_with_ledger;
pub mod sign_with_legacy_keychain;
pub mod sign_with_private_key;
pub mod sign_with_seed_phrase;
#[derive(Debug, EnumDiscriminants, Clone, interact... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signature_options/sign_with_private_key.rs | src/commands/message/sign_nep413/signature_options/sign_with_private_key.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::FinalSignNep413Context)]
#[interactive_clap(output_context = SignPrivateKeyContext)]
pub struct SignPrivateKey {
/// Enter your private (secret) key:
pub private_key: crate::types::secret_key::SecretKey,
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/recipient/mod.rs | src/commands/message/sign_nep413/recipient/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = RecipientContext)]
#[interactive_clap(output_context = RecipientWrapperContext)]
pub struct Recipient {
/// The recipient of the message (e.g. "alice.near" or "myapp.com"):
recipient: String,
#[interactive_clap(nam... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/message_type/base64.rs | src/commands/message/sign_nep413/message_type/base64.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::MessageTypeContext)]
#[interactive_clap(output_context = Base64Context)]
pub struct Base64 {
/// The base64-encoded message to sign:
message: crate::types::base64_bytes::Base64Bytes,
#[interactive_clap(named... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/message_type/mod.rs | src/commands/message/sign_nep413/message_type/mod.rs | use strum::{EnumDiscriminants, EnumIter, EnumMessage};
mod base64;
mod utf8;
#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(context = super::SignNep413Context)]
#[strum_discriminants(derive(EnumMessage, EnumIter))]
/// Select the message encoding type:
pub enum Messag... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/message_type/utf8.rs | src/commands/message/sign_nep413/message_type/utf8.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::MessageTypeContext)]
#[interactive_clap(output_context = Utf8Context)]
pub struct Utf8 {
/// The text message (UTF-8 encoded) to sign:
message: String,
#[interactive_clap(named_arg)]
nonce: super::super:... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/message/sign_nep413/signer/mod.rs | src/commands/message/sign_nep413/signer/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = SignAsContext)]
#[interactive_clap(output_context = SignAsWrapperContext)]
pub struct SignAs {
/// Which account to sign the message with:
signer_account_id: crate::types::account_id::AccountId,
#[interactive_clap(... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/config/mod.rs | src/commands/config/mod.rs | use color_eyre::eyre::ContextCompat;
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
mod add_connection;
mod delete_connection;
mod edit_connection;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(context = crate::GlobalContext)]
pub struct ConfigCommands {
#[interactive_clap(... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/config/delete_connection/mod.rs | src/commands/config/delete_connection/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = DeleteNetworkConnectionContext)]
pub struct DeleteNetworkConnection {
/// What is the network connection name?
#[interactive_clap(skip_default_input_arg)]
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/config/edit_connection/mod.rs | src/commands/config/edit_connection/mod.rs | use inquire::{Select, Text};
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = EditConnectionContext)]
pub struct EditConnection {
#[interactive_clap(skip_default_input_arg)]
/// What is the network connectio... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/config/add_connection/mod.rs | src/commands/config/add_connection/mod.rs | use inquire::{CustomType, Select};
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = AddNetworkConnectionContext)]
pub struct AddNetworkConnection {
#[interactive_clap(long)]
/// What is the NEAR network? (e.... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/mod.rs | src/commands/contract/mod.rs | use crate::common::RpcQueryResponseExt;
use color_eyre::eyre::{Context, Report};
use near_primitives::types::BlockReference;
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
use thiserror::Error;
pub mod call_function;
pub mod deploy;
pub mod deploy_global;
mod download_abi;
pub mod download_wasm;
#[cfg(feature ... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/verify/mod.rs | src/commands/contract/verify/mod.rs | use color_eyre::{
eyre::{Context, ContextCompat},
owo_colors::OwoColorize,
};
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
use tracing_indicatif::span_ext::IndicatifSpanExt;
use near_verify_rs::types::{
contract_source_metadata::ContractSourceMetadata,
source_id::{GitReference, SourceId, Sou... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/deploy_global/mod.rs | src/commands/contract/deploy_global/mod.rs | use color_eyre::eyre::Context;
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(context = crate::GlobalContext)]
pub struct Contract {
#[interactive_clap(named_arg)]
/// Specify a path to wasm file
use_file: ContractFile,
}... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/deploy/mod.rs | src/commands/contract/deploy/mod.rs | use color_eyre::eyre::Context;
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
pub mod initialize_mode;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = ContractContext)]
pub struct Contract {
#[interact... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/deploy/initialize_mode/mod.rs | src/commands/contract/deploy/initialize_mode/mod.rs | use strum::{EnumDiscriminants, EnumIter, EnumMessage};
mod call_function_type;
#[derive(Debug, Clone, EnumDiscriminants, interactive_clap_derive::InteractiveClap)]
#[interactive_clap(context = super::GenericDeployContext)]
#[strum_discriminants(derive(EnumMessage, EnumIter))]
/// Select the need for initialization:
p... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/deploy/initialize_mode/call_function_type/mod.rs | src/commands/contract/deploy/initialize_mode/call_function_type/mod.rs | use inquire::CustomType;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::GenericDeployContext)]
#[interactive_clap(output_context = CallFunctionActionContext)]
pub struct CallFunctionAction {
/// What is the name of the function?
function_name: String... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/download_wasm/mod.rs | src/commands/contract/download_wasm/mod.rs | use std::io::Write;
use color_eyre::eyre::Context;
use inquire::CustomType;
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
use crate::common::JsonRpcClientExt;
#[derive(Debug, Clone)]
pub enum ContractType {
Regular(near_primitives::types::AccountId),
GlobalContractByAccountId {
account_id: n... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/inspect/mod.rs | src/commands/contract/inspect/mod.rs | use std::fmt::Write;
use color_eyre::{
eyre::{Context, Report},
owo_colors::OwoColorize,
};
use thiserror::Error;
use tracing_indicatif::span_ext::IndicatifSpanExt;
use near_primitives::types::BlockReference;
use super::FetchAbiError;
use crate::common::{CallResultExt, RpcQueryResponseExt};
#[derive(Debug, ... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/call_function/mod.rs | src/commands/contract/call_function/mod.rs | use inquire::{Select, Text};
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
mod as_read_only;
mod as_transaction;
pub mod call_function_args_type;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(context = crate::GlobalContext)]
pub struct CallFunctionCommands {
#[interactive_... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/call_function/as_transaction/mod.rs | src/commands/contract/call_function/as_transaction/mod.rs | use inquire::CustomType;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = CallFunctionContext)]
pub struct CallFunction {
#[interactive_clap(skip_default_input_arg)]
/// What is the contract account ID?
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/call_function/as_read_only/mod.rs | src/commands/contract/call_function/as_read_only/mod.rs | use color_eyre::eyre::Context;
use std::io::Write;
use crate::common::CallResultExt;
use crate::common::JsonRpcClientExt;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = CallFunctionViewContext)]
pub struct CallFu... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/call_function/call_function_args_type/mod.rs | src/commands/contract/call_function/call_function_args_type/mod.rs | use std::str::FromStr;
use color_eyre::eyre::Context;
use inquire::Select;
use strum::{EnumDiscriminants, EnumIter, EnumMessage, IntoEnumIterator};
#[derive(Debug, EnumDiscriminants, Clone, clap::ValueEnum)]
#[strum_discriminants(derive(EnumMessage, EnumIter))]
/// How do you want to pass the function call arguments?... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/download_abi/mod.rs | src/commands/contract/download_abi/mod.rs | use std::io::Write;
use color_eyre::eyre::Context;
use inquire::CustomType;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = ContractContext)]
pub struct Contract {
#[interactive_clap(skip_default_input_arg)]
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/mod.rs | src/commands/contract/view_storage/mod.rs | mod keys_to_view;
mod output_format;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::GlobalContext)]
#[interactive_clap(output_context = ViewStorageContext)]
pub struct ViewStorage {
#[interactive_clap(skip_default_input_arg)]
/// What is the contract accoun... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/output_format/mod.rs | src/commands/contract/view_storage/output_format/mod.rs | use color_eyre::eyre::Context;
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
use crate::common::JsonRpcClientExt;
mod as_json;
mod as_text;
#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(context = super::keys_to_view::KeysContext)]
#[strum_discriminants(deri... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/output_format/as_json.rs | src/commands/contract/view_storage/output_format/as_json.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::keys_to_view::KeysContext)]
#[interactive_clap(output_context = AsJsonContext)]
pub struct AsJson {
#[interactive_clap(named_arg)]
/// Select network
network_config: crate::network_view_at_block::Netw... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/output_format/as_text.rs | src/commands/contract/view_storage/output_format/as_text.rs | use color_eyre::{eyre::Context, owo_colors::OwoColorize};
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::keys_to_view::KeysContext)]
#[interactive_clap(output_context = AsTextContext)]
pub struct AsText {
#[interactive_clap(named_arg)]
/// Select net... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/keys_to_view/keys_start_with_string.rs | src/commands/contract/view_storage/keys_to_view/keys_start_with_string.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::ViewStorageContext)]
#[interactive_clap(output_context = KeysStartWithStringContext)]
pub struct KeysStartWithString {
/// Enter the string that the keys begin with (for example, "S"):
keys_begin_with: St... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/keys_to_view/keys_start_with_bytes_as_base64.rs | src/commands/contract/view_storage/keys_to_view/keys_start_with_bytes_as_base64.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::ViewStorageContext)]
#[interactive_clap(output_context = KeysStartWithBytesAsBase64Context)]
pub struct KeysStartWithBytesAsBase64 {
/// Enter the string that the keys begin with Base64 bytes (for example, "U... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/keys_to_view/mod.rs | src/commands/contract/view_storage/keys_to_view/mod.rs | use strum::{EnumDiscriminants, EnumIter, EnumMessage};
mod all_keys;
mod keys_start_with_bytes_as_base64;
mod keys_start_with_string;
#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(context = super::ViewStorageContext)]
#[strum_discriminants(derive(EnumMessage, EnumIte... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/commands/contract/view_storage/keys_to_view/all_keys.rs | src/commands/contract/view_storage/keys_to_view/all_keys.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = super::super::ViewStorageContext)]
#[interactive_clap(output_context = AllKeysContext)]
pub struct AllKeys {
#[interactive_clap(subcommand)]
output_format: super::super::output_format::OutputFormat,
}
#[derive(Debug, ... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/utils_command/mod.rs | src/utils_command/mod.rs | pub mod generate_keypair_subcommand;
| rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/utils_command/generate_keypair_subcommand/mod.rs | src/utils_command/generate_keypair_subcommand/mod.rs | use std::str::FromStr;
/// Generate a key pair of private and public keys (use it anywhere you need
/// Ed25519 keys)
#[derive(Debug, Clone, clap::Parser)]
pub struct CliGenerateKeypair {
#[clap(long)]
pub master_seed_phrase: Option<String>,
#[clap(long, default_value = "12")]
pub new_master_seed_phras... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/public_key.rs | src/types/public_key.rs | #[derive(Debug, Clone, PartialEq, PartialOrd, Ord, Eq)]
pub struct PublicKey(pub near_crypto::PublicKey);
impl std::fmt::Display for PublicKey {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl std::str::FromStr for PublicKey {
type Err = near_crypto::ParseKe... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/signed_delegate_action.rs | src/types/signed_delegate_action.rs | use near_primitives::{borsh, borsh::BorshDeserialize};
#[derive(Debug, Clone)]
pub struct SignedDelegateActionAsBase64 {
inner: near_primitives::action::delegate::SignedDelegateAction,
}
impl serde::Serialize for SignedDelegateActionAsBase64 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/signature.rs | src/types/signature.rs | #[derive(Debug, Clone)]
pub struct Signature(pub near_crypto::Signature);
impl std::fmt::Display for Signature {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl std::str::FromStr for Signature {
type Err = near_crypto::ParseSignatureError;
fn from_str(s... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/near_allowance.rs | src/types/near_allowance.rs | const UNLIMITED: &str = "unlimited";
#[derive(
Debug,
Clone,
Copy,
serde::Serialize,
serde::Deserialize,
derive_more::AsRef,
derive_more::From,
derive_more::Into,
)]
#[as_ref(forward)]
pub struct NearAllowance(Option<crate::types::near_token::NearToken>);
impl std::fmt::Display for Nea... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/ft_properties.rs | src/types/ft_properties.rs | use color_eyre::eyre::{Context, ContextCompat};
use serde::de::{Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
use crate::common::CallResultExt;
use crate::common::JsonRpcClientExt;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd)]
pub enum FungibleTokenTransferAmount {
/// Transfer of the ... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/json.rs | src/types/json.rs | use color_eyre::eyre::WrapErr;
use serde_json::Value;
#[derive(Debug, Clone, derive_more::FromStr)]
pub struct Json {
inner: Value,
}
impl From<Json> for Value {
fn from(item: Json) -> Self {
item.inner
}
}
impl std::fmt::Display for Json {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::f... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/url.rs | src/types/url.rs | #[derive(Debug, Clone)]
pub struct Url(pub url::Url);
impl From<Url> for url::Url {
fn from(url: Url) -> Self {
url.0
}
}
impl From<url::Url> for Url {
fn from(url: url::Url) -> Self {
Self(url)
}
}
impl std::fmt::Display for Url {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) ->... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/contract_properties.rs | src/types/contract_properties.rs | use near_verify_rs::types::{contract_source_metadata::Standard, sha256_checksum::SHA256Checksum};
pub struct ContractProperties {
pub code: Vec<u8>,
pub hash: SHA256Checksum,
pub version: Option<String>,
pub standards: Vec<Standard>,
pub link: Option<String>,
pub source: String,
pub build_e... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/signed_transaction.rs | src/types/signed_transaction.rs | use near_primitives::{borsh, borsh::BorshDeserialize};
#[derive(Debug, Clone)]
pub struct SignedTransactionAsBase64 {
pub inner: near_primitives::transaction::SignedTransaction,
}
impl From<SignedTransactionAsBase64> for near_primitives::transaction::SignedTransaction {
fn from(transaction: SignedTransactionA... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/api_key.rs | src/types/api_key.rs | #[derive(Eq, Hash, Clone, Debug, PartialEq)]
pub struct ApiKey(pub near_jsonrpc_client::auth::ApiKey);
impl From<ApiKey> for near_jsonrpc_client::auth::ApiKey {
fn from(api_key: ApiKey) -> Self {
api_key.0
}
}
impl std::fmt::Display for ApiKey {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::f... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/vec_string.rs | src/types/vec_string.rs | #[derive(Debug, Default, Clone)]
pub struct VecString(pub Vec<String>);
impl std::fmt::Display for VecString {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}", self.0.join(","))
}
}
impl std::str::FromStr for VecString {
type Err = color_eyre::eyre::ErrReport;
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/path_buf.rs | src/types/path_buf.rs | use color_eyre::eyre::Context;
#[derive(
Debug,
Default,
Clone,
derive_more::AsRef,
derive_more::From,
derive_more::Into,
derive_more::FromStr,
)]
#[as_ref(forward)]
pub struct PathBuf(pub std::path::PathBuf);
impl std::fmt::Display for PathBuf {
fn fmt(&self, f: &mut std::fmt::Formatt... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/secret_key.rs | src/types/secret_key.rs | #[derive(Debug, Clone, PartialEq, Eq)]
pub struct SecretKey(pub near_crypto::SecretKey);
impl std::fmt::Display for SecretKey {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl std::str::FromStr for SecretKey {
type Err = near_crypto::ParseKeyError;
fn f... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/near_token.rs | src/types/near_token.rs | const ONE_NEAR: u128 = 10u128.pow(24);
#[derive(
Debug,
Default,
Clone,
Copy,
Eq,
PartialEq,
Ord,
PartialOrd,
serde::Serialize,
serde::Deserialize,
derive_more::AsRef,
derive_more::From,
derive_more::Into,
derive_more::FromStr,
)]
#[as_ref(forward)]
pub struct Ne... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/mod.rs | src/types/mod.rs | pub mod account_id;
pub mod api_key;
pub mod base64_bytes;
#[cfg(feature = "verify_contract")]
pub mod contract_properties;
pub mod crypto_hash;
pub mod file_bytes;
pub mod ft_properties;
pub mod json;
pub mod near_allowance;
pub mod near_token;
pub mod nonce32_bytes;
pub mod partial_protocol_config;
pub mod path_buf;
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/base64_bytes.rs | src/types/base64_bytes.rs | #[derive(Debug, Clone)]
pub struct Base64Bytes {
inner: Vec<u8>,
}
impl interactive_clap::ToCli for Base64Bytes {
type CliVariant = Base64Bytes;
}
impl std::str::FromStr for Base64Bytes {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self {
inner: near_pri... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/crypto_hash.rs | src/types/crypto_hash.rs | #[derive(Debug, Copy, Clone)]
pub struct CryptoHash(pub near_primitives::hash::CryptoHash);
impl From<CryptoHash> for near_primitives::hash::CryptoHash {
fn from(item: CryptoHash) -> Self {
item.0
}
}
impl std::fmt::Display for CryptoHash {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::R... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/partial_protocol_config.rs | src/types/partial_protocol_config.rs | use near_jsonrpc_client::methods::EXPERIMENTAL_protocol_config::RpcProtocolConfigError;
#[derive(Debug, serde::Deserialize)]
pub struct PartialProtocolConfigView {
pub runtime_config: PartialRuntimeConfigView,
}
impl near_jsonrpc_client::methods::RpcHandlerResponse for PartialProtocolConfigView {}
#[derive(Debug... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/file_bytes.rs | src/types/file_bytes.rs | use color_eyre::eyre::Context;
#[derive(Debug, Clone, derive_more::FromStr)]
pub struct FileBytes {
inner: std::path::PathBuf,
}
impl interactive_clap::ToCli for FileBytes {
type CliVariant = FileBytes;
}
impl std::fmt::Display for FileBytes {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::R... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/slip10.rs | src/types/slip10.rs | #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct BIP32Path(pub slipped10::BIP32Path);
impl std::fmt::Display for BIP32Path {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl std::str::FromStr for BIP32Path {
type Err = color_eyre::eyre::Repo... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/public_key_list.rs | src/types/public_key_list.rs | use interactive_clap::ToCli;
#[derive(Debug, Clone)]
pub struct PublicKeyList(Vec<near_crypto::PublicKey>);
impl std::fmt::Display for PublicKeyList {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let keys: Vec<String> = self.0.iter().map(|key| key.to_string()).collect();
write!... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/account_id.rs | src/types/account_id.rs | use std::str::FromStr;
#[derive(Eq, Ord, Hash, Clone, Debug, PartialEq, PartialOrd)]
pub struct AccountId(pub near_primitives::types::AccountId);
impl From<AccountId> for near_primitives::types::AccountId {
fn from(account_id: AccountId) -> Self {
account_id.0
}
}
impl From<near_primitives::types::Ac... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/nonce32_bytes.rs | src/types/nonce32_bytes.rs | #[derive(Debug, Clone, Default)]
pub struct Nonce32 {
inner: [u8; 32],
}
impl std::str::FromStr for Nonce32 {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let bytes = near_primitives::serialize::from_base64(s)
.map_err(|err| format!("Invalid base64: {err}"))?;
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/types/transaction.rs | src/types/transaction.rs | use near_primitives::{borsh, borsh::BorshDeserialize};
#[derive(Debug, Clone)]
pub struct TransactionAsBase64 {
pub inner: near_primitives::transaction::TransactionV0,
}
impl From<TransactionAsBase64> for near_primitives::transaction::TransactionV0 {
fn from(transaction: TransactionAsBase64) -> Self {
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/network_view_at_block/mod.rs | src/network_view_at_block/mod.rs | use std::str::FromStr;
use color_eyre::eyre::ContextCompat;
use near_primitives::types::{BlockId, BlockReference, Finality};
use strum::{EnumDiscriminants, EnumIter, EnumMessage};
pub type OnAfterGettingBlockReferenceCallback =
std::sync::Arc<dyn Fn(&crate::config::NetworkConfig, &BlockReference) -> crate::CliRes... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/network_for_transaction/mod.rs | src/network_for_transaction/mod.rs | use color_eyre::eyre::ContextCompat;
#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = crate::commands::ActionContext)]
#[interactive_clap(output_context = NetworkForTransactionArgsContext)]
#[interactive_clap(skip_default_from_cli)]
pub struct NetworkForTransactionArgs {
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/config/mod.rs | src/config/mod.rs | mod migrations;
pub type CliResult = color_eyre::eyre::Result<()>;
use color_eyre::eyre::{ContextCompat, WrapErr};
use std::{io::Write, str::FromStr};
use tracing_indicatif::span_ext::IndicatifSpanExt;
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Config {
pub credentials_home_dir: std... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/config/migrations.rs | src/config/migrations.rs | use crate::config::Config as ConfigV4;
use crate::config::NetworkConfig as NetworkConfigV4;
use NetworkConfigV3 as NetworkConfigV2;
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ConfigV1 {
pub credentials_home_dir: std::path::PathBuf,
pub network_connection: linked_hash_map::LinkedHa... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/src/network/mod.rs | src/network/mod.rs | #[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = NetworkContext)]
#[interactive_clap(output_context = NetworkOutputContext)]
pub struct Network {
#[interactive_clap(long)]
#[interactive_clap(skip_interactive_input)]
wallet_url: Option<crate::types::url::Url>,
... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/tests/tokens.rs | tests/tokens.rs | mod common;
use common::prepare_tests;
use std::process::Command;
#[tokio::test]
async fn test_view_near_balance() -> Result<(), Box<dyn std::error::Error>> {
let (_sandbox, _temp_dir) = prepare_tests().await?;
let output = Command::new("target/debug/near")
.args(&[
"tokens",
"... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/tests/account.rs | tests/account.rs | mod common;
use std::process::Command;
#[tokio::test]
async fn test_view_account_summary_with_localnet() -> Result<(), Box<dyn std::error::Error>> {
let (_sandbox, _temp_dir) = common::prepare_tests().await?;
let output = Command::new("target/debug/near")
.args(&[
"account",
"v... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
near/near-cli-rs | https://github.com/near/near-cli-rs/blob/c9cda7bcb76d513c212e347a76ddacdb941ed755/tests/common/mod.rs | tests/common/mod.rs | use near_sandbox::{Sandbox, SandboxConfig};
pub async fn prepare_tests() -> Result<(Sandbox, tempfile::TempDir), Box<dyn std::error::Error>> {
// Configure the sandbox with a custom epoch length
let config = SandboxConfig {
additional_genesis: Some(serde_json::json!({
"epoch_length": 43200,... | rust | Apache-2.0 | c9cda7bcb76d513c212e347a76ddacdb941ed755 | 2026-01-04T20:23:22.593044Z | false |
withoutboats/juliex | https://github.com/withoutboats/juliex/blob/cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb/src/lib.rs | src/lib.rs | //! juliex is a concurrent executor for Rust futures. It is implemented as a
//! threadpool executor using a single, shared queue. Algorithmically, it is very
//! similar to the Threadpool executor provided by the futures crate. The main
//! difference is that juliex uses a crossbeam channel and performs a single
//! a... | rust | Apache-2.0 | cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb | 2026-01-04T20:24:37.226415Z | false |
withoutboats/juliex | https://github.com/withoutboats/juliex/blob/cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb/src/tests.rs | src/tests.rs | use std::cell::Cell;
use std::future::Future;
use std::pin::Pin;
use std::task::Context;
use std::sync::mpsc::*;
use super::*;
struct DropFuture(Sender<()>);
impl Future for DropFuture {
type Output = ();
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()> {
Poll::Ready(())
}
}
impl... | rust | Apache-2.0 | cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb | 2026-01-04T20:24:37.226415Z | false |
withoutboats/juliex | https://github.com/withoutboats/juliex/blob/cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb/examples/http.rs | examples/http.rs | use std::io;
use futures::StreamExt;
use futures::executor;
use futures::io::AsyncReadExt;
use futures::io::AsyncWriteExt;
use romio::{TcpListener};
fn main() -> io::Result<()> {
executor::block_on(async {
let mut listener = TcpListener::bind(&"127.0.0.1:7878".parse().unwrap())?;
let mut incoming... | rust | Apache-2.0 | cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb | 2026-01-04T20:24:37.226415Z | false |
withoutboats/juliex | https://github.com/withoutboats/juliex/blob/cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb/examples/echo.rs | examples/echo.rs | use std::io;
use futures::StreamExt;
use futures::executor;
use futures::io::AsyncReadExt;
use romio::{TcpListener, TcpStream};
fn main() -> io::Result<()> {
executor::block_on(async {
let mut listener = TcpListener::bind(&"127.0.0.1:7878".parse().unwrap())?;
let mut incoming = listener.incoming(... | rust | Apache-2.0 | cc5144226fcf34d5c3f0c1bdcd349c0c088cd4bb | 2026-01-04T20:24:37.226415Z | false |
reganzm/hug_rust | https://github.com/reganzm/hug_rust/blob/6a2801769c8b062477c2e6273af0218e0e21e75d/rust基础/控制和跳转/src/main.rs | rust基础/控制和跳转/src/main.rs | use std::{collections::HashMap, path::PrefixComponent};
fn main() {
// 表达式和语句
// 函数func是语句
fn func() -> i32 {
// 123是表达式,表达式返回
123
}
// 整句是语句,name = "regan".to_string()是表达式
let name = "regan".to_string();
// age=123是表达式
let age = 123;
// 整句是语句,args=[1,2,3]是表达式
l... | rust | Apache-2.0 | 6a2801769c8b062477c2e6273af0218e0e21e75d | 2026-01-04T20:24:35.074754Z | false |
reganzm/hug_rust | https://github.com/reganzm/hug_rust/blob/6a2801769c8b062477c2e6273af0218e0e21e75d/rust基础/所有权及引用/src/bin/reference.rs | rust基础/所有权及引用/src/bin/reference.rs | fn main() {
let name = String::from("三角兽");
let nick_name = String::from("兽兽");
println!("name:{name} nick_name:{nick_name}");
// 通过&获取对象的引用
// 不会转移所有权
let ref_name = &name;
let ref_nick_name = &name;
println!("ref_name:{ref_name} ref_nick_name:{ref_nick_name}");
// 打印出引用的地址和值的地址
... | rust | Apache-2.0 | 6a2801769c8b062477c2e6273af0218e0e21e75d | 2026-01-04T20:24:35.074754Z | false |
reganzm/hug_rust | https://github.com/reganzm/hug_rust/blob/6a2801769c8b062477c2e6273af0218e0e21e75d/rust基础/所有权及引用/src/bin/owner_and_scope.rs | rust基础/所有权及引用/src/bin/owner_and_scope.rs | #[warn(unused_variables)]
fn main() {
let a: f64 = 3.14;
// 所有权和作用域
owner_and_scope();
} // <-------------------------------main函数作用域中的a离开作用域,自动被回收
// 所有权和作用域
#[warn(unused_variables)]
fn owner_and_scope() {
let a = 1314; // <---------- a出现在owner_and_scope中
{
//-----------------------------... | rust | Apache-2.0 | 6a2801769c8b062477c2e6273af0218e0e21e75d | 2026-01-04T20:24:35.074754Z | false |
reganzm/hug_rust | https://github.com/reganzm/hug_rust/blob/6a2801769c8b062477c2e6273af0218e0e21e75d/rust基础/所有权及引用/src/bin/owner_moved.rs | rust基础/所有权及引用/src/bin/owner_moved.rs | fn main() {
// 便量绑定
let str_a = String::from("拿下rust");
// 打印str_a内存地址
println!("str_a memory address :{:p}", &(*str_a));
// move所有权,str_b变量现在拥有值的所有权
// str_a不再拥有值的所有权,不能再访问
let str_b = str_a;
// 打印str_b内存地址
// 可以发现str_b和str_a值对应的内存地址是一样的
// 只是拥有这个值的变量变化了
println!("str_b memo... | rust | Apache-2.0 | 6a2801769c8b062477c2e6273af0218e0e21e75d | 2026-01-04T20:24:35.074754Z | false |
reganzm/hug_rust | https://github.com/reganzm/hug_rust/blob/6a2801769c8b062477c2e6273af0218e0e21e75d/rust基础/智能指针/src/main.rs | rust基础/智能指针/src/main.rs | use std::{mem::size_of_val, ops::Deref};
fn main() {
let a: &str = "Rust";
// 分别打印出&str的大小、切片变量地址、切片对应值的地址
// 和切片对应值的大小,它和切片中的len属性大小一致
println!(
"size of a:{} , address of a:{:p}, value address of a:{:p} , size of data:{}",
a.len(),
&a,
&(*a),
size_of_val(&(*a))
... | rust | Apache-2.0 | 6a2801769c8b062477c2e6273af0218e0e21e75d | 2026-01-04T20:24:35.074754Z | false |
reganzm/hug_rust | https://github.com/reganzm/hug_rust/blob/6a2801769c8b062477c2e6273af0218e0e21e75d/rust基础/智能指针/src/bin/rc_and_arc.rs | rust基础/智能指针/src/bin/rc_and_arc.rs | use std::{rc::Rc, sync::Arc, thread, time::Duration};
fn main() {
// Rc
let count1: Rc<i32> = Rc::new(10);
// 增加引用计数器
let count2: Rc<i32> = count1.clone();
println!("count1:{count1} count2:{count2}");
println!("reference count:{} ", Rc::strong_count(&count1));
{
let count3 = count2.... | rust | Apache-2.0 | 6a2801769c8b062477c2e6273af0218e0e21e75d | 2026-01-04T20:24:35.074754Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.