mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
fix: set Account.ID from provider ID in Alpaca toUnified
Account.ID was empty causing SmartOrder to call /v1/trading/accounts//orders (double slash, 404).
This commit is contained in:
@@ -86,7 +86,6 @@ func (p *Provider) do(ctx context.Context, method, path string, body interface{}
|
||||
}
|
||||
|
||||
if resp.StatusCode >= 400 {
|
||||
fmt.Printf("[alpaca] %s %s → %d body=%s\n", method, fullURL, resp.StatusCode, string(data)[:min(len(data), 200)])
|
||||
var apiErr struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
@@ -150,6 +149,7 @@ type alpacaAccount struct {
|
||||
|
||||
func (a *alpacaAccount) toUnified() *types.Account {
|
||||
acct := &types.Account{
|
||||
ID: a.ID,
|
||||
Provider: "alpaca",
|
||||
ProviderID: a.ID,
|
||||
AccountNumber: a.AccountNumber,
|
||||
|
||||
Reference in New Issue
Block a user