> For the complete documentation index, see [llms.txt](https://0xshiven.gitbook.io/guardian-smart-wallet-contracts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xshiven.gitbook.io/guardian-smart-wallet-contracts/guides/account-guardian.md).

# Account Guardian

The **Account** **Guardian** contract allows smart wallet account holders to manage their account guardians.

{% hint style="info" %}
&#x20;Since the **Account Guardian** contract handles individual accounts' guardian operations, a new instance of the **Account Guardian** contract is deployed on every new smart wallet account.
{% endhint %}

{% hint style="info" %}
You can refer to the [Guardian smart wallet architecture ](/guardian-smart-wallet-contracts/overview/architecture.md)to understand the high-level inter-dependencies between various contracts.
{% endhint %}

### **Usage**

#### On the client side:

Use the `AccountGuardian` contract address directly on the client side to interact with the deployed contract.

#### In smart-contract projects:

```jsx
import {AccountGuardian} from "@guardian-wallet/contracts/utils/AccountGuardian.sol"
```

### **Functions**

```jsx
function addGuardian(address guardian)
```

Add guardians for your smart wallet.

{% hint style="warning" %}
Can only be called by the smart wallet account, AccountLock and AccountRecovery.
{% endhint %}

**Params:**

`guardian` the verified guardian address being added as an account guardian.

***

```solidity
function removeGuardian(address guardian)
```

A user will be able to remove allotted guardian(s) from their smart-wallet guardian list. The address should be a registered guardian for the account.&#x20;

{% hint style="warning" %}
Can only be called by the smart wallet account, AccountLock and AccountRecovery.
{% endhint %}

**Params:**

`guardian` address of the guardian the user wishes to remove.

***

```solidity
function getAllGuardians() -> address[] memory
```

Returns a list of all added account guardians for the sender’s smart wallet account.&#x20;

{% hint style="warning" %}
Can only be called by the smart wallet account, AccountLock and AccountRecovery.
{% endhint %}

**Returns**

`address[]` List of account guardians of the sender’s smart wallet.

***

```solidity
function isAccountGuardian(address guardian) -> bool
```

Returns a boolean value indicating if the guardian is the sender’s guardian or not.&#x20;

{% hint style="warning" %}
Can only be called by the smart wallet account, AccountLock and AccountRecovery.
{% endhint %}

**Params:**

`guardian` guardian to be checked for&#x20;

**Returns:**

`bool` Bool flag indicating if the guardian is guarding the account

***

```solidity
function getTotalGuardians() -> uint256
```

This will return the number of guardians allotted for a smart wallet account. Will be used when creating shards of the account's private key.&#x20;

**Returns:**

`uint256` No. of allotted account guardians

***
