@cowprotocol/hook-dapp-lib 2.0.13 → 2.1.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.
package/README.md CHANGED
@@ -3,13 +3,13 @@
3
3
  >CoW Hooks allow users to call arbitrary Ethereum action before and/or after swap.
4
4
  >For example: before swap give a permission to CoW Protocol smart-contract and after swap bridge tokens to another chain.
5
5
 
6
- ### Docs: https://docs.cow.fi/cow-protocol/tutorials/hook-dapp
6
+ ### Docs: https://docs.cow.finance/cow-protocol/tutorials/hook-dapp
7
7
 
8
8
  ![](./demo.png)
9
9
 
10
10
  ## CoW Hooks Dapp library
11
11
 
12
- [CoW Swap](https://swap.cow.fi/) provides an opportunity to use external dapps to build hooks.
12
+ [CoW Swap](https://swap.cow.finance/) provides an opportunity to use external dapps to build hooks.
13
13
  So, you can put a link to some hook-daap and it will be automatically integrate in CoW Swap!
14
14
 
15
15
  This library is for developers who are interested in developing dapps for CoW Hooks.
package/index.cjs CHANGED
@@ -1,5 +1,5 @@
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 u({onContext:o}){const t=window.parent,e=p.getParentOrigin(),s=new p.WidgetEthereumProvider({targetOrigin:e}),a=g(t,e);return r.listenToMessageFromWindow(window,i.CONTEXT_UPDATE,o,e),r.postMessageToWindow(t,i.ACTIVATE,void 0,e),{actions:a,provider:s}}function g(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 l=(o=>(o.INTERNAL="INTERNAL",o.IFRAME="IFRAME",o))(l||{}),d=(o=>(o.EOA="EOA",o.SMART_CONTRACT="SMART_CONTRACT",o))(d||{});const y=64,c="cow-swap://libs/hook-dapp-lib/permit",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"}},[c]:{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 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 u({onContext:o}){const t=window.parent,e=p.getParentOrigin(),s=new p.WidgetEthereumProvider({targetOrigin:e}),a=g(t,e);return r.listenToMessageFromWindow(window,i.CONTEXT_UPDATE,o,e),r.postMessageToWindow(t,i.ACTIVATE,void 0,e),{actions:a,provider:s}}function g(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 l=(o=>(o.INTERNAL="INTERNAL",o.IFRAME="IFRAME",o))(l||{}),d=(o=>(o.EOA="EOA",o.SMART_CONTRACT="SMART_CONTRACT",o))(d||{});const y=64,c="cow-swap://libs/hook-dapp-lib/permit",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.finance/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"}},[c]:{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.finance/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.
2
2
 
3
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
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"}},f=Object.keys(n).reduce((o,t)=>{const e=n[t];return o.push({id:t,...e}),o},[]),v="0xd505accf",k="0x8fcbaf0c";function h(o,t){const e=t.reduce((s,a)=>(s[a.id]=a,s),{});return o.filter(s=>!!s.dappId).map(s=>{const a=s,m=e[a.dappId];return w(a)?{hook:a,dapp:n[c]}:{hook:a,dapp:m||null}})}function w(o){return o.callData.startsWith(v)||o.callData.startsWith(k)}function A(o,t=[]){return h(o,f.concat(t))}exports.CoWHookDappEvents=i;exports.HOOK_DAPP_ID_LENGTH=y;exports.HookDappType=l;exports.HookDappWalletCompatibility=d;exports.PERMIT_HOOK_DAPP_ID=c;exports.doesHookHavePermit=w;exports.hookDappIframeTransport=r;exports.hookDappsRegistry=n;exports.initCoWHookDapp=u;exports.matchHooksToDapps=h;exports.matchHooksToDappsRegistry=A;
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.finance/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.finance/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.finance/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.finance/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.finance/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"}},f=Object.keys(n).reduce((o,t)=>{const e=n[t];return o.push({id:t,...e}),o},[]),v="0xd505accf",k="0x8fcbaf0c";function h(o,t){const e=t.reduce((s,a)=>(s[a.id]=a,s),{});return o.filter(s=>!!s.dappId).map(s=>{const a=s,m=e[a.dappId];return w(a)?{hook:a,dapp:n[c]}:{hook:a,dapp:m||null}})}function w(o){return o.callData.startsWith(v)||o.callData.startsWith(k)}function A(o,t=[]){return h(o,f.concat(t))}exports.CoWHookDappEvents=i;exports.HOOK_DAPP_ID_LENGTH=y;exports.HookDappType=l;exports.HookDappWalletCompatibility=d;exports.PERMIT_HOOK_DAPP_ID=c;exports.doesHookHavePermit=w;exports.hookDappIframeTransport=r;exports.hookDappsRegistry=n;exports.initCoWHookDapp=u;exports.matchHooksToDapps=h;exports.matchHooksToDappsRegistry=A;
package/index.js CHANGED
@@ -4,12 +4,12 @@ const r = new l("cowSwapHookDapp");
4
4
  function T({
5
5
  onContext: o
6
6
  }) {
7
- const t = window.parent, e = d(), a = new h({
7
+ const t = window.parent, e = d(), s = new h({
8
8
  targetOrigin: e
9
- }), s = w(t, e);
9
+ }), a = w(t, e);
10
10
  return r.listenToMessageFromWindow(window, i.CONTEXT_UPDATE, o, e), r.postMessageToWindow(t, i.ACTIVATE, void 0, e), {
11
- actions: s,
12
- provider: a
11
+ actions: a,
12
+ provider: s
13
13
  };
14
14
  }
15
15
  function w(o, t) {
@@ -37,7 +37,7 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
37
37
  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.",
38
38
  image: "https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/apps/cowswap-frontend/src/modules/hooksStore/dapps/BuildHookApp/build.png",
39
39
  version: "v0.1.0",
40
- website: "https://docs.cow.fi/cow-protocol/tutorials/hook-dapp"
40
+ website: "https://docs.cow.finance/cow-protocol/tutorials/hook-dapp"
41
41
  },
42
42
  CLAIM_GNO_FROM_VALIDATORS: {
43
43
  type: "INTERNAL",
@@ -59,7 +59,7 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
59
59
  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.",
60
60
  image: "https://raw.githubusercontent.com/cowprotocol/cowswap/refs/heads/develop/apps/cowswap-frontend/src/modules/hooksStore/dapps/PermitHookApp/icon.png",
61
61
  version: "v0.1.0",
62
- website: "https://docs.cow.fi/cow-protocol/tutorials/hook-dapp",
62
+ website: "https://docs.cow.finance/cow-protocol/tutorials/hook-dapp",
63
63
  conditions: {
64
64
  walletCompatibility: ["EOA"],
65
65
  supportedNetworks: [11155111]
@@ -191,7 +191,7 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
191
191
  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!",
192
192
  version: "0.0.1",
193
193
  website: "https://www.bungee.exchange",
194
- image: "https://files.cow.fi/cow-sdk/bridging/providers/bungee/bungee-logo.png",
194
+ image: "https://files.cow.finance/cow-sdk/bridging/providers/bungee/bungee-logo.png",
195
195
  conditions: {
196
196
  walletCompatibility: ["EOA"]
197
197
  }
@@ -203,7 +203,7 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
203
203
  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.",
204
204
  version: "0.0.1",
205
205
  website: "https://across.to",
206
- image: "https://files.cow.fi/cow-sdk/bridging/providers/across/across-logo.png",
206
+ image: "https://files.cow.finance/cow-sdk/bridging/providers/across/across-logo.png",
207
207
  conditions: {
208
208
  walletCompatibility: ["EOA"]
209
209
  }
@@ -215,7 +215,7 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
215
215
  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.",
216
216
  version: "0.0.1",
217
217
  website: "https://aave.com",
218
- image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
218
+ image: "https://files.cow.finance/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
219
219
  },
220
220
  "cow-sdk://flashloans/aave/v3/debt-swap": {
221
221
  name: "Aave Debt Swap",
@@ -224,7 +224,7 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
224
224
  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.",
225
225
  version: "0.0.1",
226
226
  website: "https://aave.com",
227
- image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
227
+ image: "https://files.cow.finance/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
228
228
  },
229
229
  "cow-sdk://flashloans/aave/v3/repay-with-collateral": {
230
230
  name: "Aave Repay",
@@ -233,7 +233,7 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
233
233
  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.",
234
234
  version: "0.0.1",
235
235
  website: "https://aave.com",
236
- image: "https://files.cow.fi/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
236
+ image: "https://files.cow.finance/token-lists/images/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/logo.png"
237
237
  }
238
238
  }, g = Object.keys(n).reduce((o, t) => {
239
239
  const e = n[t];
@@ -243,14 +243,14 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
243
243
  }), o;
244
244
  }, []), y = "0xd505accf", f = "0x8fcbaf0c";
245
245
  function v(o, t) {
246
- const e = t.reduce((a, s) => (a[s.id] = s, a), {});
247
- return o.filter((a) => !!a.dappId).map((a) => {
248
- const s = a, c = e[s.dappId];
249
- return k(s) ? {
250
- hook: s,
246
+ const e = t.reduce((s, a) => (s[a.id] = a, s), {});
247
+ return o.filter((s) => !!s.dappId).map((s) => {
248
+ const a = s, c = e[a.dappId];
249
+ return k(a) ? {
250
+ hook: a,
251
251
  dapp: n[p]
252
252
  } : {
253
- hook: s,
253
+ hook: a,
254
254
  dapp: c || null
255
255
  };
256
256
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/hook-dapp-lib",
3
- "version": "2.0.13",
3
+ "version": "2.1.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.0.13"
18
+ "@cowprotocol/iframe-transport": "^2.1.0"
19
19
  },
20
20
  "exports": {
21
21
  ".": {