Skip to content

Commit

Permalink
chore: use own re-export
Browse files Browse the repository at this point in the history
  • Loading branch information
akorchyn committed Nov 7, 2024
1 parent b26cad0 commit e990010
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 30 deletions.
3 changes: 1 addition & 2 deletions src/account/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::convert::Infallible;

use near_crypto::PublicKey;
use near_gas::NearGas;
use near_primitives::types::AccountId;
use near_token::NearToken;
use reqwest::Response;
use serde_json::json;
Expand All @@ -13,7 +12,7 @@ use crate::{
errors::{AccountCreationError, FaucetError, ValidationError},
prelude::*,
transactions::{ConstructTransaction, TransactionWithSign},
types::transactions::PrepopulateTransaction,
types::{transactions::PrepopulateTransaction, AccountId},
};

#[derive(Clone, Debug)]
Expand Down
4 changes: 2 additions & 2 deletions src/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use near_crypto::PublicKey;
use near_primitives::{
account::AccessKey,
action::{AddKeyAction, DeleteKeyAction},
types::{AccountId, BlockReference},
types::BlockReference,
};

use crate::common::{
Expand All @@ -15,7 +15,7 @@ use crate::common::{
secret::SecretBuilder,
};
use crate::transactions::ConstructTransaction;
use crate::types::views::AccessKeyPermission;
use crate::types::{views::AccessKeyPermission, AccountId};

use self::create::CreateAccountBuilder;

Expand Down
2 changes: 1 addition & 1 deletion src/common/signed_delegate_action.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use near_primitives::{borsh, borsh::BorshDeserialize};
use borsh::{self, BorshDeserialize};

#[derive(Debug, Clone)]
pub struct SignedDelegateActionAsBase64 {
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ pub struct NetworkConfig {
pub rpc_url: url::Url,
pub rpc_api_key: Option<crate::types::ApiKey>,
// https://github.com/near/near-cli-rs/issues/116
pub linkdrop_account_id: Option<near_primitives::types::AccountId>,
pub linkdrop_account_id: Option<crate::types::AccountId>,
// https://docs.near.org/social/contract
pub near_social_db_contract_account_id: Option<near_primitives::types::AccountId>,
pub near_social_db_contract_account_id: Option<crate::types::AccountId>,
pub faucet_url: Option<url::Url>,
pub meta_transaction_relayer_url: Option<url::Url>,
pub fastnear_url: Option<url::Url>,
pub staking_pools_factory_account_id: Option<near_primitives::types::AccountId>,
pub staking_pools_factory_account_id: Option<crate::types::AccountId>,
}

impl NetworkConfig {
Expand Down
4 changes: 2 additions & 2 deletions src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use near_gas::NearGas;

use near_primitives::{
action::{Action, DeployContractAction, FunctionCallAction},
types::{AccountId, BlockReference, StoreKey},
types::BlockReference,
};
use near_token::NearToken;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
Expand All @@ -20,7 +20,7 @@ use crate::{
errors::BuilderError,
signer::Signer,
transactions::{ConstructTransaction, Transaction},
types::{contract::ContractSourceMetadata, Data},
types::{contract::ContractSourceMetadata, views::StoreKey, AccountId, Data},
};

#[derive(Clone, Debug)]
Expand Down
5 changes: 2 additions & 3 deletions src/fastnear.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use std::collections::BTreeSet;

use near_primitives::types::AccountId;
use serde::de::DeserializeOwned;

use crate::errors::FastNearError;

use crate::types::AccountId;
#[derive(Debug, serde::Deserialize)]
pub struct StakingPool {
pool_id: near_primitives::types::AccountId,
pool_id: AccountId,
}

#[derive(Debug, serde::Deserialize)]
Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ pub mod prelude {
types::{
reference::{EpochReference, Reference},
tokens::{FTBalance, USDT_BALANCE, W_NEAR_BALANCE},
Data,
AccountId, Data, NearGas, NearToken,
},
};

pub use near_account_id::AccountId;
pub use near_token::NearToken;
}
9 changes: 4 additions & 5 deletions src/signer/keystore.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use near_crypto::{PublicKey, SecretKey};
use near_primitives::{
transaction::Transaction,
types::{AccountId, Nonce},
};
use near_primitives::{transaction::Transaction, types::Nonce};
use tracing::{debug, info, instrument, trace, warn};

use crate::{
config::NetworkConfig,
errors::{KeyStoreError, SignerError},
types::{transactions::PrepopulateTransaction, views::AccessKeyPermission, CryptoHash},
types::{
transactions::PrepopulateTransaction, views::AccessKeyPermission, AccountId, CryptoHash,
},
};

use super::{AccountKeyPair, SignerTrait};
Expand Down
4 changes: 2 additions & 2 deletions src/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::BTreeMap;

use near_gas::NearGas;
use near_jsonrpc_client::methods::query::RpcQueryRequest;
use near_primitives::types::{AccountId, BlockReference, EpochReference};
use near_primitives::types::{BlockReference, EpochReference};
use near_token::NearToken;

use crate::{
Expand All @@ -16,7 +16,7 @@ use crate::{
transactions::ConstructTransaction,
types::{
stake::{RewardFeeFraction, StakingPoolInfo, UserStakeBalance},
Data,
AccountId, Data,
},
};

Expand Down
3 changes: 1 addition & 2 deletions src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use near_primitives::types::AccountId;
use near_token::NearToken;
use serde_json::json;

Expand All @@ -7,7 +6,7 @@ use crate::{
contract::{Contract, ContractTransactBuilder},
errors::BuilderError,
transactions::ConstructTransaction,
types::storage::StorageBalance,
types::{storage::StorageBalance, AccountId},
};

#[derive(Clone, Debug)]
Expand Down
4 changes: 2 additions & 2 deletions src/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use near_contract_standards::{
};
use near_primitives::{
action::{Action, TransferAction},
types::{AccountId, BlockReference},
types::BlockReference,
};
use near_sdk::json_types::U128;
use near_token::NearToken;
Expand All @@ -28,7 +28,7 @@ use crate::{
tokens::{FTBalance, UserBalance},
transactions::PrepopulateTransaction,
views::Account,
Data,
AccountId, Data,
},
};

Expand Down
4 changes: 2 additions & 2 deletions src/transactions.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::sync::Arc;

use near_primitives::{action::Action, types::AccountId};
use near_primitives::action::Action;

use crate::{
common::send::{ExecuteSignedTransaction, Transactionable},
config::NetworkConfig,
errors::{SignerError, ValidationError},
signer::Signer,
types::transactions::PrepopulateTransaction,
types::{transactions::PrepopulateTransaction, AccountId},
};

#[derive(Clone, Debug)]
Expand Down
4 changes: 4 additions & 0 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ pub mod tokens;
pub mod transactions;
pub mod views;

pub use near_account_id::AccountId;
pub use near_gas::NearGas;
pub use near_token::NearToken;

#[derive(
Debug,
Clone,
Expand Down

0 comments on commit e990010

Please sign in to comment.