@axonfi/sdk 0.12.0 → 0.14.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.
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3224,6 +3224,17 @@ async function getOperatorCeilings(publicClient, vaultAddress) {
|
|
|
3224
3224
|
minAiTriggerFloor
|
|
3225
3225
|
};
|
|
3226
3226
|
}
|
|
3227
|
+
function operatorMaxDrainPerDay(ceilings) {
|
|
3228
|
+
const { maxOperatorBots, maxBotDailyLimit, vaultDailyAggregate } = ceilings;
|
|
3229
|
+
if (maxOperatorBots === 0n) return 0;
|
|
3230
|
+
if (maxBotDailyLimit === 0n) {
|
|
3231
|
+
if (vaultDailyAggregate > 0n) return Number(vaultDailyAggregate) / 1e6;
|
|
3232
|
+
return Infinity;
|
|
3233
|
+
}
|
|
3234
|
+
const theoretical = maxOperatorBots * maxBotDailyLimit;
|
|
3235
|
+
const raw = vaultDailyAggregate > 0n && vaultDailyAggregate < theoretical ? vaultDailyAggregate : theoretical;
|
|
3236
|
+
return Number(raw) / 1e6;
|
|
3237
|
+
}
|
|
3227
3238
|
async function isErc1271BotsEnabled(publicClient, vaultAddress) {
|
|
3228
3239
|
return publicClient.readContract({
|
|
3229
3240
|
address: vaultAddress,
|
|
@@ -4995,6 +5006,7 @@ exports.isDestinationAllowed = isDestinationAllowed;
|
|
|
4995
5006
|
exports.isErc1271BotsEnabled = isErc1271BotsEnabled;
|
|
4996
5007
|
exports.isRebalanceTokenWhitelisted = isRebalanceTokenWhitelisted;
|
|
4997
5008
|
exports.isVaultPaused = isVaultPaused;
|
|
5009
|
+
exports.operatorMaxDrainPerDay = operatorMaxDrainPerDay;
|
|
4998
5010
|
exports.parseAmount = parseAmount;
|
|
4999
5011
|
exports.parseChainId = parseChainId;
|
|
5000
5012
|
exports.parsePaymentRequired = parsePaymentRequired;
|