damm-sdk 1.4.37 → 1.4.39

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.
@@ -1 +1 @@
1
- {"version":3,"file":"pendle.router.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/pendle/pendle.router.abi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAaW"}
1
+ {"version":3,"file":"pendle.router.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/pendle/pendle.router.abi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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* via viem's `encodeFunctionData`. No network calls, no Pendle API dependency.
6
+ *
7
+ * Clean-shape guarantee (ADR-0001):
8
+ * - `TokenInput.pendleSwap` is always forced to address(0).
9
+ * - `TokenInput.swapData` is always `(NONE=0, address(0), 0x, false)`.
10
+ * - `TokenOutput.pendleSwap` / `swapData` are forced the same way.
11
+ * - `LimitOrderData` is always `(address(0), 0, [], [], 0x)`.
12
+ *
13
+ * Callers provide the user-facing subset:
14
+ * - `TokenInputParams` = `{ tokenIn, netTokenIn, tokenMintSy }`
15
+ * - `TokenOutputParams` = `{ tokenOut, minTokenOut, tokenRedeemSy }`
16
+ * - `ApproxParams` = all five fields (obtained from the Pendle Hosted API)
17
+ *
18
+ * The encoder constructs the full on-chain structs internally — the caller cannot
19
+ * supply a non-clean `pendleSwap` or `limitRouter`.
20
+ *
21
+ * This module also contains the refactored claim encoders
22
+ * (`redeemDueInterestAndRewards` V1 + merkle `claim`), migrated from ethers v5
23
+ * to viem while keeping identical external behaviour and exports.
24
+ *
25
+ * Selectors verified against pendle-core-v2-public source + Monad/mainnet deployments
26
+ * (2026-06-29). PT↔YT swap functions (`swapExactPtForYt` / `swapExactYtForPt`) are
27
+ * intentionally absent — they do not exist on the Router V4.
28
+ */
29
+ import { type Address } from "viem";
30
+ import { type Call, type HexString, type Unwrapable } from "../../types/index.ts";
31
+ /**
32
+ * On-chain binary-search hint. All five fields are required because they carry
33
+ * market-state information computed by the Pendle Hosted API per request.
34
+ */
35
+ export type ApproxParams = Readonly<{
36
+ guessMin: bigint;
37
+ guessMax: bigint;
38
+ guessOffchain: bigint;
39
+ maxIteration: bigint;
40
+ eps: bigint;
41
+ }>;
42
+ /**
43
+ * User-facing TokenInput subset. The encoder forces `pendleSwap=0x0` and
44
+ * `swapData=CLEAN_SWAP_DATA` — the caller cannot provide a non-clean shape.
45
+ * Requires `tokenIn == tokenMintSy` for the aggregator-free code path.
46
+ */
47
+ export type TokenInputParams = Readonly<{
48
+ tokenIn: Address;
49
+ netTokenIn: bigint;
50
+ tokenMintSy: Address;
51
+ }>;
52
+ /**
53
+ * User-facing TokenOutput subset. The encoder forces `pendleSwap=0x0` and
54
+ * `swapData=CLEAN_SWAP_DATA`.
55
+ * Requires `tokenOut == tokenRedeemSy` for the aggregator-free code path.
56
+ */
57
+ export type TokenOutputParams = Readonly<{
58
+ tokenOut: Address;
59
+ minTokenOut: bigint;
60
+ tokenRedeemSy: Address;
61
+ }>;
62
+ export type PendleRedeemRewardsArgs = Readonly<{
63
+ user: Address;
64
+ sys: Address[];
65
+ yts: Address[];
66
+ markets: Address[];
67
+ }>;
68
+ export declare const pendleRedeemRewardsCalldata: ({ user, sys, yts, markets }: PendleRedeemRewardsArgs) => HexString;
69
+ export declare const pendleRedeemRewardsTrx: ({ args, routerAddress, }: {
70
+ args: PendleRedeemRewardsArgs;
71
+ routerAddress: Address;
72
+ }) => Unwrapable<Call>;
73
+ export type PendleMerkleClaimArgs = Readonly<{
74
+ receiver: Address;
75
+ tokens: Address[];
76
+ totalAccrueds: bigint[];
77
+ proofs: HexString[][];
78
+ }>;
79
+ export declare const pendleMerkleClaimCalldata: ({ receiver, tokens, totalAccrueds, proofs, }: PendleMerkleClaimArgs) => HexString;
80
+ export declare const pendleMerkleClaimTrx: ({ args, distributorAddress, }: {
81
+ args: PendleMerkleClaimArgs;
82
+ distributorAddress: Address;
83
+ }) => Unwrapable<Call>;
84
+ export type MintSyFromTokenArgs = Readonly<{
85
+ receiver: Address;
86
+ sy: Address;
87
+ minSyOut: bigint;
88
+ input: TokenInputParams;
89
+ }>;
90
+ export declare const mintSyFromTokenCalldata: ({ receiver, sy, minSyOut, input }: MintSyFromTokenArgs) => HexString;
91
+ export declare const mintSyFromTokenTrx: ({ args, routerAddress, }: {
92
+ args: MintSyFromTokenArgs;
93
+ routerAddress: Address;
94
+ }) => Unwrapable<Call>;
95
+ export type RedeemSyToTokenArgs = Readonly<{
96
+ receiver: Address;
97
+ sy: Address;
98
+ netSyIn: bigint;
99
+ output: TokenOutputParams;
100
+ }>;
101
+ export declare const redeemSyToTokenCalldata: ({ receiver, sy, netSyIn, output }: RedeemSyToTokenArgs) => HexString;
102
+ export declare const redeemSyToTokenTrx: ({ args, routerAddress, }: {
103
+ args: RedeemSyToTokenArgs;
104
+ routerAddress: Address;
105
+ }) => Unwrapable<Call>;
106
+ export type MintPyFromTokenArgs = Readonly<{
107
+ receiver: Address;
108
+ yt: Address;
109
+ minPyOut: bigint;
110
+ input: TokenInputParams;
111
+ }>;
112
+ export declare const mintPyFromTokenCalldata: ({ receiver, yt, minPyOut, input }: MintPyFromTokenArgs) => HexString;
113
+ export declare const mintPyFromTokenTrx: ({ args, routerAddress, }: {
114
+ args: MintPyFromTokenArgs;
115
+ routerAddress: Address;
116
+ }) => Unwrapable<Call>;
117
+ export type RedeemPyToTokenArgs = Readonly<{
118
+ receiver: Address;
119
+ yt: Address;
120
+ netPyIn: bigint;
121
+ output: TokenOutputParams;
122
+ }>;
123
+ export declare const redeemPyToTokenCalldata: ({ receiver, yt, netPyIn, output }: RedeemPyToTokenArgs) => HexString;
124
+ export declare const redeemPyToTokenTrx: ({ args, routerAddress, }: {
125
+ args: RedeemPyToTokenArgs;
126
+ routerAddress: Address;
127
+ }) => Unwrapable<Call>;
128
+ export type MintPyFromSyArgs = Readonly<{
129
+ receiver: Address;
130
+ yt: Address;
131
+ netSyIn: bigint;
132
+ minPyOut: bigint;
133
+ }>;
134
+ export declare const mintPyFromSyCalldata: ({ receiver, yt, netSyIn, minPyOut }: MintPyFromSyArgs) => HexString;
135
+ export declare const mintPyFromSyTrx: ({ args, routerAddress, }: {
136
+ args: MintPyFromSyArgs;
137
+ routerAddress: Address;
138
+ }) => Unwrapable<Call>;
139
+ export type RedeemPyToSyArgs = Readonly<{
140
+ receiver: Address;
141
+ yt: Address;
142
+ netPyIn: bigint;
143
+ minSyOut: bigint;
144
+ }>;
145
+ export declare const redeemPyToSyCalldata: ({ receiver, yt, netPyIn, minSyOut }: RedeemPyToSyArgs) => HexString;
146
+ export declare const redeemPyToSyTrx: ({ args, routerAddress, }: {
147
+ args: RedeemPyToSyArgs;
148
+ routerAddress: Address;
149
+ }) => Unwrapable<Call>;
150
+ export type SwapExactTokenForPtArgs = Readonly<{
151
+ receiver: Address;
152
+ market: Address;
153
+ minPtOut: bigint;
154
+ guess: ApproxParams;
155
+ input: TokenInputParams;
156
+ }>;
157
+ export declare const swapExactTokenForPtCalldata: ({ receiver, market, minPtOut, guess, input, }: SwapExactTokenForPtArgs) => HexString;
158
+ export declare const swapExactTokenForPtTrx: ({ args, routerAddress, }: {
159
+ args: SwapExactTokenForPtArgs;
160
+ routerAddress: Address;
161
+ }) => Unwrapable<Call>;
162
+ export type SwapExactSyForPtArgs = Readonly<{
163
+ receiver: Address;
164
+ market: Address;
165
+ exactSyIn: bigint;
166
+ minPtOut: bigint;
167
+ guess: ApproxParams;
168
+ }>;
169
+ export declare const swapExactSyForPtCalldata: ({ receiver, market, exactSyIn, minPtOut, guess, }: SwapExactSyForPtArgs) => HexString;
170
+ export declare const swapExactSyForPtTrx: ({ args, routerAddress, }: {
171
+ args: SwapExactSyForPtArgs;
172
+ routerAddress: Address;
173
+ }) => Unwrapable<Call>;
174
+ export type SwapExactPtForTokenArgs = Readonly<{
175
+ receiver: Address;
176
+ market: Address;
177
+ exactPtIn: bigint;
178
+ output: TokenOutputParams;
179
+ }>;
180
+ export declare const swapExactPtForTokenCalldata: ({ receiver, market, exactPtIn, output, }: SwapExactPtForTokenArgs) => HexString;
181
+ export declare const swapExactPtForTokenTrx: ({ args, routerAddress, }: {
182
+ args: SwapExactPtForTokenArgs;
183
+ routerAddress: Address;
184
+ }) => Unwrapable<Call>;
185
+ export type SwapExactPtForSyArgs = Readonly<{
186
+ receiver: Address;
187
+ market: Address;
188
+ exactPtIn: bigint;
189
+ minSyOut: bigint;
190
+ }>;
191
+ export declare const swapExactPtForSyCalldata: ({ receiver, market, exactPtIn, minSyOut }: SwapExactPtForSyArgs) => HexString;
192
+ export declare const swapExactPtForSyTrx: ({ args, routerAddress, }: {
193
+ args: SwapExactPtForSyArgs;
194
+ routerAddress: Address;
195
+ }) => Unwrapable<Call>;
196
+ export type SwapExactTokenForYtArgs = Readonly<{
197
+ receiver: Address;
198
+ market: Address;
199
+ minYtOut: bigint;
200
+ guess: ApproxParams;
201
+ input: TokenInputParams;
202
+ }>;
203
+ export declare const swapExactTokenForYtCalldata: ({ receiver, market, minYtOut, guess, input, }: SwapExactTokenForYtArgs) => HexString;
204
+ export declare const swapExactTokenForYtTrx: ({ args, routerAddress, }: {
205
+ args: SwapExactTokenForYtArgs;
206
+ routerAddress: Address;
207
+ }) => Unwrapable<Call>;
208
+ export type SwapExactSyForYtArgs = Readonly<{
209
+ receiver: Address;
210
+ market: Address;
211
+ exactSyIn: bigint;
212
+ minYtOut: bigint;
213
+ guess: ApproxParams;
214
+ }>;
215
+ export declare const swapExactSyForYtCalldata: ({ receiver, market, exactSyIn, minYtOut, guess, }: SwapExactSyForYtArgs) => HexString;
216
+ export declare const swapExactSyForYtTrx: ({ args, routerAddress, }: {
217
+ args: SwapExactSyForYtArgs;
218
+ routerAddress: Address;
219
+ }) => Unwrapable<Call>;
220
+ export type SwapExactYtForTokenArgs = Readonly<{
221
+ receiver: Address;
222
+ market: Address;
223
+ exactYtIn: bigint;
224
+ output: TokenOutputParams;
225
+ }>;
226
+ export declare const swapExactYtForTokenCalldata: ({ receiver, market, exactYtIn, output, }: SwapExactYtForTokenArgs) => HexString;
227
+ export declare const swapExactYtForTokenTrx: ({ args, routerAddress, }: {
228
+ args: SwapExactYtForTokenArgs;
229
+ routerAddress: Address;
230
+ }) => Unwrapable<Call>;
231
+ export type SwapExactYtForSyArgs = Readonly<{
232
+ receiver: Address;
233
+ market: Address;
234
+ exactYtIn: bigint;
235
+ minSyOut: bigint;
236
+ }>;
237
+ export declare const swapExactYtForSyCalldata: ({ receiver, market, exactYtIn, minSyOut }: SwapExactYtForSyArgs) => HexString;
238
+ export declare const swapExactYtForSyTrx: ({ args, routerAddress, }: {
239
+ args: SwapExactYtForSyArgs;
240
+ routerAddress: Address;
241
+ }) => Unwrapable<Call>;
242
+ export type AddLiquiditySingleTokenArgs = Readonly<{
243
+ receiver: Address;
244
+ market: Address;
245
+ minLpOut: bigint;
246
+ guess: ApproxParams;
247
+ input: TokenInputParams;
248
+ }>;
249
+ export declare const addLiquiditySingleTokenCalldata: ({ receiver, market, minLpOut, guess, input, }: AddLiquiditySingleTokenArgs) => HexString;
250
+ export declare const addLiquiditySingleTokenTrx: ({ args, routerAddress, }: {
251
+ args: AddLiquiditySingleTokenArgs;
252
+ routerAddress: Address;
253
+ }) => Unwrapable<Call>;
254
+ export type AddLiquiditySingleSyArgs = Readonly<{
255
+ receiver: Address;
256
+ market: Address;
257
+ netSyIn: bigint;
258
+ minLpOut: bigint;
259
+ guess: ApproxParams;
260
+ }>;
261
+ export declare const addLiquiditySingleSyCalldata: ({ receiver, market, netSyIn, minLpOut, guess, }: AddLiquiditySingleSyArgs) => HexString;
262
+ export declare const addLiquiditySingleSyTrx: ({ args, routerAddress, }: {
263
+ args: AddLiquiditySingleSyArgs;
264
+ routerAddress: Address;
265
+ }) => Unwrapable<Call>;
266
+ export type AddLiquiditySinglePtArgs = Readonly<{
267
+ receiver: Address;
268
+ market: Address;
269
+ netPtIn: bigint;
270
+ minLpOut: bigint;
271
+ guess: ApproxParams;
272
+ }>;
273
+ export declare const addLiquiditySinglePtCalldata: ({ receiver, market, netPtIn, minLpOut, guess, }: AddLiquiditySinglePtArgs) => HexString;
274
+ export declare const addLiquiditySinglePtTrx: ({ args, routerAddress, }: {
275
+ args: AddLiquiditySinglePtArgs;
276
+ routerAddress: Address;
277
+ }) => Unwrapable<Call>;
278
+ export type AddLiquiditySingleTokenKeepYtArgs = Readonly<{
279
+ receiver: Address;
280
+ market: Address;
281
+ minLpOut: bigint;
282
+ minYtOut: bigint;
283
+ input: TokenInputParams;
284
+ }>;
285
+ export declare const addLiquiditySingleTokenKeepYtCalldata: ({ receiver, market, minLpOut, minYtOut, input, }: AddLiquiditySingleTokenKeepYtArgs) => HexString;
286
+ export declare const addLiquiditySingleTokenKeepYtTrx: ({ args, routerAddress, }: {
287
+ args: AddLiquiditySingleTokenKeepYtArgs;
288
+ routerAddress: Address;
289
+ }) => Unwrapable<Call>;
290
+ export type AddLiquiditySingleSyKeepYtArgs = Readonly<{
291
+ receiver: Address;
292
+ market: Address;
293
+ netSyIn: bigint;
294
+ minLpOut: bigint;
295
+ minYtOut: bigint;
296
+ }>;
297
+ export declare const addLiquiditySingleSyKeepYtCalldata: ({ receiver, market, netSyIn, minLpOut, minYtOut, }: AddLiquiditySingleSyKeepYtArgs) => HexString;
298
+ export declare const addLiquiditySingleSyKeepYtTrx: ({ args, routerAddress, }: {
299
+ args: AddLiquiditySingleSyKeepYtArgs;
300
+ routerAddress: Address;
301
+ }) => Unwrapable<Call>;
302
+ export type AddLiquidityDualTokenAndPtArgs = Readonly<{
303
+ receiver: Address;
304
+ market: Address;
305
+ input: TokenInputParams;
306
+ netPtDesired: bigint;
307
+ minLpOut: bigint;
308
+ }>;
309
+ export declare const addLiquidityDualTokenAndPtCalldata: ({ receiver, market, input, netPtDesired, minLpOut, }: AddLiquidityDualTokenAndPtArgs) => HexString;
310
+ export declare const addLiquidityDualTokenAndPtTrx: ({ args, routerAddress, }: {
311
+ args: AddLiquidityDualTokenAndPtArgs;
312
+ routerAddress: Address;
313
+ }) => Unwrapable<Call>;
314
+ export type AddLiquidityDualSyAndPtArgs = Readonly<{
315
+ receiver: Address;
316
+ market: Address;
317
+ netSyDesired: bigint;
318
+ netPtDesired: bigint;
319
+ minLpOut: bigint;
320
+ }>;
321
+ export declare const addLiquidityDualSyAndPtCalldata: ({ receiver, market, netSyDesired, netPtDesired, minLpOut, }: AddLiquidityDualSyAndPtArgs) => HexString;
322
+ export declare const addLiquidityDualSyAndPtTrx: ({ args, routerAddress, }: {
323
+ args: AddLiquidityDualSyAndPtArgs;
324
+ routerAddress: Address;
325
+ }) => Unwrapable<Call>;
326
+ export type RemoveLiquiditySingleTokenArgs = Readonly<{
327
+ receiver: Address;
328
+ market: Address;
329
+ netLpToRemove: bigint;
330
+ output: TokenOutputParams;
331
+ }>;
332
+ export declare const removeLiquiditySingleTokenCalldata: ({ receiver, market, netLpToRemove, output, }: RemoveLiquiditySingleTokenArgs) => HexString;
333
+ export declare const removeLiquiditySingleTokenTrx: ({ args, routerAddress, }: {
334
+ args: RemoveLiquiditySingleTokenArgs;
335
+ routerAddress: Address;
336
+ }) => Unwrapable<Call>;
337
+ export type RemoveLiquiditySingleSyArgs = Readonly<{
338
+ receiver: Address;
339
+ market: Address;
340
+ netLpToRemove: bigint;
341
+ minSyOut: bigint;
342
+ }>;
343
+ export declare const removeLiquiditySingleSyCalldata: ({ receiver, market, netLpToRemove, minSyOut, }: RemoveLiquiditySingleSyArgs) => HexString;
344
+ export declare const removeLiquiditySingleSyTrx: ({ args, routerAddress, }: {
345
+ args: RemoveLiquiditySingleSyArgs;
346
+ routerAddress: Address;
347
+ }) => Unwrapable<Call>;
348
+ export type RemoveLiquiditySinglePtArgs = Readonly<{
349
+ receiver: Address;
350
+ market: Address;
351
+ netLpToRemove: bigint;
352
+ minPtOut: bigint;
353
+ guess: ApproxParams;
354
+ }>;
355
+ export declare const removeLiquiditySinglePtCalldata: ({ receiver, market, netLpToRemove, minPtOut, guess, }: RemoveLiquiditySinglePtArgs) => HexString;
356
+ export declare const removeLiquiditySinglePtTrx: ({ args, routerAddress, }: {
357
+ args: RemoveLiquiditySinglePtArgs;
358
+ routerAddress: Address;
359
+ }) => Unwrapable<Call>;
360
+ export type RemoveLiquidityDualTokenAndPtArgs = Readonly<{
361
+ receiver: Address;
362
+ market: Address;
363
+ netLpToRemove: bigint;
364
+ output: TokenOutputParams;
365
+ minPtOut: bigint;
366
+ }>;
367
+ export declare const removeLiquidityDualTokenAndPtCalldata: ({ receiver, market, netLpToRemove, output, minPtOut, }: RemoveLiquidityDualTokenAndPtArgs) => HexString;
368
+ export declare const removeLiquidityDualTokenAndPtTrx: ({ args, routerAddress, }: {
369
+ args: RemoveLiquidityDualTokenAndPtArgs;
370
+ routerAddress: Address;
371
+ }) => Unwrapable<Call>;
372
+ export type RemoveLiquidityDualSyAndPtArgs = Readonly<{
373
+ receiver: Address;
374
+ market: Address;
375
+ netLpToRemove: bigint;
376
+ minSyOut: bigint;
377
+ minPtOut: bigint;
378
+ }>;
379
+ export declare const removeLiquidityDualSyAndPtCalldata: ({ receiver, market, netLpToRemove, minSyOut, minPtOut, }: RemoveLiquidityDualSyAndPtArgs) => HexString;
380
+ export declare const removeLiquidityDualSyAndPtTrx: ({ args, routerAddress, }: {
381
+ args: RemoveLiquidityDualSyAndPtArgs;
382
+ routerAddress: Address;
383
+ }) => Unwrapable<Call>;
384
+ //# sourceMappingURL=pendle.router.encoders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendle.router.encoders.d.ts","sourceRoot":"","sources":["../../../src/integrations/pendle/pendle.router.encoders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAc,MAAM,sBAAsB,CAAC;AAQ9F;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC,CAAC;AAEH;;;;GAI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MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,kCAAkC,6DAM5C,8BAA8B,KAAG,SAK9B,CAAC;AAEP,eAAO,MAAM,6BAA6B;UAIhC,8BAA8B;mBACrB,OAAO;MACtB,WAAW,IAAI,CAAuE,CAAC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
7
- "version": "1.4.37",
7
+ "version": "1.4.39",
8
8
  "files": [
9
9
  "dist",
10
10
  "src",
@@ -21,7 +21,8 @@
21
21
  "build": "rm -rf ./dist && bun build ./src/index.ts --outdir ./dist --entry-naming index.js --format esm --sourcemap=external && bun build ./src/index.ts --outdir ./dist --entry-naming index.cjs --format cjs --sourcemap=external && bun tsc --project tsconfig.json",
22
22
  "verify:dist": "bun run scripts/verify-dist.ts",
23
23
  "fmt": "prettier --write . && forge fmt",
24
- "release": "bun run fmt && bun run build && bun run verify:dist && npm publish --tag latest"
24
+ "test": "bun test",
25
+ "release": "bun run fmt && bun run build && bun run verify:dist && bun run test && npm publish --tag latest"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@types/bun": "latest",
@@ -79,46 +79,98 @@ function validateLagoonV2Rates(rates: LagoonV2Rates): void {
79
79
  // ---------------------------------------------------------------------------
80
80
 
81
81
  /**
82
- * Encodes a `settleDeposit(uint256 epoch)` call.
82
+ * Encodes a `settleDeposit(uint256 newTotalAssets)` call.
83
83
  * Selector: 0xd24ca58a
84
84
  * Role: Safe (Settler)
85
+ *
86
+ * The uint256 arg is the vault's NEW TOTAL ASSETS (NAV) — NOT an epoch. Verified
87
+ * against the deployed v0.6 impl (`settleDeposit` calls
88
+ * `ERC7540Lib.updateTotalAssets(_newTotalAssets)`) and the v0.5 contract; same
89
+ * selector and semantics on both, so this encoder is valid for v0.5 and v0.6.
90
+ *
91
+ * `epoch` is a deprecated alias for `newTotalAssets`, retained for backwards
92
+ * compatibility — prefer `newTotalAssets`.
85
93
  */
86
- export const LagoonV2SettleDepositCalldata = ({ epoch }: { epoch: bigint }): HexString => {
94
+ export const LagoonV2SettleDepositCalldata = ({
95
+ newTotalAssets,
96
+ epoch,
97
+ }: {
98
+ newTotalAssets?: bigint;
99
+ /** @deprecated misnomer — pass `newTotalAssets` (the NAV) instead. */
100
+ epoch?: bigint;
101
+ }): HexString => {
102
+ const nav = newTotalAssets ?? epoch;
103
+ if (nav === undefined) {
104
+ throw new Error("LagoonV2SettleDepositCalldata: `newTotalAssets` is required");
105
+ }
87
106
  return encodeFunctionData({
88
107
  abi: lagoonV2VaultAbi,
89
108
  functionName: "settleDeposit",
90
- args: [epoch],
109
+ args: [nav],
91
110
  }) as HexString;
92
111
  };
93
112
 
94
- export const lagoonV2SettleDepositTrx = ({ vault, epoch }: { vault: Address; epoch: bigint }): Unwrapable<Call> => {
113
+ export const lagoonV2SettleDepositTrx = ({
114
+ vault,
115
+ newTotalAssets,
116
+ epoch,
117
+ }: {
118
+ vault: Address;
119
+ newTotalAssets?: bigint;
120
+ /** @deprecated misnomer — pass `newTotalAssets` (the NAV) instead. */
121
+ epoch?: bigint;
122
+ }): Unwrapable<Call> => {
95
123
  return createCall({
96
124
  operation: 0,
97
125
  to: vault,
98
126
  value: 0n,
99
- data: LagoonV2SettleDepositCalldata({ epoch }),
127
+ data: LagoonV2SettleDepositCalldata({ newTotalAssets, epoch }),
100
128
  });
101
129
  };
102
130
 
103
131
  /**
104
- * Encodes a `settleRedeem(uint256 epoch)` call.
132
+ * Encodes a `settleRedeem(uint256 newTotalAssets)` call.
105
133
  * Selector: 0xa627df66
106
134
  * Role: Safe (Settler)
135
+ *
136
+ * As with settleDeposit, the uint256 arg is the NAV (verified against the deployed
137
+ * v0.6 impl + v0.5 contract). `epoch` is a deprecated alias kept for backwards
138
+ * compatibility — prefer `newTotalAssets`.
107
139
  */
108
- export const LagoonV2SettleRedeemCalldata = ({ epoch }: { epoch: bigint }): HexString => {
140
+ export const LagoonV2SettleRedeemCalldata = ({
141
+ newTotalAssets,
142
+ epoch,
143
+ }: {
144
+ newTotalAssets?: bigint;
145
+ /** @deprecated misnomer — pass `newTotalAssets` (the NAV) instead. */
146
+ epoch?: bigint;
147
+ }): HexString => {
148
+ const nav = newTotalAssets ?? epoch;
149
+ if (nav === undefined) {
150
+ throw new Error("LagoonV2SettleRedeemCalldata: `newTotalAssets` is required");
151
+ }
109
152
  return encodeFunctionData({
110
153
  abi: lagoonV2VaultAbi,
111
154
  functionName: "settleRedeem",
112
- args: [epoch],
155
+ args: [nav],
113
156
  }) as HexString;
114
157
  };
115
158
 
116
- export const lagoonV2SettleRedeemTrx = ({ vault, epoch }: { vault: Address; epoch: bigint }): Unwrapable<Call> => {
159
+ export const lagoonV2SettleRedeemTrx = ({
160
+ vault,
161
+ newTotalAssets,
162
+ epoch,
163
+ }: {
164
+ vault: Address;
165
+ newTotalAssets?: bigint;
166
+ /** @deprecated misnomer — pass `newTotalAssets` (the NAV) instead. */
167
+ epoch?: bigint;
168
+ }): Unwrapable<Call> => {
117
169
  return createCall({
118
170
  operation: 0,
119
171
  to: vault,
120
172
  value: 0n,
121
- data: LagoonV2SettleRedeemCalldata({ epoch }),
173
+ data: LagoonV2SettleRedeemCalldata({ newTotalAssets, epoch }),
122
174
  });
123
175
  };
124
176
 
@@ -53,7 +53,7 @@ export default [
53
53
  name: "settleDeposit",
54
54
  inputs: [
55
55
  {
56
- name: "epoch",
56
+ name: "newTotalAssets",
57
57
  type: "uint256",
58
58
  internalType: "uint256",
59
59
  },
@@ -66,7 +66,7 @@ export default [
66
66
  name: "settleRedeem",
67
67
  inputs: [
68
68
  {
69
- name: "epoch",
69
+ name: "newTotalAssets",
70
70
  type: "uint256",
71
71
  internalType: "uint256",
72
72
  },
@@ -1,5 +1,5 @@
1
1
  import { ethers } from "ethers";
2
- import type { Address } from "viem";
2
+ import { encodeAbiParameters, type Address } from "viem";
3
3
  import { type Call, type HexString, type Unwrapable, createCall } from "../../types/index.ts";
4
4
  import MorphoBlueAbi from "./morpho.blue.abi.ts";
5
5
 
@@ -304,3 +304,46 @@ export const withdrawMorphoBlueTrx = ({
304
304
  data: WithdrawMorphoBlueCalldata(args),
305
305
  });
306
306
  };
307
+
308
+ // -------------------------------- MorphoBlueMarketParamsCalldata ---------------
309
+
310
+ /**
311
+ * ABI component list for a Morpho Blue MarketParams tuple.
312
+ * Field order is canonical — must match the Morpho Blue solidity struct exactly:
313
+ * `struct MarketParams { address loanToken; address collateralToken; address oracle; address irm; uint256 lltv; }`
314
+ */
315
+ const MARKET_PARAMS_ABI_COMPONENTS = [
316
+ {
317
+ type: "tuple" as const,
318
+ components: [
319
+ { name: "loanToken", type: "address" as const },
320
+ { name: "collateralToken", type: "address" as const },
321
+ { name: "oracle", type: "address" as const },
322
+ { name: "irm", type: "address" as const },
323
+ { name: "lltv", type: "uint256" as const },
324
+ ],
325
+ },
326
+ ] as const;
327
+
328
+ /**
329
+ * Encode a `MorphoBlueMarketParams` struct as raw ABI bytes (no function selector).
330
+ *
331
+ * This produces the `data` argument passed to
332
+ * `forceDeallocate(adapter, data, assets, onBehalf)` on a Morpho Vault V2
333
+ * when the adapter is a `MorphoMarketV1Adapter`.
334
+ *
335
+ * Encoding: `abi.encode(MarketParams)` — 5 × 32-byte words, 160 bytes total:
336
+ * word 0: loanToken (address, left-padded)
337
+ * word 1: collateralToken (address, left-padded)
338
+ * word 2: oracle (address, left-padded)
339
+ * word 3: irm (address, left-padded)
340
+ * word 4: lltv (uint256)
341
+ *
342
+ * Pure — no side effects, no I/O. Deterministic for identical inputs.
343
+ *
344
+ * @param marketParams - The five-field Morpho Blue market identifier.
345
+ * @returns 0x-prefixed hex string of 160 bytes.
346
+ */
347
+ export const MorphoBlueMarketParamsCalldata = (marketParams: MorphoBlueMarketParams): HexString => {
348
+ return encodeAbiParameters(MARKET_PARAMS_ABI_COMPONENTS, [marketParams]) as HexString;
349
+ };