Documentation
¶
Index ¶
- func CallsToBindings(calls []Call) []bindings.SolverNetCall
- func ExpensesToBindings(expenses []Expense) []solvernet.Expense
- type AddrAmt
- type Call
- type CheckRequest
- type CheckResponse
- type ContractsResponse
- type Expense
- type JSONError
- type JSONErrorResponse
- type QuoteRequest
- type QuoteResponse
- type RejectReason
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallsToBindings ¶ added in v0.14.0
func CallsToBindings(calls []Call) []bindings.SolverNetCall
func ExpensesToBindings ¶ added in v0.14.0
Types ¶
type AddrAmt ¶ added in v0.14.0
AddrAmt represents a token address and amount pair, with the amount being optional. If amount is nil or zero, quote response should inform the amount.
func (AddrAmt) MarshalJSON ¶ added in v0.14.0
func (*AddrAmt) UnmarshalJSON ¶ added in v0.14.0
type Call ¶ added in v0.14.0
Call wraps solvernet.Call to provide custom json marshaling.
func (Call) MarshalJSON ¶ added in v0.14.0
func (*Call) UnmarshalJSON ¶ added in v0.14.0
type CheckRequest ¶ added in v0.13.0
type CheckRequest struct {
SourceChainID uint64 `json:"sourceChainId"`
DestinationChainID uint64 `json:"destChainId"`
FillDeadline uint32 `json:"fillDeadline"`
Calls []Call `json:"calls"`
Expenses []Expense `json:"expenses"`
Deposit AddrAmt `json:"deposit"`
}
CheckRequest is the expected request body for the /api/v1/check endpoint.
NOTE: Check request / response types mirror SolvertNet.OrderData, built specifically for EVM -> EVM orders via SolverNetInbox / Outbox contracts, with ERC7683 type hash matching SolverNetInbox.ORDERDATA_TYPEHASH.
To support multiple order types with this api (e.g. EVM -> Solana, Solana -> EVM) we'd need a more generic request / response format that discriminates on order type hash.
type CheckResponse ¶ added in v0.13.0
type CheckResponse struct {
Accepted bool `json:"accepted"`
Rejected bool `json:"rejected"`
RejectCode RejectReason `json:"rejectCode"`
RejectReason string `json:"rejectReason"`
RejectDescription string `json:"rejectDescription"`
}
CheckResponse is the response json for the /check endpoint.
type ContractsResponse ¶ added in v0.13.0
type ContractsResponse struct {
Portal common.Address `json:"portal"`
Inbox common.Address `json:"inbox"`
Outbox common.Address `json:"outbox"`
Middleman common.Address `json:"middleman"`
Executor common.Address `json:"executor"`
}
ContractsResponse is the response json for the /api/vi/contracts endpoint.
type Expense ¶ added in v0.14.0
Expense wraps solvernet.Expense to provide custom json marshaling.
func (Expense) MarshalJSON ¶ added in v0.14.0
func (*Expense) UnmarshalJSON ¶ added in v0.14.0
type JSONErrorResponse ¶ added in v0.13.0
type JSONErrorResponse struct {
Error JSONError `json:"error"`
}
JSONErrorResponse is a json response for http errors (e.g 4xx, 5xx), not used for rejections.
type QuoteRequest ¶ added in v0.13.0
type QuoteRequest struct {
SourceChainID uint64 `json:"sourceChainId"`
DestinationChainID uint64 `json:"destChainId"`
Deposit AddrAmt `json:"deposit"`
Expense AddrAmt `json:"expense"`
}
QuoteRequest is the expected request body for the /api/v1/quote endpoint. If deposit amount is omitted, the response will include the required deposit amount. If expense amount is omitted, the response will include the required expense amount.
type QuoteResponse ¶ added in v0.13.0
type QuoteResponse struct {
Deposit AddrAmt `json:"deposit"`
Expense AddrAmt `json:"expense"`
Rejected bool `json:"rejected"`
RejectCode RejectReason `json:"rejectCode"`
RejectReason string `json:"rejectReason"`
RejectDescription string `json:"rejectDescription"`
}
QuoteResponse is the response json for the /api/v1/quote endpoint.
type RejectReason ¶ added in v0.13.0
type RejectReason uint8
const ( RejectNone RejectReason = 0 RejectDestCallReverts RejectReason = 1 RejectInvalidDeposit RejectReason = 2 RejectInvalidExpense RejectReason = 3 RejectInsufficientDeposit RejectReason = 4 RejectInsufficientInventory RejectReason = 5 RejectUnsupportedDeposit RejectReason = 6 RejectUnsupportedExpense RejectReason = 7 RejectUnsupportedDestChain RejectReason = 8 RejectUnsupportedSrcChain RejectReason = 9 RejectSameChain RejectReason = 10 RejectExpenseOverMax RejectReason = 11 RejectExpenseUnderMin RejectReason = 12 RejectCallNotAllowed RejectReason = 13 )
func (RejectReason) String ¶ added in v0.13.0
func (i RejectReason) String() string