CoW Shed SDK
Pre-authorized hooks and smart account managementOverview
The CoW Shed SDK enables pre-authorization of hook calls using a deterministic smart account (cow-shed account). This allows users to sign hook calls off-chain that execute during order settlement without requiring on-chain approvals.Installation
CowShedSdk
Main SDK class for managing cow-shed accounts and signing hook calls.Constructor
AbstractProviderAdapter
Optional provider adapter (ethers v5, ethers v6, or viem). Uses global adapter if not provided.
ICoWShedOptions
CoWShedVersion
default:"latest"
CoW Shed version to use
getCowShedAccount()
Get the deterministic cow-shed account address for an owner.SupportedChainId
required
Chain ID
string
required
Owner wallet address
string
Deterministic cow-shed account address
signCalls()
Sign multiple calls and encode them into a single pre-authorized transaction.SignAndEncodeTxArgs
required
ICoWShedCall[]
required
SignerLike
Signer for the cow-shed owner account. Uses global signer if not provided.
SupportedChainId
required
Chain ID for the transaction
string
Transaction nonce. Uses current timestamp if not provided.
bigint
Transaction deadline as Unix timestamp. Uses max uint256 if not provided.
bigint
Gas limit override. Estimates gas if not provided.
bigint
Default gas limit to use if estimation fails
EcdsaSigningScheme
default:"EIP712"
Signing scheme to use
CowShedCall