tokenpool

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package tokenpool provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostTokenPoolExecuteRequest

func NewPostTokenPoolExecuteRequest(server string, address string, body PostTokenPoolExecuteJSONRequestBody) (*http.Request, error)

NewPostTokenPoolExecuteRequest calls the generic PostTokenPoolExecute builder with application/json body

func NewPostTokenPoolExecuteRequestWithBody

func NewPostTokenPoolExecuteRequestWithBody(server string, address string, contentType string, body io.Reader) (*http.Request, error)

NewPostTokenPoolExecuteRequestWithBody constructs an http.Request for the PostTokenPoolExecute method, with any body, and a specified content type

func NewPostTokenPoolSendRequest

func NewPostTokenPoolSendRequest(server string, address string, body PostTokenPoolSendJSONRequestBody) (*http.Request, error)

NewPostTokenPoolSendRequest calls the generic PostTokenPoolSend builder with application/json body

func NewPostTokenPoolSendRequestWithBody

func NewPostTokenPoolSendRequestWithBody(server string, address string, contentType string, body io.Reader) (*http.Request, error)

NewPostTokenPoolSendRequestWithBody constructs an http.Request for the PostTokenPoolSend method, with any body, and a specified content type

func RegisterHandlers

func RegisterHandlers(router gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) PostTokenPoolExecute

func (c *Client) PostTokenPoolExecute(ctx context.Context, address string, body PostTokenPoolExecuteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PostTokenPoolExecute performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request. Takes a body of the `application/json` content type.

Get the explicit disclosures for executing a token transfer using this token pool.

func (*Client) PostTokenPoolExecuteWithBody

func (c *Client) PostTokenPoolExecuteWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PostTokenPoolExecuteWithBody performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request, with any type of body and a specified content type.

Get the explicit disclosures for executing a token transfer using this token pool.

func (*Client) PostTokenPoolSend

func (c *Client) PostTokenPoolSend(ctx context.Context, address string, body PostTokenPoolSendJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PostTokenPoolSend performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request. Takes a body of the `application/json` content type.

Get the explicit disclosures for sending a token transfer using this token pool.

func (*Client) PostTokenPoolSendWithBody

func (c *Client) PostTokenPoolSendWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PostTokenPoolSendWithBody performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request, with any type of body and a specified content type.

Get the explicit disclosures for sending a token transfer using this token pool.

type ClientInterface

type ClientInterface interface {

	// PostTokenPoolExecuteWithBody performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request,
	// with any type of body and a specified content type.
	//
	// Get the explicit disclosures for executing a token transfer using this token pool.
	PostTokenPoolExecuteWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostTokenPoolExecute performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request.
	// Takes a body of the `application/json` content type.
	//
	// Get the explicit disclosures for executing a token transfer using this token pool.
	PostTokenPoolExecute(ctx context.Context, address string, body PostTokenPoolExecuteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostTokenPoolSendWithBody performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request,
	// with any type of body and a specified content type.
	//
	// Get the explicit disclosures for sending a token transfer using this token pool.
	PostTokenPoolSendWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostTokenPoolSend performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request.
	// Takes a body of the `application/json` content type.
	//
	// Get the explicit disclosures for sending a token transfer using this token pool.
	PostTokenPoolSend(ctx context.Context, address string, body PostTokenPoolSendJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) PostTokenPoolExecuteWithBodyWithResponse

func (c *ClientWithResponses) PostTokenPoolExecuteWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTokenPoolExecuteResponse, error)

PostTokenPoolExecuteWithBodyWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request, with any type of body and a specified content type.

Get the explicit disclosures for executing a token transfer using this token pool.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) PostTokenPoolExecuteWithResponse

func (c *ClientWithResponses) PostTokenPoolExecuteWithResponse(ctx context.Context, address string, body PostTokenPoolExecuteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTokenPoolExecuteResponse, error)

PostTokenPoolExecuteWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Get the explicit disclosures for executing a token transfer using this token pool.

func (*ClientWithResponses) PostTokenPoolSendWithBodyWithResponse

func (c *ClientWithResponses) PostTokenPoolSendWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTokenPoolSendResponse, error)

PostTokenPoolSendWithBodyWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request, with any type of body and a specified content type.

Get the explicit disclosures for sending a token transfer using this token pool.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) PostTokenPoolSendWithResponse

