> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct CreateAccountOptions

Module: `noir_aztec::test::helpers::test_environment`

```rust
pub struct CreateAccountOptions
{ /* private fields */ }
```

Configuration values for [`TestEnvironment::create_light_account_opts`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#create_light_account_opts). Meant to be used by calling `new` and then chaining methods setting each value, e.g.:

```rust
env.create_light_account_opts(CreateAccountOptions::new().with_secret(42).with_partial_address(1));
```

The account address is derived from both the public keys (which come from the secret) and the partial address. Setting the same secret with different partial addresses produces accounts that share master keys but have distinct addresses.

## Implementations

```rust
impl CreateAccountOptions
```

```rust
pub fn new() -> Self
```

Creates a new `CreateAccountOptions` with default values, i.e. the same as if using the `create_light_account` method instead of `create_light_account_opts`. Use the `with_secret` and `with_partial_address` methods to set the desired configuration values.

```rust
pub fn with_secret(&mut self, secret: Field) -> Self
```

Sets the secret used for key derivation. The secret affects the account's public keys and therefore its address: accounts created with different secrets will have different keys and addresses.

```rust
pub fn with_partial_address(&mut self, partial_address: Field) -> Self
```

Sets the partial address used for address derivation. The partial address affects the resulting account address but not its keys: accounts created with the same secret but different partial addresses share master keys while having different addresses.
