Skip to content

feat(composable): add signer-aware Poller SDK - #966

Open
igorroncevic wants to merge 2 commits into
feat/composable-cow-poller-revoke-signaturefrom
feat/composable-cow-poller-actions
Open

feat(composable): add signer-aware Poller SDK#966
igorroncevic wants to merge 2 commits into
feat/composable-cow-poller-revoke-signaturefrom
feat/composable-cow-poller-actions

Conversation

@igorroncevic

@igorroncevic igorroncevic commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Context

The SDK design thread agreed on the same two-layer approach used by TradingSdk:

  • keep ComposableCowPoller as the low-level API for state reads, typed data, and calldata encoding;
  • add a high-level facade that can resolve a signer, sign authorizations, and submit transactions;
  • expose both direct and signature-authorized registration and revocation flows;
  • keep the Poller API generic instead of coupling it to TWAP construction.

This PR adds that high-level layer separately on top of #960.

What changed

ComposableCowPollerSdk follows the applicable TradingSdk conventions: an optional constructor adapter, a default signer with per-call overrides, named parameter objects, and transaction methods that return the submitted hash.

  • signRegister and signRevoke read the funder's current shared nonce, sign the generated EIP-712 payload, and return the exact typedData, signature, and ready-to-submit calldata.
  • register, registerWithSignature, pollFunds, revoke, and revokeWithSignature submit their corresponding Poller transactions.
  • pollerSdk.poller retains access to every low-level read and encoding primitive, so integrations can still build hooks or relay calls without submitting a transaction through the SDK.

Example

const pollerSdk = new ComposableCowPollerSdk(
  { chainId, pollerAddress, signer: funderSigner },
  adapter,
)

const authorization = await pollerSdk.signRegister({
  schedule,
  deadline,
})

// Use authorization.calldata in a hook or relay it separately.
await pollerSdk.registerWithSignature({
  schedule,
  deadline,
  signature: authorization.signature,
  signer: relayerSigner,
})

The same split applies to revocation through signRevoke and revokeWithSignature. Direct funder transactions remain available through register and revoke.

Scope

This PR deliberately does not construct TWAP orders or order hooks. It provides generic Poller actions over ComposableCowPollerSchedule; higher-level order composition can build on these primitives.

Depends on #960.

Related: TWAP for EOAs

Test

pnpm --filter @cowprotocol/sdk-composable test

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ffa14f92-0006-4086-8895-817ef29f8497

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📦 GitHub Packages Published

Last updated: Aug 7, 2026, 02:46:45 PM UTC

The following packages have been published to GitHub Packages with pre-release version pr-966-9e3b0835:

  • @cowprotocol/cow-sdk@9.2.6-pr-966-9e3b0835.0
  • @cowprotocol/sdk-app-data@6.0.0-pr-966-9e3b0835.0
  • @cowprotocol/sdk-bridging@4.4.2-pr-966-9e3b0835.0
  • @cowprotocol/sdk-common@0.12.1-pr-966-9e3b0835.0
  • @cowprotocol/sdk-composable@1.3.0-pr-966-9e3b0835.0
  • @cowprotocol/sdk-config@2.4.0-pr-966-9e3b0835.0
  • @cowprotocol/sdk-contracts-ts@3.3.3-pr-966-9e3b0835.0
  • @cowprotocol/sdk-cow-shed@0.4.5-pr-966-9e3b0835.0
  • @cowprotocol/sdk-ethers-v5-adapter@0.4.11-pr-966-9e3b0835.0
  • @cowprotocol/sdk-ethers-v6-adapter@0.4.11-pr-966-9e3b0835.0
  • @cowprotocol/sdk-flash-loans@3.3.3-pr-966-9e3b0835.0
  • @cowprotocol/sdk-order-book@4.0.2-pr-966-9e3b0835.0
  • @cowprotocol/sdk-order-signing@1.1.6-pr-966-9e3b0835.0
  • @cowprotocol/sdk-subgraph@1.2.1-pr-966-9e3b0835.0
  • @cowprotocol/sdk-trading@2.2.6-pr-966-9e3b0835.0
  • @cowprotocol/sdk-viem-adapter@0.3.26-pr-966-9e3b0835.0
  • @cowprotocol/sdk-weiroll@0.2.2-pr-966-9e3b0835.0

Installation

These packages require authentication to install from GitHub Packages. First, create a .npmrc file:

# Create .npmrc file in your project root
echo "@cowprotocol:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN" >> .npmrc

To get your GitHub token:

  1. Go to https://github.com/settings/tokens
  2. Click "Generate new token (classic)"
  3. Check only the "read:packages" scope
  4. Copy the token and replace YOUR_GITHUB_TOKEN in the .npmrc file

Then install any of the packages above, either by exact version (i.e. @cowprotocol/cow-sdk@9.2.6-pr-966-9e3b0835.0) or more conveniently by using the tag (@cowprotocol/cow-sdk@pr-966):

# Yarn
yarn add npm:@cowprotocol/cow-sdk@pr-966

# pnpm
pnpm install npm:@cowprotocol/cow-sdk@pr-966

# NPM
npm install npm:@cowprotocol/cow-sdk@pr-966

Update to the latest version (only if you used the tag)

Every commit will publish a new package. To upgrade to the latest version, run:

# Yarn
yarn upgrade @cowprotocol/cow-sdk

# pnpm
pnpm update @cowprotocol/cow-sdk

# NPM
npm update @cowprotocol/cow-sdk

View Packages

You can view the published packages at: https://github.com/cowprotocol/cow-sdk/packages

@igorroncevic
igorroncevic requested review from a team and anxolin August 7, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant