@cowprotocol/hook-dapp-lib 2.2.9 → 2.2.10
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/hookDappIframeTransport.d.ts +8 -8
- package/index.cjs +1 -1
- package/index.js +8 -8
- package/initCoWHookDapp.d.ts +3 -3
- package/package.json +2 -2
- package/types.d.ts +60 -60
- package/utils.d.ts +4 -4
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { IframeTransport } from '@cowprotocol/iframe-transport';
|
|
2
2
|
import { CowHookCreation, CowHookDetails, HookDappContext, TokenData } from './types';
|
|
3
|
-
export declare enum CoWHookDappEvents {
|
|
4
|
-
ACTIVATE = "ACTIVATE",
|
|
5
|
-
CONTEXT_UPDATE = "CONTEXT_UPDATE",
|
|
6
|
-
ADD_HOOK = "ADD_HOOK",
|
|
7
|
-
EDIT_HOOK = "EDIT_HOOK",
|
|
8
|
-
SET_SELL_TOKEN = "SET_SELL_TOKEN",
|
|
9
|
-
SET_BUY_TOKEN = "SET_BUY_TOKEN"
|
|
10
|
-
}
|
|
11
3
|
export interface HookDappEventsPayloadMap {
|
|
12
4
|
[CoWHookDappEvents.ACTIVATE]: void;
|
|
13
5
|
[CoWHookDappEvents.CONTEXT_UPDATE]: HookDappContext;
|
|
@@ -16,4 +8,12 @@ export interface HookDappEventsPayloadMap {
|
|
|
16
8
|
[CoWHookDappEvents.SET_SELL_TOKEN]: TokenData;
|
|
17
9
|
[CoWHookDappEvents.SET_BUY_TOKEN]: TokenData;
|
|
18
10
|
}
|
|
11
|
+
export declare enum CoWHookDappEvents {
|
|
12
|
+
ACTIVATE = "ACTIVATE",
|
|
13
|
+
CONTEXT_UPDATE = "CONTEXT_UPDATE",
|
|
14
|
+
ADD_HOOK = "ADD_HOOK",
|
|
15
|
+
EDIT_HOOK = "EDIT_HOOK",
|
|
16
|
+
SET_SELL_TOKEN = "SET_SELL_TOKEN",
|
|
17
|
+
SET_BUY_TOKEN = "SET_BUY_TOKEN"
|
|
18
|
+
}
|
|
19
19
|
export declare const hookDappIframeTransport: IframeTransport<HookDappEventsPayloadMap>;
|
package/index.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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
|
|
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){return o.callData.startsWith(v)||o.callData.startsWith(k)}function w(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 h(a)?{hook:a,dapp:n[c]}:{hook:a,dapp:m||null}})}function A(o,t=[]){return w(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=h;exports.hookDappIframeTransport=r;exports.hookDappsRegistry=n;exports.initCoWHookDapp=u;exports.matchHooksToDapps=w;exports.matchHooksToDappsRegistry=A;
|
package/index.js
CHANGED
|
@@ -242,11 +242,14 @@ const b = 64, p = "cow-swap://libs/hook-dapp-lib/permit", n = {
|
|
|
242
242
|
...e
|
|
243
243
|
}), o;
|
|
244
244
|
}, []), y = "0xd505accf", f = "0x8fcbaf0c";
|
|
245
|
-
function v(o
|
|
245
|
+
function v(o) {
|
|
246
|
+
return o.callData.startsWith(y) || o.callData.startsWith(f);
|
|
247
|
+
}
|
|
248
|
+
function k(o, t) {
|
|
246
249
|
const e = t.reduce((a, s) => (a[s.id] = s, a), {});
|
|
247
250
|
return o.filter((a) => !!a.dappId).map((a) => {
|
|
248
251
|
const s = a, c = e[s.dappId];
|
|
249
|
-
return
|
|
252
|
+
return v(s) ? {
|
|
250
253
|
hook: s,
|
|
251
254
|
dapp: n[p]
|
|
252
255
|
} : {
|
|
@@ -255,11 +258,8 @@ function v(o, t) {
|
|
|
255
258
|
};
|
|
256
259
|
});
|
|
257
260
|
}
|
|
258
|
-
function k(o) {
|
|
259
|
-
return o.callData.startsWith(y) || o.callData.startsWith(f);
|
|
260
|
-
}
|
|
261
261
|
function E(o, t = []) {
|
|
262
|
-
return
|
|
262
|
+
return k(o, g.concat(t));
|
|
263
263
|
}
|
|
264
264
|
export {
|
|
265
265
|
i as CoWHookDappEvents,
|
|
@@ -267,10 +267,10 @@ export {
|
|
|
267
267
|
u as HookDappType,
|
|
268
268
|
m as HookDappWalletCompatibility,
|
|
269
269
|
p as PERMIT_HOOK_DAPP_ID,
|
|
270
|
-
|
|
270
|
+
v as doesHookHavePermit,
|
|
271
271
|
r as hookDappIframeTransport,
|
|
272
272
|
n as hookDappsRegistry,
|
|
273
273
|
T as initCoWHookDapp,
|
|
274
|
-
|
|
274
|
+
k as matchHooksToDapps,
|
|
275
275
|
E as matchHooksToDappsRegistry
|
|
276
276
|
};
|
package/initCoWHookDapp.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { WidgetEthereumProvider } from '@cowprotocol/iframe-transport';
|
|
2
2
|
import { CoWHookDappActions, HookDappContext } from './types';
|
|
3
|
-
interface CoWHookDappInit {
|
|
4
|
-
onContext(context: HookDappContext): void;
|
|
5
|
-
}
|
|
6
3
|
export interface CoWHookDappHandler {
|
|
7
4
|
actions: CoWHookDappActions;
|
|
8
5
|
provider: WidgetEthereumProvider;
|
|
9
6
|
}
|
|
7
|
+
interface CoWHookDappInit {
|
|
8
|
+
onContext(context: HookDappContext): void;
|
|
9
|
+
}
|
|
10
10
|
export declare function initCoWHookDapp({ onContext }: CoWHookDappInit): CoWHookDappHandler;
|
|
11
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cowprotocol/hook-dapp-lib",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.10",
|
|
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.
|
|
18
|
+
"@cowprotocol/iframe-transport": "^2.3.3"
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
package/types.d.ts
CHANGED
|
@@ -5,17 +5,15 @@ export interface CowHook {
|
|
|
5
5
|
gasLimit: string;
|
|
6
6
|
dappId: string;
|
|
7
7
|
}
|
|
8
|
-
export interface HookDappConditions {
|
|
9
|
-
position?: 'post' | 'pre';
|
|
10
|
-
walletCompatibility?: HookDappWalletCompatibility[];
|
|
11
|
-
supportedNetworks?: number[];
|
|
12
|
-
}
|
|
13
8
|
export interface CowHookCreation {
|
|
14
9
|
hook: Omit<CowHook, 'dappId'>;
|
|
15
10
|
recipientOverride?: string;
|
|
16
11
|
}
|
|
17
|
-
export interface
|
|
18
|
-
|
|
12
|
+
export interface CoWHookDappActions {
|
|
13
|
+
addHook(payload: CowHookCreation): void;
|
|
14
|
+
editHook(payload: CowHookToEdit): void;
|
|
15
|
+
setSellToken(token: TokenData): void;
|
|
16
|
+
setBuyToken(token: TokenData): void;
|
|
19
17
|
}
|
|
20
18
|
export interface CowHookDetails extends CowHookCreation {
|
|
21
19
|
hook: CowHook;
|
|
@@ -24,11 +22,32 @@ export interface CowHookDetails extends CowHookCreation {
|
|
|
24
22
|
export interface CowHookToEdit extends CowHookCreation {
|
|
25
23
|
uuid: string;
|
|
26
24
|
}
|
|
27
|
-
export interface
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
export interface HookDappBase {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
descriptionShort?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
type: HookDappType;
|
|
31
|
+
version: string;
|
|
32
|
+
website: string;
|
|
33
|
+
image: string;
|
|
34
|
+
conditions?: HookDappConditions;
|
|
35
|
+
}
|
|
36
|
+
export interface HookDappConditions {
|
|
37
|
+
position?: 'post' | 'pre';
|
|
38
|
+
walletCompatibility?: HookDappWalletCompatibility[];
|
|
39
|
+
supportedNetworks?: number[];
|
|
40
|
+
}
|
|
41
|
+
export interface HookDappContext {
|
|
42
|
+
chainId: number;
|
|
43
|
+
account?: string;
|
|
44
|
+
orderParams: HookDappOrderParams | null;
|
|
45
|
+
hookToEdit?: CowHookDetails;
|
|
46
|
+
isSmartContract: boolean | undefined;
|
|
47
|
+
isPreHook: boolean;
|
|
48
|
+
isDarkMode: boolean;
|
|
49
|
+
balancesDiff: Record<string, Record<string, string>>;
|
|
50
|
+
stateDiff: StateDiff[];
|
|
32
51
|
}
|
|
33
52
|
export interface HookDappOrderParams {
|
|
34
53
|
kind: 'buy' | 'sell';
|
|
@@ -39,6 +58,35 @@ export interface HookDappOrderParams {
|
|
|
39
58
|
sellAmount: string;
|
|
40
59
|
buyAmount: string;
|
|
41
60
|
}
|
|
61
|
+
export interface StateDiff {
|
|
62
|
+
address: string;
|
|
63
|
+
soltype: SoltypeElement | null;
|
|
64
|
+
original: string | Record<string, unknown>;
|
|
65
|
+
dirty: string | Record<string, unknown>;
|
|
66
|
+
raw: RawElement[];
|
|
67
|
+
}
|
|
68
|
+
export interface TokenData {
|
|
69
|
+
address: string;
|
|
70
|
+
}
|
|
71
|
+
interface RawElement {
|
|
72
|
+
address: string;
|
|
73
|
+
key: string;
|
|
74
|
+
original: string;
|
|
75
|
+
dirty: string;
|
|
76
|
+
}
|
|
77
|
+
interface SoltypeElement {
|
|
78
|
+
name: string;
|
|
79
|
+
type: SoltypeType;
|
|
80
|
+
storage_location: StorageLocation;
|
|
81
|
+
components: SoltypeElement[] | null;
|
|
82
|
+
offset: number;
|
|
83
|
+
index: string;
|
|
84
|
+
indexed: boolean;
|
|
85
|
+
simple_type?: Type;
|
|
86
|
+
}
|
|
87
|
+
interface Type {
|
|
88
|
+
type: SimpleTypeType;
|
|
89
|
+
}
|
|
42
90
|
declare enum SimpleTypeType {
|
|
43
91
|
Address = "address",
|
|
44
92
|
Bool = "bool",
|
|
@@ -47,9 +95,6 @@ declare enum SimpleTypeType {
|
|
|
47
95
|
String = "string",
|
|
48
96
|
Uint = "uint"
|
|
49
97
|
}
|
|
50
|
-
interface Type {
|
|
51
|
-
type: SimpleTypeType;
|
|
52
|
-
}
|
|
53
98
|
declare enum SoltypeType {
|
|
54
99
|
Address = "address",
|
|
55
100
|
Bool = "bool",
|
|
@@ -72,49 +117,4 @@ declare enum StorageLocation {
|
|
|
72
117
|
Memory = "memory",
|
|
73
118
|
Storage = "storage"
|
|
74
119
|
}
|
|
75
|
-
interface SoltypeElement {
|
|
76
|
-
name: string;
|
|
77
|
-
type: SoltypeType;
|
|
78
|
-
storage_location: StorageLocation;
|
|
79
|
-
components: SoltypeElement[] | null;
|
|
80
|
-
offset: number;
|
|
81
|
-
index: string;
|
|
82
|
-
indexed: boolean;
|
|
83
|
-
simple_type?: Type;
|
|
84
|
-
}
|
|
85
|
-
interface RawElement {
|
|
86
|
-
address: string;
|
|
87
|
-
key: string;
|
|
88
|
-
original: string;
|
|
89
|
-
dirty: string;
|
|
90
|
-
}
|
|
91
|
-
export interface StateDiff {
|
|
92
|
-
address: string;
|
|
93
|
-
soltype: SoltypeElement | null;
|
|
94
|
-
original: string | Record<string, unknown>;
|
|
95
|
-
dirty: string | Record<string, unknown>;
|
|
96
|
-
raw: RawElement[];
|
|
97
|
-
}
|
|
98
|
-
export interface HookDappContext {
|
|
99
|
-
chainId: number;
|
|
100
|
-
account?: string;
|
|
101
|
-
orderParams: HookDappOrderParams | null;
|
|
102
|
-
hookToEdit?: CowHookDetails;
|
|
103
|
-
isSmartContract: boolean | undefined;
|
|
104
|
-
isPreHook: boolean;
|
|
105
|
-
isDarkMode: boolean;
|
|
106
|
-
balancesDiff: Record<string, Record<string, string>>;
|
|
107
|
-
stateDiff: StateDiff[];
|
|
108
|
-
}
|
|
109
|
-
export interface HookDappBase {
|
|
110
|
-
id: string;
|
|
111
|
-
name: string;
|
|
112
|
-
descriptionShort?: string;
|
|
113
|
-
description?: string;
|
|
114
|
-
type: HookDappType;
|
|
115
|
-
version: string;
|
|
116
|
-
website: string;
|
|
117
|
-
image: string;
|
|
118
|
-
conditions?: HookDappConditions;
|
|
119
|
-
}
|
|
120
120
|
export {};
|
package/utils.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CowHook, HookDappBase } from './types';
|
|
2
|
-
type StrictCowHook = Omit<CowHook, 'dappId'> & {
|
|
3
|
-
dappId?: string;
|
|
4
|
-
};
|
|
5
2
|
export interface HookToDappMatch {
|
|
6
3
|
dapp: HookDappBase | null;
|
|
7
4
|
hook: CowHook;
|
|
8
5
|
}
|
|
9
|
-
|
|
6
|
+
type StrictCowHook = Omit<CowHook, 'dappId'> & {
|
|
7
|
+
dappId?: string;
|
|
8
|
+
};
|
|
10
9
|
export declare function doesHookHavePermit(hook: {
|
|
11
10
|
callData: string;
|
|
12
11
|
}): boolean;
|
|
12
|
+
export declare function matchHooksToDapps(hooks: StrictCowHook[], dapps: HookDappBase[]): HookToDappMatch[];
|
|
13
13
|
export declare function matchHooksToDappsRegistry(hooks: StrictCowHook[], additionalHookDapps?: HookDappBase[]): HookToDappMatch[];
|
|
14
14
|
export {};
|