mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
104 lines
4.2 KiB
Go
104 lines
4.2 KiB
Go
// Package euronext implements the broker Provider interface for Euronext,
|
|
// the pan-EU exchange operating in Paris, Amsterdam, Brussels, Lisbon, Dublin, Oslo.
|
|
package euronext
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/luxfi/broker/pkg/provider"
|
|
"github.com/luxfi/broker/pkg/types"
|
|
)
|
|
|
|
const (
|
|
ProdURL = "https://api.euronext.com"
|
|
SandboxURL = "https://api.sandbox.euronext.com"
|
|
)
|
|
|
|
type Config struct {
|
|
BaseURL string `json:"base_url"`
|
|
APIKey string `json:"-"`
|
|
APISecret string `json:"-"`
|
|
}
|
|
|
|
type Provider struct {
|
|
cfg Config
|
|
client *http.Client
|
|
}
|
|
|
|
var _ provider.Provider = (*Provider)(nil)
|
|
|
|
func New(cfg Config) *Provider {
|
|
if cfg.BaseURL == "" {
|
|
cfg.BaseURL = SandboxURL
|
|
}
|
|
return &Provider{cfg: cfg, client: &http.Client{Timeout: 30 * time.Second}}
|
|
}
|
|
|
|
func (p *Provider) Name() string { return "euronext" }
|
|
func (p *Provider) CreateAccount(_ context.Context, _ *types.CreateAccountRequest) (*types.Account, error) {
|
|
return nil, fmt.Errorf("euronext: CreateAccount not implemented")
|
|
}
|
|
func (p *Provider) GetAccount(_ context.Context, _ string) (*types.Account, error) {
|
|
return nil, fmt.Errorf("euronext: GetAccount not implemented")
|
|
}
|
|
func (p *Provider) ListAccounts(_ context.Context) ([]*types.Account, error) {
|
|
return nil, fmt.Errorf("euronext: ListAccounts not implemented")
|
|
}
|
|
func (p *Provider) GetPortfolio(_ context.Context, _ string) (*types.Portfolio, error) {
|
|
return nil, fmt.Errorf("euronext: GetPortfolio not implemented")
|
|
}
|
|
func (p *Provider) CreateOrder(_ context.Context, _ string, _ *types.CreateOrderRequest) (*types.Order, error) {
|
|
return nil, fmt.Errorf("euronext: CreateOrder not implemented")
|
|
}
|
|
func (p *Provider) ListOrders(_ context.Context, _ string) ([]*types.Order, error) {
|
|
return nil, fmt.Errorf("euronext: ListOrders not implemented")
|
|
}
|
|
func (p *Provider) GetOrder(_ context.Context, _, _ string) (*types.Order, error) {
|
|
return nil, fmt.Errorf("euronext: GetOrder not implemented")
|
|
}
|
|
func (p *Provider) CancelOrder(_ context.Context, _, _ string) error {
|
|
return fmt.Errorf("euronext: CancelOrder not implemented")
|
|
}
|
|
func (p *Provider) CreateTransfer(_ context.Context, _ string, _ *types.CreateTransferRequest) (*types.Transfer, error) {
|
|
return nil, fmt.Errorf("euronext: CreateTransfer not implemented")
|
|
}
|
|
func (p *Provider) ListTransfers(_ context.Context, _ string) ([]*types.Transfer, error) {
|
|
return nil, fmt.Errorf("euronext: ListTransfers not implemented")
|
|
}
|
|
func (p *Provider) CreateBankRelationship(_ context.Context, _, _, _, _, _ string) (*types.BankRelationship, error) {
|
|
return nil, fmt.Errorf("euronext: CreateBankRelationship not implemented")
|
|
}
|
|
func (p *Provider) ListBankRelationships(_ context.Context, _ string) ([]*types.BankRelationship, error) {
|
|
return nil, fmt.Errorf("euronext: ListBankRelationships not implemented")
|
|
}
|
|
func (p *Provider) ListAssets(_ context.Context, _ string) ([]*types.Asset, error) {
|
|
return nil, fmt.Errorf("euronext: ListAssets not implemented")
|
|
}
|
|
func (p *Provider) GetAsset(_ context.Context, _ string) (*types.Asset, error) {
|
|
return nil, fmt.Errorf("euronext: GetAsset not implemented")
|
|
}
|
|
func (p *Provider) GetSnapshot(_ context.Context, _ string) (*types.MarketSnapshot, error) {
|
|
return nil, fmt.Errorf("euronext: GetSnapshot not implemented")
|
|
}
|
|
func (p *Provider) GetSnapshots(_ context.Context, _ []string) (map[string]*types.MarketSnapshot, error) {
|
|
return nil, fmt.Errorf("euronext: GetSnapshots not implemented")
|
|
}
|
|
func (p *Provider) GetBars(_ context.Context, _, _, _, _ string, _ int) ([]*types.Bar, error) {
|
|
return nil, fmt.Errorf("euronext: GetBars not implemented")
|
|
}
|
|
func (p *Provider) GetLatestTrades(_ context.Context, _ []string) (map[string]*types.Trade, error) {
|
|
return nil, fmt.Errorf("euronext: GetLatestTrades not implemented")
|
|
}
|
|
func (p *Provider) GetLatestQuotes(_ context.Context, _ []string) (map[string]*types.Quote, error) {
|
|
return nil, fmt.Errorf("euronext: GetLatestQuotes not implemented")
|
|
}
|
|
func (p *Provider) GetClock(_ context.Context) (*types.MarketClock, error) {
|
|
return nil, fmt.Errorf("euronext: GetClock not implemented")
|
|
}
|
|
func (p *Provider) GetCalendar(_ context.Context, _, _ string) ([]*types.MarketCalendarDay, error) {
|
|
return nil, fmt.Errorf("euronext: GetCalendar not implemented")
|
|
}
|