@oydual31/more-vaults-sdk 1.1.21 → 1.1.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oydual31/more-vaults-sdk",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "TypeScript SDK for MoreVaults protocol — viem/wagmi and ethers.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -126,7 +126,7 @@ export async function addAvailableAssets(
126
126
  ): Promise<{ txHash: `0x${string}` }> {
127
127
  const account = walletClient.account!
128
128
  const v = getAddress(vault)
129
- const checksummed = assets.map(getAddress)
129
+ const checksummed = assets.map(a => getAddress(a))
130
130
 
131
131
  try {
132
132
  await publicClient.simulateContract({
@@ -268,7 +268,7 @@ export async function setDepositWhitelist(
268
268
  throw new InvalidInputError('depositors and caps arrays must have the same length')
269
269
  }
270
270
 
271
- const checksummed = depositors.map(getAddress)
271
+ const checksummed = depositors.map(a => getAddress(a))
272
272
 
273
273
  try {
274
274
  await publicClient.simulateContract({
@@ -267,8 +267,9 @@ export const LZ_TIMEOUTS = {
267
267
  *
268
268
  * Note on struct differences:
269
269
  * - SwapRouter (Eth/Arb/Op, 0xE592...): exactInputSingle struct includes `deadline`
270
- * - SwapRouter02 (Base, 0x2626...): exactInputSingle struct does NOT include `deadline`
271
- * - FlowSwap V3 (Flow EVM, 0xeEDC...): derived from original UniV3, includes `deadline`
270
+ * - SwapRouter02 (Base/Flow, 0x2626.../0xeEDC...): struct does NOT include `deadline`
271
+ * Flow EVM confirmed via PUSH4 scan: router only dispatches 0x04e45aaf (SwapRouter02),
272
+ * not 0x414bf389 (SwapRouter). Both are in curatorSwaps.ts SWAP_ROUTER02_CHAINS.
272
273
  */
273
274
  export const UNISWAP_V3_ROUTERS: Record<number, `0x${string}`> = {
274
275
  [8453]: '0x2626664c2603336E57B271c5C0b26F421741e481', // Base — SwapRouter02 (no deadline)
@@ -138,7 +138,7 @@ export function encodeCuratorAction(action: CuratorAction): `0x${string}` {
138
138
  return encodeFunctionData({
139
139
  abi: ADMIN_WRITE_ABI,
140
140
  functionName: 'addAvailableAssets',
141
- args: [action.assets.map(getAddress)],
141
+ args: [action.assets.map(a => getAddress(a))],
142
142
  })
143
143
 
144
144
  case 'disableAssetToDeposit':
@@ -55,7 +55,7 @@ export async function getCuratorVaultStatus(
55
55
  timeLockPeriod,
56
56
  maxSlippagePercent,
57
57
  currentNonce,
58
- availableAssets: availableAssets.map(getAddress),
58
+ availableAssets: availableAssets.map(a => getAddress(a)),
59
59
  lzAdapter: getAddress(lzAdapter),
60
60
  paused,
61
61
  }
@@ -177,8 +177,8 @@ export async function getVaultAnalysis(
177
177
  }).catch(() => null),
178
178
  ])
179
179
 
180
- const availableAddresses = (availableRaw as Address[]).map(getAddress)
181
- const depositableAddresses = (depositableRaw as Address[]).map(getAddress)
180
+ const availableAddresses = (availableRaw as Address[]).map(a => getAddress(a))
181
+ const depositableAddresses = (depositableRaw as Address[]).map(a => getAddress(a))
182
182
 
183
183
  // Deduplicated set of all asset addresses we need metadata for
184
184
  const allAddresses = Array.from(new Set([...availableAddresses, ...depositableAddresses]))
@@ -302,7 +302,7 @@ export async function getVaultAssetBreakdown(
302
302
  return { assets: [], totalAssets: 0n, totalSupply: 0n, underlyingDecimals: 6 }
303
303
  }
304
304
 
305
- const addresses = availableRaw.map(getAddress)
305
+ const addresses = availableRaw.map(a => getAddress(a))
306
306
 
307
307
  // Step 2: multicall — balanceOf + metadata for each asset + totalAssets + totalSupply + vault decimals
308
308
  const results = await publicClient.multicall({
@@ -86,8 +86,8 @@ export async function getSubVaultPositions(
86
86
  .catch(() => [] as Address[]),
87
87
  ])
88
88
 
89
- const erc4626Vaults = (erc4626Raw as Address[]).map(getAddress)
90
- const erc7540Vaults = (erc7540Raw as Address[]).map(getAddress)
89
+ const erc4626Vaults = (erc4626Raw as Address[]).map(a => getAddress(a))
90
+ const erc7540Vaults = (erc7540Raw as Address[]).map(a => getAddress(a))
91
91
 
92
92
  const allSubVaults: Array<{ address: Address; type: 'erc4626' | 'erc7540' }> = [
93
93
  ...erc4626Vaults.map((a) => ({ address: a, type: 'erc4626' as const })),
@@ -465,7 +465,7 @@ export async function getVaultPortfolio(
465
465
  ? getAddress(vaultTotals[2].result as Address)
466
466
  : zeroAddress
467
467
 
468
- const availableAddresses = (availableRaw as Address[]).map(getAddress)
468
+ const availableAddresses = (availableRaw as Address[]).map(a => getAddress(a))
469
469
 
470
470
  // Sub-vault share addresses to exclude from liquid assets (avoid double-counting)
471
471
  const subVaultAddressSet = new Set(subVaultPositions.map((p) => p.address.toLowerCase()))
@@ -10,7 +10,7 @@
10
10
  * - Ethereum (1): SwapRouter 0xE592... — HAS deadline field
11
11
  * - Arbitrum (42161): SwapRouter 0xE592... — HAS deadline field
12
12
  * - Optimism (10): SwapRouter 0xE592... — HAS deadline field
13
- * - Flow EVM (747): FlowSwap V3 0xeEDC... — HAS deadline field
13
+ * - Flow EVM (747): FlowSwap V3 0xeEDC... — NO deadline field (SwapRouter02-compatible)
14
14
  *
15
15
  * @module curatorSwaps
16
16
  */
@@ -89,8 +89,10 @@ const UNISWAP_V3_SWAP_ROUTER02_ABI = [
89
89
  /**
90
90
  * Chains that use SwapRouter02 (no deadline in struct).
91
91
  * All other chains in UNISWAP_V3_ROUTERS use the original SwapRouter.
92
+ *
93
+ * Flow EVM (747): FlowSwap V3 router exposes exactInputSingle with selector 0x04e45aaf
92
94
  */
93
- const SWAP_ROUTER02_CHAINS = new Set([8453])
95
+ const SWAP_ROUTER02_CHAINS = new Set([8453, 747])
94
96
 
95
97
  // ─────────────────────────────────────────────────────────────────────────────
96
98
  // Calldata encoding
@@ -93,7 +93,7 @@ export async function getVaultConfiguration(
93
93
  const num_ = (i: number): number =>
94
94
  results[i].status === 'success' ? Number(results[i].result) : 0
95
95
  const addrArray = (i: number): Address[] =>
96
- results[i].status === 'success' ? (results[i].result as Address[]).map(getAddress) : []
96
+ results[i].status === 'success' ? (results[i].result as Address[]).map(a => getAddress(a)) : []
97
97
 
98
98
  return {
99
99
  // Roles