> For the complete documentation index, see [llms.txt](https://fifo-docs.gitbook.io/colibri/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fifo-docs.gitbook.io/colibri/colibri-core/account.md).

# Account

The Account module provides the `NativeAccount` class for working with Stellar accounts.

## NativeAccount

Create an account instance from an address:

```typescript
import { NativeAccount } from "@colibri/core";

const account = NativeAccount.fromAddress("GABC...XYZ");
```

### Methods

#### address()

Get the account's public key:

```typescript
account.address(); // "GABC...XYZ"
```

#### muxedAddress(id)

Generate a muxed address (M...) for this account:

```typescript
const muxed = account.muxedAddress("12345");
```

#### withMasterSigner(signer)

Attach a [`KeypairSigner`](/colibri/colibri-core/signer.md#signer-capabilities) to the account. [`LocalSigner`](/colibri/colibri-core/signer/local-signer.md) implements this complete Ed25519 signer capability:

```typescript
import { LocalSigner } from "@colibri/core";

const signer = LocalSigner.fromSecret("S...");
const signableAccount = account.withMasterSigner(signer);
```

#### signer()

Get the attached signer (throws if none attached):

```typescript
const signer = signableAccount.signer();
```

### Static Methods

#### fromMasterSigner(signer)

Create an account directly from a [`KeypairSigner`](/colibri/colibri-core/signer.md#signer-capabilities):

```typescript
import { LocalSigner, NativeAccount } from "@colibri/core";

const signer = LocalSigner.fromSecret("S...");
const account = NativeAccount.fromMasterSigner(signer);
```

## Errors

See [every code for this context](/colibri/reference/errors/core-account-native.md) and the [error-handling guide](/colibri/colibri-core/error.md). Failures from lower-level processes can retain their original context and code.
