From 79d98e8d67c3adddaef9e38f7d053ff51b270fef Mon Sep 17 00:00:00 2001 From: Tanner Moore Date: Mon, 6 Jan 2025 21:54:12 -0700 Subject: [PATCH] cleanup unused structs and endpoints --- sdk-clients/fusionplus/api.go | 31 ------------------ .../fusionplus/fusionplus_types_extended.go | 32 ------------------- sdk-clients/fusionplus/validation.go | 9 ------ 3 files changed, 72 deletions(-) diff --git a/sdk-clients/fusionplus/api.go b/sdk-clients/fusionplus/api.go index 79c9dcf..6d94acb 100644 --- a/sdk-clients/fusionplus/api.go +++ b/sdk-clients/fusionplus/api.go @@ -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 -} diff --git a/sdk-clients/fusionplus/fusionplus_types_extended.go b/sdk-clients/fusionplus/fusionplus_types_extended.go index 1ed329d..2493d83 100644 --- a/sdk-clients/fusionplus/fusionplus_types_extended.go +++ b/sdk-clients/fusionplus/fusionplus_types_extended.go @@ -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 @@ -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"` @@ -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"` diff --git a/sdk-clients/fusionplus/validation.go b/sdk-clients/fusionplus/validation.go index 99d83ab..6122063 100644 --- a/sdk-clients/fusionplus/validation.go +++ b/sdk-clients/fusionplus/validation.go @@ -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)