Skip to content
Merged
13 changes: 1 addition & 12 deletions src/wallet-account-with-protocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,11 @@
import { IWalletAccount, NotImplementedError } from '@tetherto/wdk-wallet'

/** @typedef {import('@tetherto/wdk-wallet/protocols').ISwapProtocol} ISwapProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').SwapProtocol} SwapProtocolCtor */

/** @typedef {import('@tetherto/wdk-wallet/protocols').IBridgeProtocol} IBridgeProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').BridgeProtocol} BridgeProtocolCtor */

/** @typedef {import('@tetherto/wdk-wallet/protocols').ILendingProtocol} ILendingProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').LendingProtocol} LendingProtocolCtor */

/** @typedef {import('@tetherto/wdk-wallet/protocols').IFiatProtocol} IFiatProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').FiatProtocol} FiatProtocolCtor */

/** @typedef {import('@tetherto/wdk-wallet/protocols').ISwidgeProtocol} ISwidgeProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').SwidgeProtocol} SwidgeProtocolCtor */

/** @typedef {import('@tetherto/wdk-wallet/protocols').ISdaProtocol} ISdaProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').SdaProtocol} SdaProtocolCtor */

/**
* Interface for wallet accounts that also expose the WDK's protocol-getter
Expand All @@ -52,7 +41,7 @@ export class IWalletAccountWithProtocols extends IWalletAccount {
* The label must be unique in the scope of the account and the type of protocol (i.e., there can’t be two protocols of the same
* type bound to the same account with the same label).
*
* @template {SwapProtocolCtor | BridgeProtocolCtor | LendingProtocolCtor | FiatProtocolCtor | SwidgeProtocolCtor | SdaProtocolCtor} P
* @template {typeof import('@tetherto/wdk-wallet/protocols').SwapProtocol | typeof import('@tetherto/wdk-wallet/protocols').BridgeProtocol | typeof import('@tetherto/wdk-wallet/protocols').LendingProtocol | typeof import('@tetherto/wdk-wallet/protocols').FiatProtocol | typeof import('@tetherto/wdk-wallet/protocols').SwidgeProtocol | typeof import('@tetherto/wdk-wallet/protocols').SdaProtocol} P
Comment thread
Davi0kProgramsThings marked this conversation as resolved.
Outdated
* @param {string} label - The label.
* @param {P} Protocol - The protocol class.
* @param {ConstructorParameters<P>[1]} config - The protocol configuration.
Expand Down
16 changes: 2 additions & 14 deletions types/src/wallet-account-with-protocols.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/** @typedef {import('@tetherto/wdk-wallet/protocols').ISwapProtocol} ISwapProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').SwapProtocol} SwapProtocolCtor */
/** @typedef {import('@tetherto/wdk-wallet/protocols').IBridgeProtocol} IBridgeProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').BridgeProtocol} BridgeProtocolCtor */
/** @typedef {import('@tetherto/wdk-wallet/protocols').ILendingProtocol} ILendingProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').LendingProtocol} LendingProtocolCtor */
/** @typedef {import('@tetherto/wdk-wallet/protocols').IFiatProtocol} IFiatProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').FiatProtocol} FiatProtocolCtor */
/** @typedef {import('@tetherto/wdk-wallet/protocols').ISwidgeProtocol} ISwidgeProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').SwidgeProtocol} SwidgeProtocolCtor */
/** @typedef {import('@tetherto/wdk-wallet/protocols').ISdaProtocol} ISdaProtocol */
/** @typedef {typeof import('@tetherto/wdk-wallet/protocols').SdaProtocol} SdaProtocolCtor */
/**
* Interface for wallet accounts that also expose the WDK's protocol-getter
* helpers (`registerProtocol`, `getSwapProtocol`, `getBridgeProtocol`,
Expand All @@ -28,13 +22,13 @@ export class IWalletAccountWithProtocols {
* The label must be unique in the scope of the account and the type of protocol (i.e., there can’t be two protocols of the same
* type bound to the same account with the same label).
*
* @template {SwapProtocolCtor | BridgeProtocolCtor | LendingProtocolCtor | FiatProtocolCtor | SwidgeProtocolCtor | SdaProtocolCtor} P
* @template {typeof import('@tetherto/wdk-wallet/protocols').SwapProtocol | typeof import('@tetherto/wdk-wallet/protocols').BridgeProtocol | typeof import('@tetherto/wdk-wallet/protocols').LendingProtocol | typeof import('@tetherto/wdk-wallet/protocols').FiatProtocol | typeof import('@tetherto/wdk-wallet/protocols').SwidgeProtocol | typeof import('@tetherto/wdk-wallet/protocols').SdaProtocol} P
* @param {string} label - The label.
* @param {P} Protocol - The protocol class.
* @param {ConstructorParameters<P>[1]} config - The protocol configuration.
* @returns {IWalletAccountWithProtocols} The account.
*/
registerProtocol<P extends SwapProtocolCtor | BridgeProtocolCtor | LendingProtocolCtor | FiatProtocolCtor | SwidgeProtocolCtor | SdaProtocolCtor>(label: string, Protocol: P, config: ConstructorParameters<P>[1]): IWalletAccountWithProtocols;
registerProtocol<P extends typeof import("@tetherto/wdk-wallet/protocols").SwapProtocol | typeof import("@tetherto/wdk-wallet/protocols").BridgeProtocol | typeof import("@tetherto/wdk-wallet/protocols").LendingProtocol | typeof import("@tetherto/wdk-wallet/protocols").FiatProtocol | typeof import("@tetherto/wdk-wallet/protocols").SwidgeProtocol | typeof import("@tetherto/wdk-wallet/protocols").SdaProtocol>(label: string, Protocol: P, config: ConstructorParameters<P>[1]): IWalletAccountWithProtocols;
/**
* Returns the swap protocol with the given label.
*
Expand Down Expand Up @@ -85,14 +79,8 @@ export class IWalletAccountWithProtocols {
getSdaProtocol(label: string): ISdaProtocol;
}
export type ISwapProtocol = import("@tetherto/wdk-wallet/protocols").ISwapProtocol;
export type SwapProtocolCtor = typeof import("@tetherto/wdk-wallet/protocols").SwapProtocol;
export type IBridgeProtocol = import("@tetherto/wdk-wallet/protocols").IBridgeProtocol;
export type BridgeProtocolCtor = typeof import("@tetherto/wdk-wallet/protocols").BridgeProtocol;
export type ILendingProtocol = import("@tetherto/wdk-wallet/protocols").ILendingProtocol;
export type LendingProtocolCtor = typeof import("@tetherto/wdk-wallet/protocols").LendingProtocol;
export type IFiatProtocol = import("@tetherto/wdk-wallet/protocols").IFiatProtocol;
export type FiatProtocolCtor = typeof import("@tetherto/wdk-wallet/protocols").FiatProtocol;
export type ISwidgeProtocol = import("@tetherto/wdk-wallet/protocols").ISwidgeProtocol;
export type SwidgeProtocolCtor = typeof import("@tetherto/wdk-wallet/protocols").SwidgeProtocol;
export type ISdaProtocol = import("@tetherto/wdk-wallet/protocols").ISdaProtocol;
export type SdaProtocolCtor = typeof import("@tetherto/wdk-wallet/protocols").SdaProtocol;