Skip to content

Commit

Permalink
Rename protocol types to kebab case
Browse files Browse the repository at this point in the history
  • Loading branch information
maxima-net committed Aug 30, 2022
1 parent 88c9007 commit 521945e
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/atomex/atomex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ export class Atomex implements AtomexService {
if (!quoteCurrencyInfo)
throw new Error(`The "${quoteCurrencyId}" currency (quote) is unknown`);

if (baseCurrencyInfo.atomexProtocol.type !== 'MultiChain')
if (baseCurrencyInfo.atomexProtocol.type !== 'multi-chain')
throw new Error(`Unknown type (${baseCurrencyInfo.atomexProtocol.type}) of the Atomex protocol (base)`);
if (quoteCurrencyInfo.atomexProtocol.type !== 'MultiChain')
if (quoteCurrencyInfo.atomexProtocol.type !== 'multi-chain')
throw new Error(`Unknown type (${quoteCurrencyInfo.atomexProtocol.type}) of the Atomex protocol (quote)`);

const baseCurrencyAtomexProtocolMultiChain = baseCurrencyInfo.atomexProtocol as AtomexProtocolMultiChain;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AtomexProtocolMultiChainBase } from './base';

export interface AtomexProtocolMultiChain extends AtomexProtocolMultiChainBase {
readonly type: 'MultiChain';
readonly type: 'multi-chain';
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { AtomexProtocolMultiChainBase } from './base';
import type { AtomexProtocolMultiChainInitiateParameters } from './initiateParameters';

export interface AtomexProtocolMultiChainApprovable extends AtomexProtocolMultiChainBase {
readonly type: 'MultiChainApprovable';
readonly type: 'multi-chain-approvable';

approve(params: AtomexProtocolMultiChainInitiateParameters): Promise<Transaction>;
}
4 changes: 2 additions & 2 deletions src/blockchain/atomexProtocolMultiChain/guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { AtomexProtocolMultiChain } from './atomexProtocolMultiChain';
import type { AtomexProtocolMultiChainApprovable } from './atomexProtocolMultiChainApprovable';

export const isAtomexProtocolMultiChain = (atomexProtocol: AtomexProtocol): atomexProtocol is AtomexProtocolMultiChain => {
return atomexProtocol.type === 'MultiChain';
return atomexProtocol.type === 'multi-chain';
};

export const isAtomexProtocolMultiChainApprovable = (atomexProtocol: AtomexProtocol): atomexProtocol is AtomexProtocolMultiChainApprovable => {
return atomexProtocol.type === 'MultiChainApprovable';
return atomexProtocol.type === 'multi-chain-approvable';
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { PriceManager } from '../../exchange';
import type { ERC20EthereumWeb3AtomexProtocolMultiChainOptions } from '../models/index';

export class ERC20EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtocolMultiChain implements AtomexProtocolMultiChainApprovable {
readonly type = 'MultiChainApprovable';
readonly type = 'multi-chain-approvable';

constructor(
atomexNetwork: AtomexNetwork,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { PriceManager } from '../../exchange';
import type { EthereumWeb3AtomexProtocolMultiChainOptions } from '../models/index';

export class EthereumWeb3AtomexProtocolMultiChain extends Web3AtomexProtocolMultiChain implements AtomexProtocolMultiChain {
readonly type = 'MultiChain';
readonly type = 'multi-chain';

constructor(
atomexNetwork: AtomexNetwork,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { TaquitoAtomexProtocolMultiChainOptions } from '../models/index';
import { mutezInTez } from '../utils';

export abstract class TaquitoAtomexProtocolMultiChain implements AtomexProtocolMultiChain {
readonly type = 'MultiChain';
readonly type = 'multi-chain';

constructor(
protected readonly blockchain: string,
Expand Down
4 changes: 2 additions & 2 deletions tests/blockchain/atomexBlockchainProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Atomex Blockchain Provider', () => {
};

const tezosNativeCurrencyOptions: AtomexCurrencyOptions = {
atomexProtocol: { atomexNetwork: 'mainnet', type: 'MultiChain' }
atomexProtocol: { atomexNetwork: 'mainnet', type: 'multi-chain' }
};

const ethereumNativeCurrency: Currency = {
Expand All @@ -31,7 +31,7 @@ describe('Atomex Blockchain Provider', () => {
};

const ethereumNativeCurrencyOptions: AtomexCurrencyOptions = {
atomexProtocol: { atomexNetwork: 'mainnet', type: 'MultiChain' }
atomexProtocol: { atomexNetwork: 'mainnet', type: 'multi-chain' }
};

let provider: AtomexBlockchainProvider;
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/blockchain/mockAtomexProtocolMultiChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { DeepReadonly } from '../../../src/core';
import type { AtomexNetwork, AtomexProtocolMultiChain } from '../../../src/index';

export class MockAtomexProtocolMultiChain implements AtomexProtocolMultiChain {
readonly type = 'MultiChain';
readonly type = 'multi-chain';

constructor(
readonly atomexNetwork: AtomexNetwork,
Expand Down

0 comments on commit 521945e

Please sign in to comment.