damm-sdk 1.4.26 → 1.4.28

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.
@@ -2,6 +2,9 @@ import type { HexString } from "../../types";
2
2
  import { type Unwrapable } from "../../types";
3
3
  import type { Address } from "viem";
4
4
  import type { Call } from "../../types";
5
+ export declare const CCTP_V2_DOMAIN_BY_CHAIN_ID: Readonly<Record<number, number>>;
6
+ export declare const getCctpV2Domain: (chainId: number) => number;
7
+ export declare const isCctpV2Supported: (chainId: number) => boolean;
5
8
  export type DepositForBurnArgs = {
6
9
  amount: bigint;
7
10
  destinationDomain: number;
@@ -1 +1 @@
1
- {"version":3,"file":"cctp.v2.d.ts","sourceRoot":"","sources":["../../../src/integrations/cctp/cctp.v2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAoBxC,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,sBAAsB,8GAQhC,kBAAkB,KAAG,SAUvB,CAAC;AAEF,eAAO,MAAM,uBAAuB;UAI1B,kBAAkB;2BACD,OAAO;MAC9B,WAAW,IAAI,CAOlB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC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,kBAAkB,KAAG,SAErF,CAAC;AAEF,eAAO,MAAM,yBAAyB;UAI5B,kBAAkB;+BACG,OAAO;MAClC,WAAW,IAAI,CAOlB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from "./ipor.fusion";
2
+ export * from "./withdraw.manager";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/iporFusion/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/iporFusion/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
@@ -60,6 +60,28 @@ declare const _default: readonly [{
60
60
  }];
61
61
  readonly stateMutability: "nonpayable";
62
62
  readonly type: "function";
63
+ }, {
64
+ readonly inputs: readonly [{
65
+ readonly internalType: "uint256";
66
+ readonly name: "shares";
67
+ readonly type: "uint256";
68
+ }, {
69
+ readonly internalType: "address";
70
+ readonly name: "receiver";
71
+ readonly type: "address";
72
+ }, {
73
+ readonly internalType: "address";
74
+ readonly name: "owner";
75
+ readonly type: "address";
76
+ }];
77
+ readonly name: "redeemFromRequest";
78
+ readonly outputs: readonly [{
79
+ readonly internalType: "uint256";
80
+ readonly name: "assets";
81
+ readonly type: "uint256";
82
+ }];
83
+ readonly stateMutability: "nonpayable";
84
+ readonly type: "function";
63
85
  }, {
64
86
  readonly inputs: readonly [];
65
87
  readonly name: "asset";
@@ -1 +1 @@
1
- {"version":3,"file":"ipor.fusion.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/iporFusion/ipor.fusion.abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAsDW"}
1
+ {"version":3,"file":"ipor.fusion.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/iporFusion/ipor.fusion.abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAiEW"}
@@ -29,4 +29,14 @@ export declare const redeemIporFusionTrx: ({ args, vaultAddress, }: {
29
29
  args: RedeemIporFusionArgs;
30
30
  vaultAddress: Address;
31
31
  }) => Unwrapable<Call>;
32
+ export type RedeemFromRequestIporFusionArgs = Readonly<{
33
+ shares: bigint;
34
+ receiver: Address;
35
+ owner: Address;
36
+ }>;
37
+ export declare const RedeemFromRequestIporFusionCalldata: ({ shares, receiver, owner, }: RedeemFromRequestIporFusionArgs) => HexString;
38
+ export declare const redeemFromRequestIporFusionTrx: ({ args, vaultAddress, }: {
39
+ args: RedeemFromRequestIporFusionArgs;
40
+ vaultAddress: Address;
41
+ }) => Unwrapable<Call>;
32
42
  //# sourceMappingURL=ipor.fusion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ipor.fusion.d.ts","sourceRoot":"","sources":["../../../src/integrations/iporFusion/ipor.fusion.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAS/D,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,yBAAyB,yBAA0B,qBAAqB,KAAG,SAEvF,CAAC;AAEF,eAAO,MAAM,oBAAoB;UAIvB,qBAAqB;kBACb,OAAO;MACrB,WAAW,IAAI,CAOlB,CAAC;AAMF,MAAM,MAAM,s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AAC,CAAC;AAEH,eAAO,MAAM,0BAA0B,gCAAiC,sBAAsB,KAAG,SAEhG,CAAC;AAEF,eAAO,MAAM,qBAAqB;UAIxB,sBAAsB;kBACd,OAAO;MACrB,WAAW,IAAI,CAOlB,CAAC;AAMF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,wBAAwB,gCAAiC,oBAAoB,KAAG,SAE5F,CAAC;AAEF,eAAO,MAAM,mBAAmB;UAItB,oBAAoB;kBACZ,OAAO;MACrB,WAAW,IAAI,CAOlB,CAAC;AAcF,MAAM,MAAM,+BAA+B,GAAG,QAAQ,CAAC;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,mCAAmC,iCAI7C,+BAA+B,KAAG,SAEpC,CAAC;AAEF,eAAO,MAAM,8BAA8B;UAIjC,+BAA+B;kBACvB,OAAO;MACrB,WAAW,IAAI,CAOlB,CAAC"}
@@ -0,0 +1,104 @@
1
+ declare const _default: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly internalType: "uint256";
4
+ readonly name: "shares_";
5
+ readonly type: "uint256";
6
+ }];
7
+ readonly name: "requestShares";
8
+ readonly outputs: readonly [];
9
+ readonly stateMutability: "nonpayable";
10
+ readonly type: "function";
11
+ }, {
12
+ readonly inputs: readonly [];
13
+ readonly name: "getPlasmaVaultAddress";
14
+ readonly outputs: readonly [{
15
+ readonly internalType: "address";
16
+ readonly name: "";
17
+ readonly type: "address";
18
+ }];
19
+ readonly stateMutability: "view";
20
+ readonly type: "function";
21
+ }, {
22
+ readonly inputs: readonly [];
23
+ readonly name: "getLastReleaseFundsTimestamp";
24
+ readonly outputs: readonly [{
25
+ readonly internalType: "uint256";
26
+ readonly name: "";
27
+ readonly type: "uint256";
28
+ }];
29
+ readonly stateMutability: "view";
30
+ readonly type: "function";
31
+ }, {
32
+ readonly inputs: readonly [];
33
+ readonly name: "getSharesToRelease";
34
+ readonly outputs: readonly [{
35
+ readonly internalType: "uint256";
36
+ readonly name: "";
37
+ readonly type: "uint256";
38
+ }];
39
+ readonly stateMutability: "view";
40
+ readonly type: "function";
41
+ }, {
42
+ readonly inputs: readonly [];
43
+ readonly name: "getWithdrawWindow";
44
+ readonly outputs: readonly [{
45
+ readonly internalType: "uint256";
46
+ readonly name: "";
47
+ readonly type: "uint256";
48
+ }];
49
+ readonly stateMutability: "view";
50
+ readonly type: "function";
51
+ }, {
52
+ readonly inputs: readonly [];
53
+ readonly name: "getWithdrawFee";
54
+ readonly outputs: readonly [{
55
+ readonly internalType: "uint256";
56
+ readonly name: "";
57
+ readonly type: "uint256";
58
+ }];
59
+ readonly stateMutability: "view";
60
+ readonly type: "function";
61
+ }, {
62
+ readonly inputs: readonly [];
63
+ readonly name: "getRequestFee";
64
+ readonly outputs: readonly [{
65
+ readonly internalType: "uint256";
66
+ readonly name: "";
67
+ readonly type: "uint256";
68
+ }];
69
+ readonly stateMutability: "view";
70
+ readonly type: "function";
71
+ }, {
72
+ readonly inputs: readonly [{
73
+ readonly internalType: "address";
74
+ readonly name: "account_";
75
+ readonly type: "address";
76
+ }];
77
+ readonly name: "requestInfo";
78
+ readonly outputs: readonly [{
79
+ readonly components: readonly [{
80
+ readonly internalType: "uint128";
81
+ readonly name: "shares";
82
+ readonly type: "uint128";
83
+ }, {
84
+ readonly internalType: "uint32";
85
+ readonly name: "endWithdrawWindow";
86
+ readonly type: "uint32";
87
+ }, {
88
+ readonly internalType: "uint256";
89
+ readonly name: "amount";
90
+ readonly type: "uint256";
91
+ }, {
92
+ readonly internalType: "bool";
93
+ readonly name: "canWithdraw";
94
+ readonly type: "bool";
95
+ }];
96
+ readonly internalType: "struct WithdrawRequestInfo";
97
+ readonly name: "";
98
+ readonly type: "tuple";
99
+ }];
100
+ readonly stateMutability: "view";
101
+ readonly type: "function";
102
+ }];
103
+ export default _default;
104
+ //# sourceMappingURL=withdraw.manager.abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdraw.manager.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/iporFusion/withdraw.manager.abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAqEW"}
@@ -0,0 +1,11 @@
1
+ import type { Address } from "viem";
2
+ import type { HexString, Unwrapable, Call } from "../../types";
3
+ export type RequestSharesIporFusionArgs = Readonly<{
4
+ shares: bigint;
5
+ }>;
6
+ export declare const RequestSharesIporFusionCalldata: ({ shares }: RequestSharesIporFusionArgs) => HexString;
7
+ export declare const requestSharesIporFusionTrx: ({ args, withdrawManagerAddress, }: {
8
+ args: RequestSharesIporFusionArgs;
9
+ withdrawManagerAddress: Address;
10
+ }) => Unwrapable<Call>;
11
+ //# sourceMappingURL=withdraw.manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdraw.manager.d.ts","sourceRoot":"","sources":["../../../src/integrations/iporFusion/withdraw.manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AA4B/D,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,+BAA+B,eAAgB,2BAA2B,KAAG,SAEzF,CAAC;AAEF,eAAO,MAAM,0BAA0B;UAI7B,2BAA2B;4BACT,OAAO;MAC/B,WAAW,IAAI,CAOlB,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.26",
7
+ "version": "1.4.28",
8
8
  "files": [
9
9
  "dist",
10
10
  "src",
@@ -9,6 +9,31 @@ import type { Call } from "../../types";
9
9
  const messageTransmitterAbi = new ethers.utils.Interface(CctpMessageTransmitterV2Abi);
10
10
  const tokenMessengerAbi = new ethers.utils.Interface(CctpTokenMessengerV2Abi);
11
11
 
12
+ // Circle CCTP V2 domain IDs for every chain that has TokenMessengerV2 deployed
13
+ // in contractsRegistry.json. Kept in lock-step with that registry — when a new
14
+ // chain's CCTP addresses are added there, add its domain here.
15
+ // Source: https://developers.circle.com/stablecoins/docs/supported-domains
16
+ export const CCTP_V2_DOMAIN_BY_CHAIN_ID: Readonly<Record<number, number>> = Object.freeze({
17
+ 1: 0, // Ethereum
18
+ 10: 2, // Optimism
19
+ 42161: 3, // Arbitrum
20
+ 8453: 6, // Base
21
+ 137: 7, // Polygon
22
+ 130: 10, // Unichain
23
+ 480: 14, // Worldchain
24
+ 143: 15, // Monad
25
+ });
26
+
27
+ export const getCctpV2Domain = (chainId: number): number => {
28
+ const domain = CCTP_V2_DOMAIN_BY_CHAIN_ID[chainId];
29
+ if (domain === undefined) {
30
+ throw new Error(`DAMM-sdk: CCTP V2 domain not mapped for chainId ${chainId}`);
31
+ }
32
+ return domain;
33
+ };
34
+
35
+ export const isCctpV2Supported = (chainId: number): boolean => CCTP_V2_DOMAIN_BY_CHAIN_ID[chainId] !== undefined;
36
+
12
37
  // function depositForBurn(
13
38
  // uint256 amount,
14
39
  // uint32 destinationDomain,
@@ -1 +1,2 @@
1
1
  export * from "./ipor.fusion";
2
+ export * from "./withdraw.manager";
@@ -31,6 +31,17 @@ export default [
31
31
  stateMutability: "nonpayable",
32
32
  type: "function",
33
33
  },
34
+ {
35
+ inputs: [
36
+ { internalType: "uint256", name: "shares", type: "uint256" },
37
+ { internalType: "address", name: "receiver", type: "address" },
38
+ { internalType: "address", name: "owner", type: "address" },
39
+ ],
40
+ name: "redeemFromRequest",
41
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
42
+ stateMutability: "nonpayable",
43
+ type: "function",
44
+ },
34
45
  {
35
46
  inputs: [],
36
47
  name: "asset",
@@ -91,3 +91,44 @@ export const redeemIporFusionTrx = ({
91
91
  data: RedeemIporFusionCalldata(args),
92
92
  });
93
93
  };
94
+
95
+ // ============================================================================
96
+ // RedeemFromRequest - async withdrawal claim leg
97
+ // ============================================================================
98
+ //
99
+ // IPOR Fusion PlasmaVaults expose a second redeem path for withdrawals that
100
+ // were queued via `WithdrawManager.requestShares(…)`. After IPOR governance
101
+ // calls `releaseFunds(timestamp, shares)` on the manager, the requester has
102
+ // a window to pull `shares` with `redeemFromRequest(shares, receiver, owner)`
103
+ // on the vault itself. The function signature mirrors `redeem`; the vault
104
+ // routes the burn through the WithdrawManager's release accounting rather
105
+ // than against the vault's liquid balance.
106
+
107
+ export type RedeemFromRequestIporFusionArgs = Readonly<{
108
+ shares: bigint;
109
+ receiver: Address;
110
+ owner: Address;
111
+ }>;
112
+
113
+ export const RedeemFromRequestIporFusionCalldata = ({
114
+ shares,
115
+ receiver,
116
+ owner,
117
+ }: RedeemFromRequestIporFusionArgs): HexString => {
118
+ return iporFusionInterface.encodeFunctionData("redeemFromRequest", [shares, receiver, owner]) as HexString;
119
+ };
120
+
121
+ export const redeemFromRequestIporFusionTrx = ({
122
+ args,
123
+ vaultAddress,
124
+ }: {
125
+ args: RedeemFromRequestIporFusionArgs;
126
+ vaultAddress: Address;
127
+ }): Unwrapable<Call> => {
128
+ return createCall({
129
+ operation: 0,
130
+ to: vaultAddress,
131
+ value: 0n,
132
+ data: RedeemFromRequestIporFusionCalldata(args),
133
+ });
134
+ };
@@ -0,0 +1,74 @@
1
+ // Minimal ABI for the IPOR Fusion WithdrawManager — the async redeem-queue
2
+ // coordinator bound to each PlasmaVault. We only need `requestShares` for
3
+ // calldata encoding; the read functions are included for completeness so
4
+ // UIs can surface pending-request info without a second ABI file.
5
+ export default [
6
+ {
7
+ inputs: [{ internalType: "uint256", name: "shares_", type: "uint256" }],
8
+ name: "requestShares",
9
+ outputs: [],
10
+ stateMutability: "nonpayable",
11
+ type: "function",
12
+ },
13
+ {
14
+ inputs: [],
15
+ name: "getPlasmaVaultAddress",
16
+ outputs: [{ internalType: "address", name: "", type: "address" }],
17
+ stateMutability: "view",
18
+ type: "function",
19
+ },
20
+ {
21
+ inputs: [],
22
+ name: "getLastReleaseFundsTimestamp",
23
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
24
+ stateMutability: "view",
25
+ type: "function",
26
+ },
27
+ {
28
+ inputs: [],
29
+ name: "getSharesToRelease",
30
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
31
+ stateMutability: "view",
32
+ type: "function",
33
+ },
34
+ {
35
+ inputs: [],
36
+ name: "getWithdrawWindow",
37
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
38
+ stateMutability: "view",
39
+ type: "function",
40
+ },
41
+ {
42
+ inputs: [],
43
+ name: "getWithdrawFee",
44
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
45
+ stateMutability: "view",
46
+ type: "function",
47
+ },
48
+ {
49
+ inputs: [],
50
+ name: "getRequestFee",
51
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
52
+ stateMutability: "view",
53
+ type: "function",
54
+ },
55
+ {
56
+ inputs: [{ internalType: "address", name: "account_", type: "address" }],
57
+ name: "requestInfo",
58
+ outputs: [
59
+ {
60
+ components: [
61
+ { internalType: "uint128", name: "shares", type: "uint128" },
62
+ { internalType: "uint32", name: "endWithdrawWindow", type: "uint32" },
63
+ { internalType: "uint256", name: "amount", type: "uint256" },
64
+ { internalType: "bool", name: "canWithdraw", type: "bool" },
65
+ ],
66
+ internalType: "struct WithdrawRequestInfo",
67
+ name: "",
68
+ type: "tuple",
69
+ },
70
+ ],
71
+ stateMutability: "view",
72
+ type: "function",
73
+ },
74
+ ] as const;
@@ -0,0 +1,53 @@
1
+ import { ethers } from "ethers";
2
+ import WithdrawManagerAbi from "./withdraw.manager.abi";
3
+ import type { Address } from "viem";
4
+ import type { HexString, Unwrapable, Call } from "../../types";
5
+ import { createCall } from "../../types";
6
+
7
+ // ============================================================================
8
+ // IPOR Fusion WithdrawManager
9
+ // ============================================================================
10
+ //
11
+ // The PlasmaVault's async redeem queue is coordinated by a dedicated
12
+ // WithdrawManager contract, one per vault. The full lifecycle is:
13
+ //
14
+ // 1) WithdrawManager.requestShares(shares) <- this file
15
+ // Caller queues `shares` of vault equity for later redemption. The
16
+ // vault side locks those shares; `releaseFunds` must later approve
17
+ // a matching batch before the caller can claim.
18
+ //
19
+ // 2) WithdrawManager.releaseFunds(timestamp, shares) <- IPOR governance
20
+ // Off-limits to fund roles; IPOR's ops run this to open the window.
21
+ //
22
+ // 3) PlasmaVault.redeemFromRequest(shares, receiver, owner)
23
+ // Claim leg — lives on the vault, not the manager. Helper for that
24
+ // is in `./ipor.fusion.ts` (`redeemFromRequestIporFusionTrx`).
25
+
26
+ const withdrawManagerInterface = new ethers.utils.Interface(WithdrawManagerAbi);
27
+
28
+ // ============================================================================
29
+ // requestShares — queue an async redeem request
30
+ // ============================================================================
31
+
32
+ export type RequestSharesIporFusionArgs = Readonly<{
33
+ shares: bigint;
34
+ }>;
35
+
36
+ export const RequestSharesIporFusionCalldata = ({ shares }: RequestSharesIporFusionArgs): HexString => {
37
+ return withdrawManagerInterface.encodeFunctionData("requestShares", [shares]) as HexString;
38
+ };
39
+
40
+ export const requestSharesIporFusionTrx = ({
41
+ args,
42
+ withdrawManagerAddress,
43
+ }: {
44
+ args: RequestSharesIporFusionArgs;
45
+ withdrawManagerAddress: Address;
46
+ }): Unwrapable<Call> => {
47
+ return createCall({
48
+ operation: 0,
49
+ to: withdrawManagerAddress,
50
+ value: 0n,
51
+ data: RequestSharesIporFusionCalldata(args),
52
+ });
53
+ };
@@ -619,7 +619,8 @@
619
619
  "multisendUnwrapper": "0xB4Cd4bb764C089f20DA18700CE8bc5e49F369efD"
620
620
  },
621
621
  "iporFusion": {
622
- "vault": "0x604117f0c94561231060f56cd2ddd16245d434c5"
622
+ "vault": "0x604117f0c94561231060f56cd2ddd16245d434c5",
623
+ "withdrawManager": "0x14dd163386553b23267c097dbde868559b9bcbd2"
623
624
  },
624
625
  "pendle": {
625
626
  "routerV4": "0x888888888889758f76e7103c6cbf23abbf58f946",
@@ -996,7 +997,8 @@
996
997
  },
997
998
  "wrappedNativeToken": "0x6100E367285b01F48D07953803A2d8dCA5D19873",
998
999
  "iporFusion": {
999
- "vault": "0x0A71624ab3E8101f78D95DFc81E0F1f31128Ed7A"
1000
+ "vault": "0x0A71624ab3E8101f78D95DFc81E0F1f31128Ed7A",
1001
+ "withdrawManager": "0x09322e8a025d632c893803e33360a6b587495a5b"
1000
1002
  }
1001
1003
  },
1002
1004
  "megaeth": {