synapsecns / sanguine

Synapse Monorepo
MIT License
38 stars 29 forks source link

[RFQ] Enable Message Passing linked to tokens #1805

Open trajan0x opened 8 months ago

trajan0x commented 8 months ago

Blocked by contracts or smnth, right?

greptile-apps[bot] commented 2 months ago

To enable message passing linked to tokens in the RFQ service, follow these steps:

  1. Update Swagger Definitions:

    • Modify swagger.yaml and swagger.json to include a new field message in PutQuoteRequest and GetQuoteResponse.
      model.PutQuoteRequest:
      properties:
      message:
       type: string
      model.GetQuoteResponse:
      properties:
      message:
       type: string
  2. Update API Models:

    • Modify response.go to include the Message field in GetQuoteResponse and PutQuoteRequest structs.
      type GetQuoteResponse struct {
      // existing fields...
      Message string `json:"message"`
      }
      type PutQuoteRequest struct {
      // existing fields...
      Message string `json:"message"`
      }
  3. Update Database Models:

    • Modify model.go to include the Message field in RequestForQuote struct.
      type RequestForQuote struct {
      // existing fields...
      Message string
      }
  4. Update Quoter Logic:

    • Modify quoter.go to handle the Message field when generating and submitting quotes.
      func (m *Manager) generateQuote(ctx context.Context, keyTokenID string, chainID int, address common.Address, balance *big.Int, destRFQAddr string) (quote *model.PutQuoteRequest, err error) {
      // existing logic...
      quote = &model.PutQuoteRequest{
      // existing fields...
      Message: "Your custom message",
      }
      return quote, nil
      }

References

/services/rfq/api/docs/swagger.yaml /services/rfq/api/docs/swagger.json /services/rfq/api/model/response.go /services/rfq/relayer/reldb/base/model.go /services/rfq/relayer/quoter/quoter.go /services/rfq/api /docs/bridge/docs/rfq/API /docs/bridge/docs/rfq/Relayer

Ask Greptile