@ember-finance/sdk 2.8.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.
@@ -242,6 +242,12 @@ export interface VaultDetail {
242
242
  * @memberof VaultDetail
243
243
  */
244
244
  redemptionPriceE9?: string;
245
+ /**
246
+ * The permanent withdrawal fee charged on every redemption, in e18 form where 1e18 is 100% — divide by 1e16 to get a percentage, the same scale as managementFeePercentE18 (500000000000000 is 0.05%). Mirrors the permanent fee percentage set on the vault contract. Unlike the time-based fee this is always deducted, so it is the fee to quote for a withdrawal. \"0\" when the vault charges no permanent fee.
247
+ * @type {string}
248
+ * @memberof VaultDetail
249
+ */
250
+ redemptionFeePercentageE18: string;
245
251
  /**
246
252
  * Free-form display text for the \"Price Updates\" row of the vault details panel, describing how often this vault\'s share price is updated (e.g. \"Updated Biweekly\"). Rendered verbatim by the frontend — it is display copy, not a machine-readable cadence. Absent when not configured for the vault, in which case the frontend falls back to its own default.
247
253
  * @type {string}
@@ -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]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-finance/sdk",
3
3
  "description": "Ember Protocol SDK",
4
- "version": "2.8.0",
4
+ "version": "2.10.0",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
7
7
  "main": "./dist/index.js",