@zoralabs/protocol-deployments 0.5.6-PRE.3 → 0.5.6
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/.turbo/turbo-build.log +46 -47
- package/CHANGELOG.md +3 -3
- package/LICENSE +21 -0
- package/dist/encoding.d.ts +3 -7
- package/dist/encoding.d.ts.map +1 -1
- package/dist/generated/wagmi.d.ts +6958 -3965
- package/dist/generated/wagmi.d.ts.map +1 -1
- package/dist/index.cjs +4300 -2718
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4292 -2717
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/encoding.ts +14 -17
- package/src/generated/wagmi.ts +2353 -739
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoralabs/protocol-deployments",
|
|
3
|
-
"version": "0.5.6
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"repository": "https://github.com/ourzora/zora-protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,17 +15,9 @@
|
|
|
15
15
|
"default": "./dist/index.cjs"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "pnpm bundle-configs && pnpm copy-generated && tsup",
|
|
20
|
-
"bundle-configs": "tsx scripts/bundle-configs.ts && pnpm prettier:write",
|
|
21
|
-
"copy-generated": "cp ../protocol-deployments-gen/generated/wagmi.ts src/generated/wagmi.ts",
|
|
22
|
-
"prettier:write": "prettier --write 'src/**/*.ts' 'scripts/*'",
|
|
23
|
-
"lint": "prettier --check 'src/**/*.ts' 'scripts/*'"
|
|
24
|
-
},
|
|
25
18
|
"devDependencies": {
|
|
26
19
|
"@lavamoat/preinstall-always-fail": "2.0.0",
|
|
27
20
|
"@types/node": "^20.3.2",
|
|
28
|
-
"@zoralabs/tsconfig": "workspace:^",
|
|
29
21
|
"abitype": "^1.0.2",
|
|
30
22
|
"es-main": "^1.2.0",
|
|
31
23
|
"prettier": "^3.2.5",
|
|
@@ -33,6 +25,14 @@
|
|
|
33
25
|
"tsup": "^7.2.0",
|
|
34
26
|
"tsx": "^3.13.0",
|
|
35
27
|
"typescript": "^5.2.2",
|
|
36
|
-
"viem": "^2.21.21"
|
|
28
|
+
"viem": "^2.21.21",
|
|
29
|
+
"@zoralabs/tsconfig": "^0.0.1"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "pnpm bundle-configs && pnpm copy-generated && tsup",
|
|
33
|
+
"bundle-configs": "tsx scripts/bundle-configs.ts && pnpm prettier:write",
|
|
34
|
+
"copy-generated": "cp ../protocol-deployments-gen/generated/wagmi.ts src/generated/wagmi.ts",
|
|
35
|
+
"prettier:write": "prettier --write 'src/**/*.ts' 'scripts/*'",
|
|
36
|
+
"lint": "prettier --check 'src/**/*.ts' 'scripts/*'"
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
package/src/encoding.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
decodeAbiParameters,
|
|
4
4
|
encodeAbiParameters,
|
|
5
5
|
encodeFunctionData,
|
|
6
|
+
getAbiItem,
|
|
6
7
|
} from "viem";
|
|
7
8
|
import {
|
|
8
9
|
uniswapV3SwapRouterABI,
|
|
@@ -165,10 +166,7 @@ export const decodeBuySupplyWithSwapRouterHookReturn = (returnData: Hex) => {
|
|
|
165
166
|
};
|
|
166
167
|
};
|
|
167
168
|
|
|
168
|
-
|
|
169
|
-
type UniswapV4Version = 4;
|
|
170
|
-
|
|
171
|
-
type PoolVersion = UniswapV3Version | UniswapV4Version;
|
|
169
|
+
const UNISWAP_V4_MULTICURVE_POOL_VERSION = 4;
|
|
172
170
|
|
|
173
171
|
/**
|
|
174
172
|
* Encodes the pool configuration data for creating and initializing a coin's liquidity pool,
|
|
@@ -187,31 +185,30 @@ type PoolVersion = UniswapV3Version | UniswapV4Version;
|
|
|
187
185
|
* This is typically a WAD-scaled value (i.e., scaled by 1e18).
|
|
188
186
|
* @returns The ABI-encoded pool configuration for setting
|
|
189
187
|
*/
|
|
190
|
-
export const
|
|
191
|
-
version,
|
|
188
|
+
export const encodeMultiCurvePoolConfig = ({
|
|
192
189
|
currency,
|
|
193
190
|
tickLower,
|
|
194
191
|
tickUpper,
|
|
195
192
|
numDiscoveryPositions,
|
|
196
193
|
maxDiscoverySupplyShare,
|
|
197
194
|
}: {
|
|
198
|
-
version: PoolVersion;
|
|
199
195
|
currency: Address;
|
|
200
196
|
tickLower: number[];
|
|
201
197
|
tickUpper: number[];
|
|
202
198
|
numDiscoveryPositions: number[];
|
|
203
199
|
maxDiscoverySupplyShare: bigint[];
|
|
204
200
|
}) => {
|
|
205
|
-
|
|
201
|
+
const abiItem = getAbiItem({
|
|
206
202
|
abi: poolConfigEncodingABI,
|
|
207
|
-
|
|
208
|
-
args: [
|
|
209
|
-
version,
|
|
210
|
-
currency,
|
|
211
|
-
tickLower,
|
|
212
|
-
tickUpper,
|
|
213
|
-
numDiscoveryPositions,
|
|
214
|
-
maxDiscoverySupplyShare,
|
|
215
|
-
],
|
|
203
|
+
name: "encodeMultiCurvePoolConfig",
|
|
216
204
|
});
|
|
205
|
+
|
|
206
|
+
return encodeAbiParameters(abiItem.inputs, [
|
|
207
|
+
UNISWAP_V4_MULTICURVE_POOL_VERSION,
|
|
208
|
+
currency,
|
|
209
|
+
tickLower,
|
|
210
|
+
tickUpper,
|
|
211
|
+
numDiscoveryPositions,
|
|
212
|
+
maxDiscoverySupplyShare,
|
|
213
|
+
]);
|
|
217
214
|
};
|