diff --git a/src/bridgeDataProviders/defaultDataProvider/defaultDataProvider.ts b/src/bridgeDataProviders/defaultDataProvider/defaultDataProvider.ts index 7e15842..bc4444a 100644 --- a/src/bridgeDataProviders/defaultDataProvider/defaultDataProvider.ts +++ b/src/bridgeDataProviders/defaultDataProvider/defaultDataProvider.ts @@ -93,16 +93,15 @@ export class DefaultDataProvider implements TransfersBridgeDataProvider, Balance subscribeToAccountTokenTransfers(accountAddress: string): void; subscribeToAccountTokenTransfers(accountAddresses: readonly string[]): void; - subscribeToAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void; - subscribeToAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void { + subscribeToAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void; + subscribeToAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void { return this.dipDupBridgeDataProvider.subscribeToAccountTokenTransfers(accountAddressOrAddresses); } - unsubscribeFromAccountTokenTransfers(): void; unsubscribeFromAccountTokenTransfers(accountAddress: string): void; unsubscribeFromAccountTokenTransfers(accountAddresses: readonly string[]): void; - unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void; - unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void { + unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void; + unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void { return this.dipDupBridgeDataProvider.unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses); } diff --git a/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupBridgeDataProvider.ts b/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupBridgeDataProvider.ts index 0862671..35cfa2f 100644 --- a/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupBridgeDataProvider.ts +++ b/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupBridgeDataProvider.ts @@ -146,17 +146,16 @@ export class DipDupBridgeDataProvider extends RemoteService implements Transfers subscribeToAccountTokenTransfers(accountAddress: string): void; subscribeToAccountTokenTransfers(accountAddresses: readonly string[]): void; - subscribeToAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void; - subscribeToAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void { + subscribeToAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void; + subscribeToAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void { this.startDipDupWebSocketClientIfNeeded(); this.subscribeToTokenTransfersInternal(accountAddressOrAddresses); } - unsubscribeFromAccountTokenTransfers(): void; unsubscribeFromAccountTokenTransfers(accountAddress: string): void; unsubscribeFromAccountTokenTransfers(accountAddresses: readonly string[]): void; - unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void; - unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void { + unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void; + unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void { this.unsubscribeFromTokenTransfersInternal(accountAddressOrAddresses); } diff --git a/src/bridgeDataProviders/transfersBridgeDataProvider/transfersBridgeDataProvider.ts b/src/bridgeDataProviders/transfersBridgeDataProvider/transfersBridgeDataProvider.ts index a0a0a1d..1ca7eb2 100644 --- a/src/bridgeDataProviders/transfersBridgeDataProvider/transfersBridgeDataProvider.ts +++ b/src/bridgeDataProviders/transfersBridgeDataProvider/transfersBridgeDataProvider.ts @@ -40,11 +40,11 @@ export interface TransfersBridgeDataProvider { subscribeToAccountTokenTransfers(accountAddress: string): void; subscribeToAccountTokenTransfers(accountAddresses: readonly string[]): void; - subscribeToAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void; + subscribeToAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void; unsubscribeFromAccountTokenTransfers(accountAddress: string): void; unsubscribeFromAccountTokenTransfers(accountAddresses: readonly string[]): void; - unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses?: string | readonly string[]): void; + unsubscribeFromAccountTokenTransfers(accountAddressOrAddresses: string | readonly string[]): void; unsubscribeFromAllSubscriptions(): void; } diff --git a/src/tokenBridge/tokenBridge.ts b/src/tokenBridge/tokenBridge.ts index 76fd6d8..3efa8b5 100644 --- a/src/tokenBridge/tokenBridge.ts +++ b/src/tokenBridge/tokenBridge.ts @@ -363,7 +363,7 @@ export class TokenBridge implements Disposable { if (guards.isDisposable(this.bridgeComponents.transfersBridgeDataProvider)) this.bridgeComponents.transfersBridgeDataProvider[Symbol.dispose](); - this.rejectAndClearAllStatusWatchers('The TokenBridge has been stopped!'); + this.rejectAndClearAllStatusWatchers('The TokenBridge has been disposed!'); this.detachEvents(); clearInterval(this.lastCreatedTokenTransfersTimerId); this.lastCreatedTokenTransfers.clear(); @@ -471,6 +471,7 @@ export class TokenBridge implements Disposable { protected unsubscribeFromAllSubscriptions(): void { this.bridgeComponents.transfersBridgeDataProvider.unsubscribeFromAllSubscriptions(); + this.rejectAndClearAllStatusWatchers('Unsubscribe from all subscriptions'); } // #endregion