@oydual31/more-vaults-sdk 0.2.9 → 0.3.1

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,4 +1,4 @@
1
- import { getAddress, zeroAddress, pad, encodeAbiParameters, createPublicClient, http, fallback } from 'viem';
1
+ import { getAddress, zeroAddress, pad, encodeAbiParameters, encodeFunctionData, createPublicClient, http, fallback } from 'viem';
2
2
 
3
3
  // src/viem/chains.ts
4
4
  var CHAIN_IDS = {
@@ -827,6 +827,293 @@ var OFT_ABI = [
827
827
  stateMutability: "view"
828
828
  }
829
829
  ];
830
+ var MULTICALL_ABI = [
831
+ {
832
+ type: "function",
833
+ name: "submitActions",
834
+ inputs: [
835
+ { name: "actionsData", type: "bytes[]" }
836
+ ],
837
+ outputs: [{ name: "nonce", type: "uint256" }],
838
+ stateMutability: "nonpayable"
839
+ },
840
+ {
841
+ type: "function",
842
+ name: "executeActions",
843
+ inputs: [
844
+ { name: "actionsNonce", type: "uint256" }
845
+ ],
846
+ outputs: [],
847
+ stateMutability: "nonpayable"
848
+ },
849
+ {
850
+ type: "function",
851
+ name: "getPendingActions",
852
+ inputs: [
853
+ { name: "actionsNonce", type: "uint256" }
854
+ ],
855
+ outputs: [
856
+ { name: "actionsData", type: "bytes[]" },
857
+ { name: "pendingUntil", type: "uint256" }
858
+ ],
859
+ stateMutability: "view"
860
+ },
861
+ {
862
+ type: "function",
863
+ name: "getCurrentNonce",
864
+ inputs: [],
865
+ outputs: [{ name: "", type: "uint256" }],
866
+ stateMutability: "view"
867
+ },
868
+ {
869
+ type: "function",
870
+ name: "vetoActions",
871
+ inputs: [
872
+ { name: "actionsNonces", type: "uint256[]" }
873
+ ],
874
+ outputs: [],
875
+ stateMutability: "nonpayable"
876
+ }
877
+ ];
878
+ var DEX_ABI = [
879
+ {
880
+ type: "function",
881
+ name: "executeSwap",
882
+ inputs: [
883
+ {
884
+ name: "params",
885
+ type: "tuple",
886
+ components: [
887
+ { name: "targetContract", type: "address" },
888
+ { name: "tokenIn", type: "address" },
889
+ { name: "tokenOut", type: "address" },
890
+ { name: "maxAmountIn", type: "uint256" },
891
+ { name: "minAmountOut", type: "uint256" },
892
+ { name: "swapCallData", type: "bytes" }
893
+ ]
894
+ }
895
+ ],
896
+ outputs: [{ name: "amountOut", type: "uint256" }],
897
+ stateMutability: "nonpayable"
898
+ },
899
+ {
900
+ type: "function",
901
+ name: "executeBatchSwap",
902
+ inputs: [
903
+ {
904
+ name: "params",
905
+ type: "tuple",
906
+ components: [
907
+ {
908
+ name: "swaps",
909
+ type: "tuple[]",
910
+ components: [
911
+ { name: "targetContract", type: "address" },
912
+ { name: "tokenIn", type: "address" },
913
+ { name: "tokenOut", type: "address" },
914
+ { name: "maxAmountIn", type: "uint256" },
915
+ { name: "minAmountOut", type: "uint256" },
916
+ { name: "swapCallData", type: "bytes" }
917
+ ]
918
+ }
919
+ ]
920
+ }
921
+ ],
922
+ outputs: [{ name: "amountsOut", type: "uint256[]" }],
923
+ stateMutability: "nonpayable"
924
+ }
925
+ ];
926
+ var BRIDGE_FACET_ABI = [
927
+ {
928
+ type: "function",
929
+ name: "executeBridging",
930
+ inputs: [
931
+ { name: "adapter", type: "address" },
932
+ { name: "token", type: "address" },
933
+ { name: "amount", type: "uint256" },
934
+ { name: "bridgeSpecificParams", type: "bytes" }
935
+ ],
936
+ outputs: [],
937
+ stateMutability: "payable"
938
+ },
939
+ {
940
+ type: "function",
941
+ name: "initVaultActionRequest",
942
+ inputs: [
943
+ { name: "actionType", type: "uint8" },
944
+ { name: "actionCallData", type: "bytes" },
945
+ { name: "amountLimit", type: "uint256" },
946
+ { name: "extraOptions", type: "bytes" }
947
+ ],
948
+ outputs: [{ name: "guid", type: "bytes32" }],
949
+ stateMutability: "payable"
950
+ },
951
+ {
952
+ type: "function",
953
+ name: "executeRequest",
954
+ inputs: [
955
+ { name: "guid", type: "bytes32" }
956
+ ],
957
+ outputs: [],
958
+ stateMutability: "nonpayable"
959
+ }
960
+ ];
961
+ var ERC7540_FACET_ABI = [
962
+ {
963
+ type: "function",
964
+ name: "erc7540RequestDeposit",
965
+ inputs: [
966
+ { name: "vault", type: "address" },
967
+ { name: "assets", type: "uint256" }
968
+ ],
969
+ outputs: [{ name: "requestId", type: "uint256" }],
970
+ stateMutability: "nonpayable"
971
+ },
972
+ {
973
+ type: "function",
974
+ name: "erc7540RequestRedeem",
975
+ inputs: [
976
+ { name: "vault", type: "address" },
977
+ { name: "shares", type: "uint256" }
978
+ ],
979
+ outputs: [{ name: "requestId", type: "uint256" }],
980
+ stateMutability: "nonpayable"
981
+ },
982
+ {
983
+ type: "function",
984
+ name: "erc7540Deposit",
985
+ inputs: [
986
+ { name: "vault", type: "address" },
987
+ { name: "assets", type: "uint256" }
988
+ ],
989
+ outputs: [{ name: "shares", type: "uint256" }],
990
+ stateMutability: "nonpayable"
991
+ },
992
+ {
993
+ type: "function",
994
+ name: "erc7540Redeem",
995
+ inputs: [
996
+ { name: "vault", type: "address" },
997
+ { name: "shares", type: "uint256" }
998
+ ],
999
+ outputs: [{ name: "assets", type: "uint256" }],
1000
+ stateMutability: "nonpayable"
1001
+ }
1002
+ ];
1003
+ var CURATOR_CONFIG_ABI = [
1004
+ {
1005
+ type: "function",
1006
+ name: "curator",
1007
+ inputs: [],
1008
+ outputs: [{ name: "", type: "address" }],
1009
+ stateMutability: "view"
1010
+ },
1011
+ {
1012
+ type: "function",
1013
+ name: "timeLockPeriod",
1014
+ inputs: [],
1015
+ outputs: [{ name: "", type: "uint256" }],
1016
+ stateMutability: "view"
1017
+ },
1018
+ {
1019
+ type: "function",
1020
+ name: "getAvailableAssets",
1021
+ inputs: [],
1022
+ outputs: [{ name: "", type: "address[]" }],
1023
+ stateMutability: "view"
1024
+ },
1025
+ {
1026
+ type: "function",
1027
+ name: "getMaxSlippagePercent",
1028
+ inputs: [],
1029
+ outputs: [{ name: "", type: "uint256" }],
1030
+ stateMutability: "view"
1031
+ },
1032
+ {
1033
+ type: "function",
1034
+ name: "getCrossChainAccountingManager",
1035
+ inputs: [],
1036
+ outputs: [{ name: "", type: "address" }],
1037
+ stateMutability: "view"
1038
+ },
1039
+ {
1040
+ type: "function",
1041
+ name: "paused",
1042
+ inputs: [],
1043
+ outputs: [{ name: "", type: "bool" }],
1044
+ stateMutability: "view"
1045
+ }
1046
+ ];
1047
+ var LZ_ADAPTER_ABI = [
1048
+ {
1049
+ type: "function",
1050
+ name: "quoteBridgeFee",
1051
+ inputs: [
1052
+ { name: "bridgeSpecificParams", type: "bytes" }
1053
+ ],
1054
+ outputs: [{ name: "nativeFee", type: "uint256" }],
1055
+ stateMutability: "view"
1056
+ },
1057
+ {
1058
+ type: "function",
1059
+ name: "quoteReadFee",
1060
+ inputs: [
1061
+ { name: "vaults", type: "address[]" },
1062
+ { name: "eids", type: "uint32[]" },
1063
+ { name: "_extraOptions", type: "bytes" }
1064
+ ],
1065
+ outputs: [
1066
+ {
1067
+ name: "fee",
1068
+ type: "tuple",
1069
+ components: [
1070
+ { name: "nativeFee", type: "uint256" },
1071
+ { name: "lzTokenFee", type: "uint256" }
1072
+ ]
1073
+ }
1074
+ ],
1075
+ stateMutability: "view"
1076
+ }
1077
+ ];
1078
+ var ERC4626_FACET_ABI = [
1079
+ {
1080
+ type: "function",
1081
+ name: "erc4626Deposit",
1082
+ inputs: [
1083
+ { name: "vault", type: "address" },
1084
+ { name: "assets", type: "uint256" }
1085
+ ],
1086
+ outputs: [{ name: "shares", type: "uint256" }],
1087
+ stateMutability: "nonpayable"
1088
+ },
1089
+ {
1090
+ type: "function",
1091
+ name: "erc4626Redeem",
1092
+ inputs: [
1093
+ { name: "vault", type: "address" },
1094
+ { name: "shares", type: "uint256" }
1095
+ ],
1096
+ outputs: [{ name: "assets", type: "uint256" }],
1097
+ stateMutability: "nonpayable"
1098
+ }
1099
+ ];
1100
+ var VAULT_ANALYSIS_ABI = [
1101
+ // Asset management reads
1102
+ { type: "function", name: "getAvailableAssets", inputs: [], outputs: [{ type: "address[]" }], stateMutability: "view" },
1103
+ { type: "function", name: "getDepositableAssets", inputs: [], outputs: [{ type: "address[]" }], stateMutability: "view" },
1104
+ { type: "function", name: "isAssetAvailable", inputs: [{ name: "asset", type: "address" }], outputs: [{ type: "bool" }], stateMutability: "view" },
1105
+ { type: "function", name: "isAssetDepositable", inputs: [{ name: "asset", type: "address" }], outputs: [{ type: "bool" }], stateMutability: "view" },
1106
+ // Deposit whitelist
1107
+ { type: "function", name: "isDepositWhitelistEnabled", inputs: [], outputs: [{ type: "bool" }], stateMutability: "view" },
1108
+ { type: "function", name: "getAvailableToDeposit", inputs: [{ name: "depositor", type: "address" }], outputs: [{ type: "uint256" }], stateMutability: "view" },
1109
+ // Registry
1110
+ { type: "function", name: "moreVaultsRegistry", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" }
1111
+ ];
1112
+ var REGISTRY_ABI = [
1113
+ { type: "function", name: "isWhitelisted", inputs: [{ name: "protocol", type: "address" }], outputs: [{ type: "bool" }], stateMutability: "view" },
1114
+ { type: "function", name: "isBridgeAllowed", inputs: [{ name: "bridge", type: "address" }], outputs: [{ type: "bool" }], stateMutability: "view" },
1115
+ { type: "function", name: "getAllowedFacets", inputs: [], outputs: [{ type: "address[]" }], stateMutability: "view" }
1116
+ ];
830
1117
  var LZ_ENDPOINT_ABI = [
831
1118
  {
832
1119
  type: "function",
@@ -2836,12 +3123,21 @@ async function canDeposit(publicClient, vault, user) {
2836
3123
  ],
2837
3124
  allowFailure: false
2838
3125
  });
3126
+ let whitelistEnabled = false;
3127
+ try {
3128
+ whitelistEnabled = await publicClient.readContract({
3129
+ address: v,
3130
+ abi: VAULT_ANALYSIS_ABI,
3131
+ functionName: "isDepositWhitelistEnabled"
3132
+ });
3133
+ } catch {
3134
+ }
2839
3135
  if (isPaused) {
2840
- return { allowed: false, reason: "paused" };
3136
+ return { allowed: false, reason: "paused", whitelistEnabled };
2841
3137
  }
2842
3138
  const isCrossChainAsync = isHub && !oraclesEnabled;
2843
3139
  if (isCrossChainAsync) {
2844
- return { allowed: true, reason: "ok" };
3140
+ return { allowed: true, reason: "ok", whitelistEnabled };
2845
3141
  }
2846
3142
  let maxDepositAmount;
2847
3143
  try {
@@ -2852,12 +3148,12 @@ async function canDeposit(publicClient, vault, user) {
2852
3148
  args: [getAddress(user)]
2853
3149
  });
2854
3150
  } catch {
2855
- return { allowed: false, reason: "not-whitelisted" };
3151
+ return { allowed: false, reason: "not-whitelisted", maxDeposit: 0n, whitelistEnabled };
2856
3152
  }
