@kittycorn-labs/v4-sdk 1.1.30 → 2.0.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 +9 -0
- package/dist/{PositionManager.d.ts → cjs/src/PositionManager.d.ts} +169 -169
- package/dist/cjs/src/PositionManager.js +242 -0
- package/dist/cjs/src/PositionManager.js.map +1 -0
- package/dist/cjs/src/abis/IMulticall.json +23 -0
- package/dist/{actionConstants.d.ts → cjs/src/actionConstants.d.ts} +1 -1
- package/dist/cjs/src/actionConstants.js +6 -0
- package/dist/cjs/src/actionConstants.js.map +1 -0
- package/dist/{entities → cjs/src/entities}/index.d.ts +4 -4
- package/dist/cjs/src/entities/index.js +8 -0
- package/dist/cjs/src/entities/index.js.map +1 -0
- package/dist/{entities → cjs/src/entities}/pool.d.ts +103 -103
- package/dist/cjs/src/entities/pool.js +196 -0
- package/dist/cjs/src/entities/pool.js.map +1 -0
- package/dist/{entities → cjs/src/entities}/position.d.ts +144 -144
- package/dist/cjs/src/entities/position.js +273 -0
- package/dist/cjs/src/entities/position.js.map +1 -0
- package/dist/{entities → cjs/src/entities}/route.d.ts +28 -28
- package/dist/cjs/src/entities/route.js +89 -0
- package/dist/cjs/src/entities/route.js.map +1 -0
- package/dist/{entities → cjs/src/entities}/trade.d.ts +220 -220
- package/dist/cjs/src/entities/trade.js +441 -0
- package/dist/cjs/src/entities/trade.js.map +1 -0
- package/dist/{index.d.ts → cjs/src/index.d.ts} +4 -4
- package/dist/cjs/src/index.js +8 -0
- package/dist/cjs/src/index.js.map +1 -0
- package/dist/{internalConstants.d.ts → cjs/src/internalConstants.d.ts} +46 -46
- package/dist/cjs/src/internalConstants.js +69 -0
- package/dist/cjs/src/internalConstants.js.map +1 -0
- package/dist/{multicall.d.ts → cjs/src/multicall.d.ts} +10 -10
- package/dist/cjs/src/multicall.js +26 -0
- package/dist/cjs/src/multicall.js.map +1 -0
- package/dist/cjs/src/tokenize.d.ts +17 -0
- package/dist/cjs/src/tokenize.js +42 -0
- package/dist/cjs/src/tokenize.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/calldata.d.ts +20 -20
- package/dist/cjs/src/utils/calldata.js +20 -0
- package/dist/cjs/src/utils/calldata.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/currencyMap.d.ts +2 -2
- package/dist/cjs/src/utils/currencyMap.js +15 -0
- package/dist/cjs/src/utils/currencyMap.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/encodeRouteToPath.d.ts +10 -10
- package/dist/cjs/src/utils/encodeRouteToPath.js +26 -0
- package/dist/cjs/src/utils/encodeRouteToPath.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/hook.d.ts +45 -45
- package/dist/cjs/src/utils/hook.js +97 -0
- package/dist/cjs/src/utils/hook.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/index.d.ts +11 -11
- package/dist/cjs/src/utils/index.js +15 -0
- package/dist/cjs/src/utils/index.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/pathCurrency.d.ts +4 -4
- package/dist/cjs/src/utils/pathCurrency.js +27 -0
- package/dist/cjs/src/utils/pathCurrency.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/positionManagerAbi.d.ts +102 -102
- package/dist/cjs/src/utils/positionManagerAbi.js +1318 -0
- package/dist/cjs/src/utils/positionManagerAbi.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/priceTickConversions.d.ts +20 -20
- package/dist/cjs/src/utils/priceTickConversions.js +55 -0
- package/dist/cjs/src/utils/priceTickConversions.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/sortsBefore.d.ts +2 -2
- package/dist/cjs/src/utils/sortsBefore.js +12 -0
- package/dist/cjs/src/utils/sortsBefore.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/v4BaseActionsParser.d.ts +49 -45
- package/dist/cjs/src/utils/v4BaseActionsParser.js +193 -0
- package/dist/cjs/src/utils/v4BaseActionsParser.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/v4Planner.d.ts +71 -55
- package/dist/cjs/src/utils/v4Planner.js +267 -0
- package/dist/cjs/src/utils/v4Planner.js.map +1 -0
- package/dist/{utils → cjs/src/utils}/v4PositionPlanner.d.ts +13 -12
- package/dist/cjs/src/utils/v4PositionPlanner.js +61 -0
- package/dist/cjs/src/utils/v4PositionPlanner.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/src/PositionManager.d.ts +169 -0
- package/dist/esm/src/PositionManager.js +237 -0
- package/dist/esm/src/PositionManager.js.map +1 -0
- package/dist/esm/src/abis/IMulticall.json +23 -0
- package/dist/esm/src/actionConstants.d.ts +1 -0
- package/dist/esm/src/actionConstants.js +3 -0
- package/dist/esm/src/actionConstants.js.map +1 -0
- package/dist/esm/src/entities/index.d.ts +4 -0
- package/dist/esm/src/entities/index.js +5 -0
- package/dist/esm/src/entities/index.js.map +1 -0
- package/dist/esm/src/entities/pool.d.ts +103 -0
- package/dist/esm/src/entities/pool.js +191 -0
- package/dist/esm/src/entities/pool.js.map +1 -0
- package/dist/esm/src/entities/position.d.ts +144 -0
- package/dist/esm/src/entities/position.js +268 -0
- package/dist/esm/src/entities/position.js.map +1 -0
- package/dist/esm/src/entities/route.d.ts +28 -0
- package/dist/esm/src/entities/route.js +84 -0
- package/dist/esm/src/entities/route.js.map +1 -0
- package/dist/esm/src/entities/trade.d.ts +220 -0
- package/dist/esm/src/entities/trade.js +435 -0
- package/dist/esm/src/entities/trade.js.map +1 -0
- package/dist/esm/src/index.d.ts +4 -0
- package/dist/esm/src/index.js +5 -0
- package/dist/esm/src/index.js.map +1 -0
- package/dist/esm/src/internalConstants.d.ts +46 -0
- package/dist/esm/src/internalConstants.js +65 -0
- package/dist/esm/src/internalConstants.js.map +1 -0
- package/dist/esm/src/multicall.d.ts +10 -0
- package/dist/esm/src/multicall.js +21 -0
- package/dist/esm/src/multicall.js.map +1 -0
- package/dist/esm/src/tokenize.d.ts +17 -0
- package/dist/esm/src/tokenize.js +37 -0
- package/dist/esm/src/tokenize.js.map +1 -0
- package/dist/esm/src/utils/calldata.d.ts +20 -0
- package/dist/esm/src/utils/calldata.js +15 -0
- package/dist/esm/src/utils/calldata.js.map +1 -0
- package/dist/esm/src/utils/currencyMap.d.ts +2 -0
- package/dist/esm/src/utils/currencyMap.js +11 -0
- package/dist/esm/src/utils/currencyMap.js.map +1 -0
- package/dist/esm/src/utils/encodeRouteToPath.d.ts +10 -0
- package/dist/esm/src/utils/encodeRouteToPath.js +22 -0
- package/dist/esm/src/utils/encodeRouteToPath.js.map +1 -0
- package/dist/esm/src/utils/hook.d.ts +45 -0
- package/dist/esm/src/utils/hook.js +92 -0
- package/dist/esm/src/utils/hook.js.map +1 -0
- package/dist/esm/src/utils/index.d.ts +11 -0
- package/dist/esm/src/utils/index.js +12 -0
- package/dist/esm/src/utils/index.js.map +1 -0
- package/dist/esm/src/utils/pathCurrency.d.ts +4 -0
- package/dist/esm/src/utils/pathCurrency.js +22 -0
- package/dist/esm/src/utils/pathCurrency.js.map +1 -0
- package/dist/esm/src/utils/positionManagerAbi.d.ts +102 -0
- package/dist/esm/src/utils/positionManagerAbi.js +1315 -0
- package/dist/esm/src/utils/positionManagerAbi.js.map +1 -0
- package/dist/esm/src/utils/priceTickConversions.d.ts +20 -0
- package/dist/esm/src/utils/priceTickConversions.js +49 -0
- package/dist/esm/src/utils/priceTickConversions.js.map +1 -0
- package/dist/esm/src/utils/sortsBefore.d.ts +2 -0
- package/dist/esm/src/utils/sortsBefore.js +8 -0
- package/dist/esm/src/utils/sortsBefore.js.map +1 -0
- package/dist/esm/src/utils/v4BaseActionsParser.d.ts +49 -0
- package/dist/esm/src/utils/v4BaseActionsParser.js +189 -0
- package/dist/esm/src/utils/v4BaseActionsParser.js.map +1 -0
- package/dist/esm/src/utils/v4Planner.d.ts +71 -0
- package/dist/esm/src/utils/v4Planner.js +261 -0
- package/dist/esm/src/utils/v4Planner.js.map +1 -0
- package/dist/esm/src/utils/v4PositionPlanner.d.ts +13 -0
- package/dist/esm/src/utils/v4PositionPlanner.js +57 -0
- package/dist/esm/src/utils/v4PositionPlanner.js.map +1 -0
- package/dist/types/src/PositionManager.d.ts +170 -0
- package/dist/types/src/PositionManager.d.ts.map +1 -0
- package/dist/types/src/actionConstants.d.ts +2 -0
- package/dist/types/src/actionConstants.d.ts.map +1 -0
- package/dist/types/src/entities/index.d.ts +5 -0
- package/dist/types/src/entities/index.d.ts.map +1 -0
- package/dist/types/src/entities/pool.d.ts +104 -0
- package/dist/types/src/entities/pool.d.ts.map +1 -0
- package/dist/types/src/entities/position.d.ts +145 -0
- package/dist/types/src/entities/position.d.ts.map +1 -0
- package/dist/types/src/entities/route.d.ts +29 -0
- package/dist/types/src/entities/route.d.ts.map +1 -0
- package/dist/types/src/entities/trade.d.ts +221 -0
- package/dist/types/src/entities/trade.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/internalConstants.d.ts +47 -0
- package/dist/types/src/internalConstants.d.ts.map +1 -0
- package/dist/types/src/multicall.d.ts +11 -0
- package/dist/types/src/multicall.d.ts.map +1 -0
- package/dist/types/src/tokenize.d.ts +18 -0
- package/dist/types/src/tokenize.d.ts.map +1 -0
- package/dist/types/src/utils/calldata.d.ts +21 -0
- package/dist/types/src/utils/calldata.d.ts.map +1 -0
- package/dist/types/src/utils/currencyMap.d.ts +3 -0
- package/dist/types/src/utils/currencyMap.d.ts.map +1 -0
- package/dist/types/src/utils/encodeRouteToPath.d.ts +11 -0
- package/dist/types/src/utils/encodeRouteToPath.d.ts.map +1 -0
- package/dist/types/src/utils/hook.d.ts +46 -0
- package/dist/types/src/utils/hook.d.ts.map +1 -0
- package/dist/types/src/utils/index.d.ts +12 -0
- package/dist/types/src/utils/index.d.ts.map +1 -0
- package/dist/types/src/utils/pathCurrency.d.ts +5 -0
- package/dist/types/src/utils/pathCurrency.d.ts.map +1 -0
- package/dist/types/src/utils/positionManagerAbi.d.ts +103 -0
- package/dist/types/src/utils/positionManagerAbi.d.ts.map +1 -0
- package/dist/types/src/utils/priceTickConversions.d.ts +21 -0
- package/dist/types/src/utils/priceTickConversions.d.ts.map +1 -0
- package/dist/types/src/utils/sortsBefore.d.ts +3 -0
- package/dist/types/src/utils/sortsBefore.d.ts.map +1 -0
- package/dist/types/src/utils/v4BaseActionsParser.d.ts +50 -0
- package/dist/types/src/utils/v4BaseActionsParser.d.ts.map +1 -0
- package/dist/types/src/utils/v4Planner.d.ts +72 -0
- package/dist/types/src/utils/v4Planner.d.ts.map +1 -0
- package/dist/types/src/utils/v4PositionPlanner.d.ts +14 -0
- package/dist/types/src/utils/v4PositionPlanner.d.ts.map +1 -0
- package/package.json +28 -46
- package/dist/index.js +0 -8
- package/dist/tokenizeAddresses.d.ts +0 -25
- package/dist/v4-sdk.cjs.development.js +0 -3633
- package/dist/v4-sdk.cjs.development.js.map +0 -1
- package/dist/v4-sdk.cjs.production.min.js +0 -2
- package/dist/v4-sdk.cjs.production.min.js.map +0 -1
- package/dist/v4-sdk.esm.js +0 -3597
- package/dist/v4-sdk.esm.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
> **Kittycorn / Ethers v5 dependency security**
|
|
2
|
+
> Applications combining these SDKs with Ethers v5 must put the following override in their root `package.json`, then run `npm install` and `npm audit`. npm does not inherit dependency-package overrides.
|
|
3
|
+
>
|
|
4
|
+
> ```json
|
|
5
|
+
> { "overrides": { "@ethersproject/providers": { "ws": "8.21.0" } } }
|
|
6
|
+
> ```
|
|
7
|
+
>
|
|
8
|
+
> Ethers v5 also retains an unpatched Low [elliptic advisory](https://github.com/advisories/GHSA-848j-6mx2-7j84). The Kittycorn integration builds quotes/calldata and uses external signers; it does not generate signatures from user private keys. This is a scope assessment, not a fix for elliptic.
|
|
9
|
+
|
|
@@ -1,169 +1,169 @@
|
|
|
1
|
-
import { BigintIsh, Percent, NativeCurrency } from '@kittycorn-labs/sdk-core';
|
|
2
|
-
import { TypedDataDomain, TypedDataField } from '@ethersproject/abstract-signer';
|
|
3
|
-
import { Position } from './entities/position';
|
|
4
|
-
import { MethodParameters } from './utils/calldata';
|
|
5
|
-
import { Interface } from '@ethersproject/abi';
|
|
6
|
-
import { PoolKey } from './entities';
|
|
7
|
-
export interface CommonOptions {
|
|
8
|
-
/**
|
|
9
|
-
* How much the pool price is allowed to move from the specified action.
|
|
10
|
-
*/
|
|
11
|
-
slippageTolerance: Percent;
|
|
12
|
-
/**
|
|
13
|
-
* Optional data to pass to hooks
|
|
14
|
-
*/
|
|
15
|
-
hookData?: string;
|
|
16
|
-
/**
|
|
17
|
-
* When the transaction expires, in epoch seconds.
|
|
18
|
-
*/
|
|
19
|
-
deadline: BigintIsh;
|
|
20
|
-
}
|
|
21
|
-
export interface ModifyPositionSpecificOptions {
|
|
22
|
-
/**
|
|
23
|
-
* Indicates the ID of the position to increase liquidity for.
|
|
24
|
-
*/
|
|
25
|
-
tokenId: BigintIsh;
|
|
26
|
-
}
|
|
27
|
-
export interface MintSpecificOptions {
|
|
28
|
-
/**
|
|
29
|
-
* The account that should receive the minted NFT.
|
|
30
|
-
*/
|
|
31
|
-
recipient: string;
|
|
32
|
-
/**
|
|
33
|
-
* Creates pool if not initialized before mint.
|
|
34
|
-
*/
|
|
35
|
-
createPool?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Initial price to set on the pool if creating
|
|
38
|
-
*/
|
|
39
|
-
sqrtPriceX96?: BigintIsh;
|
|
40
|
-
/**
|
|
41
|
-
* Whether the mint is part of a migration from V3 to V4.
|
|
42
|
-
*/
|
|
43
|
-
migrate?: boolean;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Options for producing the calldata to add liquidity.
|
|
47
|
-
*/
|
|
48
|
-
export interface CommonAddLiquidityOptions {
|
|
49
|
-
/**
|
|
50
|
-
* Whether to spend ether. If true, one of the currencies must be the NATIVE currency.
|
|
51
|
-
*/
|
|
52
|
-
useNative?: NativeCurrency;
|
|
53
|
-
/**
|
|
54
|
-
* The optional permit2 batch permit parameters for spending token0 and token1
|
|
55
|
-
*/
|
|
56
|
-
batchPermit?: BatchPermitOptions;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Options for producing the calldata to exit a position.
|
|
60
|
-
*/
|
|
61
|
-
export interface RemoveLiquiditySpecificOptions {
|
|
62
|
-
/**
|
|
63
|
-
* The percentage of position liquidity to exit.
|
|
64
|
-
*/
|
|
65
|
-
liquidityPercentage: Percent;
|
|
66
|
-
/**
|
|
67
|
-
* Whether the NFT should be burned if the entire position is being exited, by default false.
|
|
68
|
-
*/
|
|
69
|
-
burnToken?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT
|
|
72
|
-
*/
|
|
73
|
-
permit?: NFTPermitOptions;
|
|
74
|
-
}
|
|
75
|
-
export interface CollectSpecificOptions {
|
|
76
|
-
/**
|
|
77
|
-
* Indicates the ID of the position to collect for.
|
|
78
|
-
*/
|
|
79
|
-
tokenId: BigintIsh;
|
|
80
|
-
/**
|
|
81
|
-
* The account that should receive the tokens.
|
|
82
|
-
*/
|
|
83
|
-
recipient: string;
|
|
84
|
-
}
|
|
85
|
-
export interface TransferOptions {
|
|
86
|
-
/**
|
|
87
|
-
* The account sending the NFT.
|
|
88
|
-
*/
|
|
89
|
-
sender: string;
|
|
90
|
-
/**
|
|
91
|
-
* The account that should receive the NFT.
|
|
92
|
-
*/
|
|
93
|
-
recipient: string;
|
|
94
|
-
/**
|
|
95
|
-
* The id of the token being sent.
|
|
96
|
-
*/
|
|
97
|
-
tokenId: BigintIsh;
|
|
98
|
-
}
|
|
99
|
-
export interface PermitDetails {
|
|
100
|
-
token: string;
|
|
101
|
-
amount: BigintIsh;
|
|
102
|
-
expiration: BigintIsh;
|
|
103
|
-
nonce: BigintIsh;
|
|
104
|
-
}
|
|
105
|
-
export interface AllowanceTransferPermitSingle {
|
|
106
|
-
details: PermitDetails;
|
|
107
|
-
spender: string;
|
|
108
|
-
sigDeadline: BigintIsh;
|
|
109
|
-
}
|
|
110
|
-
export interface AllowanceTransferPermitBatch {
|
|
111
|
-
details: PermitDetails[];
|
|
112
|
-
spender: string;
|
|
113
|
-
sigDeadline: BigintIsh;
|
|
114
|
-
}
|
|
115
|
-
export interface BatchPermitOptions {
|
|
116
|
-
owner: string;
|
|
117
|
-
permitBatch: AllowanceTransferPermitBatch;
|
|
118
|
-
signature: string;
|
|
119
|
-
}
|
|
120
|
-
export interface NFTPermitValues {
|
|
121
|
-
spender: string;
|
|
122
|
-
tokenId: BigintIsh;
|
|
123
|
-
deadline: BigintIsh;
|
|
124
|
-
nonce: BigintIsh;
|
|
125
|
-
}
|
|
126
|
-
export interface NFTPermitOptions extends NFTPermitValues {
|
|
127
|
-
signature: string;
|
|
128
|
-
}
|
|
129
|
-
export interface NFTPermitData {
|
|
130
|
-
domain: TypedDataDomain;
|
|
131
|
-
types: Record<string, TypedDataField[]>;
|
|
132
|
-
values: NFTPermitValues;
|
|
133
|
-
}
|
|
134
|
-
export
|
|
135
|
-
export
|
|
136
|
-
export
|
|
137
|
-
export
|
|
138
|
-
export
|
|
139
|
-
export declare abstract class V4PositionManager {
|
|
140
|
-
static INTERFACE: Interface;
|
|
141
|
-
/**
|
|
142
|
-
* Cannot be constructed.
|
|
143
|
-
*/
|
|
144
|
-
private constructor();
|
|
145
|
-
/**
|
|
146
|
-
* Public methods to encode method parameters for different actions on the PositionManager contract
|
|
147
|
-
*/
|
|
148
|
-
static createCallParameters(poolKey: PoolKey, sqrtPriceX96: BigintIsh): MethodParameters;
|
|
149
|
-
static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters;
|
|
150
|
-
/**
|
|
151
|
-
* Produces the calldata for completely or partially exiting a position
|
|
152
|
-
* @param position The position to exit
|
|
153
|
-
* @param options Additional information necessary for generating the calldata
|
|
154
|
-
* @returns The call parameters
|
|
155
|
-
*/
|
|
156
|
-
static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters;
|
|
157
|
-
/**
|
|
158
|
-
* Produces the calldata for collecting fees from a position
|
|
159
|
-
* @param position The position to collect fees from
|
|
160
|
-
* @param options Additional information necessary for generating the calldata
|
|
161
|
-
* @returns The call parameters
|
|
162
|
-
*/
|
|
163
|
-
static collectCallParameters(position: Position, options: CollectOptions): MethodParameters;
|
|
164
|
-
private static encodeInitializePool;
|
|
165
|
-
static encodeModifyLiquidities(unlockData: string, deadline: BigintIsh): string;
|
|
166
|
-
static encodePermitBatch(owner: string, permitBatch: AllowanceTransferPermitBatch, signature: string): string;
|
|
167
|
-
static encodeERC721Permit(spender: string, tokenId: BigintIsh, deadline: BigintIsh, nonce: BigintIsh, signature: string): string;
|
|
168
|
-
static getPermitData(permit: NFTPermitValues, positionManagerAddress: string, chainId: number): NFTPermitData;
|
|
169
|
-
}
|
|
1
|
+
import { BigintIsh, Percent, NativeCurrency } from '@kittycorn-labs/sdk-core';
|
|
2
|
+
import { TypedDataDomain, TypedDataField } from '@ethersproject/abstract-signer';
|
|
3
|
+
import { Position } from './entities/position';
|
|
4
|
+
import { MethodParameters } from './utils/calldata';
|
|
5
|
+
import { Interface } from '@ethersproject/abi';
|
|
6
|
+
import { PoolKey } from './entities';
|
|
7
|
+
export interface CommonOptions {
|
|
8
|
+
/**
|
|
9
|
+
* How much the pool price is allowed to move from the specified action.
|
|
10
|
+
*/
|
|
11
|
+
slippageTolerance: Percent;
|
|
12
|
+
/**
|
|
13
|
+
* Optional data to pass to hooks
|
|
14
|
+
*/
|
|
15
|
+
hookData?: string;
|
|
16
|
+
/**
|
|
17
|
+
* When the transaction expires, in epoch seconds.
|
|
18
|
+
*/
|
|
19
|
+
deadline: BigintIsh;
|
|
20
|
+
}
|
|
21
|
+
export interface ModifyPositionSpecificOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Indicates the ID of the position to increase liquidity for.
|
|
24
|
+
*/
|
|
25
|
+
tokenId: BigintIsh;
|
|
26
|
+
}
|
|
27
|
+
export interface MintSpecificOptions {
|
|
28
|
+
/**
|
|
29
|
+
* The account that should receive the minted NFT.
|
|
30
|
+
*/
|
|
31
|
+
recipient: string;
|
|
32
|
+
/**
|
|
33
|
+
* Creates pool if not initialized before mint.
|
|
34
|
+
*/
|
|
35
|
+
createPool?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Initial price to set on the pool if creating
|
|
38
|
+
*/
|
|
39
|
+
sqrtPriceX96?: BigintIsh;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the mint is part of a migration from V3 to V4.
|
|
42
|
+
*/
|
|
43
|
+
migrate?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Options for producing the calldata to add liquidity.
|
|
47
|
+
*/
|
|
48
|
+
export interface CommonAddLiquidityOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Whether to spend ether. If true, one of the currencies must be the NATIVE currency.
|
|
51
|
+
*/
|
|
52
|
+
useNative?: NativeCurrency;
|
|
53
|
+
/**
|
|
54
|
+
* The optional permit2 batch permit parameters for spending token0 and token1
|
|
55
|
+
*/
|
|
56
|
+
batchPermit?: BatchPermitOptions;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Options for producing the calldata to exit a position.
|
|
60
|
+
*/
|
|
61
|
+
export interface RemoveLiquiditySpecificOptions {
|
|
62
|
+
/**
|
|
63
|
+
* The percentage of position liquidity to exit.
|
|
64
|
+
*/
|
|
65
|
+
liquidityPercentage: Percent;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the NFT should be burned if the entire position is being exited, by default false.
|
|
68
|
+
*/
|
|
69
|
+
burnToken?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT
|
|
72
|
+
*/
|
|
73
|
+
permit?: NFTPermitOptions;
|
|
74
|
+
}
|
|
75
|
+
export interface CollectSpecificOptions {
|
|
76
|
+
/**
|
|
77
|
+
* Indicates the ID of the position to collect for.
|
|
78
|
+
*/
|
|
79
|
+
tokenId: BigintIsh;
|
|
80
|
+
/**
|
|
81
|
+
* The account that should receive the tokens.
|
|
82
|
+
*/
|
|
83
|
+
recipient: string;
|
|
84
|
+
}
|
|
85
|
+
export interface TransferOptions {
|
|
86
|
+
/**
|
|
87
|
+
* The account sending the NFT.
|
|
88
|
+
*/
|
|
89
|
+
sender: string;
|
|
90
|
+
/**
|
|
91
|
+
* The account that should receive the NFT.
|
|
92
|
+
*/
|
|
93
|
+
recipient: string;
|
|
94
|
+
/**
|
|
95
|
+
* The id of the token being sent.
|
|
96
|
+
*/
|
|
97
|
+
tokenId: BigintIsh;
|
|
98
|
+
}
|
|
99
|
+
export interface PermitDetails {
|
|
100
|
+
token: string;
|
|
101
|
+
amount: BigintIsh;
|
|
102
|
+
expiration: BigintIsh;
|
|
103
|
+
nonce: BigintIsh;
|
|
104
|
+
}
|
|
105
|
+
export interface AllowanceTransferPermitSingle {
|
|
106
|
+
details: PermitDetails;
|
|
107
|
+
spender: string;
|
|
108
|
+
sigDeadline: BigintIsh;
|
|
109
|
+
}
|
|
110
|
+
export interface AllowanceTransferPermitBatch {
|
|
111
|
+
details: PermitDetails[];
|
|
112
|
+
spender: string;
|
|
113
|
+
sigDeadline: BigintIsh;
|
|
114
|
+
}
|
|
115
|
+
export interface BatchPermitOptions {
|
|
116
|
+
owner: string;
|
|
117
|
+
permitBatch: AllowanceTransferPermitBatch;
|
|
118
|
+
signature: string;
|
|
119
|
+
}
|
|
120
|
+
export interface NFTPermitValues {
|
|
121
|
+
spender: string;
|
|
122
|
+
tokenId: BigintIsh;
|
|
123
|
+
deadline: BigintIsh;
|
|
124
|
+
nonce: BigintIsh;
|
|
125
|
+
}
|
|
126
|
+
export interface NFTPermitOptions extends NFTPermitValues {
|
|
127
|
+
signature: string;
|
|
128
|
+
}
|
|
129
|
+
export interface NFTPermitData {
|
|
130
|
+
domain: TypedDataDomain;
|
|
131
|
+
types: Record<string, TypedDataField[]>;
|
|
132
|
+
values: NFTPermitValues;
|
|
133
|
+
}
|
|
134
|
+
export type MintOptions = CommonOptions & CommonAddLiquidityOptions & MintSpecificOptions;
|
|
135
|
+
export type IncreaseLiquidityOptions = CommonOptions & CommonAddLiquidityOptions & ModifyPositionSpecificOptions;
|
|
136
|
+
export type AddLiquidityOptions = MintOptions | IncreaseLiquidityOptions;
|
|
137
|
+
export type RemoveLiquidityOptions = CommonOptions & RemoveLiquiditySpecificOptions & ModifyPositionSpecificOptions;
|
|
138
|
+
export type CollectOptions = CommonOptions & CollectSpecificOptions;
|
|
139
|
+
export declare abstract class V4PositionManager {
|
|
140
|
+
static INTERFACE: Interface;
|
|
141
|
+
/**
|
|
142
|
+
* Cannot be constructed.
|
|
143
|
+
*/
|
|
144
|
+
private constructor();
|
|
145
|
+
/**
|
|
146
|
+
* Public methods to encode method parameters for different actions on the PositionManager contract
|
|
147
|
+
*/
|
|
148
|
+
static createCallParameters(poolKey: PoolKey, sqrtPriceX96: BigintIsh): MethodParameters;
|
|
149
|
+
static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters;
|
|
150
|
+
/**
|
|
151
|
+
* Produces the calldata for completely or partially exiting a position
|
|
152
|
+
* @param position The position to exit
|
|
153
|
+
* @param options Additional information necessary for generating the calldata
|
|
154
|
+
* @returns The call parameters
|
|
155
|
+
*/
|
|
156
|
+
static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters;
|
|
157
|
+
/**
|
|
158
|
+
* Produces the calldata for collecting fees from a position
|
|
159
|
+
* @param position The position to collect fees from
|
|
160
|
+
* @param options Additional information necessary for generating the calldata
|
|
161
|
+
* @returns The call parameters
|
|
162
|
+
*/
|
|
163
|
+
static collectCallParameters(position: Position, options: CollectOptions): MethodParameters;
|
|
164
|
+
private static encodeInitializePool;
|
|
165
|
+
static encodeModifyLiquidities(unlockData: string, deadline: BigintIsh): string;
|
|
166
|
+
static encodePermitBatch(owner: string, permitBatch: AllowanceTransferPermitBatch, signature: string): string;
|
|
167
|
+
static encodeERC721Permit(spender: string, tokenId: BigintIsh, deadline: BigintIsh, nonce: BigintIsh, signature: string): string;
|
|
168
|
+
static getPermitData(permit: NFTPermitValues, positionManagerAddress: string, chainId: number): NFTPermitData;
|
|
169
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.V4PositionManager = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const sdk_core_1 = require("@kittycorn-labs/sdk-core");
|
|
6
|
+
const jsbi_1 = tslib_1.__importDefault(require("jsbi"));
|
|
7
|
+
const position_1 = require("./entities/position");
|
|
8
|
+
const calldata_1 = require("./utils/calldata");
|
|
9
|
+
const actionConstants_1 = require("./actionConstants");
|
|
10
|
+
const abi_1 = require("@ethersproject/abi");
|
|
11
|
+
const multicall_1 = require("./multicall");
|
|
12
|
+
const tiny_invariant_1 = tslib_1.__importDefault(require("tiny-invariant"));
|
|
13
|
+
const internalConstants_1 = require("./internalConstants");
|
|
14
|
+
const utils_1 = require("./utils");
|
|
15
|
+
const positionManagerAbi_1 = require("./utils/positionManagerAbi");
|
|
16
|
+
const NFT_PERMIT_TYPES = {
|
|
17
|
+
Permit: [
|
|
18
|
+
{ name: 'spender', type: 'address' },
|
|
19
|
+
{ name: 'tokenId', type: 'uint256' },
|
|
20
|
+
{ name: 'nonce', type: 'uint256' },
|
|
21
|
+
{ name: 'deadline', type: 'uint256' },
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
// type guard
|
|
25
|
+
function isMint(options) {
|
|
26
|
+
return Object.keys(options).some((k) => k === 'recipient');
|
|
27
|
+
}
|
|
28
|
+
function shouldCreatePool(options) {
|
|
29
|
+
if (options.createPool) {
|
|
30
|
+
(0, tiny_invariant_1.default)(options.sqrtPriceX96 !== undefined, internalConstants_1.NO_SQRT_PRICE);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
class V4PositionManager {
|
|
36
|
+
/**
|
|
37
|
+
* Cannot be constructed.
|
|
38
|
+
*/
|
|
39
|
+
constructor() { }
|
|
40
|
+
/**
|
|
41
|
+
* Public methods to encode method parameters for different actions on the PositionManager contract
|
|
42
|
+
*/
|
|
43
|
+
static createCallParameters(poolKey, sqrtPriceX96) {
|
|
44
|
+
return {
|
|
45
|
+
calldata: this.encodeInitializePool(poolKey, sqrtPriceX96),
|
|
46
|
+
value: (0, calldata_1.toHex)(0),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static addCallParameters(position, options) {
|
|
50
|
+
/**
|
|
51
|
+
* Cases:
|
|
52
|
+
* - if pool does not exist yet, encode initializePool
|
|
53
|
+
* then,
|
|
54
|
+
* - if is mint, encode MINT_POSITION. If migrating, encode a SETTLE and SWEEP for both currencies. Else, encode a SETTLE_PAIR. If on a NATIVE pool, encode a SWEEP.
|
|
55
|
+
* - else, encode INCREASE_LIQUIDITY and CLOSE_CURRENCY for each token (handles accrued fees). If on a NATIVE pool, encode a SWEEP.
|
|
56
|
+
*/
|
|
57
|
+
(0, tiny_invariant_1.default)(jsbi_1.default.greaterThan(position.liquidity, internalConstants_1.ZERO), internalConstants_1.ZERO_LIQUIDITY);
|
|
58
|
+
const calldataList = [];
|
|
59
|
+
const planner = new utils_1.V4PositionPlanner();
|
|
60
|
+
// Encode initialize pool.
|
|
61
|
+
if (isMint(options) && shouldCreatePool(options)) {
|
|
62
|
+
// No planner used here because initializePool is not supported as an Action
|
|
63
|
+
calldataList.push(V4PositionManager.encodeInitializePool(position.pool.poolKey, options.sqrtPriceX96));
|
|
64
|
+
}
|
|
65
|
+
// position.pool.currency0 is native if and only if options.useNative is set
|
|
66
|
+
(0, tiny_invariant_1.default)(position.pool.currency0 === options.useNative ||
|
|
67
|
+
(!position.pool.currency0.isNative && options.useNative === undefined), internalConstants_1.NATIVE_NOT_SET);
|
|
68
|
+
// adjust for slippage
|
|
69
|
+
const maximumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance);
|
|
70
|
+
const amount0Max = (0, calldata_1.toHex)(maximumAmounts.amount0);
|
|
71
|
+
const amount1Max = (0, calldata_1.toHex)(maximumAmounts.amount1);
|
|
72
|
+
// We use permit2 to approve tokens to the position manager
|
|
73
|
+
if (options.batchPermit) {
|
|
74
|
+
calldataList.push(V4PositionManager.encodePermitBatch(options.batchPermit.owner, options.batchPermit.permitBatch, options.batchPermit.signature));
|
|
75
|
+
}
|
|
76
|
+
// mint
|
|
77
|
+
if (isMint(options)) {
|
|
78
|
+
const recipient = (0, sdk_core_1.validateAndParseAddress)(options.recipient);
|
|
79
|
+
planner.addMint(position.pool, position.tickLower, position.tickUpper, position.liquidity, amount0Max, amount1Max, recipient, options.hookData);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// increase
|
|
83
|
+
planner.addIncrease(options.tokenId, position.liquidity, amount0Max, amount1Max, options.hookData);
|
|
84
|
+
}
|
|
85
|
+
let value = (0, calldata_1.toHex)(0);
|
|
86
|
+
// If migrating, we need to settle and sweep both currencies individually
|
|
87
|
+
if (isMint(options) && options.migrate) {
|
|
88
|
+
if (options.useNative) {
|
|
89
|
+
// unwrap the exact amount needed to send to the pool manager
|
|
90
|
+
planner.addUnwrap(internalConstants_1.OPEN_DELTA);
|
|
91
|
+
}
|
|
92
|
+
// payer is v4 position manager
|
|
93
|
+
planner.addSettle(position.pool.currency0, false);
|
|
94
|
+
planner.addSettle(position.pool.currency1, false);
|
|
95
|
+
// sweep any leftover wrapped native that was not unwrapped
|
|
96
|
+
// recipient will be same as the v4 lp token recipient
|
|
97
|
+
planner.addSweep(options.useNative ? position.pool.currency0.wrapped : position.pool.currency0, options.recipient);
|
|
98
|
+
planner.addSweep(position.pool.currency1, options.recipient);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
if (isMint(options)) {
|
|
102
|
+
// Mint: the user can never be owed a token when minting (delta is always >= 0), so SETTLE_PAIR is safe
|
|
103
|
+
planner.addSettlePair(position.pool.currency0, position.pool.currency1);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// Increase: use CLOSE_CURRENCY instead of SETTLE_PAIR because accrued fees on
|
|
107
|
+
// existing positions can flip the delta positive on one side (e.g. single-sided
|
|
108
|
+
// positions with fees), causing SETTLE_PAIR to revert. CLOSE_CURRENCY handles
|
|
109
|
+
// both directions — settles if the user owes, takes if the user is owed.
|
|
110
|
+
planner.addCloseCurrency(position.pool.currency0);
|
|
111
|
+
planner.addCloseCurrency(position.pool.currency1);
|
|
112
|
+
}
|
|
113
|
+
if (options.useNative) {
|
|
114
|
+
// Any sweeping must happen after the settling.
|
|
115
|
+
// native currency will always be currency0 in v4
|
|
116
|
+
value = (0, calldata_1.toHex)(amount0Max);
|
|
117
|
+
planner.addSweep(position.pool.currency0, actionConstants_1.MSG_SENDER);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
calldataList.push(V4PositionManager.encodeModifyLiquidities(planner.finalize(), options.deadline));
|
|
121
|
+
return {
|
|
122
|
+
calldata: multicall_1.Multicall.encodeMulticall(calldataList),
|
|
123
|
+
value,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Produces the calldata for completely or partially exiting a position
|
|
128
|
+
* @param position The position to exit
|
|
129
|
+
* @param options Additional information necessary for generating the calldata
|
|
130
|
+
* @returns The call parameters
|
|
131
|
+
*/
|
|
132
|
+
static removeCallParameters(position, options) {
|
|
133
|
+
var _a;
|
|
134
|
+
/**
|
|
135
|
+
* cases:
|
|
136
|
+
* - if liquidityPercentage is 100%, encode BURN_POSITION and then TAKE_PAIR
|
|
137
|
+
* - else, encode DECREASE_LIQUIDITY and then TAKE_PAIR
|
|
138
|
+
*/
|
|
139
|
+
const calldataList = [];
|
|
140
|
+
const planner = new utils_1.V4PositionPlanner();
|
|
141
|
+
const tokenId = (0, calldata_1.toHex)(options.tokenId);
|
|
142
|
+
if (options.burnToken) {
|
|
143
|
+
// if burnToken is true, the specified liquidity percentage must be 100%
|
|
144
|
+
(0, tiny_invariant_1.default)(options.liquidityPercentage.equalTo(internalConstants_1.ONE), internalConstants_1.CANNOT_BURN);
|
|
145
|
+
// if there is a permit, encode the ERC721Permit permit call
|
|
146
|
+
if (options.permit) {
|
|
147
|
+
calldataList.push(V4PositionManager.encodeERC721Permit(options.permit.spender, options.permit.tokenId, options.permit.deadline, options.permit.nonce, options.permit.signature));
|
|
148
|
+
}
|
|
149
|
+
// slippage-adjusted amounts derived from current position liquidity
|
|
150
|
+
const { amount0: amount0Min, amount1: amount1Min } = position.burnAmountsWithSlippage(options.slippageTolerance);
|
|
151
|
+
planner.addBurn(tokenId, amount0Min, amount1Min, options.hookData);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// construct a partial position with a percentage of liquidity
|
|
155
|
+
const partialPosition = new position_1.Position({
|
|
156
|
+
pool: position.pool,
|
|
157
|
+
liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,
|
|
158
|
+
tickLower: position.tickLower,
|
|
159
|
+
tickUpper: position.tickUpper,
|
|
160
|
+
});
|
|
161
|
+
// If the partial position has liquidity=0, this is a collect call and collectCallParameters should be used
|
|
162
|
+
(0, tiny_invariant_1.default)(jsbi_1.default.greaterThan(partialPosition.liquidity, internalConstants_1.ZERO), internalConstants_1.ZERO_LIQUIDITY);
|
|
163
|
+
// slippage-adjusted underlying amounts
|
|
164
|
+
const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(options.slippageTolerance);
|
|
165
|
+
planner.addDecrease(tokenId, partialPosition.liquidity.toString(), amount0Min.toString(), amount1Min.toString(), (_a = options.hookData) !== null && _a !== void 0 ? _a : internalConstants_1.EMPTY_BYTES);
|
|
166
|
+
}
|
|
167
|
+
planner.addTakePair(position.pool.currency0, position.pool.currency1, actionConstants_1.MSG_SENDER);
|
|
168
|
+
calldataList.push(V4PositionManager.encodeModifyLiquidities(planner.finalize(), options.deadline));
|
|
169
|
+
return {
|
|
170
|
+
calldata: multicall_1.Multicall.encodeMulticall(calldataList),
|
|
171
|
+
value: (0, calldata_1.toHex)(0),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Produces the calldata for collecting fees from a position
|
|
176
|
+
* @param position The position to collect fees from
|
|
177
|
+
* @param options Additional information necessary for generating the calldata
|
|
178
|
+
* @returns The call parameters
|
|
179
|
+
*/
|
|
180
|
+
static collectCallParameters(position, options) {
|
|
181
|
+
const calldataList = [];
|
|
182
|
+
const planner = new utils_1.V4PositionPlanner();
|
|
183
|
+
const tokenId = (0, calldata_1.toHex)(options.tokenId);
|
|
184
|
+
const recipient = (0, sdk_core_1.validateAndParseAddress)(options.recipient);
|
|
185
|
+
/**
|
|
186
|
+
* To collect fees in V4, we need to:
|
|
187
|
+
* - encode a decrease liquidity by 0
|
|
188
|
+
* - and encode a TAKE_PAIR
|
|
189
|
+
*/
|
|
190
|
+
planner.addDecrease(tokenId, '0', '0', '0', options.hookData);
|
|
191
|
+
planner.addTakePair(position.pool.currency0, position.pool.currency1, recipient);
|
|
192
|
+
calldataList.push(V4PositionManager.encodeModifyLiquidities(planner.finalize(), options.deadline));
|
|
193
|
+
return {
|
|
194
|
+
calldata: multicall_1.Multicall.encodeMulticall(calldataList),
|
|
195
|
+
value: (0, calldata_1.toHex)(0),
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
// Initialize a pool
|
|
199
|
+
static encodeInitializePool(poolKey, sqrtPriceX96) {
|
|
200
|
+
return V4PositionManager.INTERFACE.encodeFunctionData(internalConstants_1.PositionFunctions.INITIALIZE_POOL, [
|
|
201
|
+
poolKey,
|
|
202
|
+
sqrtPriceX96.toString(),
|
|
203
|
+
]);
|
|
204
|
+
}
|
|
205
|
+
// Encode a modify liquidities call
|
|
206
|
+
static encodeModifyLiquidities(unlockData, deadline) {
|
|
207
|
+
return V4PositionManager.INTERFACE.encodeFunctionData(internalConstants_1.PositionFunctions.MODIFY_LIQUIDITIES, [unlockData, deadline]);
|
|
208
|
+
}
|
|
209
|
+
// Encode a permit batch call
|
|
210
|
+
static encodePermitBatch(owner, permitBatch, signature) {
|
|
211
|
+
return V4PositionManager.INTERFACE.encodeFunctionData(internalConstants_1.PositionFunctions.PERMIT_BATCH, [
|
|
212
|
+
owner,
|
|
213
|
+
permitBatch,
|
|
214
|
+
signature,
|
|
215
|
+
]);
|
|
216
|
+
}
|
|
217
|
+
// Encode a ERC721Permit permit call
|
|
218
|
+
static encodeERC721Permit(spender, tokenId, deadline, nonce, signature) {
|
|
219
|
+
return V4PositionManager.INTERFACE.encodeFunctionData(internalConstants_1.PositionFunctions.ERC721PERMIT_PERMIT, [
|
|
220
|
+
spender,
|
|
221
|
+
tokenId,
|
|
222
|
+
deadline,
|
|
223
|
+
nonce,
|
|
224
|
+
signature,
|
|
225
|
+
]);
|
|
226
|
+
}
|
|
227
|
+
// Prepare the params for an EIP712 signTypedData request
|
|
228
|
+
static getPermitData(permit, positionManagerAddress, chainId) {
|
|
229
|
+
return {
|
|
230
|
+
domain: {
|
|
231
|
+
name: 'Uniswap V4 Positions NFT',
|
|
232
|
+
chainId,
|
|
233
|
+
verifyingContract: positionManagerAddress,
|
|
234
|
+
},
|
|
235
|
+
types: NFT_PERMIT_TYPES,
|
|
236
|
+
values: permit,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
exports.V4PositionManager = V4PositionManager;
|
|
241
|
+
V4PositionManager.INTERFACE = new abi_1.Interface(positionManagerAbi_1.positionManagerAbi);
|
|
242
|
+
//# sourceMappingURL=PositionManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PositionManager.js","sourceRoot":"","sources":["../../../src/PositionManager.ts"],"names":[],"mappings":";;;;AAAA,uDAAsG;AAEtG,wDAAuB;AACvB,kDAA8C;AAC9C,+CAA0D;AAC1D,uDAA8C;AAC9C,4CAA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|
+
{
|
|
2
|
+
"abi": [
|
|
3
|
+
{
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"internalType": "bytes[]",
|
|
7
|
+
"name": "data",
|
|
8
|
+
"type": "bytes[]"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"name": "multicall",
|
|
12
|
+
"outputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "bytes[]",
|
|
15
|
+
"name": "results",
|
|
16
|
+
"type": "bytes[]"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "payable",
|
|
20
|
+
"type": "function"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MSG_SENDER = "0x0000000000000000000000000000000000000001";
|
|
1
|
+
export declare const MSG_SENDER = "0x0000000000000000000000000000000000000001";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MSG_SENDER = void 0;
|
|
4
|
+
// Shared Action Constants used in the v4 Router and v4 position manager
|
|
5
|
+
exports.MSG_SENDER = '0x0000000000000000000000000000000000000001';
|
|
6
|
+
//# sourceMappingURL=actionConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionConstants.js","sourceRoot":"","sources":["../../../src/actionConstants.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AAC3D,QAAA,UAAU,GAAG,4CAA4C,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './pool';
|
|
2
|
-
export * from './route';
|
|
3
|
-
export * from './trade';
|
|
4
|
-
export * from './position';
|
|
1
|
+
export * from './pool';
|
|
2
|
+
export * from './route';
|
|
3
|
+
export * from './trade';
|
|
4
|
+
export * from './position';
|