# Account

## Account <a href="#account" id="account"></a>

The SDK provides an `Account` class for creating and managing accounts on Endless network.

Due to ZKLogin and MultiSign Account design, Endless support two types of account:

* `SingleSender` supports `ED25519` signer authenticator
* `MultiAuthKeyAccount` supports one private key holding multi signers authenticator

The `Account` class supports different static methods to generate and/or derive an account

* `Account.generate()`
* `Account.fromPrivateKey()`
* `Account.fromDerivationPath()`

### Generate a new account <a href="#generate-a-new-account" id="generate-a-new-account"></a>

To generate a new account (or a new key pair), the SDK provides a `generate()` static method on the `Account` class.

Account generation supports `Ed25519` key schemes.

```js
const account = Account.generate(); 
```

{% hint style="info" %}
Creating an account with the SDK creates it locally, to create the account on chain we should fund it.
{% endhint %}

```js
const transaction = await endless.fundAccount({
  signer: account
});
```

### Derive an account from private key <a href="#derive-an-account-from-private-key" id="derive-an-account-from-private-key"></a>

The SDK supports deriving an account from a private key with `fromPrivateKey()` static method. This method uses a local calculation and therefore is used to derive an `Account` that has not had its authentication key rotated.

```js
// to derive an account with Ed25519 key scheme
const privateKey = new Ed25519PrivateKey(privateKeyBytes);
const account = Account.fromPrivateKey({ privateKey });
```

### Derive an account from derivation path <a href="#derive-an-account-from-derivation-path" id="derive-an-account-from-derivation-path"></a>

The SDK supports deriving an account from derivation path with `fromDerivationPath()` static method.

```js
// to derive an account with mnemonic and path
const derivationPath = `m/44'/637'/0'/0'/0'`;
const mnemonicWordsStr = "salt purpose ......";

const account = Account.fromDerivationPath({
  path,
  mnemonicWordsStr,
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.endless.link/endless/devbuild/build/endless-sdks/typescript-sdk/account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
