Skip to content

Commit

Permalink
cleanup unused structs and endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanz0rz committed Jan 7, 2025
1 parent 9fda47a commit 79d98e8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 72 deletions.
31 changes: 0 additions & 31 deletions sdk-clients/fusionplus/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,34 +217,3 @@ func (api *api) PlaceOrder(ctx context.Context, quoteParams QuoterControllerGetQ

return fusionPlusOrder.Hash, nil
}

func (api *api) PlaceOrders(ctx context.Context, body []PlaceOrderBody) (*GetQuoteOutput, error) {
u := fmt.Sprintf("/fusion/relayer/v2.0/%d/order/submit/many", api.chainId)

for _, order := range body {
err := order.Validate()
if err != nil {
return nil, err
}
}

bodyMarshaled, err := json.Marshal(body)
if err != nil {
return nil, err
}

payload := common.RequestPayload{
Method: "GET",
Params: nil,
U: u,
Body: bodyMarshaled,
}

var response GetQuoteOutput
err = api.httpExecutor.ExecuteRequest(ctx, payload, &response)
if err != nil {
return nil, err
}

return &response, nil
}
32 changes: 0 additions & 32 deletions sdk-clients/fusionplus/fusionplus_types_extended.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,6 @@ type GetQuoteOutputFixed struct {
Whitelist []string `json:"whitelist"`
}

// Copy/paste

type PlaceOrderBody struct {
Maker string
MakerAsset string
MakerTraits string
MakingAmount string
Receiver string
TakerAsset string
TakingAmount string
}

type Order struct {
EscExtension *EscrowExtension
Inner orderbook.OrderData
Expand Down Expand Up @@ -221,21 +209,6 @@ type GasCostConfigClassFixed struct {
GasPriceEstimate uint32 `json:"gasPriceEstimate"`
}

//type Preset struct {
// AuctionDuration *big.Int `json:"auctionDuration"`
// StartAuctionIn *big.Int `json:"startAuctionIn"`
// BankFee *big.Int `json:"bankFee"`
// InitialRateBump *big.Int `json:"initialRateBump"`
// AuctionStartAmount *big.Int `json:"auctionStartAmount"`
// AuctionEndAmount *big.Int `json:"auctionEndAmount"`
// TokenFee *big.Int `json:"tokenFee"`
// Points []AuctionPointClass `json:"points"`
// GasCostInfo GasCostConfigClass `json:"gasCostInfo"`
// ExclusiveResolver *common.Address `json:"exclusiveResolver,omitempty"`
// AllowPartialFills bool `json:"allowPartialFills"`
// AllowMultipleFills bool `json:"allowMultipleFills"`
//}

type PreparedOrder struct {
Order Order `json:"order"`
Hash string `json:"hash"`
Expand All @@ -249,11 +222,6 @@ type AdditionalParams struct {
PrivateKey string
}

//type FusionOrderConstructor struct {
// SettlementExtension common.Address
// OrderInfo FusionOrderV4
//}

type Details struct {
Auction *AuctionDetails `json:"auction"`
Fees Fees `json:"fees"`
Expand Down
9 changes: 0 additions & 9 deletions sdk-clients/fusionplus/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ func (params *QuoterControllerGetQuoteWithCustomPresetsParams) Validate() error
return validate.ConsolidateValidationErorrs(validationErrors)
}

func (body *PlaceOrderBody) Validate() error {
var validationErrors []error
validationErrors = validate.Parameter(body.Maker, "Maker", validate.CheckEthereumAddressRequired, validationErrors)
validationErrors = validate.Parameter(body.MakerAsset, "MakerAsset", validate.CheckEthereumAddressRequired, validationErrors)
validationErrors = validate.Parameter(body.MakingAmount, "MakingAmount", validate.CheckBigIntRequired, validationErrors)
validationErrors = validate.Parameter(body.Receiver, "Receiver", validate.CheckEthereumAddressRequired, validationErrors)
return validate.ConsolidateValidationErorrs(validationErrors)
}

func (body *OrderParams) Validate() error {
var validationErrors []error
validationErrors = validate.Parameter(body.Receiver, "Receiver", validate.CheckEthereumAddressRequired, validationErrors)
Expand Down

0 comments on commit 79d98e8

Please sign in to comment.