Documentation
¶
Overview ¶
Package jainam provides Jainam API Go, developed by Sreenivasulu Malkari.
Index ¶
- Constants
- func Checksum(userID, authCode, apiSecret string) string
- func DoubleSHA256(v string) string
- func LoginURL(appCode string) string
- func ParseContractCSV(r io.Reader) ([]map[string]string, error)
- type APIError
- type Client
- func (c *Client) CancelOrder(ctx context.Context, id string, confirmed bool) (map[string]any, error)
- func (c *Client) ContractURL(exchange, format string) (string, error)
- func (c *Client) CreateOrderWSToken(ctx context.Context) (map[string]any, error)
- func (c *Client) CreateWSSession(ctx context.Context) (map[string]any, error)
- func (c *Client) Do(ctx context.Context, method, path string, body any, result any) error
- func (c *Client) DownloadContracts(ctx context.Context, exchange, format, destination string) error
- func (c *Client) ExchangeAuthCode(ctx context.Context, userID, authCode, secret string) (map[string]any, error)
- func (c *Client) Funds(ctx context.Context) (map[string]any, error)
- func (c *Client) HistoricalData(ctx context.Context, token, resolution string, from, to int64, exchange string) (map[string]any, error)
- func (c *Client) Holdings(ctx context.Context, product string) (map[string]any, error)
- func (c *Client) InvalidateWSSession(ctx context.Context) (map[string]any, error)
- func (c *Client) ModifyOrder(ctx context.Context, id string, changes map[string]any, confirmed bool) (map[string]any, error)
- func (c *Client) OrderBook(ctx context.Context) (map[string]any, error)
- func (c *Client) OrderHistory(ctx context.Context, id string) (map[string]any, error)
- func (c *Client) OrderMargin(ctx context.Context, o Order) (map[string]any, error)
- func (c *Client) PlaceOrder(ctx context.Context, o Order, confirmed bool) (map[string]any, error)
- func (c *Client) Positions(ctx context.Context) (map[string]any, error)
- func (c *Client) Profile(ctx context.Context) (map[string]any, error)
- func (c *Client) SquareOff(ctx context.Context, o Order, confirmed bool) (map[string]any, error)
- func (c *Client) TradeBook(ctx context.Context) (map[string]any, error)
- type MarketTicker
- type MessageHandler
- type Option
- type Order
- type OrderTicker
Constants ¶
View Source
const DefaultBaseURL = "https://protrade.jainam.in/"
Variables ¶
This section is empty.
Functions ¶
func DoubleSHA256 ¶
Types ¶
type Client ¶
func (*Client) CancelOrder ¶
func (*Client) CreateOrderWSToken ¶
func (*Client) CreateWSSession ¶
func (*Client) DownloadContracts ¶
func (*Client) ExchangeAuthCode ¶
func (*Client) HistoricalData ¶
func (*Client) InvalidateWSSession ¶
func (*Client) ModifyOrder ¶
func (*Client) OrderHistory ¶
func (*Client) OrderMargin ¶
func (*Client) PlaceOrder ¶
type MarketTicker ¶
type MarketTicker struct {
UserID, UserSession string
Conn *websocket.Conn
OnMessage MessageHandler
// contains filtered or unexported fields
}
func (*MarketTicker) Close ¶
func (t *MarketTicker) Close() error
func (*MarketTicker) Connect ¶
func (t *MarketTicker) Connect() error
func (*MarketTicker) Subscribe ¶
func (t *MarketTicker) Subscribe(tokens [][2]string, depth bool) error
func (*MarketTicker) Unsubscribe ¶
func (t *MarketTicker) Unsubscribe(tokens [][2]string, depth bool) error
type MessageHandler ¶
type Order ¶
type Order struct {
Exchange string `json:"exchange"`
InstrumentID string `json:"instrumentId"`
TransactionType string `json:"transactionType"`
Quantity int `json:"quantity"`
Product string `json:"product"`
OrderComplexity string `json:"orderComplexity"`
OrderType string `json:"orderType"`
Price any `json:"price"`
Validity string `json:"validity"`
SLTriggerPrice any `json:"slTriggerPrice"`
TrailingSLAmount any `json:"trailingSlAmount,omitempty"`
APIOrderSource string `json:"apiOrderSource,omitempty"`
AlgoID string `json:"algoId,omitempty"`
MarketProtectionPercent any `json:"marketProtectionPercent,omitempty"`
DisclosedQuantity any `json:"disclosedQuantity,omitempty"`
OrderTag string `json:"orderTag,omitempty"`
}
type OrderTicker ¶
type OrderTicker struct {
UserID, OrderToken string
Conn *websocket.Conn
OnMessage MessageHandler
// contains filtered or unexported fields
}
func (*OrderTicker) Close ¶
func (t *OrderTicker) Close() error
func (*OrderTicker) Connect ¶
func (t *OrderTicker) Connect() error
Click to show internal directories.
Click to hide internal directories.