mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
feat(broker): adapter stubs for sdx, adgm, securrency, cssf, euronext, xetra
Six new venue adapters for CH, AE, EU jurisdictions. Each implements provider.Provider with all methods returning ErrNotImplemented — enough to register, dispatch, and show up in superadmin. - sdx: SIX Digital Exchange (Switzerland, FINMA) - adgm: ADGM RegS venues (Abu Dhabi, FSRA) - securrency: DFSA-licensed digital securities (Dubai DIFC) - cssf: Luxembourg DLT securities rail (CSSF) - euronext: Pan-EU exchange (Paris, Amsterdam, Brussels, Lisbon, Dublin, Oslo) - xetra: Deutsche Boerse / Xetra (Germany, BaFin)
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
// Package adgm implements the broker Provider interface for ADGM (Abu Dhabi Global Market, FSRA).
|
||||
// Supports Reg S institutional venues.
|
||||
package adgm
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/broker/pkg/provider"
|
||||
"github.com/luxfi/broker/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProdURL = "https://api.adgm.com"
|
||||
SandboxURL = "https://api.sandbox.adgm.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 "adgm" }
|
||||
func (p *Provider) CreateAccount(_ context.Context, _ *types.CreateAccountRequest) (*types.Account, error) { return nil, fmt.Errorf("adgm: CreateAccount not implemented") }
|
||||
func (p *Provider) GetAccount(_ context.Context, _ string) (*types.Account, error) { return nil, fmt.Errorf("adgm: GetAccount not implemented") }
|
||||
func (p *Provider) ListAccounts(_ context.Context) ([]*types.Account, error) { return nil, fmt.Errorf("adgm: ListAccounts not implemented") }
|
||||
func (p *Provider) GetPortfolio(_ context.Context, _ string) (*types.Portfolio, error) { return nil, fmt.Errorf("adgm: GetPortfolio not implemented") }
|
||||
func (p *Provider) CreateOrder(_ context.Context, _ string, _ *types.CreateOrderRequest) (*types.Order, error) { return nil, fmt.Errorf("adgm: CreateOrder not implemented") }
|
||||
func (p *Provider) ListOrders(_ context.Context, _ string) ([]*types.Order, error) { return nil, fmt.Errorf("adgm: ListOrders not implemented") }
|
||||
func (p *Provider) GetOrder(_ context.Context, _, _ string) (*types.Order, error) { return nil, fmt.Errorf("adgm: GetOrder not implemented") }
|
||||
func (p *Provider) CancelOrder(_ context.Context, _, _ string) error { return fmt.Errorf("adgm: CancelOrder not implemented") }
|
||||
func (p *Provider) CreateTransfer(_ context.Context, _ string, _ *types.CreateTransferRequest) (*types.Transfer, error) { return nil, fmt.Errorf("adgm: CreateTransfer not implemented") }
|
||||
func (p *Provider) ListTransfers(_ context.Context, _ string) ([]*types.Transfer, error) { return nil, fmt.Errorf("adgm: ListTransfers not implemented") }
|
||||
func (p *Provider) CreateBankRelationship(_ context.Context, _, _, _, _, _ string) (*types.BankRelationship, error) { return nil, fmt.Errorf("adgm: CreateBankRelationship not implemented") }
|
||||
func (p *Provider) ListBankRelationships(_ context.Context, _ string) ([]*types.BankRelationship, error) { return nil, fmt.Errorf("adgm: ListBankRelationships not implemented") }
|
||||
func (p *Provider) ListAssets(_ context.Context, _ string) ([]*types.Asset, error) { return nil, fmt.Errorf("adgm: ListAssets not implemented") }
|
||||
func (p *Provider) GetAsset(_ context.Context, _ string) (*types.Asset, error) { return nil, fmt.Errorf("adgm: GetAsset not implemented") }
|
||||
func (p *Provider) GetSnapshot(_ context.Context, _ string) (*types.MarketSnapshot, error) { return nil, fmt.Errorf("adgm: GetSnapshot not implemented") }
|
||||
func (p *Provider) GetSnapshots(_ context.Context, _ []string) (map[string]*types.MarketSnapshot, error) { return nil, fmt.Errorf("adgm: GetSnapshots not implemented") }
|
||||
func (p *Provider) GetBars(_ context.Context, _, _, _, _ string, _ int) ([]*types.Bar, error) { return nil, fmt.Errorf("adgm: GetBars not implemented") }
|
||||
func (p *Provider) GetLatestTrades(_ context.Context, _ []string) (map[string]*types.Trade, error) { return nil, fmt.Errorf("adgm: GetLatestTrades not implemented") }
|
||||
func (p *Provider) GetLatestQuotes(_ context.Context, _ []string) (map[string]*types.Quote, error) { return nil, fmt.Errorf("adgm: GetLatestQuotes not implemented") }
|
||||
func (p *Provider) GetClock(_ context.Context) (*types.MarketClock, error) { return nil, fmt.Errorf("adgm: GetClock not implemented") }
|
||||
func (p *Provider) GetCalendar(_ context.Context, _, _ string) ([]*types.MarketCalendarDay, error) { return nil, fmt.Errorf("adgm: GetCalendar not implemented") }
|
||||
@@ -0,0 +1,61 @@
|
||||
// Package cssf implements the broker Provider interface for CSSF-compliant
|
||||
// digital securities infrastructure in Luxembourg.
|
||||
package cssf
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/broker/pkg/provider"
|
||||
"github.com/luxfi/broker/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProdURL = "https://api.cssf-dlt.lu"
|
||||
SandboxURL = "https://api.sandbox.cssf-dlt.lu"
|
||||
)
|
||||
|
||||
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 "cssf" }
|
||||
func (p *Provider) CreateAccount(_ context.Context, _ *types.CreateAccountRequest) (*types.Account, error) { return nil, fmt.Errorf("cssf: CreateAccount not implemented") }
|
||||
func (p *Provider) GetAccount(_ context.Context, _ string) (*types.Account, error) { return nil, fmt.Errorf("cssf: GetAccount not implemented") }
|
||||
func (p *Provider) ListAccounts(_ context.Context) ([]*types.Account, error) { return nil, fmt.Errorf("cssf: ListAccounts not implemented") }
|
||||
func (p *Provider) GetPortfolio(_ context.Context, _ string) (*types.Portfolio, error) { return nil, fmt.Errorf("cssf: GetPortfolio not implemented") }
|
||||
func (p *Provider) CreateOrder(_ context.Context, _ string, _ *types.CreateOrderRequest) (*types.Order, error) { return nil, fmt.Errorf("cssf: CreateOrder not implemented") }
|
||||
func (p *Provider) ListOrders(_ context.Context, _ string) ([]*types.Order, error) { return nil, fmt.Errorf("cssf: ListOrders not implemented") }
|
||||
func (p *Provider) GetOrder(_ context.Context, _, _ string) (*types.Order, error) { return nil, fmt.Errorf("cssf: GetOrder not implemented") }
|
||||
func (p *Provider) CancelOrder(_ context.Context, _, _ string) error { return fmt.Errorf("cssf: CancelOrder not implemented") }
|
||||
func (p *Provider) CreateTransfer(_ context.Context, _ string, _ *types.CreateTransferRequest) (*types.Transfer, error) { return nil, fmt.Errorf("cssf: CreateTransfer not implemented") }
|
||||
func (p *Provider) ListTransfers(_ context.Context, _ string) ([]*types.Transfer, error) { return nil, fmt.Errorf("cssf: ListTransfers not implemented") }
|
||||
func (p *Provider) CreateBankRelationship(_ context.Context, _, _, _, _, _ string) (*types.BankRelationship, error) { return nil, fmt.Errorf("cssf: CreateBankRelationship not implemented") }
|
||||
func (p *Provider) ListBankRelationships(_ context.Context, _ string) ([]*types.BankRelationship, error) { return nil, fmt.Errorf("cssf: ListBankRelationships not implemented") }
|
||||
func (p *Provider) ListAssets(_ context.Context, _ string) ([]*types.Asset, error) { return nil, fmt.Errorf("cssf: ListAssets not implemented") }
|
||||
func (p *Provider) GetAsset(_ context.Context, _ string) (*types.Asset, error) { return nil, fmt.Errorf("cssf: GetAsset not implemented") }
|
||||
func (p *Provider) GetSnapshot(_ context.Context, _ string) (*types.MarketSnapshot, error) { return nil, fmt.Errorf("cssf: GetSnapshot not implemented") }
|
||||
func (p *Provider) GetSnapshots(_ context.Context, _ []string) (map[string]*types.MarketSnapshot, error) { return nil, fmt.Errorf("cssf: GetSnapshots not implemented") }
|
||||
func (p *Provider) GetBars(_ context.Context, _, _, _, _ string, _ int) ([]*types.Bar, error) { return nil, fmt.Errorf("cssf: GetBars not implemented") }
|
||||
func (p *Provider) GetLatestTrades(_ context.Context, _ []string) (map[string]*types.Trade, error) { return nil, fmt.Errorf("cssf: GetLatestTrades not implemented") }
|
||||
func (p *Provider) GetLatestQuotes(_ context.Context, _ []string) (map[string]*types.Quote, error) { return nil, fmt.Errorf("cssf: GetLatestQuotes not implemented") }
|
||||
func (p *Provider) GetClock(_ context.Context) (*types.MarketClock, error) { return nil, fmt.Errorf("cssf: GetClock not implemented") }
|
||||
func (p *Provider) GetCalendar(_ context.Context, _, _ string) ([]*types.MarketCalendarDay, error) { return nil, fmt.Errorf("cssf: GetCalendar not implemented") }
|
||||
@@ -0,0 +1,61 @@
|
||||
// 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") }
|
||||
@@ -0,0 +1,61 @@
|
||||
// Package sdx implements the broker Provider interface for SIX Digital Exchange (Switzerland, FINMA).
|
||||
// Supports tokenized securities and equities via the SDX API.
|
||||
package sdx
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/broker/pkg/provider"
|
||||
"github.com/luxfi/broker/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProdURL = "https://api.sdx.com"
|
||||
SandboxURL = "https://api.sandbox.sdx.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 "sdx" }
|
||||
func (p *Provider) CreateAccount(_ context.Context, _ *types.CreateAccountRequest) (*types.Account, error) { return nil, fmt.Errorf("sdx: CreateAccount not implemented") }
|
||||
func (p *Provider) GetAccount(_ context.Context, _ string) (*types.Account, error) { return nil, fmt.Errorf("sdx: GetAccount not implemented") }
|
||||
func (p *Provider) ListAccounts(_ context.Context) ([]*types.Account, error) { return nil, fmt.Errorf("sdx: ListAccounts not implemented") }
|
||||
func (p *Provider) GetPortfolio(_ context.Context, _ string) (*types.Portfolio, error) { return nil, fmt.Errorf("sdx: GetPortfolio not implemented") }
|
||||
func (p *Provider) CreateOrder(_ context.Context, _ string, _ *types.CreateOrderRequest) (*types.Order, error) { return nil, fmt.Errorf("sdx: CreateOrder not implemented") }
|
||||
func (p *Provider) ListOrders(_ context.Context, _ string) ([]*types.Order, error) { return nil, fmt.Errorf("sdx: ListOrders not implemented") }
|
||||
func (p *Provider) GetOrder(_ context.Context, _, _ string) (*types.Order, error) { return nil, fmt.Errorf("sdx: GetOrder not implemented") }
|
||||
func (p *Provider) CancelOrder(_ context.Context, _, _ string) error { return fmt.Errorf("sdx: CancelOrder not implemented") }
|
||||
func (p *Provider) CreateTransfer(_ context.Context, _ string, _ *types.CreateTransferRequest) (*types.Transfer, error) { return nil, fmt.Errorf("sdx: CreateTransfer not implemented") }
|
||||
func (p *Provider) ListTransfers(_ context.Context, _ string) ([]*types.Transfer, error) { return nil, fmt.Errorf("sdx: ListTransfers not implemented") }
|
||||
func (p *Provider) CreateBankRelationship(_ context.Context, _, _, _, _, _ string) (*types.BankRelationship, error) { return nil, fmt.Errorf("sdx: CreateBankRelationship not implemented") }
|
||||
func (p *Provider) ListBankRelationships(_ context.Context, _ string) ([]*types.BankRelationship, error) { return nil, fmt.Errorf("sdx: ListBankRelationships not implemented") }
|
||||
func (p *Provider) ListAssets(_ context.Context, _ string) ([]*types.Asset, error) { return nil, fmt.Errorf("sdx: ListAssets not implemented") }
|
||||
func (p *Provider) GetAsset(_ context.Context, _ string) (*types.Asset, error) { return nil, fmt.Errorf("sdx: GetAsset not implemented") }
|
||||
func (p *Provider) GetSnapshot(_ context.Context, _ string) (*types.MarketSnapshot, error) { return nil, fmt.Errorf("sdx: GetSnapshot not implemented") }
|
||||
func (p *Provider) GetSnapshots(_ context.Context, _ []string) (map[string]*types.MarketSnapshot, error) { return nil, fmt.Errorf("sdx: GetSnapshots not implemented") }
|
||||
func (p *Provider) GetBars(_ context.Context, _, _, _, _ string, _ int) ([]*types.Bar, error) { return nil, fmt.Errorf("sdx: GetBars not implemented") }
|
||||
func (p *Provider) GetLatestTrades(_ context.Context, _ []string) (map[string]*types.Trade, error) { return nil, fmt.Errorf("sdx: GetLatestTrades not implemented") }
|
||||
func (p *Provider) GetLatestQuotes(_ context.Context, _ []string) (map[string]*types.Quote, error) { return nil, fmt.Errorf("sdx: GetLatestQuotes not implemented") }
|
||||
func (p *Provider) GetClock(_ context.Context) (*types.MarketClock, error) { return nil, fmt.Errorf("sdx: GetClock not implemented") }
|
||||
func (p *Provider) GetCalendar(_ context.Context, _, _ string) ([]*types.MarketCalendarDay, error) { return nil, fmt.Errorf("sdx: GetCalendar not implemented") }
|
||||
@@ -0,0 +1,61 @@
|
||||
// Package securrency implements the broker Provider interface for Securrency (DIFC, DFSA-licensed).
|
||||
// Supports digital securities infrastructure in the Dubai International Financial Centre.
|
||||
package securrency
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/broker/pkg/provider"
|
||||
"github.com/luxfi/broker/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProdURL = "https://api.securrency.com"
|
||||
SandboxURL = "https://api.sandbox.securrency.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 "securrency" }
|
||||
func (p *Provider) CreateAccount(_ context.Context, _ *types.CreateAccountRequest) (*types.Account, error) { return nil, fmt.Errorf("securrency: CreateAccount not implemented") }
|
||||
func (p *Provider) GetAccount(_ context.Context, _ string) (*types.Account, error) { return nil, fmt.Errorf("securrency: GetAccount not implemented") }
|
||||
func (p *Provider) ListAccounts(_ context.Context) ([]*types.Account, error) { return nil, fmt.Errorf("securrency: ListAccounts not implemented") }
|
||||
func (p *Provider) GetPortfolio(_ context.Context, _ string) (*types.Portfolio, error) { return nil, fmt.Errorf("securrency: GetPortfolio not implemented") }
|
||||
func (p *Provider) CreateOrder(_ context.Context, _ string, _ *types.CreateOrderRequest) (*types.Order, error) { return nil, fmt.Errorf("securrency: CreateOrder not implemented") }
|
||||
func (p *Provider) ListOrders(_ context.Context, _ string) ([]*types.Order, error) { return nil, fmt.Errorf("securrency: ListOrders not implemented") }
|
||||
func (p *Provider) GetOrder(_ context.Context, _, _ string) (*types.Order, error) { return nil, fmt.Errorf("securrency: GetOrder not implemented") }
|
||||
func (p *Provider) CancelOrder(_ context.Context, _, _ string) error { return fmt.Errorf("securrency: CancelOrder not implemented") }
|
||||
func (p *Provider) CreateTransfer(_ context.Context, _ string, _ *types.CreateTransferRequest) (*types.Transfer, error) { return nil, fmt.Errorf("securrency: CreateTransfer not implemented") }
|
||||
func (p *Provider) ListTransfers(_ context.Context, _ string) ([]*types.Transfer, error) { return nil, fmt.Errorf("securrency: ListTransfers not implemented") }
|
||||
func (p *Provider) CreateBankRelationship(_ context.Context, _, _, _, _, _ string) (*types.BankRelationship, error) { return nil, fmt.Errorf("securrency: CreateBankRelationship not implemented") }
|
||||
func (p *Provider) ListBankRelationships(_ context.Context, _ string) ([]*types.BankRelationship, error) { return nil, fmt.Errorf("securrency: ListBankRelationships not implemented") }
|
||||
func (p *Provider) ListAssets(_ context.Context, _ string) ([]*types.Asset, error) { return nil, fmt.Errorf("securrency: ListAssets not implemented") }
|
||||
func (p *Provider) GetAsset(_ context.Context, _ string) (*types.Asset, error) { return nil, fmt.Errorf("securrency: GetAsset not implemented") }
|
||||
func (p *Provider) GetSnapshot(_ context.Context, _ string) (*types.MarketSnapshot, error) { return nil, fmt.Errorf("securrency: GetSnapshot not implemented") }
|
||||
func (p *Provider) GetSnapshots(_ context.Context, _ []string) (map[string]*types.MarketSnapshot, error) { return nil, fmt.Errorf("securrency: GetSnapshots not implemented") }
|
||||
func (p *Provider) GetBars(_ context.Context, _, _, _, _ string, _ int) ([]*types.Bar, error) { return nil, fmt.Errorf("securrency: GetBars not implemented") }
|
||||
func (p *Provider) GetLatestTrades(_ context.Context, _ []string) (map[string]*types.Trade, error) { return nil, fmt.Errorf("securrency: GetLatestTrades not implemented") }
|
||||
func (p *Provider) GetLatestQuotes(_ context.Context, _ []string) (map[string]*types.Quote, error) { return nil, fmt.Errorf("securrency: GetLatestQuotes not implemented") }
|
||||
func (p *Provider) GetClock(_ context.Context) (*types.MarketClock, error) { return nil, fmt.Errorf("securrency: GetClock not implemented") }
|
||||
func (p *Provider) GetCalendar(_ context.Context, _, _ string) ([]*types.MarketCalendarDay, error) { return nil, fmt.Errorf("securrency: GetCalendar not implemented") }
|
||||
@@ -0,0 +1,60 @@
|
||||
// Package xetra implements the broker Provider interface for Deutsche Boerse / Xetra (Germany, BaFin).
|
||||
package xetra
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/broker/pkg/provider"
|
||||
"github.com/luxfi/broker/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProdURL = "https://api.xetra.com"
|
||||
SandboxURL = "https://api.sandbox.xetra.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 "xetra" }
|
||||
func (p *Provider) CreateAccount(_ context.Context, _ *types.CreateAccountRequest) (*types.Account, error) { return nil, fmt.Errorf("xetra: CreateAccount not implemented") }
|
||||
func (p *Provider) GetAccount(_ context.Context, _ string) (*types.Account, error) { return nil, fmt.Errorf("xetra: GetAccount not implemented") }
|
||||
func (p *Provider) ListAccounts(_ context.Context) ([]*types.Account, error) { return nil, fmt.Errorf("xetra: ListAccounts not implemented") }
|
||||
func (p *Provider) GetPortfolio(_ context.Context, _ string) (*types.Portfolio, error) { return nil, fmt.Errorf("xetra: GetPortfolio not implemented") }
|
||||
func (p *Provider) CreateOrder(_ context.Context, _ string, _ *types.CreateOrderRequest) (*types.Order, error) { return nil, fmt.Errorf("xetra: CreateOrder not implemented") }
|
||||
func (p *Provider) ListOrders(_ context.Context, _ string) ([]*types.Order, error) { return nil, fmt.Errorf("xetra: ListOrders not implemented") }
|
||||
func (p *Provider) GetOrder(_ context.Context, _, _ string) (*types.Order, error) { return nil, fmt.Errorf("xetra: GetOrder not implemented") }
|
||||
func (p *Provider) CancelOrder(_ context.Context, _, _ string) error { return fmt.Errorf("xetra: CancelOrder not implemented") }
|
||||
func (p *Provider) CreateTransfer(_ context.Context, _ string, _ *types.CreateTransferRequest) (*types.Transfer, error) { return nil, fmt.Errorf("xetra: CreateTransfer not implemented") }
|
||||
func (p *Provider) ListTransfers(_ context.Context, _ string) ([]*types.Transfer, error) { return nil, fmt.Errorf("xetra: ListTransfers not implemented") }
|
||||
func (p *Provider) CreateBankRelationship(_ context.Context, _, _, _, _, _ string) (*types.BankRelationship, error) { return nil, fmt.Errorf("xetra: CreateBankRelationship not implemented") }
|
||||
func (p *Provider) ListBankRelationships(_ context.Context, _ string) ([]*types.BankRelationship, error) { return nil, fmt.Errorf("xetra: ListBankRelationships not implemented") }
|
||||
func (p *Provider) ListAssets(_ context.Context, _ string) ([]*types.Asset, error) { return nil, fmt.Errorf("xetra: ListAssets not implemented") }
|
||||
func (p *Provider) GetAsset(_ context.Context, _ string) (*types.Asset, error) { return nil, fmt.Errorf("xetra: GetAsset not implemented") }
|
||||
func (p *Provider) GetSnapshot(_ context.Context, _ string) (*types.MarketSnapshot, error) { return nil, fmt.Errorf("xetra: GetSnapshot not implemented") }
|
||||
func (p *Provider) GetSnapshots(_ context.Context, _ []string) (map[string]*types.MarketSnapshot, error) { return nil, fmt.Errorf("xetra: GetSnapshots not implemented") }
|
||||
func (p *Provider) GetBars(_ context.Context, _, _, _, _ string, _ int) ([]*types.Bar, error) { return nil, fmt.Errorf("xetra: GetBars not implemented") }
|
||||
func (p *Provider) GetLatestTrades(_ context.Context, _ []string) (map[string]*types.Trade, error) { return nil, fmt.Errorf("xetra: GetLatestTrades not implemented") }
|
||||
func (p *Provider) GetLatestQuotes(_ context.Context, _ []string) (map[string]*types.Quote, error) { return nil, fmt.Errorf("xetra: GetLatestQuotes not implemented") }
|
||||
func (p *Provider) GetClock(_ context.Context) (*types.MarketClock, error) { return nil, fmt.Errorf("xetra: GetClock not implemented") }
|
||||
func (p *Provider) GetCalendar(_ context.Context, _, _ string) ([]*types.MarketCalendarDay, error) { return nil, fmt.Errorf("xetra: GetCalendar not implemented") }
|
||||
Reference in New Issue
Block a user