@ember-finance/sdk 2.4.0 → 2.5.0-pre.0

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.
Files changed (59) hide show
  1. package/dist/src/abis/AtomicLiquidity.json +4050 -0
  2. package/dist/src/abis/ERC20Token.json +2 -2
  3. package/dist/src/abis/EmberETHVault.json +279 -5
  4. package/dist/src/abis/EmberProtocolConfig.json +137 -2
  5. package/dist/src/abis/EmberVault.json +2 -2
  6. package/dist/src/abis/EmberVaultMintBurnOFTAdapter.json +43 -2
  7. package/dist/src/api/v2/apis/vaults-api.d.ts +16 -4
  8. package/dist/src/api/v2/apis/vaults-api.js +21 -7
  9. package/dist/src/api/v2/models/chain-vault-details.d.ts +7 -0
  10. package/dist/src/api/v2/models/evm-atomic-liquidity-lib.d.ts +48 -0
  11. package/dist/src/api/v2/models/evm-atomic-liquidity-lib.js +14 -0
  12. package/dist/src/api/v2/models/evm-atomic-vault.d.ts +102 -0
  13. package/dist/src/api/v2/models/evm-atomic-vault.js +14 -0
  14. package/dist/src/api/v2/models/evm-contracts.d.ts +16 -0
  15. package/dist/src/api/v2/models/fee-multiplier-tier.d.ts +30 -0
  16. package/dist/src/api/v2/models/fee-multiplier-tier.js +14 -0
  17. package/dist/src/api/v2/models/index.d.ts +4 -0
  18. package/dist/src/api/v2/models/index.js +4 -0
  19. package/dist/src/api/v2/models/instant-withdraw-config.d.ts +67 -0
  20. package/dist/src/api/v2/models/instant-withdraw-config.js +14 -0
  21. package/dist/src/api/v2/models/reward-token.d.ts +0 -6
  22. package/dist/src/api/v2/models/vault-detail.d.ts +11 -0
  23. package/dist/src/api/v2/models/vault-detail.js +4 -0
  24. package/dist/src/atomic/instant-withdraw.d.ts +125 -0
  25. package/dist/src/atomic/instant-withdraw.js +122 -0
  26. package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.d.ts +98 -0
  27. package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.js +209 -0
  28. package/dist/src/evm-vaults/on-chain-calls/index.d.ts +1 -0
  29. package/dist/src/evm-vaults/on-chain-calls/index.js +1 -0
  30. package/dist/src/evm-vaults/on-chain-calls/operator.d.ts +10 -0
  31. package/dist/src/evm-vaults/on-chain-calls/operator.js +28 -0
  32. package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +103 -0
  33. package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +273 -0
  34. package/dist/src/evm-vaults/on-chain-calls/user.d.ts +50 -0
  35. package/dist/src/evm-vaults/on-chain-calls/user.js +75 -0
  36. package/dist/src/evm-vaults/on-chain-calls/vault-admin.d.ts +48 -0
  37. package/dist/src/evm-vaults/on-chain-calls/vault-admin.js +112 -0
  38. package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +6 -0
  39. package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +9 -0
  40. package/dist/src/evm-vaults/utils/deployment-parser.d.ts +8 -0
  41. package/dist/src/evm-vaults/utils/deployment-parser.js +11 -0
  42. package/dist/src/sui-vaults/interfaces/index.d.ts +15 -0
  43. package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +35 -0
  44. package/dist/src/sui-vaults/on-chain-calls/admin.js +56 -0
  45. package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.d.ts +62 -0
  46. package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.js +174 -0
  47. package/dist/src/sui-vaults/on-chain-calls/index.d.ts +1 -0
  48. package/dist/src/sui-vaults/on-chain-calls/index.js +1 -0
  49. package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +127 -0
  50. package/dist/src/sui-vaults/on-chain-calls/operator.js +210 -0
  51. package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +482 -0
  52. package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +1430 -0
  53. package/dist/src/sui-vaults/on-chain-calls/user.d.ts +105 -0
  54. package/dist/src/sui-vaults/on-chain-calls/user.js +190 -0
  55. package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +228 -1
  56. package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +391 -0
  57. package/dist/src/sui-vaults/utils/deployment-parser.d.ts +12 -0
  58. package/dist/src/sui-vaults/utils/deployment-parser.js +24 -0
  59. package/package.json +3 -2
