Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-docs-quality-audit-1774257282.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Ethers v6 Adapter
Overview
The Ethers v6 Adapter integrates the CoW Protocol SDK with ethers.js v6, enabling usage of all SDK packages with ethers v6 providers and signers.Installation
Initialization
Create an adapter instance by providing a provider and optional signer:provider: An ethers v6 Provider instance or RPC URL string (automatically creates JsonRpcProvider)signer: Optional ethers v6 Signer instance or private key string
Core Properties
- signer: Returns the EthersV6SignerAdapter instance; throws error if unavailable
- utils: Utility methods for working with ethers v6 types and contracts
- TypedDataVersionedSigner: EIP-712 signer with version support
- TypedDataV3Signer: EIP-712 version 3 legacy signer
- IntChainIdTypedDataV4Signer: EIP-712 version 4 signer with MetaMask compatibility fixes
Available Methods
Chain & State Methods
getChainId(): Returns promise resolving to chain ID numbergetCode(address): Retrieves bytecode at specified addressgetTransactionReceipt(hash): Fetches transaction receipt or nullgetStorageAt(address, slot): Returns storage value at positiongetBlock(blockTag, provider?): Retrieves block information
Contract Interaction
call(txParams, provider?): Executes read-only contract callreadContract({address, abi, functionName, args, provider?}): Reads contract functiongetContract(address, abi): Creates compatible contract instance
Signer & Provider Management
setSigner(signer): Updates the signersetProvider(provider): Updates the providersignerOrNull(): Returns signer adapter or nullcreateSigner(signerOrPrivateKey): Creates new signer adapter