Skip to content

Commit

Permalink
Merge pull request #2 from ghimire007/patch-2
Browse files Browse the repository at this point in the history
Update lock.md
  • Loading branch information
ghimire007 authored Sep 4, 2023
2 parents 7d8ec43 + 136da78 commit 09217c0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/2.develop/lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,47 @@ id: lock
title: Locking Accounts
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Removing all [full access keys](../4.tools/cli.md#near-delete-key-near-delete-key) from an account will effectively **lock it**.

When an account is locked nobody can perform transactions in the account's name (e.g. update the code or transfer money).

#### How to Lock an Account
<Tabs className="language-tabs" groupId="code-tabs">
<TabItem value="Near-CLI">

```bash
near keys <dev-account>
# result: [access_key: {"nonce": ..., "public_key": '<key>'}]

near delete-key <dev-account> '<key>'
```
</TabItem>
<TabItem value="Near-CLI-rs">

```bash
near account list-keys <dev-account> network-config testnet now
# result:

+---+------------+-------+-------------+
| # | Public Key | Nonce | Permissions |
+---+------------+-------+-------------+
.. '<key>' ... ...
+---+------------+-------+-------------+

near account delete-key <dev-account> '<key>' network-config testnet sign-with-keychain send

```



</TabItem>
</Tabs>




#### Why Locking an Account
Locking an account brings more reassurance to end-users, since they know no external actor will be able to manipulate the account's
Expand Down

0 comments on commit 09217c0

Please sign in to comment.