@@ -4,6 +4,7 @@ import EmberETHVaultABI from "../../abis/EmberETHVault.json" with { type: "json"
4
4
  import EmberProtocolConfigABI from "../../abis/EmberProtocolConfig.json" with { type: "json" };
5
5
  import ERC20TokenABI from "../../abis/ERC20Token.json" with { type: "json" };
6
6
  import EmberVaultOFTAdapterABI from "../../abis/EmberVaultMintBurnOFTAdapter.json" with { type: "json" };
7
+ import AtomicLiquidityABI from "../../abis/AtomicLiquidity.json" with { type: "json" };
7
8
  import EmberDepositParkingLotABI from "../../abis/EmberDepositParkingLot.json" with { type: "json" };
8
9
  import OpenCoverVaultABI from "../../abis/OpenCoverVault.json" with { type: "json" };
9
10
  /**
@@ -574,6 +575,63 @@ export class EVMTxBuilder {
574
575
  chainId: this.getChainId()
575
576
  };
576
577
  }
578
+ /**
579
+ * EmberETHVault: claim the caller's own escrowed (deferred) ETH withdrawal — accrued
580
+ * when a withdrawal couldn't be sent (receiver rejected the transfer). EmberETHVault only.
581
+ */
582
+ claimWithdrawal(vaultAddress) {
583
+ return {
584
+ to: vaultAddress,
585
+ functionName: "claimWithdrawal",
586
+ args: [],
587
+ abi: EmberETHVaultABI.abi,
588
+ value: 0n,
589
+ chainId: this.getChainId()
590
+ };
591
+ }
592
+ /**
593
+ * EmberETHVault: deliver `receiver`'s escrowed ETH withdrawal on their behalf
594
+ * (permissionless — funds can only go to `receiver`). EmberETHVault only.
595
+ */
596
+ claimWithdrawalFor(vaultAddress, receiver) {
597
+ return {
598
+ to: vaultAddress,
599
+ functionName: "claimWithdrawalFor",
600
+ args: [receiver],
601
+ abi: EmberETHVaultABI.abi,
602
+ value: 0n,
603
+ chainId: this.getChainId()
604
+ };
605
+ }
606
+ /**
607
+ * EmberETHVault: redirect the CALLER's own escrowed ETH withdrawal to `to`. For a
608
+ * receiver that can transact but can no longer receive ETH; delivers only the
609
+ * caller's own escrow. EmberETHVault only.
610
+ */
611
+ claimWithdrawalTo(vaultAddress, to) {
612
+ return {
613
+ to: vaultAddress,
614
+ functionName: "claimWithdrawalTo",
615
+ args: [to],
616
+ abi: EmberETHVaultABI.abi,
617
+ value: 0n,
618
+ chainId: this.getChainId()
619
+ };
620
+ }
621
+ /**
622
+ * EmberETHVault: owner recovery of `receiver`'s escrowed ETH to `to` (a permanently
623
+ * unpayable receiver). Owner-only (called directly on the vault). EmberETHVault only.
624
+ */
625
+ recoverUnclaimedWithdrawal(vaultAddress, receiver, to) {
626
+ return {
627
+ to: vaultAddress,
628
+ functionName: "recoverUnclaimedWithdrawal",
629
+ args: [receiver, to],
630
+ abi: EmberETHVaultABI.abi,
631
+ value: 0n,
632
+ chainId: this.getChainId()
633
+ };
634
+ }
577
635
  /**
578
636
  * Withdraws assets from the vault without redeeming shares (operator only)
579
637
  * Used by operators to move funds to sub-accounts for strategy execution
@@ -1050,4 +1108,219 @@ export class EVMTxBuilder {
1050
1108
  chainId: this.getChainId()
1051
1109
  };
1052
1110
  }
1111
+ // ============================================
1112
+ // Atomic Liquidity Vault methods (BFE-817/818)
1113
+ //
1114
+ // Atomic vaults are a sibling of EmberVault with instant-withdraw + cross-vault
1115
+ // EmberShare swap, backed by an ERC-4626 strategy. Shares are non-transferable
1116
+ // (no receipt token). These encode against the AtomicLiquidity ABI; admin
1117
+ // setters take `caller` because access is gated via the protocol-config role.
1118
+ // ============================================
1119
+ atomicCall(vaultAddress, functionName, args) {
1120
+ return {
1121
+ to: vaultAddress,
1122
+ functionName,
1123
+ args,
1124
+ abi: AtomicLiquidityABI.abi,
1125
+ value: 0n,
1126
+ chainId: this.getChainId()
1127
+ };
1128
+ }
1129
+ /** Claim the caller's own escrowed (deferred) holdback collateral. */
1130
+ atomicClaimHoldback(vaultAddress) {
1131
+ return this.atomicCall(vaultAddress, "claimHoldback", []);
1132
+ }
1133
+ /** Deliver `recipient`'s escrowed holdback on their behalf (permissionless). */
1134
+ atomicClaimHoldbackFor(vaultAddress, recipient) {
1135
+ return this.atomicCall(vaultAddress, "claimHoldbackFor", [recipient]);
1136
+ }
1137
+ /**
1138
+ * Redirect the CALLER's own escrowed holdback to `to`. For a recipient that can
1139
+ * transact but can no longer receive the collateral token (e.g. token blacklist);
1140
+ * moves only the caller's own escrow.
1141
+ */
1142
+ atomicClaimHoldbackTo(vaultAddress, to) {
1143
+ return this.atomicCall(vaultAddress, "claimHoldbackTo", [to]);
1144
+ }
1145
+ /**
1146
+ * Owner recovery of `recipient`'s escrowed holdback to `to` (a permanently unpayable
1147
+ * recipient). Owner-only, called directly on the vault (not via protocol config).
1148
+ */
1149
+ atomicRecoverUnclaimedHoldback(vaultAddress, recipient, to) {
1150
+ return this.atomicCall(vaultAddress, "recoverUnclaimedHoldback", [recipient, to]);
1151
+ }
1152
+ /**
1153
+ * Builds an atomic-vault ADMIN call routed through the vault's protocol config. Atomic admin
1154
+ * setters are `onlyProtocolConfig`, so they must be invoked on the EmberProtocolConfig (which
1155
+ * forwards msg.sender as `caller`) — never on the vault directly. Targets the vault's OWN
1156
+ * protocol config (atomic vaults may use a config distinct from the global one). Each config
1157
+ * forwarder takes the vault address as its first argument and derives `caller` from msg.sender.
1158
+ */
1159
+ atomicConfigCall(vaultAddress, forwarderName, forwarderArgs) {
1160
+ return {
1161
+ to: this.parser.getProtocolConfigAddressForVault(vaultAddress),
1162
+ functionName: forwarderName,
1163
+ args: [vaultAddress, ...forwarderArgs],
1164
+ abi: EmberProtocolConfigABI.abi,
1165
+ value: 0n,
1166
+ chainId: this.getChainId()
1167
+ };
1168
+ }
1169
+ /** Instant (capped, fee'd) withdraw of `shares` to `receiver`; auto-pulls from strategy. */
1170
+ atomicInstantWithdraw(vaultAddress, shares, receiver) {
1171
+ return this.atomicCall(vaultAddress, "instantWithdraw", [shares, receiver]);
1172
+ }
1173
+ /** Swap `shareAmount` of a whitelisted source EmberShare into this vault's collateral. */
1174
+ atomicSwapEmberShares(vaultAddress, share, shareAmount, receiver) {
1175
+ return this.atomicCall(vaultAddress, "swapEmberShares", [
1176
+ share,
1177
+ shareAmount,
1178
+ receiver
1179
+ ]);
1180
+ }
1181
+ /** Supply `assets` of idle collateral into the external ERC-4626 strategy. */
1182
+ atomicSupplyToStrategy(vaultAddress, assets) {
1183
+ return this.atomicCall(vaultAddress, "supplyToStrategy", [assets]);
1184
+ }
1185
+ /** Withdraw `assets` of collateral back from the strategy into the vault. */
1186
+ atomicWithdrawFromStrategy(vaultAddress, assets) {
1187
+ return this.atomicCall(vaultAddress, "withdrawFromStrategy", [assets]);
1188
+ }
1189
+ /** Submit `amount` of collected source `share` for redemption on the source EmberVault. */
1190
+ atomicRedeemCollectedEmberShares(vaultAddress, share, amount) {
1191
+ return this.atomicCall(vaultAddress, "redeemCollectedEmberShares", [
1192
+ share,
1193
+ amount
1194
+ ]);
1195
+ }
1196
+ /** Release the holdback FIFO for `share` at `unwindingPercentage` (1e18 = 100%), up to `maxEntries`. */
1197
+ atomicReleaseUsersHoldback(vaultAddress, share, unwindingPercentage, maxEntries) {
1198
+ return this.atomicCall(vaultAddress, "releaseUsersHoldback", [
1199
+ share,
1200
+ unwindingPercentage,
1201
+ maxEntries
1202
+ ]);
1203
+ }
1204
+ /** Set the external ERC-4626 strategy (address(0) to disable). Drain the old strategy first. */
1205
+ atomicSetStrategy(vaultAddress, _caller, newStrategy) {
1206
+ return this.atomicConfigCall(vaultAddress, "setVaultStrategy", [newStrategy]);
1207
+ }
1208
+ /**
1209
+ * Whitelist (or update) a source EmberShare with fee / capacity / holdback / utilization
1210
+ * percentages, a per-swap minimum gross floor (`minSwapGross`, 0 disables), and a
1211
+ * TVL-independent absolute held-value cap (`maxHeldValueAbsolute`, 0 disables).
1212
+ */
1213
+ atomicSetEmberShareWhitelist(vaultAddress, _caller, share, whitelisted, feePercentage, maxCapacityPercentage, holdbackPercentage, maxUtilizationPercentage, minSwapGross, maxHeldValueAbsolute) {
1214
+ return this.atomicConfigCall(vaultAddress, "setVaultEmberShareWhitelist", [
1215
+ share,
1216
+ whitelisted,
1217
+ feePercentage,
1218
+ maxCapacityPercentage,
1219
+ holdbackPercentage,
1220
+ maxUtilizationPercentage,
1221
+ minSwapGross,
1222
+ maxHeldValueAbsolute
1223
+ ]);
1224
+ }
1225
+ /** Set per-account swap waivers (fee and/or holdback); (false,false) removes them. */
1226
+ atomicSetSwapWaiver(vaultAddress, _caller, account, feeWaived, holdbackWaived) {
1227
+ return this.atomicConfigCall(vaultAddress, "setVaultSwapWaiver", [
1228
+ account,
1229
+ feeWaived,
1230
+ holdbackWaived
1231
+ ]);
1232
+ }
1233
+ /** Set the cumulative instant-withdraw cap (in shares). */
1234
+ atomicSetMaxInstantWithdrawShares(vaultAddress, _caller, newMax) {
1235
+ return this.atomicConfigCall(vaultAddress, "setVaultMaxInstantWithdrawShares", [
1236
+ newMax
1237
+ ]);
1238
+ }
1239
+ /** Set the instant-withdraw fee percentage. */
1240
+ atomicSetInstantWithdrawFeePercentage(vaultAddress, _caller, newFeePercentage) {
1241
+ return this.atomicConfigCall(vaultAddress, "setVaultInstantWithdrawFeePercentage", [newFeePercentage]);
1242
+ }
1243
+ /** Set the platform fee percentage. */
1244
+ atomicSetFeePercentage(vaultAddress, _caller, newFeePercentage) {
1245
+ return this.atomicConfigCall(vaultAddress, "updateVaultFeePercentage", [
1246
+ newFeePercentage
1247
+ ]);
1248
+ }
1249
+ /** Set the maximum TVL. */
1250
+ atomicSetMaxTVL(vaultAddress, _caller, newMaxTVL) {
1251
+ return this.atomicConfigCall(vaultAddress, "updateVaultMaxTVL", [newMaxTVL]);
1252
+ }
1253
+ /** Set the minimum withdrawable shares. */
1254
+ atomicSetMinWithdrawableShares(vaultAddress, _caller, newMinWithdrawableShares) {
1255
+ return this.atomicConfigCall(vaultAddress, "updateVaultMinWithdrawableShares", [
1256
+ newMinWithdrawableShares
1257
+ ]);
1258
+ }
1259
+ /** Set the max rate change per update bound. */
1260
+ atomicSetMaxRateChangePerUpdate(vaultAddress, _caller, newMaxRateChangePerUpdate) {
1261
+ return this.atomicConfigCall(vaultAddress, "updateVaultMaxRateChangePerUpdate", [
1262
+ newMaxRateChangePerUpdate
1263
+ ]);
1264
+ }
1265
+ /** Set the minimum interval between rate updates (ms). */
1266
+ atomicSetRateUpdateInterval(vaultAddress, _caller, newInterval) {
1267
+ return this.atomicConfigCall(vaultAddress, "updateVaultRateUpdateInterval", [
1268
+ newInterval
1269
+ ]);
1270
+ }
1271
+ /** Rename the vault. */
1272
+ atomicSetVaultName(vaultAddress, _caller, newName) {
1273
+ return this.atomicConfigCall(vaultAddress, "updateVaultName", [newName]);
1274
+ }
1275
+ /** Set the vault validator contract. */
1276
+ atomicSetVaultValidator(vaultAddress, _caller, validator) {
1277
+ return this.atomicConfigCall(vaultAddress, "setVaultValidator", [validator]);
1278
+ }
1279
+ /** Add/remove a sub-account. */
1280
+ atomicSetSubAccountStatus(vaultAddress, _caller, account, isSubAccount) {
1281
+ return this.atomicConfigCall(vaultAddress, "setVaultSubAccount", [
1282
+ account,
1283
+ isSubAccount
1284
+ ]);
1285
+ }
1286
+ /** Pause/unpause one operation ("deposits" | "withdrawals" | "privilegedOperations"). */
1287
+ atomicSetPausedStatus(vaultAddress, _caller, operation, paused) {
1288
+ return this.atomicConfigCall(vaultAddress, "setVaultPausedStatus", [
1289
+ operation,
1290
+ paused
1291
+ ]);
1292
+ }
1293
+ /** Move `amount` of collateral to a registered sub-account (operator). */
1294
+ atomicSupplyToSubAccount(vaultAddress, subAccount, amount) {
1295
+ return this.atomicCall(vaultAddress, "supplyToSubAccount", [subAccount, amount]);
1296
+ }
1297
+ /** Rotate the admin role. */
1298
+ atomicSetAdmin(vaultAddress, _caller, newAdmin) {
1299
+ return this.atomicConfigCall(vaultAddress, "updateVaultAdmin", [newAdmin]);
1300
+ }
1301
+ /** Rotate the operator role. */
1302
+ atomicSetOperator(vaultAddress, _caller, newOperator) {
1303
+ return this.atomicConfigCall(vaultAddress, "updateVaultOperator", [newOperator]);
1304
+ }
1305
+ /** Rotate the rate-manager role. */
1306
+ atomicSetRateManager(vaultAddress, _caller, newRateManager) {
1307
+ return this.atomicConfigCall(vaultAddress, "updateVaultRateManager", [
1308
+ newRateManager
1309
+ ]);
1310
+ }
1311
+ /** Transfer contract ownership (UUPS owner). */
1312
+ atomicTransferOwnership(vaultAddress, newOwner) {
1313
+ return this.atomicCall(vaultAddress, "transferOwnership", [newOwner]);
1314
+ }
1315
+ /** Renounce ownership (irreversible). */
1316
+ atomicRenounceOwnership(vaultAddress) {
1317
+ return this.atomicCall(vaultAddress, "renounceOwnership", []);
1318
+ }
1319
+ /** Upgrade the implementation and optionally call init data (UUPS). */
1320
+ atomicUpgradeToAndCall(vaultAddress, newImplementation, data) {
1321
+ return this.atomicCall(vaultAddress, "upgradeToAndCall", [
1322
+ newImplementation,
1323
+ data
1324
+ ]);
1325
+ }
1053
1326
  }
