Documentation ¶
Index ¶
- func ReplacePathVariable(path, pathVarName string, value interface{}) (string, error)
- type ActionService
- type Client
- type Config
- type Environment
- type OrderbookService
- func (s *OrderbookService) CreateOrder(ctx context.Context, params models.CreateOrderParams) (*models.CreateOrderResponse, *http.Response, error)
- func (s *OrderbookService) GetActiveOrdersWithPermit(ctx context.Context, params models.GetActiveOrdersWithPermitParams) ([]models.OrderResponse, *http.Response, error)
- func (s *OrderbookService) GetAllOrders(ctx context.Context, params models.GetAllOrdersParams) ([]models.OrderResponse, *http.Response, error)
- func (s *OrderbookService) GetCount(ctx context.Context, params models.GetCountParams) (*models.CountResponse, *http.Response, error)
- func (s *OrderbookService) GetEvent(ctx context.Context, params models.GetEventParams) (*models.EventResponse, *http.Response, error)
- func (s *OrderbookService) GetEvents(ctx context.Context, params models.GetEventsParams) ([]models.EventResponse, *http.Response, error)
- func (s *OrderbookService) GetOrdersByCreatorAddress(ctx context.Context, params models.GetOrdersByCreatorAddressParams) ([]models.OrderResponse, *http.Response, error)
- type SwapService
- func (s *SwapService) ExecuteSwap(ctx context.Context, config *models.ExecuteSwapConfig) error
- func (s *SwapService) GetApproveAllowance(ctx context.Context, params models.ApproveAllowanceParams) (*models.AllowanceResponse, *http.Response, error)
- func (s *SwapService) GetApproveSpender(ctx context.Context, params models.ApproveSpenderParams) (*models.SpenderResponse, *http.Response, error)
- func (s *SwapService) GetApproveTransaction(ctx context.Context, params models.ApproveTransactionParams) (*models.ApproveCallDataResponse, *http.Response, error)
- func (s *SwapService) GetLiquiditySources(ctx context.Context, params models.GetLiquiditySourcesParams) (*models.ProtocolsResponse, *http.Response, error)
- func (s *SwapService) GetQuote(ctx context.Context, params models.GetQuoteParams) (*models.QuoteResponse, *http.Response, error)
- func (s *SwapService) GetSwap(ctx context.Context, params models.GetSwapParams) (*models.SwapResponse, *http.Response, error)
- func (s *SwapService) GetTokens(ctx context.Context, params models.GetTokensParams) (*models.TokensResponse, *http.Response, error)
- type Web3ProviderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReplacePathVariable ¶
ReplacePathVariable replaces the path variable in the given URL with the specified value.
Types ¶
type ActionService ¶
type ActionService service
type Client ¶
type Client struct { // Ethereum client map EthClientMap map[int]*ethclient.Client // The URL of the 1inch API ApiBaseURL *url.URL // The API key to use for authentication ApiKey string // When present, tests will simulate swaps on Tenderly NonceCache map[string]uint64 // Isolated namespaces for each API Actions *ActionService SwapApi *SwapService OrderbookApi *OrderbookService // contains filtered or unexported fields }
func NewClient ¶
NewClient creates and initializes a new Client instance based on the provided Config.
type Config ¶
type Config struct { DevPortalApiKey string Web3HttpProviders []Web3ProviderConfig }
type Environment ¶
type Environment string
type OrderbookService ¶
type OrderbookService service
func (*OrderbookService) CreateOrder ¶
func (s *OrderbookService) CreateOrder(ctx context.Context, params models.CreateOrderParams) (*models.CreateOrderResponse, *http.Response, error)
CreateOrder creates an order in the Limit Order Protocol
func (*OrderbookService) GetActiveOrdersWithPermit ¶
func (s *OrderbookService) GetActiveOrdersWithPermit(ctx context.Context, params models.GetActiveOrdersWithPermitParams) ([]models.OrderResponse, *http.Response, error)
GetActiveOrdersWithPermit returns all orders in the Limit Order Protocol that are active and have a valid permit
func (*OrderbookService) GetAllOrders ¶
func (s *OrderbookService) GetAllOrders(ctx context.Context, params models.GetAllOrdersParams) ([]models.OrderResponse, *http.Response, error)
GetAllOrders returns all orders in the Limit Order Protocol
func (*OrderbookService) GetCount ¶
func (s *OrderbookService) GetCount(ctx context.Context, params models.GetCountParams) (*models.CountResponse, *http.Response, error)
GetCount returns the number of orders in the Limit Order Protocol
func (*OrderbookService) GetEvent ¶
func (s *OrderbookService) GetEvent(ctx context.Context, params models.GetEventParams) (*models.EventResponse, *http.Response, error)
GetEvent returns an event in the Limit Order Protocol by order hash
func (*OrderbookService) GetEvents ¶
func (s *OrderbookService) GetEvents(ctx context.Context, params models.GetEventsParams) ([]models.EventResponse, *http.Response, error)
GetEvents returns all events in the Limit Order Protocol
func (*OrderbookService) GetOrdersByCreatorAddress ¶
func (s *OrderbookService) GetOrdersByCreatorAddress(ctx context.Context, params models.GetOrdersByCreatorAddressParams) ([]models.OrderResponse, *http.Response, error)
GetOrdersByCreatorAddress returns all orders created by a given address in the Limit Order Protocol
type SwapService ¶
type SwapService service
func (*SwapService) ExecuteSwap ¶
func (s *SwapService) ExecuteSwap(ctx context.Context, config *models.ExecuteSwapConfig) error
ExecuteSwap executes a swap on the Ethereum blockchain using swap data generated by GetSwap
func (*SwapService) GetApproveAllowance ¶
func (s *SwapService) GetApproveAllowance(ctx context.Context, params models.ApproveAllowanceParams) (*models.AllowanceResponse, *http.Response, error)
GetApproveAllowance returns the allowance the 1inch router has to spend a token on behalf of a wallet
func (*SwapService) GetApproveSpender ¶
func (s *SwapService) GetApproveSpender(ctx context.Context, params models.ApproveSpenderParams) (*models.SpenderResponse, *http.Response, error)
GetApproveSpender returns the address of the 1inch router contract
func (*SwapService) GetApproveTransaction ¶
func (s *SwapService) GetApproveTransaction(ctx context.Context, params models.ApproveTransactionParams) (*models.ApproveCallDataResponse, *http.Response, error)
GetApproveTransaction returns the transaction data for approving the 1inch router to spend a token on behalf of a wallet
func (*SwapService) GetLiquiditySources ¶
func (s *SwapService) GetLiquiditySources(ctx context.Context, params models.GetLiquiditySourcesParams) (*models.ProtocolsResponse, *http.Response, error)
GetLiquiditySources returns all liquidity sources tracked by the 1inch Aggregation Protocol for a given chain
func (*SwapService) GetQuote ¶
func (s *SwapService) GetQuote(ctx context.Context, params models.GetQuoteParams) (*models.QuoteResponse, *http.Response, error)
GetQuote returns the quote for a potential swap through the Aggregation Protocol
func (*SwapService) GetSwap ¶
func (s *SwapService) GetSwap(ctx context.Context, params models.GetSwapParams) (*models.SwapResponse, *http.Response, error)
GetSwap returns a swap quote with transaction data that can be used to execute a swap through the Aggregation Protocol
func (*SwapService) GetTokens ¶
func (s *SwapService) GetTokens(ctx context.Context, params models.GetTokensParams) (*models.TokensResponse, *http.Response, error)
GetTokens returns all tokens officially tracked by the 1inch Aggregation Protocol for a given chain
type Web3ProviderConfig ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
Package orderbook provides primitives to interact with the openapi HTTP API.
|
Package orderbook provides primitives to interact with the openapi HTTP API. |