From 63e8488677abb13b3be5399625b3a53d5c0d86f4 Mon Sep 17 00:00:00 2001 From: Maxim Kucherov Date: Fri, 2 Sep 2022 19:49:21 +0300 Subject: [PATCH] Cleanup code --- ...c20EthereumWeb3AtomexProtocolMultiChain.ts | 20 +++----------- .../ethereumWeb3AtomexProtocolMultiChain.ts | 12 --------- ...a12TezosTaquitoAtomexProtocolMultiChain.ts | 26 ------------------- ...fa2TezosTaquitoAtomexProtocolMultiChain.ts | 26 ------------------- .../tezosTaquitoAtomexProtocolMultiChain.ts | 26 ------------------- 5 files changed, 3 insertions(+), 107 deletions(-) diff --git a/src/ethereum/atomexProtocol/erc20EthereumWeb3AtomexProtocolMultiChain.ts b/src/ethereum/atomexProtocol/erc20EthereumWeb3AtomexProtocolMultiChain.ts index 6aaa54de..eb53aa5c 100644 --- a/src/ethereum/atomexProtocol/erc20EthereumWeb3AtomexProtocolMultiChain.ts +++ b/src/ethereum/atomexProtocol/erc20EthereumWeb3AtomexProtocolMultiChain.ts @@ -1,7 +1,9 @@ import { AtomexProtocolMultiChainApprovable, atomexProtocolMultiChainHelper } from '../../blockchain/atomexProtocolMultiChain'; import type { AtomexBlockchainProvider, - AtomexProtocolMultiChainInitiateParameters, AtomexProtocolMultiChainRedeemParameters, AtomexProtocolMultiChainRefundParameters, + AtomexProtocolMultiChainInitiateParameters, + AtomexProtocolMultiChainRedeemParameters, + AtomexProtocolMultiChainRefundParameters, FeesInfo, Transaction, WalletsManager } from '../../blockchain/index'; import type { AtomexNetwork } from '../../common/index'; @@ -23,10 +25,6 @@ export class ERC20EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtoco super('ethereum', atomexNetwork, atomexProtocolOptions, atomexBlockchainProvider, walletsManager, priceManager); } - get currencyId() { - return this.atomexProtocolOptions.currencyId; - } - approve(_params: AtomexProtocolMultiChainInitiateParameters): Promise { throw new Error('Method not implemented.'); } @@ -35,10 +33,6 @@ export class ERC20EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtoco throw new Error('Method not implemented.'); } - getInitiateFees(params: Partial): Promise { - return super.getInitiateFees(params); - } - redeem(_params: AtomexProtocolMultiChainRedeemParameters): Promise { throw new Error('Method not implemented.'); } @@ -47,15 +41,7 @@ export class ERC20EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtoco return atomexProtocolMultiChainHelper.getRedeemRewardInToken(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider); } - getRedeemFees(params: Partial): Promise { - return super.getRedeemFees(params); - } - refund(_params: AtomexProtocolMultiChainRefundParameters): Promise { throw new Error('Method not implemented.'); } - - getRefundFees(params: Partial): Promise { - return super.getRefundFees(params); - } } diff --git a/src/ethereum/atomexProtocol/ethereumWeb3AtomexProtocolMultiChain.ts b/src/ethereum/atomexProtocol/ethereumWeb3AtomexProtocolMultiChain.ts index 0cb45b3d..008fa738 100644 --- a/src/ethereum/atomexProtocol/ethereumWeb3AtomexProtocolMultiChain.ts +++ b/src/ethereum/atomexProtocol/ethereumWeb3AtomexProtocolMultiChain.ts @@ -29,10 +29,6 @@ export class EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtocolMult throw new Error('Method not implemented.'); } - getInitiateFees(params: Partial): Promise { - return super.getInitiateFees(params); - } - redeem(_params: AtomexProtocolMultiChainRedeemParameters): Promise { throw new Error('Method not implemented.'); } @@ -41,15 +37,7 @@ export class EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtocolMult return atomexProtocolMultiChainHelper.getRedeemRewardInNativeCurrency(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider); } - getRedeemFees(params: Partial): Promise { - return super.getRedeemFees(params); - } - refund(_params: AtomexProtocolMultiChainRefundParameters): Promise { throw new Error('Method not implemented.'); } - - getRefundFees(params: Partial): Promise { - return super.getRefundFees(params); - } } diff --git a/src/tezos/atomexProtocol/multiChain/fa12TezosTaquitoAtomexProtocolMultiChain.ts b/src/tezos/atomexProtocol/multiChain/fa12TezosTaquitoAtomexProtocolMultiChain.ts index c8984c86..3abdfa7b 100644 --- a/src/tezos/atomexProtocol/multiChain/fa12TezosTaquitoAtomexProtocolMultiChain.ts +++ b/src/tezos/atomexProtocol/multiChain/fa12TezosTaquitoAtomexProtocolMultiChain.ts @@ -5,8 +5,6 @@ import { atomexProtocolMultiChainHelper } from '../../../blockchain/atomexProtoc import type { AtomexBlockchainProvider, AtomexProtocolMultiChainInitiateParameters, - AtomexProtocolMultiChainRedeemParameters, - AtomexProtocolMultiChainRefundParameters, FeesInfo, Transaction, WalletsManager } from '../../../blockchain/index'; import type { AtomexNetwork } from '../../../common/index'; @@ -29,10 +27,6 @@ export class FA12TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProto super('tezos', atomexNetwork, atomexProtocolOptions, atomexBlockchainProvider, walletsManager, priceManager); } - get currencyId() { - return this.atomexProtocolOptions.currencyId; - } - async initiate(params: AtomexProtocolMultiChainInitiateParameters): Promise { const currency = this.atomexBlockchainProvider.getCurrency(this.currencyId); if (!currency) @@ -67,27 +61,7 @@ export class FA12TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProto return this.getTransaction('Lock', operation); } - getInitiateFees(params: Partial): Promise { - return super.getInitiateFees(params); - } - - redeem(params: AtomexProtocolMultiChainRedeemParameters): Promise { - return super.redeem(params); - } - getRedeemReward(redeemFee: FeesInfo): Promise { return atomexProtocolMultiChainHelper.getRedeemRewardInToken(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider); } - - getRedeemFees(params: Partial): Promise { - return super.getRedeemFees(params); - } - - refund(params: AtomexProtocolMultiChainRefundParameters): Promise { - return super.refund(params); - } - - getRefundFees(params: Partial): Promise { - return super.getRefundFees(params); - } } diff --git a/src/tezos/atomexProtocol/multiChain/fa2TezosTaquitoAtomexProtocolMultiChain.ts b/src/tezos/atomexProtocol/multiChain/fa2TezosTaquitoAtomexProtocolMultiChain.ts index b0ba781d..8ec41987 100644 --- a/src/tezos/atomexProtocol/multiChain/fa2TezosTaquitoAtomexProtocolMultiChain.ts +++ b/src/tezos/atomexProtocol/multiChain/fa2TezosTaquitoAtomexProtocolMultiChain.ts @@ -5,8 +5,6 @@ import { atomexProtocolMultiChainHelper } from '../../../blockchain/atomexProtoc import type { AtomexBlockchainProvider, AtomexProtocolMultiChainInitiateParameters, - AtomexProtocolMultiChainRedeemParameters, - AtomexProtocolMultiChainRefundParameters, FeesInfo, Transaction, WalletsManager } from '../../../blockchain/index'; import type { AtomexNetwork } from '../../../common/index'; @@ -30,10 +28,6 @@ export class FA2TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProtoc super('tezos', atomexNetwork, atomexProtocolOptions, atomexBlockchainProvider, walletsManager, priceManager); } - get currencyId() { - return this.atomexProtocolOptions.currencyId; - } - async initiate(params: AtomexProtocolMultiChainInitiateParameters): Promise { const currency = this.atomexBlockchainProvider.getCurrency(this.currencyId); if (!currency) @@ -69,27 +63,7 @@ export class FA2TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProtoc return this.getTransaction('Lock', operation); } - getInitiateFees(params: Partial): Promise { - return super.getInitiateFees(params); - } - - redeem(params: AtomexProtocolMultiChainRedeemParameters): Promise { - return super.redeem(params); - } - getRedeemReward(redeemFee: FeesInfo): Promise { return atomexProtocolMultiChainHelper.getRedeemRewardInToken(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider); } - - getRedeemFees(params: Partial): Promise { - return super.getRedeemFees(params); - } - - refund(params: AtomexProtocolMultiChainRefundParameters): Promise { - return super.refund(params); - } - - getRefundFees(params: Partial): Promise { - return super.getRefundFees(params); - } } diff --git a/src/tezos/atomexProtocol/multiChain/tezosTaquitoAtomexProtocolMultiChain.ts b/src/tezos/atomexProtocol/multiChain/tezosTaquitoAtomexProtocolMultiChain.ts index cd77e53d..a868c554 100644 --- a/src/tezos/atomexProtocol/multiChain/tezosTaquitoAtomexProtocolMultiChain.ts +++ b/src/tezos/atomexProtocol/multiChain/tezosTaquitoAtomexProtocolMultiChain.ts @@ -4,8 +4,6 @@ import { atomexProtocolMultiChainHelper } from '../../../blockchain/atomexProtoc import type { AtomexBlockchainProvider, AtomexProtocolMultiChainInitiateParameters, - AtomexProtocolMultiChainRedeemParameters, - AtomexProtocolMultiChainRefundParameters, FeesInfo, Transaction, WalletsManager } from '../../../blockchain/index'; import type { AtomexNetwork } from '../../../common/index'; @@ -27,10 +25,6 @@ export class TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProtocolM super('tezos', atomexNetwork, atomexProtocolOptions, atomexBlockchainProvider, walletsManager, priceManager); } - get currencyId() { - return this.atomexProtocolOptions.currencyId; - } - async initiate(params: AtomexProtocolMultiChainInitiateParameters): Promise { const wallet = await this.getWallet(params.senderAddress); const contract = await wallet.toolkit.wallet.at>(this.swapContractAddress); @@ -49,27 +43,7 @@ export class TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProtocolM return this.getTransaction('Lock', operation); } - getInitiateFees(params: Partial): Promise { - return super.getInitiateFees(params); - } - - redeem(params: AtomexProtocolMultiChainRedeemParameters): Promise { - return super.redeem(params); - } - getRedeemReward(redeemFee: FeesInfo): Promise { return atomexProtocolMultiChainHelper.getRedeemRewardInNativeCurrency(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider); } - - getRedeemFees(params: Partial): Promise { - return super.getRedeemFees(params); - } - - refund(params: AtomexProtocolMultiChainRefundParameters): Promise { - return super.refund(params); - } - - getRefundFees(params: Partial): Promise { - return super.getRefundFees(params); - } }