-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dividend, All Sector Gainers and Loosers #30
base: master
Are you sure you want to change the base?
Conversation
@gogulnathv Please add some description about this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please add test cases for those new methods.
@@ -4,18 +4,22 @@ import { IndexEquityInfo } from './interface' | |||
const nseIndia = new NseIndia() | |||
|
|||
export const getGainersAndLosersByIndex = async (indexSymbol: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this 'indexSymbol' param as optional. So that user need not pass 'all' as index symbol. If 'indexSymbol' is undefined consider it as 'all'
src/index.ts
Outdated
@@ -105,6 +106,9 @@ export class NseIndia { | |||
getEquityCorporateInfo(symbol: string): Promise<EquityCorporateInfo> { | |||
return this.getDataByEndpoint(`/api/quote-equity?symbol=${encodeURIComponent(symbol)}§ion=corp_info`) | |||
} | |||
getEquityCorporateActionsDividend(symbol: string): Promise<EquityCorporateInfo> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the method name as 'getEquityDividend'
}) | ||
return { | ||
gainers: gainers.sort((a, b) => b.pChange - a.pChange), | ||
loosers: losers.sort((a, b) => a.pChange - b.pChange) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 'loosers' instead of 'losers'?
Dividend, All Sector Gainers and Loosers