@ember-finance/sdk 2.9.0 → 2.10.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.
|
@@ -109,4 +109,18 @@ export declare class EVMOperatorCalls extends EVMOnChainCalls {
|
|
|
109
109
|
releaseUsersHoldback(vaultAddress: string, share: string, unwindingPercentage: NumStr, maxEntries: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
110
110
|
/** Atomic vault: move `amount` of collateral to a registered sub-account. */
|
|
111
111
|
supplyToSubAccount(vaultAddress: string, subAccount: string, amount: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
112
|
+
/**
|
|
113
|
+
* Atomic vault: settle accrued platform fees, forwarding `accrued - loss` to the
|
|
114
|
+
* protocol fee recipient.
|
|
115
|
+
*
|
|
116
|
+
* Named apart from {@link collectPlatformFee} rather than overloading it because the two
|
|
117
|
+
* are different functions on different contracts: EmberVault exposes `collectPlatformFee()`
|
|
118
|
+
* and AtomicLiquidity exposes `collectPlatformFee(uint256 loss)`. An atomic vault sent
|
|
119
|
+
* through the EmberVault path reverts with no revert data, which is easily mistaken for
|
|
120
|
+
* "nothing accrued" — callers must pick the one matching the vault type.
|
|
121
|
+
*
|
|
122
|
+
* @param loss Fee portion to absorb against an already-booked shortfall instead of
|
|
123
|
+
* transferring; `0` is the ordinary path. Must be <= the accrued fee.
|
|
124
|
+
*/
|
|
125
|
+
collectAtomicPlatformFee(vaultAddress: string, loss: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
112
126
|
}
|
|
@@ -164,4 +164,21 @@ export class EVMOperatorCalls extends EVMOnChainCalls {
|
|
|
164
164
|
const txCall = this.txBuilder.atomicSupplyToSubAccount(vaultAddress, subAccount, amount);
|
|
165
165
|
return this.execCall(txCall, options);
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Atomic vault: settle accrued platform fees, forwarding `accrued - loss` to the
|
|
169
|
+
* protocol fee recipient.
|
|
170
|
+
*
|
|
171
|
+
* Named apart from {@link collectPlatformFee} rather than overloading it because the two
|
|
172
|
+
* are different functions on different contracts: EmberVault exposes `collectPlatformFee()`
|
|
173
|
+
* and AtomicLiquidity exposes `collectPlatformFee(uint256 loss)`. An atomic vault sent
|
|
174
|
+
* through the EmberVault path reverts with no revert data, which is easily mistaken for
|
|
175
|
+
* "nothing accrued" — callers must pick the one matching the vault type.
|
|
176
|
+
*
|
|
177
|
+
* @param loss Fee portion to absorb against an already-booked shortfall instead of
|
|
178
|
+
* transferring; `0` is the ordinary path. Must be <= the accrued fee.
|
|
179
|
+
*/
|
|
180
|
+
async collectAtomicPlatformFee(vaultAddress, loss, options) {
|
|
181
|
+
const txCall = this.txBuilder.atomicCollectPlatformFee(vaultAddress, loss);
|
|
182
|
+
return this.execCall(txCall, options);
|
|
183
|
+
}
|
|
167
184
|
}
|
|
@@ -598,6 +598,20 @@ export declare class EVMTxBuilder {
|
|
|
598
598
|
atomicSetPausedStatus(vaultAddress: string, _caller: string, operation: string, paused: boolean): ITransactionCall;
|
|
599
599
|
/** Move `amount` of collateral to a registered sub-account (operator). */
|
|
600
600
|
atomicSupplyToSubAccount(vaultAddress: string, subAccount: string, amount: NumStr): ITransactionCall;
|
|
601
|
+
/**
|
|
602
|
+
* Settle accrued platform fees and forward `accrued - loss` to the fee recipient (operator).
|
|
603
|
+
*
|
|
604
|
+
* Distinct from {@link collectPlatformFee}, which targets EmberVault's zero-argument
|
|
605
|
+
* `collectPlatformFee()`. AtomicLiquidity's is `collectPlatformFee(uint256 loss)` — a
|
|
606
|
+
* different selector — so routing an atomic vault through the EmberVault builder produces
|
|
607
|
+
* a call the contract has no function for and it reverts with no revert data.
|
|
608
|
+
*
|
|
609
|
+
* @param loss Portion of the accrued fee to absorb against an already-booked off-vault
|
|
610
|
+
* shortfall instead of transferring. The full accrued amount is settled to zero
|
|
611
|
+
* either way; only `accrued - loss` leaves the vault. Pass `0` for the ordinary
|
|
612
|
+
* path. Must be <= accrued, else the contract reverts with `InvalidValue`.
|
|
613
|
+
*/
|
|
614
|
+
atomicCollectPlatformFee(vaultAddress: string, loss: NumStr): ITransactionCall;
|
|
601
615
|
/** Rotate the admin role. */
|
|
602
616
|
atomicSetAdmin(vaultAddress: string, _caller: string, newAdmin: string): ITransactionCall;
|
|
603
617
|
/** Rotate the operator role. */
|
|
@@ -1302,6 +1302,22 @@ export class EVMTxBuilder {
|
|
|
1302
1302
|
atomicSupplyToSubAccount(vaultAddress, subAccount, amount) {
|
|
1303
1303
|
return this.atomicCall(vaultAddress, "supplyToSubAccount", [subAccount, amount]);
|
|
1304
1304
|
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Settle accrued platform fees and forward `accrued - loss` to the fee recipient (operator).
|
|
1307
|
+
*
|
|
1308
|
+
* Distinct from {@link collectPlatformFee}, which targets EmberVault's zero-argument
|
|
1309
|
+
* `collectPlatformFee()`. AtomicLiquidity's is `collectPlatformFee(uint256 loss)` — a
|
|
1310
|
+
* different selector — so routing an atomic vault through the EmberVault builder produces
|
|
1311
|
+
* a call the contract has no function for and it reverts with no revert data.
|
|
1312
|
+
*
|
|
1313
|
+
* @param loss Portion of the accrued fee to absorb against an already-booked off-vault
|
|
1314
|
+
* shortfall instead of transferring. The full accrued amount is settled to zero
|
|
1315
|
+
* either way; only `accrued - loss` leaves the vault. Pass `0` for the ordinary
|
|
1316
|
+
* path. Must be <= accrued, else the contract reverts with `InvalidValue`.
|
|
1317
|
+
*/
|
|
1318
|
+
atomicCollectPlatformFee(vaultAddress, loss) {
|
|
1319
|
+
return this.atomicCall(vaultAddress, "collectPlatformFee", [loss]);
|
|
1320
|
+
}
|
|
1305
1321
|
/** Rotate the admin role. */
|
|
1306
1322
|
atomicSetAdmin(vaultAddress, _caller, newAdmin) {
|
|
1307
1323
|
return this.atomicConfigCall(vaultAddress, "updateVaultAdmin", [newAdmin]);
|