@cowprotocol/hook-dapp-lib 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -170,4 +170,85 @@ export declare const hookDappsRegistry: {
170
170
  website: string;
171
171
  image: string;
172
172
  };
173
+ 'cow-sdk://flashloans/aave/v3/leverage': {
174
+ name: string;
175
+ type: string;
176
+ descriptionShort: string;
177
+ description: string;
178
+ version: string;
179
+ website: string;
180
+ image: string;
181
+ };
182
+ 'cow-sdk://flashloans/aave/v4/supply-swap/pre': {
183
+ name: string;
184
+ type: string;
185
+ descriptionShort: string;
186
+ description: string;
187
+ version: string;
188
+ website: string;
189
+ image: string;
190
+ };
191
+ 'cow-sdk://flashloans/aave/v4/supply-swap/post': {
192
+ name: string;
193
+ type: string;
194
+ descriptionShort: string;
195
+ description: string;
196
+ version: string;
197
+ website: string;
198
+ image: string;
199
+ };
200
+ 'cow-sdk://flashloans/aave/v4/borrow-swap/pre': {
201
+ name: string;
202
+ type: string;
203
+ descriptionShort: string;
204
+ description: string;
205
+ version: string;
206
+ website: string;
207
+ image: string;
208
+ };
209
+ 'cow-sdk://flashloans/aave/v4/borrow-swap/post': {
210
+ name: string;
211
+ type: string;
212
+ descriptionShort: string;
213
+ description: string;
214
+ version: string;
215
+ website: string;
216
+ image: string;
217
+ };
218
+ 'cow-sdk://flashloans/aave/v4/repay-with-collateral/pre': {
219
+ name: string;
220
+ type: string;
221
+ descriptionShort: string;
222
+ description: string;
223
+ version: string;
224
+ website: string;
225
+ image: string;
226
+ };
227
+ 'cow-sdk://flashloans/aave/v4/repay-with-collateral/post': {
228
+ name: string;
229
+ type: string;
230
+ descriptionShort: string;
231
+ description: string;
232
+ version: string;
233
+ website: string;
234
+ image: string;
235
+ };
236
+ 'cow-sdk://flashloans/aave/v4/leverage/pre': {
237
+ name: string;
238
+ type: string;
239
+ descriptionShort: string;
240
+ description: string;
241
+ version: string;
242
+ website: string;
243
+ image: string;
244
+ };
245
+ 'cow-sdk://flashloans/aave/v4/leverage/post': {
246
+ name: string;
247
+ type: string;
248
+ descriptionShort: string;
249
+ description: string;
250
+ version: string;
251
+ website: string;
252
+ image: string;
253
+ };
173
254
  };
