3af4e354cd
* move accounts and positions into own feature, add mock for accounts * use length for expected number of columns * combine trading feature tests into single trading-page.feature * add orders scenario for trading page * fix typo * move related test cases for orders together
19 lines
466 B
TypeScript
19 lines
466 B
TypeScript
import type { AssetFields } from './__generated__/AssetFields';
|
|
|
|
export interface ERC20Asset extends AssetFields {
|
|
source: {
|
|
__typename: 'ERC20';
|
|
contractAddress: string;
|
|
};
|
|
}
|
|
|
|
type UnknownAsset = Pick<AssetFields, '__typename' | 'source'>;
|
|
|
|
// Type guard to ensure an asset is an ERC20 token
|
|
export const isERC20Asset = (asset: UnknownAsset): asset is ERC20Asset => {
|
|
if (asset.source.__typename === 'ERC20') {
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|