Skip to content

Commit

Permalink
Add the isAtomexProtocolV1 guard
Browse files Browse the repository at this point in the history
  • Loading branch information
skubarenko committed Aug 12, 2022
1 parent a95f710 commit 4b215c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/blockchain/atomexProtocolV1/guards.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { AtomexProtocol } from '../atomexProtocol';
import type { AtomexProtocolV1 } from './atomexProtocolV1';

export const isAtomexProtocolV1 = (atomexProtocol: AtomexProtocol): atomexProtocol is AtomexProtocolV1 => {
return atomexProtocol.version === 1;
};
2 changes: 2 additions & 0 deletions src/blockchain/atomexProtocolV1/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { isAtomexProtocolV1 } from './guards';

export type { AtomexProtocolV1 } from './atomexProtocolV1';
export type { AtomexProtocolV1Options } from './options';
export type { AtomexProtocolV1InitiateParameters } from './initiateParameters';
Expand Down
1 change: 1 addition & 0 deletions src/blockchain/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { WalletsManager } from './walletsManager';
export { isAtomexProtocolV1 } from './atomexProtocolV1/index';

export type { AtomexProtocolOptions, AtomexSignature, Transaction } from './models/index';
export type { AtomexProtocol } from './atomexProtocol';
Expand Down

0 comments on commit 4b215c4

Please sign in to comment.