package/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@cowprotocol/iframe-transport");var i=(o=>(o.ACTIVATE="ACTIVATE",o.CONTEXT_UPDATE="CONTEXT_UPDATE",o.ADD_HOOK="ADD_HOOK",o.EDIT_HOOK="EDIT_HOOK",o.SET_SELL_TOKEN="SET_SELL_TOKEN",o.SET_BUY_TOKEN="SET_BUY_TOKEN",o))(i||{});const r=new c.IframeTransport("cowSwapHookDapp");function g({onContext:o}){const t=window.parent,e=c.getParentOrigin(),s=new c.WidgetEthereumProvider({targetOrigin:e}),a=f(t,e);return r.listenToMessageFromWindow(window,t,i.CONTEXT_UPDATE,o,e),r.postMessageToWindow(t,i.ACTIVATE,void 0,e),{actions:a,provider:s}}function f(o,t){return{addHook(e){r.postMessageToWindow(o,i.ADD_HOOK,e,t)},editHook(e){r.postMessageToWindow(o,i.EDIT_HOOK,e,t)},setSellToken(e){r.postMessageToWindow(o,i.SET_SELL_TOKEN,e,t)},setBuyToken(e){r.postMessageToWindow(o,i.SET_BUY_TOKEN,e,t)}}}var n=(o=>(o.INTERNAL="INTERNAL",o.IFRAME="IFRAME",o))(n||{}),w=(o=>(o.EOA="EOA",o.SMART_CONTRACT="SMART_CONTRACT",o))(w||{});const y=64,l="cow-swap://libs/hook-dapp-lib/permit",d="cow-swap://libs/hook-dapp-lib/twap/eoa-poll-funds",p={BUILD_CUSTOM_HOOK:{type:"INTERNAL",name:"Build your own hook",descriptionShort:"Call any smart contract with your own parameters",description:"Didn't find a suitable hook? You can always create your own! To do this, you need to specify which smart contract you want to call, the parameters for the call and the gas limit.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/apps/cowswap-frontend/src/modules/hooksStore/dapps/BuildHookApp/build.png",version:"v0.1.0",website:"https://docs.cow.fi/cow-protocol/tutorials/hook-dapp"},CLAIM_GNO_FROM_VALIDATORS:{type:"INTERNAL",name:"Claim GNO from validators",descriptionShort:"Withdraw rewards from your Gnosis validators.",description:"This hook allows you to withdraw rewards from your Gnosis Chain validators through CoW Swap. It automates the process of interacting with the Gnosis Deposit Contract, enabling you to claim any available rewards directly to your specified withdrawal address. The hook monitors your validator's accrued rewards and triggers the claimWithdrawals function when rewards are ready for withdrawal. This simplifies the management of Gnosis validator earnings without requiring ready for withdrawal. This simplifies the management of Gnosis validator earnings without requiring manual contract interaction, providing a smoother and more efficient experience for users.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/897ce91ca60a6b2d3823e6a002c3bf64c5384afe/libs/assets/src/cow-swap/network-gnosis-chain-logo.svg",version:"v0.1.1",website:"https://www.gnosis.io",conditions:{supportedNetworks:[100],position:"pre"}},[l]:{type:"INTERNAL",name:"Permit a token",descriptionShort:"Permit an address to spend one token on your behalf.",description:"This hook allows you to permit an address to spend your tokens on your behalf. This is useful for allowing a smart contract to spend your tokens without needing to approve each transaction.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/apps/cowswap-frontend/src/modules/hooksStore/dapps/PermitHookApp/icon.png",version:"v0.1.0",website:"https://docs.cow.fi/cow-protocol/tutorials/hook-dapp",conditions:{walletCompatibility:["EOA"],supportedNetworks:[11155111]}},CLAIM_COW_AIRDROP:{type:"INTERNAL",name:"Claim COW Airdrop",descriptionShort:"Retrieve COW tokens before or after a swap.",description:"Effortless Airdrop Claims! The Claim COW Airdrop feature simplifies the process of collecting free COW tokens before or after your swap, seamlessly integrating into the CoW Swap platform. Whether you're claiming new airdrops or exploring CoW on a new network, this tool ensures you get your rewards quickly and easily.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/897ce91ca60a6b2d3823e6a002c3bf64c5384afe/apps/cowswap-frontend/src/modules/hooksStore/dapps/AirdropHookApp/airdrop.svg",version:"v0.1.0",website:"https://github.com/bleu/cow-airdrop-contract-deployer",conditions:{supportedNetworks:[11155111]}},CLAIM_LLAMAPAY_VESTING:{type:"IFRAME",name:"Claim LlamaPay Vesting Hook",description:"The Claim LlamaPay Vesting Hook is a powerful and user-friendly feature designed to streamline the process of claiming funds from LlamaPay vesting contracts. This tool empowers users to easily access and manage their vested tokens, ensuring a smooth and efficient experience in handling time-locked assets.",descriptionShort:"Claim your LlamaPay vesting contract funds",image:"https://cow-hooks-dapps-claim-vesting.vercel.app/llama-pay-icon.png",version:"0.1.0",website:"https://github.com/bleu/cow-hooks-dapps",url:"https://cow-hooks-dapps-claim-vesting.vercel.app",conditions:{supportedNetworks:[1,100,42161],walletCompatibility:["EOA"]}},CREATE_LLAMAPAY_VESTING:{type:"IFRAME",name:"Create LlamaPay Vesting",descriptionShort:"Create a LlamaPay vesting contract",description:"This hook allows you to easily set up vesting contracts with LlamaPay. Enter the recipient’s address or ENS name, then choose how much to transfer: the token buy will be automatically detected by the hook and the contracts will be linked to your LlamaPay dashboard for seamless tracking.",version:"0.1.0",website:"https://llamapay.io/vesting",image:"https://cow-hooks-dapps-create-vesting.vercel.app/llama-pay-icon.png",url:"https://cow-hooks-dapps-create-vesting.vercel.app",conditions:{position:"post",walletCompatibility:["EOA"],supportedNetworks:[1,100,42161]}},UNI_V2_WITHDRAW:{type:"IFRAME",name:"Withdraw Uniswap v2 Liquidity",descriptionShort:"Remove liquidity from a Uniswap v2 Weighted pool before the swap",description:"Reduce or withdraw Uniswap v2 from a pool before a token swap integrating the process directly into the transaction flow. By adjusting your liquidity ahead of time, you gain more control over your assets without any extra steps. Optimize your position in a pool, all in one seamless action — no need for multiple transactions or added complexity.",version:"0.0.1",website:"https://app.uniswap.org/pools/v2",image:"https://cow-hooks-dapps-withdraw-uniswap-v2.vercel.app/icon.png",url:"https://cow-hooks-dapps-withdraw-uniswap-v2.vercel.app/",conditions:{position:"pre",walletCompatibility:["EOA"],supportedNetworks:[1,42161,11155111,8453]}},UNI_V2_DEPOSIT:{name:"Uniswap v2 Deposit",type:"IFRAME",descriptionShort:"Add liquidity to a Uniswap v2 pool after the swap",description:`Easily increase your position in a liquidity pool, adding both tokens in the right ratio.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@cowprotocol/iframe-transport");var i=(e=>(e.ACTIVATE="ACTIVATE",e.CONTEXT_UPDATE="CONTEXT_UPDATE",e.ADD_HOOK="ADD_HOOK",e.EDIT_HOOK="EDIT_HOOK",e.SET_SELL_TOKEN="SET_SELL_TOKEN",e.SET_BUY_TOKEN="SET_BUY_TOKEN",e))(i||{});const r=new c.IframeTransport("cowSwapHookDapp");function v({onContext:e}){const o=window.parent,a=c.getParentOrigin(),s=new c.WidgetEthereumProvider({targetOrigin:a}),t=u(o,a);return r.listenToMessageFromWindow(window,o,i.CONTEXT_UPDATE,e,a),r.postMessageToWindow(o,i.ACTIVATE,void 0,a),{actions:t,provider:s}}function u(e,o){return{addHook(a){r.postMessageToWindow(e,i.ADD_HOOK,a,o)},editHook(a){r.postMessageToWindow(e,i.EDIT_HOOK,a,o)},setSellToken(a){r.postMessageToWindow(e,i.SET_SELL_TOKEN,a,o)},setBuyToken(a){r.postMessageToWindow(e,i.SET_BUY_TOKEN,a,o)}}}var n=(e=>(e.INTERNAL="INTERNAL",e.IFRAME="IFRAME",e))(n||{}),h=(e=>(e.EOA="EOA",e.SMART_CONTRACT="SMART_CONTRACT",e))(h||{});const f=64,l="cow-swap://libs/hook-dapp-lib/permit",d="cow-swap://libs/hook-dapp-lib/twap/eoa-poll-funds",p={BUILD_CUSTOM_HOOK:{type:"INTERNAL",name:"Build your own hook",descriptionShort:"Call any smart contract with your own parameters",description:"Didn't find a suitable hook? You can always create your own! To do this, you need to specify which smart contract you want to call, the parameters for the call and the gas limit.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/apps/cowswap-frontend/src/modules/hooksStore/dapps/BuildHookApp/build.png",version:"v0.1.0",website:"https://docs.cow.fi/cow-protocol/tutorials/hook-dapp"},CLAIM_GNO_FROM_VALIDATORS:{type:"INTERNAL",name:"Claim GNO from validators",descriptionShort:"Withdraw rewards from your Gnosis validators.",description:"This hook allows you to withdraw rewards from your Gnosis Chain validators through CoW Swap. It automates the process of interacting with the Gnosis Deposit Contract, enabling you to claim any available rewards directly to your specified withdrawal address. The hook monitors your validator's accrued rewards and triggers the claimWithdrawals function when rewards are ready for withdrawal. This simplifies the management of Gnosis validator earnings without requiring ready for withdrawal. This simplifies the management of Gnosis validator earnings without requiring manual contract interaction, providing a smoother and more efficient experience for users.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/897ce91ca60a6b2d3823e6a002c3bf64c5384afe/libs/assets/src/cow-swap/network-gnosis-chain-logo.svg",version:"v0.1.1",website:"https://www.gnosis.io",conditions:{supportedNetworks:[100],position:"pre"}},[l]:{type:"INTERNAL",name:"Permit a token",descriptionShort:"Permit an address to spend one token on your behalf.",description:"This hook allows you to permit an address to spend your tokens on your behalf. This is useful for allowing a smart contract to spend your tokens without needing to approve each transaction.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/apps/cowswap-frontend/src/modules/hooksStore/dapps/PermitHookApp/icon.png",version:"v0.1.0",website:"https://docs.cow.fi/cow-protocol/tutorials/hook-dapp",conditions:{walletCompatibility:["EOA"],supportedNetworks:[11155111]}},CLAIM_COW_AIRDROP:{type:"INTERNAL",name:"Claim COW Airdrop",descriptionShort:"Retrieve COW tokens before or after a swap.",description:"Effortless Airdrop Claims! The Claim COW Airdrop feature simplifies the process of collecting free COW tokens before or after your swap, seamlessly integrating into the CoW Swap platform. Whether you're claiming new airdrops or exploring CoW on a new network, this tool ensures you get your rewards quickly and easily.",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/897ce91ca60a6b2d3823e6a002c3bf64c5384afe/apps/cowswap-frontend/src/modules/hooksStore/dapps/AirdropHookApp/airdrop.svg",version:"v0.1.0",website:"https://github.com/bleu/cow-airdrop-contract-deployer",conditions:{supportedNetworks:[11155111]}},CLAIM_LLAMAPAY_VESTING:{type:"IFRAME",name:"Claim LlamaPay Vesting Hook",description:"The Claim LlamaPay Vesting Hook is a powerful and user-friendly feature designed to streamline the process of claiming funds from LlamaPay vesting contracts. This tool empowers users to easily access and manage their vested tokens, ensuring a smooth and efficient experience in handling time-locked assets.",descriptionShort:"Claim your LlamaPay vesting contract funds",image:"https://cow-hooks-dapps-claim-vesting.vercel.app/llama-pay-icon.png",version:"0.1.0",website:"https://github.com/bleu/cow-hooks-dapps",url:"https://cow-hooks-dapps-claim-vesting.vercel.app",conditions:{supportedNetworks:[1,100,42161],walletCompatibility:["EOA"]}},CREATE_LLAMAPAY_VESTING:{type:"IFRAME",name:"Create LlamaPay Vesting",descriptionShort:"Create a LlamaPay vesting contract",description:"This hook allows you to easily set up vesting contracts with LlamaPay. Enter the recipient’s address or ENS name, then choose how much to transfer: the token buy will be automatically detected by the hook and the contracts will be linked to your LlamaPay dashboard for seamless tracking.",version:"0.1.0",website:"https://llamapay.io/vesting",image:"https://cow-hooks-dapps-create-vesting.vercel.app/llama-pay-icon.png",url:"https://cow-hooks-dapps-create-vesting.vercel.app",conditions:{position:"post",walletCompatibility:["EOA"],supportedNetworks:[1,100,42161]}},UNI_V2_WITHDRAW:{type:"IFRAME",name:"Withdraw Uniswap v2 Liquidity",descriptionShort:"Remove liquidity from a Uniswap v2 Weighted pool before the swap",description:"Reduce or withdraw Uniswap v2 from a pool before a token swap integrating the process directly into the transaction flow. By adjusting your liquidity ahead of time, you gain more control over your assets without any extra steps. Optimize your position in a pool, all in one seamless action — no need for multiple transactions or added complexity.",version:"0.0.1",website:"https://app.uniswap.org/pools/v2",image:"https://cow-hooks-dapps-withdraw-uniswap-v2.vercel.app/icon.png",url:"https://cow-hooks-dapps-withdraw-uniswap-v2.vercel.app/",conditions:{position:"pre",walletCompatibility:["EOA"],supportedNetworks:[1,42161,11155111,8453]}},UNI_V2_DEPOSIT:{name:"Uniswap v2 Deposit",type:"IFRAME",descriptionShort:"Add liquidity to a Uniswap v2 pool after the swap",description:`Easily increase your position in a liquidity pool, adding both tokens in the right ratio.
2
2
 
