Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(bebop): move apiName to config #692

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/liquidity-source/bebop/client/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (c *HTTPClient) QuoteSingleOrderResult(ctx context.Context, params bebop.Qu
SetQueryParam(bebop.ParamsApproveType, "Standard").
SetQueryParam(bebop.ParamsSkipValidation, "true"). // not checking balance
SetQueryParam(bebop.ParamsGasLess, "false"). // self-execution
SetQueryParam(querySourceKey, c.config.Name)
SetQueryParam(querySourceKey, c.config.APIName)

var result bebop.QuoteSingleOrderResult
var fail bebop.QuoteFail
Expand Down
2 changes: 1 addition & 1 deletion pkg/liquidity-source/bebop/client/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestHTTPClient(t *testing.T) {
Duration: time.Second * 5,
},
RetryCount: 1,
Name: "",
APIName: "",
Authorization: "",
},
)
Expand Down
7 changes: 6 additions & 1 deletion pkg/liquidity-source/bebop/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ type HTTPClientConfig struct {
BaseURL string `mapstructure:"base_url" json:"base_url"`
Timeout durationjson.Duration `mapstructure:"timeout" json:"timeout"`
RetryCount int `mapstructure:"retry_count" json:"retry_count"`
Name string `mapstructure:"name" json:"name"`
APIName string `mapstructure:"api_name" json:"api_name"`
Authorization string `mapstructure:"authorization" json:"authorization"`
}

type Config struct {
DexID string `json:"dexId"`
HTTP HTTPClientConfig `mapstructure:"http" json:"http"`
}
5 changes: 0 additions & 5 deletions pkg/liquidity-source/bebop/rfq.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import (
"github.com/mitchellh/mapstructure"
)

type Config struct {
DexID string `json:"dexId"`
HTTP HTTPClientConfig `mapstructure:"http" json:"http"`
}

type IClient interface {
QuoteSingleOrderResult(ctx context.Context, params QuoteParams) (QuoteSingleOrderResult, error)
}
Expand Down
Loading