@cowprotocol/hook-dapp-lib 2.3.2 → 2.4.1

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.
@@ -46,21 +46,6 @@ export declare const hookDappsRegistry: {
46
46
  supportedNetworks: number[];
47
47
  };
48
48
  };
49
- COW_AMM_WITHDRAW: {
50
- name: string;
51
- type: string;
52
- descriptionShort: string;
53
- description: string;
54
- version: string;
55
- website: string;
56
- image: string;
57
- url: string;
58
- conditions: {
59
- position: string;
60
- walletCompatibility: string[];
61
- supportedNetworks: number[];
62
- };
63
- };
64
49
  CLAIM_LLAMAPAY_VESTING: {
65
50
  type: string;
66
51
  name: string;
@@ -105,21 +90,6 @@ export declare const hookDappsRegistry: {
105
90
  supportedNetworks: number[];
106
91
  };
107
92
  };
108
- COW_AMM_DEPOSIT: {
109
- name: string;
110
- type: string;
111
- descriptionShort: string;
112
- description: string;
113
- version: string;
114
- website: string;
115
- image: string;
116
- url: string;
117
- conditions: {
118
- position: string;
119
- walletCompatibility: string[];
120
- supportedNetworks: number[];
121
- };
122
- };
123
93
  UNI_V2_DEPOSIT: {
124
94
  name: string;
125
95
  type: string;
package/index.cjs CHANGED
@@ -1,5 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=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 p.IframeTransport("cowSwapHookDapp");function g({onContext:o}){const t=window.parent,e=p.getParentOrigin(),a=new p.WidgetEthereumProvider({targetOrigin:e}),s=y(t,e);return r.listenToMessageFromWindow(window,t,i.CONTEXT_UPDATE,o,e),r.postMessageToWindow(t,i.ACTIVATE,void 0,e),{actions:s,provider:a}}function y(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 c=(o=>(o.INTERNAL="INTERNAL",o.IFRAME="IFRAME",o))(c||{}),h=(o=>(o.EOA="EOA",o.SMART_CONTRACT="SMART_CONTRACT",o))(h||{});const f=64,l="cow-swap://libs/hook-dapp-lib/permit",d="cow-swap://libs/hook-dapp-lib/twap/eoa-poll-funds",n={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]}},COW_AMM_WITHDRAW:{name:"CoW AMM Withdraw Liquidity",type:"IFRAME",descriptionShort:"Remove liquidity from a CoW AMM pool before the swap",description:"Reduce or withdraw liquidity 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://balancer.fi/pools/cow",image:"https://cow-hooks-dapps-withdraw-pool.vercel.app/icon.png",url:"https://cow-hooks-dapps-withdraw-pool.vercel.app/",conditions:{position:"pre",walletCompatibility:["EOA"],supportedNetworks:[1,100,8453,42161,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]}},COW_AMM_DEPOSIT:{name:"CoW AMM Deposit",type:"IFRAME",descriptionShort:"Add liquidity to any of the CoW AMM pools",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=(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.
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://balancer.fi/pools/cow",image:"https://cow-hooks-dapps-cow-amm-deposit.vercel.app/icon.png",url:"https://cow-hooks-dapps-cow-amm-deposit.vercel.app/",conditions:{position:"post",walletCompatibility:["EOA"],supportedNetworks:[1,100,8453,42161,11155111]}},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.
4
-
5
- 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(n).reduce((o,t)=>{const e=n[t];return o.push({id:t,...e}),o},[]),k={id:d,name:"TWAP funding",descriptionShort:"Transfers sell tokens into the TWAP account before a part executes.",type:c.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"},A="0xd505accf",T="0x8fcbaf0c";function w(o){return o.callData.startsWith(A)||o.callData.startsWith(T)}function b(o){return o.dappId===d}function u(o,t){const e=t.reduce((a,s)=>(a[s.id]=s,a),{});return o.filter(a=>!!a.dappId).map(a=>{const s=a,m=e[s.dappId];return w(s)?{hook:s,dapp:n[l]}:{hook:s,dapp:m||null}})}function E(o,t=[]){return u(o,v.concat(k,t))}exports.CoWHookDappEvents=i;exports.EOA_TWAP_POLL_FUNDS_DAPP_ID=d;exports.HOOK_DAPP_ID_LENGTH=f;exports.HookDappType=c;exports.HookDappWalletCompatibility=h;exports.PERMIT_HOOK_DAPP_ID=l;exports.doesHookHavePermit=w;exports.hookDappIframeTransport=r;exports.hookDappsRegistry=n;exports.initCoWHookDapp=g;exports.isEoaTwapPollFundsHook=b;exports.matchHooksToDapps=u;exports.matchHooksToDappsRegistry=E;
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;
package/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { IframeTransport as w, getParentOrigin as h, WidgetEthereumProvider as u } from "@cowprotocol/iframe-transport";
1
+ import { IframeTransport as w, getParentOrigin as h, WidgetEthereumProvider as m } from "@cowprotocol/iframe-transport";
2
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
3
  const r = new w("cowSwapHookDapp");
4
- function E({
4
+ function O({
5
5
  onContext: o
6
6
  }) {
7
- const t = window.parent, e = h(), a = new u({
7
+ const t = window.parent, e = h(), a = new m({
8
8
  targetOrigin: e
9
- }), s = m(t, e);
9
+ }), s = u(t, e);
10
10
  return r.listenToMessageFromWindow(window, t, i.CONTEXT_UPDATE, o, e), r.postMessageToWindow(t, i.ACTIVATE, void 0, e), {
11
11
  actions: s,
12
12
  provider: a
13
13
  };
14
14
  }
15
- function m(o, t) {
15
+ function u(o, t) {
16
16
  return {
17
17
  addHook(e) {
18
18
  r.postMessageToWindow(o, i.ADD_HOOK, e, t);
@@ -28,8 +28,8 @@ function m(o, t) {
28
28
  }
29
29
  };
30
30
  }
31
- var p = /* @__PURE__ */ ((o) => (o.INTERNAL = "INTERNAL", o.IFRAME = "IFRAME", o))(p || {}), g = /* @__PURE__ */ ((o) => (o.EOA = "EOA", o.SMART_CONTRACT = "SMART_CONTRACT", o))(g || {});
32
- const O = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/hook-dapp-lib/twap/eoa-poll-funds", n = {
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 = {
33
33
  BUILD_CUSTOM_HOOK: {
34
34
  type: "INTERNAL",
35
35
  name: "Build your own hook",
@@ -77,21 +77,6 @@ const O = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/h
77
77
  supportedNetworks: [11155111]
78
78
  }
79
79
  },
80
- COW_AMM_WITHDRAW: {
81
- name: "CoW AMM Withdraw Liquidity",
82
- type: "IFRAME",
83
- descriptionShort: "Remove liquidity from a CoW AMM pool before the swap",
84
- description: "Reduce or withdraw liquidity 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.",
85
- version: "0.0.1",
86
- website: "https://balancer.fi/pools/cow",
87
- image: "https://cow-hooks-dapps-withdraw-pool.vercel.app/icon.png",
88
- url: "https://cow-hooks-dapps-withdraw-pool.vercel.app/",
89
- conditions: {
90
- position: "pre",
91
- walletCompatibility: ["EOA"],
92
- supportedNetworks: [1, 100, 8453, 42161, 11155111]
93
- }
94
- },
95
80
  CLAIM_LLAMAPAY_VESTING: {
96
81
  type: "IFRAME",
97
82
  name: "Claim LlamaPay Vesting Hook",
@@ -136,23 +121,6 @@ const O = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/h
136
121
  supportedNetworks: [1, 42161, 11155111, 8453]
137
122
  }
138
123
  },
139
- COW_AMM_DEPOSIT: {
140
- name: "CoW AMM Deposit",
141
- type: "IFRAME",
142
- descriptionShort: "Add liquidity to any of the CoW AMM pools",
143
- description: `Easily increase your position in a liquidity pool, adding both tokens in the right ratio.
144
-
145
- 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.`,
146
- version: "0.0.1",
147
- website: "https://balancer.fi/pools/cow",
148
- image: "https://cow-hooks-dapps-cow-amm-deposit.vercel.app/icon.png",
149
- url: "https://cow-hooks-dapps-cow-amm-deposit.vercel.app/",
150
- conditions: {
151
- position: "post",
152
- walletCompatibility: ["EOA"],
153
- supportedNetworks: [1, 100, 8453, 42161, 11155111]
154
- }
155
- },
156
124
  UNI_V2_DEPOSIT: {
157
125
  name: "Uniswap v2 Deposit",
158
126
  type: "IFRAME",
@@ -235,8 +203,8 @@ const O = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/h
235
203
  website: "https://aave.com",
236
204
  image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
237
205
  }
238
- }, f = Object.keys(n).reduce((o, t) => {
239
- const e = n[t];
206
+ }, f = Object.keys(p).reduce((o, t) => {
207
+ const e = p[t];
240
208
  return o.push({
241
209
  id: t,
242
210
  ...e
@@ -245,45 +213,61 @@ const O = 64, c = "cow-swap://libs/hook-dapp-lib/permit", l = "cow-swap://libs/h
245
213
  id: l,
246
214
  name: "TWAP funding",
247
215
  descriptionShort: "Transfers sell tokens into the TWAP account before a part executes.",
248
- type: p.INTERNAL,
216
+ type: n.INTERNAL,
249
217
  version: "v1.0.0",
250
218
  website: "https://docs.cow.fi",
251
219
  image: "https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/libs/assets/src/images/logo-icon-cow-circle.svg"
252
- }, v = "0xd505accf", A = "0x8fcbaf0c";
220
+ }, v = [{
221
+ id: "COW_AMM_WITHDRAW",
222
+ name: "CoW AMM Withdraw Liquidity",
223
+ descriptionShort: "Remove liquidity from a CoW AMM pool before the swap",
224
+ type: n.IFRAME,
225
+ version: "0.0.1",
226
+ website: "https://balancer.fi/pools/cow",
227
+ image: "https://cow-hooks-dapps-withdraw-pool.vercel.app/icon.png"
228
+ }, {
229
+ id: "COW_AMM_DEPOSIT",
230
+ name: "CoW AMM Deposit",
231
+ descriptionShort: "Add liquidity to any of the CoW AMM pools",
232
+ type: n.IFRAME,
233
+ version: "0.0.1",
234
+ website: "https://balancer.fi/pools/cow",
235
+ image: "https://cow-hooks-dapps-cow-amm-deposit.vercel.app/icon.png"
236
+ }], A = "0xd505accf", T = "0x8fcbaf0c";
253
237
  function k(o) {
254
- return o.callData.startsWith(v) || o.callData.startsWith(A);
238
+ return o.callData.startsWith(A) || o.callData.startsWith(T);
255
239
  }
256
- function _(o) {
240
+ function I(o) {
257
241
  return o.dappId === l;
258
242
  }
259
- function T(o, t) {
243
+ function b(o, t) {
260
244
  const e = t.reduce((a, s) => (a[s.id] = s, a), {});
261
245
  return o.filter((a) => !!a.dappId).map((a) => {
262
246
  const s = a, d = e[s.dappId];
263
247
  return k(s) ? {
264
248
  hook: s,
265
- dapp: n[c]
249
+ dapp: p[c]
266
250
  } : {
267
251
  hook: s,
268
252
  dapp: d || null
269
253
  };
270
254
  });
271
255
  }
272
- function C(o, t = []) {
273
- return T(o, f.concat(y, t));
256
+ function S(o, t = []) {
257
+ return b(o, f.concat(y, v, t));
274
258
  }
275
259
  export {
276
260
  i as CoWHookDappEvents,
277
261
  l as EOA_TWAP_POLL_FUNDS_DAPP_ID,
278
- O as HOOK_DAPP_ID_LENGTH,
279
- p as HookDappType,
262
+ _ as HOOK_DAPP_ID_LENGTH,
263
+ n as HookDappType,
280
264
  g as HookDappWalletCompatibility,
281
265
  c as PERMIT_HOOK_DAPP_ID,
282
266
  k as doesHookHavePermit,
283
267
  r as hookDappIframeTransport,
284
- n as hookDappsRegistry,
285
- E as initCoWHookDapp,
286
- _ as isEoaTwapPollFundsHook,
287
- T as matchHooksToDapps,
288
- C as matchHooksToDappsRegistry
268
+ p as hookDappsRegistry,
269
+ O as initCoWHookDapp,
270
+ I as isEoaTwapPollFundsHook,
271
+ b as matchHooksToDapps,
272
+ S as matchHooksToDappsRegistry
289
273
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/hook-dapp-lib",
3
- "version": "2.3.2",
3
+ "version": "2.4.1",
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.10"
18
+ "@cowprotocol/iframe-transport": "^2.3.12"
19
19
  },
20
20
  "exports": {
21
21
  ".": {