connectAccount
Connect account for signing transactions. Accepts either a private key or wallet provider (EIP-1193). Automatically performs SIWE authentication.
Signature
connectAccount(account: string | any, chainId?: SupportedChainId): Promise<Address>
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
account | `string | any` | ✅ |
chainId | SupportedChainId | ❌ | Target chain ID (default: 8453 - Base) |
Returns
The connected EOA address
Return Type
type Address = `0x${string}`;
Example
// With private key
const address = await sdk.connectAccount('0x...');
// With wallet provider (e.g., from wagmi, web3-react)
const provider = await connector.getProvider();
const address = await sdk.connectAccount(provider, 8453);