@@ -455,4 +455,54 @@ export declare class EVMUserCalls extends EVMOnChainCalls {
455
455
  * @returns The allowance as bigint
456
456
  */
457
457
  getTokenAllowance(tokenAddress: string, spender: string, owner?: string): Promise<bigint>;
458
+ /**
459
+ * EmberETHVault: claim your own escrowed (deferred) ETH withdrawal — ETH that couldn't be
460
+ * sent when your withdrawal was processed (your receiver rejected the transfer) and is now
461
+ * escrowed. Reverts if nothing is escrowed. Query via the reader's `getUnclaimedWithdrawals`.
462
+ */
463
+ claimWithdrawal(vaultAddress: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
464
+ /**
465
+ * EmberETHVault: deliver `receiver`'s escrowed ETH withdrawal on their behalf.
466
+ * Permissionless — the funds can only ever go to `receiver`.
467
+ */
468
+ claimWithdrawalFor(vaultAddress: string, receiver: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
469
+ /**
470
+ * EmberETHVault: redirect YOUR OWN escrowed ETH withdrawal to `to`. Use when you can
471
+ * transact but can no longer receive ETH at your original address (e.g. a contract
472
+ * receiver that now reverts). Delivers only the caller's own escrow.
473
+ */
474
+ claimWithdrawalTo(vaultAddress: string, to: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
475
+ /**
476
+ * EmberETHVault: owner recovery of `receiver`'s escrowed ETH to `to`, for a receiver
477
+ * that can neither receive ETH nor call claimWithdrawalTo. Owner-only.
478
+ */
479
+ recoverUnclaimedWithdrawal(vaultAddress: string, receiver: string, to: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
480
+ /** Atomic vault: instant (capped, fee'd) withdraw of `shares` to `receiver`; auto-pulls from strategy. */
481
+ instantWithdraw(vaultAddress: string, shares: NumStr, receiver: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
482
+ /** Atomic vault: swap `shareAmount` of a whitelisted source EmberShare `share` into collateral. */
483
+ swapEmberShares(vaultAddress: string, share: string, shareAmount: NumStr, receiver: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
484
+ /**
485
+ * Atomic vault: claim your own escrowed holdback — collateral that couldn't be
486
+ * delivered during `releaseUsersHoldback` (e.g. you were blocklisted on the
487
+ * collateral token at release time and are now payable again). Reverts if nothing
488
+ * is escrowed for you. Query the amount via the reader's `unclaimedHoldback`.
489
+ */
490
+ claimHoldback(vaultAddress: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
491
+ /**
492
+ * Atomic vault: deliver a recipient's escrowed holdback on their behalf. Permissionless
493
+ * — the funds can only ever go to `recipient` — so anyone (e.g. the operator) may
494
+ * trigger delivery once the recipient is payable again.
495
+ */
496
+ claimHoldbackFor(vaultAddress: string, recipient: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
497
+ /**
498
+ * Atomic vault: redirect YOUR OWN escrowed holdback to `to`. Use when you can transact
499
+ * but can no longer receive the collateral token at your original address (e.g. a
500
+ * token-level blacklist). Delivers only the caller's own escrow.
501
+ */
502
+ claimHoldbackTo(vaultAddress: string, to: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
503
+ /**
504
+ * Atomic vault: owner recovery of `recipient`'s escrowed holdback to `to`, for a
505
+ * recipient that can neither receive the collateral nor call claimHoldbackTo. Owner-only.
506
+ */
507
+ recoverUnclaimedHoldback(vaultAddress: string, recipient: string, to: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
458
508
  }
@@ -702,4 +702,79 @@ export class EVMUserCalls extends EVMOnChainCalls {
702
702
  const token = this.getERC20Contract(tokenAddress);
703
703
  return token.allowance(ownerAddress, spender);
704
704
  }
705
+ /**
706
+ * EmberETHVault: claim your own escrowed (deferred) ETH withdrawal — ETH that couldn't be
707
+ * sent when your withdrawal was processed (your receiver rejected the transfer) and is now
708
+ * escrowed. Reverts if nothing is escrowed. Query via the reader's `getUnclaimedWithdrawals`.
709
+ */
710
+ async claimWithdrawal(vaultAddress, options) {
711
+ return this.execCall(this.txBuilder.claimWithdrawal(vaultAddress), options);
712
+ }
713
+ /**
714
+ * EmberETHVault: deliver `receiver`'s escrowed ETH withdrawal on their behalf.
715
+ * Permissionless — the funds can only ever go to `receiver`.
716
+ */
717
+ async claimWithdrawalFor(vaultAddress, receiver, options) {
718
+ return this.execCall(this.txBuilder.claimWithdrawalFor(vaultAddress, receiver), options);
719
+ }
720
+ /**
721
+ * EmberETHVault: redirect YOUR OWN escrowed ETH withdrawal to `to`. Use when you can
722
+ * transact but can no longer receive ETH at your original address (e.g. a contract
723
+ * receiver that now reverts). Delivers only the caller's own escrow.
724
+ */
725
+ async claimWithdrawalTo(vaultAddress, to, options) {
726
+ return this.execCall(this.txBuilder.claimWithdrawalTo(vaultAddress, to), options);
727
+ }
728
+ /**
729
+ * EmberETHVault: owner recovery of `receiver`'s escrowed ETH to `to`, for a receiver
730
+ * that can neither receive ETH nor call claimWithdrawalTo. Owner-only.
731
+ */
732
+ async recoverUnclaimedWithdrawal(vaultAddress, receiver, to, options) {
733
+ return this.execCall(this.txBuilder.recoverUnclaimedWithdrawal(vaultAddress, receiver, to), options);
734
+ }
735
+ // ============================================
736
+ // Atomic Liquidity Vault — user actions (BFE-817/818)
737
+ // ============================================
738
+ /** Atomic vault: instant (capped, fee'd) withdraw of `shares` to `receiver`; auto-pulls from strategy. */
739
+ async instantWithdraw(vaultAddress, shares, receiver, options) {
740
+ const txCall = this.txBuilder.atomicInstantWithdraw(vaultAddress, shares, receiver);
741
+ return this.execCall(txCall, options);
742
+ }
743
+ /** Atomic vault: swap `shareAmount` of a whitelisted source EmberShare `share` into collateral. */
744
+ async swapEmberShares(vaultAddress, share, shareAmount, receiver, options) {
745
+ const txCall = this.txBuilder.atomicSwapEmberShares(vaultAddress, share, shareAmount, receiver);
746
+ return this.execCall(txCall, options);
747
+ }
748
+ /**
749
+ * Atomic vault: claim your own escrowed holdback — collateral that couldn't be
750
+ * delivered during `releaseUsersHoldback` (e.g. you were blocklisted on the
751
+ * collateral token at release time and are now payable again). Reverts if nothing
752
+ * is escrowed for you. Query the amount via the reader's `unclaimedHoldback`.
753
+ */
754
+ async claimHoldback(vaultAddress, options) {
755
+ return this.execCall(this.txBuilder.atomicClaimHoldback(vaultAddress), options);
756
+ }
757
+ /**
758
+ * Atomic vault: deliver a recipient's escrowed holdback on their behalf. Permissionless
759
+ * — the funds can only ever go to `recipient` — so anyone (e.g. the operator) may
760
+ * trigger delivery once the recipient is payable again.
761
+ */
762
+ async claimHoldbackFor(vaultAddress, recipient, options) {
763
+ return this.execCall(this.txBuilder.atomicClaimHoldbackFor(vaultAddress, recipient), options);
764
+ }
765
+ /**
766
+ * Atomic vault: redirect YOUR OWN escrowed holdback to `to`. Use when you can transact
767
+ * but can no longer receive the collateral token at your original address (e.g. a
768
+ * token-level blacklist). Delivers only the caller's own escrow.
769
+ */
770
+ async claimHoldbackTo(vaultAddress, to, options) {
771
+ return this.execCall(this.txBuilder.atomicClaimHoldbackTo(vaultAddress, to), options);
772
+ }
773
+ /**
774
+ * Atomic vault: owner recovery of `recipient`'s escrowed holdback to `to`, for a
775
+ * recipient that can neither receive the collateral nor call claimHoldbackTo. Owner-only.
776
+ */
777
+ async recoverUnclaimedHoldback(vaultAddress, recipient, to, options) {
778
+ return this.execCall(this.txBuilder.atomicRecoverUnclaimedHoldback(vaultAddress, recipient, to), options);
779
+ }
705
780
  }
@@ -162,4 +162,52 @@ export declare class EVMVaultAdminCalls extends EVMOnChainCalls {
162
162
  * @returns EvmOnChainCallResponse
163
163
  */
164
164
  updateVaultName(vaultAddress: string, newName: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
165
+ /** Atomic vault: set the external ERC-4626 strategy (address(0) to disable). Drain the old strategy first. */
166
+ setStrategy(vaultAddress: string, caller: string, newStrategy: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
167
+ /**
168
+ * Atomic vault: whitelist (or update) a source EmberShare with fee / capacity / holdback /
169
+ * utilization percentages, a per-swap minimum gross floor, and an absolute held-value cap.
170
+ *
171
+ * @param minSwapGross Minimum gross collateral value per swap (collateral units); 0 disables
172
+ * the dust floor that would otherwise allow holdback-queue bloat.
173
+ * @param maxHeldValueAbsolute TVL-independent ceiling on this source share's post-swap held
174
+ * value (collateral units); 0 disables it.
175
+ */
176
+ setEmberShareWhitelist(vaultAddress: string, caller: string, share: string, whitelisted: boolean, feePercentage: NumStr, maxCapacityPercentage: NumStr, holdbackPercentage: NumStr, maxUtilizationPercentage: NumStr, minSwapGross: NumStr, maxHeldValueAbsolute: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
177
+ /** Atomic vault: set per-account swap waivers (fee and/or holdback); (false,false) removes them. */
178
+ setSwapWaiver(vaultAddress: string, caller: string, account: string, feeWaived: boolean, holdbackWaived: boolean, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
179
+ /** Atomic vault: set the cumulative instant-withdraw cap (in shares). */
180
+ setMaxInstantWithdrawShares(vaultAddress: string, caller: string, newMax: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
181
+ /** Atomic vault: set the instant-withdraw fee percentage. */
182
+ setInstantWithdrawFeePercentage(vaultAddress: string, caller: string, newFeePercentage: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
183
+ /** Atomic vault: set the platform fee percentage. */
184
+ setFeePercentage(vaultAddress: string, caller: string, newFeePercentage: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
185
+ /** Atomic vault: set the maximum TVL. */
186
+ setMaxTVL(vaultAddress: string, caller: string, newMaxTVL: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
187
+ /** Atomic vault: set the minimum withdrawable shares. */
188
+ setMinWithdrawableShares(vaultAddress: string, caller: string, newMinWithdrawableShares: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
189
+ /** Atomic vault: set the max rate change per update bound. */
190
+ setMaxRateChangePerUpdate(vaultAddress: string, caller: string, newMaxRateChangePerUpdate: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
191
+ /** Atomic vault: set the minimum interval between rate updates (ms). */
192
+ setRateUpdateInterval(vaultAddress: string, caller: string, newInterval: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
193
+ /** Atomic vault: rename the vault. */
194
+ setVaultName(vaultAddress: string, caller: string, newName: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
195
+ /** Atomic vault: set the vault validator contract. */
196
+ setVaultValidator(vaultAddress: string, caller: string, validator: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
197
+ /** Atomic vault: add/remove a sub-account. */
198
+ setSubAccountStatus(vaultAddress: string, caller: string, account: string, isSubAccount: boolean, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
199
+ /** Atomic vault: pause/unpause an operation ("deposits" | "withdrawals" | "privilegedOperations"). */
200
+ setPausedStatus(vaultAddress: string, caller: string, operation: string, paused: boolean, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
201
+ /** Atomic vault: rotate the admin role. */
202
+ setAdmin(vaultAddress: string, caller: string, newAdmin: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
203
+ /** Atomic vault: rotate the operator role. */
204
+ setOperator(vaultAddress: string, caller: string, newOperator: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
205
+ /** Atomic vault: rotate the rate-manager role. */
206
+ setRateManager(vaultAddress: string, caller: string, newRateManager: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
207
+ /** Atomic vault: transfer contract ownership (UUPS owner). */
208
+ transferOwnership(vaultAddress: string, newOwner: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
209
+ /** Atomic vault: renounce ownership (irreversible). */
210
+ renounceOwnership(vaultAddress: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
211
+ /** Atomic vault: upgrade the implementation and optionally call init data (UUPS). */
212
+ upgradeToAndCall(vaultAddress: string, newImplementation: string, data: string, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
165
213
  }
@@ -220,4 +220,116 @@ export class EVMVaultAdminCalls extends EVMOnChainCalls {
220
220
  const txCall = this.txBuilder.updateVaultName(vaultAddress, newName);
221
221
  return this.execCall(txCall, options);
222
222
  }
223
+ // ============================================
224
+ // Atomic Liquidity Vault — vault admin actions (BFE-817/818)
225
+ // Gated via protocol-config; pass the admin as `caller`.
226
+ // ============================================
227
+ /** Atomic vault: set the external ERC-4626 strategy (address(0) to disable). Drain the old strategy first. */
228
+ async setStrategy(vaultAddress, caller, newStrategy, options) {
229
+ const txCall = this.txBuilder.atomicSetStrategy(vaultAddress, caller, newStrategy);
230
+ return this.execCall(txCall, options);
231
+ }
232
+ /**
233
+ * Atomic vault: whitelist (or update) a source EmberShare with fee / capacity / holdback /
234
+ * utilization percentages, a per-swap minimum gross floor, and an absolute held-value cap.
235
+ *
236
+ * @param minSwapGross Minimum gross collateral value per swap (collateral units); 0 disables
237
+ * the dust floor that would otherwise allow holdback-queue bloat.
238
+ * @param maxHeldValueAbsolute TVL-independent ceiling on this source share's post-swap held
239
+ * value (collateral units); 0 disables it.
240
+ */
241
+ async setEmberShareWhitelist(vaultAddress, caller, share, whitelisted, feePercentage, maxCapacityPercentage, holdbackPercentage, maxUtilizationPercentage, minSwapGross, maxHeldValueAbsolute, options) {
242
+ const txCall = this.txBuilder.atomicSetEmberShareWhitelist(vaultAddress, caller, share, whitelisted, feePercentage, maxCapacityPercentage, holdbackPercentage, maxUtilizationPercentage, minSwapGross, maxHeldValueAbsolute);
243
+ return this.execCall(txCall, options);
244
+ }
245
+ /** Atomic vault: set per-account swap waivers (fee and/or holdback); (false,false) removes them. */
246
+ async setSwapWaiver(vaultAddress, caller, account, feeWaived, holdbackWaived, options) {
247
+ const txCall = this.txBuilder.atomicSetSwapWaiver(vaultAddress, caller, account, feeWaived, holdbackWaived);
248
+ return this.execCall(txCall, options);
249
+ }
250
+ /** Atomic vault: set the cumulative instant-withdraw cap (in shares). */
251
+ async setMaxInstantWithdrawShares(vaultAddress, caller, newMax, options) {
252
+ const txCall = this.txBuilder.atomicSetMaxInstantWithdrawShares(vaultAddress, caller, newMax);
253
+ return this.execCall(txCall, options);
254
+ }
255
+ /** Atomic vault: set the instant-withdraw fee percentage. */
256
+ async setInstantWithdrawFeePercentage(vaultAddress, caller, newFeePercentage, options) {
257
+ const txCall = this.txBuilder.atomicSetInstantWithdrawFeePercentage(vaultAddress, caller, newFeePercentage);
258
+ return this.execCall(txCall, options);
259
+ }
260
+ /** Atomic vault: set the platform fee percentage. */
261
+ async setFeePercentage(vaultAddress, caller, newFeePercentage, options) {
262
+ const txCall = this.txBuilder.atomicSetFeePercentage(vaultAddress, caller, newFeePercentage);
263
+ return this.execCall(txCall, options);
264
+ }
265
+ /** Atomic vault: set the maximum TVL. */
266
+ async setMaxTVL(vaultAddress, caller, newMaxTVL, options) {
267
+ const txCall = this.txBuilder.atomicSetMaxTVL(vaultAddress, caller, newMaxTVL);
268
+ return this.execCall(txCall, options);
269
+ }
270
+ /** Atomic vault: set the minimum withdrawable shares. */
271
+ async setMinWithdrawableShares(vaultAddress, caller, newMinWithdrawableShares, options) {
272
+ const txCall = this.txBuilder.atomicSetMinWithdrawableShares(vaultAddress, caller, newMinWithdrawableShares);
273
+ return this.execCall(txCall, options);
274
+ }
275
+ /** Atomic vault: set the max rate change per update bound. */
276
+ async setMaxRateChangePerUpdate(vaultAddress, caller, newMaxRateChangePerUpdate, options) {
277
+ const txCall = this.txBuilder.atomicSetMaxRateChangePerUpdate(vaultAddress, caller, newMaxRateChangePerUpdate);
278
+ return this.execCall(txCall, options);
279
+ }
280
+ /** Atomic vault: set the minimum interval between rate updates (ms). */
281
+ async setRateUpdateInterval(vaultAddress, caller, newInterval, options) {
282
+ const txCall = this.txBuilder.atomicSetRateUpdateInterval(vaultAddress, caller, newInterval);
283
+ return this.execCall(txCall, options);
284
+ }
285
+ /** Atomic vault: rename the vault. */
286
+ async setVaultName(vaultAddress, caller, newName, options) {
287
+ const txCall = this.txBuilder.atomicSetVaultName(vaultAddress, caller, newName);
288
+ return this.execCall(txCall, options);
289
+ }
290
+ /** Atomic vault: set the vault validator contract. */
291
+ async setVaultValidator(vaultAddress, caller, validator, options) {
292
+ const txCall = this.txBuilder.atomicSetVaultValidator(vaultAddress, caller, validator);
293
+ return this.execCall(txCall, options);
294
+ }
295
+ /** Atomic vault: add/remove a sub-account. */
296
+ async setSubAccountStatus(vaultAddress, caller, account, isSubAccount, options) {
297
+ const txCall = this.txBuilder.atomicSetSubAccountStatus(vaultAddress, caller, account, isSubAccount);
298
+ return this.execCall(txCall, options);
299
+ }
300
+ /** Atomic vault: pause/unpause an operation ("deposits" | "withdrawals" | "privilegedOperations"). */
301
+ async setPausedStatus(vaultAddress, caller, operation, paused, options) {
302
+ const txCall = this.txBuilder.atomicSetPausedStatus(vaultAddress, caller, operation, paused);
303
+ return this.execCall(txCall, options);
304
+ }
305
+ /** Atomic vault: rotate the admin role. */
306
+ async setAdmin(vaultAddress, caller, newAdmin, options) {
307
+ const txCall = this.txBuilder.atomicSetAdmin(vaultAddress, caller, newAdmin);
308
+ return this.execCall(txCall, options);
309
+ }
310
+ /** Atomic vault: rotate the operator role. */
311
+ async setOperator(vaultAddress, caller, newOperator, options) {
312
+ const txCall = this.txBuilder.atomicSetOperator(vaultAddress, caller, newOperator);
313
+ return this.execCall(txCall, options);
314
+ }
315
+ /** Atomic vault: rotate the rate-manager role. */
316
+ async setRateManager(vaultAddress, caller, newRateManager, options) {
317
+ const txCall = this.txBuilder.atomicSetRateManager(vaultAddress, caller, newRateManager);
318
+ return this.execCall(txCall, options);
319
+ }
320
+ /** Atomic vault: transfer contract ownership (UUPS owner). */
321
+ async transferOwnership(vaultAddress, newOwner, options) {
322
+ const txCall = this.txBuilder.atomicTransferOwnership(vaultAddress, newOwner);
323
+ return this.execCall(txCall, options);
324
+ }
325
+ /** Atomic vault: renounce ownership (irreversible). */
326
+ async renounceOwnership(vaultAddress, options) {
327
+ const txCall = this.txBuilder.atomicRenounceOwnership(vaultAddress);
328
+ return this.execCall(txCall, options);
329
+ }
330
+ /** Atomic vault: upgrade the implementation and optionally call init data (UUPS). */
331
+ async upgradeToAndCall(vaultAddress, newImplementation, data, options) {
332
+ const txCall = this.txBuilder.atomicUpgradeToAndCall(vaultAddress, newImplementation, data);
333
+ return this.execCall(txCall, options);
334
+ }
223
335
  }
@@ -275,6 +275,12 @@ export declare class EVMVaultReader {
275
275
  * @returns Total supply
276
276
  */
277
277
  getTotalSupply(vaultAddress: string, isETHVault?: boolean): Promise<bigint>;
278
+ /**
279
+ * Escrowed (deferred) ETH withdrawal claimable by `account` on an EmberETHVault —
280
+ * accrued when a withdrawal couldn't be sent (the receiver rejected the ETH transfer).
281
+ * Claim via `claimWithdrawal` / `claimWithdrawalFor`. Returns 0 if none. EmberETHVault only.
282
+ */
283
+ getUnclaimedWithdrawals(vaultAddress: string, account: string): Promise<bigint>;
278
284
  /**
279
285
  * Converts assets to shares
280
286
  * @param vaultAddress The vault address
@@ -275,6 +275,15 @@ export class EVMVaultReader {
275
275
  const vault = this.getVaultContract(vaultAddress, isETHVault);
276
276
  return vault.totalSupply();
277
277
  }
278
+ /**
279
+ * Escrowed (deferred) ETH withdrawal claimable by `account` on an EmberETHVault —
280
+ * accrued when a withdrawal couldn't be sent (the receiver rejected the ETH transfer).
281
+ * Claim via `claimWithdrawal` / `claimWithdrawalFor`. Returns 0 if none. EmberETHVault only.
282
+ */
283
+ async getUnclaimedWithdrawals(vaultAddress, account) {
284
+ const vault = this.getVaultContract(vaultAddress, true);
285
+ return vault.unclaimedWithdrawals(account);
286
+ }
278
287
  /**
279
288
  * Converts assets to shares
280
289
  * @param vaultAddress The vault address
@@ -20,6 +20,14 @@ export declare class EVMDeploymentParser {
20
20
  * Gets the protocol config proxy address
21
21
  */
22
22
  getProtocolConfigAddress(): string | undefined;
23
+ /**
24
+ * Resolves the protocol config that governs a specific vault. Atomic Liquidity vaults can be
25
+ * deployed against their own protocol config (carried per-vault in the deployment), which may
26
+ * differ from the global one; admin ops for an atomic vault MUST route through that config.
27
+ * Falls back to the global protocol config for non-atomic vaults (and atomic vaults that don't
28
+ * specify one).
29
+ */
30
+ getProtocolConfigAddressForVault(vaultAddress: string): string | undefined;
23
31
  /**
24
32
  * Gets the protocol config implementation address
25
33
  */