diff --git a/Cargo.lock b/Cargo.lock index 597c7c53b..8c9d20109 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2158,7 +2158,7 @@ dependencies = [ "near-jsonrpc-primitives", "near-ledger", "near-primitives", - "near-socialdb-client-rs", + "near-socialdb-client", "open", "openssl", "prettytable", @@ -2396,9 +2396,10 @@ dependencies = [ ] [[package]] -name = "near-socialdb-client-rs" +name = "near-socialdb-client" version = "0.1.0" -source = "git+https://github.com/bos-cli-rs/near-socialdb-client-rs#9974f789d6ca74c15a214ff9d2d48da8bc1f7d80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0c8308868cc23a386607d73bc04b9fb8ce054e3f7bd3392899daf5d29b8b443" dependencies = [ "color-eyre", "interactive-clap", diff --git a/Cargo.toml b/Cargo.toml index 4d28a7f60..c54e0324e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,7 +79,7 @@ keyring = "2.0.5" interactive-clap = "0.2.6" interactive-clap-derive = "0.2.6" -near-socialdb-client-rs = {git = "https://github.com/bos-cli-rs/near-socialdb-client-rs"} +near-socialdb-client = "0.1.0" [features] default = ["ledger", "self-update"] diff --git a/src/commands/account/storage_management/view_storage_balance.rs b/src/commands/account/storage_management/view_storage_balance.rs index 0232002ae..6bb36e1d1 100644 --- a/src/commands/account/storage_management/view_storage_balance.rs +++ b/src/commands/account/storage_management/view_storage_balance.rs @@ -45,7 +45,7 @@ impl AccountContext { .wrap_err_with(|| { "Failed to fetch query for view method: 'storage_balance_of'" })? - .parse_result_from_json::() + .parse_result_from_json::() .wrap_err_with(|| { "Failed to parse return value of view function call for StorageBalance." })?; diff --git a/src/commands/account/update_social_profile/mod.rs b/src/commands/account/update_social_profile/mod.rs index c8f3cebd9..8771adf83 100644 --- a/src/commands/account/update_social_profile/mod.rs +++ b/src/commands/account/update_social_profile/mod.rs @@ -3,7 +3,7 @@ mod sign_as; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct TransactionFunctionArgs { - pub data: near_socialdb_client_rs::types::socialdb_types::SocialDb, + pub data: near_socialdb_client::types::socialdb_types::SocialDb, } #[derive(Debug, Clone, interactive_clap::InteractiveClap)] diff --git a/src/commands/account/update_social_profile/profile_args_type/manually.rs b/src/commands/account/update_social_profile/profile_args_type/manually.rs index 3a8144836..f037dbed1 100644 --- a/src/commands/account/update_social_profile/profile_args_type/manually.rs +++ b/src/commands/account/update_social_profile/profile_args_type/manually.rs @@ -53,29 +53,25 @@ impl ManuallyContext { previous_context: super::super::UpdateSocialProfileContext, scope: &::InteractiveClapContextScope, ) -> color_eyre::eyre::Result { - let profile = near_socialdb_client_rs::types::socialdb_types::Profile { + let profile = near_socialdb_client::types::socialdb_types::Profile { name: scope.name.clone(), image: if scope.image_url.is_none() && scope.image_ipfs_cid.is_none() { None } else { - Some( - near_socialdb_client_rs::types::socialdb_types::ProfileImage { - url: scope.image_url.clone().map(|url| url.into()), - ipfs_cid: scope.image_ipfs_cid.clone(), - }, - ) + Some(near_socialdb_client::types::socialdb_types::ProfileImage { + url: scope.image_url.clone().map(|url| url.into()), + ipfs_cid: scope.image_ipfs_cid.clone(), + }) }, background_image: if scope.background_image_url.is_none() && scope.background_image_ipfs_cid.is_none() { None } else { - Some( - near_socialdb_client_rs::types::socialdb_types::ProfileImage { - url: scope.background_image_url.clone().map(|url| url.into()), - ipfs_cid: scope.background_image_ipfs_cid.clone(), - }, - ) + Some(near_socialdb_client::types::socialdb_types::ProfileImage { + url: scope.background_image_url.clone().map(|url| url.into()), + ipfs_cid: scope.background_image_ipfs_cid.clone(), + }) }, description: scope.description.clone(), linktree: if scope.twitter.is_none() diff --git a/src/commands/account/update_social_profile/sign_as.rs b/src/commands/account/update_social_profile/sign_as.rs index 568d5cf59..c89dce9d0 100644 --- a/src/commands/account/update_social_profile/sign_as.rs +++ b/src/commands/account/update_social_profile/sign_as.rs @@ -72,7 +72,7 @@ impl From for crate::commands::ActionContext { near_primitives::types::Finality::Final.into(), ) .wrap_err_with(|| {format!("Failed to fetch query for view method: 'get {account_id}/profile/**'")})? - .parse_result_from_json::() + .parse_result_from_json::() .wrap_err_with(|| { format!("Failed to parse view function call return value for {account_id}/profile.") })? @@ -83,7 +83,7 @@ impl From for crate::commands::ActionContext { }; let deposit = tokio::runtime::Runtime::new().unwrap().block_on( - near_socialdb_client_rs::required_deposit( + near_socialdb_client::required_deposit( &json_rpc_client, &contract_account_id, &account_id, @@ -93,10 +93,10 @@ impl From for crate::commands::ActionContext { )?; let new_social_db_state = - near_socialdb_client_rs::types::socialdb_types::SocialDb { + near_socialdb_client::types::socialdb_types::SocialDb { accounts: HashMap::from([( account_id.clone(), - near_socialdb_client_rs::types::socialdb_types::AccountProfile { + near_socialdb_client::types::socialdb_types::AccountProfile { profile: serde_json::from_value(local_profile)?, }, )]), @@ -132,7 +132,7 @@ impl From for crate::commands::ActionContext { { action.deposit = tokio::runtime::Runtime::new() .unwrap() - .block_on(near_socialdb_client_rs::get_deposit( + .block_on(near_socialdb_client::get_deposit( &json_rpc_client, &signer_account_id, &prepopulated_unsigned_transaction.public_key, diff --git a/src/commands/account/view_account_summary/mod.rs b/src/commands/account/view_account_summary/mod.rs index e0276272d..5a97715f8 100644 --- a/src/commands/account/view_account_summary/mod.rs +++ b/src/commands/account/view_account_summary/mod.rs @@ -66,7 +66,7 @@ impl ViewAccountSummaryContext { block_reference.clone(), ) .wrap_err_with(|| {format!("Failed to fetch query for view method: 'get {account_id}/profile/**'")})? - .parse_result_from_json::() + .parse_result_from_json::() .wrap_err_with(|| { format!("Failed to parse view function call return value for {account_id}/profile.") })?; diff --git a/src/common.rs b/src/common.rs index 5260d0909..869f96268 100644 --- a/src/common.rs +++ b/src/common.rs @@ -68,7 +68,7 @@ impl std::fmt::Display for BlockHashAsBase58 { } } -pub use near_socialdb_client_rs::NearBalance; +pub use near_socialdb_client::NearBalance; pub use near_gas::NearGas; @@ -1282,9 +1282,7 @@ pub fn display_account_info( account_id: &near_primitives::types::AccountId, account_view: &near_primitives::views::AccountView, access_keys: &[near_primitives::views::AccessKeyInfoView], - optional_account_profile: Option< - &near_socialdb_client_rs::types::socialdb_types::AccountProfile, - >, + optional_account_profile: Option<&near_socialdb_client::types::socialdb_types::AccountProfile>, ) { let mut table = Table::new(); table.set_format(*prettytable::format::consts::FORMAT_NO_COLSEP);