diff --git a/docs/GUIDE.en.md b/docs/GUIDE.en.md
index 3ae80d0fb..7a21a5c19 100644
--- a/docs/GUIDE.en.md
+++ b/docs/GUIDE.en.md
@@ -97,6 +97,7 @@ View account details ([View properties for an account](#view-account-summary---v
- [list-keys](#list-keys---View-a-list-of-access-keys-of-an-account)
- [add-key](#add-key---Add-an-access-key-to-an-account)
- [delete-key](#delete-key---Delete-an-access-key-from-an-account)
+- [manage-storage-deposit](#manage-storage-deposit---Storage-management-deposit-withdrawal-balance-review)
#### view-account-summary - View properties for an account
@@ -314,6 +315,72 @@ The data for the access key is saved in macOS Keychain
+#### export-account - Export existing account
+
+- [using-web-wallet](#using-web-wallet---Export-existing-account-using-NEAR-Wallet-aka-sign-in)
+- [using-seed-phrase](#using-seed-phrase---Export-existing-account-using-a-seed-phrase)
+- [using-private-key](#using-private-key---Export-existing-account-using-a-private-key)
+
+
+#### using-web-wallet - Export existing account using NEAR Wallet
+
+To export an existing account, enter in the terminal command line:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-web-wallet \
+ network-config testnet
+```
+
+You will be redirected to the browser for authorization.
+Default wallet url is https://app.mynearwallet.com/ (for testnet - https://testnet.mynearwallet.com/). But if you want to change to a different wallet url, you can use `--wallet-url` option:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-web-wallet \
+ network-config testnet\
+ --wallet-url 'https://wallet.testnet.near.org/'
+```
+Demonstration of the command in interactive mode
+
+
+
+
+
+#### using-seed-phrase - Export existing account using a seed phrase
+
+To export an existing account, enter in the terminal command line:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-seed-phrase \
+ network-config testnet
+```
+
+The result of this command will be as follows:
+
+```txt
+Here is the secret recovery seed phrase for account : "feature army carpet ..." (HD Path: m/44'/397'/0').
+```
+
+
+#### using-private-key - Export existing account using a private key
+
+To export an existing account, enter in the terminal command line:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-private-key \
+ network-config testnet
+```
+
+The result of this command will be as follows:
+
+```txt
+Here is the private key for account : ed25519:4TKr1c7p...y7p8BvGdB
+```
+
+
#### create-account - Create a new account
- sponsor-by-linkdrop (Not implemented yet)
@@ -871,6 +938,93 @@ https://explorer.testnet.near.org/transactions/6S7bJ76QNFypUvP7PCB1hkLM7X5GxPxP2
+#### manage-storage-deposit - Storage management: deposit, withdrawal, balance review
+
+- [view-balance](#view-balance---View-storage-balance-for-an-account)
+- [deposit](#deposit---Make-a-storage-deposit-for-the-account)
+- [withdraw](#withdraw---Withdraw-a-deposit-from-storage-for-an-account-ID)
+
+##### view-balance - View storage balance for an account
+
+To view the account balance on the contract on the last block, you must enter in the terminal command line:
+
+```txt
+near account \
+ manage-storage-deposit v1.social08.testnet \
+ view-balance volodymyr.testnet \
+ network-config testnet \
+ now
+```
+
+The result of this command will be as follows:
+
+```txt
+storage balance for :
+ available: 1.6 MB (15.878059999854543210876557 NEAR [ 15878059999854543210876557 yoctoNEAR])
+ total: 1.6 MB (16.238949999854543210876557 NEAR [ 16238949999854543210876557 yoctoNEAR])
+```
+
+
+Demonstration of the command in interactive mode
+
+
+
+
+
+##### deposit - Make a storage deposit for the account
+
+To add a deposit to the account balance under the contract, you must enter in the terminal command line:
+
+```txt
+near account \
+ manage-storage-deposit v1.social08.testnet \
+ deposit volodymyr.testnet '1 NEAR' \
+ sign-as fro_volod.testnet \
+ network-config testnet \
+ sign-with-macos-keychain \
+ send
+```
+
+The result of this command will be as follows:
+
+```txt
+ has successfully added a deposit of 1 NEAR to on contract .
+```
+
+
+Demonstration of the command in interactive mode
+
+
+
+
+
+##### withdraw - Withdraw a deposit from storage for an account ID
+
+To withdraw funds from the account balance under the contract, you must enter in the terminal command line:
+
+```txt
+near account \
+ manage-storage-deposit v1.social08.testnet \
+ withdraw '0.5 NEAR' \
+ sign-as volodymyr.testnet \
+ network-config testnet \
+ sign-with-keychain \
+ send
+```
+
+The result of this command will be as follows:
+
+```txt
+ has successfully withdraw 0.5 NEAR from .
+```
+
+
+Demonstration of the command in interactive mode
+
+
+
+
+
### tokens - Manage token assets such as NEAR, FT, NFT
- [send-near](#send-near---The-transfer-is-carried-out-in-NEAR-tokens)
- [send-ft](#send-ft---The-transfer-is-carried-out-in-FT-tokens)
diff --git a/docs/GUIDE.ru.md b/docs/GUIDE.ru.md
index 568f6b498..c4f2d59f0 100644
--- a/docs/GUIDE.ru.md
+++ b/docs/GUIDE.ru.md
@@ -89,12 +89,14 @@ near --offline tokens \
Просмотреть сведения об аккаунте ([View properties for an account](#view-account-summary---view-properties-for-an-account)) и просмотреть ключи доступа к аккаунту ([View a list of access keys of an account](#list-keys---View-a-list-of-access-keys-of-an-account)) возможно на текущий момент времени (***now***) и на определеный момент в прошлом, указав блок (***at-block-height*** или ***at-block-hash***). На примерах ниже показаны варианты применения этих режимов.
- [view-account-summary](#view-account-summary---View-properties-for-an-account)
-- [import-account](#import-account---import-existing-account-aka-sign-in)
+- [import-account](#import-account---Import-existing-account-aka-sign-in)
+- [export-account](#export-account---Export-existing-account)
- [create-account](#create-account---Create-a-new-account)
- [delete-account](#delete-account---Delete-an-account)
- [list-keys](#list-keys---View-a-list-of-access-keys-of-an-account)
- [add-key](#add-key---Add-an-access-key-to-an-account)
- [delete-key](#delete-key---Delete-an-access-key-from-an-account)
+- [manage-storage-deposit](#manage-storage-deposit---Storage-management-deposit-withdrawal-balance-review)
#### view-account-summary - View properties for an account
@@ -313,6 +315,72 @@ The data for the access key is saved in macOS Keychain
+#### export-account - Export existing account
+
+- [using-web-wallet](#using-web-wallet---Export-existing-account-using-NEAR-Wallet-aka-sign-in)
+- [using-seed-phrase](#using-seed-phrase---Export-existing-account-using-a-seed-phrase)
+- [using-private-key](#using-private-key---Export-existing-account-using-a-private-key)
+
+
+#### using-web-wallet - Export existing account using NEAR Wallet
+
+Для экспорта существующего аккаунта необходимо ввести в командной строке терминала:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-web-wallet \
+ network-config testnet
+```
+
+Вы будете перенаправлены браузер.
+По умолчанию - это https://app.mynearwallet.com/ (для testnet - https://testnet.mynearwallet.com/). Но вы можете изменить адрес для авторизации с помощью флага `--wallet-url`:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-web-wallet \
+ network-config testnet\
+ --wallet-url 'https://wallet.testnet.near.org/'
+```
+Демонстрация работы команды в интерактивном режиме
+
+
+
+
+
+#### using-seed-phrase - Export existing account using a seed phrase
+
+Для экспорта существующего аккаунта необходимо ввести в командной строке терминала:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-seed-phrase \
+ network-config testnet
+```
+
+Результат выполнения команды
+
+```txt
+Here is the secret recovery seed phrase for account : "feature army carpet ..." (HD Path: m/44'/397'/0').
+```
+
+
+#### using-private-key - Export existing account using a private key
+
+Для экспорта существующего аккаунта необходимо ввести в командной строке терминала:
+```txt
+near account \
+ export-account volodymyr.testnet \
+ using-private-key \
+ network-config testnet
+```
+
+Результат выполнения команды
+
+```txt
+Here is the private key for account : ed25519:4TKr1c7p...y7p8BvGdB
+```
+
+
#### create-account - Create a new account
- sponsor-by-linkdrop (Находится в разработке)
@@ -872,6 +940,93 @@ https://explorer.testnet.near.org/transactions/6S7bJ76QNFypUvP7PCB1hkLM7X5GxPxP2
+#### manage-storage-deposit - Storage management: deposit, withdrawal, balance review
+
+- [view-balance](#view-balance---View-storage-balance-for-an-account)
+- [deposit](#deposit---Make-a-storage-deposit-for-the-account)
+- [withdraw](#withdraw---Withdraw-a-deposit-from-storage-for-an-account-ID)
+
+##### view-balance - View storage balance for an account
+
+Для просмотра баланса аккаунта на контракте на последнем блоке необходимо ввести в командной строке терминала:
+
+```txt
+near account \
+ manage-storage-deposit v1.social08.testnet \
+ view-balance volodymyr.testnet \
+ network-config testnet \
+ now
+```
+
+Результат выполнения команды
+
+```txt
+storage balance for :
+ available: 1.6 MB (15.878059999854543210876557 NEAR [ 15878059999854543210876557 yoctoNEAR])
+ total: 1.6 MB (16.238949999854543210876557 NEAR [ 16238949999854543210876557 yoctoNEAR])
+```
+
+
+Демонстрация работы команды в интерактивном режиме
+
+
+
+
+
+##### deposit - Make a storage deposit for the account
+
+Для пополнения баланса аккаунта на контракте необходимо ввести в командной строке терминала:
+
+```txt
+near account \
+ manage-storage-deposit v1.social08.testnet \
+ deposit volodymyr.testnet '1 NEAR' \
+ sign-as fro_volod.testnet \
+ network-config testnet \
+ sign-with-macos-keychain \
+ send
+```
+
+Результат выполнения команды
+
+```txt
+ has successfully added a deposit of 1 NEAR to on contract .
+```
+
+
+Демонстрация работы команды в интерактивном режиме
+
+
+
+
+
+##### withdraw - Withdraw a deposit from storage for an account ID
+
+Для вывода средств с баланса аккаунта на контракте необходимо ввести в командной строке терминала:
+
+```txt
+near account \
+ manage-storage-deposit v1.social08.testnet \
+ withdraw '0.5 NEAR' \
+ sign-as volodymyr.testnet \
+ network-config testnet \
+ sign-with-keychain \
+ send
+```
+
+Результат выполнения команды
+
+```txt
+ has successfully withdraw 0.5 NEAR from .
+```
+
+
+Демонстрация работы команды в интерактивном режиме
+
+
+
+
+
### tokens - Manage token assets such as NEAR, FT, NFT
- [send-near](#send-near---The-transfer-is-carried-out-in-NEAR-tokens)
- [send-ft](#send-ft---The-transfer-is-carried-out-in-FT-tokens)
diff --git a/src/commands/account/export_account/mod.rs b/src/commands/account/export_account/mod.rs
new file mode 100644
index 000000000..c0c0d842f
--- /dev/null
+++ b/src/commands/account/export_account/mod.rs
@@ -0,0 +1,221 @@
+use color_eyre::eyre::{ContextCompat, WrapErr};
+use strum::{EnumDiscriminants, EnumIter, EnumMessage};
+
+use crate::common::JsonRpcClientExt;
+use crate::common::RpcQueryResponseExt;
+
+mod using_private_key;
+mod using_seed_phrase;
+mod using_web_wallet;
+
+#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
+#[interactive_clap(input_context = crate::GlobalContext)]
+#[interactive_clap(output_context = ExportAccountContext)]
+pub struct ExportAccount {
+ #[interactive_clap(skip_default_input_arg)]
+ /// Which account ID should be exported?
+ account_id: crate::types::account_id::AccountId,
+ #[interactive_clap(subcommand)]
+ export_account_actions: ExportAccountActions,
+}
+
+#[derive(Debug, Clone)]
+pub struct ExportAccountContext {
+ global_context: crate::GlobalContext,
+ account_id: near_primitives::types::AccountId,
+}
+
+impl ExportAccountContext {
+ pub fn from_previous_context(
+ previous_context: crate::GlobalContext,
+ scope: &::InteractiveClapContextScope,
+ ) -> color_eyre::eyre::Result {
+ Ok(Self {
+ global_context: previous_context,
+ account_id: scope.account_id.clone().into(),
+ })
+ }
+}
+
+impl ExportAccount {
+ pub fn input_account_id(
+ context: &crate::GlobalContext,
+ ) -> color_eyre::eyre::Result