3
- Whether you're seeking to increase your exposure to specific tokens or maximize the returns from your assets, this tool offers a quick and efficient way to enhance your liquidity position after a token swap, all in a smooth, efficient process.`,version:"0.0.1",website:"https://app.uniswap.org/pools/v2",image:"https://cow-hooks-dapps-9zio.vercel.app/icon.png",url:"https://cow-hooks-dapps-9zio.vercel.app/",conditions:{position:"post",walletCompatibility:["EOA"],supportedNetworks:[1,42161,11155111,8453]}},MORPHO_BORROW:{name:"Morpho Borrow",type:"IFRAME",descriptionShort:"Supply collateral, borrow, repay and withdraw collateral on Morpho Protocol.",description:"The Morpho Borrow hook enables users to seamlessly combine swaps with borrow-related actions. Users can enter new positions, leave existing ones, or move between different markets through a unified, streamlined process.",version:"0.0.1",website:"https://app.morpho.org/",image:"https://cow-hooks-dapps-morpho-lending.vercel.app/icon.png",url:"https://cow-hooks-dapps-morpho-lending.vercel.app/",conditions:{walletCompatibility:["EOA"],supportedNetworks:[1,137,8453]}},"cow-sdk://bridging/providers/bungee":{name:"Bungee",type:"INTERNAL",descriptionShort:"Bungee Protocol - Swap tokens across chains",description:"Bungee is a liquidity marketplace that lets you swap into any token on any chain in a fully abstracted manner. Trade any token with the best quotes and a gasless UX!",version:"0.0.1",website:"https://www.bungee.exchange",image:"https://files.cow.fi/cow-sdk/bridging/providers/bungee/bungee-logo.png",conditions:{walletCompatibility:["EOA"]}},"cow-sdk://bridging/providers/across":{name:"Across",type:"INTERNAL",descriptionShort:"Across Protocol - Transfer Assets Between Layer 2s and Mainnet",description:"Across is the fastest, cheapest and most secure cross-chain bridge for Ethereum, Arbitrum, Optimism, Polygon and other Layer 1 and Layer 2 networks. Transfer tokens with Across.",version:"0.0.1",website:"https://across.to",image:"https://files.cow.fi/cow-sdk/bridging/providers/across/across-logo.png",conditions:{walletCompatibility:["EOA"]}},"cow-sdk://flashloans/aave/v3/collateral-swap":{name:"Aave Collateral Swap",type:"INTERNAL",descriptionShort:"Aave Collateral Swap Flashloan",description:"The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping collateral assets when there are borrow positions. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v3/debt-swap":{name:"Aave Debt Swap",type:"INTERNAL",descriptionShort:"Aave Debt Swap Flashloan",description:"The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping debt assets. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v3/repay-with-collateral":{name:"Aave Repay",type:"INTERNAL",descriptionShort:"Aave Repay with Collateral Flashloan",description:"The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like repaying borrow positions using collateral. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"}},v=Object.keys(p).reduce((o,t)=>{const e=p[t];return o.push({id:t,...e}),o},[]),A={id:d,name:"TWAP funding",descriptionShort:"Transfers sell tokens into the TWAP account before a part executes.",type:n.INTERNAL,version:"v1.0.0",website:"https://docs.cow.fi",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/libs/assets/src/images/logo-icon-cow-circle.svg"},T=[{id:"COW_AMM_WITHDRAW",name:"CoW AMM Withdraw Liquidity",descriptionShort:"Remove liquidity from a CoW AMM pool before the swap",type:n.IFRAME,version:"0.0.1",website:"https://balancer.fi/pools/cow",image:"https://cow-hooks-dapps-withdraw-pool.vercel.app/icon.png"},{id:"COW_AMM_DEPOSIT",name:"CoW AMM Deposit",descriptionShort:"Add liquidity to any of the CoW AMM pools",type:n.IFRAME,version:"0.0.1",website:"https://balancer.fi/pools/cow",image:"https://cow-hooks-dapps-cow-amm-deposit.vercel.app/icon.png"}],k="0xd505accf",b="0x8fcbaf0c";function h(o){return o.callData.startsWith(k)||o.callData.startsWith(b)}function E(o){return o.dappId===d}function m(o,t){const e=t.reduce((s,a)=>(s[a.id]=a,s),{});return o.filter(s=>!!s.dappId).map(s=>{const a=s,u=e[a.dappId];return h(a)?{hook:a,dapp:p[l]}:{hook:a,dapp:u||null}})}function O(o,t=[]){return m(o,v.concat(A,T,t))}exports.CoWHookDappEvents=i;exports.EOA_TWAP_POLL_FUNDS_DAPP_ID=d;exports.HOOK_DAPP_ID_LENGTH=y;exports.HookDappType=n;exports.HookDappWalletCompatibility=w;exports.PERMIT_HOOK_DAPP_ID=l;exports.doesHookHavePermit=h;exports.hookDappIframeTransport=r;exports.hookDappsRegistry=p;exports.initCoWHookDapp=g;exports.isEoaTwapPollFundsHook=E;exports.matchHooksToDapps=m;exports.matchHooksToDappsRegistry=O;
3
+ Whether you're seeking to increase your exposure to specific tokens or maximize the returns from your assets, this tool offers a quick and efficient way to enhance your liquidity position after a token swap, all in a smooth, efficient process.`,version:"0.0.1",website:"https://app.uniswap.org/pools/v2",image:"https://cow-hooks-dapps-9zio.vercel.app/icon.png",url:"https://cow-hooks-dapps-9zio.vercel.app/",conditions:{position:"post",walletCompatibility:["EOA"],supportedNetworks:[1,42161,11155111,8453]}},MORPHO_BORROW:{name:"Morpho Borrow",type:"IFRAME",descriptionShort:"Supply collateral, borrow, repay and withdraw collateral on Morpho Protocol.",description:"The Morpho Borrow hook enables users to seamlessly combine swaps with borrow-related actions. Users can enter new positions, leave existing ones, or move between different markets through a unified, streamlined process.",version:"0.0.1",website:"https://app.morpho.org/",image:"https://cow-hooks-dapps-morpho-lending.vercel.app/icon.png",url:"https://cow-hooks-dapps-morpho-lending.vercel.app/",conditions:{walletCompatibility:["EOA"],supportedNetworks:[1,137,8453]}},"cow-sdk://bridging/providers/bungee":{name:"Bungee",type:"INTERNAL",descriptionShort:"Bungee Protocol - Swap tokens across chains",description:"Bungee is a liquidity marketplace that lets you swap into any token on any chain in a fully abstracted manner. Trade any token with the best quotes and a gasless UX!",version:"0.0.1",website:"https://www.bungee.exchange",image:"https://files.cow.fi/cow-sdk/bridging/providers/bungee/bungee-logo.png",conditions:{walletCompatibility:["EOA"]}},"cow-sdk://bridging/providers/across":{name:"Across",type:"INTERNAL",descriptionShort:"Across Protocol - Transfer Assets Between Layer 2s and Mainnet",description:"Across is the fastest, cheapest and most secure cross-chain bridge for Ethereum, Arbitrum, Optimism, Polygon and other Layer 1 and Layer 2 networks. Transfer tokens with Across.",version:"0.0.1",website:"https://across.to",image:"https://files.cow.fi/cow-sdk/bridging/providers/across/across-logo.png",conditions:{walletCompatibility:["EOA"]}},"cow-sdk://flashloans/aave/v3/collateral-swap":{name:"Aave V3 Collateral Swap",type:"INTERNAL",descriptionShort:"Aave V3 Collateral Swap Flashloan",description:"The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping collateral assets when there are borrow positions. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v3/debt-swap":{name:"Aave V3 Debt Swap",type:"INTERNAL",descriptionShort:"Aave V3 Debt Swap Flashloan",description:"The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping debt assets. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v3/repay-with-collateral":{name:"Aave V3 Repay",type:"INTERNAL",descriptionShort:"Aave V3 Repay with Collateral Flashloan",description:"The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like repaying borrow positions using collateral. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v3/leverage":{name:"Aave V3 Leverage",type:"INTERNAL",descriptionShort:"Aave V3 Leverage Flashloan",description:"The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like increasing leverage by borrowing an asset and supplying the swap output as collateral. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/supply-swap/pre":{name:"Aave V4 Supply Swap",type:"INTERNAL",descriptionShort:"Aave V4 Supply Swap Flashloan, adapter deployment",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a supplied asset for another. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/supply-swap/post":{name:"Aave V4 Supply Swap",type:"INTERNAL",descriptionShort:"Aave V4 Supply Swap Flashloan, adapter execution",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a supplied asset for another. This post-hook calls the adapter instance, which updates the Aave V4 position.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/borrow-swap/pre":{name:"Aave V4 Borrow Swap",type:"INTERNAL",descriptionShort:"Aave V4 Borrow Swap Flashloan, adapter deployment",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a borrowed asset for another. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/borrow-swap/post":{name:"Aave V4 Borrow Swap",type:"INTERNAL",descriptionShort:"Aave V4 Borrow Swap Flashloan, adapter execution",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a borrowed asset for another. This post-hook calls the adapter instance, which updates the Aave V4 position.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/repay-with-collateral/pre":{name:"Aave V4 Repay with Collateral",type:"INTERNAL",descriptionShort:"Aave V4 Repay with Collateral Flashloan, adapter deployment",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like repaying borrow positions using supplied collateral. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/repay-with-collateral/post":{name:"Aave V4 Repay with Collateral",type:"INTERNAL",descriptionShort:"Aave V4 Repay with Collateral Flashloan, adapter execution",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like repaying borrow positions using supplied collateral. This post-hook calls the adapter instance, which updates the Aave V4 position.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/leverage/pre":{name:"Aave V4 Leverage",type:"INTERNAL",descriptionShort:"Aave V4 Leverage Flashloan, adapter deployment",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like increasing leverage by borrowing an asset and supplying the swap output as collateral. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"},"cow-sdk://flashloans/aave/v4/leverage/post":{name:"Aave V4 Leverage",type:"INTERNAL",descriptionShort:"Aave V4 Leverage Flashloan, adapter execution",description:"The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like increasing leverage by borrowing an asset and supplying the swap output as collateral. This post-hook calls the adapter instance, which updates the Aave V4 position.",version:"0.0.1",website:"https://aave.com",image:"https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"}},y=Object.keys(p).reduce((e,o)=>{const a=p[o];return e.push({id:o,...a}),e},[]),A={id:d,name:"TWAP funding",descriptionShort:"Transfers sell tokens into the TWAP account before a part executes.",type:n.INTERNAL,version:"v1.0.0",website:"https://docs.cow.fi",image:"https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/libs/assets/src/images/logo-icon-cow-circle.svg"},k=[{id:"COW_AMM_WITHDRAW",name:"CoW AMM Withdraw Liquidity",descriptionShort:"Remove liquidity from a CoW AMM pool before the swap",type:n.IFRAME,version:"0.0.1",website:"https://balancer.fi/pools/cow",image:"https://cow-hooks-dapps-withdraw-pool.vercel.app/icon.png"},{id:"COW_AMM_DEPOSIT",name:"CoW AMM Deposit",descriptionShort:"Add liquidity to any of the CoW AMM pools",type:n.IFRAME,version:"0.0.1",website:"https://balancer.fi/pools/cow",image:"https://cow-hooks-dapps-cow-amm-deposit.vercel.app/icon.png"}],T="0xd505accf",b="0x8fcbaf0c";function w(e){return e.callData.startsWith(T)||e.callData.startsWith(b)}function E(e){return e.dappId===d}function g(e,o){const a=o.reduce((s,t)=>(s[t.id]=t,s),{});return e.filter(s=>!!s.dappId).map(s=>{const t=s,m=a[t.dappId];return w(t)?{hook:t,dapp:p[l]}:{hook:t,dapp:m||null}})}function S(e,o=[]){return g(e,y.concat(A,k,o))}exports.CoWHookDappEvents=i;exports.EOA_TWAP_POLL_FUNDS_DAPP_ID=d;exports.HOOK_DAPP_ID_LENGTH=f;exports.HookDappType=n;exports.HookDappWalletCompatibility=h;exports.PERMIT_HOOK_DAPP_ID=l;exports.doesHookHavePermit=w;exports.hookDappIframeTransport=r;exports.hookDappsRegistry=p;exports.initCoWHookDapp=v;exports.isEoaTwapPollFundsHook=E;exports.matchHooksToDapps=g;exports.matchHooksToDappsRegistry=S;
package/index.js CHANGED
@@ -1,35 +1,35 @@
1
- import { IframeTransport as w, getParentOrigin as h, WidgetEthereumProvider as m } from "@cowprotocol/iframe-transport";
2
- var i = /* @__PURE__ */ ((o) => (o.ACTIVATE = "ACTIVATE", o.CONTEXT_UPDATE = "CONTEXT_UPDATE", o.ADD_HOOK = "ADD_HOOK", o.EDIT_HOOK = "EDIT_HOOK", o.SET_SELL_TOKEN = "SET_SELL_TOKEN", o.SET_BUY_TOKEN = "SET_BUY_TOKEN", o))(i || {});
3
- const r = new w("cowSwapHookDapp");
4
- function O({
5
- onContext: o
1
+ import { IframeTransport as h, getParentOrigin as w, WidgetEthereumProvider as g } from "@cowprotocol/iframe-transport";
2
+ var i = /* @__PURE__ */ ((e) => (e.ACTIVATE = "ACTIVATE", e.CONTEXT_UPDATE = "CONTEXT_UPDATE", e.ADD_HOOK = "ADD_HOOK", e.EDIT_HOOK = "EDIT_HOOK", e.SET_SELL_TOKEN = "SET_SELL_TOKEN", e.SET_BUY_TOKEN = "SET_BUY_TOKEN", e))(i || {});
3
+ const r = new h("cowSwapHookDapp");
4
+ function S({
5
+ onContext: e
6
6
  }) {
7
- const t = window.parent, e = h(), a = new m({
8
- targetOrigin: e
9
- }), s = u(t, e);
10
- return r.listenToMessageFromWindow(window, t, i.CONTEXT_UPDATE, o, e), r.postMessageToWindow(t, i.ACTIVATE, void 0, e), {
11
- actions: s,
12
- provider: a
7
+ const o = window.parent, a = w(), s = new g({
8
+ targetOrigin: a
9
+ }), t = m(o, a);
10
+ return r.listenToMessageFromWindow(window, o, i.CONTEXT_UPDATE, e, a), r.postMessageToWindow(o, i.ACTIVATE, void 0, a), {
11
+ actions: t,
12
+ provider: s
13
13
  };
14
14
  }
15
- function u(o, t) {
15
+ function m(e, o) {
16
16
  return {
17
- addHook(e) {
18
- r.postMessageToWindow(o, i.ADD_HOOK, e, t);
17
+ addHook(a) {
18
+ r.postMessageToWindow(e, i.ADD_HOOK, a, o);
19
19
  },
20
- editHook(e) {
21
- r.postMessageToWindow(o, i.EDIT_HOOK, e, t);
20
+ editHook(a) {
21
+ r.postMessageToWindow(e, i.EDIT_HOOK, a, o);
22
22
  },
23
- setSellToken(e) {
24
- r.postMessageToWindow(o, i.SET_SELL_TOKEN, e, t);
23
+ setSellToken(a) {
24
+ r.postMessageToWindow(e, i.SET_SELL_TOKEN, a, o);
25
25
  },
26
- setBuyToken(e) {
27
- r.postMessageToWindow(o, i.SET_BUY_TOKEN, e, t);
26
+ setBuyToken(a) {
27
+ r.postMessageToWindow(e, i.SET_BUY_TOKEN, a, o);
28
28
  }
29
29
  };
30
30
  }
31
- var n = /* @__PURE__ */ ((o) => (o.INTERNAL = "INTERNAL", o.IFRAME = "IFRAME", o))(n || {}), g = /* @__PURE__ */ ((o) => (o.EOA = "EOA", o.SMART_CONTRACT = "SMART_CONTRACT", o))(g || {});
32
- const _ = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/hook-dapp-lib/twap/eoa-poll-funds", p = {
31
+ var n = /* @__PURE__ */ ((e) => (e.INTERNAL = "INTERNAL", e.IFRAME = "IFRAME", e))(n || {}), v = /* @__PURE__ */ ((e) => (e.EOA = "EOA", e.SMART_CONTRACT = "SMART_CONTRACT", e))(v || {});
32
+ const L = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/hook-dapp-lib/twap/eoa-poll-funds", p = {
33
33
  BUILD_CUSTOM_HOOK: {
34
34
  type: "INTERNAL",
35
35
  name: "Build your own hook",
@@ -177,39 +177,120 @@ const _ = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/h
177
177
  }
178
178
  },
179
179
  "cow-sdk://flashloans/aave/v3/collateral-swap": {
180
- name: "Aave Collateral Swap",
180
+ name: "Aave V3 Collateral Swap",
181
181
  type: "INTERNAL",
182
- descriptionShort: "Aave Collateral Swap Flashloan",
182
+ descriptionShort: "Aave V3 Collateral Swap Flashloan",
183
183
  description: "The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping collateral assets when there are borrow positions. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",
184
184
  version: "0.0.1",
185
185
  website: "https://aave.com",
186
186
  image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
187
187
  },
188
188
  "cow-sdk://flashloans/aave/v3/debt-swap": {
189
- name: "Aave Debt Swap",
189
+ name: "Aave V3 Debt Swap",
190
190
  type: "INTERNAL",
191
- descriptionShort: "Aave Debt Swap Flashloan",
191
+ descriptionShort: "Aave V3 Debt Swap Flashloan",
192
192
  description: "The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping debt assets. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",
193
193
  version: "0.0.1",
194
194
  website: "https://aave.com",
195
195
  image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
196
196
  },
197
197
  "cow-sdk://flashloans/aave/v3/repay-with-collateral": {
198
- name: "Aave Repay",
198
+ name: "Aave V3 Repay",
199
199
  type: "INTERNAL",
200
- descriptionShort: "Aave Repay with Collateral Flashloan",
200
+ descriptionShort: "Aave V3 Repay with Collateral Flashloan",
201
201
  description: "The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like repaying borrow positions using collateral. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",
202
202
  version: "0.0.1",
203
203
  website: "https://aave.com",
204
204
  image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
205
+ },
206
+ "cow-sdk://flashloans/aave/v3/leverage": {
207
+ name: "Aave V3 Leverage",
208
+ type: "INTERNAL",
209
+ descriptionShort: "Aave V3 Leverage Flashloan",
210
+ description: "The swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like increasing leverage by borrowing an asset and supplying the swap output as collateral. Learn more at https://aave.com/docs/developers/smart-contracts/swap-features.",
211
+ version: "0.0.1",
212
+ website: "https://aave.com",
213
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
214
+ },
215
+ "cow-sdk://flashloans/aave/v4/supply-swap/pre": {
216
+ name: "Aave V4 Supply Swap",
217
+ type: "INTERNAL",
218
+ descriptionShort: "Aave V4 Supply Swap Flashloan, adapter deployment",
219
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a supplied asset for another. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",
220
+ version: "0.0.1",
221
+ website: "https://aave.com",
222
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
223
+ },
224
+ "cow-sdk://flashloans/aave/v4/supply-swap/post": {
225
+ name: "Aave V4 Supply Swap",
226
+ type: "INTERNAL",
227
+ descriptionShort: "Aave V4 Supply Swap Flashloan, adapter execution",
228
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a supplied asset for another. This post-hook calls the adapter instance, which updates the Aave V4 position.",
229
+ version: "0.0.1",
230
+ website: "https://aave.com",
231
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
232
+ },
233
+ "cow-sdk://flashloans/aave/v4/borrow-swap/pre": {
234
+ name: "Aave V4 Borrow Swap",
235
+ type: "INTERNAL",
236
+ descriptionShort: "Aave V4 Borrow Swap Flashloan, adapter deployment",
237
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a borrowed asset for another. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",
238
+ version: "0.0.1",
239
+ website: "https://aave.com",
240
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
241
+ },
242
+ "cow-sdk://flashloans/aave/v4/borrow-swap/post": {
243
+ name: "Aave V4 Borrow Swap",
244
+ type: "INTERNAL",
245
+ descriptionShort: "Aave V4 Borrow Swap Flashloan, adapter execution",
246
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like swapping a borrowed asset for another. This post-hook calls the adapter instance, which updates the Aave V4 position.",
247
+ version: "0.0.1",
248
+ website: "https://aave.com",
249
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
250
+ },
251
+ "cow-sdk://flashloans/aave/v4/repay-with-collateral/pre": {
252
+ name: "Aave V4 Repay with Collateral",
253
+ type: "INTERNAL",
254
+ descriptionShort: "Aave V4 Repay with Collateral Flashloan, adapter deployment",
255
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like repaying borrow positions using supplied collateral. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",
256
+ version: "0.0.1",
257
+ website: "https://aave.com",
258
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
259
+ },
260
+ "cow-sdk://flashloans/aave/v4/repay-with-collateral/post": {
261
+ name: "Aave V4 Repay with Collateral",
262
+ type: "INTERNAL",
263
+ descriptionShort: "Aave V4 Repay with Collateral Flashloan, adapter execution",
264
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like repaying borrow positions using supplied collateral. This post-hook calls the adapter instance, which updates the Aave V4 position.",
265
+ version: "0.0.1",
266
+ website: "https://aave.com",
267
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
268
+ },
269
+ "cow-sdk://flashloans/aave/v4/leverage/pre": {
270
+ name: "Aave V4 Leverage",
271
+ type: "INTERNAL",
272
+ descriptionShort: "Aave V4 Leverage Flashloan, adapter deployment",
273
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like increasing leverage by borrowing an asset and supplying the swap output as collateral. This pre-hook deploys the order's adapter instance through the factory and moves the flash loan into it.",
274
+ version: "0.0.1",
275
+ website: "https://aave.com",
276
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
277
+ },
278
+ "cow-sdk://flashloans/aave/v4/leverage/post": {
279
+ name: "Aave V4 Leverage",
280
+ type: "INTERNAL",
281
+ descriptionShort: "Aave V4 Leverage Flashloan, adapter execution",
282
+ description: "The Aave V4 swap adapter contracts integrate Aave Flash Loans and CoW Swap to facilitate advanced actions like increasing leverage by borrowing an asset and supplying the swap output as collateral. This post-hook calls the adapter instance, which updates the Aave V4 position.",
283
+ version: "0.0.1",
284
+ website: "https://aave.com",
285
+ image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
205
286
  }
206
- }, f = Object.keys(p).reduce((o, t) => {
207
- const e = p[t];
208
- return o.push({
209
- id: t,
210
- ...e
211
- }), o;
212
- }, []), y = {
287
+ }, u = Object.keys(p).reduce((e, o) => {
288
+ const a = p[o];
289
+ return e.push({
290
+ id: o,
291
+ ...a
292
+ }), e;
293
+ }, []), f = {
213
294
  id: l,
214
295
  name: "TWAP funding",
215
296
  descriptionShort: "Transfers sell tokens into the TWAP account before a part executes.",
@@ -217,7 +298,7 @@ const _ = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/h
217
298
  version: "v1.0.0",
218
299
  website: "https://docs.cow.fi",
219
300
  image: "https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/libs/assets/src/images/logo-icon-cow-circle.svg"
220
- }, v = [{
301
+ }, y = [{
221
302
  id: "COW_AMM_WITHDRAW",
222
303
  name: "CoW AMM Withdraw Liquidity",
223
304
  descriptionShort: "Remove liquidity from a CoW AMM pool before the swap",
@@ -233,41 +314,41 @@ const _ = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/h
233
314
  version: "0.0.1",
234
315
  website: "https://balancer.fi/pools/cow",
235
316
  image: "https://cow-hooks-dapps-cow-amm-deposit.vercel.app/icon.png"
236
- }], A = "0xd505accf", T = "0x8fcbaf0c";
237
- function k(o) {
238
- return o.callData.startsWith(A) || o.callData.startsWith(T);
317
+ }], A = "0xd505accf", k = "0x8fcbaf0c";
318
+ function T(e) {
319
+ return e.callData.startsWith(A) || e.callData.startsWith(k);
239
320
  }
240
- function I(o) {
241
- return o.dappId === l;
321
+ function N(e) {
322
+ return e.dappId === l;
242
323
  }
243
- function b(o, t) {
244
- const e = t.reduce((a, s) => (a[s.id] = s, a), {});
245
- return o.filter((a) => !!a.dappId).map((a) => {
246
- const s = a, d = e[s.dappId];
247
- return k(s) ? {
248
- hook: s,
324
+ function b(e, o) {
325
+ const a = o.reduce((s, t) => (s[t.id] = t, s), {});
326
+ return e.filter((s) => !!s.dappId).map((s) => {
327
+ const t = s, d = a[t.dappId];
328
+ return T(t) ? {
329
+ hook: t,
249
330
  dapp: p[c]
250
331
  } : {
251
- hook: s,
332
+ hook: t,
252
333
  dapp: d || null
253
334
  };
254
335
  });
255
336
  }
256
- function S(o, t = []) {
257
- return b(o, f.concat(y, v, t));
337
+ function C(e, o = []) {
338
+ return b(e, u.concat(f, y, o));
258
339
  }
259
340
  export {
260
341
  i as CoWHookDappEvents,
261
342
  l as EOA_TWAP_POLL_FUNDS_DAPP_ID,
262
- _ as HOOK_DAPP_ID_LENGTH,
343
+ L as HOOK_DAPP_ID_LENGTH,
263
344
  n as HookDappType,
264
- g as HookDappWalletCompatibility,
345
+ v as HookDappWalletCompatibility,
265
346
  c as PERMIT_HOOK_DAPP_ID,
266
- k as doesHookHavePermit,
347
+ T as doesHookHavePermit,
267
348
  r as hookDappIframeTransport,
268
349
  p as hookDappsRegistry,
269
- O as initCoWHookDapp,
270
- I as isEoaTwapPollFundsHook,
350
+ S as initCoWHookDapp,
351
+ N as isEoaTwapPollFundsHook,
271
352
  b as matchHooksToDapps,
272
- S as matchHooksToDappsRegistry
353
+ C as matchHooksToDappsRegistry
273
354
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/hook-dapp-lib",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "CoW Swap Hook Dapp Library. Allows you to develop pre/post hooks dapps for CoW Protocol.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "access": "public"
16
16
  },
17
17
  "dependencies": {
18
- "@cowprotocol/iframe-transport": "^2.3.11"
18
+ "@cowprotocol/iframe-transport": "^2.3.12"
19
19
  },
20
20
  "exports": {
21
21
  ".": {