func (c *ClientWithResponses) PostTokenPoolSendWithResponse(ctx context.Context, address string, body PostTokenPoolSendJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTokenPoolSendResponse, error)

PostTokenPoolSendWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Get the explicit disclosures for sending a token transfer using this token pool.

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// PostTokenPoolExecuteWithBodyWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request,
	// with any type of body and a specified content type.
	//
	// Get the explicit disclosures for executing a token transfer using this token pool.
	//
	// Returns a wrapper object for the known response body format(s).
	PostTokenPoolExecuteWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTokenPoolExecuteResponse, error)

	// PostTokenPoolExecuteWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/execute (the `PostTokenPoolExecute` operationId) request.
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Get the explicit disclosures for executing a token transfer using this token pool.
	PostTokenPoolExecuteWithResponse(ctx context.Context, address string, body PostTokenPoolExecuteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTokenPoolExecuteResponse, error)

	// PostTokenPoolSendWithBodyWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request,
	// with any type of body and a specified content type.
	//
	// Get the explicit disclosures for sending a token transfer using this token pool.
	//
	// Returns a wrapper object for the known response body format(s).
	PostTokenPoolSendWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTokenPoolSendResponse, error)

	// PostTokenPoolSendWithResponse performs a POST /ccip/v1/external/tokenPool/{address}/send (the `PostTokenPoolSend` operationId) request.
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Get the explicit disclosures for sending a token transfer using this token pool.
	PostTokenPoolSendWithResponse(ctx context.Context, address string, body PostTokenPoolSendJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTokenPoolSendResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type PostTokenPoolExecuteJSONRequestBody

type PostTokenPoolExecuteJSONRequestBody = TokenPoolExecuteRequest

PostTokenPoolExecuteJSONRequestBody defines body for PostTokenPoolExecute for application/json ContentType.

type PostTokenPoolExecuteResponse

type PostTokenPoolExecuteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *TokenPoolExecuteResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *externalRef0.N400
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *externalRef0.N404
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *externalRef0.N500
}

func ParsePostTokenPoolExecuteResponse

func ParsePostTokenPoolExecuteResponse(rsp *http.Response) (*PostTokenPoolExecuteResponse, error)

ParsePostTokenPoolExecuteResponse parses an HTTP response from a PostTokenPoolExecuteWithResponse call

func (PostTokenPoolExecuteResponse) ContentType

func (r PostTokenPoolExecuteResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PostTokenPoolExecuteResponse) GetBody

func (r PostTokenPoolExecuteResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PostTokenPoolExecuteResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PostTokenPoolExecuteResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (PostTokenPoolExecuteResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (PostTokenPoolExecuteResponse) GetJSON500

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (PostTokenPoolExecuteResponse) Status

Status returns HTTPResponse.Status

func (PostTokenPoolExecuteResponse) StatusCode

func (r PostTokenPoolExecuteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostTokenPoolSendJSONRequestBody

type PostTokenPoolSendJSONRequestBody = TokenPoolSendRequest

PostTokenPoolSendJSONRequestBody defines body for PostTokenPoolSend for application/json ContentType.

type PostTokenPoolSendResponse

type PostTokenPoolSendResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *TokenPoolSendResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *externalRef0.N400
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *externalRef0.N404
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *externalRef0.N500
}

func ParsePostTokenPoolSendResponse

func ParsePostTokenPoolSendResponse(rsp *http.Response) (*PostTokenPoolSendResponse, error)

ParsePostTokenPoolSendResponse parses an HTTP response from a PostTokenPoolSendWithResponse call

func (PostTokenPoolSendResponse) ContentType

func (r PostTokenPoolSendResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PostTokenPoolSendResponse) GetBody

func (r PostTokenPoolSendResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PostTokenPoolSendResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PostTokenPoolSendResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (PostTokenPoolSendResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (PostTokenPoolSendResponse) GetJSON500

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (PostTokenPoolSendResponse) Status

func (r PostTokenPoolSendResponse) Status() string

Status returns HTTPResponse.Status

func (PostTokenPoolSendResponse) StatusCode

func (r PostTokenPoolSendResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ServerInterface

type ServerInterface interface {

	// (POST /ccip/v1/external/tokenPool/{address}/execute)
	PostTokenPoolExecute(c *gin.Context, address string)

	// (POST /ccip/v1/external/tokenPool/{address}/send)
	PostTokenPoolSend(c *gin.Context, address string)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) PostTokenPoolExecute

func (siw *ServerInterfaceWrapper) PostTokenPoolExecute(c *gin.Context)

PostTokenPoolExecute operation middleware

func (*ServerInterfaceWrapper) PostTokenPoolSend

func (siw *ServerInterfaceWrapper) PostTokenPoolSend(c *gin.Context)

PostTokenPoolSend operation middleware

type TokenPoolExecuteRequest

type TokenPoolExecuteRequest struct {
	// EncodedMessage The CCIP message to be executed, encoded as a hex string.
	EncodedMessage string `json:"encodedMessage"`

	// Receiver The unique identifier of a party.
	//
	// Example: some-party::1220131b86f50178e6f7aabe62ef79e79b4964a526a1c557776409f448cbcd2406ce
	Receiver externalRef0.PartyId `json:"receiver"`
}

TokenPoolExecuteRequest defines model for TokenPoolExecuteRequest.

type TokenPoolExecuteResponse

type TokenPoolExecuteResponse struct {
	// ContextData The context to be passed along to the token pool.
	ContextData map[string]interface{} `json:"contextData"`

	// ContractId The unique identifier of a contract.
	//
	// Example: 00929f6a675c128bb54bef77a8cad8d330badd4330cf71f6a19b596b01f4b66b2dca121220cd655ce27fae64bdf6a203fcd987727de81c3762e46b1882ce2c2fbf0a72c64f
	ContractId         externalRef0.ContractId          `json:"contractId"`
	DisclosedContracts []externalRef0.DisclosedContract `json:"disclosedContracts"`

	// InstanceAddress The InstanceAddress of a contract, the keccak256 hash of the RawInstanceAddress.
	//
	// Example: 0x9d24274102a5d2f57506d48dee1394e33f7cef9a9c0920ee714d6f4a216a21a9
	InstanceAddress externalRef0.InstanceAddress `json:"instanceAddress"`

	// RawInstanceAddress The raw InstanceAddress of a contract, in the form of "prefix@owner", where prefix is the InstanceId of the contract.
	//
	// Example: some-contract-fgtlw@ccipOwner::1220131b86f50178e6f7aabe62ef79e79b4964a526a1c557776409f448cbcd2406ce
	RawInstanceAddress externalRef0.RawInstanceAddress   `json:"rawInstanceAddress"`
	RequiredCCVs       []externalRef0.RawOrHashedAddress `json:"requiredCCVs"`
}

TokenPoolExecuteResponse defines model for TokenPoolExecuteResponse.

type TokenPoolSendRequest

type TokenPoolSendRequest struct {
	// Message A message to be sent from Canton.
	Message externalRef0.Message `json:"message"`
}

TokenPoolSendRequest defines model for TokenPoolSendRequest.

type TokenPoolSendResponse

type TokenPoolSendResponse struct {
	// ContextData The context to be passed along to the token pool.
	ContextData map[string]interface{} `json:"contextData"`

	// ContractId The unique identifier of a contract.
	//
	// Example: 00929f6a675c128bb54bef77a8cad8d330badd4330cf71f6a19b596b01f4b66b2dca121220cd655ce27fae64bdf6a203fcd987727de81c3762e46b1882ce2c2fbf0a72c64f
	ContractId         externalRef0.ContractId          `json:"contractId"`
	DisclosedContracts []externalRef0.DisclosedContract `json:"disclosedContracts"`

	// InstanceAddress The InstanceAddress of a contract, the keccak256 hash of the RawInstanceAddress.
	//
	// Example: 0x9d24274102a5d2f57506d48dee1394e33f7cef9a9c0920ee714d6f4a216a21a9
	InstanceAddress externalRef0.InstanceAddress `json:"instanceAddress"`

	// RawInstanceAddress The raw InstanceAddress of a contract, in the form of "prefix@owner", where prefix is the InstanceId of the contract.
	//
	// Example: some-contract-fgtlw@ccipOwner::1220131b86f50178e6f7aabe62ef79e79b4964a526a1c557776409f448cbcd2406ce
	RawInstanceAddress externalRef0.RawInstanceAddress   `json:"rawInstanceAddress"`
	RequiredCCVs       []externalRef0.RawOrHashedAddress `json:"requiredCCVs"`
}

TokenPoolSendResponse defines model for TokenPoolSendResponse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL