govortex

package module
v2.0.5-dev.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 20 Imported by: 0

README

Go Reference

Vortex API Golang Client

Official golang client for communicating with Vortex API

Vortex APIs are meant for clients who want to execute orders based on their own strategy programatically and for partners to build their own applications. These apis provide a fast and secure way to place trades, manage positions and access real time market data.

Documentation

Installation

    go get github.com/RupeezyTech/govortex/v2

Getting Started with APIs

package main

import (
	"context"

	govortex "github.com/RupeezyTech/govortex/v2"
)

const (
	applicationId string = "testApplicationId"
	apiKey        string = "testApiKey"
)

func main() {
	var client govortex.VortexApi
	govortex.InitializeVortexApi(applicationId, apiKey, &client)
	ctx := context.Background()

	// Open this URL in the browser to login. The page will redirect to the callback URL configured on the API Portal.
	// The callback URL will contain the auth_token as a query parameter.
	url := client.GetLoginUrl()
	fmt.Printf("URL for login: %s\n", url)

	auth_token := "your_auth_token_here" // Replace with the auth_token received after login

	_, err := client.ExchangeToken(ctx, auth_token)
	if err != nil {
		fmt.Println("Error exchanging token:", err)
		return
	}
	fmt.Println("Access Token:", client.AccessToken)
	// Access token is automatically set upon successful login call

	client.Orders(ctx, 1, 20) //orders need an offset and limit
	client.Positions(ctx)     //positions need an offset and limit

	client.PlaceOrder(ctx, govortex.PlaceOrderRequest{
		Exchange:          govortex.ExchangeTypesNSEEQUITY,
		Token:             22,
		TransactionType:   govortex.TransactionTypesBUY,
		Product:           govortex.ProductTypesDelivery,
		Variety:           govortex.VarietyTypesRegularMarketOrder,
		Quantity:          1,
		Price:             1800,
		TriggerPrice:      0,
		DisclosedQuantity: 0,
		Validity:          govortex.ValidityTypesFullDay,
		ValidityDays:      1,
		IsAMO:             false,
	})

	client.Funds(ctx)

}

Getting started with Feed

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"time"

	"github.com/RupeezyTech/govortex/v2"
)

var wire *govortex.Wire

const (
	applicationId string = "testApplicationId"
	apiKey        string = "testApiKey"
)

func main() {
	var client govortex.VortexApi
	govortex.InitializeVortexApi(applicationId, apiKey, &client)
	ctx := context.Background()
	client.Login(ctx, "clientCode", "password", "totp")
	accessToken := client.AccessToken

	// Initialize the wire client
	wire = &govortex.Wire{}
	govortex.InitializeWire(accessToken, wire)

	// Define callbacks
	wire.OnConnect(onConnect)
	wire.OnPriceUpdate(onPriceUpdate)
	wire.OnError(onError)
	wire.OnClose(onClose)
	wire.OnReconnect(onReconnect)
	wire.OnOrderUpdate(onOrderUpdate)

	// Start websocket server
	wire.Serve()
}

func onConnect() {
	fmt.Println("connected")
	wire.Subscribe(govortex.ExchangeTypesNSEEQUITY, 22, govortex.QuoteModesFULL)
}

func onPriceUpdate(q *govortex.FullQuoteData) {
	aa, _ := json.Marshal(q)
	fmt.Println(string(aa))
}

func onError(err error) {
	fmt.Println(err.Error())
}

func onClose(code int, reason string) {
	fmt.Println(code, reason)
}

func onReconnect(attempt int, delay time.Duration) {
	fmt.Println(attempt, delay)
}

func onOrderUpdate(msg govortex.SocketMessage) {
	aa, _ := json.Marshal(msg)
	fmt.Println(string(aa))
}

Run Tests

go test

Generate Docs

go doc -all > doc.txt

Documentation

Index

Constants

View Source
const (
	URILogin               string = "/user/login"
	URISession             string = "/user/session"
	URIInstruments         string = "/data/instruments"
	URIPlaceOrder          string = "/trading/orders/%s"                   //"/trading/orders/regular"
	URIModifyOrder         string = "/trading/orders/%s/%s"                //"/trading/orders/{{order_type}}/{order_id}"
	URIModifyOrderTags     string = "/trading/orders/%s/%s/tags"           //"/trading/orders/{{order_type}}/{order_id}/tags"
	URIDeleteOrder         string = "/trading/orders/%s/%s"                //"/trading/orders/{{order_type}}/{order_id}"
	URIDeleteMultipleOrder string = "/trading/orders/%s/multi_delete"      //"/trading/orders/{{order_type}}/{order_id}"
	URIGttOrderBook        string = "/trading/orders/gtt"                  //"/trading/orders/gtt"
	URIOrderBook           string = "/trading/orders"                      //"/trading/orders"
	URIMultiCancelrders    string = "/trading/orders/regular/multi_delete" //"/trading/orders/regular/multi_delete"
	URIOrderHistory        string = "/trading/orders/%s"                   //"/trading/orders/{order_id}"
	URITrades              string = "/trading/trades"

	URIPositions       string = "/trading/portfolio/positions"
	URIConvertposition string = "/trading/portfolio/positions"
	URIHoldings        string = "/trading/portfolio/holdings"

	URIFunds     string = "/user/funds"
	URIBanks     string = "/user/profile/banks"
	URIBrokerage string = "/user/profile/brokerage"

	URIWithdrawal   string = "/user/funds/withdrawal"
	URIOrderMargin  string = "/margins/order"
	URIBasketMargin string = "/margins/basket"
	URIQuotes       string = "/data/quotes"
	URIHistory      string = "/data/history"

	URIOptionChain string = "/strategies/option_chain"

	URIStrategies       string = "/strategies"
	URIBuildStrategies  string = "/strategies/build"
	URIPayoffStrategies string = "/strategies/payoff"

	URITradeReport           string = "/reports/trades/%s?from_date=%s&to_date=%s"
	URITurnoverSummaryReport string = "/reports/turnover/summary/%s?from_date=%s&to_date=%s"
	URITurnoverDetailsReport string = "/reports/turnover/details/%s?from_date=%s&to_date=%s"
	URIPnLReport             string = "/reports/pnl/%s?from_date=%s&to_date=%s"
	URIMTFInterestReport     string = "/reports/mtf_interest/%s?from_date=%s&to_date=%s"

	URITags string = "/reports/tags"
	URITag  string = "/reports/tags/%d"

	URIAlerts string = "/alerts"
	URIAlert  string = "/alerts/%d"

	URIBaskets string = "/basket"
	URIBasket  string = "/basket/%d"

	URIMfHoldings         string = "/mf/holdings"
	URIFundDetails        string = "/mf/fund/details"
	URIMfFunds            string = "/mf/fund"
	URIFundMainCategories string = "/mf/fund/mainCategories"
	URIFundCategories     string = "/mf/fund/categories"
	URIFundNavs           string = "/mf/fund/navs"
	URIPortfolioOverlap   string = "/mf/fund/portfolio-overlap"
	URIPortfolioImpact    string = "/mf/fund/portfolio-impact"
	URIMFSips             string = "/mf/purchases/synthetic/plan"
)

Constants for the API endpoints

View Source
const (
	GeneralError    = "GeneralException"
	TokenError      = "TokenException"
	PermissionError = "PermissionError"
	UserError       = "UserException"
	TwoFAError      = "TwoFAException"
	OrderError      = "OrderException"
	InputError      = "InputException"
	DataError       = "DataException"
	NetworkError    = "NetworkException"
	NotFoundError   = "NotFoundException"
)

Variables

This section is empty.

Functions

func GetErrorName

func GetErrorName(code int) string

GetErrorName returns an error name given an HTTP code.

func InitializeVortexApi

func InitializeVortexApi(applicationId string, apiKey string, apiClient *VortexApi) error

Function to get a new instance of VortexApi Client.

func InitializeWire

func InitializeWire(accessToken string, wire *Wire) error

Default method to create a new instance of Wire which can be used to get price updates and order updates

func NewError

func NewError(etype string, message string, data interface{}) error

NewError creates and returns a new instace of Error with custom error metadata.

Types

type Alert

type Alert struct {
	DeletedAt       *string        `json:"DeletedAt"`
	ClientCode      string         `json:"clientCode"`
	Condition       AlertCondition `json:"condition"`
	CreatedAt       string         `json:"createdAt"`
	Expiry          string         `json:"expiry"`
	ID              int            `json:"id"`
	IsExecuted      bool           `json:"isExecuted"`
	LastExecutedAt  string         `json:"lastExecutedAt"`
	MarketSegmentID int            `json:"marketSegmentId"`
	Name            string         `json:"name"`
	Note            string         `json:"note"`
	Property        AlertProperty  `json:"property"`
	Source          string         `json:"source"`
	Status          string         `json:"status"`
	Token           int            `json:"token"`
	TriggerValue    float64        `json:"triggerValue"`
	UpdatedAt       string         `json:"updatedAt"`
}

type AlertBook

type AlertBook struct {
	Data    []Alert `json:"data"`
	Status  string  `json:"status"`
	Message string  `json:"message"`
}

type AlertCondition

type AlertCondition string
const (
	AlertConditionLE AlertCondition = "LE"
	AlertConditionGE AlertCondition = "GE"
	AlertConditionEQ AlertCondition = "EQ"
)

type AlertId

type AlertId struct {
	AlertId int `json:"alertId"`
}

type AlertInfo

type AlertInfo struct {
	Name           string         `json:"name"`
	ClientCode     string         `json:"client_code"`
	Token          int            `json:"token"`
	Exchange       ExchangeTypes  `json:"exchange"`
	TriggerValue   float64        `json:"trigger_value"`
	Property       AlertProperty  `json:"property"`
	Condition      AlertCondition `json:"condition"`
	Status         string         `json:"status" `
	Note           string         `json:"note"`
	Expiry         time.Time      `json:"expiry"`
	LastExecutedAt time.Time      `json:"last_executed_at"`
	IsExecuted     *bool          `json:"is_executed"`
	CreatedAt      time.Time      `json:"created_at"`
	UpdatedAt      time.Time      `json:"updated_at"`
}

type AlertProperty

type AlertProperty string
const (
	AlertPropertyLTP      AlertProperty = "LTP"
	AlertPropertyVOLUME   AlertProperty = "VOLUME"
	AlertPropertyAVGPRICE AlertProperty = "AVGPRICE"
)

type Allocation

type Allocation struct {
	Name  string
	Value float64
}

type AssetAllocation

type AssetAllocation struct {
	Isin                string  `json:"Isin"`
	AssetCodeFloat      float64 `json:"AssetCode"`
	AssetCode           int     `json:"asset_code"`
	AssetName           string  `json:"AssetName"`
	HoldingCurrentMonth float64 `json:"Holding_CurrentMonth"`
	HoldingPrevMonth    float64 `json:"Holding_PrevMonth"`
	CurrentMonth        string  `gorm:"-" json:"CurrentMonth"`
}

type BankDetails

type BankDetails struct {
	AccountNumber string `json:"account_number"`
	Ifsc          string `json:"ifsc"`
	IsPrimary     bool   `json:"is_primary"`
	AccountType   string `json:"account_type"`
	BankName      string `json:"bank_name"`
}

type BanksResponse

type BanksResponse struct {
	Status string              `json:"status"`
	Data   ExchangeBankDetails `json:"data"`
}

type Basket

type Basket struct {
	ID             int           `json:"id"`
	ClientCode     string        `json:"clientCode"`
	BasketName     string        `json:"basketName"`
	BasketOrders   []BasketOrder `json:"basketOrders"`
	OrdersCount    int           `json:"ordersCount"`
	CreatedAt      time.Time     `json:"createdAt"`
	UpdatedAt      time.Time     `json:"updatedAt"`
	LastExecutedAt time.Time     `json:"lastExecutedAt"`
	AlertId        *int          `json:"alertId"`
	Alert          *Alert        `json:"alert"`
	IsExecuted     bool          `json:"isExecuted"`
	TagIds         []int         `json:"tag_ids"`
}

type BasketMarginOrder

type BasketMarginOrder struct {
	Ticker          string           `json:"ticker"`           // Required: Ticker of the instrument.
	Exchange        ExchangeTypes    `json:"exchange"`         // Required: Exchange type.
	Token           int              `json:"token"`            // Required: Token of the underlying instrument.
	TransactionType TransactionTypes `json:"transaction_type"` // Required: Type of transaction.
	Product         ProductTypes     `json:"product"`          // Required: Type of product.
	Variety         VarietyTypes     `json:"variety"`          // Required: Type of variety.
	Quantity        int              `json:"quantity"`         // Required: Quantity of the order.
	Price           float64          `json:"price"`            // Required: Price of the order.
}

type BasketMarginRequest

type BasketMarginRequest struct {
	Orders []BasketMarginOrder `json:"orders"`
}

type BasketMarginResponse

type BasketMarginResponse struct {
	Status         string  `json:"status"`
	InitialMargin  float64 `json:"initial_margin"`
	RequiredMargin float64 `json:"required_margin"`
}

type BasketOrder

type BasketOrder struct {
	ID                int                    `json:"id"`
	OrderPosition     int                    `json:"orderPosition"`
	Token             int                    `json:"token"`
	MarketSegmentId   int                    `json:"marketSegmentId"`
	BuySell           int                    `json:"buySell"`
	ProductType       string                 `json:"productType"`
	OrderType         string                 `json:"orderType"`
	Quantity          int                    `json:"quantity"`
	Price             float64                `json:"price"`
	DisclosedQuantity int                    `json:"disclosedQuantity"`
	Validity          string                 `json:"validity"`
	ValidityDays      int                    `json:"validityDays"`
	IsAmo             bool                   `json:"isAmo"`
	OrderIdentifier   string                 `json:"orderIdentifier"`
	OrderId           string                 `json:"orderId"`
	TriggerPrice      float64                `json:"triggerPrice"`
	CreatedAt         time.Time              `json:"createdAt"`
	UpdatedAt         time.Time              `json:"updatedAt"`
	TagIds            []int                  `json:"tag_ids"`
	Metadata          map[string]interface{} `json:"metadata"`
}

type Baskets

type Baskets struct {
	Status   string   `json:"status"`
	Message  string   `json:"message"`
	Response []Basket `json:"response"`
}

type BseSchemeDetail

type BseSchemeDetail struct {
	UniqueNo                     int       `json:"UniqueNo"`
	SchemeCode                   string    `json:"SchemeCode"`
	AMCSchemeCode                string    `json:"AMCSchemeCode"`
	RTASchemeCode                string    `json:"RTASchemeCode"`
	ISIN                         string    `gorm:"primaryKey" json:"ISIN"`
	AMCCode                      string    `json:"AMCCode"`
	SchemeType                   string    `json:"SchemeType"`
	SchemePlan                   string    `json:"SchemePlan"`
	SchemeName                   string    `json:"SchemeName"`
	PurchaseAllowed              string    `json:"PurchaseAllowed"`
	PurchaseTransactionMode      string    `json:"PurchaseTransactionMode"`
	MinimumPurchaseAmount        float64   `json:"MinimumPurchaseAmount"`
	AdditionalPurchaseAmount     float64   `json:"AdditionalPurchaseAmount"`
	MaximumPurchaseAmount        float64   `json:"MaximumPurchaseAmount"`
	PurchaseAmountMultiplier     float64   `json:"PurchaseAmountMultiplier"`
	PurchaseCutoffTime           string    `json:"PurchaseCutoffTime"`
	RedemptionAllowed            string    `json:"RedemptionAllowed"`
	RedemptionTransactionMode    string    `json:"RedemptionTransactionMode"`
	MinimumRedemptionQty         float64   `json:"MinimumRedemptionQty"`
	RedemptionQtyMultiplier      float64   `json:"RedemptionQtyMultiplier"`
	MaximumRedemptionQty         float64   `json:"MaximumRedemptionQty"`
	RedemptionAmountMinimum      float64   `json:"RedemptionAmountMinimum"`
	RedemptionAmountMaximum      float64   `json:"RedemptionAmountMaximum"`
	RedemptionAmountMultiple     float64   `json:"RedemptionAmountMultiple"`
	RedemptionCutoffTime         string    `json:"RedemptionCutoffTime"`
	RTAAgentCode                 string    `json:"RTAAgentCode"`
	AMCActiveFlag                string    `json:"AMCActiveFlag"`
	DividendReinvestmentFlag     string    `json:"DividendReinvestmentFlag"`
	SIPFlag                      string    `json:"SIPFlag"`
	STPFlag                      string    `json:"STPFlag"`
	SWPFlag                      string    `json:"SWPFlag"`
	SwitchFlag                   string    `json:"SwitchFlag"`
	SettlementType               string    `json:"SettlementType"`
	AMCInd                       string    `json:"AMCInd"`
	FaceValue                    float64   `json:"FaceValue"`
	StartDate                    time.Time `json:"StartDate"`
	EndDate                      time.Time `json:"EndDate"`
	ExitLoadFlag                 string    `json:"ExitLoadFlag"`
	ExitLoad                     float64   `json:"ExitLoad"`
	LockInPeriodFlag             string    `json:"LockInPeriodFlag"`
	LockInPeriod                 int       `json:"LockInPeriod"`
	ChannelPartnerCode           string    `json:"ChannelPartnerCode"`
	ReOpeningDate                time.Time `json:"ReOpeningDate"`
	SIPTransactionMode           string    `json:"SIPTransactionMode"`
	SIPFrequency                 string    `json:"SIPFrequency"`
	SIPDates                     string    `json:"SIPDates"`
	SIPMinimumGap                int       `json:"SIPMinimumGap"`
	SIPMaximumGap                int       `json:"SIPMaximumGap"`
	SIPInstallmentGap            int       `json:"SIPInstallmentGap"`
	SIPStatus                    string    `json:"SIPStatus"`
	SIPMinimumInstallmentAmount  float64   `json:"SIPMinimumInstallmentAmount"`
	SIPMaximumInstallmentAmount  float64   `json:"SIPMaximumInstallmentAmount"`
	SIPMultiplierAmount          float64   `json:"SIPMultiplierAmount"`
	SIPMinimumInstallmentNumbers int       `json:"SIPMinimumInstallmentNumbers"`
	SIPMaximumInstallmentNumbers int       `json:"SIPMaximumInstallmentNumbers"`
	SchemeISIN                   string    `json:"SchemeISIN"`
	PauseFlag                    string    `json:"PauseFlag"`
	PauseMinimumInstallments     int       `json:"PauseMinimumInstallments"`
	PauseMaximumInstallments     int       `json:"PauseMaximumInstallments"`
	PauseModificationCount       int       `json:"PauseModificationCount"`
	L0Flag                       bool      `json:"L0Flag"`
}

type CancelIcebergOrderResponse

type CancelIcebergOrderResponse struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

type ConvertPositionRequest

type ConvertPositionRequest struct {
	Ticker          string           `json:"ticker"`           // Required: Ticker of the instrument.
	Exchange        ExchangeTypes    `json:"exchange"`         // Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Token           int              `json:"token"`            // Not needed if Ticker is provided. Deprecated: use Ticker instead.
	TransactionType TransactionTypes `json:"transaction_type"` // Required: Type of transaction.
	Quantity        int              `json:"quantity"`         // Required: Quantity of the position to convert.
	OldProductType  ProductTypes     `json:"old_product"`      // Required: Old product type of the position.
	NewProductType  ProductTypes     `json:"new_product"`      // Required: New product type to convert the position to.
}

ConvertPositionRequest represents a request to convert a position.

type ConvertPositionResponse

type ConvertPositionResponse struct {
	Status  string `json:"status"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type CreateAlertRequest

type CreateAlertRequest struct {
	BasketID     *int
	Condition    AlertCondition
	Exchange     ExchangeTypes
	Name         string
	Note         string
	Property     AlertProperty
	Token        int
	TriggerValue float64
}

type CreateAlertResponse

type CreateAlertResponse struct {
	Status  string  `json:"status"`
	Message string  `json:"message"`
	Data    AlertId `json:"data"`
}

type CreateBasketRequest

type CreateBasketRequest struct {
	Name string `json:"name"`
}

type DateOptionData

type DateOptionData struct {
	StrikePrice float64        `json:"strike_price"`
	IV          float64        `json:"iv"`
	Theta       float64        `json:"theta"`
	Vega        float64        `json:"vega"`
	Gamma       float64        `json:"gamma"`
	CE          StockWithGreek `json:"CE"`
	PE          StockWithGreek `json:"PE"`
}

type Error

type Error struct {
	Code      int
	ErrorType string
	Message   string
	Data      interface{}
}

Error is the error type used for all API errors.

func (Error) Error

func (e Error) Error() string

This makes Error a valid Go error type.

type ExchangeAuthTokenRequest

type ExchangeAuthTokenRequest struct {
	Checksum      string `json:"checksum"`
	ApplicationId string `json:"applicationId"`
	Token         string `json:"token"`
}

type ExchangeBankDetails

type ExchangeBankDetails struct {
	Nse []BankDetails `json:"nse"`
	Mcx []BankDetails `json:"mcx"`
}

type ExchangeDetail

type ExchangeDetail struct {
	Token    int           `json:"token"`
	Exchange ExchangeTypes `json:"exchange"`
	Symbol   string        `json:"symbol"`
	Ticker   string        `json:"ticker"`
}

type ExchangeFundResponse

type ExchangeFundResponse struct {
	Deposit             float64 `json:"deposit"`
	FundsTransferred    float64 `json:"funds_transferred"`
	Collateral          float64 `json:"collateral"`
	CreditForSale       float64 `json:"credit_for_sale"`
	OptionCreditForSale float64 `json:"option_credit_for_sale"`
	LimitUtilization    float64 `json:"limit_utilization"`
	MtmAndBookedLoss    float64 `json:"mtm_and_booked_loss"`
	BookedProfit        float64 `json:"booked_profit"`
	TotalTradingPower   float64 `json:"total_trading_power"`
	TotalUtilization    float64 `json:"total_utilization"`
	NetAvailable        float64 `json:"net_available"`
	FundsWithdrawal     float64 `json:"funds_withdrawal"`
}

type ExchangeTypes

type ExchangeTypes string
const (
	ExchangeTypesNSEFO       ExchangeTypes = "NSE_FO"
	ExchangeTypesBSEFO       ExchangeTypes = "BSE_FO"
	ExchangeTypesBSEEQUITY   ExchangeTypes = "BSE_EQ"
	ExchangeTypesNSEEQUITY   ExchangeTypes = "NSE_EQ"
	ExchangeTypesNSECURRENCY ExchangeTypes = "NSE_CD"
	ExchangeTypesMCX         ExchangeTypes = "MCX_FO"
)

type FullQuoteData

type FullQuoteData struct {
	Ticker            string      `json:"ticker"`
	Exchange          string      `json:"exchange"`
	Token             int         `json:"token"`
	LastTradeTime     int         `json:"last_trade_time"`
	LastUpdateTime    int         `json:"last_update_time"`
	LastTradePrice    float64     `json:"last_trade_price"`
	Volume            int         `json:"volume"`
	AverageTradePrice float64     `json:"average_trade_price"`
	TotalBuyQuantity  int64       `json:"total_buy_quantity"`
	TotalSellQuantity int64       `json:"total_sell_quantity"`
	OpenInterest      int         `json:"open_interest"`
	OpenPrice         float64     `json:"open_price"`
	HighPrice         float64     `json:"high_price"`
	LowPrice          float64     `json:"low_price"`
	ClosePrice        float64     `json:"close_price"`
	LastTradeQuantity int         `json:"last_trade_quantity"`
	Depth             *QuoteDepth `json:"depth"`
	DPRHigh           float64     `json:"dpr_high"`
	DPRLow            float64     `json:"dpr_low"`
}

type FundDetails

type FundDetails struct {
	Deposit             float64 `json:"deposit"`
	FundsTransferred    float64 `json:"funds_transferred"`
	Collateral          float64 `json:"collateral"`
	CreditForSale       float64 `json:"credit_for_sale"`
	OptionCreditForSale float64 `json:"option_credit_for_sale"`
	LimitUtilization    float64 `json:"limit_utilization"`
	FundsWithdrawn      float64 `json:"funds_withdrawn"`
	MtmAndBookedLoss    float64 `json:"mtm_and_booked_loss"`
	BookedProfit        float64 `json:"booked_profit"`
	TotalTradingPower   float64 `json:"total_trading_power"`
	TotalUtilization    float64 `json:"total_utilization"`
	NetAvailable        float64 `json:"net_available"`
}

type FundOfferScheme

type FundOfferScheme struct {
	Mfcocode   float64 `json:"Mfcocode"`
	Mfschcode  float64 `json:"Mfschcode"`
	Name       string  `json:"Name"`
	SchName    string  `json:"sch_name"`
	ISIN       string  `json:"isin"`
	OfferPrice float64 `json:"OFFERPRICE"`
	ClassCode  int     `json:"ClassCode"`
}

type FundOverlap

type FundOverlap struct {
	Value    float64
	Overlaps []Overlaps
}

type FundOverlapResponse

type FundOverlapResponse struct {
	Status string      `json:"status"`
	Data   FundOverlap `json:"data"`
}

type FundResponse

type FundResponse struct {
	Nse ExchangeFundResponse `json:"nse"`
	Mcx ExchangeFundResponse `json:"mcx"`
}

type FundWithdrawalCancelRequest

type FundWithdrawalCancelRequest struct {
	TransactionId string        `json:"transaction_id"` // Required: Transaction ID.
	Exchange      ExchangeTypes `json:"exchange"`       // Required: Exchange type.
	Amount        float64       `json:"amount"`         // Required: Amount of the withdrawal.
}

FundWithdrawalCancelRequest represents a request to cancel a fund withdrawal.

type FundWithdrawalItem

type FundWithdrawalItem struct {
	TransactionId string        `json:"transaction_id"`
	Amount        float64       `json:"amount"`
	CreatedAt     time.Time     `json:"created_at"`
	Status        string        `json:"status"`
	Exchange      ExchangeTypes `json:"exchange"`
}

type FundWithdrawalListResponse

type FundWithdrawalListResponse struct {
	Status  string               `json:"status"`
	Message string               `json:"message,omitempty"`
	Data    []FundWithdrawalItem `json:"data"`
}

type FundWithdrawalRequest

type FundWithdrawalRequest struct {
	BankAccountNumber string        `json:"bank_account_number"` // Required: Bank account number.
	Ifsc              string        `json:"ifsc"`                // Required: IFSC code.
	Amount            float64       `json:"amount"`              // Required: Amount to withdraw.
	Exchange          ExchangeTypes `json:"exchange"`            // Required: Exchange type.
}

FundWithdrawalRequest represents a request to withdraw funds.

type FundsResponse

type FundsResponse struct {
	NSE FundDetails `json:"nse"`
	MCX FundDetails `json:"mcx"`
}

type Greeks

type Greeks struct {
	Theta float64 `json:"theta"`
	Delta float64 `json:"delta"`
	Gamma float64 `json:"gamma"`
	Vega  float64 `json:"vega"`
	Iv    float64 `json:"iv"`
}

type GttInfo

type GttInfo struct {
	Id              string           `json:"id"`
	Token           int              `json:"token"`
	Exchange        ExchangeTypes    `json:"exchange"`
	Symbol          string           `json:"symbol"`
	StrikePrice     float64          `json:"strike_price"`
	InstrumentName  string           `json:"instrument_name"`
	ExpiryDate      string           `json:"expiry_date"`
	OptionType      OptionType       `json:"option_type"`
	LotSize         int              `json:"lot_size"`
	TriggerType     GttTriggerType   `json:"trigger_type"`
	TransactionType TransactionTypes `json:"transaction_type"`
	TagIds          pq.Int32Array    `json:"tag_ids"`
	OrderIdentifier string           `json:"order_identifier"`
	Orders          []GttInfoOrder   `json:"orders"`
}

type GttInfoOrder

type GttInfoOrder struct {
	Id           uint           `json:"id"`
	Product      ProductTypes   `json:"product"`
	Variety      VarietyTypes   `json:"variety"`
	Price        *float64       `json:"price"`
	TriggerPrice *float64       `json:"trigger_price"`
	Quantity     int            `json:"quantity"`
	Status       GttOrderStatus `json:"status"`
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
	TrigerredAt  time.Time      `json:"trigerred_at"`
}

type GttLegs

type GttLegs struct {
	SlTriggerPercent     *float64       `json:"sl_trigger_percent"`     // Optional: Stop loss trigger percentage.
	ProfitTriggerPercent *float64       `json:"profit_trigger_percent"` // Optional: Profit trigger percentage.
	SlVariety            *VarietyTypes  `json:"sl_variety"`
	ProfitVariety        *VarietyTypes  `json:"profit_variety"`
	TrailJumpPoint       *float64       `json:"trail_jump_point"`
	TrailJumpType        *TrailJumpType `json:"trail_jump_type"`
}

GttLegs represents legs of a Good 'til Triggered (GTT) order.

type GttOrderResponse

type GttOrderResponse struct {
	Id                 string                   `json:"id"`
	Token              int                      `json:"token" binding:"required"`
	Exchange           ExchangeTypes            `json:"exchange" binding:"required"`
	Symbol             string                   `json:"symbol" binding:"required"`
	Series             string                   `json:"series" binding:"required"`
	InstrumentName     InstrumentName           `json:"instrument_name" binding:"required"`
	ExpiryDate         string                   `json:"expiry_date" binding:"required"`
	StrikePrice        float64                  `json:"strike_price" binding:"required"`
	OptionType         OptionType               `json:"option_type" binding:"required"`
	LotSize            int                      `json:"lot_size" binding:"required"`
	TriggerType        GttTriggerType           `json:"trigger_type" binding:"required"`
	TransactionType    TransactionTypes         `json:"transaction_type" binding:"required"`
	TagIds             pq.Int32Array            `json:"tag_ids"`
	Product            ProductTypes             `json:"product"`
	ParentMiddlewareId *uint                    `json:"parent_middleware_id"`
	Orders             []GttOrderResponseOrders `json:"orders" binding:"required"`
}

type GttOrderResponseOrders

type GttOrderResponseOrders struct {
	Id              uint             `json:"id"`
	ProductType     ProductTypes     `json:"product"`
	Variety         VarietyTypes     `json:"variety"`
	TransactionType TransactionTypes `json:"transaction_type"`
	Price           float64          `json:"price"`
	TriggerPrice    float64          `json:"trigger_price"`
	Quantity        int              `json:"quantity"`
	Status          GttOrderStatus   `json:"status"`
	CreatedAt       time.Time        `json:"created_at"`
	UpdatedAt       time.Time        `json:"updated_at"`
	TrigerredAt     time.Time        `json:"trigerred_at"`
	Trail           *Trail           `json:"trail,omitempty"`
}

type GttOrderStatus

type GttOrderStatus string
const (
	GttOrderStatusTriggered GttOrderStatus = "triggered"
	GttOrderStatusActive    GttOrderStatus = "active"
	GttOrderStatusCancelled GttOrderStatus = "cancelled"
	GttOrderStatusExpired   GttOrderStatus = "expired"
	GttOrderStatusCompleted GttOrderStatus = "completed"
)

type GttOrderbookResponse

type GttOrderbookResponse struct {
	Status string              `json:"status"`
	Data   []*GttOrderResponse `json:"data"`
}

type GttTriggerType

type GttTriggerType string

GttTriggerType represents the trigger type for a Good 'til Triggered (GTT) order.

const (
	GttTriggerTypeSingle GttTriggerType = "single" // Single trigger type.
	GttTriggerTypeOCO    GttTriggerType = "oco"    // One Cancels the Other (OCO) trigger type.
)

type HTTPClient

type HTTPClient interface {
	GetClient() *httpClient
	// contains filtered or unexported methods
}

HTTPClient defines the interface for performing HTTP requests.

func NewHTTPClient

func NewHTTPClient(h *http.Client, hLog *log.Logger, debug bool) HTTPClient

NewHTTPClient creates a new instance of the httpClient with the given HTTP client, logger, and debug flag. If the logger is nil, it uses a default logger that writes to os.Stdout. If the HTTP client is nil, it uses a default client with a 5-second timeout and default transport settings.

type HTTPResponse

type HTTPResponse struct {
	Body     []byte
	Response *http.Response
}

HTTPResponse contains the response body and the HTTP response object.

type HistoricalResponse

type HistoricalResponse struct {
	S string    `json:"s"`
	T []int     `json:"t"`
	O []float64 `json:"o"`
	H []float64 `json:"h"`
	L []float64 `json:"l"`
	C []float64 `json:"c"`
	V []float64 `json:"v"`
}

type Holding

type Holding struct {
	ISIN               string          `json:"isin"`
	NSE                *ExchangeDetail `json:"nse,omitempty"`
	BSE                *ExchangeDetail `json:"bse,omitempty"`
	TotalFree          int             `json:"total_free"`
	DPFree             int             `json:"dp_free"`
	PoolFree           int             `json:"pool_free"`
	T1Quantity         int             `json:"t1_quantity"`
	AveragePrice       float64         `json:"average_price"`
	LastPrice          float64         `json:"last_price"`
	Product            string          `json:"product"`
	CollateralQuantity int             `json:"collateral_quantity"`
	CollateralValue    float64         `json:"collateral_value"`
}

type HoldingAllocation

type HoldingAllocation struct {
	Isin          string    `json:"Isin"`
	CompanyCode   int       `json:"co_code"`
	CompanyName   string    `json:"co_name"`
	InvDateString string    `json:"invdate"`
	InvDate       time.Time `json:"InvDate"`
	PercHolding   float64   `json:"Perc_hold"`
	MktValue      float64   `json:"MktValue"`
	TotalShares   float64   `json:"TotalShares"`
	AssetType     string    `json:"AssetType"`
	Rating        string    `json:"rating"`
}

type HoldingConfig

type HoldingConfig struct {
	OverAllXirr             float64    `json:"OverAllXirr"`
	MarketValueAmount       float64    `json:"MarketValueAmount"`
	InvestedAmount          float64    `json:"InvestedAmount"`
	Returns                 float64    `json:"Returns"`
	ReturnsPercentage       float64    `json:"ReturnsPercentage"`
	LastImportedAt          *time.Time `json:"LastImportedAt"`
	FundsImportStatus       string     `json:"FundsImportStatus"`
	OneDayReturns           float64    `json:"OneDayReturns"`
	OneDayReturnsPercentage float64    `json:"OneDayReturnsPercentage"`
	NavAsOn                 time.Time  `json:"NavAsOn"`
}

type HoldingReportScheme

type HoldingReportScheme struct {
	Xirr                    float64    `json:"xirr"`
	ClientCode              string     `json:"client_code"`
	DpamId                  int        `json:"dpam_id"`
	FolioNumber             string     `json:"folio_number"`
	FolioXirr               float64    `json:"folio_xirr"`
	Isin                    string     `json:"isin"`
	CoCode                  int        `json:"co_code"`
	Name                    string     `json:"name"`
	Type                    string     `json:"type"`
	Units                   float64    `json:"units"`
	RedeemableUnits         float64    `json:"redeemable_units"`
	MarketValueAmount       float64    `json:"market_value_amount"`
	RedeemableAmount        float64    `json:"redeemable_amount"`
	InvestedAmount          float64    `json:"invested_amount"`
	NavValue                float64    `json:"nav_value"`
	BuyPrice                float64    `json:"buy_price"`
	AsOn                    *time.Time `json:"as_on"`
	CreatedAt               time.Time  `json:"created_at"`
	UpdatedAt               time.Time  `json:"updated_at"`
	HoldType                string     `json:"hold_type"`
	IsDemat                 string     `json:"is_demat"`
	OneDayReturns           float64    `json:"one_day_returns"`
	OneDayReturnsPercentage float64    `json:"one_day_returns_percentage"`
}

type HoldingResponse

type HoldingResponse struct {
	Name                    string                `json:"Name"`
	MarketValueAmount       float64               `json:"MarketValueAmount"`
	InvestedAmount          float64               `json:"InvestedAmount"`
	Returns                 float64               `json:"Returns"`
	ReturnsPercentage       float64               `json:"ReturnsPercentage"`
	OneDayReturns           float64               `json:"OneDayReturns"`
	OneDayReturnsPercentage float64               `json:"OneDayReturnsPercentage"`
	Folios                  []HoldingReportScheme `json:"Folios"`
	BseScheme               *BseSchemeDetail      `json:"BseScheme,omitempty"`
	CmotsScheme             *SchemeMaster         `json:"CmotsScheme,omitempty"`
	IsinXirr                float64               `json:"IsinXirr"`
}

type HoldingsResponse

type HoldingsResponse struct {
	Status  string    `json:"status"`
	Message string    `json:"message,omitempty"`
	Data    []Holding `json:"data"`
}

type IcebergOrderData

type IcebergOrderData struct {
	IcebergOrderId string `json:"iceberg_order_id"`
	FirstOrderId   string `json:"first_order_id"`
}

type IcebergOrderResponse

type IcebergOrderResponse struct {
	Message string           `json:"message"`
	Code    string           `json:"code"`
	Status  string           `json:"status"`
	Data    IcebergOrderData `json:"data"`
}

type InstrumentName

type InstrumentName string
const (
	InstrumentNameEqIndex             InstrumentName = "EQIDX"
	InstrumentNameCom                 InstrumentName = "COM"
	InstrumentNameEquities            InstrumentName = "EQUITIES"
	InstrumentNameCommodityFuture     InstrumentName = "FUTCOM"
	InstrumentNameCurrencyFuture      InstrumentName = "FUTCUR"
	InstrumentNameIndexFuture         InstrumentName = "FUTIDX"
	InstrumentNameInterestFuture      InstrumentName = "FUTIRC"
	InstrumentNameInterestFutureT     InstrumentName = "FUTIRT"
	InstrumentNameStockFuture         InstrumentName = "FUTSTK"
	InstrumentNameCurrencyOption      InstrumentName = "OPTCUR"
	InstrumentNameCommodityOption     InstrumentName = "OPTFUT"
	InstrumentNameIndexOption         InstrumentName = "OPTIDX"
	InstrumentNameInterestOption      InstrumentName = "OPTIRC"
	InstrumentNameStockOption         InstrumentName = "OPTSTK"
	InstrumentNameCurrentcyUnderlying InstrumentName = "UNDCUR"
)

type LegStockGreek

type LegStockGreek struct {
	Token       int        `json:"token" binding:"required"`
	StrikePrice float64    `json:"strike_price"`
	OptionType  OptionType `json:"option_type"`
	ExpYYYYMMDD string     `json:"expiry_date"`
	Action      string     `json:"action"`
	LotSize     int        `json:"lot_size"`
	Quantity    int        `json:"quantity"`
	Ltp         float64    `json:"last_trade_price"` // Update
	Iv          float64    `json:"iv"`               // Update *hide
	Greeks      Greeks     `json:"greeks" gorm:"-"`
}

type LoginResponse

type LoginResponse struct {
	Status string   `json:"status"`
	Data   UserData `json:"data"`
}

type LogoutResponse

type LogoutResponse struct {
	Status   string `json:"status"`
	Response string `json:"response"`
}

type LtpQuoteData

type LtpQuoteData struct {
	Ticker         string  `json:"ticker"`
	Exchange       string  `json:"exchange"`
	Token          int     `json:"token"`
	LastTradePrice float64 `json:"last_trade_price"`
}

type MarginModes

type MarginModes string
const (
	MarginModeNew    MarginModes = "NEW"
	MarginModeMODIFY MarginModes = "MODIFY"
)

type MarginResponse

type MarginResponse struct {
	Status    string  `json:"status"`
	Required  float64 `json:"required_margin"`
	Available float64 `json:"available_margin"`
}

type MarketDepthResponse

type MarketDepthResponse struct {
	Status string     `json:"status"`
	Data   QuoteDepth `json:"data"`
}

type Metadata

type Metadata struct {
	TotalRecords int `json:"total_records"`
}

type MfDetailResponse

type MfDetailResponse struct {
	Status string                `json:"status"`
	Data   SchemeDetailsResponse `json:"data"`
}

type MfHoldings

type MfHoldings struct {
	OverallConfig HoldingConfig               `json:"OverallConfig"`
	IsinWiseData  map[string]*HoldingResponse `json:"IsinWiseData"`
}

type MfHoldingsResponse

type MfHoldingsResponse struct {
	Status  string     `json:"status"`
	Message string     `json:"message"`
	Data    MfHoldings `json:"data"`
}

type ModifyAlertResponse

type ModifyAlertResponse struct {
	Status   string `json:"status"`
	Message  string `json:"message"`
	Response string `json:"response"`
}

type ModifyBasketOrder

type ModifyBasketOrder struct {
	Token             int
	Exchange          ExchangeTypes
	TransactionType   TransactionTypes
	ProductType       ProductTypes
	Variety           VarietyTypes
	Quantity          int
	Price             float64
	DisclosedQuantity int
	Validity          ValidityTypes
	ValidityDays      int
	IsAmo             bool
	OrderIdentifier   string
	TriggerPrice      float64
	CreatedAt         time.Time
	UpdatedAt         time.Time
	TagIds            []int
	Metadata          map[string]interface{}
}

type ModifyBasketRequest

type ModifyBasketRequest struct {
	Name   string
	Orders []ModifyBasketOrder
}

type ModifyBasketResponse

type ModifyBasketResponse struct {
	Status   string `json:"status"`
	Message  string `json:"message"`
	Response string `json:"response"`
}

type ModifyGttRequest

type ModifyGttRequest struct {
	Id           uint         `json:"id"`            // Required: Identifier of the GTT order to modify.
	TriggerPrice *float64     `json:"trigger_price"` // Required: New trigger price for the GTT order.
	Price        *float64     `json:"price"`         // Required: New price for the GTT order.
	Quantity     *int         `json:"quantity"`      // Required: New quantity for the GTT order.
	Variety      VarietyTypes `json:"variety"`       // Required: Type of variety. Accepted values: [RL,RL-MKT].
	Trail        *Trail       `json:"trail"`         // Optional: Trail information for the GTT order.
}

ModifyGttRequest represents a request to modify a Good 'til Triggered (GTT) order.

type ModifyIcebergOrderRequest

type ModifyIcebergOrderRequest struct {
	Price          float64 `json:"price"`           // Required: Price of the order.
	TriggerPrice   float64 `json:"trigger_price"`   // Required: Trigger price for the order.
	TradedQuantity int     `json:"traded_quantity"` // Required: Quantity already traded.
}

ModifyIcebergOrderRequest represents a request to modify an Iceberg order.

type ModifyOrderRequest

type ModifyOrderRequest struct {
	Variety           VarietyTypes  `json:"variety" `           // Required: Type of variety.
	Quantity          int           `json:"quantity" `          // Required: Quantity of the order.
	TradedQuantity    *int          `json:"traded_quantity" `   // Required: Quantity which has already been traded according to you. This is important..
	Price             float64       `json:"price" `             // Optional if market order. Price of the order.
	TriggerPrice      float64       `json:"trigger_price"`      // Optional if not stoploss order. Trigger price for the order.
	DisclosedQuantity int           `json:"disclosed_quantity"` // Optional: Disclosed quantity for the order.
	Validity          ValidityTypes `json:"validity" `          // Required: Validity type for the order.
	ValidityDays      int           `json:"validity_days"`      // Optional: Number of validity days.
	TagIds            []int         `json:"tag_ids"`            // Optional: IDs of tags associated with the order.
}

type MultipleOrderCancelRequest

type MultipleOrderCancelRequest struct {
	OrderIds []string `json:"order_ids"`
}

type MultipleOrderResponse

type MultipleOrderResponse struct {
	Status string          `json:"status"`
	Data   []OrderResponse `json:"data"`
}
type NAVResponse struct {
	Status string       `json:"status"`
	Data   []TimeSeries `json:"data"`
}

type NetDayPositions

type NetDayPositions struct {
	Net []PositionItem `json:"net"`
	Day []PositionItem `json:"day"`
}

type OhlcvQuoteData

type OhlcvQuoteData struct {
	Ticker         string  `json:"ticker"`
	Exchange       string  `json:"exchange"`
	Token          int     `json:"token"`
	LastTradePrice float64 `json:"last_trade_price"`
	LastTradeTime  int     `json:"last_trade_time"`
	Volume         int     `json:"volume"`
	OpenPrice      float64 `json:"open_price"`
	HighPrice      float64 `json:"high_price"`
	LowPrice       float64 `json:"low_price"`
	ClosePrice     float64 `json:"close_price"`
}

type OptionChainRequest

type OptionChainRequest struct {
	Token      int           `json:"token"`       // Required: Token of the underlying instrument.
	ExpiryDate string        `json:"expiry_date"` // Optional: Expiry date of options in format YYYYMMDD. If not provided, the result will be of the closest expiry.
	Exchange   ExchangeTypes `json:"exchange"`    // Required: Exchange type.
	AddGreek   bool          `json:"greeks"`      // Optional: Include Greeks in the result. Default is false.
}

OptionChainRequest represents a request to retrieve an option chain.

type OptionChainResponse

type OptionChainResponse struct {
	Status   string            `json:"status"`
	Message  string            `json:"message"`
	Response OptionchainResult `json:"response"`
}

type OptionType

type OptionType string
const (
	OptionTypeCall OptionType = "CE"
	OptionTypePut  OptionType = "PE"
)

type OptionchainResult

type OptionchainResult struct {
	Symbol         string   `json:"symbol"`
	ExpiryDate     string   `json:"expiry_date"`
	HasParentStock bool     `json:"has_parent_stock"`
	ExpiryDates    []string `json:"expiry_dates"`
	Options        struct {
		Exchange ExchangeTypes     `json:"exchange"`
		List     []*DateOptionData `json:"list"`
	} `json:"options"`
	ParentStock struct {
		Symbol   string        `json:"symbol"`
		Exchange ExchangeTypes `json:"exchange"`
		Token    int           `json:"token"`
		ISINCode string        `json:"isin"`
		LTP      float64       `json:"ltp"`
	} `json:"parent"`
}

type Order

type Order struct {
	OrderID                    string                `json:"order_id"`
	Exchange                   ExchangeTypes         `json:"exchange"`
	Token                      int                   `json:"token"`
	OrderNumber                string                `json:"order_number"`
	Status                     string                `json:"status"`
	ErrorReason                string                `json:"error_reason"`
	TransactionType            TransactionTypes      `json:"transaction_type"`
	Product                    ProductTypes          `json:"product"`
	Variety                    VarietyTypes          `json:"variety"`
	TotalQuantity              int                   `json:"total_quantity"`
	PendingQuantity            int                   `json:"pending_quantity"`
	TradedQuantity             int                   `json:"traded_quantity"`
	DisclosedQuantity          int                   `json:"disclosed_quantity"`
	DisclosedQuantityRemaining int                   `json:"disclosed_quantity_remaining"`
	OrderPrice                 float64               `json:"order_price"`
	TriggerPrice               float64               `json:"trigger_price"`
	TradedPrice                float64               `json:"traded_price,omitempty"`
	Validity                   ValidityTypes         `json:"validity"`
	Symbol                     string                `json:"symbol"`
	Series                     string                `json:"series"`
	InstrumentName             InstrumentName        `json:"instrument_name"`
	ExpiryDate                 string                `json:"expiry_date"`
	StrikePrice                float64               `json:"strike_price"`
	OptionType                 OptionType            `json:"option_type"`
	LotSize                    int                   `json:"lot_size"`
	OrderCreatedAt             string                `json:"order_created_at"`
	InitiatedBy                string                `json:"initiated_by"`
	ModifiedBy                 string                `json:"modified_by"`
	IsAMO                      bool                  `json:"is_amo"`
	OrderIdentifier            string                `json:"order_identifier"`
	TagsIds                    pq.Int32Array         `json:"tags_ids"`
	MiddlewareOrderId          uint                  `json:"middleware_order_id"`
	Iceberg                    *OrderBookIcebergInfo `json:"iceberg,omitempty"`
	Gtt                        *OrderBookGttInfo     `json:"gtt,omitempty"`
}

type OrderBookGttInfo

type OrderBookGttInfo struct {
	TriggerType          GttTriggerType `json:"trigger_type"`
	SlTriggerPercent     *float64       `json:"sl_trigger_percent,omitempty"`
	ProfitTriggerPercent *float64       `json:"profit_trigger_percent,omitempty"`
}

type OrderBookIcebergInfo

type OrderBookIcebergInfo struct {
	IcebergOrderId  string `json:"iceberg_order_id"`
	IcebergSequence int    `json:"iceberg_sequence"`
	Legs            int    `json:"legs"`
}

type OrderBookResponse

type OrderBookResponse struct {
	Status   string   `json:"status"`
	Orders   []Order  `json:"orders"`
	Metadata Metadata `json:"metadata"`
}

type OrderHistory

type OrderHistory struct {
	OrderID                string           `json:"order_id"`
	Exchange               ExchangeTypes    `json:"exchange"`
	Token                  int              `json:"token"`
	OrderNumber            string           `json:"order_number"`
	Status                 string           `json:"status"`
	ErrorReason            string           `json:"error_reason"`
	TransactionType        TransactionTypes `json:"transaction_type"`
	Product                ProductTypes     `json:"product"`
	Variety                VarietyTypes     `json:"variety"`
	TotalQuantity          int              `json:"total_quantity"`
	PendingQuantity        int              `json:"pending_quantity"`
	TradedQuantity         int              `json:"traded_quantity"`
	DisclosedQuantity      int              `json:"disclosed_quantity"`
	OrderPrice             float64          `json:"order_price"`
	TriggerPrice           float64          `json:"trigger_price"`
	Validity               ValidityTypes    `json:"validity"`
	ValidityDays           int              `json:"validity_days"`
	Symbol                 string           `json:"symbol"`
	Series                 string           `json:"series"`
	InstrumentName         InstrumentName   `json:"instrument_name"`
	ExpiryDate             string           `json:"expiry_date"`
	StrikePrice            float64          `json:"strike_price"`
	OptionType             OptionType       `json:"option_type"`
	OrderCreatedAt         string           `json:"order_created_at"`
	ExchangeOrderCreatedAt string           `json:"exchange_order_created_at"`
	InitiatedBy            string           `json:"initiated_by"`
	ModifiedBy             string           `json:"modified_by"`
	IsAMO                  bool             `json:"is_amo"`
	OrderIdentifier        string           `json:"order_identifier"`
}

type OrderHistoryResponse

type OrderHistoryResponse struct {
	Status   string         `json:"status"`
	Code     string         `json:"code"`
	Message  string         `json:"message"`
	Data     []OrderHistory `json:"orders"`
	Metadata Metadata       `json:"metadata"`
}

type OrderMarginRequest

type OrderMarginRequest struct {
	// Ticker of the instrument.
	// Required if Exchange/Token are not provided. This will be the preferred input going forward.
	Ticker string `json:"ticker"`

	// Exchange type.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Exchange ExchangeTypes `json:"exchange"`

	// Token of the underlying instrument.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Token int `json:"token"`

	// Type of transaction.
	// Required.
	TransactionType TransactionTypes `json:"transaction_type"`

	// Type of product.
	// Required.
	Product ProductTypes `json:"product"`

	// Type of variety.
	// Required.
	Variety VarietyTypes `json:"variety"`

	// Quantity of the order.
	// Required.
	Quantity int `json:"quantity"`

	// Price of the order.
	// Required.
	Price float64 `json:"price"`

	// Old price of the order.
	// Required.
	OldPrice float64 `json:"old_price"`

	// Old quantity of the order.
	// Required.
	OldQuantity int `json:"old_quantity"`

	// Mode of margin calculation.
	// Required.
	Mode MarginModes `json:"mode"`
}

OrderMarginRequest represents a request to calculate margin for an order.

type OrderResponse

type OrderResponse struct {
	Status  string `json:"status"`
	Code    string `json:"code"`
	Message string `json:"message"`
	Data    struct {
		OrderID string `json:"order_id"`
	} `json:"data"`
}

type OrderStatus

type OrderStatus string
const (
	OrderStatusPending            OrderStatus = "PENDING"
	OrderStausMiddlewarePending   OrderStatus = "middleware_pending"
	OrderStatusMiddlewareRejected OrderStatus = "middleware_rejected"
	OrderStatusRejected           OrderStatus = "REJECTED"
	OrderStatusCancelled          OrderStatus = "CANCELLED"
	OrderStatusCompleted          OrderStatus = "COMPLETED"
)

type Overlaps

type Overlaps struct {
	Isin     string
	Holdings []Allocation
}

type PayOff

type PayOff struct {
	IPayoff float64 `json:"intraday_pay_off"`
	EPayoff float64 `json:"expiry_pay_off"`
	At      float64 `json:"at"`
}

type PayOffData

type PayOffData struct {
	MaxLoss          float64         `json:"max_loss"`
	MaxProfit        float64         `json:"max_profit"`
	IsInfiniteProfit bool            `json:"infinite_profit"`
	IsInfiniteLoss   bool            `json:"infinite_loss"`
	BreakEvens       []float64       `json:"breakevens"`
	PayOffs          []PayOff        `json:"payoffs"`
	CombinedGreeks   Greeks          `json:"combined_greeks"`
	LivePrice        float64         `json:"last_trade_price"`
	LegStocks        []LegStockGreek `json:"leg_greeks"`
	MinDaysToExpiry  int             `json:"min_days_to_expiry"`
}

type PayoffAction

type PayoffAction string
const (
	PayoffActionBUY  PayoffAction = "BUY"
	PayoffActionSELL PayoffAction = "SELL"
)

PayoffAction represents the action for a trading strategy.

type PayoffOption

type PayoffOption struct {
	Token    int          `json:"token"`            // Required: Token of the underlying instrument.
	Action   PayoffAction `json:"action"`           // Required: Action for the option.
	Quantity int          `json:"quantity"`         // Required: Quantity of the option.
	Ltp      float64      `json:"last_trade_price"` // Optional: Last traded price for the option.
}

PayoffOption represents an option within a trading strategy.

type PayoffRequest

type PayoffRequest struct {
	Symbol          string         `json:"symbol" `        // Required: Symbol for the underlying asset.
	Exchange        ExchangeTypes  `json:"exchange" `      // Required: Exchange type.
	Legs            []PayoffOption `json:"legs"`           // Required: Legs of the trading strategy.
	InpDaysToExpiry *int           `json:"days_to_expiry"` // Optional: Number of days to expiry.
	CurrentPnl      float64        `json:"current_pnl"`    // Optional: Current profit or loss.
}

PayoffRequest represents a request to calculate the payoff for a trading strategy.

type PayoffResponse

type PayoffResponse struct {
	Status  string     `json:"status"`
	Message string     `json:"message"`
	Data    PayOffData `json:"data"`
}

type PlaceGttLegRequest

type PlaceGttLegRequest struct {
	Quantity     int           `json:"quantity" binding:"required"`
	Price        *float64      `json:"price"`
	TriggerPrice float64       `json:"trigger_price" binding:"required"`
	ProductType  ProductTypes  `json:"product"`
	Variety      *VarietyTypes `json:"variety"`
	Trail        *Trail        `json:"trail"`
}

PlaceGttLegRequest represents a leg of a Good 'til Triggered (GTT) order.

type PlaceGttRequest

type PlaceGttRequest struct {
	// Exchange type.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Exchange ExchangeTypes `json:"exchange"`

	// Token of the underlying instrument.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Token int `json:"token"`

	// Ticker of the instrument.
	// Required if Exchange/Token are not provided. This will be the preferred input going forward.
	Ticker string `json:"ticker"`

	// Required: Type of transaction.
	TransactionType TransactionTypes `json:"transaction_type"`

	// Optional: Type of variety. By default RL is considered. Accepted values: [RL,RL-MKT].
	Variety VarietyTypes `json:"variety"`

	// Required: Quantity of the order.
	Quantity *int `json:"quantity"`

	// Required: Trigger price for the order.
	TriggerPrice *float64 `json:"trigger_price"`

	// Required: Price of the order.
	Price *float64 `json:"price"`

	// Required: Identifier for the order.
	OrderIdentifier string `json:"order_identifier"`

	// Required: Type of GTT trigger.
	GttTriggerType GttTriggerType `json:"gtt_trigger_type"`

	// Required: Type of product.
	Product ProductTypes `json:"product"`

	// Optional: Stop loss leg of the GTT order.
	Stoploss *PlaceGttLegRequest `json:"stoploss"`

	// Optional: Profit leg of the GTT order.
	Profit *PlaceGttLegRequest `json:"profit"`

	// Optional: Use when GttTriggerType is single.
	SingleTrailingSL *Trail `json:"single_trailing_sl"`

	// Required: IDs of tags associated with the order.
	TagIds []int `json:"tag_ids"`
}

PlaceGttRequest represents a request to place a Good 'til Triggered (GTT) order.

type PlaceIcebergOrderRequest

type PlaceIcebergOrderRequest struct {
	// Ticker of the instrument.
	// Required if Exchange/Token are not provided. This will be the preferred input going forward.
	Ticker string `json:"ticker"`

	// Exchange type.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Exchange ExchangeTypes `json:"exchange"`

	// Token of the underlying instrument.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Token int `json:"token"`

	// Type of transaction.
	// Required.
	TransactionType TransactionTypes `json:"transaction_type"`

	// Type of product.
	// Required.
	Product ProductTypes `json:"product"`

	// Type of variety.
	// Required.
	Variety VarietyTypes `json:"variety"`

	// Quantity of the order.
	// Required.
	Quantity int `json:"quantity"`

	// Price of the order.
	// Optional if market order.
	Price *float64 `json:"price"`

	// Trigger price for the order.
	// Optional if not stoploss order.
	TriggerPrice float64 `json:"trigger_price"`

	// Your identifier for the order.
	// Optional.
	OrderIdentifier string `json:"order_identifier"`

	// Validity type for the order.
	// Required.
	Validity ValidityTypes `json:"validity"`

	// Number of legs for the order.
	// Required.
	Legs int `json:"legs"`

	// IDs of tags associated with the order.
	TagIds pq.Int32Array `json:"tag_ids"`
}

PlaceIcebergOrderRequest represents a request to place an Iceberg order.

type PlaceOrderRequest

type PlaceOrderRequest struct {
	// Ticker of the instrument.
	// Required if Exchange/Token are not provided. This will be the preferred input going forward.
	Ticker string `json:"ticker"`

	// Exchange type.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Exchange ExchangeTypes `json:"exchange"`

	// Token of the underlying instrument.
	// Not needed if Ticker is provided. Deprecated: use Ticker instead.
	Token int `json:"token"`

	// Type of transaction.
	// Required.
	TransactionType TransactionTypes `json:"transaction_type"`

	// Type of product.
	// Required.
	Product ProductTypes `json:"product"`

	// Type of variety.
	// Required.
	Variety VarietyTypes `json:"variety"`

	// Quantity of the order.
	// Required.
	Quantity int `json:"quantity"`

	// Price of the order.
	// Optional if market order.
	Price float64 `json:"price"`

	// Trigger price for the order.
	// Optional if not stoploss order.
	TriggerPrice float64 `json:"trigger_price"`

	// Your identifier for the order.
	// Optional.
	OrderIdentifier string `json:"order_identifier"`

	// Disclosed quantity for the order.
	// Optional.
	DisclosedQuantity int `json:"disclosed_quantity"`

	// Validity type for the order.
	// Required.
	Validity ValidityTypes `json:"validity"`

	// Number of validity days.
	// Optional.
	ValidityDays int `json:"validity_days"`

	// Flag indicating if the order is an after-market order.
	// Optional.
	IsAMO bool `json:"is_amo"`

	// Good 'til Triggered (GTT) legs.
	// Optional.
	Gtt *GttLegs `json:"gtt"`

	// IDs of tags associated with the order.
	// Optional.
	TagIds []int `json:"tag_ids"`
}

PlaceOrderRequest represents a request to place an order.

type PortfolioImpact

type PortfolioImpact struct {
	New      PortfolioStats `json:"New"`
	Original PortfolioStats `json:"Original"`
}

type PortfolioImpactResponse

type PortfolioImpactResponse struct {
	Status string          `json:"status"`
	Data   PortfolioImpact `json:"data"`
}

type PortfolioStats

type PortfolioStats struct {
	Returns float64 `json:"Returns"`
	Risk    float64 `json:"Risk"`
}

type PositionItem

type PositionItem struct {
	Ticker                string        `json:"ticker"`
	Exchange              ExchangeTypes `json:"exchange"`
	Symbol                string        `json:"symbol"`
	ExpiryDate            string        `json:"expiry_date"`
	OptionType            OptionType    `json:"option_type"`
	StrikePrice           float64       `json:"strike_price"`
	Token                 int           `json:"token"`
	Product               ProductTypes  `json:"product"`
	Quantity              int           `json:"quantity"`
	OvernightBuyValue     float64       `json:"overnight_buy_value"`
	OvernightSellValue    float64       `json:"overnight_sell_value"`
	OvernightAveragePrice float64       `json:"overnight_average_price"`
	LotSize               int           `json:"lot_size"`
	Multiplier            float64       `json:"multiplier"`
	AveragePrice          float64       `json:"average_price"`
	Value                 float64       `json:"value"`
	BuyValue              float64       `json:"buy_value"`
	SellValue             float64       `json:"sell_value"`
	BuyQuantity           int           `json:"buy_quantity"`
	SellQuantity          int           `json:"sell_quantity"`
	BuyPrice              float64       `json:"buy_price"`
	SellPrice             float64       `json:"sell_price"`
}

type PositionResponse

type PositionResponse struct {
	Status string          `json:"status"`
	Data   NetDayPositions `json:"data"`
}

type PredictionType

type PredictionType string

PredictionType represents the type of prediction for a trading strategy.

const (
	PredictionTypeABOVE   PredictionType = "ABOVE"   // Predict that the asset price will be above a certain level.
	PredictionTypeBELOW   PredictionType = "BELOW"   // Predict that the asset price will be below a certain level.
	PredictionTypeBETWEEN PredictionType = "BETWEEN" // Predict that the asset price will be within a certain range.
)

type ProductTypes

type ProductTypes string
const (
	ProductTypesIntraday ProductTypes = "INTRADAY"
	ProductTypesDelivery ProductTypes = "DELIVERY"
	ProductTypesMTF      ProductTypes = "MTF"
	ProductTypesBTST     ProductTypes = "BTST"
)

type QuoteDepth

type QuoteDepth struct {
	Buy  []QuoteEntry `json:"buy"`
	Sell []QuoteEntry `json:"sell"`
}

type QuoteEntry

type QuoteEntry struct {
	Quantity int     `json:"quantity"`
	Price    float64 `json:"price"`
	Orders   int     `json:"orders"`
}

type QuoteModes

type QuoteModes string
const (
	QuoteModesLTP   QuoteModes = "ltp"
	QuoteModesFULL  QuoteModes = "full"
	QuoteModesOHLCV QuoteModes = "ohlcv"
)

type QuoteResponse

type QuoteResponse struct {
	Status string                 `json:"status"`
	Data   map[string]interface{} `json:"data"`
}

type Resolutions

type Resolutions string
const (
	ResolutionsMin1   Resolutions = "1"
	ResolutionsMin2   Resolutions = "2"
	ResolutionsMin3   Resolutions = "3"
	ResolutionsMin4   Resolutions = "4"
	ResolutionsMin5   Resolutions = "5"
	ResolutionsMin10  Resolutions = "10"
	ResolutionsMin15  Resolutions = "15"
	ResolutionsMin30  Resolutions = "30"
	ResolutionsMin45  Resolutions = "45"
	ResolutionsMin60  Resolutions = "60"
	ResolutionsMin120 Resolutions = "120"
	ResolutionsMin180 Resolutions = "180"
	ResolutionsMin240 Resolutions = "240"
	ResolutionsDay    Resolutions = "1D"
	ResolutionsWeek   Resolutions = "1W"
	ResolutionsMonth  Resolutions = "1M"
)
const (
	Min1   Resolutions = "1"
	Min2   Resolutions = "2"
	Min3   Resolutions = "3"
	Min4   Resolutions = "4"
	Min5   Resolutions = "5"
	Min10  Resolutions = "10"
	Min15  Resolutions = "15"
	Min30  Resolutions = "30"
	Min45  Resolutions = "45"
	Min60  Resolutions = "60"
	Min120 Resolutions = "120"
	Min180 Resolutions = "180"
	Min240 Resolutions = "240"
	Day1   Resolutions = "day"
	Week1  Resolutions = "week"
	Month1 Resolutions = "month"
)

type SchemeDetailsResponse

type SchemeDetailsResponse struct {
	AssetAllocation   []AssetAllocation   `json:"assetAllocation"`
	SectorAllocation  []SectorAllocation  `json:"sectorAllocation"`
	HoldingAllocation []HoldingAllocation `json:"holdingAllocation"`
	CMOTSDetails      SchemeMaster        `json:"cmotsDetails"`
	BseSchemeDetails  BseSchemeDetail     `json:"bseSchemeDetails"`
}

type SchemeMaster

type SchemeMaster struct {
	Isin                     string    `json:"isin"`
	Mfschcode                int       `json:"Mfschcode"`
	Mfcocode                 int       `json:"Mfcocode"`
	Amficode                 int       `json:"amficode"`
	CategoryCode             int       `json:"ClassCode"`
	Schname                  string    `json:"sch_name"`
	Navrs                    float64   `json:"navrs"`
	Navdate                  string    `json:"Navdate"`
	RtCode                   string    `json:"rtcode"`
	IsinReinvestment         string    `json:"isin_reinvestment"`
	FundManager              string    `json:"FundManager"`
	LaunchDateString         string    `json:"LaunchDate"`
	LaunchDate               time.Time `json:"launch_date"`
	InceptionDateString      string    `json:"InceptionDate"`
	InceptionDate            time.Time `json:"inception_date"`
	MinInvestment            float64   `json:"MinInvestment"`
	IncrementalInvestment    float64   `json:"IncrementalInvestment"`
	MinInvestmentSIP         float64   `json:"MinInvestment_SIP"`
	Frequency                string    `json:"frequency"`
	SchemeAUM                float64   `json:"SchemeAUM"`
	EntryLoad                string    `json:"EntrytLoad"`
	ExitLoad                 string    `json:"ExitLoad"`
	FundType                 string    `json:"FundType"`
	InvestmentType           string    `json:"InvestmentType"`
	MCAPCategory             string    `json:"MCAPCategory"`
	BMCode                   int       `json:"BM_code"`
	BMCodefloat              float64   `json:"BMCode"`
	BenchmarkName            string    `json:"BenchmarkName"`
	RiskometerValue          string    `json:"riskometervalue"`
	SchemeInvestmentType     string    `json:"SchemeInvestmentType"`
	SchemeType               string    `json:"SchemeType"`
	GroupCode                string    `json:"groupcode"`
	GroupName                string    `json:"groupname"`
	MaturityDate             string    `json:"maturitydate"`
	SubscriptionAvailability string    `json:"subscriptionavailability"`

	// 	Scheme Profile
	MaturityPeriod string  `json:"MaturityPeriod"`
	ExpRatio       float64 `json:"EXPRATIO"`
	TaxBName       string  `json:"taxbname"`
	TAXB           float64 `json:"TAXB"`
	SIPExitLoad    float64 `json:"SIP_Exitload"`

	//  Scheme ratios
	RatiosAsOnDate string  `json:"Date"`
	BETA           float64 `json:"BETA"`
	SD             float64 `json:"SD"`
	TREYNOR        float64 `json:"TREYNOR"`
	ALPHA          float64 `json:"ALPHA"`
	SHARPE         float64 `json:"SHARPE"`
	RSQUARE        float64 `json:"RSQUARE"`
	PTRatio        float64 `json:"PTRatio"`
	PE             float64 `json:"PE"`

	IsAllowed         bool
	SchemeReturns     SchemeReturns
	SchemeCAGR        SchemeReturns
	StdDeviation      SchemeStdDeviation
	CanonicalUrl      string `json:"canonical_url"`
	IsNfo             bool
	SubCategory_Theme string `json:"SubCategory_Theme"`
	Category          string `json:"Category"`
	FundRating        *int   `json:"fund_rating"`
}

type SchemeReturns

type SchemeReturns struct {
	Isin          string
	OneDay        float64
	OneWeek       float64
	OneMonth      float64
	ThreeMonth    float64
	SixMonth      float64
	OneYear       float64
	ThreeYear     float64
	FiveYear      float64
	TenYear       float64
	ThreeYearCagr float64
	Date          time.Time
}

type SchemeStdDeviation

type SchemeStdDeviation struct {
	Isin      string
	Date      time.Time
	OneYear   float64
	ThreeYear float64
	FiveYear  float64
	TenYear   float64
}

type SchemesDetails

type SchemesDetails struct {
	BseSchemeDetails BseSchemeDetail `json:"bseSchemeDetails"`
	CmotsDetails     SchemeMaster    `json:"cmotsDetails"`
	NfoDetails       FundOfferScheme `json:"nfoDetails"`
}

type SectorAllocation

type SectorAllocation struct {
	Isin           string    `json:"Isin"`
	Value          float64   `json:"VALUE"`
	PercentHolding float64   `json:"PERC_HOLD"`
	Sector         string    `json:"SECTOR"`
	AsOnDate       time.Time `json:"AsOnDate"`
}

type Sip

type Sip struct {
	ID                      int            `json:"ID"`
	CreatedAt               time.Time      `json:"CreatedAt"`
	UpdatedAt               time.Time      `json:"UpdatedAt"`
	DeletedAt               *time.Time     `json:"DeletedAt,omitempty"`
	TransactionCode         string         `json:"transactionCode"`
	Isin                    string         `json:"isin"`
	Amount                  float64        `json:"amount"`
	ClientCode              string         `json:"clientCode"`
	SchemeCode              string         `json:"schemeCode"`
	Remarks                 string         `json:"remarks"`
	StartDate               time.Time      `json:"startDate"`
	StartDay                int            `json:"startDay"`
	ModifiedStartDate       *time.Time     `json:"modifiedStartDate,omitempty"`
	MandateId               string         `json:"mandateId"`
	State                   string         `json:"state"`
	Frequency               string         `json:"frequency"`
	StepUp                  bool           `json:"stepUp"`
	StepUpFrequency         string         `json:"stepUpFrequency"`
	StepUpPercentage        float64        `json:"stepUpPercentage"`
	StepUpAmount            float64        `json:"stepUpAmount"`
	IsAmcSip                bool           `json:"isAmcSip"`
	InitialInvestmentAmount float64        `json:"initialInvestmentAmount"`
	BuySellType             string         `json:"buySellType"`
	NextInstallmentDate     *time.Time     `json:"nextInstallmentDate,omitempty"`
	MfLabId                 int            `json:"mfLabId"`
	PauseDate               *time.Time     `json:"pauseDate,omitempty"`
	PauseNoOfInstallments   int            `json:"pauseNoOfInstallments"`
	SwitchNoOfInstallments  int            `json:"switchNoOfInstallments"`
	InstallmentNumber       int            `json:"installmentNumber"`
	LastStepUpDate          *time.Time     `json:"lastStepUpDate,omitempty"`
	SchemeName              string         `json:"schemeName"`
	CoCode                  int            `json:"coCode"`
	SchemesDetails          SchemesDetails `json:"schemes_details"`
}

type SipsResponse

type SipsResponse struct {
	Status string `json:"status"`
	Data   []Sip  `json:"data"`
}

type SocketMessage

type SocketMessage struct {
	Type       string             `json:"type"`
	Data       *SocketMessageData `json:"data,omitempty"`
	AlertInfo  *AlertInfo         `json:"alert_info,omitempty"`
	Gtt        *GttInfo           `json:"gtt,omitempty"`
	ClientCode string             `json:"client_code,omitempty"`
}

type SocketMessageData

type SocketMessageData struct {
	OrderId                    string           `json:"order_id"`
	MiddlewareOrderId          uint             `json:"middleware_order_id"`
	TriggersGtt                bool             `json:"triggers_gtt"`
	OrderNumber                string           `json:"order_number"`
	AmoOrderId                 string           `json:"amo_order_id"`
	PlacedBy                   string           `json:"placed_by"`
	ModifiedBy                 string           `json:"modified_by"`
	Status                     OrderStatus      `json:"status"`
	StatusMessage              string           `json:"status_message"`
	Symbol                     string           `json:"symbol"`
	Series                     string           `json:"series"`
	InstrumentName             string           `json:"instrument_name"`
	Token                      int              `json:"token"`
	Exchange                   ExchangeTypes    `json:"exchange"`
	ExpiryDate                 string           `json:"expiry_date"`
	StrikePrice                float32          `json:"strike_price"`
	OptionType                 string           `json:"option_type"`
	TransactionType            TransactionTypes `json:"transaction_type"`
	Validity                   ValidityTypes    `json:"validity"`
	ValidityDays               int              `json:"validity_days"`
	Product                    ProductTypes     `json:"product"` //Intraday, Delivery or MTF
	Variety                    VarietyTypes     `json:"variety"` //regular , SL , SL-MKT,amo etc
	DisclosedQuantity          int              `json:"disclosed_quantity"`
	DisclosedQuantityRemaining int              `json:"disclosed_quantity_remaining"`
	TotalQuantity              int              `json:"total_quantity"`
	PendingQuantity            int              `json:"pending_quantity"`
	TradedQuantity             int              `json:"traded_quantity"`
	ThisTradeQuantity          int              `json:"this_trade_quantity,omitempty"`
	MarketType                 string           `json:"market_type"`
	OrderPrice                 float32          `json:"order_price"`
	TriggerPrice               float32          `json:"trigger_price"`
	CoverTriggerPrice          float32          `json:"cover_trigger_price"`
	TradedPrice                float32          `json:"traded_price"`
	IsAmo                      bool             `json:"is_amo"`
	OrderIdentifier            string           `json:"order_identifier"`
	InternalRemarks            string           `json:"internal_remarks"`
	OrderCreatedAt             string           `json:"order_created_at"`
	OrderUpdatedAt             string           `json:"order_updated_at"`
	TradeNumber                string           `json:"trade_number,omitempty"`
	TradeTime                  string           `json:"trade_time,omitempty"`
	MarketSegmentId            int              `json:"market_segment_id"`
	GtdOrderStatus             OrderStatus      `json:"gtd_order_status"`
	SequenceNumber             int              `json:"sequence_number"`
}

type StockWithGreek

type StockWithGreek struct {
	Token          int     `json:"token"`
	InstrumentName string  `json:"instrument_name"`
	LotSize        int     `json:"lot_size"`
	SecurityDesc   string  `json:"security_description"`
	Eligibility    int     `json:"eligibility"`
	Ltp            float64 `json:"ltp"`
	OpenInterest   int     `json:"open_interest"`
	DayFirstTickOI int     `json:"day_first_tick_oi" `
	Volume         int     `json:"volume"`
	Delta          float64 `json:"delta"`
}

type StrategiesRequest

type StrategiesRequest struct {
	Token       int    `json:"token"`       // Required: Token for authentication.
	Symbol      string `json:"symbol"`      // Required: Symbol for the underlying asset.
	ExpYYYYMMDD string `json:"expiry_date"` // Required: Expiry date of the strategy in format YYYYMMDD.
}

StrategiesRequest represents a request to retrieve strategies.

type StrategiesResponse

type StrategiesResponse struct {
	Status  string           `json:"status"`
	Message string           `json:"message"`
	Data    StrategiesResult `json:"data"`
}

type StrategiesResult

type StrategiesResult struct {
	Symbol     string     `json:"symbol"`
	Token      int        `json:"token"`
	Ltp        float64    `json:"ltp"`
	Strategies []Strategy `json:"strategies"`
}

type Strategy

type Strategy struct {
	Name                 string               `json:"strategy_name"`
	TradingOpportunities []TradingOpportunity `json:"trading_opportunities"`
}

type StrategyBuilderRequest

type StrategyBuilderRequest struct {
	Token      int            `json:"token"`       // Required: Token of the underlying instrument.
	Symbol     string         `json:"symbol"`      // Required: Symbol of the underlying instrument.
	MarketView PredictionType `json:"prediction"`  // Required: Prediction type. Should be one of ["ABOVE", "BELOW", "BETWEEN"]
	ExpiryDate string         `json:"expiry_date"` // Required: Expiry date of options in format: YYYYMMDD
	PriceRange []float64      `json:"price_range"` // Price range for the strategy.
}

type StrategyLeg

type StrategyLeg struct {
	Option   StrategyStock `json:"option"`
	Action   string        `json:"action"`
	Quantity int           `json:"quantity"`
}

type StrategyStock

type StrategyStock struct {
	Token          int           `json:"token"`
	InstrumentName string        `json:"instrument_name"`
	Symbol         string        `json:"symbol"`
	StrikePrice    float64       `json:"strike_price"`
	OptionType     OptionType    `json:"option_type"`
	LotSize        int           `json:"lot_size"`
	SecurityDesc   string        `json:"security_description"`
	Exchange       ExchangeTypes `json:"exchange"`
	ExpYyyymmdd    string        `json:"expiry_date"`
	Ltp            float64       `json:"ltp"`
	Greeks         struct {
		Theta float64 `json:"theta"`
		Delta float64 `json:"delta"`
		Gamma float64 `json:"gamma"`
		Vega  float64 `json:"vega"`
		Iv    float64 `json:"iv"`
	} `json:"greeks"`
}

type TagInfo

type TagInfo struct {
	Id          int       `json:"id"`
	ClientCode  string    `json:"client_code"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type TagRequest

type TagRequest struct {
	Name        string `json:"name"`        // Name of the tag.
	Description string `json:"description"` // Description of the tag.
}

TagRequest represents a request to create a tag.

type TagResponse

type TagResponse struct {
	Status  string  `json:"status"`
	Message string  `json:"message"`
	Data    TagInfo `json:"data"`
}

type TagsResponse

type TagsResponse struct {
	Status  string    `json:"status"`
	Message string    `json:"message"`
	Data    []TagInfo `json:"data"`
}

type TimeSeries

type TimeSeries struct {
	Date  time.Time `json:"date"`
	Value float64   `json:"value"`
}

type Trade

type Trade struct {
	Ticker          string           `json:"ticker"`
	OrderID         string           `json:"order_id"`
	Exchange        ExchangeTypes    `json:"exchange"`
	Token           int              `json:"token"`
	TradeNo         string           `json:"trade_no"`
	ExchangeOrderNo string           `json:"exchange_order_no"`
	TransactionType TransactionTypes `json:"transaction_type"`
	Product         ProductTypes     `json:"product"`
	Variety         VarietyTypes     `json:"variety"`
	TradeQuantity   int              `json:"trade_quantity"`
	TradePrice      float64          `json:"trade_price"`
	Symbol          string           `json:"symbol"`
	Series          string           `json:"series"`
	InstrumentName  string           `json:"instrument_name"`
	ExpiryDate      string           `json:"expiry_date"`
	StrikePrice     float64          `json:"strike_price"`
	OptionType      OptionType       `json:"option_type"`
	TradedAt        string           `json:"traded_at"`
	InitiatedBy     string           `json:"initiated_by"`
	ModifiedBy      string           `json:"modified_by"`
	OrderIdentifier string           `json:"order_identifier"`
}

type TradeBookResponse

type TradeBookResponse struct {
	Status   string  `json:"status"`
	Trades   []Trade `json:"trades"`
	Metadata struct {
		TotalRecords int `json:"total_records"`
	} `json:"metadata"`
}

type TradingOpportunity

type TradingOpportunity struct {
	Legs             []StrategyLeg `json:"legs"`
	MaxLoss          float64       `json:"max_loss"`
	MaxProfit        float64       `json:"max_profit"`
	IsInfiniteProfit bool          `json:"is_infinite_profit"`
	IsInfiniteLoss   bool          `json:"is_infinite_loss"`
	BreakEven        []float64     `json:"breakeven"`
}

type Trail

type Trail struct {
	ID             uint           `json:"id"`
	TrailJumpPoint *float64       `json:"trail_jump_point"`
	TrailJumpType  *TrailJumpType `json:"trail_jump_type"`
	TriggerTrail   *float64       `json:"trigger_trail"` // This is only used for gtt order book not for accepting the value, we are using ltp as current trail while creating
	TrailFirstJump *float64       `json:"trail_first_jump"`
}

type TrailJumpType

type TrailJumpType string
const (
	TrailJumpTypePercent TrailJumpType = "Percent"
	TrailJumpTypePoint   TrailJumpType = "Point"
)

type TransactionTypes

type TransactionTypes string
const (
	TransactionTypesBUY  TransactionTypes = "BUY"
	TransactionTypesSELL TransactionTypes = "SELL"
)

type UpdateAlertRequest

type UpdateAlertRequest struct {
	BasketID     *int
	Condition    AlertCondition
	Exchange     ExchangeTypes
	Name         string
	Note         string
	Property     AlertProperty
	Token        int
	TriggerValue float64
}

type UserData

type UserData struct {
	AccessToken  string   `json:"access_token"`
	UserName     string   `json:"user_name"`
	LoginTime    string   `json:"login_time"`
	Email        string   `json:"email"`
	Mobile       string   `json:"mobile"`
	Exchanges    []string `json:"exchanges"`
	ProductTypes []string `json:"product_types"`
	Others       struct {
		UserCode string `json:"userCode"`
		POA      int    `json:"POA"`
	} `json:"others"`
	UserID        string `json:"user_id"`
	TradingActive bool   `json:"tradingActive"`
}

type ValidityTypes

type ValidityTypes string
const (
	ValidityTypesFullDay           ValidityTypes = "DAY"
	ValidityTypesImmediateOrCancel ValidityTypes = "IOC"
	ValidityTypesAfterMarket       ValidityTypes = "AMO"
)

type VarietyTypes

type VarietyTypes string
const (
	VarietyTypesRegularLimitOrder  VarietyTypes = "RL"
	VarietyTypesRegularMarketOrder VarietyTypes = "RL-MKT"
	VarietyTypesStopLimitOrder     VarietyTypes = "SL"
	VarietyTypesStopMarketOrder    VarietyTypes = "SL-MKT"
)

type VortexApi

type VortexApi struct {
	AccessToken string
	// contains filtered or unexported fields
}

VortexApi is a struct representing the Vortex API client

func (*VortexApi) Banks

func (v *VortexApi) Banks(ctx context.Context) (*BanksResponse, error)

Banks retrieves a list of banks from the Vortex API. It returns a BanksResponse containing the list of banks and an error if any.

func (*VortexApi) BasketMargin

func (v *VortexApi) BasketMargin(ctx context.Context, request *BasketMarginRequest) (*BasketMarginResponse, error)

BasketMargin gets the required margin to place a collection of new orders in the Vortex API. It takes a context and an BasketMarginRequest as input. It returns a BasketMarginResponse and an error.

func (*VortexApi) BuildStrategy

BuildStrategy initiates the strategy building process with the Vortex API based on the provided StrategyBuilderRequest. It takes a context and a StrategyBuilderRequest as input. It returns a StrategiesResponse and an error.

func (*VortexApi) CancelGttOrder

func (v *VortexApi) CancelGttOrder(ctx context.Context, gtt_order_id string) (*OrderResponse, error)

CancelGttOrder cancels an existing Good Till Trigger (GTT) order with the Vortex API. It takes a context and a GTT order ID as input. It returns an OrderResponse and an error.

func (*VortexApi) CancelIcebergOrder

func (v *VortexApi) CancelIcebergOrder(ctx context.Context, iceberg_order_id string) (*CancelIcebergOrderResponse, error)

CancelIcebergOrder cancels an existing iceberg order with the Vortex API. It takes a context and an iceberg order ID as input. It returns a CancelIcebergOrderResponse and an error.

func (*VortexApi) CancelMultipleRegularOrders

func (v *VortexApi) CancelMultipleRegularOrders(ctx context.Context, req MultipleOrderCancelRequest) (*MultipleOrderResponse, error)

func (*VortexApi) CancelOrder

func (v *VortexApi) CancelOrder(ctx context.Context, orderID string) (*OrderResponse, error)

CancelOrder cancels an existing order with the Vortex API. It takes a context, an ExchangeTypes value, and an order ID as input. It returns an OrderResponse and an error.

func (*VortexApi) ConvertPosition

func (*VortexApi) CreateAlert

func (v *VortexApi) CreateAlert(ctx context.Context, request *CreateAlertRequest) (*CreateAlertResponse, error)

func (*VortexApi) CreateBasket

func (v *VortexApi) CreateBasket(ctx context.Context, request *CreateBasketRequest) (*BasketOrder, error)

func (*VortexApi) CreateTag

func (v *VortexApi) CreateTag(ctx context.Context, request TagRequest) (*TagResponse, error)

CreateTag creates a new tag with the Vortex API. It takes a context and a TagRequest as input. It returns a TagResponse and an error.

func (*VortexApi) DeleteAlert

func (v *VortexApi) DeleteAlert(ctx context.Context, alertID int) (*ModifyAlertResponse, error)

func (*VortexApi) DeleteBasket

func (v *VortexApi) DeleteBasket(ctx context.Context, basketID int) (*ModifyBasketResponse, error)

func (*VortexApi) DeleteTag

func (v *VortexApi) DeleteTag(ctx context.Context, tag_id int) (*TagResponse, error)

DeleteTag deletes an existing tag with the Vortex API. It takes a context and a tag ID as input. It returns a TagResponse and an error.

func (*VortexApi) DownloadMaster

func (v *VortexApi) DownloadMaster(ctx context.Context) ([]map[string]string, error)

DownloadMaster retrieves the master data from the Vortex API. It returns a slice of maps representing the CSV records and an error if any.

func (*VortexApi) ExchangeToken

func (v *VortexApi) ExchangeToken(ctx context.Context, auth_token string) (*LoginResponse, error)

ExchangeToken exchanges auth token received for the access_token from the Vortex API. It takes a context and auth_token as input. If the login is successful, the method updates the accessToken field of the VortexApi instance. It returns the LoginResponse and an error.

func (*VortexApi) FundDetails

func (v *VortexApi) FundDetails(ctx context.Context, isin string) (*MfDetailResponse, error)

func (*VortexApi) FundNavs

func (v *VortexApi) FundNavs(ctx context.Context, isin string) (*NAVResponse, error)

func (*VortexApi) Funds

func (v *VortexApi) Funds(ctx context.Context) (*FundsResponse, error)

Funds retrieves the funds information from the Vortex API. It returns a FundsResponse containing the funds information and an error if any.

func (*VortexApi) GetAlerts

func (v *VortexApi) GetAlerts(ctx context.Context) (*AlertBook, error)

func (*VortexApi) GetBaskets

func (v *VortexApi) GetBaskets(ctx context.Context) (*Baskets, error)

func (*VortexApi) GetFundOverlap

func (v *VortexApi) GetFundOverlap(ctx context.Context, isin string, amount float64) (*FundOverlapResponse, error)

func (*VortexApi) GetLoginUrl

func (v *VortexApi) GetLoginUrl() string

GetLoginUrl returns the login URL for the Vortex API

func (*VortexApi) GetOptionChain

func (v *VortexApi) GetOptionChain(ctx context.Context, req OptionChainRequest) (*OptionChainResponse, error)

GetOptionChain retrieves the option chain from the Vortex API based on the provided OptionChainRequest. It takes a context and an OptionChainRequest as input. It returns an OptionChainResponse and an error.

func (*VortexApi) GetPayoff

func (v *VortexApi) GetPayoff(ctx context.Context, req PayoffRequest) (*PayoffResponse, error)

GetPayoff calculates the payoff for strategies with the Vortex API based on the provided PayoffRequest. It takes a context and a PayoffRequest as input. It returns a PayoffResponse and an error.

func (*VortexApi) GetPortfolioImpact

func (v *VortexApi) GetPortfolioImpact(ctx context.Context, isin string, amount float64) (*PortfolioImpactResponse, error)

func (*VortexApi) GetStrategies

func (v *VortexApi) GetStrategies(ctx context.Context, req StrategiesRequest) (*StrategiesResponse, error)

GetStrategies retrieves strategies from the Vortex API based on the provided StrategiesRequest. It takes a context and a StrategiesRequest as input. It returns a StrategiesResponse and an error.

func (*VortexApi) GttOrders

func (v *VortexApi) GttOrders(ctx context.Context) (*GttOrderbookResponse, error)

GttOrders retrieves the Good Till Trigger (GTT) orderbook from the Vortex API. It takes a context as input. It returns a GttOrderbookResponse and an error.

func (*VortexApi) HistoricalCandles

func (v *VortexApi) HistoricalCandles(ctx context.Context, exchange ExchangeTypes, token int, from time.Time, to time.Time, resolution Resolutions) (*HistoricalResponse, error)

HistoricalCandles retrieves historical candlestick data from the Vortex API. It takes a context, an ExchangeTypes value, a token, a start time, an end time, and a resolution as input. It returns a HistoricalResponse and an error.

func (*VortexApi) Holdings

func (v *VortexApi) Holdings(ctx context.Context) (*HoldingsResponse, error)

Holdings retrieves the holdings information from the Vortex API. It returns a HoldingsResponse and an error.

func (*VortexApi) Login

func (v *VortexApi) Login(ctx context.Context, clientCode string, password string, totp string) (*LoginResponse, error)

Depricated: Use SSO Login instead. Login performs the login operation in the Vortex API. It takes a context, client code, password, and TOTP (Time-Based One-Time Password) as input. If the login is successful, the method updates the accessToken field of the VortexApi instance. It returns the LoginResponse and an error.

func (*VortexApi) Logout

func (v *VortexApi) Logout(ctx context.Context) (*LogoutResponse, error)

Logout logs the user out from the Vortex API and the access token is then no longer useful. It takes a context as input. It returns the LogoutResponse and an error.

func (*VortexApi) MFOrderBook

func (v *VortexApi) MFOrderBook(ctx context.Context)

func (*VortexApi) MfHoldings

func (v *VortexApi) MfHoldings(ctx context.Context) (*MfHoldingsResponse, error)

func (*VortexApi) ModifyGttOrder

func (v *VortexApi) ModifyGttOrder(ctx context.Context, gtt_order_id string, request ModifyGttRequest) (*OrderResponse, error)

ModifyGttOrder modifies an existing Good Till Trigger (GTT) order with the Vortex API. It takes a context, a GTT order ID, and a ModifyGttRequest as input. It returns an OrderResponse and an error.

func (*VortexApi) ModifyIcebergOrder

func (v *VortexApi) ModifyIcebergOrder(ctx context.Context, iceberg_order_id string, request ModifyIcebergOrderRequest) (*IcebergOrderResponse, error)

ModifyIcebergOrder modifies an existing iceberg order with the Vortex API. It takes a context, an iceberg order ID, and a ModifyIcebergOrderRequest as input. It returns an IcebergOrderResponse and an error.

func (*VortexApi) ModifyOrder

func (v *VortexApi) ModifyOrder(ctx context.Context, request ModifyOrderRequest, exchange ExchangeTypes, orderID string) (*OrderResponse, error)

ModifyOrder modifies an existing order with the Vortex API. It takes a context, a ModifyOrderRequest, an ExchangeTypes value, and an order ID as input. The request's Validity field is used to determine the ValidityDays value. It returns an OrderResponse and an error.

func (*VortexApi) OrderHistory

func (v *VortexApi) OrderHistory(ctx context.Context, orderId string) (*OrderHistoryResponse, error)

func (*VortexApi) OrderMargin

func (v *VortexApi) OrderMargin(ctx context.Context, request *OrderMarginRequest) (*MarginResponse, error)

OrderMargin gets the required margin to place or modify an order in the Vortex API. It takes a context and an OrderMarginRequest as input. It returns a MarginResponse and an error.

func (*VortexApi) Orders

func (v *VortexApi) Orders(ctx context.Context) (*OrderBookResponse, error)

Orders retrieves the order book information from the Vortex API. It takes a context, an offset, and a limit as input. It returns an OrderBookResponse and an error.

func (*VortexApi) PlaceGttOrder

func (v *VortexApi) PlaceGttOrder(ctx context.Context, request PlaceGttRequest) (*OrderResponse, error)

PlaceGttOrder places a Good Till Trigger (GTT) order with the Vortex API. It takes a context and a PlaceGttRequest as input. It returns an OrderResponse and an error.

func (*VortexApi) PlaceIcebergOrder

func (v *VortexApi) PlaceIcebergOrder(ctx context.Context, request PlaceIcebergOrderRequest) (*IcebergOrderResponse, error)

PlaceIcebergOrder places an iceberg order with the Vortex API. It takes a context and a PlaceIcebergOrderRequest as input. It returns an IcebergOrderResponse and an error.

func (*VortexApi) PlaceOrder

func (v *VortexApi) PlaceOrder(ctx context.Context, request PlaceOrderRequest) (*OrderResponse, error)

PlaceOrder places an order with the Vortex API. It takes a context and a PlaceOrderRequest as input. The request's Validity field is used to determine the ValidityDays and IsAMO values. It returns an OrderResponse and an error.

func (*VortexApi) Positions

func (v *VortexApi) Positions(ctx context.Context) (*PositionResponse, error)

Positions retrieves the positions information from the Vortex API. It returns a PositionsResponse and an error.

func (*VortexApi) Quotes

func (v *VortexApi) Quotes(ctx context.Context, instruments []string, mode QuoteModes) (*QuoteResponse, error)

Quotes retrieves real-time quote information for the specified instruments from the Vortex API. It takes a context, a slice of instrument names, and a quote mode as input. It returns a QuoteResponse and an error.

func (*VortexApi) SIPBook

func (v *VortexApi) SIPBook(ctx context.Context) (*SipsResponse, error)

func (*VortexApi) SSOLogin

func (v *VortexApi) SSOLogin(ctx context.Context, callback_param string) (string, error)

SSOLogin performs the login operation using Single Sign-On (SSO) in the Vortex API. It takes a context and a callback parameter as input. If the applicationId is not set, it returns an error. It returns a URL for the SSO login process. The User will be redirected to the callback url configured on the API Portal.

func (*VortexApi) SetAccessToken

func (v *VortexApi) SetAccessToken(accessToken string)

func (*VortexApi) SetBaseUrl

func (v *VortexApi) SetBaseUrl(newBaseUrl string)

func (*VortexApi) SetHTTPClient

func (v *VortexApi) SetHTTPClient(h *http.Client)

SetHTTPClient sets the HTTP client for the Vortex API client

func (*VortexApi) SetLogging

func (v *VortexApi) SetLogging(flag bool)

SetLogging sets the HTTP client with logging enabled

func (*VortexApi) Tags

func (v *VortexApi) Tags(ctx context.Context) (*TagsResponse, error)

Tags retrieves the list of tags from the Vortex API. It takes a context as input. It returns a TagsResponse and an error.

func (*VortexApi) TradeHistory

func (v *VortexApi) TradeHistory(ctx context.Context)

func (*VortexApi) Trades

func (v *VortexApi) Trades(ctx context.Context, offset int, limit int) (*TradeBookResponse, error)

Trades retrieves the trade book information from the Vortex API. It returns a TradeBookResponse and an error.

func (*VortexApi) UpdateAlert

func (v *VortexApi) UpdateAlert(ctx context.Context, alertID int, request *UpdateAlertRequest) (*ModifyAlertResponse, error)

func (*VortexApi) UpdateBasket

func (v *VortexApi) UpdateBasket(ctx context.Context, basketId int, request *ModifyBasketRequest) (*ModifyBasketResponse, error)

func (*VortexApi) UpdateTag

func (v *VortexApi) UpdateTag(ctx context.Context, tag_id int, request TagRequest) (*TagResponse, error)

UpdateTag updates an existing tag with the Vortex API. It takes a context, a tag ID, and a TagRequest as input. It returns a TagResponse and an error.

type Wire

type Wire struct {
	Conn *websocket.Conn
	// contains filtered or unexported fields
}

func (*Wire) Close

func (t *Wire) Close() error

func (*Wire) OnClose

func (t *Wire) OnClose(f func(code int, reason string))

Set a function to receive update whenever the socket closes

func (*Wire) OnConnect

func (t *Wire) OnConnect(f func())

Set a function to receive update whenever the socket is connected

func (*Wire) OnError

func (t *Wire) OnError(f func(err error))

Set a function to receive update whenever there is an error

func (*Wire) OnMessage

func (t *Wire) OnMessage(f func(messageType int, message []byte))

Set a function to receive raw message

func (*Wire) OnNoReconnect

func (t *Wire) OnNoReconnect(f func(attempt int))

func (*Wire) OnOrderUpdate

func (t *Wire) OnOrderUpdate(f func(order SocketMessage))

Set a function to receive Order Updates

func (*Wire) OnPriceUpdate

func (t *Wire) OnPriceUpdate(f func(*FullQuoteData))

Set a function to receive Price Updates

func (*Wire) OnReconnect

func (t *Wire) OnReconnect(f func(attempt int, delay time.Duration))

Set a function to receive update whenever the socket reconnects

func (*Wire) Resubscribe

func (t *Wire) Resubscribe()

func (*Wire) Serve

func (t *Wire) Serve()

Call this function to start the websocket server

func (*Wire) ServeWithContext

func (t *Wire) ServeWithContext(ctx context.Context)

Call this function to start the websocket server with a context

func (*Wire) SetAccessToken

func (t *Wire) SetAccessToken(accessToken string)

Use this function to change access token

func (*Wire) SetAutoReconnect

func (t *Wire) SetAutoReconnect(val bool)

Use this function to change auto reconnection setting. Default: true

func (*Wire) SetConnectTimeout

func (t *Wire) SetConnectTimeout(val time.Duration)

Use this function to change connection timeout value. Dafault: 7 seconds

func (*Wire) SetReconnectMaxDelay

func (t *Wire) SetReconnectMaxDelay(val time.Duration) error

Use this function to change max reconnection delay. Default: 60 seconds

func (*Wire) SetReconnectMaxRetries

func (t *Wire) SetReconnectMaxRetries(val int)

Use this function to change max connection retries. Default: 300

func (*Wire) SetRootURL

func (t *Wire) SetRootURL(u url.URL)

Use this function to set new url for websocket connection

func (*Wire) Stop

func (t *Wire) Stop()

Stop the wire instance and all the goroutines it has spawned.

func (*Wire) Subscribe

func (t *Wire) Subscribe(exchange ExchangeTypes, token int, mode QuoteModes)

Call this function to subscribe to an instrument

func (*Wire) Unsubscribe

func (t *Wire) Unsubscribe(exchange ExchangeTypes, token int, mode QuoteModes)

Call this function to unsubscribe an instrument

Directories

Path Synopsis
examples
api command
wire command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL