Documentation
¶
Overview ¶
Package nepse provides a type-safe Go client for NEPSE market data.
Covers market summaries, securities, prices, floor sheets, indices, company fundamentals, dividends, and corporate actions.
Example:
opts := nepse.DefaultOptions()
opts.TLSVerification = false // NEPSE servers have certificate issues
client, err := nepse.NewClient(opts)
if err != nil {
log.Fatal(err)
}
defer client.Close()
summary, err := client.MarketSummary(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("Turnover: Rs. %.2f\n", summary.TotalTurnover)
Index ¶
- Constants
- Variables
- type BoardMember
- type Client
- func (c *Client) BoardOfDirectors(ctx context.Context, securityID int32) ([]BoardMember, error)
- func (c *Client) BoardOfDirectorsBySymbol(ctx context.Context, symbol string) ([]BoardMember, error)
- func (c *Client) Close() error
- func (c *Client) Companies(ctx context.Context) ([]Company, error)
- func (c *Client) Company(ctx context.Context, securityID int32) (*CompanyDetails, error)
- func (c *Client) CompanyBySymbol(ctx context.Context, symbol string) (*CompanyDetails, error)
- func (c *Client) CompanyProfile(ctx context.Context, securityID int32) (*CompanyProfile, error)
- func (c *Client) CompanyProfileBySymbol(ctx context.Context, symbol string) (*CompanyProfile, error)
- func (c *Client) Config() *Config
- func (c *Client) CorporateActions(ctx context.Context, securityID int32) ([]CorporateAction, error)
- func (c *Client) CorporateActionsBySymbol(ctx context.Context, symbol string) ([]CorporateAction, error)
- func (c *Client) DailyBankSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyDevelopmentBankSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyFinanceSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyFloatIndexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyHotelTourismSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyHydroSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyIndexGraph(ctx context.Context, indexType IndexType) (*GraphResponse, error)
- func (c *Client) DailyInvestmentSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyLifeInsuranceSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyManufacturingSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyMicrofinanceSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyMutualfundSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyNepseIndexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyNonLifeInsuranceSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyOthersSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyScripGraph(ctx context.Context, securityID int32) (*GraphResponse, error)
- func (c *Client) DailyScripGraphBySymbol(ctx context.Context, symbol string) (*GraphResponse, error)
- func (c *Client) DailySensitiveFloatIndexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailySensitiveIndexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DailyTradingSubindexGraph(ctx context.Context) (*GraphResponse, error)
- func (c *Client) DebugDecodedToken(ctx context.Context) (string, error)
- func (c *Client) DebugRawPostRequest(ctx context.Context, endpoint string, body any) ([]byte, error)
- func (c *Client) DebugRawRequest(ctx context.Context, endpoint string) ([]byte, error)
- func (c *Client) DebugSecurityDetailRaw(ctx context.Context, securityID int32) ([]byte, error)
- func (c *Client) Dividends(ctx context.Context, securityID int32) ([]Dividend, error)
- func (c *Client) DividendsBySymbol(ctx context.Context, symbol string) ([]Dividend, error)
- func (c *Client) FindSecurity(ctx context.Context, securityID int32) (*Security, error)
- func (c *Client) FindSecurityBySymbol(ctx context.Context, symbol string) (*Security, error)
- func (c *Client) FloorSheet(ctx context.Context) ([]FloorSheetEntry, error)
- func (c *Client) FloorSheetBySymbol(ctx context.Context, symbol string, businessDate string) ([]FloorSheetEntry, error)
- func (c *Client) FloorSheetOf(ctx context.Context, securityID int32, businessDate string) ([]FloorSheetEntry, error)
- func (c *Client) LiveMarket(ctx context.Context) ([]LiveMarketEntry, error)
- func (c *Client) MarketDepth(ctx context.Context, securityID int32) (*MarketDepth, error)
- func (c *Client) MarketDepthBySymbol(ctx context.Context, symbol string) (*MarketDepth, error)
- func (c *Client) MarketStatus(ctx context.Context) (*MarketStatus, error)
- func (c *Client) MarketSummary(ctx context.Context) (*MarketSummary, error)
- func (c *Client) NepseIndex(ctx context.Context) (*NepseIndex, error)
- func (c *Client) PriceHistory(ctx context.Context, securityID int32, startDate, endDate string) ([]PriceHistory, error)
- func (c *Client) PriceHistoryBySymbol(ctx context.Context, symbol string, startDate, endDate string) ([]PriceHistory, error)
- func (c *Client) Reports(ctx context.Context, securityID int32) ([]Report, error)
- func (c *Client) ReportsBySymbol(ctx context.Context, symbol string) ([]Report, error)
- func (c *Client) SectorScrips(ctx context.Context) (SectorScrips, error)
- func (c *Client) Securities(ctx context.Context) ([]Security, error)
- func (c *Client) SecurityDetail(ctx context.Context, securityID int32) (*SecurityDetail, error)
- func (c *Client) SecurityDetailBySymbol(ctx context.Context, symbol string) (*SecurityDetail, error)
- func (c *Client) SubIndices(ctx context.Context) ([]SubIndex, error)
- func (c *Client) SupplyDemand(ctx context.Context) (*SupplyDemandData, error)
- func (c *Client) TodaysPrices(ctx context.Context, businessDate string) ([]TodayPrice, error)
- func (c *Client) Token(ctx context.Context) (*auth.TokenResponse, error)
- func (c *Client) TopGainers(ctx context.Context) ([]TopGainerLoserEntry, error)
- func (c *Client) TopLosers(ctx context.Context) ([]TopGainerLoserEntry, error)
- func (c *Client) TopTenTrade(ctx context.Context) ([]TopTradeEntry, error)
- func (c *Client) TopTenTransaction(ctx context.Context) ([]TopTransactionEntry, error)
- func (c *Client) TopTenTurnover(ctx context.Context) ([]TopTurnoverEntry, error)
- type Company
- type CompanyDetails
- type CompanyDetailsRaw
- type CompanyInfo
- type CompanyNews
- type CompanyProfile
- type Config
- type CorporateAction
- type DepthEntry
- type Dividend
- type DividendNotice
- type Endpoints
- type ErrorType
- type FinancialYear
- type FiscalReport
- type FloorSheetEntry
- type FloorSheetResponse
- type GraphDataPoint
- type GraphResponse
- type IndexType
- type InstrumentType
- type LiveMarketEntry
- type MarketDepth
- type MarketDepthRaw
- type MarketStatus
- type MarketSummary
- type MarketSummaryItem
- type NepseError
- func MapHTTPStatusToError(statusCode int, message string) *NepseError
- func NewInternalError(message string, err error) *NepseError
- func NewInvalidClientRequestError(message string) *NepseError
- func NewInvalidServerResponseError(message string) *NepseError
- func NewNepseError(errorType ErrorType, message string, err error) *NepseError
- func NewNetworkError(err error) *NepseError
- func NewNotFoundError(resource string) *NepseError
- func NewRateLimitError() *NepseError
- func NewTokenExpiredError() *NepseError
- func NewUnauthorizedError(message string) *NepseError
- type NepseIndex
- type NepseIndexRaw
- type Options
- type PaginatedResponse
- type ParsedValue
- type PriceHistory
- type QuarterMaster
- type Report
- type ReportDocument
- type ReportTypeMaster
- type SectorMaster
- type SectorScrips
- type Security
- type SecurityDetail
- type SecurityDetailRaw
- type ShareGroup
- type SubIndex
- type SupplyDemandData
- type SupplyDemandItem
- type TodayPrice
- type TopGainerLoserEntry
- type TopListEntry
- type TopTradeEntry
- type TopTransactionEntry
- type TopTurnoverEntry
Constants ¶
const ( Version = "0.2.0" UserAgent = "go-nepse/" + Version )
const ( DateFormat = "2006-01-02" DateTimeFormat = "2006-01-02 15:04:05" )
Date formats used by NEPSE API.
const ( SectorBanking = "Banking" SectorDevelopmentBank = "Development Bank" SectorFinance = "Finance" SectorHotelTourism = "Hotel Tourism" SectorHydro = "Hydro" SectorInvestment = "Investment" SectorLifeInsurance = "Life Insurance" SectorManufacturing = "Manufacturing" SectorMicrofinance = "Microfinance" SectorMutualFund = "Mutual Fund" SectorNonLifeInsurance = "Non Life Insurance" SectorOthers = "Others" SectorTrading = "Trading" )
Sector names.
const DefaultBaseURL = "https://nepalstock.com.np"
DefaultBaseURL is the production NEPSE API URL.
Variables ¶
var ( ErrInvalidClientRequest = &NepseError{Type: ErrorTypeInvalidClientRequest} ErrInvalidServerResponse = &NepseError{Type: ErrorTypeInvalidServerResponse} ErrTokenExpired = &NepseError{Type: ErrorTypeTokenExpired} ErrNetworkError = &NepseError{Type: ErrorTypeNetworkError} ErrNotFound = &NepseError{Type: ErrorTypeNotFound} ErrRateLimit = &NepseError{Type: ErrorTypeRateLimit} ErrInternal = &NepseError{Type: ErrorTypeInternal} )
Sentinel errors for use with errors.Is. Matching is based on ErrorType, not identity.
Functions ¶
This section is empty.
Types ¶
type BoardMember ¶ added in v0.2.1
type BoardMember struct {
FirstName string `json:"firstName"`
MiddleName string `json:"middleName"`
LastName string `json:"lastName"`
Designation string `json:"designation"`
MemberPhotoPath *string `json:"memberPhotoPath"`
Description string `json:"description"`
}
BoardMember represents a board of directors member.
func (*BoardMember) FullName ¶ added in v0.2.1
func (b *BoardMember) FullName() string
FullName returns the complete name of the board member.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the NEPSE API client. Use NewClient to create one.
func (*Client) BoardOfDirectors ¶ added in v0.2.1
BoardOfDirectors returns the board of directors for a security.
func (*Client) BoardOfDirectorsBySymbol ¶ added in v0.2.1
func (c *Client) BoardOfDirectorsBySymbol(ctx context.Context, symbol string) ([]BoardMember, error)
BoardOfDirectorsBySymbol returns the board of directors for a security by symbol.
func (*Client) Company ¶ added in v0.1.2
Company returns comprehensive information including price data for a security.
func (*Client) CompanyBySymbol ¶ added in v0.1.2
CompanyBySymbol returns comprehensive information for a security by ticker symbol.
func (*Client) CompanyProfile ¶ added in v0.2.1
CompanyProfile returns detailed profile information for a security.
func (*Client) CompanyProfileBySymbol ¶ added in v0.2.1
func (c *Client) CompanyProfileBySymbol(ctx context.Context, symbol string) (*CompanyProfile, error)
CompanyProfileBySymbol returns detailed profile information for a security by symbol.
func (*Client) CorporateActions ¶ added in v0.2.1
CorporateActions returns corporate actions (bonus, rights, dividends) for a security.
func (*Client) CorporateActionsBySymbol ¶ added in v0.2.1
func (c *Client) CorporateActionsBySymbol(ctx context.Context, symbol string) ([]CorporateAction, error)
CorporateActionsBySymbol returns corporate actions for a security by symbol.
func (*Client) DailyBankSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyBankSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyBankSubindexGraph returns intraday graph data for the banking sector sub-index.
func (*Client) DailyDevelopmentBankSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyDevelopmentBankSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyDevelopmentBankSubindexGraph returns intraday graph data for the development bank sector.
func (*Client) DailyFinanceSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyFinanceSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyFinanceSubindexGraph returns intraday graph data for the finance sector.
func (*Client) DailyFloatIndexGraph ¶ added in v0.1.2
func (c *Client) DailyFloatIndexGraph(ctx context.Context) (*GraphResponse, error)
DailyFloatIndexGraph returns intraday graph data for the float index.
func (*Client) DailyHotelTourismSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyHotelTourismSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyHotelTourismSubindexGraph returns intraday graph data for the hotel & tourism sector.
func (*Client) DailyHydroSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyHydroSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyHydroSubindexGraph returns intraday graph data for the hydropower sector.
func (*Client) DailyIndexGraph ¶ added in v0.1.2
DailyIndexGraph returns intraday graph data points for any market index.
func (*Client) DailyInvestmentSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyInvestmentSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyInvestmentSubindexGraph returns intraday graph data for the investment sector.
func (*Client) DailyLifeInsuranceSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyLifeInsuranceSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyLifeInsuranceSubindexGraph returns intraday graph data for the life insurance sector.
func (*Client) DailyManufacturingSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyManufacturingSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyManufacturingSubindexGraph returns intraday graph data for the manufacturing sector.
func (*Client) DailyMicrofinanceSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyMicrofinanceSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyMicrofinanceSubindexGraph returns intraday graph data for the microfinance sector.
func (*Client) DailyMutualfundSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyMutualfundSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyMutualfundSubindexGraph returns intraday graph data for the mutual fund sector.
func (*Client) DailyNepseIndexGraph ¶ added in v0.1.2
func (c *Client) DailyNepseIndexGraph(ctx context.Context) (*GraphResponse, error)
DailyNepseIndexGraph returns intraday graph data for the main NEPSE index.
func (*Client) DailyNonLifeInsuranceSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyNonLifeInsuranceSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyNonLifeInsuranceSubindexGraph returns intraday graph data for the non-life insurance sector.
func (*Client) DailyOthersSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyOthersSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyOthersSubindexGraph returns intraday graph data for the others sector.
func (*Client) DailyScripGraph ¶ added in v0.1.2
DailyScripGraph returns intraday price graph data for a specific security.
func (*Client) DailyScripGraphBySymbol ¶ added in v0.1.2
func (c *Client) DailyScripGraphBySymbol(ctx context.Context, symbol string) (*GraphResponse, error)
DailyScripGraphBySymbol returns intraday price graph data for a security by ticker symbol.
func (*Client) DailySensitiveFloatIndexGraph ¶ added in v0.1.2
func (c *Client) DailySensitiveFloatIndexGraph(ctx context.Context) (*GraphResponse, error)
DailySensitiveFloatIndexGraph returns intraday graph data for the sensitive float index.
func (*Client) DailySensitiveIndexGraph ¶ added in v0.1.2
func (c *Client) DailySensitiveIndexGraph(ctx context.Context) (*GraphResponse, error)
DailySensitiveIndexGraph returns intraday graph data for the sensitive index.
func (*Client) DailyTradingSubindexGraph ¶ added in v0.1.2
func (c *Client) DailyTradingSubindexGraph(ctx context.Context) (*GraphResponse, error)
DailyTradingSubindexGraph returns intraday graph data for the trading sector.
func (*Client) DebugDecodedToken ¶ added in v0.1.2
DebugDecodedToken returns the WASM-decoded access token for debugging. This is the token that would be sent in Authorization headers.
func (*Client) DebugRawPostRequest ¶ added in v0.1.2
func (c *Client) DebugRawPostRequest(ctx context.Context, endpoint string, body any) ([]byte, error)
DebugRawPostRequest makes an authenticated POST request and returns the raw response. This is for debugging API responses.
func (*Client) DebugRawRequest ¶
DebugRawRequest makes an authenticated request and returns the raw response. This is for debugging API responses.
func (*Client) DebugSecurityDetailRaw ¶ added in v0.2.4
DebugSecurityDetailRaw returns the raw JSON response from the security detail endpoint. This is useful for debugging the API response structure.
func (*Client) DividendsBySymbol ¶ added in v0.2.1
DividendsBySymbol returns dividend history for a security by symbol.
func (*Client) FindSecurity ¶
FindSecurity returns the security with the given ID.
func (*Client) FindSecurityBySymbol ¶
FindSecurityBySymbol returns the security with the given ticker symbol.
func (*Client) FloorSheet ¶ added in v0.1.2
func (c *Client) FloorSheet(ctx context.Context) ([]FloorSheetEntry, error)
FloorSheet returns all trades executed on the exchange for the current trading day. Handles both array and paginated response formats. Note: Returns empty slice if no trades have occurred yet.
func (*Client) FloorSheetBySymbol ¶ added in v0.1.2
func (c *Client) FloorSheetBySymbol(ctx context.Context, symbol string, businessDate string) ([]FloorSheetEntry, error)
FloorSheetBySymbol returns all trades for a specific security by symbol on a given date.
HACK: As of December 2025, NEPSE has blocked this endpoint at the server level. All requests return 403 Forbidden. Use Client.FloorSheet instead for general floorsheet data.
func (*Client) FloorSheetOf ¶ added in v0.1.2
func (c *Client) FloorSheetOf(ctx context.Context, securityID int32, businessDate string) ([]FloorSheetEntry, error)
FloorSheetOf returns all trades for a specific security on a given business date.
IMPORTANT: As of December 2025, NEPSE has blocked this endpoint at the server level. All requests return 403 Forbidden. Use Client.FloorSheet instead for general floorsheet data.
func (*Client) LiveMarket ¶ added in v0.1.2
func (c *Client) LiveMarket(ctx context.Context) ([]LiveMarketEntry, error)
LiveMarket returns real-time price and volume data for all actively traded securities.
func (*Client) MarketDepth ¶ added in v0.1.2
MarketDepth returns the order book (bid/ask levels) for a security.
func (*Client) MarketDepthBySymbol ¶ added in v0.1.2
MarketDepthBySymbol returns the order book for a security by ticker symbol.
func (*Client) MarketStatus ¶ added in v0.1.2
func (c *Client) MarketStatus(ctx context.Context) (*MarketStatus, error)
MarketStatus returns whether the market is currently open or closed.
func (*Client) MarketSummary ¶ added in v0.1.2
func (c *Client) MarketSummary(ctx context.Context) (*MarketSummary, error)
MarketSummary returns aggregate market statistics including turnover, volume, and capitalization.
func (*Client) NepseIndex ¶ added in v0.1.2
func (c *Client) NepseIndex(ctx context.Context) (*NepseIndex, error)
NepseIndex returns the main NEPSE index with current value, change, and 52-week range.
func (*Client) PriceHistory ¶ added in v0.1.2
func (c *Client) PriceHistory(ctx context.Context, securityID int32, startDate, endDate string) ([]PriceHistory, error)
PriceHistory returns historical OHLCV data for a security within a date range.
func (*Client) PriceHistoryBySymbol ¶ added in v0.1.2
func (c *Client) PriceHistoryBySymbol(ctx context.Context, symbol string, startDate, endDate string) ([]PriceHistory, error)
PriceHistoryBySymbol returns historical OHLCV data for a security by symbol.
func (*Client) Reports ¶ added in v0.2.1
Reports returns quarterly and annual reports for a security.
func (*Client) ReportsBySymbol ¶ added in v0.2.1
ReportsBySymbol returns quarterly and annual reports for a security by symbol.
func (*Client) SectorScrips ¶ added in v0.1.2
func (c *Client) SectorScrips(ctx context.Context) (SectorScrips, error)
SectorScrips returns a map of sector names to their constituent security symbols.
func (*Client) Securities ¶ added in v0.1.2
Securities returns all tradable securities on the exchange.
func (*Client) SecurityDetail ¶ added in v0.2.4
SecurityDetail returns comprehensive security information including shareholding data. This uses a POST request to fetch additional data not available via Client.Company.
func (*Client) SecurityDetailBySymbol ¶ added in v0.2.4
func (c *Client) SecurityDetailBySymbol(ctx context.Context, symbol string) (*SecurityDetail, error)
SecurityDetailBySymbol returns comprehensive security information by ticker symbol.
func (*Client) SubIndices ¶ added in v0.1.2
SubIndices returns other main indices (Sensitive, Float, Sensitive Float) excluding the main NEPSE index. Note: Sector sub-indices are only available through graph endpoints.
func (*Client) SupplyDemand ¶ added in v0.1.2
func (c *Client) SupplyDemand(ctx context.Context) (*SupplyDemandData, error)
SupplyDemand returns aggregate supply and demand data.
func (*Client) TodaysPrices ¶ added in v0.1.2
TodaysPrices returns price data for all securities on a given business date. If businessDate is empty, returns data for the current trading day.
Note: This endpoint may return empty results. NEPSE's web interface uses a POST request that requires additional authentication not currently supported by this library. For current prices, consider using Client.TopGainers, Client.TopLosers, or Client.Company which return LTP (last traded price) data.
func (*Client) TopGainers ¶ added in v0.1.2
func (c *Client) TopGainers(ctx context.Context) ([]TopGainerLoserEntry, error)
TopGainers returns securities with the highest percentage gains for the trading day.
func (*Client) TopLosers ¶ added in v0.1.2
func (c *Client) TopLosers(ctx context.Context) ([]TopGainerLoserEntry, error)
TopLosers returns securities with the highest percentage losses for the trading day.
func (*Client) TopTenTrade ¶ added in v0.1.2
func (c *Client) TopTenTrade(ctx context.Context) ([]TopTradeEntry, error)
TopTenTrade returns the ten securities with the highest traded share volume.
func (*Client) TopTenTransaction ¶ added in v0.1.2
func (c *Client) TopTenTransaction(ctx context.Context) ([]TopTransactionEntry, error)
TopTenTransaction returns the ten securities with the most transactions.
func (*Client) TopTenTurnover ¶ added in v0.1.2
func (c *Client) TopTenTurnover(ctx context.Context) ([]TopTurnoverEntry, error)
TopTenTurnover returns the ten securities with the highest trading turnover (value).
type Company ¶
type Company struct {
ID int32 `json:"id"`
CompanyName string `json:"companyName"`
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
Status string `json:"status"`
CompanyEmail string `json:"companyEmail"`
Website string `json:"website"`
SectorName string `json:"sectorName"`
RegulatoryBody string `json:"regulatoryBody"`
InstrumentType string `json:"instrumentType"`
}
Company represents company information.
type CompanyDetails ¶
type CompanyDetails struct {
ID int32 `json:"id"`
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
SectorName string `json:"sectorName"`
Email string `json:"email"`
ActiveStatus string `json:"activeStatus"`
PermittedToTrade string `json:"permittedToTrade"`
OpenPrice float64 `json:"openPrice"`
HighPrice float64 `json:"highPrice"`
LowPrice float64 `json:"lowPrice"`
ClosePrice float64 `json:"closePrice"`
LastTradedPrice float64 `json:"lastTradedPrice"`
PreviousClose float64 `json:"previousClose"`
TotalTradeQuantity int64 `json:"totalTradeQuantity"`
TotalTrades int32 `json:"totalTrades"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
BusinessDate string `json:"businessDate"`
LastUpdatedDateTime string `json:"lastUpdatedDateTime"`
}
CompanyDetails represents processed company information.
type CompanyDetailsRaw ¶
type CompanyDetailsRaw struct {
SecurityMcsData struct {
SecurityID string `json:"securityId"`
OpenPrice float64 `json:"openPrice"`
HighPrice float64 `json:"highPrice"`
LowPrice float64 `json:"lowPrice"`
TotalTradeQuantity int64 `json:"totalTradeQuantity"`
TotalTrades int32 `json:"totalTrades"`
LastTradedPrice float64 `json:"lastTradedPrice"`
PreviousClose float64 `json:"previousClose"`
BusinessDate string `json:"businessDate"`
ClosePrice float64 `json:"closePrice"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
LastUpdatedDateTime string `json:"lastUpdatedDateTime"`
} `json:"securityMcsData"`
SecurityData struct {
ID int32 `json:"id"`
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
ActiveStatus string `json:"activeStatus"`
PermittedToTrade string `json:"permittedToTrade"`
Email string `json:"email"`
Sector string `json:"sector"`
} `json:"securityData"`
}
CompanyDetailsRaw represents the raw nested company details response.
type CompanyInfo ¶ added in v0.2.2
type CompanyInfo struct {
ID int32 `json:"id"`
CompanyShortName string `json:"companyShortName"`
CompanyName string `json:"companyName"`
Email string `json:"email"`
CompanyWebsite string `json:"companyWebsite"`
CompanyContactPerson string `json:"companyContactPerson"`
SectorMaster SectorMaster `json:"sectorMaster"`
CompanyRegistrationNumber string `json:"companyRegistrationNumber"`
ActiveStatus string `json:"activeStatus"`
}
CompanyInfo represents company information within classification.
type CompanyNews ¶ added in v0.2.1
type CompanyNews struct {
ID int32 `json:"id"`
NewsSource string `json:"newsSource"`
NewsHeadline string `json:"newsHeadline"`
NewsBody string `json:"newsBody"`
NewsType string `json:"newsType"`
ExpiryDate string `json:"expiryDate"`
DividendsNotice *DividendNotice `json:"dividendsNotice"`
}
CompanyNews contains news/announcement details.
type CompanyProfile ¶ added in v0.2.1
type CompanyProfile struct {
CompanyName string `json:"companyName"`
CompanyEmail string `json:"companyEmail"`
CompanyProfile string `json:"companyProfile"`
CompanyContactPerson string `json:"companyContactPerson"`
LogoFilePath string `json:"logoFilePath"`
AddressType string `json:"addressType"`
AddressField string `json:"addressField"`
PhoneNumber string `json:"phoneNumber"`
Fax string `json:"fax"`
Town string `json:"town"`
}
CompanyProfile represents detailed company profile information.
type Config ¶
Config holds configuration for the NEPSE API client.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default NEPSE API configuration.
type CorporateAction ¶ added in v0.2.1
type CorporateAction struct {
ActiveStatus string `json:"activeStatus"`
AuthorizationComments *string `json:"authorizationComments"`
SubmittedDate string `json:"submittedDate"`
FilePath string `json:"filePath"`
DocumentID int32 `json:"documentId"`
RatioNum float64 `json:"ratioNum"`
RatioDen float64 `json:"ratioDen"`
CashDividend *float64 `json:"cashDividend"`
FiscalYear string `json:"fiscalYear"`
BonusPercentage float64 `json:"bonusPercentage"`
RightPercentage *float64 `json:"rightPercentage"`
SdID int32 `json:"sdId"`
}
CorporateAction represents a corporate action (bonus, rights, cash dividend).
func (*CorporateAction) IsBonus ¶ added in v0.2.1
func (c *CorporateAction) IsBonus() bool
IsBonus returns true if this corporate action is a bonus share.
func (*CorporateAction) IsCashDividend ¶ added in v0.2.1
func (c *CorporateAction) IsCashDividend() bool
IsCashDividend returns true if this corporate action is a cash dividend.
func (*CorporateAction) IsRight ¶ added in v0.2.1
func (c *CorporateAction) IsRight() bool
IsRight returns true if this corporate action is a rights issue.
type DepthEntry ¶
type DepthEntry struct {
StockID int32 `json:"stockId"`
Price float64 `json:"orderBookOrderPrice"`
Quantity int64 `json:"quantity"`
Orders int32 `json:"orderCount"`
IsBuy int `json:"isBuy"`
}
DepthEntry represents a single entry in market depth.
type Dividend ¶ added in v0.2.1
type Dividend struct {
ID int32 `json:"id"`
ActiveStatus string `json:"activeStatus"`
ModifiedDate string `json:"modifiedDate"`
ApplicationType int32 `json:"applicationType"`
ApplicationStatus int32 `json:"applicationStatus"`
CompanyNews *CompanyNews `json:"companyNews"`
}
Dividend represents a dividend declaration.
func (*Dividend) BonusPercentage ¶ added in v0.2.1
BonusPercentage returns the bonus dividend percentage.
func (*Dividend) CashPercentage ¶ added in v0.2.1
CashPercentage returns the cash dividend percentage.
func (*Dividend) FiscalYear ¶ added in v0.2.1
FiscalYear returns the fiscal year of the dividend.
func (*Dividend) HasBonusDividend ¶ added in v0.2.1
HasBonusDividend returns true if this dividend includes bonus shares.
func (*Dividend) HasCashDividend ¶ added in v0.2.1
HasCashDividend returns true if this dividend includes cash.
type DividendNotice ¶ added in v0.2.1
type DividendNotice struct {
ID int32 `json:"id"`
FinancialYear *FinancialYear `json:"financialYear"`
CashDividend float64 `json:"cashDividend"`
Remarks *string `json:"remarks"`
}
DividendNotice contains dividend declaration details.
type Endpoints ¶
type Endpoints struct {
// Market data
MarketSummary string
MarketOpen string
LiveMarket string
SupplyDemand string
TodaysPrice string
FloorSheet string
// Index data
NepseIndex string
// Top ten lists
TopGainers string
TopLosers string
TopTrade string
TopTransaction string
TopTurnover string
// Security/Company data
SecurityList string
CompanyList string
CompanyDetails string
CompanyPriceHistory string
CompanyFloorsheet string
MarketDepth string
// Company fundamentals & financial data
CompanyProfile string
BoardOfDirectors string
CorporateActions string
Reports string
Dividend string
// Graph endpoints (index charts)
GraphNepseIndex string
GraphSensitiveIndex string
GraphFloatIndex string
GraphSensitiveFloatIndex string
GraphBankingSubindex string
GraphDevBankSubindex string
GraphFinanceSubindex string
GraphHotelSubindex string
GraphHydroSubindex string
GraphInvestmentSubindex string
GraphLifeInsSubindex string
GraphManufacturingSubindex string
GraphMicrofinanceSubindex string
GraphMutualFundSubindex string
GraphNonLifeInsSubindex string
GraphOthersSubindex string
GraphTradingSubindex string
// Graph endpoints (company)
CompanyDailyGraph string
}
Endpoints holds all NEPSE API endpoint paths.
func DefaultEndpoints ¶
func DefaultEndpoints() Endpoints
DefaultEndpoints returns the default NEPSE API endpoints.
type ErrorType ¶
type ErrorType string
ErrorType categorizes NEPSE errors for programmatic handling.
const ( ErrorTypeInvalidClientRequest ErrorType = "invalid_client_request" ErrorTypeInvalidServerResponse ErrorType = "invalid_server_response" ErrorTypeTokenExpired ErrorType = "token_expired" ErrorTypeNetworkError ErrorType = "network_error" ErrorTypeNotFound ErrorType = "not_found" ErrorTypeRateLimit ErrorType = "rate_limit" ErrorTypeInternal ErrorType = "internal_error" )
type FinancialYear ¶ added in v0.2.1
type FinancialYear struct {
ID int32 `json:"id"`
FYName string `json:"fyName"`
FYNameNepali string `json:"fyNameNepali"`
FromYear string `json:"fromYear"`
ToYear string `json:"toYear"`
}
FinancialYear represents a fiscal year.
type FiscalReport ¶ added in v0.2.1
type FiscalReport struct {
ID int32 `json:"id"`
QuarterMaster *QuarterMaster `json:"quarterMaster"`
ReportTypeMaster *ReportTypeMaster `json:"reportTypeMaster"`
FinancialYear *FinancialYear `json:"financialYear"`
PEValue float64 `json:"peValue"`
EPSValue float64 `json:"epsValue"`
PaidUpCapital float64 `json:"paidUpCapital"`
ProfitAmount float64 `json:"profitAmount"`
Remarks *string `json:"remarks"`
}
FiscalReport contains financial metrics from a report.
type FloorSheetEntry ¶
type FloorSheetEntry struct {
ContractID int64 `json:"contractId"`
StockSymbol string `json:"stockSymbol"`
SecurityName string `json:"securityName"`
BuyerMemberID int32 `json:"buyerMemberId"`
SellerMemberID int32 `json:"sellerMemberId"`
ContractQuantity int64 `json:"contractQuantity"`
ContractRate float64 `json:"contractRate"`
BusinessDate string `json:"businessDate"`
TradeTime string `json:"tradeTime"`
SecurityID int32 `json:"securityId"`
ContractAmount float64 `json:"contractAmount"`
BuyerBrokerName string `json:"buyerBrokerName"`
SellerBrokerName string `json:"sellerBrokerName"`
TradeBookID int64 `json:"tradeBookId"`
}
FloorSheetEntry represents a single floor sheet entry.
type FloorSheetResponse ¶
type FloorSheetResponse struct {
FloorSheets struct {
Content []FloorSheetEntry `json:"content"`
PageNumber int32 `json:"number"`
Size int32 `json:"size"`
TotalElements int64 `json:"totalElements"`
TotalPages int32 `json:"totalPages"`
First bool `json:"first"`
Last bool `json:"last"`
NumberOfElements int32 `json:"numberOfElements"`
} `json:"floorsheets"`
}
FloorSheetResponse represents the paginated floor sheet response.
type GraphDataPoint ¶
GraphDataPoint represents a single data point in graph data. The NEPSE API returns different formats for different endpoints: - Index graphs: [timestamp, value] arrays - Scrip graphs: {"time": timestamp, "value": value} objects
func (*GraphDataPoint) UnmarshalJSON ¶ added in v0.1.2
func (g *GraphDataPoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshaling for GraphDataPoint. Handles both array format [timestamp, value] and object format {"time": ..., "value": ...}.
type GraphResponse ¶
type GraphResponse struct {
Data []GraphDataPoint
}
GraphResponse represents graph data response.
type IndexType ¶
type IndexType int
IndexType represents the type of market index for graph data retrieval.
type InstrumentType ¶ added in v0.2.2
type InstrumentType struct {
ID int32 `json:"id"`
Code string `json:"code"`
Description string `json:"description"`
ActiveStatus string `json:"activeStatus"`
}
InstrumentType represents the type of financial instrument.
type LiveMarketEntry ¶
type LiveMarketEntry struct {
SecurityID string `json:"securityId"`
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
OpenPrice float64 `json:"openPrice"`
HighPrice float64 `json:"highPrice"`
LowPrice float64 `json:"lowPrice"`
LastTradedPrice float64 `json:"lastTradedPrice"`
TotalTradeQuantity int64 `json:"totalTradeQuantity"`
TotalTradeValue float64 `json:"totalTradeValue"`
PreviousClose float64 `json:"previousClose"`
PercentageChange float64 `json:"percentageChange"`
LastTradedVolume int64 `json:"lastTradedVolume"`
LastUpdatedDateTime string `json:"lastUpdatedDateTime"`
AverageTradedPrice float64 `json:"averageTradedPrice"`
}
LiveMarketEntry represents live market data entry.
type MarketDepth ¶
type MarketDepth struct {
TotalBuyQty int64
TotalSellQty int64
BuyDepth []DepthEntry
SellDepth []DepthEntry
}
MarketDepth represents processed market depth information.
type MarketDepthRaw ¶
type MarketDepthRaw struct {
TotalBuyQty int64 `json:"totalBuyQty"`
TotalSellQty int64 `json:"totalSellQty"`
MarketDepth struct {
BuyList []DepthEntry `json:"buyMarketDepthList"`
SellList []DepthEntry `json:"sellMarketDepthList"`
} `json:"marketDepth"`
}
MarketDepthRaw represents the raw API response for market depth.
type MarketStatus ¶
type MarketStatus struct {
IsOpen string `json:"isOpen"`
AsOf string `json:"asOf"`
ID int32 `json:"id"`
}
MarketStatus represents the current market status.
func (*MarketStatus) IsMarketOpen ¶
func (m *MarketStatus) IsMarketOpen() bool
IsMarketOpen returns true if the market is currently open.
type MarketSummary ¶
type MarketSummary struct {
TotalTurnover float64
TotalTransactions float64
TotalScripsTraded float64
TotalMarketCapitalization float64
TotalFloatMarketCap float64
}
MarketSummary represents the processed market summary data.
type MarketSummaryItem ¶
MarketSummaryItem represents a single item in the market summary response.
type NepseError ¶
type NepseError struct {
Type ErrorType // Category of error
Message string // Human-readable description
Err error // Underlying error, if any
}
NepseError is the error type returned by all NEPSE API operations. Use errors.Is with sentinel errors (e.g., ErrNotFound) to check error categories, or errors.As to extract the full error details.
func MapHTTPStatusToError ¶
func MapHTTPStatusToError(statusCode int, message string) *NepseError
MapHTTPStatusToError converts an HTTP status code to the appropriate NepseError.
func NewInternalError ¶
func NewInternalError(message string, err error) *NepseError
NewInternalError wraps unexpected internal failures.
func NewInvalidClientRequestError ¶
func NewInvalidClientRequestError(message string) *NepseError
NewInvalidClientRequestError returns an error for malformed requests (HTTP 400).
func NewInvalidServerResponseError ¶
func NewInvalidServerResponseError(message string) *NepseError
NewInvalidServerResponseError returns an error for unexpected server responses (5xx).
func NewNepseError ¶
func NewNepseError(errorType ErrorType, message string, err error) *NepseError
NewNepseError constructs an error with the given type, message, and optional wrapped error.
func NewNetworkError ¶
func NewNetworkError(err error) *NepseError
NewNetworkError wraps a low-level network failure (DNS, connection, timeout).
func NewNotFoundError ¶
func NewNotFoundError(resource string) *NepseError
NewNotFoundError returns an error for missing resources (HTTP 404). If resource is empty, a generic message is used.
func NewRateLimitError ¶
func NewRateLimitError() *NepseError
NewRateLimitError returns an error when API rate limits are exceeded (HTTP 429).
func NewTokenExpiredError ¶
func NewTokenExpiredError() *NepseError
NewTokenExpiredError returns an error indicating the access token has expired.
func NewUnauthorizedError ¶
func NewUnauthorizedError(message string) *NepseError
NewUnauthorizedError returns an error for forbidden access (HTTP 403). If message is empty, a default message is used.
func (*NepseError) Error ¶
func (e *NepseError) Error() string
Error implements the error interface.
func (*NepseError) Is ¶
func (e *NepseError) Is(target error) bool
Is reports whether e matches target by comparing ErrorType fields.
func (*NepseError) IsRetryable ¶
func (e *NepseError) IsRetryable() bool
IsRetryable reports whether the operation that caused this error may succeed on retry. Token expiration, network errors, server errors, and rate limits are considered retryable.
func (*NepseError) Unwrap ¶
func (e *NepseError) Unwrap() error
Unwrap returns the underlying error.
type NepseIndex ¶
type NepseIndex struct {
IndexValue float64 `json:"close"`
PercentChange float64 `json:"perChange"`
PointChange float64 `json:"change"`
High float64 `json:"high"`
Low float64 `json:"low"`
PreviousClose float64 `json:"previousClose"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
CurrentValue float64 `json:"currentValue"`
GeneratedTime string `json:"generatedTime"`
}
NepseIndex represents the NEPSE main index (ID 58).
type NepseIndexRaw ¶
type NepseIndexRaw struct {
ID int32 `json:"id"`
Index string `json:"index"`
Close float64 `json:"close"`
High float64 `json:"high"`
Low float64 `json:"low"`
PreviousClose float64 `json:"previousClose"`
Change float64 `json:"change"`
PerChange float64 `json:"perChange"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
CurrentValue float64 `json:"currentValue"`
GeneratedTime string `json:"generatedTime"`
}
NepseIndexRaw represents the raw NEPSE index response item.
type Options ¶
type Options struct {
BaseURL string // Override default API URL (useful for testing/proxying)
TLSVerification bool // Set false only for development; NEPSE uses self-signed certs
HTTPTimeout time.Duration // Per-request timeout
MaxRetries int // Retry count for transient failures (5xx, rate limits)
RetryDelay time.Duration // Base delay; actual delay uses exponential backoff
Config *Config // API endpoint paths and headers
HTTPClient *http.Client // Bring your own client; nil uses sensible defaults
}
Options configures the NEPSE client.
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns sensible defaults for the NEPSE client.
type PaginatedResponse ¶
type PaginatedResponse[T any] struct { Content []T `json:"content"` PageNumber int32 `json:"number"` Size int32 `json:"size"` TotalElements int64 `json:"totalElements"` TotalPages int32 `json:"totalPages"` First bool `json:"first"` Last bool `json:"last"` NumberOfElements int32 `json:"numberOfElements"` }
PaginatedResponse represents a generic paginated response.
type ParsedValue ¶ added in v0.2.2
ParsedValue represents a value with its source string and parsed numeric value.
type PriceHistory ¶
type PriceHistory struct {
BusinessDate string `json:"businessDate"`
HighPrice float64 `json:"highPrice"`
LowPrice float64 `json:"lowPrice"`
ClosePrice float64 `json:"closePrice"`
TotalTradedQuantity int64 `json:"totalTradedQuantity"`
TotalTradedValue float64 `json:"totalTradedValue"`
TotalTrades int32 `json:"totalTrades"`
}
PriceHistory represents historical OHLCV data for a security. Note: NEPSE API does not provide open price in historical data.
type QuarterMaster ¶ added in v0.2.1
QuarterMaster represents a fiscal quarter.
type Report ¶ added in v0.2.1
type Report struct {
ID int32 `json:"id"`
ActiveStatus string `json:"activeStatus"`
ModifiedDate string `json:"modifiedDate"`
ApplicationType int32 `json:"applicationType"`
ApplicationStatus int32 `json:"applicationStatus"`
FiscalReport *FiscalReport `json:"fiscalReport"`
ApplicationDocumentDetailsList []ReportDocument `json:"applicationDocumentDetailsList"`
}
Report represents a quarterly or annual financial report.
func (*Report) IsQuarterly ¶ added in v0.2.1
IsQuarterly returns true if this is a quarterly report.
func (*Report) QuarterName ¶ added in v0.2.1
QuarterName returns the quarter name (e.g., "First Quarter") or empty if annual.
type ReportDocument ¶ added in v0.2.1
type ReportDocument struct {
ID int32 `json:"id"`
SubmittedDate string `json:"submittedDate"`
FilePath string `json:"filePath"`
EncryptedID string `json:"encryptedId"`
}
ReportDocument represents a document attached to a report.
type ReportTypeMaster ¶ added in v0.2.1
ReportTypeMaster represents a report type (Annual/Quarterly).
type SectorMaster ¶ added in v0.2.2
type SectorMaster struct {
ID int32 `json:"id"`
SectorDescription string `json:"sectorDescription"`
ActiveStatus string `json:"activeStatus"`
RegulatoryBody string `json:"regulatoryBody"`
}
SectorMaster represents sector information.
type SectorScrips ¶
SectorScrips represents scrips grouped by sector.
type Security ¶
type Security struct {
ID int32 `json:"id"`
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
ActiveStatus string `json:"activeStatus"`
}
Security represents a listed security/company. Note: The security list API only returns id, symbol, securityName, and activeStatus. For sector info, use GetCompanyList() instead.
type SecurityDetail ¶ added in v0.2.4
type SecurityDetail struct {
// Basic info
ID int32 `json:"id"`
Symbol string `json:"symbol"`
ISIN string `json:"isin"`
PermittedToTrade string `json:"permittedToTrade"`
FaceValue float64 `json:"faceValue"` // Typically 100 or 10
// Shareholding data
PaidUpCapital float64 `json:"paidUpCapital"`
IssuedCapital float64 `json:"issuedCapital"`
MarketCap float64 `json:"marketCap"`
PublicPercent float64 `json:"publicPercent"`
PromoterPercent float64 `json:"promoterPercent"`
// Price data
OpenPrice float64 `json:"openPrice"`
HighPrice float64 `json:"highPrice"`
LowPrice float64 `json:"lowPrice"`
ClosePrice float64 `json:"closePrice"`
LastTradedPrice float64 `json:"lastTradedPrice"`
PreviousClose float64 `json:"previousClose"`
TotalTradedQuantity int64 `json:"totalTradedQuantity"`
TotalTrades int32 `json:"totalTrades"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
BusinessDate string `json:"businessDate"`
LastUpdatedDateTime string `json:"lastUpdatedDateTime"`
}
SecurityDetail represents comprehensive security information including shareholding. Use Client.SecurityDetail to fetch this data via POST request.
type SecurityDetailRaw ¶ added in v0.2.4
type SecurityDetailRaw struct {
Security struct {
ID int32 `json:"id"`
Symbol string `json:"symbol"`
Isin string `json:"isin"`
PermittedToTrade string `json:"permittedToTrade"`
FaceValue float64 `json:"faceValue"`
} `json:"security"`
SecurityDailyTradeDTO struct {
SecurityID string `json:"securityId"`
OpenPrice float64 `json:"openPrice"`
HighPrice float64 `json:"highPrice"`
LowPrice float64 `json:"lowPrice"`
ClosePrice float64 `json:"closePrice"`
TotalTradeQuantity int64 `json:"totalTradeQuantity"`
TotalTrades int32 `json:"totalTrades"`
LastTradedPrice float64 `json:"lastTradedPrice"`
PreviousClose float64 `json:"previousClose"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
LastUpdatedDateTime string `json:"lastUpdatedDateTime"`
BusinessDate string `json:"businessDate"`
} `json:"securityDailyTradeDto"`
// Shareholding data at root level
PaidUpCapital float64 `json:"paidUpCapital"`
IssuedCapital float64 `json:"issuedCapital"`
MarketCapitalization float64 `json:"marketCapitalization"`
PublicPercentage float64 `json:"publicPercentage"`
PromoterPercentage float64 `json:"promoterPercentage"`
}
SecurityDetailRaw represents the raw response from POST /api/nots/security/{id}. This endpoint returns additional shareholding data not available via GET.
type ShareGroup ¶ added in v0.2.2
type ShareGroup struct {
}
ShareGroup represents the share group classification.
type SubIndex ¶
type SubIndex struct {
ID int32 `json:"id"`
Index string `json:"index"`
Close float64 `json:"close"`
High float64 `json:"high"`
Low float64 `json:"low"`
PreviousClose float64 `json:"previousClose"`
Change float64 `json:"change"`
PerChange float64 `json:"perChange"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
CurrentValue float64 `json:"currentValue"`
GeneratedTime string `json:"generatedTime"`
}
SubIndex represents a sector sub-index.
type SupplyDemandData ¶
type SupplyDemandData struct {
SupplyList []SupplyDemandItem `json:"supplyList"`
DemandList []SupplyDemandItem `json:"demandList"`
}
SupplyDemandData represents the combined supply and demand response.
type SupplyDemandItem ¶
type SupplyDemandItem struct {
SecurityID int32 `json:"securityId"`
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
TotalQuantity int64 `json:"totalQuantity"`
TotalOrder int32 `json:"totalOrder"`
}
SupplyDemandItem represents a single item in supply or demand list.
type TodayPrice ¶
type TodayPrice struct {
ID int32 `json:"id"`
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
OpenPrice float64 `json:"openPrice"`
HighPrice float64 `json:"highPrice"`
LowPrice float64 `json:"lowPrice"`
ClosePrice float64 `json:"closePrice"`
TotalTradedQuantity int64 `json:"totalTradedQuantity"`
TotalTradedValue float64 `json:"totalTradedValue"`
PreviousClose float64 `json:"previousClose"`
DifferenceRs float64 `json:"differenceRs"`
PercentageChange float64 `json:"percentageChange"`
TotalTrades int32 `json:"totalTrades"`
BusinessDate string `json:"businessDate"`
SecurityID int32 `json:"securityId"`
LastTradedPrice float64 `json:"lastTradedPrice"`
MaxPrice float64 `json:"maxPrice"`
MinPrice float64 `json:"minPrice"`
}
TodayPrice represents today's price data for a security.
type TopGainerLoserEntry ¶
type TopGainerLoserEntry struct {
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
SecurityID int32 `json:"securityId"`
LTP float64 `json:"ltp"`
PointChange float64 `json:"pointChange"`
PercentageChange float64 `json:"percentageChange"`
}
TopGainerLoserEntry represents entries in top gainers/losers lists.
type TopListEntry ¶
type TopListEntry struct {
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
ClosePrice float64 `json:"closePrice"`
PercentageChange float64 `json:"percentageChange"`
DifferenceRs float64 `json:"differenceRs"`
TotalTradedQuantity int64 `json:"totalTradedQuantity"`
TotalTradedValue float64 `json:"totalTradedValue"`
TotalTrades int32 `json:"totalTrades"`
HighPrice float64 `json:"highPrice,omitempty"`
LowPrice float64 `json:"lowPrice,omitempty"`
OpenPrice float64 `json:"openPrice,omitempty"`
PreviousClose float64 `json:"previousClose,omitempty"`
}
TopListEntry is deprecated, use specific types instead. Kept for backward compatibility.
type TopTradeEntry ¶
type TopTradeEntry struct {
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
SecurityID int32 `json:"securityId"`
ClosingPrice float64 `json:"closingPrice"`
}
TopTradeEntry represents entries in top trade (volume) list.
type TopTransactionEntry ¶
type TopTransactionEntry struct {
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
SecurityID int32 `json:"securityId"`
TotalTrades int32 `json:"totalTrades"`
LastTradedPrice float64 `json:"lastTradedPrice"`
}
TopTransactionEntry represents entries in top transaction list.
type TopTurnoverEntry ¶
type TopTurnoverEntry struct {
Symbol string `json:"symbol"`
SecurityName string `json:"securityName"`
SecurityID int32 `json:"securityId"`
Turnover float64 `json:"turnover"`
ClosingPrice float64 `json:"closingPrice"`
}
TopTurnoverEntry represents entries in top turnover list.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
_examples
|
|
|
basic
command
|
|
|
debug
command
|
|
|
explore
command
|
|
|
server
command
|
|
|
internal
|
|
|
auth
Package auth handles NEPSE API authentication using embedded WASM to decode obfuscated tokens returned by the NEPSE API.
|
Package auth handles NEPSE API authentication using embedded WASM to decode obfuscated tokens returned by the NEPSE API. |
