@reflectmoney/stable.ts 2.6.0 → 2.7.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.
|
@@ -246,4 +246,12 @@ export declare abstract class Stablecoin<T extends Controller> {
|
|
|
246
246
|
* @returns Promise resolving to the amount of base tokens that would be returned
|
|
247
247
|
*/
|
|
248
248
|
abstract simulateRedeemMath(amount: BN): Promise<BN>;
|
|
249
|
+
/**
|
|
250
|
+
* Abstract method to cleanup the stablecoin.
|
|
251
|
+
* Must be implemented by concrete stablecoin classes.
|
|
252
|
+
* Used to unsubscribe all connections to websockets.
|
|
253
|
+
*
|
|
254
|
+
* @returns Promise resolving to void
|
|
255
|
+
*/
|
|
256
|
+
abstract cleanup(): Promise<void>;
|
|
249
257
|
}
|
|
@@ -345,5 +345,10 @@ class LstStablecoin extends Stablecoin_1.Stablecoin {
|
|
|
345
345
|
return new bn_js_1.default(0);
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
+
cleanup() {
|
|
349
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
350
|
+
yield this.driftClient.unsubscribe();
|
|
351
|
+
});
|
|
352
|
+
}
|
|
348
353
|
}
|
|
349
354
|
exports.LstStablecoin = LstStablecoin;
|