Smart Wallets

Integrated Alchemy Account Kit support for smart contract wallets.

Generate Private Key

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

Validate Private Key

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

Get Address from Private Key

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

Create Project Wallet

For project-level smart wallets:

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:

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:

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:

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