Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
maxima-net committed Sep 5, 2022
1 parent ed8322a commit 63e8488
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<Transaction> {
throw new Error('Method not implemented.');
}
Expand All @@ -35,10 +33,6 @@ export class ERC20EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtoco
throw new Error('Method not implemented.');
}

getInitiateFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getInitiateFees(params);
}

redeem(_params: AtomexProtocolMultiChainRedeemParameters): Promise<Transaction> {
throw new Error('Method not implemented.');
}
Expand All @@ -47,15 +41,7 @@ export class ERC20EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtoco
return atomexProtocolMultiChainHelper.getRedeemRewardInToken(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider);
}

getRedeemFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRedeemFees(params);
}

refund(_params: AtomexProtocolMultiChainRefundParameters): Promise<Transaction> {
throw new Error('Method not implemented.');
}

getRefundFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRefundFees(params);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export class EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtocolMult
throw new Error('Method not implemented.');
}

getInitiateFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getInitiateFees(params);
}

redeem(_params: AtomexProtocolMultiChainRedeemParameters): Promise<Transaction> {
throw new Error('Method not implemented.');
}
Expand All @@ -41,15 +37,7 @@ export class EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtocolMult
return atomexProtocolMultiChainHelper.getRedeemRewardInNativeCurrency(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider);
}

getRedeemFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRedeemFees(params);
}

refund(_params: AtomexProtocolMultiChainRefundParameters): Promise<Transaction> {
throw new Error('Method not implemented.');
}

getRefundFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRefundFees(params);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<Transaction> {
const currency = this.atomexBlockchainProvider.getCurrency(this.currencyId);
if (!currency)
Expand Down Expand Up @@ -67,27 +61,7 @@ export class FA12TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProto
return this.getTransaction('Lock', operation);
}

getInitiateFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getInitiateFees(params);
}

redeem(params: AtomexProtocolMultiChainRedeemParameters): Promise<Transaction> {
return super.redeem(params);
}

getRedeemReward(redeemFee: FeesInfo): Promise<FeesInfo> {
return atomexProtocolMultiChainHelper.getRedeemRewardInToken(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider);
}

getRedeemFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRedeemFees(params);
}

refund(params: AtomexProtocolMultiChainRefundParameters): Promise<Transaction> {
return super.refund(params);
}

getRefundFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRefundFees(params);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<Transaction> {
const currency = this.atomexBlockchainProvider.getCurrency(this.currencyId);
if (!currency)
Expand Down Expand Up @@ -69,27 +63,7 @@ export class FA2TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProtoc
return this.getTransaction('Lock', operation);
}

getInitiateFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getInitiateFees(params);
}

redeem(params: AtomexProtocolMultiChainRedeemParameters): Promise<Transaction> {
return super.redeem(params);
}

getRedeemReward(redeemFee: FeesInfo): Promise<FeesInfo> {
return atomexProtocolMultiChainHelper.getRedeemRewardInToken(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider);
}

getRedeemFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRedeemFees(params);
}

refund(params: AtomexProtocolMultiChainRefundParameters): Promise<Transaction> {
return super.refund(params);
}

getRefundFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRefundFees(params);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<Transaction> {
const wallet = await this.getWallet(params.senderAddress);
const contract = await wallet.toolkit.wallet.at<TezosMultiChainSmartContract<Wallet>>(this.swapContractAddress);
Expand All @@ -49,27 +43,7 @@ export class TezosTaquitoAtomexProtocolMultiChain extends TaquitoAtomexProtocolM
return this.getTransaction('Lock', operation);
}

getInitiateFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getInitiateFees(params);
}

redeem(params: AtomexProtocolMultiChainRedeemParameters): Promise<Transaction> {
return super.redeem(params);
}

getRedeemReward(redeemFee: FeesInfo): Promise<FeesInfo> {
return atomexProtocolMultiChainHelper.getRedeemRewardInNativeCurrency(this.currencyId, redeemFee, this.priceManager, this.atomexBlockchainProvider);
}

getRedeemFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRedeemFees(params);
}

refund(params: AtomexProtocolMultiChainRefundParameters): Promise<Transaction> {
return super.refund(params);
}

getRefundFees(params: Partial<AtomexProtocolMultiChainInitiateParameters>): Promise<FeesInfo> {
return super.getRefundFees(params);
}
}

0 comments on commit 63e8488

Please sign in to comment.