Function createWallet
Parameters
Optionalconfig: WalletConfigOptional wallet configuration
privateKey
Private key (required in Node.js, optional in browser)
pemContent
PEM file content (alternative to privateKey)
pemPassword
Password for encrypted PEM files
network
Network to connect to
provider
Custom provider instance
Returns Promise<Wallet>
Wallet instance appropriate for the current environment
Convenience function for creating environment-appropriate wallets
This is a simplified wrapper around WalletFactory for quick wallet creation. It automatically detects the environment and creates the appropriate wallet type.
When to use:
When to use WalletFactory instead: