# IPersonalAccount

> Flare Smart Accounts IPersonalAccount interface reference.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/smart-accounts/reference/IPersonalAccount

Interface for the `PersonalAccount` contract — Flare account abstraction for an XRPL address, controller entirely by that address.

Sourced from `IPersonalAccount.sol` on [GitHub](https://github.com/flare-foundation/flare-smart-accounts/blob/main/contracts/userInterfaces/IPersonalAccount.sol).

* * *

## View Functions[​](#view-functions "Direct link to View Functions")

### `xrplOwner`[​](#xrplowner "Direct link to xrplowner")

Returns the XRPL owner address associated with this personal account.

```
function xrplOwner() external view returns (string memory);
```

Smart account detection

If a contract at a given Flare address returns an XRPL account when the `xrplOwner()` function is called, then it is a smart account. Use this to [detect whether an arbitrary Flare address is a smart account](/smart-accounts/guides/typescript-viem/state-lookup-ts#checking-if-a-flare-address-is-a-smart-account).

### `controllerAddress`[​](#controlleraddress "Direct link to controlleraddress")

Returns the `MasterAccountController` address that manages this personal account.

```
function controllerAddress() external view returns (address);
```

### `implementation`[​](#implementation "Direct link to implementation")

Returns the implementation contract address for this personal account (used by the beacon proxy pattern).

```
function implementation() external view returns (address);
```

## State-Changing Functions[​](#state-changing-functions "Direct link to State-Changing Functions")

### `executeUserOp`[​](#executeuserop "Direct link to executeuserop")

Executes a series of arbitrary calls from this personal account as a single user operation. Each call is made with the personal account as `msg.sender`, allowing the account to interact with any contract on Flare. The function is `payable` so the account can forward FLR alongside the calls.

```
function executeUserOp(    Call[] calldata _calls)    external payable;
```

Parameters:

-   `_calls`: Array of [`Call`](#call) structs describing each call to execute.

Reverts with [`CallFailed(index, returnData)`](#callfailed) if any call in the array fails, where `index` identifies the failing call and `returnData` is the raw revert data returned by the target.

## Structs[​](#structs "Direct link to Structs")

### `Call`[​](#call "Direct link to call")

Describes a single call dispatched by [`executeUserOp`](#executeuserop).

```
struct Call {    address target;    uint256 value;    bytes data;}
```

Fields:

-   `target`: The target contract address to call.
-   `value`: The amount of FLR (in wei) to send with the call.
-   `data`: The ABI-encoded calldata to pass to the target.

## Errors[​](#errors "Direct link to Errors")

### `CallFailed`[​](#callfailed "Direct link to callfailed")

Thrown by [`executeUserOp`](#executeuserop) when one of the underlying calls reverts.

```
error CallFailed(uint256 index, bytes returnData);
```

Parameters:

-   `index`: The index of the failing call within the `_calls` array.
-   `returnData`: The raw return data from the failed call.

### `InsufficientFundsForCollateralReservation`[​](#insufficientfundsforcollateralreservation "Direct link to insufficientfundsforcollateralreservation")

Thrown when the value sent with a collateral reservation is not enough to cover both the collateral reservation fee and the executor fee.

```
error InsufficientFundsForCollateralReservation(    uint256 collateralReservationFee,    uint256 executorFee);
```

Parameters:

-   `collateralReservationFee`: The required collateral reservation fee.
-   `executorFee`: The required executor fee.

### `InsufficientFundsForRedeem`[​](#insufficientfundsforredeem "Direct link to insufficientfundsforredeem")

Thrown when the value sent with a redeem operation is not enough to cover the executor fee.

```
error InsufficientFundsForRedeem(uint256 executorFee);
```

Parameters:

-   `executorFee`: The required executor fee.

### `OnlyController`[​](#onlycontroller "Direct link to onlycontroller")

Thrown when a function restricted to the [`MasterAccountController`](/smart-accounts/reference/IMasterAccountController) is called by any other address.

```
error OnlyController();
```

### `AlreadyInitialized`[​](#alreadyinitialized "Direct link to alreadyinitialized")

Thrown when the personal account initializer is called more than once.

```
error AlreadyInitialized();
```

### `InvalidControllerAddress`[​](#invalidcontrolleraddress "Direct link to invalidcontrolleraddress")

Thrown when the controller address provided at initialization is the zero address or otherwise invalid.

```
error InvalidControllerAddress();
```

### `InvalidXrplOwner`[​](#invalidxrplowner "Direct link to invalidxrplowner")

Thrown when the XRPL owner string provided at initialization is empty or otherwise invalid.

```
error InvalidXrplOwner();
```

### `AgentNotAvailable`[​](#agentnotavailable "Direct link to agentnotavailable")

Thrown when the FAssets agent selected for a minting or redemption operation is not available.

```
error AgentNotAvailable();
```

### `ApprovalFailed`[​](#approvalfailed "Direct link to approvalfailed")

Thrown when an ERC-20 approval issued by the personal account (for example, when granting a vault permission to spend FXRP) returns `false` or reverts.

```
error ApprovalFailed();
```

## Events[​](#events "Direct link to Events")

### `CollateralReserved`[​](#collateralreserved "Direct link to collateralreserved")

Emitted when collateral is reserved for minting FXRP.

```
event CollateralReserved(    address agentVault,    uint256 lots,    address executor,    uint256 executorFee,    uint256 collateralReservationId);
```

Parameters:

-   `agentVault`: The agent vault address.
-   `lots`: The number of lots that will be minted.
-   `executor`: The executor address.
-   `executorFee`: The fee paid to the executor.
-   `collateralReservationId`: The ID of the collateral reservation.

info

This event does not include the necessary information to complete the minting process. When performing minting, the [`CollateralReserved`](/fassets/reference/IAssetManagerEvents#collateralreserved) event emitted by the `IAssetManager` contract should be observed instead.

### `FXrpTransferred`[​](#fxrptransferred "Direct link to fxrptransferred")

Emitted when a transfer of FXRP is made from the personal account.

```
event FXrpTransferred(    address to,    uint256 amount);
```

Parameters:

-   `to`: The recipient address.
-   `amount`: The amount of FXRP transferred.

### `FXrpRedeemed`[​](#fxrpredeemed "Direct link to fxrpredeemed")

Emitted when a FXRP redemption is performed.

```
event FXrpRedeemed(    uint256 lots,    uint256 amount,    address executor,    uint256 executorFee);
```

Parameters:

-   `lots`: The number of lots redeemed.
-   `amount`: The amount redeemed.
-   `executor`: The executor address.
-   `executorFee`: The fee paid to the executor.

### `Approved`[​](#approved "Direct link to approved")

Emitted when a token approval is made for a vault.

```
event Approved(    address fxrp,    address vault,    uint256 amount);
```

Parameters:

-   `fxrp`: The FXRP token address.
-   `vault`: The vault address.
-   `amount`: The approved amount.

### `Deposited`[​](#deposited "Direct link to deposited")

Emitted when a deposit is made to a vault.

```
event Deposited(    address indexed vault,    uint256 amount,    uint256 shares);
```

Parameters:

-   `vault`: The vault address.
-   `amount`: The amount deposited.
-   `shares`: The number of shares received.

### `Redeemed`[​](#redeemed "Direct link to redeemed")

Emitted when a redeem is made from a vault.

```
event Redeemed(    address indexed vault,    uint256 amount,    uint256 shares);
```

Parameters:

-   `vault`: The vault address.
-   `amount`: The amount redeemed.
-   `shares`: The number of shares burned.

### `WithdrawalClaimed`[​](#withdrawalclaimed "Direct link to withdrawalclaimed")

Emitted when a withdrawal claim is made from a vault.

```
event WithdrawalClaimed(    address indexed vault,    uint256 period,    uint256 amount);
```

Parameters:

-   `vault`: The vault address.
-   `period`: The period for which the claim is made.
-   `amount`: The amount claimed.

### `RedeemRequested`[​](#redeemrequested "Direct link to redeemrequested")

Emitted when a redeem request is made from a vault.

```
event RedeemRequested(    address indexed vault,    uint256 shares,    uint256 claimableEpoch,    uint256 year,    uint256 month,    uint256 day);
```

Parameters:

-   `vault`: The vault address.
-   `shares`: The number of shares to redeem.
-   `claimableEpoch`: The epoch when the claim becomes available.
-   `year`: The year of the claimable date.
-   `month`: The month of the claimable date.
-   `day`: The day of the claimable date.

### `Claimed`[​](#claimed "Direct link to claimed")

Emitted when a claim is made for a specific date.

```
event Claimed(    address indexed vault,    uint256 year,    uint256 month,    uint256 day,    uint256 shares,    uint256 amount);
```

Parameters:

-   `vault`: The vault address.
-   `year`: The year of the claim.
-   `month`: The month of the claim.
-   `day`: The day of the claim.
-   `shares`: The number of shares claimed.
-   `amount`: The amount claimed.

### `SwapExecuted`[​](#swapexecuted "Direct link to swapexecuted")

Emitted when a token swap is executed.

```
event SwapExecuted(    address indexed tokenIn,    address indexed tokenOut,    uint256 amountIn,    uint256 amountOut);
```

Parameters:

-   `tokenIn`: The input token address.
-   `tokenOut`: The output token address.
-   `amountIn`: The amount of input tokens.
-   `amountOut`: The amount of output tokens received.
