# Smart Wallets

Integrated Alchemy Account Kit support for smart contract wallets.

## Generate Private Key

```typescript
const { privateKey, address } = await orda.smartWallets.generatePrivateKey();
console.log('Private Key:', privateKey);
console.log('EOA Address:', address);
```

## Validate Private Key

```typescript
const isValid = orda.smartWallets.validatePrivateKey(privateKey);
```

## Get Address from Private Key

```typescript
const address = await orda.smartWallets.getAddressFromPrivateKey(privateKey);
```

## Create Project Wallet

For project-level smart wallets:

```typescript
const wallet = await orda.smartWallets.createProjectWallet(
  'project-id',
  privateKey,
  8453,  // Chain ID (Base)
  'MODULAR_ACCOUNT_V2'  // Account type (optional)
);

console.log('Smart Wallet Address:', wallet.getAddress());
```

## Create Recipient Wallet

For recipient-specific smart wallets:

```typescript
const wallet = await orda.smartWallets.createRecipientWallet(
  'recipient-id',
  privateKey,
  8453,
  'MODULAR_ACCOUNT_V2'
);
```

## Account Types

* `MODULAR_ACCOUNT_V2` (default) - ERC-6900 modular account
* `LIGHT_ACCOUNT` - Lightweight account

## Recipient with Smart Wallet

Auto-generate smart wallet by omitting `toAddress`:

```typescript
const recipient = await orda.recipients.create({
  name: 'Smart Wallet Recipient',
  cryptoSettlementDetails: {
    toChain: '8453',
    toToken: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
    // No toAddress - smart wallet auto-generated
  }
});

console.log('Smart Wallet:', recipient.smartWallet?.address);
console.log('Private Key:', recipient.smartWallet?.privateKey);
```

## Using Alchemy API Key

Pass Alchemy API key for enhanced features:

```typescript
const orda = new OrdaSDK({
  clientId: process.env.ORDA_CLIENT_ID,
  clientSecret: process.env.ORDA_CLIENT_SECRET,
  alchemyApiKey: process.env.ALCHEMY_API_KEY
});
```


---

# 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.orda.network/developers/sdks/smart-wallets.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.