2857
3153
  if (maxDepositAmount === 0n) {
2858
- return { allowed: false, reason: "capacity-full" };
3154
+ return { allowed: false, reason: "capacity-full", maxDeposit: 0n, whitelistEnabled };
2859
3155
  }
2860
- return { allowed: true, reason: "ok" };
3156
+ return { allowed: true, reason: "ok", maxDeposit: maxDepositAmount, whitelistEnabled };
2861
3157
  }
2862
3158
  async function getVaultMetadata(publicClient, vault) {
2863
3159
  const v = getAddress(vault);
@@ -3201,6 +3497,290 @@ async function getVaultDistributionWithTopology(hubClient, vault) {
3201
3497
  spokeChainIds: topology.spokeChainIds
3202
3498
  };
3203
3499
  }
3500
+ async function getCuratorVaultStatus(publicClient, vault) {
3501
+ const v = getAddress(vault);
3502
+ const [
3503
+ curator,
3504
+ timeLockPeriod,
3505
+ maxSlippagePercent,
3506
+ currentNonce,
3507
+ availableAssets,
3508
+ lzAdapter,
3509
+ paused
3510
+ ] = await publicClient.multicall({
3511
+ contracts: [
3512
+ { address: v, abi: CURATOR_CONFIG_ABI, functionName: "curator" },
3513
+ { address: v, abi: CURATOR_CONFIG_ABI, functionName: "timeLockPeriod" },
3514
+ { address: v, abi: CURATOR_CONFIG_ABI, functionName: "getMaxSlippagePercent" },
3515
+ { address: v, abi: MULTICALL_ABI, functionName: "getCurrentNonce" },
3516
+ { address: v, abi: CURATOR_CONFIG_ABI, functionName: "getAvailableAssets" },
3517
+ { address: v, abi: CURATOR_CONFIG_ABI, functionName: "getCrossChainAccountingManager" },
3518
+ { address: v, abi: CURATOR_CONFIG_ABI, functionName: "paused" }
3519
+ ],
3520
+ allowFailure: false
3521
+ });
3522
+ return {
3523
+ curator: getAddress(curator),
3524
+ timeLockPeriod,
3525
+ maxSlippagePercent,
3526
+ currentNonce,
3527
+ availableAssets: availableAssets.map(getAddress),
3528
+ lzAdapter: getAddress(lzAdapter),
3529
+ paused
3530
+ };
3531
+ }
3532
+ async function getPendingActions(publicClient, vault, nonce) {
3533
+ const v = getAddress(vault);
3534
+ const [actionsResult, block] = await Promise.all([
3535
+ publicClient.readContract({
3536
+ address: v,
3537
+ abi: MULTICALL_ABI,
3538
+ functionName: "getPendingActions",
3539
+ args: [nonce]
3540
+ }),
3541
+ publicClient.getBlock()
3542
+ ]);
3543
+ const [actionsData, pendingUntil] = actionsResult;
3544
+ const isExecutable = pendingUntil > 0n && block.timestamp >= pendingUntil;
3545
+ return {
3546
+ nonce,
3547
+ actionsData,
3548
+ pendingUntil,
3549
+ isExecutable
3550
+ };
3551
+ }
3552
+ async function isCurator(publicClient, vault, address) {
3553
+ const curatorAddress = await publicClient.readContract({
3554
+ address: getAddress(vault),
3555
+ abi: CURATOR_CONFIG_ABI,
3556
+ functionName: "curator"
3557
+ });
3558
+ return getAddress(curatorAddress) === getAddress(address);
3559
+ }
3560
+ async function getVaultAnalysis(publicClient, vault) {
3561
+ const v = getAddress(vault);
3562
+ const [availableRaw, depositableRaw, depositWhitelistEnabled, registryResult] = await Promise.all([
3563
+ publicClient.readContract({
3564
+ address: v,
3565
+ abi: VAULT_ANALYSIS_ABI,
3566
+ functionName: "getAvailableAssets"
3567
+ }),
3568
+ publicClient.readContract({
3569
+ address: v,
3570
+ abi: VAULT_ANALYSIS_ABI,
3571
+ functionName: "getDepositableAssets"
3572
+ }),
3573
+ publicClient.readContract({
3574
+ address: v,
3575
+ abi: VAULT_ANALYSIS_ABI,
3576
+ functionName: "isDepositWhitelistEnabled"
3577
+ }),
3578
+ publicClient.readContract({
3579
+ address: v,
3580
+ abi: VAULT_ANALYSIS_ABI,
3581
+ functionName: "moreVaultsRegistry"
3582
+ }).catch(() => null)
3583
+ ]);
3584
+ const availableAddresses = availableRaw.map(getAddress);
3585
+ const depositableAddresses = depositableRaw.map(getAddress);
3586
+ const allAddresses = Array.from(/* @__PURE__ */ new Set([...availableAddresses, ...depositableAddresses]));
3587
+ const metadataCalls = allAddresses.flatMap((addr) => [
3588
+ { address: addr, abi: METADATA_ABI, functionName: "name" },
3589
+ { address: addr, abi: METADATA_ABI, functionName: "symbol" },
3590
+ { address: addr, abi: METADATA_ABI, functionName: "decimals" }
3591
+ ]);
3592
+ const metadataResults = allAddresses.length > 0 ? await publicClient.multicall({ contracts: metadataCalls, allowFailure: true }) : [];
3593
+ const assetInfoMap = /* @__PURE__ */ new Map();
3594
+ for (let i = 0; i < allAddresses.length; i++) {
3595
+ const addr = allAddresses[i];
3596
+ const nameResult = metadataResults[i * 3];
3597
+ const symbolResult = metadataResults[i * 3 + 1];
3598
+ const decimalsResult = metadataResults[i * 3 + 2];
3599
+ assetInfoMap.set(addr, {
3600
+ address: addr,
3601
+ name: nameResult?.status === "success" ? nameResult.result : "",
3602
+ symbol: symbolResult?.status === "success" ? symbolResult.result : "",
3603
+ decimals: decimalsResult?.status === "success" ? decimalsResult.result : 18
3604
+ });
3605
+ }
3606
+ const registryAddress = registryResult ? getAddress(registryResult) : null;
3607
+ return {
3608
+ availableAssets: availableAddresses.map((a) => assetInfoMap.get(a)),
3609
+ depositableAssets: depositableAddresses.map((a) => assetInfoMap.get(a)),
3610
+ depositWhitelistEnabled,
3611
+ registryAddress
3612
+ };
3613
+ }
3614
+ async function checkProtocolWhitelist(publicClient, vault, protocols) {
3615
+ const v = getAddress(vault);
3616
+ const registryRaw = await publicClient.readContract({
3617
+ address: v,
3618
+ abi: VAULT_ANALYSIS_ABI,
3619
+ functionName: "moreVaultsRegistry"
3620
+ });
3621
+ const registry = getAddress(registryRaw);
3622
+ if (protocols.length === 0) return {};
3623
+ const results = await publicClient.multicall({
3624
+ contracts: protocols.map((protocol) => ({
3625
+ address: registry,
3626
+ abi: REGISTRY_ABI,
3627
+ functionName: "isWhitelisted",
3628
+ args: [getAddress(protocol)]
3629
+ })),
3630
+ allowFailure: true
3631
+ });
3632
+ const out = {};
3633
+ for (let i = 0; i < protocols.length; i++) {
3634
+ const r = results[i];
3635
+ out[getAddress(protocols[i])] = r?.status === "success" ? r.result : false;
3636
+ }
3637
+ return out;
3638
+ }
3639
+ function encodeCuratorAction(action) {
3640
+ switch (action.type) {
3641
+ case "swap":
3642
+ return encodeFunctionData({
3643
+ abi: DEX_ABI,
3644
+ functionName: "executeSwap",
3645
+ args: [
3646
+ {
3647
+ targetContract: getAddress(action.params.targetContract),
3648
+ tokenIn: getAddress(action.params.tokenIn),
3649
+ tokenOut: getAddress(action.params.tokenOut),
3650
+ maxAmountIn: action.params.maxAmountIn,
3651
+ minAmountOut: action.params.minAmountOut,
3652
+ swapCallData: action.params.swapCallData
3653
+ }
3654
+ ]
3655
+ });
3656
+ case "batchSwap":
3657
+ return encodeFunctionData({
3658
+ abi: DEX_ABI,
3659
+ functionName: "executeBatchSwap",
3660
+ args: [
3661
+ {
3662
+ swaps: action.params.swaps.map((s) => ({
3663
+ targetContract: getAddress(s.targetContract),
3664
+ tokenIn: getAddress(s.tokenIn),
3665
+ tokenOut: getAddress(s.tokenOut),
3666
+ maxAmountIn: s.maxAmountIn,
3667
+ minAmountOut: s.minAmountOut,
3668
+ swapCallData: s.swapCallData
3669
+ }))
3670
+ }
3671
+ ]
3672
+ });
3673
+ case "erc4626Deposit":
3674
+ return encodeFunctionData({
3675
+ abi: ERC4626_FACET_ABI,
3676
+ functionName: "erc4626Deposit",
3677
+ args: [getAddress(action.vault), action.assets]
3678
+ });
3679
+ case "erc4626Redeem":
3680
+ return encodeFunctionData({
3681
+ abi: ERC4626_FACET_ABI,
3682
+ functionName: "erc4626Redeem",
3683
+ args: [getAddress(action.vault), action.shares]
3684
+ });
3685
+ case "erc7540RequestDeposit":
3686
+ return encodeFunctionData({
3687
+ abi: ERC7540_FACET_ABI,
3688
+ functionName: "erc7540RequestDeposit",
3689
+ args: [getAddress(action.vault), action.assets]
3690
+ });
3691
+ case "erc7540Deposit":
3692
+ return encodeFunctionData({
3693
+ abi: ERC7540_FACET_ABI,
3694
+ functionName: "erc7540Deposit",
3695
+ args: [getAddress(action.vault), action.assets]
3696
+ });
3697
+ case "erc7540RequestRedeem":
3698
+ return encodeFunctionData({
3699
+ abi: ERC7540_FACET_ABI,
3700
+ functionName: "erc7540RequestRedeem",
3701
+ args: [getAddress(action.vault), action.shares]
3702
+ });
3703
+ case "erc7540Redeem":
3704
+ return encodeFunctionData({
3705
+ abi: ERC7540_FACET_ABI,
3706
+ functionName: "erc7540Redeem",
3707
+ args: [getAddress(action.vault), action.shares]
3708
+ });
3709
+ default: {
3710
+ const _exhaustive = action;
3711
+ throw new Error(`[MoreVaults] Unknown CuratorAction type: ${_exhaustive.type}`);
3712
+ }
3713
+ }
3714
+ }
3715
+ function buildCuratorBatch(actions) {
3716
+ return actions.map(encodeCuratorAction);
3717
+ }
3718
+ async function submitActions(walletClient, publicClient, vault, actions) {
3719
+ const account = walletClient.account;
3720
+ const v = getAddress(vault);
3721
+ await publicClient.simulateContract({
3722
+ address: v,
3723
+ abi: MULTICALL_ABI,
3724
+ functionName: "submitActions",
3725
+ args: [actions],
3726
+ account: account.address
3727
+ });
3728
+ const txHash = await walletClient.writeContract({
3729
+ address: v,
3730
+ abi: MULTICALL_ABI,
3731
+ functionName: "submitActions",
3732
+ args: [actions],
3733
+ account,
3734
+ chain: walletClient.chain
3735
+ });
3736
+ const nextNonce = await publicClient.readContract({
3737
+ address: v,
3738
+ abi: MULTICALL_ABI,
3739
+ functionName: "getCurrentNonce"
3740
+ });
3741
+ const nonce = nextNonce - 1n;
3742
+ return { txHash, nonce };
3743
+ }
3744
+ async function executeActions(walletClient, publicClient, vault, nonce) {
3745
+ const account = walletClient.account;
3746
+ const v = getAddress(vault);
3747
+ await publicClient.simulateContract({
3748
+ address: v,
3749
+ abi: MULTICALL_ABI,
3750
+ functionName: "executeActions",
3751
+ args: [nonce],
3752
+ account: account.address
3753
+ });
3754
+ const txHash = await walletClient.writeContract({
3755
+ address: v,
3756
+ abi: MULTICALL_ABI,
3757
+ functionName: "executeActions",
3758
+ args: [nonce],
3759
+ account,
3760
+ chain: walletClient.chain
3761
+ });
3762
+ return { txHash };
3763
+ }
3764
+ async function vetoActions(walletClient, publicClient, vault, nonces) {
3765
+ const account = walletClient.account;
3766
+ const v = getAddress(vault);
3767
+ await publicClient.simulateContract({
3768
+ address: v,
3769
+ abi: MULTICALL_ABI,
3770
+ functionName: "vetoActions",
3771
+ args: [nonces],
3772
+ account: account.address
3773
+ });
3774
+ const txHash = await walletClient.writeContract({
3775
+ address: v,
3776
+ abi: MULTICALL_ABI,
3777
+ functionName: "vetoActions",
3778
+ args: [nonces],
3779
+ account,
3780
+ chain: walletClient.chain
3781
+ });
3782
+ return { txHash };
3783
+ }
3204
3784
 
3205
3785
  // src/viem/wagmiCompat.ts
3206
3786
  function asSdkClient(client) {
@@ -3208,6 +3788,6 @@ function asSdkClient(client) {
3208
3788
  return client;
3209
3789
  }
3210
3790
 
3211
- export { ActionType, BRIDGE_ABI, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CapacityFullError, EID_TO_CHAIN_ID, ERC20_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MissingEscrowAddressError, MoreVaultsError, NATIVE_SYMBOL, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, OMNI_FACTORY_ADDRESS, STARGATE_TAXI_CMD, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, VaultPausedError, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, canDeposit, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, discoverVaultTopology, ensureAllowance, executeCompose, getAllVaultChainIds, getAsyncRequestStatus, getAsyncRequestStatusLabel, getFullVaultTopology, getInboundRoutes, getMaxWithdrawable, getOutboundRoutes, getUserBalances, getUserBalancesForRoutes, getUserPosition, getUserPositionMultiChain, getVaultDistribution, getVaultDistributionWithTopology, getVaultMetadata, getVaultStatus, getVaultSummary, getVaultTopology, getWithdrawalRequest, isAsyncMode, isOnHubChain, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, previewDeposit, previewRedeem, quoteComposeFee, quoteDepositFromSpokeFee, quoteLzFee, quoteRouteDepositFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, waitForAsyncRequest, waitForCompose, waitForTx, withdrawAssets };
3791
+ export { ActionType, BRIDGE_ABI, BRIDGE_FACET_ABI, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CURATOR_CONFIG_ABI, CapacityFullError, DEX_ABI, EID_TO_CHAIN_ID, ERC20_ABI, ERC4626_FACET_ABI, ERC7540_FACET_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_ADAPTER_ABI, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MULTICALL_ABI, MissingEscrowAddressError, MoreVaultsError, NATIVE_SYMBOL, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, OMNI_FACTORY_ADDRESS, REGISTRY_ABI, STARGATE_TAXI_CMD, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, VAULT_ANALYSIS_ABI, VaultPausedError, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, buildCuratorBatch, canDeposit, checkProtocolWhitelist, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, discoverVaultTopology, encodeCuratorAction, ensureAllowance, executeActions, executeCompose, getAllVaultChainIds, getAsyncRequestStatus, getAsyncRequestStatusLabel, getCuratorVaultStatus, getFullVaultTopology, getInboundRoutes, getMaxWithdrawable, getOutboundRoutes, getPendingActions, getUserBalances, getUserBalancesForRoutes, getUserPosition, getUserPositionMultiChain, getVaultAnalysis, getVaultDistribution, getVaultDistributionWithTopology, getVaultMetadata, getVaultStatus, getVaultSummary, getVaultTopology, getWithdrawalRequest, isAsyncMode, isCurator, isOnHubChain, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, previewDeposit, previewRedeem, quoteComposeFee, quoteDepositFromSpokeFee, quoteLzFee, quoteRouteDepositFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, submitActions, vetoActions, waitForAsyncRequest, waitForCompose, waitForTx, withdrawAssets };
3212
3792
  //# sourceMappingURL=index.js.map
3213
3793
  //# sourceMappingURL=index.js.map