From 7dbf6aa40614676940372b9301d264c86953fb91 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Sat, 27 Sep 2025 10:54:49 +0000 Subject: [PATCH 001/121] [AUTOMATED] Update: proto/clients/api.gen.go --- trails-api/api.gen.go | 1124 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1124 insertions(+) create mode 100644 trails-api/api.gen.go diff --git a/trails-api/api.gen.go b/trails-api/api.gen.go new file mode 100644 index 00000000..59538c98 --- /dev/null +++ b/trails-api/api.gen.go @@ -0,0 +1,1124 @@ +// trails-api v0.4.0 28a9163b0bcbdf5cecfc8f2b668550cc1ccadaf3 +// -- +// Code generated by webrpc-gen@v0.25.3 with golang generator. DO NOT EDIT. +// +// webrpc-gen -schema=api.ridl -target=golang -pkg=api -client -out=./clients/api.gen.go +package api + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/0xsequence/go-sequence/lib/prototyp" +) + +const WebrpcHeader = "Webrpc" + +const WebrpcHeaderValue = "webrpc@v0.25.3;gen-golang@v0.18.4;trails-api@v0.4.0" + +// WebRPC description and code-gen version +func WebRPCVersion() string { + return "v1" +} + +// Schema version of your RIDL schema +func WebRPCSchemaVersion() string { + return "v0.4.0" +} + +// Schema hash generated from your RIDL schema +func WebRPCSchemaHash() string { + return "28a9163b0bcbdf5cecfc8f2b668550cc1ccadaf3" +} + +type WebrpcGenVersions struct { + WebrpcGenVersion string + CodeGenName string + CodeGenVersion string + SchemaName string + SchemaVersion string +} + +func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error) { + if h.Get(WebrpcHeader) == "" { + return nil, fmt.Errorf("header is empty or missing") + } + + versions, err := parseWebrpcGenVersions(h.Get(WebrpcHeader)) + if err != nil { + return nil, fmt.Errorf("webrpc header is invalid: %w", err) + } + + return versions, nil +} + +func parseWebrpcGenVersions(header string) (*WebrpcGenVersions, error) { + versions := strings.Split(header, ";") + if len(versions) < 3 { + return nil, fmt.Errorf("expected at least 3 parts while parsing webrpc header: %v", header) + } + + _, webrpcGenVersion, ok := strings.Cut(versions[0], "@") + if !ok { + return nil, fmt.Errorf("webrpc gen version could not be parsed from: %s", versions[0]) + } + + tmplTarget, tmplVersion, ok := strings.Cut(versions[1], "@") + if !ok { + return nil, fmt.Errorf("tmplTarget and tmplVersion could not be parsed from: %s", versions[1]) + } + + schemaName, schemaVersion, ok := strings.Cut(versions[2], "@") + if !ok { + return nil, fmt.Errorf("schema name and schema version could not be parsed from: %s", versions[2]) + } + + return &WebrpcGenVersions{ + WebrpcGenVersion: webrpcGenVersion, + CodeGenName: tmplTarget, + CodeGenVersion: tmplVersion, + SchemaName: schemaName, + SchemaVersion: schemaVersion, + }, nil +} + +// +// Common types +// + +type TradeType string + +const ( + TradeType_EXACT_INPUT TradeType = "EXACT_INPUT" + TradeType_EXACT_OUTPUT TradeType = "EXACT_OUTPUT" +) + +func (x TradeType) MarshalText() ([]byte, error) { + return []byte(x), nil +} + +func (x *TradeType) UnmarshalText(b []byte) error { + *x = TradeType(string(b)) + return nil +} + +func (x *TradeType) Is(values ...TradeType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type SortOrder uint32 + +const ( + SortOrder_DESC SortOrder = 0 + SortOrder_ASC SortOrder = 1 +) + +var SortOrder_name = map[uint32]string{ + 0: "DESC", + 1: "ASC", +} + +var SortOrder_value = map[string]uint32{ + "DESC": 0, + "ASC": 1, +} + +func (x SortOrder) String() string { + return SortOrder_name[uint32(x)] +} + +func (x SortOrder) MarshalText() ([]byte, error) { + return []byte(SortOrder_name[uint32(x)]), nil +} + +func (x *SortOrder) UnmarshalText(b []byte) error { + *x = SortOrder(SortOrder_value[string(b)]) + return nil +} + +func (x *SortOrder) Is(values ...SortOrder) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type Version struct { + WebrpcVersion string `json:"webrpcVersion"` + SchemaVersion string `json:"schemaVersion"` + SchemaHash string `json:"schemaHash"` + AppVersion string `json:"appVersion"` +} + +type RuntimeStatus struct { + // overall status, true/false + HealthOK bool `json:"healthOK"` + StartTime time.Time `json:"startTime"` + Uptime uint64 `json:"uptime"` + Ver string `json:"ver"` + Branch string `json:"branch"` + CommitHash string `json:"commitHash"` + Checks *RuntimeChecks `json:"checks"` + NumTxnsRelayed map[string]*NumTxnsRelayed `json:"numTxnsRelayed"` +} + +type NumTxnsRelayed struct { + ChainID uint64 `json:"chainID"` + Prev uint64 `json:"prev"` + Current uint64 `json:"current"` + Period uint64 `json:"period"` +} + +type RuntimeChecks struct { +} + +// From: `0xsequence/relayer`: https://github.com/0xsequence/relayer/blob/2c695b820970c68c57bfe71810f469412cdec675/proto/relayer.ridl#L502 +// TODO: rename this to MetaTxnRaw (eventually), we can leave it for now to not break compat +// or name it, MetaTxnArgs ..? +type MetaTxn struct { + ID string `json:"id"` + ChainId prototyp.BigInt `json:"chainId"` + WalletAddress string `json:"walletAddress" db:"wallet_address"` + // TODO (later): rename this to `to: string` + Contract string `json:"contract" db:"to_address"` + // TODO: rename to 'execdata' + Input string `json:"input" db:"tx_data"` +} + +type Call struct { + To prototyp.Hash `json:"to"` + Value prototyp.BigInt `json:"value"` + Data prototyp.Hash `json:"data"` + GasLimit prototyp.BigInt `json:"gasLimit"` + DelegateCall *bool `json:"delegateCall"` + OnlyFallback *bool `json:"onlyFallback"` + BehaviorOnError *uint8 `json:"behaviorOnError"` +} + +type IntentCallsPayload struct { + ChainId prototyp.BigInt `json:"chainId"` + Space prototyp.BigInt `json:"space"` + Nonce prototyp.BigInt `json:"nonce"` + Calls []*Call `json:"calls"` +} + +// IntentConfig +type IntentConfig struct { + ID uint64 `json:"id" db:"id,omitempty"` + ConfigHash prototyp.Hash `json:"configHash" db:"config_hash"` + OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` + DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"destination_intent_address"` + MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` + Calls prototyp.JSONString `json:"calls" db:"calls"` + Preconditions prototyp.JSONString `json:"preconditions" db:"preconditions"` + ExecutionStatus *string `json:"executionStatus" db:"execution_status,omitempty"` + MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` + TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` +} + +type AddressOverrides struct { + TrailsLiFiSapientSignerAddress *string `json:"trailsLiFiSapientSignerAddress"` + TrailsRelaySapientSignerAddress *string `json:"trailsRelaySapientSignerAddress"` + TrailsCCTPV2SapientSignerAddress *string `json:"trailsCCTPV2SapientSignerAddress"` +} + +type TakerFee struct { + Address prototyp.Hash `json:"address"` + Bps uint64 `json:"bps"` +} + +type IntentPrecondition struct { + Type string `json:"type"` + ChainId prototyp.BigInt `json:"chainId"` + Data interface{} `json:"data"` +} + +type Token struct { + ChainId uint64 `json:"chainId"` + ContractAddress prototyp.Hash `json:"contractAddress"` + TokenId *string `json:"tokenId"` +} + +type Price struct { + Value float64 `json:"value"` + Currency string `json:"currency"` +} + +type TokenPrice struct { + Token *Token `json:"token"` + Price *Price `json:"price"` + Price24hChange *Price `json:"price24hChange"` + Price24hVol *Price `json:"price24hVol"` + FloorPrice *Price `json:"floorPrice,omitempty"` + BuyPrice *Price `json:"buyPrice,omitempty"` + SellPrice *Price `json:"sellPrice,omitempty"` + UpdatedAt *time.Time `json:"updatedAt"` +} + +type ExchangeRate struct { + Name string `json:"name"` + Symbol string `json:"symbol"` + Value float64 `json:"value"` + VsCurrency string `json:"vsCurrency"` + CurrencyType string `json:"currencyType"` +} + +// TOOD: refactor, we should be returning a cursor always.. +// see indexer/indexer.ridl Page object.. +// +// --- +// +// Page represents a results page. This can be used both to request a page and +// to store the state of a page. +type Page struct { + // Common for both numbered pages and cursor: Number of items per page + // TODO: REMOVE.. + PageSize *uint32 `json:"pageSize"` + // Numbered pages: Page number, this is multiplied by the value of the parameter. + // TODO: REMOVE.. + Page *uint32 `json:"page"` + // Number of total items on this query. + // TODO: REMOVE.. + TotalRecords *uint64 `json:"totalRecords"` + // Cursor: column to compare before/after to + Column *string `json:"column"` + // Cursor: return column < before - include to get previous page + Before *interface{} `json:"before"` + // Cursor: return column > after - include to get next page + After *interface{} `json:"after"` + // Sorting filter + Sort []*SortBy `json:"sort"` + // Indicates if there are more results available + More *bool `json:"more,omitempty"` +} + +type SortBy struct { + Column string `json:"column"` + Order SortOrder `json:"order"` +} + +type CCTPTransfer struct { + ID string `json:"id"` + SourceTxHash string `json:"sourceTxHash"` + SourceChainID uint64 `json:"sourceChainId"` + DestinationChainID uint64 `json:"destinationChainId"` + Message string `json:"message"` + Attestation string `json:"attestation"` + Status string `json:"status"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} + +type CrossChainFee struct { + ProviderFee prototyp.BigInt `json:"providerFee"` + TrailsSwapFee prototyp.BigInt `json:"trailsSwapFee"` + ProviderFeeUSD float64 `json:"providerFeeUSD"` + TrailsSwapFeeUSD float64 `json:"trailsSwapFeeUSD"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUSD"` +} + +type MetaTxnFeeDetail struct { + MetaTxnID string `json:"metaTxnID"` + EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` + FeeNative prototyp.BigInt `json:"feeNative"` +} + +type ChainExecuteQuote struct { + ChainId prototyp.BigInt `json:"chainId"` + TotalGasLimit prototyp.BigInt `json:"totalGasLimit"` + GasPrice prototyp.BigInt `json:"gasPrice"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + NativeTokenSymbol string `json:"nativeTokenSymbol"` + NativeTokenPrice float64 `json:"nativeTokenPrice"` + MetaTxnFeeDetails []*MetaTxnFeeDetail `json:"metaTxnFeeDetails"` + TotalFeeUSD float64 `json:"totalFeeUSD"` +} + +type ExecuteQuote struct { + ChainQuotes []*ChainExecuteQuote `json:"chainQuotes"` +} + +type TrailsFee struct { + ExecuteQuote *ExecuteQuote `json:"executeQuote"` + CrossChainFee *CrossChainFee `json:"crossChainFee"` + TakerFeeAmount prototyp.BigInt `json:"takerFeeAmount"` + TakerFeeUSD *float64 `json:"takerFeeUSD"` + TrailsFixedFeeUSD float64 `json:"trailsFixedFeeUSD"` + FeeToken prototyp.Hash `json:"feeToken"` + OriginTokenTotalAmount prototyp.BigInt `json:"originTokenTotalAmount"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUSD"` + QuoteProvider *string `json:"quoteProvider"` +} + +type IntentQuote struct { + FromAmount prototyp.BigInt `json:"fromAmount"` + FromAmountMin prototyp.BigInt `json:"fromAmountMin"` + ToAmount prototyp.BigInt `json:"toAmount"` + ToAmountMin prototyp.BigInt `json:"toAmountMin"` + PriceImpact float64 `json:"priceImpact"` + PriceImpactUsd string `json:"priceImpactUsd"` + MaxSlippage float64 `json:"maxSlippage"` + QuoteProvider string `json:"quoteProvider"` + QuoteProviderRequestId string `json:"quoteProviderRequestId"` + QuoteProviderFeeUsd string `json:"quoteProviderFeeUsd"` + FeeQuotes map[string]string `json:"feeQuotes"` +} + +var methods = map[string]method{ + "/rpc/API/Ping": { + Name: "Ping", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/Version": { + Name: "Version", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/RuntimeStatus": { + Name: "RuntimeStatus", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/Clock": { + Name: "Clock", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetIntentCallsPayloads": { + Name: "GetIntentCallsPayloads", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/CommitIntentConfig": { + Name: "CommitIntentConfig", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetIntentConfig": { + Name: "GetIntentConfig", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetCCTPTransfer": { + Name: "GetCCTPTransfer", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/QueueCCTPTransfer": { + Name: "QueueCCTPTransfer", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/QueueIntentConfigExecution": { + Name: "QueueIntentConfigExecution", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/GetIntentConfigExecutionStatus": { + Name: "GetIntentConfigExecutionStatus", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/ListIntentConfigs": { + Name: "ListIntentConfigs", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/QueueMetaTxnReceipt": { + Name: "QueueMetaTxnReceipt", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, +} + +func WebrpcMethods() map[string]method { + res := make(map[string]method, len(methods)) + for k, v := range methods { + res[k] = v + } + + return res +} + +var WebRPCServices = map[string][]string{ + "API": { + "Ping", + "Version", + "RuntimeStatus", + "Clock", + "GetIntentCallsPayloads", + "CommitIntentConfig", + "GetIntentConfig", + "GetCCTPTransfer", + "QueueCCTPTransfer", + "QueueIntentConfigExecution", + "GetIntentConfigExecutionStatus", + "ListIntentConfigs", + "QueueMetaTxnReceipt", + }, +} + +// +// Server types +// + +type API interface { + // + // Runtime + // + Ping(ctx context.Context) (bool, error) + Version(ctx context.Context) (*Version, error) + RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) + Clock(ctx context.Context) (time.Time, error) + // + // Chain abstraction + // + GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // + // CCTP + // + GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) + QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) + // + // Intent Machine Worker + // + QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) + QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) +} + +// +// Client types +// + +type APIClient interface { + // + // Runtime + // + Ping(ctx context.Context) (bool, error) + Version(ctx context.Context) (*Version, error) + RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) + Clock(ctx context.Context) (time.Time, error) + // + // Chain abstraction + // + GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // + // CCTP + // + GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) + QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) + // + // Intent Machine Worker + // + QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) + QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) +} + +// +// Client +// + +const APIPathPrefix = "/rpc/API/" + +type aPIClient struct { + client HTTPClient + urls [13]string +} + +func NewAPIClient(addr string, client HTTPClient) APIClient { + prefix := urlBase(addr) + APIPathPrefix + urls := [13]string{ + prefix + "Ping", + prefix + "Version", + prefix + "RuntimeStatus", + prefix + "Clock", + prefix + "GetIntentCallsPayloads", + prefix + "CommitIntentConfig", + prefix + "GetIntentConfig", + prefix + "GetCCTPTransfer", + prefix + "QueueCCTPTransfer", + prefix + "QueueIntentConfigExecution", + prefix + "GetIntentConfigExecutionStatus", + prefix + "ListIntentConfigs", + prefix + "QueueMetaTxnReceipt", + } + return &aPIClient{ + client: client, + urls: urls, + } +} + +func (c *aPIClient) Ping(ctx context.Context) (bool, error) { + out := struct { + Ret0 bool `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[0], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) Version(ctx context.Context) (*Version, error) { + out := struct { + Ret0 *Version `json:"version"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[1], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { + out := struct { + Ret0 *RuntimeStatus `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[2], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) Clock(ctx context.Context) (time.Time, error) { + out := struct { + Ret0 time.Time `json:"serverTime"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[3], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) { + in := struct { + Arg0 string `json:"userAddress"` + Arg1 uint64 `json:"destinationChainId"` + Arg2 string `json:"destinationTokenAddress"` + Arg3 string `json:"destinationTokenAmount"` + Arg4 string `json:"destinationToAddress"` + Arg5 uint64 `json:"originChainId"` + Arg6 string `json:"originTokenAddress"` + Arg7 string `json:"originTokenAmount"` + Arg8 *string `json:"destinationCallData"` + Arg9 *string `json:"destinationCallValue"` + Arg10 *string `json:"provider"` + Arg11 *AddressOverrides `json:"addressOverrides"` + Arg12 *string `json:"destinationSalt"` + Arg13 *TakerFee `json:"takerFee"` + Arg14 *float64 `json:"slippageTolerance"` + Arg15 *TradeType `json:"tradeType"` + }{userAddress, destinationChainId, destinationTokenAddress, destinationTokenAmount, destinationToAddress, originChainId, originTokenAddress, originTokenAmount, destinationCallData, destinationCallValue, provider, addressOverrides, destinationSalt, takerFee, slippageTolerance, tradeType} + out := struct { + Ret0 []*IntentCallsPayload `json:"calls"` + Ret1 []*IntentPrecondition `json:"preconditions"` + Ret2 []*MetaTxn `json:"metaTxns"` + Ret3 *TrailsFee `json:"trailsFee"` + Ret4 *IntentQuote `json:"quote"` + Ret5 map[string]string `json:"feeQuotes"` + Ret6 string `json:"originIntentAddress"` + Ret7 string `json:"destinationIntentAddress"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, out.Ret1, out.Ret2, out.Ret3, out.Ret4, out.Ret5, out.Ret6, out.Ret7, err +} + +func (c *aPIClient) CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) { + in := struct { + Arg0 string `json:"originIntentAddress"` + Arg1 string `json:"destinationIntentAddress"` + Arg2 string `json:"mainSigner"` + Arg3 []*IntentCallsPayload `json:"calls"` + Arg4 []*IntentPrecondition `json:"preconditions"` + Arg5 *AddressOverrides `json:"addressOverrides"` + }{originIntentAddress, destinationIntentAddress, mainSigner, calls, preconditions, addressOverrides} + out := struct { + Ret0 *IntentConfig `json:"config"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) { + in := struct { + Arg0 string `json:"intentAddress"` + }{intentAddress} + out := struct { + Ret0 *IntentConfig `json:"config"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) { + in := struct { + Arg0 string `json:"id"` + }{id} + out := struct { + Ret0 *CCTPTransfer `json:"transfer"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) { + in := struct { + Arg0 *string `json:"sourceTxHash"` + Arg1 *string `json:"metaTxHash"` + Arg2 uint64 `json:"sourceChainId"` + Arg3 uint64 `json:"destinationChainId"` + }{sourceTxHash, metaTxHash, sourceChainId, destinationChainId} + out := struct { + Ret0 *CCTPTransfer `json:"transfer"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) { + in := struct { + Arg0 uint64 `json:"intentConfigId"` + }{intentConfigId} + out := struct { + Ret0 bool `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) { + in := struct { + Arg0 uint64 `json:"intentConfigId"` + }{intentConfigId} + out := struct { + Ret0 string `json:"executionStatus"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) { + in := struct { + Arg0 *Page `json:"page"` + Arg1 *string `json:"executionStatus"` + }{page, executionStatus} + out := struct { + Ret0 *Page `json:"page"` + Ret1 []*IntentConfig `json:"intentConfigs"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, out.Ret1, err +} + +func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) { + in := struct { + Arg0 string `json:"metaTxID"` + }{metaTxID} + out := struct { + Ret0 bool `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +// HTTPClient is the interface used by generated clients to send HTTP requests. +// It is fulfilled by *(net/http).Client, which is sufficient for most users. +// Users can provide their own implementation for special retry policies. +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + +// urlBase helps ensure that addr specifies a scheme. If it is unparsable +// as a URL, it returns addr unchanged. +func urlBase(addr string) string { + // If the addr specifies a scheme, use it. If not, default to + // http. If url.Parse fails on it, return it unchanged. + url, err := url.Parse(addr) + if err != nil { + return addr + } + if url.Scheme == "" { + url.Scheme = "http" + } + return url.String() +} + +// newRequest makes an http.Request from a client, adding common headers. +func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType string) (*http.Request, error) { + req, err := http.NewRequestWithContext(ctx, "POST", url, reqBody) + if err != nil { + return nil, err + } + req.Header.Set("Accept", contentType) + req.Header.Set("Content-Type", contentType) + req.Header.Set(WebrpcHeader, WebrpcHeaderValue) + if headers, ok := HTTPRequestHeaders(ctx); ok { + for k := range headers { + for _, v := range headers[k] { + req.Header.Add(k, v) + } + } + } + return req, nil +} + +// doHTTPRequest is common code to make a request to the remote service. +func doHTTPRequest(ctx context.Context, client HTTPClient, url string, in, out interface{}) (*http.Response, error) { + reqBody, err := json.Marshal(in) + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCausef("failed to marshal JSON body: %w", err) + } + if err = ctx.Err(); err != nil { + return nil, ErrWebrpcRequestFailed.WithCausef("aborted because context was done: %w", err) + } + + req, err := newRequest(ctx, url, bytes.NewBuffer(reqBody), "application/json") + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCausef("could not build request: %w", err) + } + + resp, err := client.Do(req) + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCause(err) + } + + if resp.StatusCode != 200 { + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to read server error response body: %w", err) + } + + var rpcErr WebRPCError + if err := json.Unmarshal(respBody, &rpcErr); err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to unmarshal server error: %w", err) + } + if rpcErr.Cause != "" { + rpcErr.cause = errors.New(rpcErr.Cause) + } + return nil, rpcErr + } + + if out != nil { + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to read response body: %w", err) + } + + err = json.Unmarshal(respBody, &out) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to unmarshal JSON response body: %w", err) + } + } + + return resp, nil +} + +func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error) { + if _, ok := h["Accept"]; ok { + return nil, errors.New("provided header cannot set Accept") + } + if _, ok := h["Content-Type"]; ok { + return nil, errors.New("provided header cannot set Content-Type") + } + + copied := make(http.Header, len(h)) + for k, vv := range h { + if vv == nil { + copied[k] = nil + continue + } + copied[k] = make([]string, len(vv)) + copy(copied[k], vv) + } + + return context.WithValue(ctx, HTTPClientRequestHeadersCtxKey, copied), nil +} + +func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { + h, ok := ctx.Value(HTTPClientRequestHeadersCtxKey).(http.Header) + return h, ok +} + +// +// Helpers +// + +type method struct { + Name string + Service string + Annotations map[string]string +} + +type contextKey struct { + name string +} + +func (k *contextKey) String() string { + return "webrpc context value " + k.name +} + +var ( + HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} + HTTPRequestCtxKey = &contextKey{"HTTPRequest"} + + ServiceNameCtxKey = &contextKey{"ServiceName"} + + MethodNameCtxKey = &contextKey{"MethodName"} +) + +func ServiceNameFromContext(ctx context.Context) string { + service, _ := ctx.Value(ServiceNameCtxKey).(string) + return service +} + +func MethodNameFromContext(ctx context.Context) string { + method, _ := ctx.Value(MethodNameCtxKey).(string) + return method +} + +func RequestFromContext(ctx context.Context) *http.Request { + r, _ := ctx.Value(HTTPRequestCtxKey).(*http.Request) + return r +} + +func MethodCtx(ctx context.Context) (method, bool) { + req := RequestFromContext(ctx) + if req == nil { + return method{}, false + } + + m, ok := methods[req.URL.Path] + if !ok { + return method{}, false + } + + return m, true +} + +// +// Errors +// + +type WebRPCError struct { + Name string `json:"error"` + Code int `json:"code"` + Message string `json:"msg"` + Cause string `json:"cause,omitempty"` + HTTPStatus int `json:"status"` + cause error +} + +var _ error = WebRPCError{} + +func (e WebRPCError) Error() string { + if e.cause != nil { + return fmt.Sprintf("%s %d: %s: %v", e.Name, e.Code, e.Message, e.cause) + } + return fmt.Sprintf("%s %d: %s", e.Name, e.Code, e.Message) +} + +func (e WebRPCError) Is(target error) bool { + if target == nil { + return false + } + if rpcErr, ok := target.(WebRPCError); ok { + return rpcErr.Code == e.Code + } + return errors.Is(e.cause, target) +} + +func (e WebRPCError) Unwrap() error { + return e.cause +} + +func (e WebRPCError) WithCause(cause error) WebRPCError { + err := e + err.cause = cause + err.Cause = cause.Error() + return err +} + +func (e WebRPCError) WithCausef(format string, args ...interface{}) WebRPCError { + cause := fmt.Errorf(format, args...) + err := e + err.cause = cause + err.Cause = cause.Error() + return err +} + +// Deprecated: Use .WithCause() method on WebRPCError. +func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError { + return rpcErr.WithCause(cause) +} + +// Webrpc errors +var ( + ErrWebrpcEndpoint = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400} + ErrWebrpcRequestFailed = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400} + ErrWebrpcBadRoute = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404} + ErrWebrpcBadMethod = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405} + ErrWebrpcBadRequest = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400} + ErrWebrpcBadResponse = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500} + ErrWebrpcServerPanic = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500} + ErrWebrpcInternalError = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500} + ErrWebrpcClientDisconnected = WebRPCError{Code: -8, Name: "WebrpcClientDisconnected", Message: "client disconnected", HTTPStatus: 400} + ErrWebrpcStreamLost = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400} + ErrWebrpcStreamFinished = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200} +) + +// Schema errors +var ( + ErrUnauthorized = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401} + ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} + ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} + ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} + ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} + ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} + ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} + ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} + ErrProjectNotFound = WebRPCError{Code: 1008, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} + ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} + ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} + ErrInvalidOrigin = WebRPCError{Code: 1103, Name: "InvalidOrigin", Message: "Invalid origin for Access Key", HTTPStatus: 403} + ErrInvalidService = WebRPCError{Code: 1104, Name: "InvalidService", Message: "Service not enabled for Access key", HTTPStatus: 403} + ErrUnauthorizedUser = WebRPCError{Code: 1105, Name: "UnauthorizedUser", Message: "Unauthorized user", HTTPStatus: 403} + ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota request exceeded", HTTPStatus: 429} + ErrQuotaRateLimit = WebRPCError{Code: 1201, Name: "QuotaRateLimit", Message: "Quota rate limit exceeded", HTTPStatus: 429} + ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} + ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} + ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} + ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} + ErrInvalidArgument = WebRPCError{Code: 2000, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} + ErrUnavailable = WebRPCError{Code: 2002, Name: "Unavailable", Message: "Unavailable resource", HTTPStatus: 400} + ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} + ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} + ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} +) From f914ee3bd3ef7a08ab7814165af3aa8b28040b76 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:39:36 +0000 Subject: [PATCH 002/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 1124 ++++++++++++++++++++++++++++++++++ 1 file changed, 1124 insertions(+) create mode 100644 trails-api/trails-api.gen.go diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go new file mode 100644 index 00000000..30229109 --- /dev/null +++ b/trails-api/trails-api.gen.go @@ -0,0 +1,1124 @@ +// trails-api v0.4.0 28a9163b0bcbdf5cecfc8f2b668550cc1ccadaf3 +// -- +// Code generated by webrpc-gen@v0.25.3 with golang generator. DO NOT EDIT. +// +// webrpc-gen -schema=api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go +package api + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/0xsequence/go-sequence/lib/prototyp" +) + +const WebrpcHeader = "Webrpc" + +const WebrpcHeaderValue = "webrpc@v0.25.3;gen-golang@v0.18.4;trails-api@v0.4.0" + +// WebRPC description and code-gen version +func WebRPCVersion() string { + return "v1" +} + +// Schema version of your RIDL schema +func WebRPCSchemaVersion() string { + return "v0.4.0" +} + +// Schema hash generated from your RIDL schema +func WebRPCSchemaHash() string { + return "28a9163b0bcbdf5cecfc8f2b668550cc1ccadaf3" +} + +type WebrpcGenVersions struct { + WebrpcGenVersion string + CodeGenName string + CodeGenVersion string + SchemaName string + SchemaVersion string +} + +func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error) { + if h.Get(WebrpcHeader) == "" { + return nil, fmt.Errorf("header is empty or missing") + } + + versions, err := parseWebrpcGenVersions(h.Get(WebrpcHeader)) + if err != nil { + return nil, fmt.Errorf("webrpc header is invalid: %w", err) + } + + return versions, nil +} + +func parseWebrpcGenVersions(header string) (*WebrpcGenVersions, error) { + versions := strings.Split(header, ";") + if len(versions) < 3 { + return nil, fmt.Errorf("expected at least 3 parts while parsing webrpc header: %v", header) + } + + _, webrpcGenVersion, ok := strings.Cut(versions[0], "@") + if !ok { + return nil, fmt.Errorf("webrpc gen version could not be parsed from: %s", versions[0]) + } + + tmplTarget, tmplVersion, ok := strings.Cut(versions[1], "@") + if !ok { + return nil, fmt.Errorf("tmplTarget and tmplVersion could not be parsed from: %s", versions[1]) + } + + schemaName, schemaVersion, ok := strings.Cut(versions[2], "@") + if !ok { + return nil, fmt.Errorf("schema name and schema version could not be parsed from: %s", versions[2]) + } + + return &WebrpcGenVersions{ + WebrpcGenVersion: webrpcGenVersion, + CodeGenName: tmplTarget, + CodeGenVersion: tmplVersion, + SchemaName: schemaName, + SchemaVersion: schemaVersion, + }, nil +} + +// +// Common types +// + +type TradeType string + +const ( + TradeType_EXACT_INPUT TradeType = "EXACT_INPUT" + TradeType_EXACT_OUTPUT TradeType = "EXACT_OUTPUT" +) + +func (x TradeType) MarshalText() ([]byte, error) { + return []byte(x), nil +} + +func (x *TradeType) UnmarshalText(b []byte) error { + *x = TradeType(string(b)) + return nil +} + +func (x *TradeType) Is(values ...TradeType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type SortOrder uint32 + +const ( + SortOrder_DESC SortOrder = 0 + SortOrder_ASC SortOrder = 1 +) + +var SortOrder_name = map[uint32]string{ + 0: "DESC", + 1: "ASC", +} + +var SortOrder_value = map[string]uint32{ + "DESC": 0, + "ASC": 1, +} + +func (x SortOrder) String() string { + return SortOrder_name[uint32(x)] +} + +func (x SortOrder) MarshalText() ([]byte, error) { + return []byte(SortOrder_name[uint32(x)]), nil +} + +func (x *SortOrder) UnmarshalText(b []byte) error { + *x = SortOrder(SortOrder_value[string(b)]) + return nil +} + +func (x *SortOrder) Is(values ...SortOrder) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type Version struct { + WebrpcVersion string `json:"webrpcVersion"` + SchemaVersion string `json:"schemaVersion"` + SchemaHash string `json:"schemaHash"` + AppVersion string `json:"appVersion"` +} + +type RuntimeStatus struct { + // overall status, true/false + HealthOK bool `json:"healthOK"` + StartTime time.Time `json:"startTime"` + Uptime uint64 `json:"uptime"` + Ver string `json:"ver"` + Branch string `json:"branch"` + CommitHash string `json:"commitHash"` + Checks *RuntimeChecks `json:"checks"` + NumTxnsRelayed map[string]*NumTxnsRelayed `json:"numTxnsRelayed"` +} + +type NumTxnsRelayed struct { + ChainID uint64 `json:"chainID"` + Prev uint64 `json:"prev"` + Current uint64 `json:"current"` + Period uint64 `json:"period"` +} + +type RuntimeChecks struct { +} + +// From: `0xsequence/relayer`: https://github.com/0xsequence/relayer/blob/2c695b820970c68c57bfe71810f469412cdec675/proto/relayer.ridl#L502 +// TODO: rename this to MetaTxnRaw (eventually), we can leave it for now to not break compat +// or name it, MetaTxnArgs ..? +type MetaTxn struct { + ID string `json:"id"` + ChainId prototyp.BigInt `json:"chainId"` + WalletAddress string `json:"walletAddress" db:"wallet_address"` + // TODO (later): rename this to `to: string` + Contract string `json:"contract" db:"to_address"` + // TODO: rename to 'execdata' + Input string `json:"input" db:"tx_data"` +} + +type Call struct { + To prototyp.Hash `json:"to"` + Value prototyp.BigInt `json:"value"` + Data prototyp.Hash `json:"data"` + GasLimit prototyp.BigInt `json:"gasLimit"` + DelegateCall *bool `json:"delegateCall"` + OnlyFallback *bool `json:"onlyFallback"` + BehaviorOnError *uint8 `json:"behaviorOnError"` +} + +type IntentCallsPayload struct { + ChainId prototyp.BigInt `json:"chainId"` + Space prototyp.BigInt `json:"space"` + Nonce prototyp.BigInt `json:"nonce"` + Calls []*Call `json:"calls"` +} + +// IntentConfig +type IntentConfig struct { + ID uint64 `json:"id" db:"id,omitempty"` + ConfigHash prototyp.Hash `json:"configHash" db:"config_hash"` + OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` + DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"destination_intent_address"` + MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` + Calls prototyp.JSONString `json:"calls" db:"calls"` + Preconditions prototyp.JSONString `json:"preconditions" db:"preconditions"` + ExecutionStatus *string `json:"executionStatus" db:"execution_status,omitempty"` + MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` + TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` +} + +type AddressOverrides struct { + TrailsLiFiSapientSignerAddress *string `json:"trailsLiFiSapientSignerAddress"` + TrailsRelaySapientSignerAddress *string `json:"trailsRelaySapientSignerAddress"` + TrailsCCTPV2SapientSignerAddress *string `json:"trailsCCTPV2SapientSignerAddress"` +} + +type TakerFee struct { + Address prototyp.Hash `json:"address"` + Bps uint64 `json:"bps"` +} + +type IntentPrecondition struct { + Type string `json:"type"` + ChainId prototyp.BigInt `json:"chainId"` + Data interface{} `json:"data"` +} + +type Token struct { + ChainId uint64 `json:"chainId"` + ContractAddress prototyp.Hash `json:"contractAddress"` + TokenId *string `json:"tokenId"` +} + +type Price struct { + Value float64 `json:"value"` + Currency string `json:"currency"` +} + +type TokenPrice struct { + Token *Token `json:"token"` + Price *Price `json:"price"` + Price24hChange *Price `json:"price24hChange"` + Price24hVol *Price `json:"price24hVol"` + FloorPrice *Price `json:"floorPrice,omitempty"` + BuyPrice *Price `json:"buyPrice,omitempty"` + SellPrice *Price `json:"sellPrice,omitempty"` + UpdatedAt *time.Time `json:"updatedAt"` +} + +type ExchangeRate struct { + Name string `json:"name"` + Symbol string `json:"symbol"` + Value float64 `json:"value"` + VsCurrency string `json:"vsCurrency"` + CurrencyType string `json:"currencyType"` +} + +// TOOD: refactor, we should be returning a cursor always.. +// see indexer/indexer.ridl Page object.. +// +// --- +// +// Page represents a results page. This can be used both to request a page and +// to store the state of a page. +type Page struct { + // Common for both numbered pages and cursor: Number of items per page + // TODO: REMOVE.. + PageSize *uint32 `json:"pageSize"` + // Numbered pages: Page number, this is multiplied by the value of the parameter. + // TODO: REMOVE.. + Page *uint32 `json:"page"` + // Number of total items on this query. + // TODO: REMOVE.. + TotalRecords *uint64 `json:"totalRecords"` + // Cursor: column to compare before/after to + Column *string `json:"column"` + // Cursor: return column < before - include to get previous page + Before *interface{} `json:"before"` + // Cursor: return column > after - include to get next page + After *interface{} `json:"after"` + // Sorting filter + Sort []*SortBy `json:"sort"` + // Indicates if there are more results available + More *bool `json:"more,omitempty"` +} + +type SortBy struct { + Column string `json:"column"` + Order SortOrder `json:"order"` +} + +type CCTPTransfer struct { + ID string `json:"id"` + SourceTxHash string `json:"sourceTxHash"` + SourceChainID uint64 `json:"sourceChainId"` + DestinationChainID uint64 `json:"destinationChainId"` + Message string `json:"message"` + Attestation string `json:"attestation"` + Status string `json:"status"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} + +type CrossChainFee struct { + ProviderFee prototyp.BigInt `json:"providerFee"` + TrailsSwapFee prototyp.BigInt `json:"trailsSwapFee"` + ProviderFeeUSD float64 `json:"providerFeeUSD"` + TrailsSwapFeeUSD float64 `json:"trailsSwapFeeUSD"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUSD"` +} + +type MetaTxnFeeDetail struct { + MetaTxnID string `json:"metaTxnID"` + EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` + FeeNative prototyp.BigInt `json:"feeNative"` +} + +type ChainExecuteQuote struct { + ChainId prototyp.BigInt `json:"chainId"` + TotalGasLimit prototyp.BigInt `json:"totalGasLimit"` + GasPrice prototyp.BigInt `json:"gasPrice"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + NativeTokenSymbol string `json:"nativeTokenSymbol"` + NativeTokenPrice float64 `json:"nativeTokenPrice"` + MetaTxnFeeDetails []*MetaTxnFeeDetail `json:"metaTxnFeeDetails"` + TotalFeeUSD float64 `json:"totalFeeUSD"` +} + +type ExecuteQuote struct { + ChainQuotes []*ChainExecuteQuote `json:"chainQuotes"` +} + +type TrailsFee struct { + ExecuteQuote *ExecuteQuote `json:"executeQuote"` + CrossChainFee *CrossChainFee `json:"crossChainFee"` + TakerFeeAmount prototyp.BigInt `json:"takerFeeAmount"` + TakerFeeUSD *float64 `json:"takerFeeUSD"` + TrailsFixedFeeUSD float64 `json:"trailsFixedFeeUSD"` + FeeToken prototyp.Hash `json:"feeToken"` + OriginTokenTotalAmount prototyp.BigInt `json:"originTokenTotalAmount"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUSD"` + QuoteProvider *string `json:"quoteProvider"` +} + +type IntentQuote struct { + FromAmount prototyp.BigInt `json:"fromAmount"` + FromAmountMin prototyp.BigInt `json:"fromAmountMin"` + ToAmount prototyp.BigInt `json:"toAmount"` + ToAmountMin prototyp.BigInt `json:"toAmountMin"` + PriceImpact float64 `json:"priceImpact"` + PriceImpactUsd string `json:"priceImpactUsd"` + MaxSlippage float64 `json:"maxSlippage"` + QuoteProvider string `json:"quoteProvider"` + QuoteProviderRequestId string `json:"quoteProviderRequestId"` + QuoteProviderFeeUsd string `json:"quoteProviderFeeUsd"` + FeeQuotes map[string]string `json:"feeQuotes"` +} + +var methods = map[string]method{ + "/rpc/API/Ping": { + Name: "Ping", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/Version": { + Name: "Version", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/RuntimeStatus": { + Name: "RuntimeStatus", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/Clock": { + Name: "Clock", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetIntentCallsPayloads": { + Name: "GetIntentCallsPayloads", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/CommitIntentConfig": { + Name: "CommitIntentConfig", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetIntentConfig": { + Name: "GetIntentConfig", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetCCTPTransfer": { + Name: "GetCCTPTransfer", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/QueueCCTPTransfer": { + Name: "QueueCCTPTransfer", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/QueueIntentConfigExecution": { + Name: "QueueIntentConfigExecution", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/GetIntentConfigExecutionStatus": { + Name: "GetIntentConfigExecutionStatus", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/ListIntentConfigs": { + Name: "ListIntentConfigs", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/QueueMetaTxnReceipt": { + Name: "QueueMetaTxnReceipt", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, +} + +func WebrpcMethods() map[string]method { + res := make(map[string]method, len(methods)) + for k, v := range methods { + res[k] = v + } + + return res +} + +var WebRPCServices = map[string][]string{ + "API": { + "Ping", + "Version", + "RuntimeStatus", + "Clock", + "GetIntentCallsPayloads", + "CommitIntentConfig", + "GetIntentConfig", + "GetCCTPTransfer", + "QueueCCTPTransfer", + "QueueIntentConfigExecution", + "GetIntentConfigExecutionStatus", + "ListIntentConfigs", + "QueueMetaTxnReceipt", + }, +} + +// +// Server types +// + +type API interface { + // + // Runtime + // + Ping(ctx context.Context) (bool, error) + Version(ctx context.Context) (*Version, error) + RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) + Clock(ctx context.Context) (time.Time, error) + // + // Chain abstraction + // + GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // + // CCTP + // + GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) + QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) + // + // Intent Machine Worker + // + QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) + QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) +} + +// +// Client types +// + +type APIClient interface { + // + // Runtime + // + Ping(ctx context.Context) (bool, error) + Version(ctx context.Context) (*Version, error) + RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) + Clock(ctx context.Context) (time.Time, error) + // + // Chain abstraction + // + GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // + // CCTP + // + GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) + QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) + // + // Intent Machine Worker + // + QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) + QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) +} + +// +// Client +// + +const APIPathPrefix = "/rpc/API/" + +type aPIClient struct { + client HTTPClient + urls [13]string +} + +func NewAPIClient(addr string, client HTTPClient) APIClient { + prefix := urlBase(addr) + APIPathPrefix + urls := [13]string{ + prefix + "Ping", + prefix + "Version", + prefix + "RuntimeStatus", + prefix + "Clock", + prefix + "GetIntentCallsPayloads", + prefix + "CommitIntentConfig", + prefix + "GetIntentConfig", + prefix + "GetCCTPTransfer", + prefix + "QueueCCTPTransfer", + prefix + "QueueIntentConfigExecution", + prefix + "GetIntentConfigExecutionStatus", + prefix + "ListIntentConfigs", + prefix + "QueueMetaTxnReceipt", + } + return &aPIClient{ + client: client, + urls: urls, + } +} + +func (c *aPIClient) Ping(ctx context.Context) (bool, error) { + out := struct { + Ret0 bool `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[0], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) Version(ctx context.Context) (*Version, error) { + out := struct { + Ret0 *Version `json:"version"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[1], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { + out := struct { + Ret0 *RuntimeStatus `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[2], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) Clock(ctx context.Context) (time.Time, error) { + out := struct { + Ret0 time.Time `json:"serverTime"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[3], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) { + in := struct { + Arg0 string `json:"userAddress"` + Arg1 uint64 `json:"destinationChainId"` + Arg2 string `json:"destinationTokenAddress"` + Arg3 string `json:"destinationTokenAmount"` + Arg4 string `json:"destinationToAddress"` + Arg5 uint64 `json:"originChainId"` + Arg6 string `json:"originTokenAddress"` + Arg7 string `json:"originTokenAmount"` + Arg8 *string `json:"destinationCallData"` + Arg9 *string `json:"destinationCallValue"` + Arg10 *string `json:"provider"` + Arg11 *AddressOverrides `json:"addressOverrides"` + Arg12 *string `json:"destinationSalt"` + Arg13 *TakerFee `json:"takerFee"` + Arg14 *float64 `json:"slippageTolerance"` + Arg15 *TradeType `json:"tradeType"` + }{userAddress, destinationChainId, destinationTokenAddress, destinationTokenAmount, destinationToAddress, originChainId, originTokenAddress, originTokenAmount, destinationCallData, destinationCallValue, provider, addressOverrides, destinationSalt, takerFee, slippageTolerance, tradeType} + out := struct { + Ret0 []*IntentCallsPayload `json:"calls"` + Ret1 []*IntentPrecondition `json:"preconditions"` + Ret2 []*MetaTxn `json:"metaTxns"` + Ret3 *TrailsFee `json:"trailsFee"` + Ret4 *IntentQuote `json:"quote"` + Ret5 map[string]string `json:"feeQuotes"` + Ret6 string `json:"originIntentAddress"` + Ret7 string `json:"destinationIntentAddress"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, out.Ret1, out.Ret2, out.Ret3, out.Ret4, out.Ret5, out.Ret6, out.Ret7, err +} + +func (c *aPIClient) CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) { + in := struct { + Arg0 string `json:"originIntentAddress"` + Arg1 string `json:"destinationIntentAddress"` + Arg2 string `json:"mainSigner"` + Arg3 []*IntentCallsPayload `json:"calls"` + Arg4 []*IntentPrecondition `json:"preconditions"` + Arg5 *AddressOverrides `json:"addressOverrides"` + }{originIntentAddress, destinationIntentAddress, mainSigner, calls, preconditions, addressOverrides} + out := struct { + Ret0 *IntentConfig `json:"config"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) { + in := struct { + Arg0 string `json:"intentAddress"` + }{intentAddress} + out := struct { + Ret0 *IntentConfig `json:"config"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) { + in := struct { + Arg0 string `json:"id"` + }{id} + out := struct { + Ret0 *CCTPTransfer `json:"transfer"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) { + in := struct { + Arg0 *string `json:"sourceTxHash"` + Arg1 *string `json:"metaTxHash"` + Arg2 uint64 `json:"sourceChainId"` + Arg3 uint64 `json:"destinationChainId"` + }{sourceTxHash, metaTxHash, sourceChainId, destinationChainId} + out := struct { + Ret0 *CCTPTransfer `json:"transfer"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) { + in := struct { + Arg0 uint64 `json:"intentConfigId"` + }{intentConfigId} + out := struct { + Ret0 bool `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) { + in := struct { + Arg0 uint64 `json:"intentConfigId"` + }{intentConfigId} + out := struct { + Ret0 string `json:"executionStatus"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) { + in := struct { + Arg0 *Page `json:"page"` + Arg1 *string `json:"executionStatus"` + }{page, executionStatus} + out := struct { + Ret0 *Page `json:"page"` + Ret1 []*IntentConfig `json:"intentConfigs"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, out.Ret1, err +} + +func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) { + in := struct { + Arg0 string `json:"metaTxID"` + }{metaTxID} + out := struct { + Ret0 bool `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +// HTTPClient is the interface used by generated clients to send HTTP requests. +// It is fulfilled by *(net/http).Client, which is sufficient for most users. +// Users can provide their own implementation for special retry policies. +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + +// urlBase helps ensure that addr specifies a scheme. If it is unparsable +// as a URL, it returns addr unchanged. +func urlBase(addr string) string { + // If the addr specifies a scheme, use it. If not, default to + // http. If url.Parse fails on it, return it unchanged. + url, err := url.Parse(addr) + if err != nil { + return addr + } + if url.Scheme == "" { + url.Scheme = "http" + } + return url.String() +} + +// newRequest makes an http.Request from a client, adding common headers. +func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType string) (*http.Request, error) { + req, err := http.NewRequestWithContext(ctx, "POST", url, reqBody) + if err != nil { + return nil, err + } + req.Header.Set("Accept", contentType) + req.Header.Set("Content-Type", contentType) + req.Header.Set(WebrpcHeader, WebrpcHeaderValue) + if headers, ok := HTTPRequestHeaders(ctx); ok { + for k := range headers { + for _, v := range headers[k] { + req.Header.Add(k, v) + } + } + } + return req, nil +} + +// doHTTPRequest is common code to make a request to the remote service. +func doHTTPRequest(ctx context.Context, client HTTPClient, url string, in, out interface{}) (*http.Response, error) { + reqBody, err := json.Marshal(in) + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCausef("failed to marshal JSON body: %w", err) + } + if err = ctx.Err(); err != nil { + return nil, ErrWebrpcRequestFailed.WithCausef("aborted because context was done: %w", err) + } + + req, err := newRequest(ctx, url, bytes.NewBuffer(reqBody), "application/json") + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCausef("could not build request: %w", err) + } + + resp, err := client.Do(req) + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCause(err) + } + + if resp.StatusCode != 200 { + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to read server error response body: %w", err) + } + + var rpcErr WebRPCError + if err := json.Unmarshal(respBody, &rpcErr); err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to unmarshal server error: %w", err) + } + if rpcErr.Cause != "" { + rpcErr.cause = errors.New(rpcErr.Cause) + } + return nil, rpcErr + } + + if out != nil { + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to read response body: %w", err) + } + + err = json.Unmarshal(respBody, &out) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCausef("failed to unmarshal JSON response body: %w", err) + } + } + + return resp, nil +} + +func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error) { + if _, ok := h["Accept"]; ok { + return nil, errors.New("provided header cannot set Accept") + } + if _, ok := h["Content-Type"]; ok { + return nil, errors.New("provided header cannot set Content-Type") + } + + copied := make(http.Header, len(h)) + for k, vv := range h { + if vv == nil { + copied[k] = nil + continue + } + copied[k] = make([]string, len(vv)) + copy(copied[k], vv) + } + + return context.WithValue(ctx, HTTPClientRequestHeadersCtxKey, copied), nil +} + +func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { + h, ok := ctx.Value(HTTPClientRequestHeadersCtxKey).(http.Header) + return h, ok +} + +// +// Helpers +// + +type method struct { + Name string + Service string + Annotations map[string]string +} + +type contextKey struct { + name string +} + +func (k *contextKey) String() string { + return "webrpc context value " + k.name +} + +var ( + HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} + HTTPRequestCtxKey = &contextKey{"HTTPRequest"} + + ServiceNameCtxKey = &contextKey{"ServiceName"} + + MethodNameCtxKey = &contextKey{"MethodName"} +) + +func ServiceNameFromContext(ctx context.Context) string { + service, _ := ctx.Value(ServiceNameCtxKey).(string) + return service +} + +func MethodNameFromContext(ctx context.Context) string { + method, _ := ctx.Value(MethodNameCtxKey).(string) + return method +} + +func RequestFromContext(ctx context.Context) *http.Request { + r, _ := ctx.Value(HTTPRequestCtxKey).(*http.Request) + return r +} + +func MethodCtx(ctx context.Context) (method, bool) { + req := RequestFromContext(ctx) + if req == nil { + return method{}, false + } + + m, ok := methods[req.URL.Path] + if !ok { + return method{}, false + } + + return m, true +} + +// +// Errors +// + +type WebRPCError struct { + Name string `json:"error"` + Code int `json:"code"` + Message string `json:"msg"` + Cause string `json:"cause,omitempty"` + HTTPStatus int `json:"status"` + cause error +} + +var _ error = WebRPCError{} + +func (e WebRPCError) Error() string { + if e.cause != nil { + return fmt.Sprintf("%s %d: %s: %v", e.Name, e.Code, e.Message, e.cause) + } + return fmt.Sprintf("%s %d: %s", e.Name, e.Code, e.Message) +} + +func (e WebRPCError) Is(target error) bool { + if target == nil { + return false + } + if rpcErr, ok := target.(WebRPCError); ok { + return rpcErr.Code == e.Code + } + return errors.Is(e.cause, target) +} + +func (e WebRPCError) Unwrap() error { + return e.cause +} + +func (e WebRPCError) WithCause(cause error) WebRPCError { + err := e + err.cause = cause + err.Cause = cause.Error() + return err +} + +func (e WebRPCError) WithCausef(format string, args ...interface{}) WebRPCError { + cause := fmt.Errorf(format, args...) + err := e + err.cause = cause + err.Cause = cause.Error() + return err +} + +// Deprecated: Use .WithCause() method on WebRPCError. +func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError { + return rpcErr.WithCause(cause) +} + +// Webrpc errors +var ( + ErrWebrpcEndpoint = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400} + ErrWebrpcRequestFailed = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400} + ErrWebrpcBadRoute = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404} + ErrWebrpcBadMethod = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405} + ErrWebrpcBadRequest = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400} + ErrWebrpcBadResponse = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500} + ErrWebrpcServerPanic = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500} + ErrWebrpcInternalError = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500} + ErrWebrpcClientDisconnected = WebRPCError{Code: -8, Name: "WebrpcClientDisconnected", Message: "client disconnected", HTTPStatus: 400} + ErrWebrpcStreamLost = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400} + ErrWebrpcStreamFinished = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200} +) + +// Schema errors +var ( + ErrUnauthorized = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401} + ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} + ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} + ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} + ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} + ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} + ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} + ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} + ErrProjectNotFound = WebRPCError{Code: 1008, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} + ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} + ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} + ErrInvalidOrigin = WebRPCError{Code: 1103, Name: "InvalidOrigin", Message: "Invalid origin for Access Key", HTTPStatus: 403} + ErrInvalidService = WebRPCError{Code: 1104, Name: "InvalidService", Message: "Service not enabled for Access key", HTTPStatus: 403} + ErrUnauthorizedUser = WebRPCError{Code: 1105, Name: "UnauthorizedUser", Message: "Unauthorized user", HTTPStatus: 403} + ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota request exceeded", HTTPStatus: 429} + ErrQuotaRateLimit = WebRPCError{Code: 1201, Name: "QuotaRateLimit", Message: "Quota rate limit exceeded", HTTPStatus: 429} + ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} + ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} + ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} + ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} + ErrInvalidArgument = WebRPCError{Code: 2000, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} + ErrUnavailable = WebRPCError{Code: 2002, Name: "Unavailable", Message: "Unavailable resource", HTTPStatus: 400} + ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} + ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} + ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} +) From 3b25f998f91b6a1df3d137bd06c96992f781a085 Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Wed, 1 Oct 2025 16:05:19 +0000 Subject: [PATCH 003/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 42 ++++++++++++++---------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 30229109..21cfc591 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 28a9163b0bcbdf5cecfc8f2b668550cc1ccadaf3 +// trails-api v0.4.0 a81a66cc8764837490ea73950ef78928610fa7e6 // -- // Code generated by webrpc-gen@v0.25.3 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "28a9163b0bcbdf5cecfc8f2b668550cc1ccadaf3" + return "a81a66cc8764837490ea73950ef78928610fa7e6" } type WebrpcGenVersions struct { @@ -489,30 +489,25 @@ var WebRPCServices = map[string][]string{ // type API interface { - // - // Runtime - // Ping(ctx context.Context) (bool, error) Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) - // - // Chain abstraction - // + // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + // Persists intent configuration details to database for later execution, creating a new intent config record. CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + // Retrieves stored intent configuration by wallet address for inspection or execution. GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) - // - // CCTP - // GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) - // - // Intent Machine Worker - // + // Marks an intent config as ready for processing by the execution worker. QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + // Returns current execution status (pending/processing/executed/failed) for a given intent config. GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + // Paginated listing of intent configs with optional execution status filtering. ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) + // Processes relay transaction receipts to update intent execution status and trigger refund logic. QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) } @@ -521,30 +516,25 @@ type API interface { // type APIClient interface { - // - // Runtime - // Ping(ctx context.Context) (bool, error) Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) - // - // Chain abstraction - // + // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + // Persists intent configuration details to database for later execution, creating a new intent config record. CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + // Retrieves stored intent configuration by wallet address for inspection or execution. GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) - // - // CCTP - // GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) - // - // Intent Machine Worker - // + // Marks an intent config as ready for processing by the execution worker. QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + // Returns current execution status (pending/processing/executed/failed) for a given intent config. GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + // Paginated listing of intent configs with optional execution status filtering. ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) + // Processes relay transaction receipts to update intent execution status and trigger refund logic. QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) } From d8b33aa17ded2d10f6fa176f089a1bad94257049 Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Wed, 1 Oct 2025 18:36:35 +0000 Subject: [PATCH 004/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 209 +++++++++++++++++++++++------------ 1 file changed, 140 insertions(+), 69 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 21cfc591..a3d981c9 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 a81a66cc8764837490ea73950ef78928610fa7e6 +// trails-api v0.4.0 d0eb660544cee4bb56919d4aa3135ab30ecb72d0 // -- // Code generated by webrpc-gen@v0.25.3 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "a81a66cc8764837490ea73950ef78928610fa7e6" + return "d0eb660544cee4bb56919d4aa3135ab30ecb72d0" } type WebrpcGenVersions struct { @@ -94,34 +94,6 @@ func parseWebrpcGenVersions(header string) (*WebrpcGenVersions, error) { // Common types // -type TradeType string - -const ( - TradeType_EXACT_INPUT TradeType = "EXACT_INPUT" - TradeType_EXACT_OUTPUT TradeType = "EXACT_OUTPUT" -) - -func (x TradeType) MarshalText() ([]byte, error) { - return []byte(x), nil -} - -func (x *TradeType) UnmarshalText(b []byte) error { - *x = TradeType(string(b)) - return nil -} - -func (x *TradeType) Is(values ...TradeType) bool { - if x == nil { - return false - } - for _, v := range values { - if *x == v { - return true - } - } - return false -} - type SortOrder uint32 const ( @@ -164,6 +136,34 @@ func (x *SortOrder) Is(values ...SortOrder) bool { return false } +type TradeType string + +const ( + TradeType_EXACT_INPUT TradeType = "EXACT_INPUT" + TradeType_EXACT_OUTPUT TradeType = "EXACT_OUTPUT" +) + +func (x TradeType) MarshalText() ([]byte, error) { + return []byte(x), nil +} + +func (x *TradeType) UnmarshalText(b []byte) error { + *x = TradeType(string(b)) + return nil +} + +func (x *TradeType) Is(values ...TradeType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type Version struct { WebrpcVersion string `json:"webrpcVersion"` SchemaVersion string `json:"schemaVersion"` @@ -239,6 +239,14 @@ type IntentConfig struct { CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } +// MetaTxnReceipt +type MetaTxnReceipt struct { + MetaTxID string `json:"metaTxID" db:"meta_tx_id"` + Status string `json:"status" db:"status"` + TxnReceipt *string `json:"txnReceipt" db:"txn_receipt"` + RevertReason *string `json:"revertReason" db:"revert_reason"` +} + type AddressOverrides struct { TrailsLiFiSapientSignerAddress *string `json:"trailsLiFiSapientSignerAddress"` TrailsRelaySapientSignerAddress *string `json:"trailsRelaySapientSignerAddress"` @@ -250,6 +258,13 @@ type TakerFee struct { Bps uint64 `json:"bps"` } +type OriginCall struct { + ChainId prototyp.BigInt `json:"chainId"` + To string `json:"to"` + TransactionData string `json:"transactionData"` + TransactionValue prototyp.BigInt `json:"transactionValue"` +} + type IntentPrecondition struct { Type string `json:"type"` ChainId prototyp.BigInt `json:"chainId"` @@ -332,6 +347,56 @@ type CCTPTransfer struct { UpdatedAt time.Time `json:"updatedAt"` } +type GetIntentCallsPayloadParams struct { + UserAddress prototyp.Hash `json:"userAddress"` + DestinationChainID uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount string `json:"destinationTokenAmount"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + OriginChainID uint64 `json:"originChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + OriginTokenAmount string `json:"originTokenAmount"` + DestinationCallData *string `json:"destinationCallData"` + DestinationCallValue *string `json:"destinationCallValue"` + Provider *string `json:"provider"` + AddressOverrides *AddressOverrides `json:"addressOverrides"` + DestinationSalt *string `json:"destinationSalt"` + TakerFee *TakerFee `json:"takerFee"` + SlippageTolerance *float64 `json:"slippageTolerance"` + TradeType *TradeType `json:"tradeType"` +} + +type GetIntentsQuoteParams struct { + UserAddress prototyp.Hash `json:"userAddress"` + DestinationChainID uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount string `json:"destinationTokenAmount"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + OriginChainID uint64 `json:"originChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + OriginTokenAmount string `json:"originTokenAmount"` + DestinationCallData *string `json:"destinationCallData"` + DestinationCallValue *string `json:"destinationCallValue"` + Provider *string `json:"provider"` + AddressOverrides *AddressOverrides `json:"addressOverrides"` + DestinationSalt *string `json:"destinationSalt"` + TakerFee *TakerFee `json:"takerFee"` + SlippageTolerance *float64 `json:"slippageTolerance"` + TradeType *TradeType `json:"tradeType"` + ExactInputOriginalTokenAmount *string `json:"exactInputOriginalTokenAmount"` +} + +type IntentCallsPayloads struct { + Calls []*IntentCallsPayload `json:"calls"` + Preconditions []*IntentPrecondition `json:"preconditions"` + MetaTxns []*MetaTxn `json:"metaTxns"` + TrailsFee *TrailsFee `json:"trailsFee"` + Quote *IntentQuote `json:"quote"` + FeeQuotes map[string]string `json:"feeQuotes"` + OriginIntentAddress string `json:"originIntentAddress"` + DestinationIntentAddress string `json:"destinationIntentAddress"` +} + type CrossChainFee struct { ProviderFee prototyp.BigInt `json:"providerFee"` TrailsSwapFee prototyp.BigInt `json:"trailsSwapFee"` @@ -415,6 +480,11 @@ var methods = map[string]method{ Service: "API", Annotations: map[string]string{}, }, + "/rpc/API/GetIntentsQuote": { + Name: "GetIntentsQuote", + Service: "API", + Annotations: map[string]string{}, + }, "/rpc/API/CommitIntentConfig": { Name: "CommitIntentConfig", Service: "API", @@ -473,6 +543,7 @@ var WebRPCServices = map[string][]string{ "RuntimeStatus", "Clock", "GetIntentCallsPayloads", + "GetIntentsQuote", "CommitIntentConfig", "GetIntentConfig", "GetCCTPTransfer", @@ -494,7 +565,8 @@ type API interface { RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. - GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) + GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) // Persists intent configuration details to database for later execution, creating a new intent config record. CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) // Retrieves stored intent configuration by wallet address for inspection or execution. @@ -521,7 +593,8 @@ type APIClient interface { RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. - GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) + GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) + GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) // Persists intent configuration details to database for later execution, creating a new intent config record. CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) // Retrieves stored intent configuration by wallet address for inspection or execution. @@ -546,17 +619,18 @@ const APIPathPrefix = "/rpc/API/" type aPIClient struct { client HTTPClient - urls [13]string + urls [14]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [13]string{ + urls := [14]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", prefix + "Clock", prefix + "GetIntentCallsPayloads", + prefix + "GetIntentsQuote", prefix + "CommitIntentConfig", prefix + "GetIntentConfig", prefix + "GetCCTPTransfer", @@ -636,34 +710,12 @@ func (c *aPIClient) Clock(ctx context.Context) (time.Time, error) { return out.Ret0, err } -func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, userAddress string, destinationChainId uint64, destinationTokenAddress string, destinationTokenAmount string, destinationToAddress string, originChainId uint64, originTokenAddress string, originTokenAmount string, destinationCallData *string, destinationCallValue *string, provider *string, addressOverrides *AddressOverrides, destinationSalt *string, takerFee *TakerFee, slippageTolerance *float64, tradeType *TradeType) ([]*IntentCallsPayload, []*IntentPrecondition, []*MetaTxn, *TrailsFee, *IntentQuote, map[string]string, string, string, error) { +func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) { in := struct { - Arg0 string `json:"userAddress"` - Arg1 uint64 `json:"destinationChainId"` - Arg2 string `json:"destinationTokenAddress"` - Arg3 string `json:"destinationTokenAmount"` - Arg4 string `json:"destinationToAddress"` - Arg5 uint64 `json:"originChainId"` - Arg6 string `json:"originTokenAddress"` - Arg7 string `json:"originTokenAmount"` - Arg8 *string `json:"destinationCallData"` - Arg9 *string `json:"destinationCallValue"` - Arg10 *string `json:"provider"` - Arg11 *AddressOverrides `json:"addressOverrides"` - Arg12 *string `json:"destinationSalt"` - Arg13 *TakerFee `json:"takerFee"` - Arg14 *float64 `json:"slippageTolerance"` - Arg15 *TradeType `json:"tradeType"` - }{userAddress, destinationChainId, destinationTokenAddress, destinationTokenAmount, destinationToAddress, originChainId, originTokenAddress, originTokenAmount, destinationCallData, destinationCallValue, provider, addressOverrides, destinationSalt, takerFee, slippageTolerance, tradeType} + Arg0 *GetIntentCallsPayloadParams `json:"params"` + }{params} out := struct { - Ret0 []*IntentCallsPayload `json:"calls"` - Ret1 []*IntentPrecondition `json:"preconditions"` - Ret2 []*MetaTxn `json:"metaTxns"` - Ret3 *TrailsFee `json:"trailsFee"` - Ret4 *IntentQuote `json:"quote"` - Ret5 map[string]string `json:"feeQuotes"` - Ret6 string `json:"originIntentAddress"` - Ret7 string `json:"destinationIntentAddress"` + Ret0 *IntentCallsPayloads `json:"payloads"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) @@ -674,7 +726,26 @@ func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, userAddress stri } } - return out.Ret0, out.Ret1, out.Ret2, out.Ret3, out.Ret4, out.Ret5, out.Ret6, out.Ret7, err + return out.Ret0, err +} + +func (c *aPIClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) { + in := struct { + Arg0 *GetIntentsQuoteParams `json:"params"` + }{params} + out := struct { + Ret0 *IntentQuote `json:"quote"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err } func (c *aPIClient) CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) { @@ -690,7 +761,7 @@ func (c *aPIClient) CommitIntentConfig(ctx context.Context, originIntentAddress Ret0 *IntentConfig `json:"config"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -709,7 +780,7 @@ func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) ( Ret0 *IntentConfig `json:"config"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -728,7 +799,7 @@ func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -750,7 +821,7 @@ func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -769,7 +840,7 @@ func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfig Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -788,7 +859,7 @@ func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo Ret0 string `json:"executionStatus"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -809,7 +880,7 @@ func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, execution Ret1 []*IntentConfig `json:"intentConfigs"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -828,7 +899,7 @@ func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From 5cfd20be8d525d282f8fcb872a03b91f01c9b132 Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Wed, 1 Oct 2025 20:01:12 +0000 Subject: [PATCH 005/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 110 ++++++++++++++++++++++++++++------- 1 file changed, 90 insertions(+), 20 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index a3d981c9..4b6097a6 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 d0eb660544cee4bb56919d4aa3135ab30ecb72d0 +// trails-api v0.4.0 382b29dc1d49e1b98fb4b074aec76beb06a1cd3d // -- // Code generated by webrpc-gen@v0.25.3 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "d0eb660544cee4bb56919d4aa3135ab30ecb72d0" + return "382b29dc1d49e1b98fb4b074aec76beb06a1cd3d" } type WebrpcGenVersions struct { @@ -239,6 +239,24 @@ type IntentConfig struct { CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } +// IntentTransaction represents a transaction that went through the intent machine +type IntentTransaction struct { + OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` + DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"destination_intent_address"` + MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` + MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` + TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` + ExecutionStatus *string `json:"executionStatus" db:"execution_status,omitempty"` + OriginChainID *uint64 `json:"originChainId"` + DestinationChainID *uint64 `json:"destinationChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + OriginTokenAmount prototyp.BigInt `json:"originTokenAmount"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + CreatedAt *string `json:"createdAt"` +} + // MetaTxnReceipt type MetaTxnReceipt struct { MetaTxID string `json:"metaTxID" db:"meta_tx_id"` @@ -386,6 +404,31 @@ type GetIntentsQuoteParams struct { ExactInputOriginalTokenAmount *string `json:"exactInputOriginalTokenAmount"` } +type CommitIntentConfigParams struct { + OriginIntentAddress string `json:"originIntentAddress"` + DestinationIntentAddress string `json:"destinationIntentAddress"` + MainSigner string `json:"mainSigner"` + Calls []*IntentCallsPayload `json:"calls"` + Preconditions []*IntentPrecondition `json:"preconditions"` + AddressOverrides *AddressOverrides `json:"addressOverrides"` + RequestParams *IntentRequestParams `json:"requestParams"` +} + +type IntentRequestParams struct { + Version string `json:"version"` + UserAddress prototyp.Hash `json:"userAddress"` + DestinationChainId uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + OriginChainId uint64 `json:"originChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + OriginTokenAmount prototyp.BigInt `json:"originTokenAmount"` + DestinationCallData *string `json:"destinationCallData"` + DestinationCallValue *string `json:"destinationCallValue"` + CreatedAt time.Time `json:"createdAt"` +} + type IntentCallsPayloads struct { Calls []*IntentCallsPayload `json:"calls"` Preconditions []*IntentPrecondition `json:"preconditions"` @@ -495,6 +538,11 @@ var methods = map[string]method{ Service: "API", Annotations: map[string]string{}, }, + "/rpc/API/GetIntentTransactionHistory": { + Name: "GetIntentTransactionHistory", + Service: "API", + Annotations: map[string]string{}, + }, "/rpc/API/GetCCTPTransfer": { Name: "GetCCTPTransfer", Service: "API", @@ -546,6 +594,7 @@ var WebRPCServices = map[string][]string{ "GetIntentsQuote", "CommitIntentConfig", "GetIntentConfig", + "GetIntentTransactionHistory", "GetCCTPTransfer", "QueueCCTPTransfer", "QueueIntentConfigExecution", @@ -568,9 +617,11 @@ type API interface { GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) // Persists intent configuration details to database for later execution, creating a new intent config record. - CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) // Retrieves stored intent configuration by wallet address for inspection or execution. GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // Intent transaction history endpoint + GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) // Marks an intent config as ready for processing by the execution worker. @@ -596,9 +647,11 @@ type APIClient interface { GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) // Persists intent configuration details to database for later execution, creating a new intent config record. - CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) + CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) // Retrieves stored intent configuration by wallet address for inspection or execution. GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // Intent transaction history endpoint + GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) // Marks an intent config as ready for processing by the execution worker. @@ -619,12 +672,12 @@ const APIPathPrefix = "/rpc/API/" type aPIClient struct { client HTTPClient - urls [14]string + urls [15]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [14]string{ + urls := [15]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -633,6 +686,7 @@ func NewAPIClient(addr string, client HTTPClient) APIClient { prefix + "GetIntentsQuote", prefix + "CommitIntentConfig", prefix + "GetIntentConfig", + prefix + "GetIntentTransactionHistory", prefix + "GetCCTPTransfer", prefix + "QueueCCTPTransfer", prefix + "QueueIntentConfigExecution", @@ -748,15 +802,10 @@ func (c *aPIClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuote return out.Ret0, err } -func (c *aPIClient) CommitIntentConfig(ctx context.Context, originIntentAddress string, destinationIntentAddress string, mainSigner string, calls []*IntentCallsPayload, preconditions []*IntentPrecondition, addressOverrides *AddressOverrides) (*IntentConfig, error) { +func (c *aPIClient) CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) { in := struct { - Arg0 string `json:"originIntentAddress"` - Arg1 string `json:"destinationIntentAddress"` - Arg2 string `json:"mainSigner"` - Arg3 []*IntentCallsPayload `json:"calls"` - Arg4 []*IntentPrecondition `json:"preconditions"` - Arg5 *AddressOverrides `json:"addressOverrides"` - }{originIntentAddress, destinationIntentAddress, mainSigner, calls, preconditions, addressOverrides} + Arg0 *CommitIntentConfigParams `json:"params"` + }{params} out := struct { Ret0 *IntentConfig `json:"config"` }{} @@ -791,6 +840,27 @@ func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) ( return out.Ret0, err } +func (c *aPIClient) GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) { + in := struct { + Arg0 string `json:"accountAddress"` + Arg1 *Page `json:"page"` + }{accountAddress, page} + out := struct { + Ret0 *Page `json:"page"` + Ret1 []*IntentTransaction `json:"transactions"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, out.Ret1, err +} + func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) { in := struct { Arg0 string `json:"id"` @@ -799,7 +869,7 @@ func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -821,7 +891,7 @@ func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -840,7 +910,7 @@ func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfig Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -859,7 +929,7 @@ func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo Ret0 string `json:"executionStatus"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -880,7 +950,7 @@ func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, execution Ret1 []*IntentConfig `json:"intentConfigs"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -899,7 +969,7 @@ func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From 5e1c3f1e244883b6282fe594892f5cc10e3c4da9 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:31:37 +0000 Subject: [PATCH 006/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 150 +++++++++++++++++++++-------------- 1 file changed, 89 insertions(+), 61 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 4b6097a6..3f2e3a58 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ // trails-api v0.4.0 382b29dc1d49e1b98fb4b074aec76beb06a1cd3d // -- -// Code generated by webrpc-gen@v0.25.3 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -22,7 +22,7 @@ import ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.25.3;gen-golang@v0.18.4;trails-api@v0.4.0" +const WebrpcHeaderValue = "webrpc@v0.28.1;gen-golang@v0.21.0;trails-api@v0.4.0" // WebRPC description and code-gen version func WebRPCVersion() string { @@ -499,79 +499,79 @@ type IntentQuote struct { var methods = map[string]method{ "/rpc/API/Ping": { - Name: "Ping", - Service: "API", - Annotations: map[string]string{}, + name: "Ping", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/Version": { - Name: "Version", - Service: "API", - Annotations: map[string]string{}, + name: "Version", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/RuntimeStatus": { - Name: "RuntimeStatus", - Service: "API", - Annotations: map[string]string{}, + name: "RuntimeStatus", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/Clock": { - Name: "Clock", - Service: "API", - Annotations: map[string]string{}, + name: "Clock", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/GetIntentCallsPayloads": { - Name: "GetIntentCallsPayloads", - Service: "API", - Annotations: map[string]string{}, + name: "GetIntentCallsPayloads", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/GetIntentsQuote": { - Name: "GetIntentsQuote", - Service: "API", - Annotations: map[string]string{}, + name: "GetIntentsQuote", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/CommitIntentConfig": { - Name: "CommitIntentConfig", - Service: "API", - Annotations: map[string]string{}, + name: "CommitIntentConfig", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/GetIntentConfig": { - Name: "GetIntentConfig", - Service: "API", - Annotations: map[string]string{}, + name: "GetIntentConfig", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/GetIntentTransactionHistory": { - Name: "GetIntentTransactionHistory", - Service: "API", - Annotations: map[string]string{}, + name: "GetIntentTransactionHistory", + service: "API", + annotations: map[string]string{}, }, "/rpc/API/GetCCTPTransfer": { - Name: "GetCCTPTransfer", - Service: "API", - Annotations: map[string]string{"public": ""}, + name: "GetCCTPTransfer", + service: "API", + annotations: map[string]string{"public": ""}, }, "/rpc/API/QueueCCTPTransfer": { - Name: "QueueCCTPTransfer", - Service: "API", - Annotations: map[string]string{"public": ""}, + name: "QueueCCTPTransfer", + service: "API", + annotations: map[string]string{"public": ""}, }, "/rpc/API/QueueIntentConfigExecution": { - Name: "QueueIntentConfigExecution", - Service: "API", - Annotations: map[string]string{"public": ""}, + name: "QueueIntentConfigExecution", + service: "API", + annotations: map[string]string{"public": ""}, }, "/rpc/API/GetIntentConfigExecutionStatus": { - Name: "GetIntentConfigExecutionStatus", - Service: "API", - Annotations: map[string]string{"public": ""}, + name: "GetIntentConfigExecutionStatus", + service: "API", + annotations: map[string]string{"public": ""}, }, "/rpc/API/ListIntentConfigs": { - Name: "ListIntentConfigs", - Service: "API", - Annotations: map[string]string{"public": ""}, + name: "ListIntentConfigs", + service: "API", + annotations: map[string]string{"public": ""}, }, "/rpc/API/QueueMetaTxnReceipt": { - Name: "QueueMetaTxnReceipt", - Service: "API", - Annotations: map[string]string{"public": ""}, + name: "QueueMetaTxnReceipt", + service: "API", + annotations: map[string]string{"public": ""}, }, } @@ -768,6 +768,7 @@ func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, params *GetInten in := struct { Arg0 *GetIntentCallsPayloadParams `json:"params"` }{params} + out := struct { Ret0 *IntentCallsPayloads `json:"payloads"` }{} @@ -787,6 +788,7 @@ func (c *aPIClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuote in := struct { Arg0 *GetIntentsQuoteParams `json:"params"` }{params} + out := struct { Ret0 *IntentQuote `json:"quote"` }{} @@ -806,6 +808,7 @@ func (c *aPIClient) CommitIntentConfig(ctx context.Context, params *CommitIntent in := struct { Arg0 *CommitIntentConfigParams `json:"params"` }{params} + out := struct { Ret0 *IntentConfig `json:"config"` }{} @@ -825,6 +828,7 @@ func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) ( in := struct { Arg0 string `json:"intentAddress"` }{intentAddress} + out := struct { Ret0 *IntentConfig `json:"config"` }{} @@ -845,6 +849,7 @@ func (c *aPIClient) GetIntentTransactionHistory(ctx context.Context, accountAddr Arg0 string `json:"accountAddress"` Arg1 *Page `json:"page"` }{accountAddress, page} + out := struct { Ret0 *Page `json:"page"` Ret1 []*IntentTransaction `json:"transactions"` @@ -865,6 +870,7 @@ func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf in := struct { Arg0 string `json:"id"` }{id} + out := struct { Ret0 *CCTPTransfer `json:"transfer"` }{} @@ -887,6 +893,7 @@ func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, Arg2 uint64 `json:"sourceChainId"` Arg3 uint64 `json:"destinationChainId"` }{sourceTxHash, metaTxHash, sourceChainId, destinationChainId} + out := struct { Ret0 *CCTPTransfer `json:"transfer"` }{} @@ -906,6 +913,7 @@ func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfig in := struct { Arg0 uint64 `json:"intentConfigId"` }{intentConfigId} + out := struct { Ret0 bool `json:"status"` }{} @@ -925,6 +933,7 @@ func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo in := struct { Arg0 uint64 `json:"intentConfigId"` }{intentConfigId} + out := struct { Ret0 string `json:"executionStatus"` }{} @@ -945,6 +954,7 @@ func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, execution Arg0 *Page `json:"page"` Arg1 *string `json:"executionStatus"` }{page, executionStatus} + out := struct { Ret0 *Page `json:"page"` Ret1 []*IntentConfig `json:"intentConfigs"` @@ -965,6 +975,7 @@ func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b in := struct { Arg0 string `json:"metaTxID"` }{metaTxID} + out := struct { Ret0 bool `json:"status"` }{} @@ -1103,9 +1114,26 @@ func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { // type method struct { - Name string - Service string - Annotations map[string]string + name string + service string + annotations map[string]string +} + +func (m method) Name() string { + return m.name +} + +func (m method) Service() string { + return m.service +} + +func (m method) Annotations() map[string]string { + res := make(map[string]string, len(m.annotations)) + for k, v := range m.annotations { + res[k] = v + } + + return res } type contextKey struct { @@ -1212,17 +1240,17 @@ func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError { // Webrpc errors var ( - ErrWebrpcEndpoint = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400} - ErrWebrpcRequestFailed = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400} - ErrWebrpcBadRoute = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404} - ErrWebrpcBadMethod = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405} - ErrWebrpcBadRequest = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400} - ErrWebrpcBadResponse = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500} - ErrWebrpcServerPanic = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500} - ErrWebrpcInternalError = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500} - ErrWebrpcClientDisconnected = WebRPCError{Code: -8, Name: "WebrpcClientDisconnected", Message: "client disconnected", HTTPStatus: 400} - ErrWebrpcStreamLost = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400} - ErrWebrpcStreamFinished = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200} + ErrWebrpcEndpoint = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400} + ErrWebrpcRequestFailed = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400} + ErrWebrpcBadRoute = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404} + ErrWebrpcBadMethod = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405} + ErrWebrpcBadRequest = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400} + ErrWebrpcBadResponse = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500} + ErrWebrpcServerPanic = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500} + ErrWebrpcInternalError = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500} + ErrWebrpcClientAborted = WebRPCError{Code: -8, Name: "WebrpcClientAborted", Message: "request aborted by client", HTTPStatus: 400} + ErrWebrpcStreamLost = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400} + ErrWebrpcStreamFinished = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200} ) // Schema errors From f836aea50d8e08ea348a5cc34c90811a09683df8 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 7 Oct 2025 01:29:25 +0000 Subject: [PATCH 007/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 3f2e3a58..5cd357a8 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 382b29dc1d49e1b98fb4b074aec76beb06a1cd3d +// trails-api v0.4.0 21fe8892ba70a2368cbf23d158a09a9b61873d6a // -- // Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "382b29dc1d49e1b98fb4b074aec76beb06a1cd3d" + return "21fe8892ba70a2368cbf23d158a09a9b61873d6a" } type WebrpcGenVersions struct { @@ -173,13 +173,14 @@ type Version struct { type RuntimeStatus struct { // overall status, true/false - HealthOK bool `json:"healthOK"` - StartTime time.Time `json:"startTime"` - Uptime uint64 `json:"uptime"` - Ver string `json:"ver"` - Branch string `json:"branch"` - CommitHash string `json:"commitHash"` - Checks *RuntimeChecks `json:"checks"` + HealthOK bool `json:"healthOK"` + StartTime time.Time `json:"startTime"` + Uptime uint64 `json:"uptime"` + Ver string `json:"ver"` + Branch string `json:"branch"` + CommitHash string `json:"commitHash"` + Checks *RuntimeChecks `json:"checks"` + // TODOXXX: copied from relayer, should we keep it? NumTxnsRelayed map[string]*NumTxnsRelayed `json:"numTxnsRelayed"` } From 844d4d2489d1bc4b89ec7c3d0d771be480a538a7 Mon Sep 17 00:00:00 2001 From: miguelmota <168240+miguelmota@users.noreply.github.com> Date: Tue, 7 Oct 2025 01:59:13 +0000 Subject: [PATCH 008/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 111 +++++++++++++++++++++++++++++++---- 1 file changed, 101 insertions(+), 10 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 5cd357a8..83f7ba9a 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 21fe8892ba70a2368cbf23d158a09a9b61873d6a +// trails-api v0.4.0 62cf3364b251220bd2fc985fae07f490158c119c // -- // Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "21fe8892ba70a2368cbf23d158a09a9b61873d6a" + return "62cf3364b251220bd2fc985fae07f490158c119c" } type WebrpcGenVersions struct { @@ -498,6 +498,35 @@ type IntentQuote struct { FeeQuotes map[string]string `json:"feeQuotes"` } +type GetIntentEntrypointDepositParams struct { + UserAddress prototyp.Hash `json:"userAddress"` + TokenAddress prototyp.Hash `json:"tokenAddress"` + Amount prototyp.BigInt `json:"amount"` + IntentAddress prototyp.Hash `json:"intentAddress"` + ChainID uint64 `json:"chainID"` + Deadline uint64 `json:"deadline"` + IntentSignature string `json:"intentSignature"` + UsePermit *bool `json:"usePermit"` + PermitDeadline *uint64 `json:"permitDeadline"` + PermitSignature *string `json:"permitSignature"` +} + +type GetIntentEntrypointDepositResult struct { + DepositWalletAddress string `json:"depositWalletAddress"` + MetaTxn *MetaTxn `json:"metaTxn"` + FeeQuote string `json:"feeQuote"` + EntrypointAddress string `json:"entrypointAddress"` +} + +type GetIntentEntrypointMessageHashParams struct { + UserAddress prototyp.Hash `json:"userAddress"` + TokenAddress prototyp.Hash `json:"tokenAddress"` + Amount prototyp.BigInt `json:"amount"` + IntentAddress prototyp.Hash `json:"intentAddress"` + ChainID uint64 `json:"chainID"` + Deadline uint64 `json:"deadline"` +} + var methods = map[string]method{ "/rpc/API/Ping": { name: "Ping", @@ -544,6 +573,16 @@ var methods = map[string]method{ service: "API", annotations: map[string]string{}, }, + "/rpc/API/GetIntentEntrypointDeposit": { + name: "GetIntentEntrypointDeposit", + service: "API", + annotations: map[string]string{"public": ""}, + }, + "/rpc/API/GetIntentEntrypointMessageHash": { + name: "GetIntentEntrypointMessageHash", + service: "API", + annotations: map[string]string{"public": ""}, + }, "/rpc/API/GetCCTPTransfer": { name: "GetCCTPTransfer", service: "API", @@ -596,6 +635,8 @@ var WebRPCServices = map[string][]string{ "CommitIntentConfig", "GetIntentConfig", "GetIntentTransactionHistory", + "GetIntentEntrypointDeposit", + "GetIntentEntrypointMessageHash", "GetCCTPTransfer", "QueueCCTPTransfer", "QueueIntentConfigExecution", @@ -623,6 +664,10 @@ type API interface { GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) // Intent transaction history endpoint GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) + // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. + GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) + // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. + GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) // Marks an intent config as ready for processing by the execution worker. @@ -653,6 +698,10 @@ type APIClient interface { GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) // Intent transaction history endpoint GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) + // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. + GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) + // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. + GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) // Marks an intent config as ready for processing by the execution worker. @@ -673,12 +722,12 @@ const APIPathPrefix = "/rpc/API/" type aPIClient struct { client HTTPClient - urls [15]string + urls [17]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [15]string{ + urls := [17]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -688,6 +737,8 @@ func NewAPIClient(addr string, client HTTPClient) APIClient { prefix + "CommitIntentConfig", prefix + "GetIntentConfig", prefix + "GetIntentTransactionHistory", + prefix + "GetIntentEntrypointDeposit", + prefix + "GetIntentEntrypointMessageHash", prefix + "GetCCTPTransfer", prefix + "QueueCCTPTransfer", prefix + "QueueIntentConfigExecution", @@ -867,6 +918,46 @@ func (c *aPIClient) GetIntentTransactionHistory(ctx context.Context, accountAddr return out.Ret0, out.Ret1, err } +func (c *aPIClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) { + in := struct { + Arg0 *GetIntentEntrypointDepositParams `json:"params"` + }{params} + + out := struct { + Ret0 *GetIntentEntrypointDepositResult `json:"result"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) { + in := struct { + Arg0 *GetIntentEntrypointMessageHashParams `json:"params"` + }{params} + + out := struct { + Ret0 string `json:"messageHash"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) { in := struct { Arg0 string `json:"id"` @@ -876,7 +967,7 @@ func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -899,7 +990,7 @@ func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -919,7 +1010,7 @@ func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfig Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -939,7 +1030,7 @@ func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo Ret0 string `json:"executionStatus"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -961,7 +1052,7 @@ func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, execution Ret1 []*IntentConfig `json:"intentConfigs"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -981,7 +1072,7 @@ func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From 33b407e6cc4e4b62d573244e386a89cd78c10b5f Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Tue, 7 Oct 2025 08:48:56 +0000 Subject: [PATCH 009/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 83f7ba9a..1ff9ec73 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 62cf3364b251220bd2fc985fae07f490158c119c +// trails-api v0.4.0 639386f692af6385305bf6901cc9f1b6fe21e979 // -- // Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "62cf3364b251220bd2fc985fae07f490158c119c" + return "639386f692af6385305bf6901cc9f1b6fe21e979" } type WebrpcGenVersions struct { @@ -267,9 +267,11 @@ type MetaTxnReceipt struct { } type AddressOverrides struct { - TrailsLiFiSapientSignerAddress *string `json:"trailsLiFiSapientSignerAddress"` - TrailsRelaySapientSignerAddress *string `json:"trailsRelaySapientSignerAddress"` - TrailsCCTPV2SapientSignerAddress *string `json:"trailsCCTPV2SapientSignerAddress"` + SequenceWalletFactoryAddress *string `json:"sequenceWalletFactoryAddress"` + SequenceWalletMainModuleAddress *string `json:"sequenceWalletMainModuleAddress"` + SequenceWalletMainModuleUpgradableAddress *string `json:"sequenceWalletMainModuleUpgradableAddress"` + SequenceWalletGuestModuleAddress *string `json:"sequenceWalletGuestModuleAddress"` + SequenceWalletUtilsAddress *string `json:"sequenceWalletUtilsAddress"` } type TakerFee struct { From f161920d14ba086b1640c7beb0a3d2e1bbdf2505 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:03:45 +0000 Subject: [PATCH 010/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 1ff9ec73..327a6b7f 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 639386f692af6385305bf6901cc9f1b6fe21e979 +// trails-api v0.4.0 8d6fd2f45083b3e8df2e6d6babe1046f788a6d43 // -- // Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "639386f692af6385305bf6901cc9f1b6fe21e979" + return "8d6fd2f45083b3e8df2e6d6babe1046f788a6d43" } type WebrpcGenVersions struct { @@ -180,8 +180,6 @@ type RuntimeStatus struct { Branch string `json:"branch"` CommitHash string `json:"commitHash"` Checks *RuntimeChecks `json:"checks"` - // TODOXXX: copied from relayer, should we keep it? - NumTxnsRelayed map[string]*NumTxnsRelayed `json:"numTxnsRelayed"` } type NumTxnsRelayed struct { From 0b78abb556ec9dc745170d964641a0961b428fc8 Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Fri, 10 Oct 2025 05:26:58 +0000 Subject: [PATCH 011/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 327a6b7f..9fe8b3bd 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 8d6fd2f45083b3e8df2e6d6babe1046f788a6d43 +// trails-api v0.4.0 fed97360e921855da1cdb97cf0a96404edb2950f // -- // Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "8d6fd2f45083b3e8df2e6d6babe1046f788a6d43" + return "fed97360e921855da1cdb97cf0a96404edb2950f" } type WebrpcGenVersions struct { @@ -474,9 +474,6 @@ type ExecuteQuote struct { type TrailsFee struct { ExecuteQuote *ExecuteQuote `json:"executeQuote"` CrossChainFee *CrossChainFee `json:"crossChainFee"` - TakerFeeAmount prototyp.BigInt `json:"takerFeeAmount"` - TakerFeeUSD *float64 `json:"takerFeeUSD"` - TrailsFixedFeeUSD float64 `json:"trailsFixedFeeUSD"` FeeToken prototyp.Hash `json:"feeToken"` OriginTokenTotalAmount prototyp.BigInt `json:"originTokenTotalAmount"` TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` From 34a8266b3170ad37e13574180eae5471483c141d Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Sat, 11 Oct 2025 00:29:41 +0000 Subject: [PATCH 012/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 117 ++++++++++++++++++++++------------- 1 file changed, 73 insertions(+), 44 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 9fe8b3bd..3d5ea011 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 fed97360e921855da1cdb97cf0a96404edb2950f +// trails-api v0.4.0 7ae581ed6118efc338a137a9a4699e2ec1f87f03 // -- // Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "fed97360e921855da1cdb97cf0a96404edb2950f" + return "7ae581ed6118efc338a137a9a4699e2ec1f87f03" } type WebrpcGenVersions struct { @@ -173,23 +173,12 @@ type Version struct { type RuntimeStatus struct { // overall status, true/false - HealthOK bool `json:"healthOK"` - StartTime time.Time `json:"startTime"` - Uptime uint64 `json:"uptime"` - Ver string `json:"ver"` - Branch string `json:"branch"` - CommitHash string `json:"commitHash"` - Checks *RuntimeChecks `json:"checks"` -} - -type NumTxnsRelayed struct { - ChainID uint64 `json:"chainID"` - Prev uint64 `json:"prev"` - Current uint64 `json:"current"` - Period uint64 `json:"period"` -} - -type RuntimeChecks struct { + HealthOK bool `json:"healthOK"` + StartTime time.Time `json:"startTime"` + Uptime uint64 `json:"uptime"` + Ver string `json:"ver"` + Branch string `json:"branch"` + CommitHash string `json:"commitHash"` } // From: `0xsequence/relayer`: https://github.com/0xsequence/relayer/blob/2c695b820970c68c57bfe71810f469412cdec675/proto/relayer.ridl#L502 @@ -272,11 +261,6 @@ type AddressOverrides struct { SequenceWalletUtilsAddress *string `json:"sequenceWalletUtilsAddress"` } -type TakerFee struct { - Address prototyp.Hash `json:"address"` - Bps uint64 `json:"bps"` -} - type OriginCall struct { ChainId prototyp.BigInt `json:"chainId"` To string `json:"to"` @@ -284,10 +268,25 @@ type OriginCall struct { TransactionValue prototyp.BigInt `json:"transactionValue"` } +// TODO: fix this.. it should adhere to 7795, which it does not. type IntentPrecondition struct { - Type string `json:"type"` - ChainId prototyp.BigInt `json:"chainId"` - Data interface{} `json:"data"` + // TODO: should be erc20MinAllowance + Type string `json:"type"` + ChainId prototyp.BigInt `json:"chainId"` + Data *IntentPreconditionData `json:"data"` +} + +// transaction preconditions based on https://eips.ethereum.org/EIPS/eip-7795 +// TODOXXX: these values are incorrect, and should match 7795 +// chainId: `0x${string}`; // Hex chain id +// owner: `0x${string}`; // Address +// token: `0x${string}`; // Address +// minAmount: `0x${string}`; // Hex value +type IntentPreconditionData struct { + Address string `json:"address"` + Token string `json:"token"` + // TODOXXX: this probably should be a hex string.. what does ERC + Min uint64 `json:"min"` } type Token struct { @@ -380,7 +379,6 @@ type GetIntentCallsPayloadParams struct { Provider *string `json:"provider"` AddressOverrides *AddressOverrides `json:"addressOverrides"` DestinationSalt *string `json:"destinationSalt"` - TakerFee *TakerFee `json:"takerFee"` SlippageTolerance *float64 `json:"slippageTolerance"` TradeType *TradeType `json:"tradeType"` } @@ -399,7 +397,6 @@ type GetIntentsQuoteParams struct { Provider *string `json:"provider"` AddressOverrides *AddressOverrides `json:"addressOverrides"` DestinationSalt *string `json:"destinationSalt"` - TakerFee *TakerFee `json:"takerFee"` SlippageTolerance *float64 `json:"slippageTolerance"` TradeType *TradeType `json:"tradeType"` ExactInputOriginalTokenAmount *string `json:"exactInputOriginalTokenAmount"` @@ -431,6 +428,7 @@ type IntentRequestParams struct { } type IntentCallsPayloads struct { + ID string `json:"id"` Calls []*IntentCallsPayload `json:"calls"` Preconditions []*IntentPrecondition `json:"preconditions"` MetaTxns []*MetaTxn `json:"metaTxns"` @@ -545,6 +543,11 @@ var methods = map[string]method{ service: "API", annotations: map[string]string{}, }, + "/rpc/API/ExecuteIntent": { + name: "ExecuteIntent", + service: "API", + annotations: map[string]string{}, + }, "/rpc/API/GetIntentCallsPayloads": { name: "GetIntentCallsPayloads", service: "API", @@ -627,6 +630,7 @@ var WebRPCServices = map[string][]string{ "Version", "RuntimeStatus", "Clock", + "ExecuteIntent", "GetIntentCallsPayloads", "GetIntentsQuote", "CommitIntentConfig", @@ -652,6 +656,8 @@ type API interface { Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) + // TODO: a lot of overlap with IntentConfig and other stuff.. + ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) @@ -686,6 +692,8 @@ type APIClient interface { Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) + // TODO: a lot of overlap with IntentConfig and other stuff.. + ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) @@ -719,16 +727,17 @@ const APIPathPrefix = "/rpc/API/" type aPIClient struct { client HTTPClient - urls [17]string + urls [18]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [17]string{ + urls := [18]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", prefix + "Clock", + prefix + "ExecuteIntent", prefix + "GetIntentCallsPayloads", prefix + "GetIntentsQuote", prefix + "CommitIntentConfig", @@ -813,6 +822,26 @@ func (c *aPIClient) Clock(ctx context.Context) (time.Time, error) { return out.Ret0, err } +func (c *aPIClient) ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) { + in := struct { + Arg0 *CommitIntentConfigParams `json:"intent"` + }{intent} + + out := struct { + Ret0 *IntentConfig `json:"config"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) { in := struct { Arg0 *GetIntentCallsPayloadParams `json:"params"` @@ -822,7 +851,7 @@ func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, params *GetInten Ret0 *IntentCallsPayloads `json:"payloads"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -842,7 +871,7 @@ func (c *aPIClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuote Ret0 *IntentQuote `json:"quote"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -862,7 +891,7 @@ func (c *aPIClient) CommitIntentConfig(ctx context.Context, params *CommitIntent Ret0 *IntentConfig `json:"config"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -882,7 +911,7 @@ func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) ( Ret0 *IntentConfig `json:"config"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -904,7 +933,7 @@ func (c *aPIClient) GetIntentTransactionHistory(ctx context.Context, accountAddr Ret1 []*IntentTransaction `json:"transactions"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -924,7 +953,7 @@ func (c *aPIClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetI Ret0 *GetIntentEntrypointDepositResult `json:"result"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -944,7 +973,7 @@ func (c *aPIClient) GetIntentEntrypointMessageHash(ctx context.Context, params * Ret0 string `json:"messageHash"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -964,7 +993,7 @@ func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -987,7 +1016,7 @@ func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1007,7 +1036,7 @@ func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfig Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1027,7 +1056,7 @@ func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo Ret0 string `json:"executionStatus"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1049,7 +1078,7 @@ func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, execution Ret1 []*IntentConfig `json:"intentConfigs"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1069,7 +1098,7 @@ func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From 421eea15123eb886200a2add13c97f98645a4ee8 Mon Sep 17 00:00:00 2001 From: miguelmota <168240+miguelmota@users.noreply.github.com> Date: Mon, 13 Oct 2025 18:51:16 +0000 Subject: [PATCH 013/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 87 +++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 3d5ea011..83dbf164 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 7ae581ed6118efc338a137a9a4699e2ec1f87f03 +// trails-api v0.4.0 c4f41586d79b6d1fd4283fcb3da2527586ebb033 // -- // Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. // @@ -36,7 +36,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "7ae581ed6118efc338a137a9a4699e2ec1f87f03" + return "c4f41586d79b6d1fd4283fcb3da2527586ebb033" } type WebrpcGenVersions struct { @@ -502,8 +502,11 @@ type GetIntentEntrypointDepositParams struct { Deadline uint64 `json:"deadline"` IntentSignature string `json:"intentSignature"` UsePermit *bool `json:"usePermit"` + PermitAmount prototyp.BigInt `json:"permitAmount"` PermitDeadline *uint64 `json:"permitDeadline"` PermitSignature *string `json:"permitSignature"` + // Optional fee parameters + FeeAmount prototyp.BigInt `json:"feeAmount"` } type GetIntentEntrypointDepositResult struct { @@ -520,6 +523,37 @@ type GetIntentEntrypointMessageHashParams struct { IntentAddress prototyp.Hash `json:"intentAddress"` ChainID uint64 `json:"chainID"` Deadline uint64 `json:"deadline"` + Nonce prototyp.BigInt `json:"nonce"` +} + +// Fee options related types +type GetIntentEntrypointDepositFeeOptionsParams struct { + UserAddress prototyp.Hash `json:"userAddress"` + TokenAddress prototyp.Hash `json:"tokenAddress"` + IntentAddress prototyp.Hash `json:"intentAddress"` + Amount prototyp.BigInt `json:"amount"` + ChainID uint64 `json:"chainID"` +} + +type GetIntentEntrypointDepositFeeOptionsResult struct { + GasEstimate *GasEstimate `json:"gasEstimate"` + FeeOptions []*FeeOption `json:"feeOptions"` + ExpiresAt uint64 `json:"expiresAt"` +} + +type GasEstimate struct { + TotalGas uint64 `json:"totalGas"` + GasPrice string `json:"gasPrice"` + NativeCost string `json:"nativeCost"` + NativeCostUSD float64 `json:"nativeCostUSD"` +} + +type FeeOption struct { + TokenAddress string `json:"tokenAddress"` + TokenSymbol string `json:"tokenSymbol"` + TokenDecimals int32 `json:"tokenDecimals"` + Amount string `json:"amount"` + AmountUSD float64 `json:"amountUSD"` } var methods = map[string]method{ @@ -578,6 +612,11 @@ var methods = map[string]method{ service: "API", annotations: map[string]string{"public": ""}, }, + "/rpc/API/GetIntentEntrypointDepositFeeOptions": { + name: "GetIntentEntrypointDepositFeeOptions", + service: "API", + annotations: map[string]string{"public": ""}, + }, "/rpc/API/GetIntentEntrypointMessageHash": { name: "GetIntentEntrypointMessageHash", service: "API", @@ -637,6 +676,7 @@ var WebRPCServices = map[string][]string{ "GetIntentConfig", "GetIntentTransactionHistory", "GetIntentEntrypointDeposit", + "GetIntentEntrypointDepositFeeOptions", "GetIntentEntrypointMessageHash", "GetCCTPTransfer", "QueueCCTPTransfer", @@ -669,6 +709,8 @@ type API interface { GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) + // Calculates fee options for intent entrypoint deposits. + GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) @@ -705,6 +747,8 @@ type APIClient interface { GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) + // Calculates fee options for intent entrypoint deposits. + GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) @@ -727,12 +771,12 @@ const APIPathPrefix = "/rpc/API/" type aPIClient struct { client HTTPClient - urls [18]string + urls [19]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [18]string{ + urls := [19]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -744,6 +788,7 @@ func NewAPIClient(addr string, client HTTPClient) APIClient { prefix + "GetIntentConfig", prefix + "GetIntentTransactionHistory", prefix + "GetIntentEntrypointDeposit", + prefix + "GetIntentEntrypointDepositFeeOptions", prefix + "GetIntentEntrypointMessageHash", prefix + "GetCCTPTransfer", prefix + "QueueCCTPTransfer", @@ -964,6 +1009,26 @@ func (c *aPIClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetI return out.Ret0, err } +func (c *aPIClient) GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) { + in := struct { + Arg0 *GetIntentEntrypointDepositFeeOptionsParams `json:"params"` + }{params} + + out := struct { + Ret0 *GetIntentEntrypointDepositFeeOptionsResult `json:"result"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + func (c *aPIClient) GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) { in := struct { Arg0 *GetIntentEntrypointMessageHashParams `json:"params"` @@ -973,7 +1038,7 @@ func (c *aPIClient) GetIntentEntrypointMessageHash(ctx context.Context, params * Ret0 string `json:"messageHash"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -993,7 +1058,7 @@ func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1016,7 +1081,7 @@ func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1036,7 +1101,7 @@ func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfig Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1056,7 +1121,7 @@ func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo Ret0 string `json:"executionStatus"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1078,7 +1143,7 @@ func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, execution Ret1 []*IntentConfig `json:"intentConfigs"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1098,7 +1163,7 @@ func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[18], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From 87ba7dae0147f0f36ae3d5955dec1906ada0ffca Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 21 Oct 2025 19:25:36 +0000 Subject: [PATCH 014/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 313 +++++++++++++++-------------------- 1 file changed, 135 insertions(+), 178 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 83dbf164..13d39a3e 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ -// trails-api v0.4.0 c4f41586d79b6d1fd4283fcb3da2527586ebb033 +// trails-api v0.4.0 debf6c73d2e0a7dbf749261baedad6291eedafab // -- -// Code generated by webrpc-gen@v0.28.1 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.29.0 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -20,10 +20,6 @@ import ( "github.com/0xsequence/go-sequence/lib/prototyp" ) -const WebrpcHeader = "Webrpc" - -const WebrpcHeaderValue = "webrpc@v0.28.1;gen-golang@v0.21.0;trails-api@v0.4.0" - // WebRPC description and code-gen version func WebRPCVersion() string { return "v1" @@ -36,62 +32,49 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "c4f41586d79b6d1fd4283fcb3da2527586ebb033" -} - -type WebrpcGenVersions struct { - WebrpcGenVersion string - CodeGenName string - CodeGenVersion string - SchemaName string - SchemaVersion string -} - -func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error) { - if h.Get(WebrpcHeader) == "" { - return nil, fmt.Errorf("header is empty or missing") - } - - versions, err := parseWebrpcGenVersions(h.Get(WebrpcHeader)) - if err != nil { - return nil, fmt.Errorf("webrpc header is invalid: %w", err) - } - - return versions, nil + return "debf6c73d2e0a7dbf749261baedad6291eedafab" } -func parseWebrpcGenVersions(header string) (*WebrpcGenVersions, error) { - versions := strings.Split(header, ";") - if len(versions) < 3 { - return nil, fmt.Errorf("expected at least 3 parts while parsing webrpc header: %v", header) - } - - _, webrpcGenVersion, ok := strings.Cut(versions[0], "@") - if !ok { - return nil, fmt.Errorf("webrpc gen version could not be parsed from: %s", versions[0]) - } - - tmplTarget, tmplVersion, ok := strings.Cut(versions[1], "@") - if !ok { - return nil, fmt.Errorf("tmplTarget and tmplVersion could not be parsed from: %s", versions[1]) - } - - schemaName, schemaVersion, ok := strings.Cut(versions[2], "@") - if !ok { - return nil, fmt.Errorf("schema name and schema version could not be parsed from: %s", versions[2]) - } +// +// Client interface +// - return &WebrpcGenVersions{ - WebrpcGenVersion: webrpcGenVersion, - CodeGenName: tmplTarget, - CodeGenVersion: tmplVersion, - SchemaName: schemaName, - SchemaVersion: schemaVersion, - }, nil +type APIClient interface { + Ping(ctx context.Context) (bool, error) + Version(ctx context.Context) (*Version, error) + RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) + Clock(ctx context.Context) (time.Time, error) + // TODO: a lot of overlap with IntentConfig and other stuff.. + ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) + // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. + GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) + GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) + // Persists intent configuration details to database for later execution, creating a new intent config record. + CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) + // Retrieves stored intent configuration by wallet address for inspection or execution. + GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // Intent transaction history endpoint + GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) + // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. + GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) + // Calculates fee options for intent entrypoint deposits. + GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) + // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. + GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) + GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) + QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) + // Marks an intent config as ready for processing by the execution worker. + QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + // Returns current execution status (pending/processing/executed/failed) for a given intent config. + GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + // Paginated listing of intent configs with optional execution status filtering. + ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) + // Processes relay transaction receipts to update intent execution status and trigger refund logic. + QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) } // -// Common types +// Schema types // type SortOrder uint32 @@ -524,6 +507,8 @@ type GetIntentEntrypointMessageHashParams struct { ChainID uint64 `json:"chainID"` Deadline uint64 `json:"deadline"` Nonce prototyp.BigInt `json:"nonce"` + FeeAmount prototyp.BigInt `json:"feeAmount"` + FeeCollector prototyp.Hash `json:"feeCollector"` } // Fee options related types @@ -536,9 +521,10 @@ type GetIntentEntrypointDepositFeeOptionsParams struct { } type GetIntentEntrypointDepositFeeOptionsResult struct { - GasEstimate *GasEstimate `json:"gasEstimate"` - FeeOptions []*FeeOption `json:"feeOptions"` - ExpiresAt uint64 `json:"expiresAt"` + GasEstimate *GasEstimate `json:"gasEstimate"` + FeeOptions []*FeeOption `json:"feeOptions"` + ExpiresAt uint64 `json:"expiresAt"` + FeeCollector string `json:"feeCollector"` } type GasEstimate struct { @@ -554,6 +540,7 @@ type FeeOption struct { TokenDecimals int32 `json:"tokenDecimals"` Amount string `json:"amount"` AmountUSD float64 `json:"amountUSD"` + FeeCollector string `json:"feeCollector"` } var methods = map[string]method{ @@ -687,89 +674,13 @@ var WebRPCServices = map[string][]string{ }, } -// -// Server types -// - -type API interface { - Ping(ctx context.Context) (bool, error) - Version(ctx context.Context) (*Version, error) - RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) - Clock(ctx context.Context) (time.Time, error) - // TODO: a lot of overlap with IntentConfig and other stuff.. - ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) - // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. - GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) - GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) - // Persists intent configuration details to database for later execution, creating a new intent config record. - CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) - // Retrieves stored intent configuration by wallet address for inspection or execution. - GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) - // Intent transaction history endpoint - GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) - // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. - GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) - // Calculates fee options for intent entrypoint deposits. - GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) - // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. - GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) - GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) - QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) - // Marks an intent config as ready for processing by the execution worker. - QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) - // Returns current execution status (pending/processing/executed/failed) for a given intent config. - GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) - // Paginated listing of intent configs with optional execution status filtering. - ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) - // Processes relay transaction receipts to update intent execution status and trigger refund logic. - QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) -} - -// -// Client types -// - -type APIClient interface { - Ping(ctx context.Context) (bool, error) - Version(ctx context.Context) (*Version, error) - RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) - Clock(ctx context.Context) (time.Time, error) - // TODO: a lot of overlap with IntentConfig and other stuff.. - ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) - // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. - GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) - GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) - // Persists intent configuration details to database for later execution, creating a new intent config record. - CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) - // Retrieves stored intent configuration by wallet address for inspection or execution. - GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) - // Intent transaction history endpoint - GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) - // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. - GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) - // Calculates fee options for intent entrypoint deposits. - GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) - // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. - GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) - GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) - QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) - // Marks an intent config as ready for processing by the execution worker. - QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) - // Returns current execution status (pending/processing/executed/failed) for a given intent config. - GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) - // Paginated listing of intent configs with optional execution status filtering. - ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) - // Processes relay transaction receipts to update intent execution status and trigger refund logic. - QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) -} - // // Client // const APIPathPrefix = "/rpc/API/" -type aPIClient struct { +type apiClient struct { client HTTPClient urls [19]string } @@ -797,13 +708,13 @@ func NewAPIClient(addr string, client HTTPClient) APIClient { prefix + "ListIntentConfigs", prefix + "QueueMetaTxnReceipt", } - return &aPIClient{ + return &apiClient{ client: client, urls: urls, } } -func (c *aPIClient) Ping(ctx context.Context) (bool, error) { +func (c *apiClient) Ping(ctx context.Context) (bool, error) { out := struct { Ret0 bool `json:"status"` }{} @@ -819,7 +730,7 @@ func (c *aPIClient) Ping(ctx context.Context) (bool, error) { return out.Ret0, err } -func (c *aPIClient) Version(ctx context.Context) (*Version, error) { +func (c *apiClient) Version(ctx context.Context) (*Version, error) { out := struct { Ret0 *Version `json:"version"` }{} @@ -835,7 +746,7 @@ func (c *aPIClient) Version(ctx context.Context) (*Version, error) { return out.Ret0, err } -func (c *aPIClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { +func (c *apiClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { out := struct { Ret0 *RuntimeStatus `json:"status"` }{} @@ -851,7 +762,7 @@ func (c *aPIClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { return out.Ret0, err } -func (c *aPIClient) Clock(ctx context.Context) (time.Time, error) { +func (c *apiClient) Clock(ctx context.Context) (time.Time, error) { out := struct { Ret0 time.Time `json:"serverTime"` }{} @@ -867,11 +778,10 @@ func (c *aPIClient) Clock(ctx context.Context) (time.Time, error) { return out.Ret0, err } -func (c *aPIClient) ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) { +func (c *apiClient) ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) { in := struct { Arg0 *CommitIntentConfigParams `json:"intent"` }{intent} - out := struct { Ret0 *IntentConfig `json:"config"` }{} @@ -887,11 +797,10 @@ func (c *aPIClient) ExecuteIntent(ctx context.Context, intent *CommitIntentConfi return out.Ret0, err } -func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) { +func (c *apiClient) GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) { in := struct { Arg0 *GetIntentCallsPayloadParams `json:"params"` }{params} - out := struct { Ret0 *IntentCallsPayloads `json:"payloads"` }{} @@ -907,11 +816,10 @@ func (c *aPIClient) GetIntentCallsPayloads(ctx context.Context, params *GetInten return out.Ret0, err } -func (c *aPIClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) { +func (c *apiClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) { in := struct { Arg0 *GetIntentsQuoteParams `json:"params"` }{params} - out := struct { Ret0 *IntentQuote `json:"quote"` }{} @@ -927,11 +835,10 @@ func (c *aPIClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuote return out.Ret0, err } -func (c *aPIClient) CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) { +func (c *apiClient) CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) { in := struct { Arg0 *CommitIntentConfigParams `json:"params"` }{params} - out := struct { Ret0 *IntentConfig `json:"config"` }{} @@ -947,11 +854,10 @@ func (c *aPIClient) CommitIntentConfig(ctx context.Context, params *CommitIntent return out.Ret0, err } -func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) { +func (c *apiClient) GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) { in := struct { Arg0 string `json:"intentAddress"` }{intentAddress} - out := struct { Ret0 *IntentConfig `json:"config"` }{} @@ -967,12 +873,11 @@ func (c *aPIClient) GetIntentConfig(ctx context.Context, intentAddress string) ( return out.Ret0, err } -func (c *aPIClient) GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) { +func (c *apiClient) GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) { in := struct { Arg0 string `json:"accountAddress"` Arg1 *Page `json:"page"` }{accountAddress, page} - out := struct { Ret0 *Page `json:"page"` Ret1 []*IntentTransaction `json:"transactions"` @@ -989,11 +894,10 @@ func (c *aPIClient) GetIntentTransactionHistory(ctx context.Context, accountAddr return out.Ret0, out.Ret1, err } -func (c *aPIClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) { +func (c *apiClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) { in := struct { Arg0 *GetIntentEntrypointDepositParams `json:"params"` }{params} - out := struct { Ret0 *GetIntentEntrypointDepositResult `json:"result"` }{} @@ -1009,11 +913,10 @@ func (c *aPIClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetI return out.Ret0, err } -func (c *aPIClient) GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) { +func (c *apiClient) GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) { in := struct { Arg0 *GetIntentEntrypointDepositFeeOptionsParams `json:"params"` }{params} - out := struct { Ret0 *GetIntentEntrypointDepositFeeOptionsResult `json:"result"` }{} @@ -1029,11 +932,10 @@ func (c *aPIClient) GetIntentEntrypointDepositFeeOptions(ctx context.Context, pa return out.Ret0, err } -func (c *aPIClient) GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) { +func (c *apiClient) GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) { in := struct { Arg0 *GetIntentEntrypointMessageHashParams `json:"params"` }{params} - out := struct { Ret0 string `json:"messageHash"` }{} @@ -1049,11 +951,10 @@ func (c *aPIClient) GetIntentEntrypointMessageHash(ctx context.Context, params * return out.Ret0, err } -func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) { +func (c *apiClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) { in := struct { Arg0 string `json:"id"` }{id} - out := struct { Ret0 *CCTPTransfer `json:"transfer"` }{} @@ -1069,14 +970,13 @@ func (c *aPIClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf return out.Ret0, err } -func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) { +func (c *apiClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) { in := struct { Arg0 *string `json:"sourceTxHash"` Arg1 *string `json:"metaTxHash"` Arg2 uint64 `json:"sourceChainId"` Arg3 uint64 `json:"destinationChainId"` }{sourceTxHash, metaTxHash, sourceChainId, destinationChainId} - out := struct { Ret0 *CCTPTransfer `json:"transfer"` }{} @@ -1092,11 +992,10 @@ func (c *aPIClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, return out.Ret0, err } -func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) { +func (c *apiClient) QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) { in := struct { Arg0 uint64 `json:"intentConfigId"` }{intentConfigId} - out := struct { Ret0 bool `json:"status"` }{} @@ -1112,11 +1011,10 @@ func (c *aPIClient) QueueIntentConfigExecution(ctx context.Context, intentConfig return out.Ret0, err } -func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) { +func (c *apiClient) GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) { in := struct { Arg0 uint64 `json:"intentConfigId"` }{intentConfigId} - out := struct { Ret0 string `json:"executionStatus"` }{} @@ -1132,12 +1030,11 @@ func (c *aPIClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo return out.Ret0, err } -func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) { +func (c *apiClient) ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) { in := struct { Arg0 *Page `json:"page"` Arg1 *string `json:"executionStatus"` }{page, executionStatus} - out := struct { Ret0 *Page `json:"page"` Ret1 []*IntentConfig `json:"intentConfigs"` @@ -1154,11 +1051,10 @@ func (c *aPIClient) ListIntentConfigs(ctx context.Context, page *Page, execution return out.Ret0, out.Ret1, err } -func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) { +func (c *apiClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) { in := struct { Arg0 string `json:"metaTxID"` }{metaTxID} - out := struct { Ret0 bool `json:"status"` }{} @@ -1174,6 +1070,10 @@ func (c *aPIClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b return out.Ret0, err } +// +// Client helpers +// + // HTTPClient is the interface used by generated clients to send HTTP requests. // It is fulfilled by *(net/http).Client, which is sufficient for most users. // Users can provide their own implementation for special retry policies. @@ -1293,7 +1193,7 @@ func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { } // -// Helpers +// Webrpc helpers // type method struct { @@ -1328,12 +1228,10 @@ func (k *contextKey) String() string { } var ( - HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} - HTTPRequestCtxKey = &contextKey{"HTTPRequest"} - - ServiceNameCtxKey = &contextKey{"ServiceName"} - - MethodNameCtxKey = &contextKey{"MethodName"} + HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} // client + HTTPRequestCtxKey = &contextKey{"HTTPRequest"} // server + ServiceNameCtxKey = &contextKey{"ServiceName"} // server + MethodNameCtxKey = &contextKey{"MethodName"} // server ) func ServiceNameFromContext(ctx context.Context) string { @@ -1464,3 +1362,62 @@ var ( ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} ) + +// +// Webrpc +// + +const WebrpcHeader = "Webrpc" + +const WebrpcHeaderValue = "webrpc@v0.29.0;gen-golang@v0.22.2;trails-api@v0.4.0" + +type WebrpcGenVersions struct { + WebrpcGenVersion string + CodeGenName string + CodeGenVersion string + SchemaName string + SchemaVersion string +} + +func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error) { + if h.Get(WebrpcHeader) == "" { + return nil, fmt.Errorf("header is empty or missing") + } + + versions, err := parseWebrpcGenVersions(h.Get(WebrpcHeader)) + if err != nil { + return nil, fmt.Errorf("webrpc header is invalid: %w", err) + } + + return versions, nil +} + +func parseWebrpcGenVersions(header string) (*WebrpcGenVersions, error) { + versions := strings.Split(header, ";") + if len(versions) < 3 { + return nil, fmt.Errorf("expected at least 3 parts while parsing webrpc header: %v", header) + } + + _, webrpcGenVersion, ok := strings.Cut(versions[0], "@") + if !ok { + return nil, fmt.Errorf("webrpc gen version could not be parsed from: %s", versions[0]) + } + + tmplTarget, tmplVersion, ok := strings.Cut(versions[1], "@") + if !ok { + return nil, fmt.Errorf("tmplTarget and tmplVersion could not be parsed from: %s", versions[1]) + } + + schemaName, schemaVersion, ok := strings.Cut(versions[2], "@") + if !ok { + return nil, fmt.Errorf("schema name and schema version could not be parsed from: %s", versions[2]) + } + + return &WebrpcGenVersions{ + WebrpcGenVersion: webrpcGenVersion, + CodeGenName: tmplTarget, + CodeGenVersion: tmplVersion, + SchemaName: schemaName, + SchemaVersion: schemaVersion, + }, nil +} From 40e38d971cfbd3af12e5965a6a35cb0dce7cbdfa Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:24:01 +0000 Subject: [PATCH 015/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 74 +++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 9 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 13d39a3e..1bbe62d9 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 debf6c73d2e0a7dbf749261baedad6291eedafab +// trails-api v0.4.0 30a311cd323c194a46ebd96b217d6b6be1007672 // -- // Code generated by webrpc-gen@v0.29.0 with golang generator. DO NOT EDIT. // @@ -32,7 +32,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "debf6c73d2e0a7dbf749261baedad6291eedafab" + return "30a311cd323c194a46ebd96b217d6b6be1007672" } // @@ -77,6 +77,57 @@ type APIClient interface { // Schema types // +type ExecutionStatus uint8 + +const ( + ExecutionStatus_created ExecutionStatus = 0 + ExecutionStatus_pending ExecutionStatus = 1 + ExecutionStatus_processing ExecutionStatus = 2 + ExecutionStatus_executed ExecutionStatus = 3 + ExecutionStatus_failed ExecutionStatus = 4 +) + +var ExecutionStatus_name = map[uint8]string{ + 0: "created", + 1: "pending", + 2: "processing", + 3: "executed", + 4: "failed", +} + +var ExecutionStatus_value = map[string]uint8{ + "created": 0, + "pending": 1, + "processing": 2, + "executed": 3, + "failed": 4, +} + +func (x ExecutionStatus) String() string { + return ExecutionStatus_name[uint8(x)] +} + +func (x ExecutionStatus) MarshalText() ([]byte, error) { + return []byte(ExecutionStatus_name[uint8(x)]), nil +} + +func (x *ExecutionStatus) UnmarshalText(b []byte) error { + *x = ExecutionStatus(ExecutionStatus_value[string(b)]) + return nil +} + +func (x *ExecutionStatus) Is(values ...ExecutionStatus) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type SortOrder uint32 const ( @@ -196,18 +247,23 @@ type IntentCallsPayload struct { // IntentConfig type IntentConfig struct { - ID uint64 `json:"id" db:"id,omitempty"` + ID uint64 `json:"id" db:"id,omitempty"` + // TODO: This field/column seems to be unused in dev/prod DBs. ConfigHash prototyp.Hash `json:"configHash" db:"config_hash"` OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"destination_intent_address"` MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` Calls prototyp.JSONString `json:"calls" db:"calls"` Preconditions prototyp.JSONString `json:"preconditions" db:"preconditions"` - ExecutionStatus *string `json:"executionStatus" db:"execution_status,omitempty"` - MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` - TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + ExecutionStatus ExecutionStatus `json:"executionStatus" db:"execution_status,omitempty"` + // TODO: This field/column seems to be unused in dev/prod DBs. + MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` + // TODO: This field/column seems to be unused in dev/prod DBs. + TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` + ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` + RetryCount uint64 `json:"retryCount" db:"retry_count"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // IntentTransaction represents a transaction that went through the intent machine @@ -217,7 +273,7 @@ type IntentTransaction struct { MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` - ExecutionStatus *string `json:"executionStatus" db:"execution_status,omitempty"` + ExecutionStatus ExecutionStatus `json:"executionStatus" db:"execution_status,omitempty"` OriginChainID *uint64 `json:"originChainId"` DestinationChainID *uint64 `json:"destinationChainId"` OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` From b2264419ecc21be3eb34b87ff34562c0f5a02f26 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:14:10 +0000 Subject: [PATCH 016/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 1bbe62d9..d8a5ebc4 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 30a311cd323c194a46ebd96b217d6b6be1007672 +// trails-api v0.4.0 1f8ef0bd3ab5a1f717035e46d67de5abb2fbc648 // -- // Code generated by webrpc-gen@v0.29.0 with golang generator. DO NOT EDIT. // @@ -32,7 +32,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "30a311cd323c194a46ebd96b217d6b6be1007672" + return "1f8ef0bd3ab5a1f717035e46d67de5abb2fbc648" } // @@ -207,12 +207,13 @@ type Version struct { type RuntimeStatus struct { // overall status, true/false - HealthOK bool `json:"healthOK"` - StartTime time.Time `json:"startTime"` - Uptime uint64 `json:"uptime"` - Ver string `json:"ver"` - Branch string `json:"branch"` - CommitHash string `json:"commitHash"` + HealthOK bool `json:"healthOK"` + StartTime time.Time `json:"startTime"` + Uptime uint64 `json:"uptime"` + Ver string `json:"ver"` + Branch string `json:"branch"` + CommitHash string `json:"commitHash"` + Runnables interface{} `json:"runnables"` } // From: `0xsequence/relayer`: https://github.com/0xsequence/relayer/blob/2c695b820970c68c57bfe71810f469412cdec675/proto/relayer.ridl#L502 From 40f035205c467d7b7d085c8a851f40743cdb430f Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 24 Oct 2025 01:39:55 +0000 Subject: [PATCH 017/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index d8a5ebc4..ab73ff9a 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ -// trails-api v0.4.0 1f8ef0bd3ab5a1f717035e46d67de5abb2fbc648 +// trails-api v0.4.0 36e1205943d9f99bcfd7d279a67514ac8869ec84 // -- -// Code generated by webrpc-gen@v0.29.0 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.30.1 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -32,7 +32,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "1f8ef0bd3ab5a1f717035e46d67de5abb2fbc648" + return "36e1205943d9f99bcfd7d279a67514ac8869ec84" } // @@ -47,18 +47,26 @@ type APIClient interface { // TODO: a lot of overlap with IntentConfig and other stuff.. ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. + // TODOXXX: rename to SolveIntent GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) + // TODOXXX: remove GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) + // TODOXXX: ExecuteIntent // Persists intent configuration details to database for later execution, creating a new intent config record. CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) + // TODOXXX: GetIntentDetails .. or another name..? // Retrieves stored intent configuration by wallet address for inspection or execution. GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) + // TODOXXX: keep the name! // Intent transaction history endpoint GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) + // TODOXXX: rename to GetIntentEntryTransaction // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) + // TODOXXX: rename to GetIntentGasFeeOptions // Calculates fee options for intent entrypoint deposits. GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) + // TODOXXX: remove completely // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) @@ -198,6 +206,16 @@ func (x *TradeType) Is(values ...TradeType) bool { return false } +type Transaction struct { + // TODO......... + Todo string `json:"todo"` +} + +type IntentReceipt struct { + // TODO ......... + Todo string `json:"todo"` +} + type Version struct { WebrpcVersion string `json:"webrpcVersion"` SchemaVersion string `json:"schemaVersion"` @@ -1320,6 +1338,9 @@ func MethodCtx(ctx context.Context) (method, bool) { return m, true } +// PtrTo is a useful helper when constructing values for optional fields. +func PtrTo[T any](v T) *T { return &v } + // // Errors // @@ -1426,7 +1447,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.29.0;gen-golang@v0.22.2;trails-api@v0.4.0" +const WebrpcHeaderValue = "webrpc@v0.30.1;gen-golang@v0.23.1;trails-api@v0.4.0" type WebrpcGenVersions struct { WebrpcGenVersion string From 4db53fe632282cb1b7cf8eb4c05fe2b80567a1d7 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 27 Oct 2025 13:47:33 +0000 Subject: [PATCH 018/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 43 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index ab73ff9a..8057b7c8 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 36e1205943d9f99bcfd7d279a67514ac8869ec84 +// trails-api v0.4.0 563242406b1457bb583d99d0c76c9e75e3f3b3f3 // -- // Code generated by webrpc-gen@v0.30.1 with golang generator. DO NOT EDIT. // @@ -32,7 +32,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "36e1205943d9f99bcfd7d279a67514ac8869ec84" + return "563242406b1457bb583d99d0c76c9e75e3f3b3f3" } // @@ -72,9 +72,9 @@ type APIClient interface { GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) // Marks an intent config as ready for processing by the execution worker. - QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) + QueueIntentConfigExecution(ctx context.Context, intentConfigId string) (bool, error) // Returns current execution status (pending/processing/executed/failed) for a given intent config. - GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) + GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId string) (string, error) // Paginated listing of intent configs with optional execution status filtering. ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) // Processes relay transaction receipts to update intent execution status and trigger refund logic. @@ -266,7 +266,10 @@ type IntentCallsPayload struct { // IntentConfig type IntentConfig struct { - ID uint64 `json:"id" db:"id,omitempty"` + // id is an internal-only sequential primary key. + ID uint64 `json:"-" db:"id,omitempty"` + // intentId is a deterministic public intent identifier. + IntentID prototyp.Hash `json:"intentId" db:"intent_id"` // TODO: This field/column seems to be unused in dev/prod DBs. ConfigHash prototyp.Hash `json:"configHash" db:"config_hash"` OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` @@ -275,14 +278,14 @@ type IntentConfig struct { Calls prototyp.JSONString `json:"calls" db:"calls"` Preconditions prototyp.JSONString `json:"preconditions" db:"preconditions"` ExecutionStatus ExecutionStatus `json:"executionStatus" db:"execution_status,omitempty"` - // TODO: This field/column seems to be unused in dev/prod DBs. - MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` - // TODO: This field/column seems to be unused in dev/prod DBs. - TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` - ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` - RetryCount uint64 `json:"retryCount" db:"retry_count"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + OriginMetaTxnID prototyp.Hash `json:"originMetaTxnId" db:"origin_meta_txn_id,omitempty"` + DestinationMetaTxnID prototyp.Hash `json:"destinationMetaTxnId" db:"destination_meta_txn_id,omitempty"` + OriginTxnHash prototyp.Hash `json:"originTxnHash" db:"origin_txn_hash,omitempty"` + DestinationTxnHash prototyp.Hash `json:"destinationTxnHash" db:"destination_txn_hash,omitempty"` + ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` + RetryCount uint64 `json:"retryCount" db:"retry_count"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // IntentTransaction represents a transaction that went through the intent machine @@ -290,8 +293,10 @@ type IntentTransaction struct { OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"destination_intent_address"` MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` - MetaTxnID *string `json:"metaTxnId" db:"meta_txn_id,omitempty"` - TxnHash *string `json:"txnHash" db:"txn_hash,omitempty"` + OriginMetaTxnID prototyp.Hash `json:"originMetaTxnId" db:"origin_meta_txn_id,omitempty"` + DestinationMetaTxnID prototyp.Hash `json:"destinationMetaTxnId" db:"destination_meta_txn_id,omitempty"` + OriginTxnHash prototyp.Hash `json:"originTxnHash" db:"origin_txn_hash,omitempty"` + DestinationTxnHash prototyp.Hash `json:"destinationTxnHash" db:"destination_txn_hash,omitempty"` ExecutionStatus ExecutionStatus `json:"executionStatus" db:"execution_status,omitempty"` OriginChainID *uint64 `json:"originChainId"` DestinationChainID *uint64 `json:"destinationChainId"` @@ -1067,9 +1072,9 @@ func (c *apiClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, return out.Ret0, err } -func (c *apiClient) QueueIntentConfigExecution(ctx context.Context, intentConfigId uint64) (bool, error) { +func (c *apiClient) QueueIntentConfigExecution(ctx context.Context, intentConfigId string) (bool, error) { in := struct { - Arg0 uint64 `json:"intentConfigId"` + Arg0 string `json:"intentConfigId"` }{intentConfigId} out := struct { Ret0 bool `json:"status"` @@ -1086,9 +1091,9 @@ func (c *apiClient) QueueIntentConfigExecution(ctx context.Context, intentConfig return out.Ret0, err } -func (c *apiClient) GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId uint64) (string, error) { +func (c *apiClient) GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId string) (string, error) { in := struct { - Arg0 uint64 `json:"intentConfigId"` + Arg0 string `json:"intentConfigId"` }{intentConfigId} out := struct { Ret0 string `json:"executionStatus"` From 50d48b3b0c85cb50877e0f7acaa8dab31257abdf Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 28 Oct 2025 00:10:23 +0000 Subject: [PATCH 019/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 74 +++++++++--------------------------- 1 file changed, 18 insertions(+), 56 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 8057b7c8..29501552 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v0.4.0 563242406b1457bb583d99d0c76c9e75e3f3b3f3 +// trails-api v0.4.0 983d4771af81d7ad7880e614060edf7a542f0ddd // -- // Code generated by webrpc-gen@v0.30.1 with golang generator. DO NOT EDIT. // @@ -32,7 +32,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "563242406b1457bb583d99d0c76c9e75e3f3b3f3" + return "983d4771af81d7ad7880e614060edf7a542f0ddd" } // @@ -44,8 +44,6 @@ type APIClient interface { Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) - // TODO: a lot of overlap with IntentConfig and other stuff.. - ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. // TODOXXX: rename to SolveIntent GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) @@ -206,16 +204,6 @@ func (x *TradeType) Is(values ...TradeType) bool { return false } -type Transaction struct { - // TODO......... - Todo string `json:"todo"` -} - -type IntentReceipt struct { - // TODO ......... - Todo string `json:"todo"` -} - type Version struct { WebrpcVersion string `json:"webrpcVersion"` SchemaVersion string `json:"schemaVersion"` @@ -644,11 +632,6 @@ var methods = map[string]method{ service: "API", annotations: map[string]string{}, }, - "/rpc/API/ExecuteIntent": { - name: "ExecuteIntent", - service: "API", - annotations: map[string]string{}, - }, "/rpc/API/GetIntentCallsPayloads": { name: "GetIntentCallsPayloads", service: "API", @@ -736,7 +719,6 @@ var WebRPCServices = map[string][]string{ "Version", "RuntimeStatus", "Clock", - "ExecuteIntent", "GetIntentCallsPayloads", "GetIntentsQuote", "CommitIntentConfig", @@ -762,17 +744,16 @@ const APIPathPrefix = "/rpc/API/" type apiClient struct { client HTTPClient - urls [19]string + urls [18]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [19]string{ + urls := [18]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", prefix + "Clock", - prefix + "ExecuteIntent", prefix + "GetIntentCallsPayloads", prefix + "GetIntentsQuote", prefix + "CommitIntentConfig", @@ -858,25 +839,6 @@ func (c *apiClient) Clock(ctx context.Context) (time.Time, error) { return out.Ret0, err } -func (c *apiClient) ExecuteIntent(ctx context.Context, intent *CommitIntentConfigParams) (*IntentConfig, error) { - in := struct { - Arg0 *CommitIntentConfigParams `json:"intent"` - }{intent} - out := struct { - Ret0 *IntentConfig `json:"config"` - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - func (c *apiClient) GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) { in := struct { Arg0 *GetIntentCallsPayloadParams `json:"params"` @@ -885,7 +847,7 @@ func (c *apiClient) GetIntentCallsPayloads(ctx context.Context, params *GetInten Ret0 *IntentCallsPayloads `json:"payloads"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -904,7 +866,7 @@ func (c *apiClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuote Ret0 *IntentQuote `json:"quote"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -923,7 +885,7 @@ func (c *apiClient) CommitIntentConfig(ctx context.Context, params *CommitIntent Ret0 *IntentConfig `json:"config"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -942,7 +904,7 @@ func (c *apiClient) GetIntentConfig(ctx context.Context, intentAddress string) ( Ret0 *IntentConfig `json:"config"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -963,7 +925,7 @@ func (c *apiClient) GetIntentTransactionHistory(ctx context.Context, accountAddr Ret1 []*IntentTransaction `json:"transactions"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -982,7 +944,7 @@ func (c *apiClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetI Ret0 *GetIntentEntrypointDepositResult `json:"result"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1001,7 +963,7 @@ func (c *apiClient) GetIntentEntrypointDepositFeeOptions(ctx context.Context, pa Ret0 *GetIntentEntrypointDepositFeeOptionsResult `json:"result"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1020,7 +982,7 @@ func (c *apiClient) GetIntentEntrypointMessageHash(ctx context.Context, params * Ret0 string `json:"messageHash"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1039,7 +1001,7 @@ func (c *apiClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1061,7 +1023,7 @@ func (c *apiClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, Ret0 *CCTPTransfer `json:"transfer"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1080,7 +1042,7 @@ func (c *apiClient) QueueIntentConfigExecution(ctx context.Context, intentConfig Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1099,7 +1061,7 @@ func (c *apiClient) GetIntentConfigExecutionStatus(ctx context.Context, intentCo Ret0 string `json:"executionStatus"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1120,7 +1082,7 @@ func (c *apiClient) ListIntentConfigs(ctx context.Context, page *Page, execution Ret1 []*IntentConfig `json:"intentConfigs"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1139,7 +1101,7 @@ func (c *apiClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[18], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From a875c1081ff6636f627cf47edd14400eacc3dda9 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 29 Oct 2025 20:24:17 +0000 Subject: [PATCH 020/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 1440 +++++++++++++++++++--------------- 1 file changed, 817 insertions(+), 623 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 29501552..fd548789 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,17 +1,19 @@ -// trails-api v0.4.0 983d4771af81d7ad7880e614060edf7a542f0ddd +// trails-api v1.0.0 d77c84a0d98b34c7e6d3a9810cc8819aee40b978 // -- -// Code generated by webrpc-gen@v0.30.1 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // -// webrpc-gen -schema=api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go +// webrpc-gen -schema=trails-api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api import ( "bytes" "context" + "database/sql/driver" "encoding/json" "errors" "fmt" "io" + "math/big" "net/http" "net/url" "strings" @@ -27,102 +29,85 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v0.4.0" + return "v1.0.0" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "983d4771af81d7ad7880e614060edf7a542f0ddd" + return "d77c84a0d98b34c7e6d3a9810cc8819aee40b978" } // // Client interface // -type APIClient interface { +type TrailsClient interface { Ping(ctx context.Context) (bool, error) Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) - // Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers. - // TODOXXX: rename to SolveIntent - GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) - // TODOXXX: remove - GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) - // TODOXXX: ExecuteIntent - // Persists intent configuration details to database for later execution, creating a new intent config record. - CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) - // TODOXXX: GetIntentDetails .. or another name..? - // Retrieves stored intent configuration by wallet address for inspection or execution. - GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) - // TODOXXX: keep the name! - // Intent transaction history endpoint - GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) - // TODOXXX: rename to GetIntentEntryTransaction - // Generates gasless meta transaction for depositing tokens into an Intent Entrypoint contract. - GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) - // TODOXXX: rename to GetIntentGasFeeOptions - // Calculates fee options for intent entrypoint deposits. - GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) - // TODOXXX: remove completely - // Calculates the EIP-712 message hash that user needs to sign for intent entrypoint deposit. - GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) - GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) - QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) - // Marks an intent config as ready for processing by the execution worker. - QueueIntentConfigExecution(ctx context.Context, intentConfigId string) (bool, error) - // Returns current execution status (pending/processing/executed/failed) for a given intent config. - GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId string) (string, error) - // Paginated listing of intent configs with optional execution status filtering. - ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) - // Processes relay transaction receipts to update intent execution status and trigger refund logic. - QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) + QuoteIntent(ctx context.Context, quoteIntentRequest QuoteIntentRequest) (*QuoteIntentResponse, error) + CommitIntent(ctx context.Context, commitIntentRequest CommitIntentRequest) (*CommitIntentResponse, error) + ExecuteIntent(ctx context.Context, executeIntentRequest ExecuteIntentRequest) (*ExecuteIntentResponse, error) + WaitIntentReceipt(ctx context.Context, waitIntentReceiptRequest WaitIntentReceiptRequest) (*WaitIntentReceiptResponse, error) + GetIntentReceipt(ctx context.Context, getIntentReceiptRequest GetIntentReceiptRequest) (*GetIntentReceiptResponse, error) + GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) + SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) + GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) + GetIntentGasFeeOptions(ctx context.Context, getIntentGasFeeOptionsRequest GetIntentGasFeeOptionsRequest) (*GetIntentGasFeeOptionsResponse, error) + GetIntentEntryTransaction(ctx context.Context, getIntentEntryTransactionRequest GetIntentEntryTransactionRequest) (*GetIntentEntryTransactionResponse, error) } // // Schema types // -type ExecutionStatus uint8 +type TradeType string const ( - ExecutionStatus_created ExecutionStatus = 0 - ExecutionStatus_pending ExecutionStatus = 1 - ExecutionStatus_processing ExecutionStatus = 2 - ExecutionStatus_executed ExecutionStatus = 3 - ExecutionStatus_failed ExecutionStatus = 4 + TradeType_EXACT_INPUT TradeType = "EXACT_INPUT" + TradeType_EXACT_OUTPUT TradeType = "EXACT_OUTPUT" ) -var ExecutionStatus_name = map[uint8]string{ - 0: "created", - 1: "pending", - 2: "processing", - 3: "executed", - 4: "failed", +func (x TradeType) MarshalText() ([]byte, error) { + return []byte(x), nil } -var ExecutionStatus_value = map[string]uint8{ - "created": 0, - "pending": 1, - "processing": 2, - "executed": 3, - "failed": 4, +func (x *TradeType) UnmarshalText(b []byte) error { + *x = TradeType(string(b)) + return nil } -func (x ExecutionStatus) String() string { - return ExecutionStatus_name[uint8(x)] +func (x *TradeType) Is(values ...TradeType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false } -func (x ExecutionStatus) MarshalText() ([]byte, error) { - return []byte(ExecutionStatus_name[uint8(x)]), nil +type QuoteProviderType string + +const ( + QuoteProviderType_RELAY QuoteProviderType = "RELAY" + QuoteProviderType_CCTPV2 QuoteProviderType = "CCTPV2" + QuoteProviderType_LIFI QuoteProviderType = "LIFI" +) + +func (x QuoteProviderType) MarshalText() ([]byte, error) { + return []byte(x), nil } -func (x *ExecutionStatus) UnmarshalText(b []byte) error { - *x = ExecutionStatus(ExecutionStatus_value[string(b)]) +func (x *QuoteProviderType) UnmarshalText(b []byte) error { + *x = QuoteProviderType(string(b)) return nil } -func (x *ExecutionStatus) Is(values ...ExecutionStatus) bool { +func (x *QuoteProviderType) Is(values ...QuoteProviderType) bool { if x == nil { return false } @@ -134,37 +119,43 @@ func (x *ExecutionStatus) Is(values ...ExecutionStatus) bool { return false } -type SortOrder uint32 +type TransactionStatus uint8 const ( - SortOrder_DESC SortOrder = 0 - SortOrder_ASC SortOrder = 1 + TransactionStatus_PENDING TransactionStatus = 0 + TransactionStatus_PROCESSING TransactionStatus = 1 + TransactionStatus_FAILED TransactionStatus = 2 + TransactionStatus_SUCCEEDED TransactionStatus = 3 ) -var SortOrder_name = map[uint32]string{ - 0: "DESC", - 1: "ASC", +var TransactionStatus_name = map[uint8]string{ + 0: "PENDING", + 1: "PROCESSING", + 2: "FAILED", + 3: "SUCCEEDED", } -var SortOrder_value = map[string]uint32{ - "DESC": 0, - "ASC": 1, +var TransactionStatus_value = map[string]uint8{ + "PENDING": 0, + "PROCESSING": 1, + "FAILED": 2, + "SUCCEEDED": 3, } -func (x SortOrder) String() string { - return SortOrder_name[uint32(x)] +func (x TransactionStatus) String() string { + return TransactionStatus_name[uint8(x)] } -func (x SortOrder) MarshalText() ([]byte, error) { - return []byte(SortOrder_name[uint32(x)]), nil +func (x TransactionStatus) MarshalText() ([]byte, error) { + return []byte(TransactionStatus_name[uint8(x)]), nil } -func (x *SortOrder) UnmarshalText(b []byte) error { - *x = SortOrder(SortOrder_value[string(b)]) +func (x *TransactionStatus) UnmarshalText(b []byte) error { + *x = TransactionStatus(TransactionStatus_value[string(b)]) return nil } -func (x *SortOrder) Is(values ...SortOrder) bool { +func (x *TransactionStatus) Is(values ...TransactionStatus) bool { if x == nil { return false } @@ -176,23 +167,46 @@ func (x *SortOrder) Is(values ...SortOrder) bool { return false } -type TradeType string +type IntentStatus uint8 const ( - TradeType_EXACT_INPUT TradeType = "EXACT_INPUT" - TradeType_EXACT_OUTPUT TradeType = "EXACT_OUTPUT" + IntentStatus_SOLVED IntentStatus = 0 + IntentStatus_COMMITTED IntentStatus = 1 + IntentStatus_EXECUTING IntentStatus = 2 + IntentStatus_FAILED IntentStatus = 3 + IntentStatus_SUCCEEDED IntentStatus = 4 ) -func (x TradeType) MarshalText() ([]byte, error) { - return []byte(x), nil +var IntentStatus_name = map[uint8]string{ + 0: "SOLVED", + 1: "COMMITTED", + 2: "EXECUTING", + 3: "FAILED", + 4: "SUCCEEDED", } -func (x *TradeType) UnmarshalText(b []byte) error { - *x = TradeType(string(b)) +var IntentStatus_value = map[string]uint8{ + "SOLVED": 0, + "COMMITTED": 1, + "EXECUTING": 2, + "FAILED": 3, + "SUCCEEDED": 4, +} + +func (x IntentStatus) String() string { + return IntentStatus_name[uint8(x)] +} + +func (x IntentStatus) MarshalText() ([]byte, error) { + return []byte(IntentStatus_name[uint8(x)]), nil +} + +func (x *IntentStatus) UnmarshalText(b []byte) error { + *x = IntentStatus(IntentStatus_value[string(b)]) return nil } -func (x *TradeType) Is(values ...TradeType) bool { +func (x *IntentStatus) Is(values ...IntentStatus) bool { if x == nil { return false } @@ -204,38 +218,104 @@ func (x *TradeType) Is(values ...TradeType) bool { return false } -type Version struct { - WebrpcVersion string `json:"webrpcVersion"` - SchemaVersion string `json:"schemaVersion"` - SchemaHash string `json:"schemaHash"` - AppVersion string `json:"appVersion"` +type ChainGasUsageStatus string + +const ( + ChainGasUsageStatus_NORMAL ChainGasUsageStatus = "NORMAL" + ChainGasUsageStatus_BUSY ChainGasUsageStatus = "BUSY" + ChainGasUsageStatus_VERY_BUSY ChainGasUsageStatus = "VERY_BUSY" +) + +func (x ChainGasUsageStatus) MarshalText() ([]byte, error) { + return []byte(x), nil } -type RuntimeStatus struct { - // overall status, true/false - HealthOK bool `json:"healthOK"` - StartTime time.Time `json:"startTime"` - Uptime uint64 `json:"uptime"` - Ver string `json:"ver"` - Branch string `json:"branch"` - CommitHash string `json:"commitHash"` - Runnables interface{} `json:"runnables"` +func (x *ChainGasUsageStatus) UnmarshalText(b []byte) error { + *x = ChainGasUsageStatus(string(b)) + return nil } -// From: `0xsequence/relayer`: https://github.com/0xsequence/relayer/blob/2c695b820970c68c57bfe71810f469412cdec675/proto/relayer.ridl#L502 -// TODO: rename this to MetaTxnRaw (eventually), we can leave it for now to not break compat -// or name it, MetaTxnArgs ..? -type MetaTxn struct { - ID string `json:"id"` - ChainId prototyp.BigInt `json:"chainId"` - WalletAddress string `json:"walletAddress" db:"wallet_address"` - // TODO (later): rename this to `to: string` - Contract string `json:"contract" db:"to_address"` - // TODO: rename to 'execdata' - Input string `json:"input" db:"tx_data"` +func (x *ChainGasUsageStatus) Is(values ...ChainGasUsageStatus) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false } -type Call struct { +// User goal prior to solving/quoting, aka the intent request. +// +// NOTE: was previously named GetIntentCallsPayloadParams +// +// ............ +type QuoteIntentRequest struct { + OwnerAddress prototyp.Hash `json:"ownerAddress"` + OriginChainID uint64 `json:"originChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + // TODOXXX: remove this + OriginTokenAmount *prototyp.BigInt `json:"originTokenAmount"` + DestinationChainID uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + DestinationCallData *string `json:"destinationCallData"` + DestinationCallValue *string `json:"destinationCallValue"` + // NOTE: EXACT_OUTPUT is the default if unspecified + TradeType *TradeType `json:"tradeType"` + Options *QuoteIntentRequestOptions `json:"options"` +} + +type QuoteIntentRequestOptions struct { + QuoteProvider *QuoteProviderType `json:"quoteProvider"` + SlippageTolerance *float64 `json:"slippageTolerance"` + TrailsAddressOverrides *TrailsAddressOverrides `json:"trailsAddressOverrides"` +} + +// Fully formed/quoted/solved, executable intent. +// +// NOTE: was previously named IntentCallsPayloads, and as well IntentConfig +// was pretty much the same thing too, so consolidated into a single type. +// +// db table: 'intents' +type Intent struct { + // id is an internal-only sequential primary key. + ID uint64 `json:"-" db:"id,omitempty"` + // intentId is a deterministic public intent identifier + // based on the hash of the origin and destination intent addresses. + IntentID prototyp.Hash `json:"intentId" db:"intent_id"` + // intent status of different stages of the intent to keep track. + // note: we also track status in IntentReceipt for execution status. + Status IntentStatus `json:"status" db:"status,omitempty"` + QuoteRequest *QuoteIntentRequest `json:"quoteRequest" db:"quote_request"` + // intent owner / main signer + OwnerAddress prototyp.Hash `json:"ownerAddress" db:"owner_address"` + OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"orig_intent_address"` + DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"dest_intent_address"` + DestinationSalt prototyp.BigInt `json:"destinationSalt" db:"destination_salt"` + Calls []*IntentCalls `json:"calls" db:"calls"` + Preconditions []*IntentPrecondition `json:"preconditions" db:"preconditions"` + MetaTxns []*MetaTxn `json:"metaTxns" db:"meta_txns"` + Quote *IntentProviderQuote `json:"quote" db:"quote"` + Fees *IntentFees `json:"fees" db:"fees"` + ExecutedAt *time.Time `json:"executedAt,omitempty" db:"executed_at,omitempty"` + ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` +} + +// NOTE: was previously named IntentCallsPayload +type IntentCalls struct { + ChainID uint64 `json:"chainId"` + Space prototyp.BigInt `json:"space"` + Nonce prototyp.BigInt `json:"nonce"` + Calls []*TransactionCall `json:"calls"` +} + +type TransactionCall struct { To prototyp.Hash `json:"to"` Value prototyp.BigInt `json:"value"` Data prototyp.Hash `json:"data"` @@ -245,85 +325,11 @@ type Call struct { BehaviorOnError *uint8 `json:"behaviorOnError"` } -type IntentCallsPayload struct { - ChainId prototyp.BigInt `json:"chainId"` - Space prototyp.BigInt `json:"space"` - Nonce prototyp.BigInt `json:"nonce"` - Calls []*Call `json:"calls"` -} - -// IntentConfig -type IntentConfig struct { - // id is an internal-only sequential primary key. - ID uint64 `json:"-" db:"id,omitempty"` - // intentId is a deterministic public intent identifier. - IntentID prototyp.Hash `json:"intentId" db:"intent_id"` - // TODO: This field/column seems to be unused in dev/prod DBs. - ConfigHash prototyp.Hash `json:"configHash" db:"config_hash"` - OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` - DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"destination_intent_address"` - MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` - Calls prototyp.JSONString `json:"calls" db:"calls"` - Preconditions prototyp.JSONString `json:"preconditions" db:"preconditions"` - ExecutionStatus ExecutionStatus `json:"executionStatus" db:"execution_status,omitempty"` - OriginMetaTxnID prototyp.Hash `json:"originMetaTxnId" db:"origin_meta_txn_id,omitempty"` - DestinationMetaTxnID prototyp.Hash `json:"destinationMetaTxnId" db:"destination_meta_txn_id,omitempty"` - OriginTxnHash prototyp.Hash `json:"originTxnHash" db:"origin_txn_hash,omitempty"` - DestinationTxnHash prototyp.Hash `json:"destinationTxnHash" db:"destination_txn_hash,omitempty"` - ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` - RetryCount uint64 `json:"retryCount" db:"retry_count"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` -} - -// IntentTransaction represents a transaction that went through the intent machine -type IntentTransaction struct { - OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"origin_intent_address"` - DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"destination_intent_address"` - MainSigner prototyp.Hash `json:"mainSigner" db:"main_signer"` - OriginMetaTxnID prototyp.Hash `json:"originMetaTxnId" db:"origin_meta_txn_id,omitempty"` - DestinationMetaTxnID prototyp.Hash `json:"destinationMetaTxnId" db:"destination_meta_txn_id,omitempty"` - OriginTxnHash prototyp.Hash `json:"originTxnHash" db:"origin_txn_hash,omitempty"` - DestinationTxnHash prototyp.Hash `json:"destinationTxnHash" db:"destination_txn_hash,omitempty"` - ExecutionStatus ExecutionStatus `json:"executionStatus" db:"execution_status,omitempty"` - OriginChainID *uint64 `json:"originChainId"` - DestinationChainID *uint64 `json:"destinationChainId"` - OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` - OriginTokenAmount prototyp.BigInt `json:"originTokenAmount"` - DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` - DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` - DestinationToAddress prototyp.Hash `json:"destinationToAddress"` - CreatedAt *string `json:"createdAt"` -} - -// MetaTxnReceipt -type MetaTxnReceipt struct { - MetaTxID string `json:"metaTxID" db:"meta_tx_id"` - Status string `json:"status" db:"status"` - TxnReceipt *string `json:"txnReceipt" db:"txn_receipt"` - RevertReason *string `json:"revertReason" db:"revert_reason"` -} - -type AddressOverrides struct { - SequenceWalletFactoryAddress *string `json:"sequenceWalletFactoryAddress"` - SequenceWalletMainModuleAddress *string `json:"sequenceWalletMainModuleAddress"` - SequenceWalletMainModuleUpgradableAddress *string `json:"sequenceWalletMainModuleUpgradableAddress"` - SequenceWalletGuestModuleAddress *string `json:"sequenceWalletGuestModuleAddress"` - SequenceWalletUtilsAddress *string `json:"sequenceWalletUtilsAddress"` -} - -type OriginCall struct { - ChainId prototyp.BigInt `json:"chainId"` - To string `json:"to"` - TransactionData string `json:"transactionData"` - TransactionValue prototyp.BigInt `json:"transactionValue"` -} - // TODO: fix this.. it should adhere to 7795, which it does not. type IntentPrecondition struct { // TODO: should be erc20MinAllowance Type string `json:"type"` - ChainId prototyp.BigInt `json:"chainId"` + ChainID uint64 `json:"chainId"` Data *IntentPreconditionData `json:"data"` } @@ -336,21 +342,180 @@ type IntentPrecondition struct { type IntentPreconditionData struct { Address string `json:"address"` Token string `json:"token"` - // TODOXXX: this probably should be a hex string.. what does ERC + // TODOXXX: this probably should be a hex string.. what does ERC, should be string and prototyp.Hash Min uint64 `json:"min"` } -type Token struct { - ChainId uint64 `json:"chainId"` - ContractAddress prototyp.Hash `json:"contractAddress"` - TokenId *string `json:"tokenId"` +// MetaTxn is a meta-transaction to be submitted to Sequence Relayer. +// +// From: `0xsequence/relayer`: https://github.com/0xsequence/relayer/blob/2c695b820970c68c57bfe71810f469412cdec675/proto/relayer.ridl#L502 +// TODO: rename this to MetaTxnRaw (eventually), we can leave it for now to not break compat +// or name it, MetaTxnArgs ..? +// +// NOTE: this was previously named MetaTxn +type MetaTxn struct { + ID string `json:"id"` + ChainID uint64 `json:"chainId"` + // TODO: rename this to 'from: string' ? + WalletAddress string `json:"walletAddress" db:"wallet_address"` + // TODO (later): rename this to `to: string` + Contract string `json:"contract" db:"to_address"` + // TODO: rename to 'execdata' ? + Input string `json:"input" db:"tx_data"` } -type Price struct { - Value float64 `json:"value"` - Currency string `json:"currency"` +// IntentReceipt represents an intent that went through trails, and fully executed +// as a set of transactions, and is now complete. This method is used to fetch the +// status of an intent, and also used by the GetIntentTransactionHistory endpoint. +// +// NOTE: this was previously named IntentTransaction +// +// TODO: this type still needs some review.. for example, I wonder if we should have +// Intent or IntentReceipt split out the differrent transactions per chain as separate +// rows, instead of having it be consolidated.. I kinda prefer having them separate, +// but it could mean we have a new type called IntentTransaction which is that..? +// +// db table: 'intent_receipts' +type IntentReceipt struct { + // id is an internal-only sequential primary key. + ID uint64 `json:"-" db:"id,omitempty"` + // intent deterministic id + IntentID prototyp.Hash `json:"intentId" db:"intent_id"` + // intent execution status + Status IntentStatus `json:"status" db:"status,omitempty"` + // intent owner / main signer + OwnerAddress prototyp.Hash `json:"ownerAddress" db:"owner_address"` + // origin chain id where the intent originated from + OriginChainID uint64 `json:"originChainId" db:"orig_chain_id"` + // destination chain id where the intent is targetting as final execution + DestinationChainID uint64 `json:"destinationChainId" db:"dest_chain_id"` + // transfer transaction hash and status, which is the init + // transfer from the owner / main signer into the origin intent + // address on the origin chain id + TransferTransactionHash prototyp.Hash `json:"transferTransactionHash" db:"transfer_txn_hash"` + TransferTransactionStatus TransactionStatus `json:"transferTransactionStatus" db:"transfer_txn_status"` + // origin intent transaction db reference and runtime type + OriginTransactionID uint64 `json:"-" db:"orig_txn_id"` + OriginTransaction *IntentTransaction `json:"originTransaction" db:"-"` + // destination intent transaction db reference and runtime type + DestinationTransactionID uint64 `json:"-" db:"dest_txn_id"` + DestinationTransaction *IntentTransaction `json:"destinationTransaction" db:"-"` + // Worker fields for tracking background processing + ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` + RetryCount *uint32 `json:"retryCount" db:"retry_count,omitempty"` + // timestamp when the intent receipt was updated, usually from status change + UpdatedAt *string `json:"updatedAt" db:"updated_at,omitempty"` + // timestamp of when the intent receipt was created + CreatedAt *string `json:"createdAt" db:"created_at,omitempty"` +} + +// IntentTransaction represents a single transaction within an intent's execution flow. +// +// db table: 'intent_transactions' +type IntentTransaction struct { + // Auto-incrementing id used for table pk + ID uint64 `json:"-" db:"id,omitempty"` + // we don't return it in the json, no need. its internal. + // Intent id this transaction is associated with + IntentID prototyp.Hash `json:"intentId" db:"intent_id"` + // Chain where this transaction executes + ChainID uint64 `json:"chainId" db:"chain_id"` + MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id"` + // Transaction hash for this specific transaction + TxnHash prototyp.Hash `json:"txnHash" db:"txn_hash,omitempty"` + // Recipient address (aka, the intentAddress) + ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` + // Token being transferred in this transaction + TokenAddress prototyp.Hash `json:"tokenAddress" db:"token_address"` + // Amount transferred in this transaction + TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` + // TODO: how about calldata here too..? feels useful to have.. + // Status of this specific transaction + TxnStatus TransactionStatus `json:"txnStatus" db:"txn_status"` +} + +// IntentProviderQuote represents the quotes from the underlining providers for both +// the swap and/or bridge external providers. If we do both a swap and a bridge, then +// the total amount is the sum of both providers. The 'quoteProvider' enum, will indiciate +// multiple providers in that case. +// NOTE: previously named IntentQuote +type IntentProviderQuote struct { + QuoteProvider string `json:"quoteProvider"` + QuoteProviderRequestID string `json:"quoteProviderRequestId"` + QuoteProviderFeeUSD float64 `json:"quoteProviderFeeUsd"` + FromAmount prototyp.BigInt `json:"fromAmount"` + FromAmountMin prototyp.BigInt `json:"fromAmountMin"` + ToAmount prototyp.BigInt `json:"toAmount"` + ToAmountMin prototyp.BigInt `json:"toAmountMin"` + MaxSlippage float64 `json:"maxSlippage"` + PriceImpact float64 `json:"priceImpact"` + PriceImpactUSD float64 `json:"priceImpactUsd"` +} + +// NOTE: previously named TrailsFee +type IntentFees struct { + // gas fees on origin and destination chains + OriginGas *IntentTransactionGasFee `json:"originGas"` + DestinationGas *IntentTransactionGasFee `json:"destinationGas"` + // provider fees (swap + bridge + trails) + Provider *IntentProviderFees `json:"provider"` + // total fees including provider fees + gas fees + FeeTokenAddress prototyp.Hash `json:"feeTokenAddress"` + FeeTokenTotal prototyp.BigInt `json:"feeTokenTotal"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUsd"` +} + +// ProviderFees is the swap+bridge provider fee, trails fee summary and totals +// NOTE: previously named the CrossChainFee +type IntentProviderFees struct { + // quote provider fee component (swap and/or bridge) + // TODO: what is the providerFee token denomination? is it always origin token..? I think no. + QuoteProvider string `json:"quoteProvider"` + QuoteProviderFee prototyp.BigInt `json:"quoteProviderFee"` + QuoteProviderFeeUSD float64 `json:"quoteProviderFeeUsd"` + // trails provider fee component, denominated in the origin token + TrailsFee prototyp.BigInt `json:"trailsFee"` + TrailsFeeUSD float64 `json:"trailsFeeUsd"` + // total provider fees, aka, swap + bridge + trails fees + // TODO: what is this denomination? is it always origin token..? ... + // TODO: rename to totalFees ? and totalFeesUsd ? .. + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUsd"` +} + +// NOTE: previously named ChainExecuteQuote +type IntentTransactionGasFee struct { + ChainID uint64 `json:"chainId"` + TotalGasLimit prototyp.BigInt `json:"totalGasLimit"` + GasPrice prototyp.BigInt `json:"gasPrice"` + NativeTokenSymbol string `json:"nativeTokenSymbol"` + NativeTokenPriceUSD *float64 `json:"nativeTokenPriceUsd"` + ChainGasUsageStatus ChainGasUsageStatus `json:"chainGasUsageStatus"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUsd"` + // sequence relayer gas fee quotes + // AKA, meta transaction gas fee quotes for pre-sponsored + // TODO: this shouldnt be an array anymore... + MetaTxnFeeDetails []*MetaTxnFeeDetail `json:"metaTxnFeeDetails"` + // metaTxnGasQuote is like a voucher for gas sponsorship from the relayer + MetaTxnGasQuote string `json:"metaTxnGasQuote"` } +type MetaTxnFeeDetail struct { + MetaTxnID string `json:"metaTxnId"` + EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` + // TODO: whats up with this name? + FeeNative prototyp.BigInt `json:"feeNative"` +} + +// NOTE: this also comes from pricefeed package.. +// lets review, and move it there .. perhaps have types +// here, as seems we need it..? HOWEVER.. it seems +// that trails npm package still uses the sequence api +// for pricing directly, and we're not using the pricefeed +// from trails-api .. I think..? cuz, we don't have GetCoinPrices +// endpoint... so... type TokenPrice struct { Token *Token `json:"token"` Price *Price `json:"price"` @@ -362,46 +527,15 @@ type TokenPrice struct { UpdatedAt *time.Time `json:"updatedAt"` } -type ExchangeRate struct { - Name string `json:"name"` - Symbol string `json:"symbol"` - Value float64 `json:"value"` - VsCurrency string `json:"vsCurrency"` - CurrencyType string `json:"currencyType"` -} - -// TOOD: refactor, we should be returning a cursor always.. -// see indexer/indexer.ridl Page object.. -// -// --- -// -// Page represents a results page. This can be used both to request a page and -// to store the state of a page. -type Page struct { - // Common for both numbered pages and cursor: Number of items per page - // TODO: REMOVE.. - PageSize *uint32 `json:"pageSize"` - // Numbered pages: Page number, this is multiplied by the value of the parameter. - // TODO: REMOVE.. - Page *uint32 `json:"page"` - // Number of total items on this query. - // TODO: REMOVE.. - TotalRecords *uint64 `json:"totalRecords"` - // Cursor: column to compare before/after to - Column *string `json:"column"` - // Cursor: return column < before - include to get previous page - Before *interface{} `json:"before"` - // Cursor: return column > after - include to get next page - After *interface{} `json:"after"` - // Sorting filter - Sort []*SortBy `json:"sort"` - // Indicates if there are more results available - More *bool `json:"more,omitempty"` +type Token struct { + ChainID uint64 `json:"chainId"` + TokenAddress prototyp.Hash `json:"tokenAddress"` + TokenId *string `json:"tokenId"` } -type SortBy struct { - Column string `json:"column"` - Order SortOrder `json:"order"` +type Price struct { + Value float64 `json:"value"` + Currency string `json:"currency"` } type CCTPTransfer struct { @@ -416,134 +550,6 @@ type CCTPTransfer struct { UpdatedAt time.Time `json:"updatedAt"` } -type GetIntentCallsPayloadParams struct { - UserAddress prototyp.Hash `json:"userAddress"` - DestinationChainID uint64 `json:"destinationChainId"` - DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` - DestinationTokenAmount string `json:"destinationTokenAmount"` - DestinationToAddress prototyp.Hash `json:"destinationToAddress"` - OriginChainID uint64 `json:"originChainId"` - OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` - OriginTokenAmount string `json:"originTokenAmount"` - DestinationCallData *string `json:"destinationCallData"` - DestinationCallValue *string `json:"destinationCallValue"` - Provider *string `json:"provider"` - AddressOverrides *AddressOverrides `json:"addressOverrides"` - DestinationSalt *string `json:"destinationSalt"` - SlippageTolerance *float64 `json:"slippageTolerance"` - TradeType *TradeType `json:"tradeType"` -} - -type GetIntentsQuoteParams struct { - UserAddress prototyp.Hash `json:"userAddress"` - DestinationChainID uint64 `json:"destinationChainId"` - DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` - DestinationTokenAmount string `json:"destinationTokenAmount"` - DestinationToAddress prototyp.Hash `json:"destinationToAddress"` - OriginChainID uint64 `json:"originChainId"` - OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` - OriginTokenAmount string `json:"originTokenAmount"` - DestinationCallData *string `json:"destinationCallData"` - DestinationCallValue *string `json:"destinationCallValue"` - Provider *string `json:"provider"` - AddressOverrides *AddressOverrides `json:"addressOverrides"` - DestinationSalt *string `json:"destinationSalt"` - SlippageTolerance *float64 `json:"slippageTolerance"` - TradeType *TradeType `json:"tradeType"` - ExactInputOriginalTokenAmount *string `json:"exactInputOriginalTokenAmount"` -} - -type CommitIntentConfigParams struct { - OriginIntentAddress string `json:"originIntentAddress"` - DestinationIntentAddress string `json:"destinationIntentAddress"` - MainSigner string `json:"mainSigner"` - Calls []*IntentCallsPayload `json:"calls"` - Preconditions []*IntentPrecondition `json:"preconditions"` - AddressOverrides *AddressOverrides `json:"addressOverrides"` - RequestParams *IntentRequestParams `json:"requestParams"` -} - -type IntentRequestParams struct { - Version string `json:"version"` - UserAddress prototyp.Hash `json:"userAddress"` - DestinationChainId uint64 `json:"destinationChainId"` - DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` - DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` - DestinationToAddress prototyp.Hash `json:"destinationToAddress"` - OriginChainId uint64 `json:"originChainId"` - OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` - OriginTokenAmount prototyp.BigInt `json:"originTokenAmount"` - DestinationCallData *string `json:"destinationCallData"` - DestinationCallValue *string `json:"destinationCallValue"` - CreatedAt time.Time `json:"createdAt"` -} - -type IntentCallsPayloads struct { - ID string `json:"id"` - Calls []*IntentCallsPayload `json:"calls"` - Preconditions []*IntentPrecondition `json:"preconditions"` - MetaTxns []*MetaTxn `json:"metaTxns"` - TrailsFee *TrailsFee `json:"trailsFee"` - Quote *IntentQuote `json:"quote"` - FeeQuotes map[string]string `json:"feeQuotes"` - OriginIntentAddress string `json:"originIntentAddress"` - DestinationIntentAddress string `json:"destinationIntentAddress"` -} - -type CrossChainFee struct { - ProviderFee prototyp.BigInt `json:"providerFee"` - TrailsSwapFee prototyp.BigInt `json:"trailsSwapFee"` - ProviderFeeUSD float64 `json:"providerFeeUSD"` - TrailsSwapFeeUSD float64 `json:"trailsSwapFeeUSD"` - TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` - TotalFeeUSD float64 `json:"totalFeeUSD"` -} - -type MetaTxnFeeDetail struct { - MetaTxnID string `json:"metaTxnID"` - EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` - FeeNative prototyp.BigInt `json:"feeNative"` -} - -type ChainExecuteQuote struct { - ChainId prototyp.BigInt `json:"chainId"` - TotalGasLimit prototyp.BigInt `json:"totalGasLimit"` - GasPrice prototyp.BigInt `json:"gasPrice"` - TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` - NativeTokenSymbol string `json:"nativeTokenSymbol"` - NativeTokenPrice float64 `json:"nativeTokenPrice"` - MetaTxnFeeDetails []*MetaTxnFeeDetail `json:"metaTxnFeeDetails"` - TotalFeeUSD float64 `json:"totalFeeUSD"` -} - -type ExecuteQuote struct { - ChainQuotes []*ChainExecuteQuote `json:"chainQuotes"` -} - -type TrailsFee struct { - ExecuteQuote *ExecuteQuote `json:"executeQuote"` - CrossChainFee *CrossChainFee `json:"crossChainFee"` - FeeToken prototyp.Hash `json:"feeToken"` - OriginTokenTotalAmount prototyp.BigInt `json:"originTokenTotalAmount"` - TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` - TotalFeeUSD float64 `json:"totalFeeUSD"` - QuoteProvider *string `json:"quoteProvider"` -} - -type IntentQuote struct { - FromAmount prototyp.BigInt `json:"fromAmount"` - FromAmountMin prototyp.BigInt `json:"fromAmountMin"` - ToAmount prototyp.BigInt `json:"toAmount"` - ToAmountMin prototyp.BigInt `json:"toAmountMin"` - PriceImpact float64 `json:"priceImpact"` - PriceImpactUsd string `json:"priceImpactUsd"` - MaxSlippage float64 `json:"maxSlippage"` - QuoteProvider string `json:"quoteProvider"` - QuoteProviderRequestId string `json:"quoteProviderRequestId"` - QuoteProviderFeeUsd string `json:"quoteProviderFeeUsd"` - FeeQuotes map[string]string `json:"feeQuotes"` -} - type GetIntentEntrypointDepositParams struct { UserAddress prototyp.Hash `json:"userAddress"` TokenAddress prototyp.Hash `json:"tokenAddress"` @@ -567,18 +573,6 @@ type GetIntentEntrypointDepositResult struct { EntrypointAddress string `json:"entrypointAddress"` } -type GetIntentEntrypointMessageHashParams struct { - UserAddress prototyp.Hash `json:"userAddress"` - TokenAddress prototyp.Hash `json:"tokenAddress"` - Amount prototyp.BigInt `json:"amount"` - IntentAddress prototyp.Hash `json:"intentAddress"` - ChainID uint64 `json:"chainID"` - Deadline uint64 `json:"deadline"` - Nonce prototyp.BigInt `json:"nonce"` - FeeAmount prototyp.BigInt `json:"feeAmount"` - FeeCollector prototyp.Hash `json:"feeCollector"` -} - // Fee options related types type GetIntentEntrypointDepositFeeOptionsParams struct { UserAddress prototyp.Hash `json:"userAddress"` @@ -599,7 +593,7 @@ type GasEstimate struct { TotalGas uint64 `json:"totalGas"` GasPrice string `json:"gasPrice"` NativeCost string `json:"nativeCost"` - NativeCostUSD float64 `json:"nativeCostUSD"` + NativeCostUSD float64 `json:"nativeCostUsd"` } type FeeOption struct { @@ -607,100 +601,277 @@ type FeeOption struct { TokenSymbol string `json:"tokenSymbol"` TokenDecimals int32 `json:"tokenDecimals"` Amount string `json:"amount"` - AmountUSD float64 `json:"amountUSD"` + AmountUSD float64 `json:"amountUsd"` FeeCollector string `json:"feeCollector"` } +type TrailsAddressOverrides struct { + SequenceWalletFactoryAddress *string `json:"sequenceWalletFactoryAddress"` + SequenceWalletMainModuleAddress *string `json:"sequenceWalletMainModuleAddress"` + SequenceWalletMainModuleUpgradableAddress *string `json:"sequenceWalletMainModuleUpgradableAddress"` + SequenceWalletGuestModuleAddress *string `json:"sequenceWalletGuestModuleAddress"` + SequenceWalletUtilsAddress *string `json:"sequenceWalletUtilsAddress"` +} + +type SortOrder uint32 + +const ( + SortOrder_DESC SortOrder = 0 + SortOrder_ASC SortOrder = 1 +) + +var SortOrder_name = map[uint32]string{ + 0: "DESC", + 1: "ASC", +} + +var SortOrder_value = map[string]uint32{ + "DESC": 0, + "ASC": 1, +} + +func (x SortOrder) String() string { + return SortOrder_name[uint32(x)] +} + +func (x SortOrder) MarshalText() ([]byte, error) { + return []byte(SortOrder_name[uint32(x)]), nil +} + +func (x *SortOrder) UnmarshalText(b []byte) error { + *x = SortOrder(SortOrder_value[string(b)]) + return nil +} + +func (x *SortOrder) Is(values ...SortOrder) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type Version struct { + WebrpcVersion string `json:"webrpcVersion"` + SchemaVersion string `json:"schemaVersion"` + SchemaHash string `json:"schemaHash"` + AppVersion string `json:"appVersion"` +} + +type RuntimeStatus struct { + // overall status, true/false + HealthOK bool `json:"healthOK"` + StartTime time.Time `json:"startTime"` + Uptime uint64 `json:"uptime"` + Ver string `json:"ver"` + Branch string `json:"branch"` + CommitHash string `json:"commitHash"` + Runnables interface{} `json:"runnables"` +} + +// QuoteIntent accepts an intent request from the user/app and returns +// a fully formed/quoted/solved and executable Intent. +// +// NOTE: we use the IntentRequest directly for the QuoteIntent request type. +// And do not create a QuoteIntentRequest additional type, as its unnecessary. +type QuoteIntentResponse struct { + Intent *Intent `json:"intent"` +} + +// CommitIntent accepts a fully formed Intent and commits it for execution. CommitIntent +// is called by clients to confirm they wish to commit to the intent and will execute it. +// We return the intent ID for tracking. +type CommitIntentRequest struct { + Intent *Intent `json:"intent"` +} + +type CommitIntentResponse struct { + IntentID prototyp.Hash `json:"intentId"` +} + +// ExecuteIntent relays the intent execution request to the intent execution engine. +// Clients provide the transfer transaction hash that executed the transfer to the +// intent origin address. +type ExecuteIntentRequest struct { + IntentID prototyp.Hash `json:"intentId"` + TransferTransactionHash prototyp.Hash `json:"transferTransactionHash"` +} + +type ExecuteIntentResponse struct { + IntentID prototyp.Hash `json:"intentId"` + IntentStatus IntentStatus `json:"intentStatus"` +} + +// GetIntentReceipt returns the current receipt/status of an intent immediately. +// If you are waiting for a intent to complete, use WaitIntentReceipt. +type GetIntentReceiptRequest struct { + IntentID prototyp.Hash `json:"intentId"` +} + +type GetIntentReceiptResponse struct { + IntentReceipt *IntentReceipt `json:"intentReceipt"` +} + +// WaitIntentReceipt will block until the intent reaches a terminal status or timeout. +type WaitIntentReceiptRequest struct { + IntentID prototyp.Hash `json:"intentId"` +} + +type WaitIntentReceiptResponse struct { + IntentReceipt *IntentReceipt `json:"intentReceipt"` + // done flag informs a client whether the wait completed successfully (true) or timed out (false). + // as the clients will keep polling until done is true. NOTE: done does not indicate success, + // it just indicates the execution is done, to check status see intentReceipt.status. + Done bool `json:"done"` +} + +// GetIntent queries the database for solved and committed 'intents' +type GetIntentRequest struct { + IntentID prototyp.Hash `json:"intentId"` +} + +type GetIntentResponse struct { + Intent *Intent `json:"intent"` +} + +// SearchIntents searches past intents based on filters. +// We do not return 'solved' status intents here, only committed/executed/failed/succeeded. +type SearchIntentsRequest struct { + ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` + ByTransferTransactionHash prototyp.Hash `json:"byTransferTransactionHash"` + ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` +} + +type SearchIntentsResponse struct { + // NOTE: we intentionally do not return a page here, and limit it to 10 latest results + Intents []*Intent `json:"intents"` +} + +// GetIntentTransactionHistory returns the discrete transactions related to an intent. +type GetIntentTransactionHistoryRequest struct { + // cursor paging parameters + Page *Page `json:"page"` +} + +type GetIntentTransactionHistoryResponse struct { + Transactions []*IntentTransaction `json:"transactions"` + NextPage *Page `json:"nextPage"` +} + +// Gas fee options for intent entry (leverages existing Entrypoint fee option params/result types). +type GetIntentGasFeeOptionsRequest struct { + Params *GetIntentEntrypointDepositFeeOptionsParams `json:"params"` +} + +type GetIntentGasFeeOptionsResponse struct { + Result *GetIntentEntrypointDepositFeeOptionsResult `json:"result"` +} + +// Entry transaction (deposit) construction for an intent (leverages existing Entrypoint deposit params/result types). +type GetIntentEntryTransactionRequest struct { + Params *GetIntentEntrypointDepositParams `json:"params"` +} + +type GetIntentEntryTransactionResponse struct { + Result *GetIntentEntrypointDepositResult `json:"result"` +} + +// Page represents a results page. This can be used both to request a page and +// to store the state of a page. +type Page struct { + // Cursor: column to compare before/after to + Column *string `json:"column,omitempty"` + // Cursor: return column < before - include to get previous page + Before *interface{} `json:"before,omitempty"` + // Cursor: return column > after - include to get next page + After *interface{} `json:"after,omitempty"` + // Sorting filter + Sort []*SortBy `json:"sort,omitempty"` + // Number of items per page + PageSize *uint32 `json:"pageSize,omitempty"` + // Indicates if there are more results available + More *bool `json:"more,omitempty"` +} + +type SortBy struct { + Column string `json:"column"` + Order SortOrder `json:"order"` +} + var methods = map[string]method{ - "/rpc/API/Ping": { + "/rpc/Trails/Ping": { name: "Ping", - service: "API", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/Version": { + "/rpc/Trails/Version": { name: "Version", - service: "API", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/RuntimeStatus": { + "/rpc/Trails/RuntimeStatus": { name: "RuntimeStatus", - service: "API", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/Clock": { + "/rpc/Trails/Clock": { name: "Clock", - service: "API", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/GetIntentCallsPayloads": { - name: "GetIntentCallsPayloads", - service: "API", + "/rpc/Trails/QuoteIntent": { + name: "QuoteIntent", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/GetIntentsQuote": { - name: "GetIntentsQuote", - service: "API", + "/rpc/Trails/CommitIntent": { + name: "CommitIntent", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/CommitIntentConfig": { - name: "CommitIntentConfig", - service: "API", + "/rpc/Trails/ExecuteIntent": { + name: "ExecuteIntent", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/GetIntentConfig": { - name: "GetIntentConfig", - service: "API", + "/rpc/Trails/WaitIntentReceipt": { + name: "WaitIntentReceipt", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/GetIntentTransactionHistory": { - name: "GetIntentTransactionHistory", - service: "API", + "/rpc/Trails/GetIntentReceipt": { + name: "GetIntentReceipt", + service: "Trails", annotations: map[string]string{}, }, - "/rpc/API/GetIntentEntrypointDeposit": { - name: "GetIntentEntrypointDeposit", - service: "API", - annotations: map[string]string{"public": ""}, - }, - "/rpc/API/GetIntentEntrypointDepositFeeOptions": { - name: "GetIntentEntrypointDepositFeeOptions", - service: "API", - annotations: map[string]string{"public": ""}, - }, - "/rpc/API/GetIntentEntrypointMessageHash": { - name: "GetIntentEntrypointMessageHash", - service: "API", - annotations: map[string]string{"public": ""}, - }, - "/rpc/API/GetCCTPTransfer": { - name: "GetCCTPTransfer", - service: "API", - annotations: map[string]string{"public": ""}, - }, - "/rpc/API/QueueCCTPTransfer": { - name: "QueueCCTPTransfer", - service: "API", - annotations: map[string]string{"public": ""}, + "/rpc/Trails/GetIntent": { + name: "GetIntent", + service: "Trails", + annotations: map[string]string{}, }, - "/rpc/API/QueueIntentConfigExecution": { - name: "QueueIntentConfigExecution", - service: "API", - annotations: map[string]string{"public": ""}, + "/rpc/Trails/SearchIntents": { + name: "SearchIntents", + service: "Trails", + annotations: map[string]string{}, }, - "/rpc/API/GetIntentConfigExecutionStatus": { - name: "GetIntentConfigExecutionStatus", - service: "API", - annotations: map[string]string{"public": ""}, + "/rpc/Trails/GetIntentTransactionHistory": { + name: "GetIntentTransactionHistory", + service: "Trails", + annotations: map[string]string{}, }, - "/rpc/API/ListIntentConfigs": { - name: "ListIntentConfigs", - service: "API", - annotations: map[string]string{"public": ""}, + "/rpc/Trails/GetIntentGasFeeOptions": { + name: "GetIntentGasFeeOptions", + service: "Trails", + annotations: map[string]string{}, }, - "/rpc/API/QueueMetaTxnReceipt": { - name: "QueueMetaTxnReceipt", - service: "API", - annotations: map[string]string{"public": ""}, + "/rpc/Trails/GetIntentEntryTransaction": { + name: "GetIntentEntryTransaction", + service: "Trails", + annotations: map[string]string{}, }, } @@ -714,25 +885,21 @@ func WebrpcMethods() map[string]method { } var WebRPCServices = map[string][]string{ - "API": { + "Trails": { "Ping", "Version", "RuntimeStatus", "Clock", - "GetIntentCallsPayloads", - "GetIntentsQuote", - "CommitIntentConfig", - "GetIntentConfig", + "QuoteIntent", + "CommitIntent", + "ExecuteIntent", + "WaitIntentReceipt", + "GetIntentReceipt", + "GetIntent", + "SearchIntents", "GetIntentTransactionHistory", - "GetIntentEntrypointDeposit", - "GetIntentEntrypointDepositFeeOptions", - "GetIntentEntrypointMessageHash", - "GetCCTPTransfer", - "QueueCCTPTransfer", - "QueueIntentConfigExecution", - "GetIntentConfigExecutionStatus", - "ListIntentConfigs", - "QueueMetaTxnReceipt", + "GetIntentGasFeeOptions", + "GetIntentEntryTransaction", }, } @@ -740,42 +907,38 @@ var WebRPCServices = map[string][]string{ // Client // -const APIPathPrefix = "/rpc/API/" +const TrailsPathPrefix = "/rpc/Trails/" -type apiClient struct { +type trailsClient struct { client HTTPClient - urls [18]string + urls [14]string } -func NewAPIClient(addr string, client HTTPClient) APIClient { - prefix := urlBase(addr) + APIPathPrefix - urls := [18]string{ +func NewTrailsClient(addr string, client HTTPClient) TrailsClient { + prefix := urlBase(addr) + TrailsPathPrefix + urls := [14]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", prefix + "Clock", - prefix + "GetIntentCallsPayloads", - prefix + "GetIntentsQuote", - prefix + "CommitIntentConfig", - prefix + "GetIntentConfig", + prefix + "QuoteIntent", + prefix + "CommitIntent", + prefix + "ExecuteIntent", + prefix + "WaitIntentReceipt", + prefix + "GetIntentReceipt", + prefix + "GetIntent", + prefix + "SearchIntents", prefix + "GetIntentTransactionHistory", - prefix + "GetIntentEntrypointDeposit", - prefix + "GetIntentEntrypointDepositFeeOptions", - prefix + "GetIntentEntrypointMessageHash", - prefix + "GetCCTPTransfer", - prefix + "QueueCCTPTransfer", - prefix + "QueueIntentConfigExecution", - prefix + "GetIntentConfigExecutionStatus", - prefix + "ListIntentConfigs", - prefix + "QueueMetaTxnReceipt", - } - return &apiClient{ + prefix + "GetIntentGasFeeOptions", + prefix + "GetIntentEntryTransaction", + } + return &trailsClient{ client: client, urls: urls, } } -func (c *apiClient) Ping(ctx context.Context) (bool, error) { +func (c *trailsClient) Ping(ctx context.Context) (bool, error) { out := struct { Ret0 bool `json:"status"` }{} @@ -791,7 +954,7 @@ func (c *apiClient) Ping(ctx context.Context) (bool, error) { return out.Ret0, err } -func (c *apiClient) Version(ctx context.Context) (*Version, error) { +func (c *trailsClient) Version(ctx context.Context) (*Version, error) { out := struct { Ret0 *Version `json:"version"` }{} @@ -807,7 +970,7 @@ func (c *apiClient) Version(ctx context.Context) (*Version, error) { return out.Ret0, err } -func (c *apiClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { +func (c *trailsClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { out := struct { Ret0 *RuntimeStatus `json:"status"` }{} @@ -823,7 +986,7 @@ func (c *apiClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { return out.Ret0, err } -func (c *apiClient) Clock(ctx context.Context) (time.Time, error) { +func (c *trailsClient) Clock(ctx context.Context) (time.Time, error) { out := struct { Ret0 time.Time `json:"serverTime"` }{} @@ -839,34 +1002,12 @@ func (c *apiClient) Clock(ctx context.Context) (time.Time, error) { return out.Ret0, err } -func (c *apiClient) GetIntentCallsPayloads(ctx context.Context, params *GetIntentCallsPayloadParams) (*IntentCallsPayloads, error) { - in := struct { - Arg0 *GetIntentCallsPayloadParams `json:"params"` - }{params} - out := struct { - Ret0 *IntentCallsPayloads `json:"payloads"` - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[4], in, &out) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *apiClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuoteParams) (*IntentQuote, error) { - in := struct { - Arg0 *GetIntentsQuoteParams `json:"params"` - }{params} +func (c *trailsClient) QuoteIntent(ctx context.Context, quoteIntentRequest QuoteIntentRequest) (*QuoteIntentResponse, error) { out := struct { - Ret0 *IntentQuote `json:"quote"` + Ret0 *QuoteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[5], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], quoteIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -877,15 +1018,12 @@ func (c *apiClient) GetIntentsQuote(ctx context.Context, params *GetIntentsQuote return out.Ret0, err } -func (c *apiClient) CommitIntentConfig(ctx context.Context, params *CommitIntentConfigParams) (*IntentConfig, error) { - in := struct { - Arg0 *CommitIntentConfigParams `json:"params"` - }{params} +func (c *trailsClient) CommitIntent(ctx context.Context, commitIntentRequest CommitIntentRequest) (*CommitIntentResponse, error) { out := struct { - Ret0 *IntentConfig `json:"config"` + Ret0 *CommitIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[6], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], commitIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -896,15 +1034,12 @@ func (c *apiClient) CommitIntentConfig(ctx context.Context, params *CommitIntent return out.Ret0, err } -func (c *apiClient) GetIntentConfig(ctx context.Context, intentAddress string) (*IntentConfig, error) { - in := struct { - Arg0 string `json:"intentAddress"` - }{intentAddress} +func (c *trailsClient) ExecuteIntent(ctx context.Context, executeIntentRequest ExecuteIntentRequest) (*ExecuteIntentResponse, error) { out := struct { - Ret0 *IntentConfig `json:"config"` + Ret0 *ExecuteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[7], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], executeIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -915,36 +1050,12 @@ func (c *apiClient) GetIntentConfig(ctx context.Context, intentAddress string) ( return out.Ret0, err } -func (c *apiClient) GetIntentTransactionHistory(ctx context.Context, accountAddress string, page *Page) (*Page, []*IntentTransaction, error) { - in := struct { - Arg0 string `json:"accountAddress"` - Arg1 *Page `json:"page"` - }{accountAddress, page} - out := struct { - Ret0 *Page `json:"page"` - Ret1 []*IntentTransaction `json:"transactions"` - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, out.Ret1, err -} - -func (c *apiClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetIntentEntrypointDepositParams) (*GetIntentEntrypointDepositResult, error) { - in := struct { - Arg0 *GetIntentEntrypointDepositParams `json:"params"` - }{params} +func (c *trailsClient) WaitIntentReceipt(ctx context.Context, waitIntentReceiptRequest WaitIntentReceiptRequest) (*WaitIntentReceiptResponse, error) { out := struct { - Ret0 *GetIntentEntrypointDepositResult `json:"result"` + Ret0 *WaitIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], waitIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -955,15 +1066,12 @@ func (c *apiClient) GetIntentEntrypointDeposit(ctx context.Context, params *GetI return out.Ret0, err } -func (c *apiClient) GetIntentEntrypointDepositFeeOptions(ctx context.Context, params *GetIntentEntrypointDepositFeeOptionsParams) (*GetIntentEntrypointDepositFeeOptionsResult, error) { - in := struct { - Arg0 *GetIntentEntrypointDepositFeeOptionsParams `json:"params"` - }{params} +func (c *trailsClient) GetIntentReceipt(ctx context.Context, getIntentReceiptRequest GetIntentReceiptRequest) (*GetIntentReceiptResponse, error) { out := struct { - Ret0 *GetIntentEntrypointDepositFeeOptionsResult `json:"result"` + Ret0 *GetIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], getIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -974,15 +1082,12 @@ func (c *apiClient) GetIntentEntrypointDepositFeeOptions(ctx context.Context, pa return out.Ret0, err } -func (c *apiClient) GetIntentEntrypointMessageHash(ctx context.Context, params *GetIntentEntrypointMessageHashParams) (string, error) { - in := struct { - Arg0 *GetIntentEntrypointMessageHashParams `json:"params"` - }{params} +func (c *trailsClient) GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) { out := struct { - Ret0 string `json:"messageHash"` + Ret0 *GetIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], getIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -993,15 +1098,12 @@ func (c *apiClient) GetIntentEntrypointMessageHash(ctx context.Context, params * return out.Ret0, err } -func (c *apiClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransfer, error) { - in := struct { - Arg0 string `json:"id"` - }{id} +func (c *trailsClient) SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) { out := struct { - Ret0 *CCTPTransfer `json:"transfer"` + Ret0 *SearchIntentsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], searchIntentsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1012,18 +1114,12 @@ func (c *apiClient) GetCCTPTransfer(ctx context.Context, id string) (*CCTPTransf return out.Ret0, err } -func (c *apiClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, metaTxHash *string, sourceChainId uint64, destinationChainId uint64) (*CCTPTransfer, error) { - in := struct { - Arg0 *string `json:"sourceTxHash"` - Arg1 *string `json:"metaTxHash"` - Arg2 uint64 `json:"sourceChainId"` - Arg3 uint64 `json:"destinationChainId"` - }{sourceTxHash, metaTxHash, sourceChainId, destinationChainId} +func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) { out := struct { - Ret0 *CCTPTransfer `json:"transfer"` + Ret0 *GetIntentTransactionHistoryResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], getIntentTransactionHistoryRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1034,15 +1130,12 @@ func (c *apiClient) QueueCCTPTransfer(ctx context.Context, sourceTxHash *string, return out.Ret0, err } -func (c *apiClient) QueueIntentConfigExecution(ctx context.Context, intentConfigId string) (bool, error) { - in := struct { - Arg0 string `json:"intentConfigId"` - }{intentConfigId} +func (c *trailsClient) GetIntentGasFeeOptions(ctx context.Context, getIntentGasFeeOptionsRequest GetIntentGasFeeOptionsRequest) (*GetIntentGasFeeOptionsResponse, error) { out := struct { - Ret0 bool `json:"status"` + Ret0 *GetIntentGasFeeOptionsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getIntentGasFeeOptionsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1053,55 +1146,12 @@ func (c *apiClient) QueueIntentConfigExecution(ctx context.Context, intentConfig return out.Ret0, err } -func (c *apiClient) GetIntentConfigExecutionStatus(ctx context.Context, intentConfigId string) (string, error) { - in := struct { - Arg0 string `json:"intentConfigId"` - }{intentConfigId} +func (c *trailsClient) GetIntentEntryTransaction(ctx context.Context, getIntentEntryTransactionRequest GetIntentEntryTransactionRequest) (*GetIntentEntryTransactionResponse, error) { out := struct { - Ret0 string `json:"executionStatus"` + Ret0 *GetIntentEntryTransactionResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *apiClient) ListIntentConfigs(ctx context.Context, page *Page, executionStatus *string) (*Page, []*IntentConfig, error) { - in := struct { - Arg0 *Page `json:"page"` - Arg1 *string `json:"executionStatus"` - }{page, executionStatus} - out := struct { - Ret0 *Page `json:"page"` - Ret1 []*IntentConfig `json:"intentConfigs"` - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, out.Ret1, err -} - -func (c *apiClient) QueueMetaTxnReceipt(ctx context.Context, metaTxID string) (bool, error) { - in := struct { - Arg0 string `json:"metaTxID"` - }{metaTxID} - out := struct { - Ret0 bool `json:"status"` - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getIntentEntryTransactionRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1308,6 +1358,148 @@ func MethodCtx(ctx context.Context) (method, bool) { // PtrTo is a useful helper when constructing values for optional fields. func PtrTo[T any](v T) *T { return &v } +// +// BigInt helpers +// + +// BigInt is an alias of big.Int with custom JSON (decimal string) encoding. +type BigInt big.Int + +func NewBigInt(v int64) BigInt { var bi big.Int; bi.SetInt64(v); return BigInt(bi) } + +// AsInt exposes the underlying *big.Int. +func (b *BigInt) AsInt() *big.Int { return (*big.Int)(b) } + +// String returns the decimal string representation of the BigInt. +func (b BigInt) String() string { return b.AsInt().String() } + +// MarshalText implements encoding.TextMarshaler. +func (b BigInt) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("\"%s\"", b.String())), nil +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (b *BigInt) UnmarshalText(text []byte) error { + if len(text) == 0 { + return nil + } + if len(text) == 4 && text[0] == 'n' && string(text) == "null" { + return nil + } + for _, c := range text { + if c == ' ' || c == '\t' || c == '\n' || c == '\r' { + return fmt.Errorf("BigInt.UnmarshalText: unexpected whitespace in %q", text) + } + } + var digits []byte + if text[0] == '-' || (text[0] >= '0' && text[0] <= '9') { + digits = text + } else { + if len(text) < 2 || text[0] != '"' || text[len(text)-1] != '"' { + return fmt.Errorf("BigInt.UnmarshalText: unsupported format %q", text) + } + digits = text[1 : len(text)-1] + } + i, ok := big.NewInt(0).SetString(string(digits), 10) + if !ok { + return fmt.Errorf("BigInt.UnmarshalText: failed to parse %q", text) + } + *b = BigInt(*i) + return nil +} + +// MarshalJSON implements json.Marshaler +func (b BigInt) MarshalJSON() ([]byte, error) { + return b.MarshalText() +} + +// UnmarshalJSON implements json.Unmarshaler +func (b *BigInt) UnmarshalJSON(text []byte) error { + if string(text) == "null" { + return nil + } + return b.UnmarshalText(text) +} + +// MarshalBinary implements encoding.BinaryMarshaler. The first byte is the sign byte +// to represent positive or negative numbers. +func (b BigInt) MarshalBinary() ([]byte, error) { + bytes := b.AsInt().Bytes() + out := make([]byte, len(bytes)+1) + copy(out[1:], bytes) + if b.AsInt().Sign() < 0 { + // Prepend a sign byte (0xFF for negative) + out[0] = 0xFF + } else { + // For zero or positive numbers, prepend 0x00 + out[0] = 0x00 + } + return out, nil +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler. The first byte is the sign byte +// to represent positive or negative numbers. +func (b *BigInt) UnmarshalBinary(buff []byte) error { + if len(buff) == 0 { + *b = BigInt(*big.NewInt(0)) + return nil + } + // Extract the sign byte + signByte := buff[0] + i := new(big.Int) + if len(buff) > 1 { + i.SetBytes(buff[1:]) + } + // Apply sign if negative + if signByte == 0xFF { + i.Neg(i) + } + *b = BigInt(*i) + return nil +} + +func (b BigInt) Value() (driver.Value, error) { + return b.String(), nil +} + +func (b *BigInt) Scan(src interface{}) error { + if src == nil { + return nil + } + + var svalue string + switch v := src.(type) { + case string: + svalue = v + case []byte: + svalue = string(v) + default: + return fmt.Errorf("BigInt.Scan: unexpected type %T", src) + } + + // pgx driver returns NeX where N is digits and X is exponent + parts := strings.SplitN(svalue, "e", 2) + + var ok bool + i := &big.Int{} + i, ok = i.SetString(parts[0], 10) + if !ok { + return fmt.Errorf("BigInt.Scan: failed to scan value %q", svalue) + } + + if len(parts) >= 2 { + exp := big.NewInt(0) + exp, ok = exp.SetString(parts[1], 10) + if !ok { + return fmt.Errorf("BigInt.Scan failed to scan exp component %q", svalue) + } + i = i.Mul(i, big.NewInt(1).Exp(big.NewInt(10), exp, nil)) + } + + *b = BigInt(*i) + return nil +} + // // Errors // @@ -1402,8 +1594,10 @@ var ( ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} ErrInvalidArgument = WebRPCError{Code: 2000, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} + ErrUnexpected = WebRPCError{Code: 2001, Name: "Unexpected", Message: "Unexpected server error", HTTPStatus: 500} ErrUnavailable = WebRPCError{Code: 2002, Name: "Unavailable", Message: "Unavailable resource", HTTPStatus: 400} ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} + ErrIntentStatus = WebRPCError{Code: 2004, Name: "IntentStatus", Message: "Invalid intent status", HTTPStatus: 422} ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} ) @@ -1414,7 +1608,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.30.1;gen-golang@v0.23.1;trails-api@v0.4.0" +const WebrpcHeaderValue = "webrpc@v0.30.2;gen-golang@v0.23.1;trails-api@v1.0.0" type WebrpcGenVersions struct { WebrpcGenVersion string From 2b37571ee287e1d078019c14670073430ba578cf Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 30 Oct 2025 13:56:06 +0000 Subject: [PATCH 021/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 82 +++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index fd548789..993470b0 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 d77c84a0d98b34c7e6d3a9810cc8819aee40b978 +// trails-api v1.0.0 f01309b41f30972f5f124ffff33d0a805a73e992 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "d77c84a0d98b34c7e6d3a9810cc8819aee40b978" + return "f01309b41f30972f5f124ffff33d0a805a73e992" } // @@ -122,24 +122,27 @@ func (x *QuoteProviderType) Is(values ...QuoteProviderType) bool { type TransactionStatus uint8 const ( - TransactionStatus_PENDING TransactionStatus = 0 - TransactionStatus_PROCESSING TransactionStatus = 1 - TransactionStatus_FAILED TransactionStatus = 2 - TransactionStatus_SUCCEEDED TransactionStatus = 3 + TransactionStatus_UNKNOWN TransactionStatus = 0 + TransactionStatus_PENDING TransactionStatus = 1 + TransactionStatus_PROCESSING TransactionStatus = 2 + TransactionStatus_FAILED TransactionStatus = 3 + TransactionStatus_SUCCEEDED TransactionStatus = 4 ) var TransactionStatus_name = map[uint8]string{ - 0: "PENDING", - 1: "PROCESSING", - 2: "FAILED", - 3: "SUCCEEDED", + 0: "UNKNOWN", + 1: "PENDING", + 2: "PROCESSING", + 3: "FAILED", + 4: "SUCCEEDED", } var TransactionStatus_value = map[string]uint8{ - "PENDING": 0, - "PROCESSING": 1, - "FAILED": 2, - "SUCCEEDED": 3, + "UNKNOWN": 0, + "PENDING": 1, + "PROCESSING": 2, + "FAILED": 3, + "SUCCEEDED": 4, } func (x TransactionStatus) String() string { @@ -170,7 +173,7 @@ func (x *TransactionStatus) Is(values ...TransactionStatus) bool { type IntentStatus uint8 const ( - IntentStatus_SOLVED IntentStatus = 0 + IntentStatus_QUOTED IntentStatus = 0 IntentStatus_COMMITTED IntentStatus = 1 IntentStatus_EXECUTING IntentStatus = 2 IntentStatus_FAILED IntentStatus = 3 @@ -178,7 +181,7 @@ const ( ) var IntentStatus_name = map[uint8]string{ - 0: "SOLVED", + 0: "QUOTED", 1: "COMMITTED", 2: "EXECUTING", 3: "FAILED", @@ -186,7 +189,7 @@ var IntentStatus_name = map[uint8]string{ } var IntentStatus_value = map[string]uint8{ - "SOLVED": 0, + "QUOTED": 0, "COMMITTED": 1, "EXECUTING": 2, "FAILED": 3, @@ -301,7 +304,6 @@ type Intent struct { MetaTxns []*MetaTxn `json:"metaTxns" db:"meta_txns"` Quote *IntentProviderQuote `json:"quote" db:"quote"` Fees *IntentFees `json:"fees" db:"fees"` - ExecutedAt *time.Time `json:"executedAt,omitempty" db:"executed_at,omitempty"` ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` @@ -392,7 +394,7 @@ type IntentReceipt struct { // transfer transaction hash and status, which is the init // transfer from the owner / main signer into the origin intent // address on the origin chain id - TransferTransactionHash prototyp.Hash `json:"transferTransactionHash" db:"transfer_txn_hash"` + TransferTransactionHash *prototyp.Hash `json:"transferTransactionHash" db:"transfer_txn_hash,omitempty"` TransferTransactionStatus TransactionStatus `json:"transferTransactionStatus" db:"transfer_txn_status"` // origin intent transaction db reference and runtime type OriginTransactionID uint64 `json:"-" db:"orig_txn_id"` @@ -404,9 +406,9 @@ type IntentReceipt struct { ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` RetryCount *uint32 `json:"retryCount" db:"retry_count,omitempty"` // timestamp when the intent receipt was updated, usually from status change - UpdatedAt *string `json:"updatedAt" db:"updated_at,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` // timestamp of when the intent receipt was created - CreatedAt *string `json:"createdAt" db:"created_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // IntentTransaction represents a single transaction within an intent's execution flow. @@ -432,6 +434,8 @@ type IntentTransaction struct { // TODO: how about calldata here too..? feels useful to have.. // Status of this specific transaction TxnStatus TransactionStatus `json:"txnStatus" db:"txn_status"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // IntentProviderQuote represents the quotes from the underlining providers for both @@ -517,14 +521,15 @@ type MetaTxnFeeDetail struct { // from trails-api .. I think..? cuz, we don't have GetCoinPrices // endpoint... so... type TokenPrice struct { - Token *Token `json:"token"` - Price *Price `json:"price"` - Price24hChange *Price `json:"price24hChange"` - Price24hVol *Price `json:"price24hVol"` - FloorPrice *Price `json:"floorPrice,omitempty"` - BuyPrice *Price `json:"buyPrice,omitempty"` - SellPrice *Price `json:"sellPrice,omitempty"` - UpdatedAt *time.Time `json:"updatedAt"` + Token *Token `json:"token"` + Price *Price `json:"price"` + Price24hChange *Price `json:"price24hChange"` + Price24hVol *Price `json:"price24hVol"` + FloorPrice *Price `json:"floorPrice,omitempty"` + BuyPrice *Price `json:"buyPrice,omitempty"` + SellPrice *Price `json:"sellPrice,omitempty"` + // TODO: review, copy other types, or not? + UpdatedAt *time.Time `json:"updatedAt"` } type Token struct { @@ -539,15 +544,16 @@ type Price struct { } type CCTPTransfer struct { - ID string `json:"id"` - SourceTxHash string `json:"sourceTxHash"` - SourceChainID uint64 `json:"sourceChainId"` - DestinationChainID uint64 `json:"destinationChainId"` - Message string `json:"message"` - Attestation string `json:"attestation"` - Status string `json:"status"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` + ID string `json:"id"` + SourceTxHash string `json:"sourceTxHash"` + SourceChainID uint64 `json:"sourceChainId"` + DestinationChainID uint64 `json:"destinationChainId"` + Message string `json:"message"` + Attestation string `json:"attestation"` + // TODO use an enum instead? + Status string `json:"status"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } type GetIntentEntrypointDepositParams struct { From 439a0c30aef7eb46ce2fad2371d527b34dce5475 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 30 Oct 2025 18:41:46 +0000 Subject: [PATCH 022/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 993470b0..9053ca76 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 f01309b41f30972f5f124ffff33d0a805a73e992 +// trails-api v1.0.0 3db4e7de3a5bd5ac465fd949325f7ae87f8f896d // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "f01309b41f30972f5f124ffff33d0a805a73e992" + return "3db4e7de3a5bd5ac465fd949325f7ae87f8f896d" } // @@ -394,7 +394,7 @@ type IntentReceipt struct { // transfer transaction hash and status, which is the init // transfer from the owner / main signer into the origin intent // address on the origin chain id - TransferTransactionHash *prototyp.Hash `json:"transferTransactionHash" db:"transfer_txn_hash,omitempty"` + TransferTransactionHash prototyp.Hash `json:"transferTransactionHash" db:"transfer_txn_hash"` TransferTransactionStatus TransactionStatus `json:"transferTransactionStatus" db:"transfer_txn_status"` // origin intent transaction db reference and runtime type OriginTransactionID uint64 `json:"-" db:"orig_txn_id"` From 5acd4225857490c9245f438e0fe016277049fef3 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 00:38:23 +0000 Subject: [PATCH 023/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 9053ca76..4ba5e929 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 3db4e7de3a5bd5ac465fd949325f7ae87f8f896d +// trails-api v1.0.0 637d853041f61166b4ffb5d6fb879fce563c45a8 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "3db4e7de3a5bd5ac465fd949325f7ae87f8f896d" + return "637d853041f61166b4ffb5d6fb879fce563c45a8" } // @@ -268,14 +268,14 @@ type QuoteIntentRequest struct { DestinationCallData *string `json:"destinationCallData"` DestinationCallValue *string `json:"destinationCallValue"` // NOTE: EXACT_OUTPUT is the default if unspecified - TradeType *TradeType `json:"tradeType"` - Options *QuoteIntentRequestOptions `json:"options"` + TradeType *TradeType `json:"tradeType,omitempty"` + Options *QuoteIntentRequestOptions `json:"options,omitempty"` } type QuoteIntentRequestOptions struct { - QuoteProvider *QuoteProviderType `json:"quoteProvider"` - SlippageTolerance *float64 `json:"slippageTolerance"` - TrailsAddressOverrides *TrailsAddressOverrides `json:"trailsAddressOverrides"` + QuoteProvider *QuoteProviderType `json:"quoteProvider,omitempty"` + SlippageTolerance *float64 `json:"slippageTolerance,omitempty"` + TrailsAddressOverrides *TrailsAddressOverrides `json:"trailsAddressOverrides,omitempty"` } // Fully formed/quoted/solved, executable intent. @@ -304,6 +304,7 @@ type Intent struct { MetaTxns []*MetaTxn `json:"metaTxns" db:"meta_txns"` Quote *IntentProviderQuote `json:"quote" db:"quote"` Fees *IntentFees `json:"fees" db:"fees"` + TrailsVersion string `json:"trailsVersion" db:"trails_version"` ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` @@ -327,16 +328,14 @@ type TransactionCall struct { BehaviorOnError *uint8 `json:"behaviorOnError"` } -// TODO: fix this.. it should adhere to 7795, which it does not. type IntentPrecondition struct { - // TODO: should be erc20MinAllowance + // TODO: value should be erc20MinAllowance to match 7795 Type string `json:"type"` ChainID uint64 `json:"chainId"` Data *IntentPreconditionData `json:"data"` } // transaction preconditions based on https://eips.ethereum.org/EIPS/eip-7795 -// TODOXXX: these values are incorrect, and should match 7795 // chainId: `0x${string}`; // Hex chain id // owner: `0x${string}`; // Address // token: `0x${string}`; // Address @@ -358,12 +357,14 @@ type IntentPreconditionData struct { type MetaTxn struct { ID string `json:"id"` ChainID uint64 `json:"chainId"` - // TODO: rename this to 'from: string' ? - WalletAddress string `json:"walletAddress" db:"wallet_address"` + // TODO: rename this to 'from: string' ? ... name...?? walletAddress... from..? + // fromAddress ...? + WalletAddress string `json:"walletAddress"` // TODO (later): rename this to `to: string` - Contract string `json:"contract" db:"to_address"` + // TODO: name it.. toAddress ? + Contract string `json:"contract"` // TODO: rename to 'execdata' ? - Input string `json:"input" db:"tx_data"` + Input string `json:"input"` } // IntentReceipt represents an intent that went through trails, and fully executed @@ -500,13 +501,12 @@ type IntentTransactionGasFee struct { TotalFeeUSD float64 `json:"totalFeeUsd"` // sequence relayer gas fee quotes // AKA, meta transaction gas fee quotes for pre-sponsored - // TODO: this shouldnt be an array anymore... - MetaTxnFeeDetails []*MetaTxnFeeDetail `json:"metaTxnFeeDetails"` + MetaTxnFeeDetails *MetaTxnFeeDetails `json:"metaTxnFeeDetails"` // metaTxnGasQuote is like a voucher for gas sponsorship from the relayer MetaTxnGasQuote string `json:"metaTxnGasQuote"` } -type MetaTxnFeeDetail struct { +type MetaTxnFeeDetails struct { MetaTxnID string `json:"metaTxnId"` EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` // TODO: whats up with this name? From 2e71cbb9ea53d0a3f91b9f6463a0cc18a6fd108a Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 02:50:10 +0000 Subject: [PATCH 024/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 4ba5e929..6c495ec7 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 637d853041f61166b4ffb5d6fb879fce563c45a8 +// trails-api v1.0.0 05ed598bed12799bc48ae5315179931d7f262790 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "637d853041f61166b4ffb5d6fb879fce563c45a8" + return "05ed598bed12799bc48ae5315179931d7f262790" } // @@ -299,6 +299,7 @@ type Intent struct { OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"orig_intent_address"` DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"dest_intent_address"` DestinationSalt prototyp.BigInt `json:"destinationSalt" db:"destination_salt"` + DepositTransaction *DepositTransaction `json:"depositTransaction" db:"deposit_txn"` Calls []*IntentCalls `json:"calls" db:"calls"` Preconditions []*IntentPrecondition `json:"preconditions" db:"preconditions"` MetaTxns []*MetaTxn `json:"metaTxns" db:"meta_txns"` @@ -310,6 +311,14 @@ type Intent struct { CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } +// DepositTransaction represents a deposit transfer transaction of the token amount +// to the origin intent address. +type DepositTransaction struct { + ToAddress prototyp.Hash `json:"toAddress"` + TokenAddress prototyp.Hash `json:"tokenAddress"` + Amount prototyp.BigInt `json:"amount"` +} + // NOTE: was previously named IntentCallsPayload type IntentCalls struct { ChainID uint64 `json:"chainId"` @@ -392,11 +401,11 @@ type IntentReceipt struct { OriginChainID uint64 `json:"originChainId" db:"orig_chain_id"` // destination chain id where the intent is targetting as final execution DestinationChainID uint64 `json:"destinationChainId" db:"dest_chain_id"` - // transfer transaction hash and status, which is the init + // deposit transfer transaction hash and status, which is the init // transfer from the owner / main signer into the origin intent // address on the origin chain id - TransferTransactionHash prototyp.Hash `json:"transferTransactionHash" db:"transfer_txn_hash"` - TransferTransactionStatus TransactionStatus `json:"transferTransactionStatus" db:"transfer_txn_status"` + DepositTransactionHash prototyp.Hash `json:"depositTransactionHash" db:"deposit_txn_hash"` + DepositTransactionStatus TransactionStatus `json:"depositTransactionStatus" db:"deposit_txn_status"` // origin intent transaction db reference and runtime type OriginTransactionID uint64 `json:"-" db:"orig_txn_id"` OriginTransaction *IntentTransaction `json:"originTransaction" db:"-"` @@ -703,7 +712,10 @@ type CommitIntentResponse struct { // Clients provide the transfer transaction hash that executed the transfer to the // intent origin address. type ExecuteIntentRequest struct { - IntentID prototyp.Hash `json:"intentId"` + IntentID prototyp.Hash `json:"intentId"` + DepositTransactionHash prototyp.Hash `json:"depositTransactionHash"` + // TODOXXX: remove this! just leaving here for backwards compat on frontend + // until we update the trails-sdk too (tomorrow) TransferTransactionHash prototyp.Hash `json:"transferTransactionHash"` } @@ -747,9 +759,9 @@ type GetIntentResponse struct { // SearchIntents searches past intents based on filters. // We do not return 'solved' status intents here, only committed/executed/failed/succeeded. type SearchIntentsRequest struct { - ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` - ByTransferTransactionHash prototyp.Hash `json:"byTransferTransactionHash"` - ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` + ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` + ByDepositTransactionHash prototyp.Hash `json:"byDepositTransactionHash"` + ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` } type SearchIntentsResponse struct { From dd5b40de233127224d6739007734a0283460f06b Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:26:54 +0000 Subject: [PATCH 025/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 6c495ec7..b7fd180e 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 05ed598bed12799bc48ae5315179931d7f262790 +// trails-api v1.0.0 54cbe231c8762643c1a1b625b01d8a1ba6487cdd // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "05ed598bed12799bc48ae5315179931d7f262790" + return "54cbe231c8762643c1a1b625b01d8a1ba6487cdd" } // @@ -314,9 +314,15 @@ type Intent struct { // DepositTransaction represents a deposit transfer transaction of the token amount // to the origin intent address. type DepositTransaction struct { - ToAddress prototyp.Hash `json:"toAddress"` - TokenAddress prototyp.Hash `json:"tokenAddress"` - Amount prototyp.BigInt `json:"amount"` + // toAddress is the origin intent address where the deposit is sent to. + ToAddress prototyp.Hash `json:"toAddress"` + // tokenAddress is the token being deposited. + TokenAddress prototyp.Hash `json:"tokenAddress"` + // decimals is the number of decimals for the token. If the value is null, it + // means we were unable to retrieve the decimals for the token. + Decimals *uint8 `json:"decimals"` + // amount is the token amount being deposited. + Amount prototyp.BigInt `json:"amount"` } // NOTE: was previously named IntentCallsPayload From 39f2dc0854d70840bc73255e55a940be629fceb6 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:40:26 +0000 Subject: [PATCH 026/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index b7fd180e..cb2db696 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 54cbe231c8762643c1a1b625b01d8a1ba6487cdd +// trails-api v1.0.0 10e80c7e6d8eaec75b8a5368a8ef038e5ab1a625 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "54cbe231c8762643c1a1b625b01d8a1ba6487cdd" + return "10e80c7e6d8eaec75b8a5368a8ef038e5ab1a625" } // @@ -256,17 +256,15 @@ func (x *ChainGasUsageStatus) Is(values ...ChainGasUsageStatus) bool { // // ............ type QuoteIntentRequest struct { - OwnerAddress prototyp.Hash `json:"ownerAddress"` - OriginChainID uint64 `json:"originChainId"` - OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` - // TODOXXX: remove this - OriginTokenAmount *prototyp.BigInt `json:"originTokenAmount"` - DestinationChainID uint64 `json:"destinationChainId"` - DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` - DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` - DestinationToAddress prototyp.Hash `json:"destinationToAddress"` - DestinationCallData *string `json:"destinationCallData"` - DestinationCallValue *string `json:"destinationCallValue"` + OwnerAddress prototyp.Hash `json:"ownerAddress"` + OriginChainID uint64 `json:"originChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + DestinationChainID uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + DestinationCallData *string `json:"destinationCallData"` + DestinationCallValue *string `json:"destinationCallValue"` // NOTE: EXACT_OUTPUT is the default if unspecified TradeType *TradeType `json:"tradeType,omitempty"` Options *QuoteIntentRequestOptions `json:"options,omitempty"` From c2960f157bdc26568be0e6a48954dcf3e2dc8b19 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:12:13 +0000 Subject: [PATCH 027/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index cb2db696..246534c6 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 10e80c7e6d8eaec75b8a5368a8ef038e5ab1a625 +// trails-api v1.0.0 5669b86e8def11e520b7d1722de60e73a3b9d75b // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "10e80c7e6d8eaec75b8a5368a8ef038e5ab1a625" + return "5669b86e8def11e520b7d1722de60e73a3b9d75b" } // @@ -718,9 +718,6 @@ type CommitIntentResponse struct { type ExecuteIntentRequest struct { IntentID prototyp.Hash `json:"intentId"` DepositTransactionHash prototyp.Hash `json:"depositTransactionHash"` - // TODOXXX: remove this! just leaving here for backwards compat on frontend - // until we update the trails-sdk too (tomorrow) - TransferTransactionHash prototyp.Hash `json:"transferTransactionHash"` } type ExecuteIntentResponse struct { From 2c157770870adbe802941bf95e230c3a7ccd63e7 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:39:04 +0000 Subject: [PATCH 028/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 63 +++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 246534c6..93682089 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 5669b86e8def11e520b7d1722de60e73a3b9d75b +// trails-api v1.0.0 be6fdd3eab15f477b03ddf9bd7abeb162178b4d0 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "5669b86e8def11e520b7d1722de60e73a3b9d75b" + return "be6fdd3eab15f477b03ddf9bd7abeb162178b4d0" } // @@ -122,27 +122,30 @@ func (x *QuoteProviderType) Is(values ...QuoteProviderType) bool { type TransactionStatus uint8 const ( - TransactionStatus_UNKNOWN TransactionStatus = 0 - TransactionStatus_PENDING TransactionStatus = 1 - TransactionStatus_PROCESSING TransactionStatus = 2 - TransactionStatus_FAILED TransactionStatus = 3 - TransactionStatus_SUCCEEDED TransactionStatus = 4 + TransactionStatus_UNKNOWN TransactionStatus = 0 + TransactionStatus_PENDING TransactionStatus = 1 + TransactionStatus_RELAYING TransactionStatus = 2 + TransactionStatus_AWAITING_RECEIPT TransactionStatus = 3 + TransactionStatus_FINISHED TransactionStatus = 4 + TransactionStatus_FAILED TransactionStatus = 5 ) var TransactionStatus_name = map[uint8]string{ 0: "UNKNOWN", 1: "PENDING", - 2: "PROCESSING", - 3: "FAILED", - 4: "SUCCEEDED", + 2: "RELAYING", + 3: "AWAITING_RECEIPT", + 4: "FINISHED", + 5: "FAILED", } var TransactionStatus_value = map[string]uint8{ - "UNKNOWN": 0, - "PENDING": 1, - "PROCESSING": 2, - "FAILED": 3, - "SUCCEEDED": 4, + "UNKNOWN": 0, + "PENDING": 1, + "RELAYING": 2, + "AWAITING_RECEIPT": 3, + "FINISHED": 4, + "FAILED": 5, } func (x TransactionStatus) String() string { @@ -416,9 +419,8 @@ type IntentReceipt struct { // destination intent transaction db reference and runtime type DestinationTransactionID uint64 `json:"-" db:"dest_txn_id"` DestinationTransaction *IntentTransaction `json:"destinationTransaction" db:"-"` - // Worker fields for tracking background processing - ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` - RetryCount *uint32 `json:"retryCount" db:"retry_count,omitempty"` + ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` + RetryCount *uint32 `json:"retryCount" db:"retry_count,omitempty"` // timestamp when the intent receipt was updated, usually from status change UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` // timestamp of when the intent receipt was created @@ -435,21 +437,24 @@ type IntentTransaction struct { // Intent id this transaction is associated with IntentID prototyp.Hash `json:"intentId" db:"intent_id"` // Chain where this transaction executes - ChainID uint64 `json:"chainId" db:"chain_id"` - MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id"` - // Transaction hash for this specific transaction - TxnHash prototyp.Hash `json:"txnHash" db:"txn_hash,omitempty"` - // Recipient address (aka, the intentAddress) - ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` + ChainID uint64 `json:"chainId" db:"chain_id"` + FromAddress prototyp.Hash `json:"fromAddress" db:"from_address"` + ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` // Token being transferred in this transaction TokenAddress prototyp.Hash `json:"tokenAddress" db:"token_address"` // Amount transferred in this transaction - TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` - // TODO: how about calldata here too..? feels useful to have.. + TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` + Calldata prototyp.Hash `json:"calldata" db:"calldata"` + MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id"` + MetaTxnFeeQuote string `json:"metaTxnFeeQuote" db:"fee_quote"` + Preconditions *IntentPrecondition `json:"preconditions" db:"preconditions"` + // Transaction hash received from the relayer after it's mined. + TxnHash prototyp.Hash `json:"txnHash" db:"txn_hash,omitempty"` // Status of this specific transaction - TxnStatus TransactionStatus `json:"txnStatus" db:"txn_status"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + Status TransactionStatus `json:"status" db:"status"` + StatusReason *string `json:"statusReason" db:"status_reason,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // IntentProviderQuote represents the quotes from the underlining providers for both From ded30c84dad0c6d52b3f0c0cf6f824093a40659b Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:25:15 +0000 Subject: [PATCH 029/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 93682089..57bda5e1 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 be6fdd3eab15f477b03ddf9bd7abeb162178b4d0 +// trails-api v1.0.0 57e04bf9ac957ab0646258ce21b9b52859e2d8b3 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "be6fdd3eab15f477b03ddf9bd7abeb162178b4d0" + return "57e04bf9ac957ab0646258ce21b9b52859e2d8b3" } // @@ -259,18 +259,26 @@ func (x *ChainGasUsageStatus) Is(values ...ChainGasUsageStatus) bool { // // ............ type QuoteIntentRequest struct { - OwnerAddress prototyp.Hash `json:"ownerAddress"` - OriginChainID uint64 `json:"originChainId"` - OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` - DestinationChainID uint64 `json:"destinationChainId"` - DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` - DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` - DestinationToAddress prototyp.Hash `json:"destinationToAddress"` - DestinationCallData *string `json:"destinationCallData"` - DestinationCallValue *string `json:"destinationCallValue"` - // NOTE: EXACT_OUTPUT is the default if unspecified - TradeType *TradeType `json:"tradeType,omitempty"` - Options *QuoteIntentRequestOptions `json:"options,omitempty"` + // intent owner, aka the user address processing the quote + OwnerAddress prototyp.Hash `json:"ownerAddress"` + // origin chain and token details + OriginChainID uint64 `json:"originChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + // destination chain, token, and execution details + DestinationChainID uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + DestinationCallData *string `json:"destinationCallData"` + DestinationCallValue *string `json:"destinationCallValue"` + // originTokenAmount is used with EXACT_INPUT txns + OriginTokenAmount *prototyp.BigInt `json:"originTokenAmount"` + // destinationTokenAmount is used with EXACT_OUTPUT txns + DestinationTokenAmount *prototyp.BigInt `json:"destinationTokenAmount"` + // tradeType indicates whether the trade is an exact input or exact output trade. + // EXACT_OUTPUT is the default if unspecified. + TradeType *TradeType `json:"tradeType,omitempty"` + // options for additional auxiliary params + Options *QuoteIntentRequestOptions `json:"options,omitempty"` } type QuoteIntentRequestOptions struct { From f249e7420c82fe792e72111ff1883ca487b8ad7f Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 17:09:32 +0000 Subject: [PATCH 030/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 57bda5e1..01ac639d 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 57e04bf9ac957ab0646258ce21b9b52859e2d8b3 +// trails-api v1.0.0 ebcef7106408aa5206a04dd007cb25e18bf014fd // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "57e04bf9ac957ab0646258ce21b9b52859e2d8b3" + return "ebcef7106408aa5206a04dd007cb25e18bf014fd" } // @@ -122,30 +122,30 @@ func (x *QuoteProviderType) Is(values ...QuoteProviderType) bool { type TransactionStatus uint8 const ( - TransactionStatus_UNKNOWN TransactionStatus = 0 - TransactionStatus_PENDING TransactionStatus = 1 - TransactionStatus_RELAYING TransactionStatus = 2 - TransactionStatus_AWAITING_RECEIPT TransactionStatus = 3 - TransactionStatus_FINISHED TransactionStatus = 4 - TransactionStatus_FAILED TransactionStatus = 5 + TransactionStatus_UNKNOWN TransactionStatus = 0 + TransactionStatus_PENDING TransactionStatus = 1 + TransactionStatus_RELAYING TransactionStatus = 2 + TransactionStatus_MINING TransactionStatus = 3 + TransactionStatus_SUCCEEDED TransactionStatus = 4 + TransactionStatus_FAILED TransactionStatus = 5 ) var TransactionStatus_name = map[uint8]string{ 0: "UNKNOWN", 1: "PENDING", 2: "RELAYING", - 3: "AWAITING_RECEIPT", - 4: "FINISHED", + 3: "MINING", + 4: "SUCCEEDED", 5: "FAILED", } var TransactionStatus_value = map[string]uint8{ - "UNKNOWN": 0, - "PENDING": 1, - "RELAYING": 2, - "AWAITING_RECEIPT": 3, - "FINISHED": 4, - "FAILED": 5, + "UNKNOWN": 0, + "PENDING": 1, + "RELAYING": 2, + "MINING": 3, + "SUCCEEDED": 4, + "FAILED": 5, } func (x TransactionStatus) String() string { @@ -427,8 +427,6 @@ type IntentReceipt struct { // destination intent transaction db reference and runtime type DestinationTransactionID uint64 `json:"-" db:"dest_txn_id"` DestinationTransaction *IntentTransaction `json:"destinationTransaction" db:"-"` - ProcessedAt *time.Time `json:"processedAt,omitempty" db:"processed_at,omitempty"` - RetryCount *uint32 `json:"retryCount" db:"retry_count,omitempty"` // timestamp when the intent receipt was updated, usually from status change UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` // timestamp of when the intent receipt was created From beed2e26077f131bb5f5d8c77059574bb29e0365 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 31 Oct 2025 18:01:35 +0000 Subject: [PATCH 031/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 01ac639d..5667fde4 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 ebcef7106408aa5206a04dd007cb25e18bf014fd +// trails-api v1.0.0 04e3b566a4664b522b5144d2c88002fd77dbb760 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "ebcef7106408aa5206a04dd007cb25e18bf014fd" + return "04e3b566a4664b522b5144d2c88002fd77dbb760" } // @@ -537,6 +537,12 @@ type MetaTxnFeeDetails struct { FeeNative prototyp.BigInt `json:"feeNative"` } +// IntentSummary represents a summary view of an intent for listing purposes. +type IntentSummary struct { + // intent deterministic id + IntentID prototyp.Hash `json:"intentId"` +} + // NOTE: this also comes from pricefeed package.. // lets review, and move it there .. perhaps have types // here, as seems we need it..? HOWEVER.. it seems @@ -788,8 +794,8 @@ type GetIntentTransactionHistoryRequest struct { } type GetIntentTransactionHistoryResponse struct { - Transactions []*IntentTransaction `json:"transactions"` - NextPage *Page `json:"nextPage"` + Intents []*IntentSummary `json:"intents"` + NextPage *Page `json:"nextPage"` } // Gas fee options for intent entry (leverages existing Entrypoint fee option params/result types). From 1d27ec4f18da6dab7f0af622e818e484f19d4d52 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Sat, 1 Nov 2025 02:52:40 +0000 Subject: [PATCH 032/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 52 +++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 5667fde4..4e802bea 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 04e3b566a4664b522b5144d2c88002fd77dbb760 +// trails-api v1.0.0 005a369b19dfebdb65dde9e0e5ddac91bfc04c44 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "04e3b566a4664b522b5144d2c88002fd77dbb760" + return "005a369b19dfebdb65dde9e0e5ddac91bfc04c44" } // @@ -443,7 +443,8 @@ type IntentTransaction struct { // Intent id this transaction is associated with IntentID prototyp.Hash `json:"intentId" db:"intent_id"` // Chain where this transaction executes - ChainID uint64 `json:"chainId" db:"chain_id"` + ChainID uint64 `json:"chainId" db:"chain_id"` + // TODO: we can remove the from..? FromAddress prototyp.Hash `json:"fromAddress" db:"from_address"` ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` // Token being transferred in this transaction @@ -539,8 +540,53 @@ type MetaTxnFeeDetails struct { // IntentSummary represents a summary view of an intent for listing purposes. type IntentSummary struct { + ID uint64 `json:"-"` // intent deterministic id IntentID prototyp.Hash `json:"intentId"` + // intent status + Status IntentStatus `json:"status"` + // intent owner / main signer + OwnerAddress prototyp.Hash `json:"ownerAddress"` + // origin and destination chain ids + OriginChainID uint64 `json:"originChainId"` + OriginChainMetadata *ChainMetadata `json:"originChainMetadata"` + DestinationChainID uint64 `json:"destinationChainId"` + DestinationChainMetadata *ChainMetadata `json:"destinationChainMetadata"` + // origin and destination intent addresses + OriginIntentAddress prototyp.Hash `json:"originIntentAddress"` + DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress"` + // deposit transfer transaction hash and status, which is the init + // transfer from the owner / main signer into the origin intent + // address on the origin chain id + DepositTransactionHash *prototyp.Hash `json:"depositTransactionHash"` + DepositTransactionStatus TransactionStatus `json:"depositTransactionStatus"` + // origin and destination execution transaction hashes and statuses + OriginTransactionHash *prototyp.Hash `json:"originTransactionHash"` + OriginTransactionStatus TransactionStatus `json:"originTransactionStatus"` + DestinationTransactionHash *prototyp.Hash `json:"destinationTransactionHash"` + DestinationTransactionStatus TransactionStatus `json:"destinationTransactionStatus"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + OriginTokenAmount prototyp.BigInt `json:"originTokenAmount"` + OriginTokenMetadata *TokenMetadata `json:"originTokenMetadata"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` + DestinationTokenMetadata *TokenMetadata `json:"destinationTokenMetadata"` + // timestamp when the intent receipt was updated, usually from status change + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // timestamp of when the intent receipt was created + CreatedAt time.Time `json:"createdAt"` +} + +type ChainMetadata struct { + Name string `json:"name"` + LogoUri string `json:"logoUri,omitempty"` +} + +type TokenMetadata struct { + Name string `json:"name"` + Symbol string `json:"symbol"` + Decimals uint8 `json:"decimals"` + LogoUri string `json:"logoUri,omitempty"` } // NOTE: this also comes from pricefeed package.. From cb7998c2715e7a8247d0d9396677a175d994b8ff Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Sun, 2 Nov 2025 02:23:37 +0000 Subject: [PATCH 033/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 85 +++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 4e802bea..8857da95 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 005a369b19dfebdb65dde9e0e5ddac91bfc04c44 +// trails-api v1.0.0 0b6de03a213c68572c446338975ad1f080d68655 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "005a369b19dfebdb65dde9e0e5ddac91bfc04c44" + return "0b6de03a213c68572c446338975ad1f080d68655" } // @@ -56,6 +56,7 @@ type TrailsClient interface { GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) GetIntentGasFeeOptions(ctx context.Context, getIntentGasFeeOptionsRequest GetIntentGasFeeOptionsRequest) (*GetIntentGasFeeOptionsResponse, error) GetIntentEntryTransaction(ctx context.Context, getIntentEntryTransactionRequest GetIntentEntryTransactionRequest) (*GetIntentEntryTransactionResponse, error) + GetTokenPrices(ctx context.Context, tokens []*Token) ([]*TokenPrice, error) } // @@ -548,10 +549,9 @@ type IntentSummary struct { // intent owner / main signer OwnerAddress prototyp.Hash `json:"ownerAddress"` // origin and destination chain ids - OriginChainID uint64 `json:"originChainId"` - OriginChainMetadata *ChainMetadata `json:"originChainMetadata"` - DestinationChainID uint64 `json:"destinationChainId"` - DestinationChainMetadata *ChainMetadata `json:"destinationChainMetadata"` + OriginChainID uint64 `json:"originChainId"` + // - originChainMetadata: ChainMetadata + DestinationChainID uint64 `json:"destinationChainId"` // origin and destination intent addresses OriginIntentAddress prototyp.Hash `json:"originIntentAddress"` DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress"` @@ -578,45 +578,32 @@ type IntentSummary struct { } type ChainMetadata struct { + ChainID uint64 `json:"chainId"` Name string `json:"name"` - LogoUri string `json:"logoUri,omitempty"` + LogoURI string `json:"logoUri,omitempty"` + Testnet *bool `json:"testnet,omitempty"` } type TokenMetadata struct { - Name string `json:"name"` - Symbol string `json:"symbol"` - Decimals uint8 `json:"decimals"` - LogoUri string `json:"logoUri,omitempty"` -} - -// NOTE: this also comes from pricefeed package.. -// lets review, and move it there .. perhaps have types -// here, as seems we need it..? HOWEVER.. it seems -// that trails npm package still uses the sequence api -// for pricing directly, and we're not using the pricefeed -// from trails-api .. I think..? cuz, we don't have GetCoinPrices -// endpoint... so... -type TokenPrice struct { - Token *Token `json:"token"` - Price *Price `json:"price"` - Price24hChange *Price `json:"price24hChange"` - Price24hVol *Price `json:"price24hVol"` - FloorPrice *Price `json:"floorPrice,omitempty"` - BuyPrice *Price `json:"buyPrice,omitempty"` - SellPrice *Price `json:"sellPrice,omitempty"` - // TODO: review, copy other types, or not? - UpdatedAt *time.Time `json:"updatedAt"` + TokenAddress prototyp.Hash `json:"tokenAddress"` + Name string `json:"name"` + Symbol string `json:"symbol"` + Decimals *uint8 `json:"decimals,omitempty"` + LogoURI string `json:"logoUri,omitempty"` } type Token struct { ChainID uint64 `json:"chainId"` TokenAddress prototyp.Hash `json:"tokenAddress"` - TokenId *string `json:"tokenId"` + TokenSymbol *string `json:"tokenSymbol,omitempty"` } -type Price struct { - Value float64 `json:"value"` - Currency string `json:"currency"` +type TokenPrice struct { + Token *Token `json:"token"` + PriceUSD *float64 `json:"priceUsd"` + // - price?: float64 + // - currency: string + UpdatedAt time.Time `json:"updatedAt"` } type CCTPTransfer struct { @@ -955,6 +942,11 @@ var methods = map[string]method{ service: "Trails", annotations: map[string]string{}, }, + "/rpc/Trails/GetTokenPrices": { + name: "GetTokenPrices", + service: "Trails", + annotations: map[string]string{}, + }, } func WebrpcMethods() map[string]method { @@ -982,6 +974,7 @@ var WebRPCServices = map[string][]string{ "GetIntentTransactionHistory", "GetIntentGasFeeOptions", "GetIntentEntryTransaction", + "GetTokenPrices", }, } @@ -993,12 +986,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [14]string + urls [15]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [14]string{ + urls := [15]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1013,6 +1006,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetIntentTransactionHistory", prefix + "GetIntentGasFeeOptions", prefix + "GetIntentEntryTransaction", + prefix + "GetTokenPrices", } return &trailsClient{ client: client, @@ -1244,6 +1238,25 @@ func (c *trailsClient) GetIntentEntryTransaction(ctx context.Context, getIntentE return out.Ret0, err } +func (c *trailsClient) GetTokenPrices(ctx context.Context, tokens []*Token) ([]*TokenPrice, error) { + in := struct { + Arg0 []*Token `json:"tokens"` + }{tokens} + out := struct { + Ret0 []*TokenPrice `json:"tokenPrices"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + // // Client helpers // From 8dd7dcccaca52780c5b3c3729933ae650f1b20d3 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Sun, 2 Nov 2025 16:52:00 +0000 Subject: [PATCH 034/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 8857da95..204253b7 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 0b6de03a213c68572c446338975ad1f080d68655 +// trails-api v1.0.0 6b5ffa05cd25d7fe78555b8cbc0b193f957c4ed9 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "0b6de03a213c68572c446338975ad1f080d68655" + return "6b5ffa05cd25d7fe78555b8cbc0b193f957c4ed9" } // @@ -585,6 +585,7 @@ type ChainMetadata struct { } type TokenMetadata struct { + ChainID uint64 `json:"chainId"` TokenAddress prototyp.Hash `json:"tokenAddress"` Name string `json:"name"` Symbol string `json:"symbol"` From 484932a0bf054bcf6ca54b9ab787a0ae90a02e2e Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Sun, 2 Nov 2025 17:53:24 +0000 Subject: [PATCH 035/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 204253b7..19eee8e7 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 6b5ffa05cd25d7fe78555b8cbc0b193f957c4ed9 +// trails-api v1.0.0 c652c2506895f07c946ff703ae630217360ae825 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "6b5ffa05cd25d7fe78555b8cbc0b193f957c4ed9" + return "c652c2506895f07c946ff703ae630217360ae825" } // @@ -123,30 +123,37 @@ func (x *QuoteProviderType) Is(values ...QuoteProviderType) bool { type TransactionStatus uint8 const ( - TransactionStatus_UNKNOWN TransactionStatus = 0 - TransactionStatus_PENDING TransactionStatus = 1 - TransactionStatus_RELAYING TransactionStatus = 2 - TransactionStatus_MINING TransactionStatus = 3 - TransactionStatus_SUCCEEDED TransactionStatus = 4 - TransactionStatus_FAILED TransactionStatus = 5 + TransactionStatus_UNKNOWN TransactionStatus = 0 + // Queued. + TransactionStatus_PENDING TransactionStatus = 1 + // Sending to Relayer. + TransactionStatus_RELAYING TransactionStatus = 2 + // Sent to Relayer. + TransactionStatus_RELAYED TransactionStatus = 3 + // Waiting for receipt. + TransactionStatus_MINING TransactionStatus = 4 + TransactionStatus_SUCCEEDED TransactionStatus = 5 + TransactionStatus_FAILED TransactionStatus = 6 ) var TransactionStatus_name = map[uint8]string{ 0: "UNKNOWN", 1: "PENDING", 2: "RELAYING", - 3: "MINING", - 4: "SUCCEEDED", - 5: "FAILED", + 3: "RELAYED", + 4: "MINING", + 5: "SUCCEEDED", + 6: "FAILED", } var TransactionStatus_value = map[string]uint8{ "UNKNOWN": 0, "PENDING": 1, "RELAYING": 2, - "MINING": 3, - "SUCCEEDED": 4, - "FAILED": 5, + "RELAYED": 3, + "MINING": 4, + "SUCCEEDED": 5, + "FAILED": 6, } func (x TransactionStatus) String() string { From f373f1a3d5008ca42b006ac62621908c63d70a4d Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 3 Nov 2025 01:42:44 +0000 Subject: [PATCH 036/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 68 ++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 19eee8e7..577d1f8d 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 c652c2506895f07c946ff703ae630217360ae825 +// trails-api v1.0.0 a60c9fc27cb40ddf164c57c9c9e3ae85ad3a4ce8 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "c652c2506895f07c946ff703ae630217360ae825" + return "a60c9fc27cb40ddf164c57c9c9e3ae85ad3a4ce8" } // @@ -312,20 +312,20 @@ type Intent struct { Status IntentStatus `json:"status" db:"status,omitempty"` QuoteRequest *QuoteIntentRequest `json:"quoteRequest" db:"quote_request"` // intent owner / main signer - OwnerAddress prototyp.Hash `json:"ownerAddress" db:"owner_address"` - OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"orig_intent_address"` - DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"dest_intent_address"` - DestinationSalt prototyp.BigInt `json:"destinationSalt" db:"destination_salt"` - DepositTransaction *DepositTransaction `json:"depositTransaction" db:"deposit_txn"` - Calls []*IntentCalls `json:"calls" db:"calls"` - Preconditions []*IntentPrecondition `json:"preconditions" db:"preconditions"` - MetaTxns []*MetaTxn `json:"metaTxns" db:"meta_txns"` - Quote *IntentProviderQuote `json:"quote" db:"quote"` - Fees *IntentFees `json:"fees" db:"fees"` - TrailsVersion string `json:"trailsVersion" db:"trails_version"` - ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + OwnerAddress prototyp.Hash `json:"ownerAddress" db:"owner_address"` + OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"orig_intent_address"` + DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"dest_intent_address"` + DestinationSalt prototyp.BigInt `json:"destinationSalt" db:"destination_salt"` + DepositTransaction *DepositTransaction `json:"depositTransaction" db:"deposit_txn"` + Calls []*IntentCalls `json:"calls" db:"calls"` + Preconditions []*TransactionPrecondition `json:"preconditions" db:"preconditions"` + MetaTxns []*MetaTxn `json:"metaTxns" db:"meta_txns"` + Quote *IntentProviderQuote `json:"quote" db:"quote"` + Fees *IntentFees `json:"fees" db:"fees"` + TrailsVersion string `json:"trailsVersion" db:"trails_version"` + ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // DepositTransaction represents a deposit transfer transaction of the token amount @@ -360,23 +360,15 @@ type TransactionCall struct { BehaviorOnError *uint8 `json:"behaviorOnError"` } -type IntentPrecondition struct { - // TODO: value should be erc20MinAllowance to match 7795 - Type string `json:"type"` - ChainID uint64 `json:"chainId"` - Data *IntentPreconditionData `json:"data"` -} - -// transaction preconditions based on https://eips.ethereum.org/EIPS/eip-7795 -// chainId: `0x${string}`; // Hex chain id -// owner: `0x${string}`; // Address -// token: `0x${string}`; // Address -// minAmount: `0x${string}`; // Hex value -type IntentPreconditionData struct { - Address string `json:"address"` - Token string `json:"token"` - // TODOXXX: this probably should be a hex string.. what does ERC, should be string and prototyp.Hash - Min uint64 `json:"min"` +// TransactionPrecondition preconditions based on https://eips.ethereum.org/EIPS/eip-7795 +// NOTE: make sure this struct type matches the relayer TransactionPrecondition type. +type TransactionPrecondition struct { + // value must be 'tokenMinBalance' or '' + Type string `json:"type"` + ChainID uint64 `json:"chainId"` + OwnerAddress prototyp.Hash `json:"ownerAddress"` + TokenAddress prototyp.Hash `json:"tokenAddress"` + MinAmount prototyp.BigInt `json:"minAmount"` } // MetaTxn is a meta-transaction to be submitted to Sequence Relayer. @@ -458,11 +450,11 @@ type IntentTransaction struct { // Token being transferred in this transaction TokenAddress prototyp.Hash `json:"tokenAddress" db:"token_address"` // Amount transferred in this transaction - TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` - Calldata prototyp.Hash `json:"calldata" db:"calldata"` - MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id"` - MetaTxnFeeQuote string `json:"metaTxnFeeQuote" db:"fee_quote"` - Preconditions *IntentPrecondition `json:"preconditions" db:"preconditions"` + TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` + Calldata prototyp.Hash `json:"calldata" db:"calldata"` + MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id"` + MetaTxnFeeQuote string `json:"metaTxnFeeQuote" db:"fee_quote"` + Precondition *TransactionPrecondition `json:"precondition" db:"precondition"` // Transaction hash received from the relayer after it's mined. TxnHash prototyp.Hash `json:"txnHash" db:"txn_hash,omitempty"` // Status of this specific transaction From 7549bcdd939638717c622255eba2cda2b9ae9d58 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 3 Nov 2025 22:22:15 +0000 Subject: [PATCH 037/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 218 ++++++++++++++--------------------- 1 file changed, 85 insertions(+), 133 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 577d1f8d..dbd06ab0 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 a60c9fc27cb40ddf164c57c9c9e3ae85ad3a4ce8 +// trails-api v1.0.0 c41075ba78dccc2053a45ec888ac7d356d6f42a9 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "a60c9fc27cb40ddf164c57c9c9e3ae85ad3a4ce8" + return "c41075ba78dccc2053a45ec888ac7d356d6f42a9" } // @@ -54,8 +54,6 @@ type TrailsClient interface { GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) - GetIntentGasFeeOptions(ctx context.Context, getIntentGasFeeOptionsRequest GetIntentGasFeeOptionsRequest) (*GetIntentGasFeeOptionsResponse, error) - GetIntentEntryTransaction(ctx context.Context, getIntentEntryTransactionRequest GetIntentEntryTransactionRequest) (*GetIntentEntryTransactionResponse, error) GetTokenPrices(ctx context.Context, tokens []*Token) ([]*TokenPrice, error) } @@ -397,11 +395,6 @@ type MetaTxn struct { // // NOTE: this was previously named IntentTransaction // -// TODO: this type still needs some review.. for example, I wonder if we should have -// Intent or IntentReceipt split out the differrent transactions per chain as separate -// rows, instead of having it be consolidated.. I kinda prefer having them separate, -// but it could mean we have a new type called IntentTransaction which is that..? -// // db table: 'intent_receipts' type IntentReceipt struct { // id is an internal-only sequential primary key. @@ -416,11 +409,17 @@ type IntentReceipt struct { OriginChainID uint64 `json:"originChainId" db:"orig_chain_id"` // destination chain id where the intent is targetting as final execution DestinationChainID uint64 `json:"destinationChainId" db:"dest_chain_id"` - // deposit transfer transaction hash and status, which is the init - // transfer from the owner / main signer into the origin intent - // address on the origin chain id - DepositTransactionHash prototyp.Hash `json:"depositTransactionHash" db:"deposit_txn_hash"` - DepositTransactionStatus TransactionStatus `json:"depositTransactionStatus" db:"deposit_txn_status"` + // deposit transaction transaction is the user-initiated transfer into + // the origin intent address on the origin chain. + // + // also note, that if a user is using the 'gasless' deposit method, + // then they supply us with an 'intentEntry' signature, and then + // we relay the deposit as a meta-transaction on their behalf to + // the intent entrypoint contract. + // + // there will also be a deposit transaction to the origin intent address. + DepositTransactionID *uint64 `json:"-" db:"deposit_txn_id"` + DepositTransaction *IntentTransaction `json:"depositTransaction" db:"-"` // origin intent transaction db reference and runtime type OriginTransactionID uint64 `json:"-" db:"orig_txn_id"` OriginTransaction *IntentTransaction `json:"originTransaction" db:"-"` @@ -444,17 +443,21 @@ type IntentTransaction struct { IntentID prototyp.Hash `json:"intentId" db:"intent_id"` // Chain where this transaction executes ChainID uint64 `json:"chainId" db:"chain_id"` - // TODO: we can remove the from..? + // TODO: any reason to keep 'fromAddress' ? we can get it from chain if we need FromAddress prototyp.Hash `json:"fromAddress" db:"from_address"` - ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` + // ie. originIntentAddress, TrailsRouter, or TrailsIntentEntrypoint + ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` // Token being transferred in this transaction TokenAddress prototyp.Hash `json:"tokenAddress" db:"token_address"` // Amount transferred in this transaction - TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` - Calldata prototyp.Hash `json:"calldata" db:"calldata"` - MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id"` - MetaTxnFeeQuote string `json:"metaTxnFeeQuote" db:"fee_quote"` - Precondition *TransactionPrecondition `json:"precondition" db:"precondition"` + TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` + Calldata prototyp.Hash `json:"-" db:"calldata,omitempty"` + // for user-sent deposit txn, this will be null + MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id,omitempty"` + MetaTxnFeeQuote *string `json:"metaTxnFeeQuote" db:"fee_quote,omitempty"` + Precondition *TransactionPrecondition `json:"precondition" db:"precondition,omitempty"` + // Gasless deposit metadata (nullable) + DepositIntentEntry *DepositIntentEntry `json:"depositIntentEntry" db:"deposit_intent_entry,omitempty"` // Transaction hash received from the relayer after it's mined. TxnHash prototyp.Hash `json:"txnHash" db:"txn_hash,omitempty"` // Status of this specific transaction @@ -619,43 +622,11 @@ type CCTPTransfer struct { CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } -type GetIntentEntrypointDepositParams struct { - UserAddress prototyp.Hash `json:"userAddress"` - TokenAddress prototyp.Hash `json:"tokenAddress"` - Amount prototyp.BigInt `json:"amount"` - IntentAddress prototyp.Hash `json:"intentAddress"` - ChainID uint64 `json:"chainID"` - Deadline uint64 `json:"deadline"` - IntentSignature string `json:"intentSignature"` - UsePermit *bool `json:"usePermit"` - PermitAmount prototyp.BigInt `json:"permitAmount"` - PermitDeadline *uint64 `json:"permitDeadline"` - PermitSignature *string `json:"permitSignature"` - // Optional fee parameters - FeeAmount prototyp.BigInt `json:"feeAmount"` -} - -type GetIntentEntrypointDepositResult struct { - DepositWalletAddress string `json:"depositWalletAddress"` - MetaTxn *MetaTxn `json:"metaTxn"` - FeeQuote string `json:"feeQuote"` - EntrypointAddress string `json:"entrypointAddress"` -} - -// Fee options related types -type GetIntentEntrypointDepositFeeOptionsParams struct { - UserAddress prototyp.Hash `json:"userAddress"` - TokenAddress prototyp.Hash `json:"tokenAddress"` - IntentAddress prototyp.Hash `json:"intentAddress"` - Amount prototyp.BigInt `json:"amount"` - ChainID uint64 `json:"chainID"` -} - -type GetIntentEntrypointDepositFeeOptionsResult struct { - GasEstimate *GasEstimate `json:"gasEstimate"` - FeeOptions []*FeeOption `json:"feeOptions"` - ExpiresAt uint64 `json:"expiresAt"` - FeeCollector string `json:"feeCollector"` +type GasFeeOptions struct { + GasEstimate *GasEstimate `json:"gasEstimate"` + FeeOptions []*FeeOption `json:"feeOptions"` + ExpiresAt time.Time `json:"expiresAt"` + FeeCollectorAddress prototyp.Hash `json:"feeCollectorAddress"` } type GasEstimate struct { @@ -666,12 +637,53 @@ type GasEstimate struct { } type FeeOption struct { - TokenAddress string `json:"tokenAddress"` - TokenSymbol string `json:"tokenSymbol"` - TokenDecimals int32 `json:"tokenDecimals"` - Amount string `json:"amount"` - AmountUSD float64 `json:"amountUsd"` - FeeCollector string `json:"feeCollector"` + // if value is 0x000...000 or 0xeee...eeee, it is native token 1Code has comments. Press enter to view. + TokenAddress prototyp.Hash `json:"tokenAddress"` + TokenSymbol string `json:"tokenSymbol"` + TokenDecimals uint8 `json:"tokenDecimals"` + Amount prototyp.BigInt `json:"amount"` + AmountUSD float64 `json:"amountUsd"` + FeeCollectorAddress prototyp.Hash `json:"feeCollectorAddress"` +} + +// DepositSignature contains all gasless deposit signature parameters for ExecuteIntent +type DepositSignature struct { + // Required: EIP-712 TrailsIntent signature (hex) + IntentSignature prototyp.Hash `json:"intentSignature"` + // Optional: EIP-2612 permit signature (hex, if token approval needed) + PermitSignature *prototyp.Hash `json:"permitSignature"` + // Optional: Permit expiration timestamp + PermitDeadline *uint64 `json:"permitDeadline"` + // Optional: Permit amount (usually max uint256) + PermitAmount prototyp.BigInt `json:"permitAmount"` + // Required: Selected fee option from gasFeeOptions + SelectedGasFeeOption *FeeOption `json:"selectedGasFeeOption"` + // Required: User nonce from Intent Entrypoint contract (fetched fresh at execute time) + UserNonce uint64 `json:"userNonce"` + // Required: Intent deadline timestamp + Deadline uint64 `json:"deadline"` +} + +// DepositIntentEntry contains gasless deposit metadata stored in JSONB +type DepositIntentEntry struct { + // EIP-712 TrailsIntent signature (hex) + IntentSignature prototyp.Hash `json:"intentSignature"` + // EIP-2612 permit signature (hex, if approval needed) + PermitSignature *prototyp.Hash `json:"permitSignature"` + // Permit expiration timestamp + PermitDeadline *uint64 `json:"permitDeadline"` + // Permit amount (usually max uint256) + PermitAmount prototyp.BigInt `json:"permitAmount"` + // Fee amount in deposit token + FeeAmount prototyp.BigInt `json:"feeAmount"` + // Fee token address (same as deposit token) + FeeToken prototyp.Hash `json:"feeToken"` + // Address that receives the fee + FeeCollector prototyp.Hash `json:"feeCollector"` + // User nonce from Intent Entrypoint contract (provided by client) + UserNonce uint64 `json:"userNonce"` + // Intent deadline timestamp + Deadline uint64 `json:"deadline"` } type TrailsAddressOverrides struct { @@ -748,7 +760,8 @@ type RuntimeStatus struct { // NOTE: we use the IntentRequest directly for the QuoteIntent request type. // And do not create a QuoteIntentRequest additional type, as its unnecessary. type QuoteIntentResponse struct { - Intent *Intent `json:"intent"` + Intent *Intent `json:"intent"` + GasFeeOptions *GasFeeOptions `json:"gasFeeOptions"` } // CommitIntent accepts a fully formed Intent and commits it for execution. CommitIntent @@ -766,8 +779,11 @@ type CommitIntentResponse struct { // Clients provide the transfer transaction hash that executed the transfer to the // intent origin address. type ExecuteIntentRequest struct { - IntentID prototyp.Hash `json:"intentId"` + IntentID prototyp.Hash `json:"intentId"` + // Traditional deposit: provide transaction hash DepositTransactionHash prototyp.Hash `json:"depositTransactionHash"` + // Gasless deposit: provide signatures (mutually exclusive with depositTransactionHash) + DepositSignature *DepositSignature `json:"depositSignature"` } type ExecuteIntentResponse struct { @@ -831,24 +847,6 @@ type GetIntentTransactionHistoryResponse struct { NextPage *Page `json:"nextPage"` } -// Gas fee options for intent entry (leverages existing Entrypoint fee option params/result types). -type GetIntentGasFeeOptionsRequest struct { - Params *GetIntentEntrypointDepositFeeOptionsParams `json:"params"` -} - -type GetIntentGasFeeOptionsResponse struct { - Result *GetIntentEntrypointDepositFeeOptionsResult `json:"result"` -} - -// Entry transaction (deposit) construction for an intent (leverages existing Entrypoint deposit params/result types). -type GetIntentEntryTransactionRequest struct { - Params *GetIntentEntrypointDepositParams `json:"params"` -} - -type GetIntentEntryTransactionResponse struct { - Result *GetIntentEntrypointDepositResult `json:"result"` -} - // Page represents a results page. This can be used both to request a page and // to store the state of a page. type Page struct { @@ -932,16 +930,6 @@ var methods = map[string]method{ service: "Trails", annotations: map[string]string{}, }, - "/rpc/Trails/GetIntentGasFeeOptions": { - name: "GetIntentGasFeeOptions", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/GetIntentEntryTransaction": { - name: "GetIntentEntryTransaction", - service: "Trails", - annotations: map[string]string{}, - }, "/rpc/Trails/GetTokenPrices": { name: "GetTokenPrices", service: "Trails", @@ -972,8 +960,6 @@ var WebRPCServices = map[string][]string{ "GetIntent", "SearchIntents", "GetIntentTransactionHistory", - "GetIntentGasFeeOptions", - "GetIntentEntryTransaction", "GetTokenPrices", }, } @@ -986,12 +972,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [15]string + urls [13]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [15]string{ + urls := [13]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1004,8 +990,6 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetIntent", prefix + "SearchIntents", prefix + "GetIntentTransactionHistory", - prefix + "GetIntentGasFeeOptions", - prefix + "GetIntentEntryTransaction", prefix + "GetTokenPrices", } return &trailsClient{ @@ -1206,38 +1190,6 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten return out.Ret0, err } -func (c *trailsClient) GetIntentGasFeeOptions(ctx context.Context, getIntentGasFeeOptionsRequest GetIntentGasFeeOptionsRequest) (*GetIntentGasFeeOptionsResponse, error) { - out := struct { - Ret0 *GetIntentGasFeeOptionsResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getIntentGasFeeOptionsRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) GetIntentEntryTransaction(ctx context.Context, getIntentEntryTransactionRequest GetIntentEntryTransactionRequest) (*GetIntentEntryTransactionResponse, error) { - out := struct { - Ret0 *GetIntentEntryTransactionResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getIntentEntryTransactionRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - func (c *trailsClient) GetTokenPrices(ctx context.Context, tokens []*Token) ([]*TokenPrice, error) { in := struct { Arg0 []*Token `json:"tokens"` @@ -1246,7 +1198,7 @@ func (c *trailsClient) GetTokenPrices(ctx context.Context, tokens []*Token) ([]* Ret0 []*TokenPrice `json:"tokenPrices"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From 2ef2d82944cd30cadb19f90cf95e5b3ce02dcc16 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 4 Nov 2025 01:28:29 +0000 Subject: [PATCH 038/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index dbd06ab0..bd3406a3 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 c41075ba78dccc2053a45ec888ac7d356d6f42a9 +// trails-api v1.0.0 8f454c95cc0ada33868332c071b18e9dfed9c389 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "c41075ba78dccc2053a45ec888ac7d356d6f42a9" + return "8f454c95cc0ada33868332c071b18e9dfed9c389" } // @@ -637,7 +637,7 @@ type GasEstimate struct { } type FeeOption struct { - // if value is 0x000...000 or 0xeee...eeee, it is native token 1Code has comments. Press enter to view. + // if value is 0x000...000 or 0xeee...eeee, it is native token TokenAddress prototyp.Hash `json:"tokenAddress"` TokenSymbol string `json:"tokenSymbol"` TokenDecimals uint8 `json:"tokenDecimals"` From 5b47deaa8d90b5eb18e74e1e64dc4a61bd3eff69 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 4 Nov 2025 02:03:39 +0000 Subject: [PATCH 039/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index bd3406a3..f334832d 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 8f454c95cc0ada33868332c071b18e9dfed9c389 +// trails-api v1.0.0 fb8c387446f202180d13383089d42cc09891df9e // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "8f454c95cc0ada33868332c071b18e9dfed9c389" + return "fb8c387446f202180d13383089d42cc09891df9e" } // @@ -418,7 +418,7 @@ type IntentReceipt struct { // the intent entrypoint contract. // // there will also be a deposit transaction to the origin intent address. - DepositTransactionID *uint64 `json:"-" db:"deposit_txn_id"` + DepositTransactionID uint64 `json:"-" db:"deposit_txn_id"` DepositTransaction *IntentTransaction `json:"depositTransaction" db:"-"` // origin intent transaction db reference and runtime type OriginTransactionID uint64 `json:"-" db:"orig_txn_id"` @@ -442,8 +442,7 @@ type IntentTransaction struct { // Intent id this transaction is associated with IntentID prototyp.Hash `json:"intentId" db:"intent_id"` // Chain where this transaction executes - ChainID uint64 `json:"chainId" db:"chain_id"` - // TODO: any reason to keep 'fromAddress' ? we can get it from chain if we need + ChainID uint64 `json:"chainId" db:"chain_id"` FromAddress prototyp.Hash `json:"fromAddress" db:"from_address"` // ie. originIntentAddress, TrailsRouter, or TrailsIntentEntrypoint ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` From 187f1aeb28b4aa1149b2a1d89493835c3f78753e Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:42:23 +0000 Subject: [PATCH 040/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index f334832d..f4d369e2 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 fb8c387446f202180d13383089d42cc09891df9e +// trails-api v1.0.0 5466ab4ac18cc3dba87474e761c45420d9a0d137 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "fb8c387446f202180d13383089d42cc09891df9e" + return "5466ab4ac18cc3dba87474e761c45420d9a0d137" } // @@ -459,6 +459,8 @@ type IntentTransaction struct { DepositIntentEntry *DepositIntentEntry `json:"depositIntentEntry" db:"deposit_intent_entry,omitempty"` // Transaction hash received from the relayer after it's mined. TxnHash prototyp.Hash `json:"txnHash" db:"txn_hash,omitempty"` + // On-chain block timestamp when txn was mined + TxnMinedAt *time.Time `json:"txnMinedAt" db:"txn_mined_at,omitempty"` // Status of this specific transaction Status TransactionStatus `json:"status" db:"status"` StatusReason *string `json:"statusReason" db:"status_reason,omitempty"` From e758fbf8d6d2d59d06d06f3d9e5eac2031e9b800 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 5 Nov 2025 02:13:13 +0000 Subject: [PATCH 041/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index f4d369e2..3fcb3d25 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 5466ab4ac18cc3dba87474e761c45420d9a0d137 +// trails-api v1.0.0 dde1603b363889099a3f3af5ca2dac9a0937cf7a // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "5466ab4ac18cc3dba87474e761c45420d9a0d137" + return "dde1603b363889099a3f3af5ca2dac9a0937cf7a" } // @@ -452,13 +452,13 @@ type IntentTransaction struct { TokenAmount prototyp.BigInt `json:"tokenAmount" db:"token_amount"` Calldata prototyp.Hash `json:"-" db:"calldata,omitempty"` // for user-sent deposit txn, this will be null - MetaTxnID prototyp.Hash `json:"metaTxnId" db:"meta_txn_id,omitempty"` + MetaTxnID prototyp.Hash `json:"metaTxnId,omitempty" db:"meta_txn_id,omitempty"` MetaTxnFeeQuote *string `json:"metaTxnFeeQuote" db:"fee_quote,omitempty"` Precondition *TransactionPrecondition `json:"precondition" db:"precondition,omitempty"` // Gasless deposit metadata (nullable) DepositIntentEntry *DepositIntentEntry `json:"depositIntentEntry" db:"deposit_intent_entry,omitempty"` // Transaction hash received from the relayer after it's mined. - TxnHash prototyp.Hash `json:"txnHash" db:"txn_hash,omitempty"` + TxnHash prototyp.Hash `json:"txnHash,omitempty" db:"txn_hash,omitempty"` // On-chain block timestamp when txn was mined TxnMinedAt *time.Time `json:"txnMinedAt" db:"txn_mined_at,omitempty"` // Status of this specific transaction From 6f6ece7455d6699a792a2365a2dd438311bfd00e Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 5 Nov 2025 16:34:20 +0000 Subject: [PATCH 042/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 58 +++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 3fcb3d25..f69c5e27 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 dde1603b363889099a3f3af5ca2dac9a0937cf7a +// trails-api v1.0.0 cbd6d970d0d38194195eb3409777b9ef67cd0714 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "dde1603b363889099a3f3af5ca2dac9a0937cf7a" + return "cbd6d970d0d38194195eb3409777b9ef67cd0714" } // @@ -122,36 +122,46 @@ type TransactionStatus uint8 const ( TransactionStatus_UNKNOWN TransactionStatus = 0 - // Queued. - TransactionStatus_PENDING TransactionStatus = 1 - // Sending to Relayer. - TransactionStatus_RELAYING TransactionStatus = 2 - // Sent to Relayer. - TransactionStatus_RELAYED TransactionStatus = 3 - // Waiting for receipt. - TransactionStatus_MINING TransactionStatus = 4 - TransactionStatus_SUCCEEDED TransactionStatus = 5 - TransactionStatus_FAILED TransactionStatus = 6 + // On hold, ie. waiting for bridge (off-chain burn attestation) + TransactionStatus_ON_HOLD TransactionStatus = 1 + // Ready to be dequeued & sent by the worker + TransactionStatus_PENDING TransactionStatus = 2 + // Worker: sending to Relayer + TransactionStatus_RELAYING TransactionStatus = 3 + // Sent to the blockchain, whether direct, or via Relayer + TransactionStatus_SENT TransactionStatus = 4 + // Worker: Waiting for receipt + TransactionStatus_MINING TransactionStatus = 5 + // Txn is mined onchain with success status + TransactionStatus_SUCCEEDED TransactionStatus = 6 + // Txn is mined onchain with failure status + TransactionStatus_FAILED TransactionStatus = 7 + // Flow aborted at one of the stages, and never completed onchain txn + TransactionStatus_ABORTED TransactionStatus = 8 ) var TransactionStatus_name = map[uint8]string{ 0: "UNKNOWN", - 1: "PENDING", - 2: "RELAYING", - 3: "RELAYED", - 4: "MINING", - 5: "SUCCEEDED", - 6: "FAILED", + 1: "ON_HOLD", + 2: "PENDING", + 3: "RELAYING", + 4: "SENT", + 5: "MINING", + 6: "SUCCEEDED", + 7: "FAILED", + 8: "ABORTED", } var TransactionStatus_value = map[string]uint8{ "UNKNOWN": 0, - "PENDING": 1, - "RELAYING": 2, - "RELAYED": 3, - "MINING": 4, - "SUCCEEDED": 5, - "FAILED": 6, + "ON_HOLD": 1, + "PENDING": 2, + "RELAYING": 3, + "SENT": 4, + "MINING": 5, + "SUCCEEDED": 6, + "FAILED": 7, + "ABORTED": 8, } func (x TransactionStatus) String() string { From 8c341d6920fbda3e2b5e811e4f553a24875f83db Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 5 Nov 2025 16:56:34 +0000 Subject: [PATCH 043/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index f69c5e27..91d24601 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 cbd6d970d0d38194195eb3409777b9ef67cd0714 +// trails-api v1.0.0 ceebf8def1df165f16d66ce5580c84fe2375c8b6 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "cbd6d970d0d38194195eb3409777b9ef67cd0714" + return "ceebf8def1df165f16d66ce5580c84fe2375c8b6" } // @@ -434,8 +434,10 @@ type IntentReceipt struct { OriginTransactionID uint64 `json:"-" db:"orig_txn_id"` OriginTransaction *IntentTransaction `json:"originTransaction" db:"-"` // destination intent transaction db reference and runtime type - DestinationTransactionID uint64 `json:"-" db:"dest_txn_id"` - DestinationTransaction *IntentTransaction `json:"destinationTransaction" db:"-"` + // note: this may be null if the intent did not require a destination txn, + // ie. simple swap on origin chain only with no destination calldata. + DestinationTransactionID uint64 `json:"-" db:"dest_txn_id,omitempty"` + DestinationTransaction *IntentTransaction `json:"destinationTransaction,omitempty" db:"-"` // timestamp when the intent receipt was updated, usually from status change UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` // timestamp of when the intent receipt was created From 8576b10704ed59e83852483660852ffe380242b5 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 5 Nov 2025 18:17:02 +0000 Subject: [PATCH 044/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 91d24601..24681a15 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 ceebf8def1df165f16d66ce5580c84fe2375c8b6 +// trails-api v1.0.0 8b03dcc1b34a3d96a39a3ad70e863e7e1e1a42ad // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "ceebf8def1df165f16d66ce5580c84fe2375c8b6" + return "8b03dcc1b34a3d96a39a3ad70e863e7e1e1a42ad" } // @@ -436,7 +436,7 @@ type IntentReceipt struct { // destination intent transaction db reference and runtime type // note: this may be null if the intent did not require a destination txn, // ie. simple swap on origin chain only with no destination calldata. - DestinationTransactionID uint64 `json:"-" db:"dest_txn_id,omitempty"` + DestinationTransactionID *uint64 `json:"-" db:"dest_txn_id,omitempty"` DestinationTransaction *IntentTransaction `json:"destinationTransaction,omitempty" db:"-"` // timestamp when the intent receipt was updated, usually from status change UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` From 41eb54ad5f644a8374d7efe700196e38bf2751de Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Thu, 6 Nov 2025 11:50:13 +0000 Subject: [PATCH 045/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 24681a15..cc737e2c 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 8b03dcc1b34a3d96a39a3ad70e863e7e1e1a42ad +// trails-api v1.0.0 8a39e1f88ba87651e7acb6b8c27fc6682f072eac // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "8b03dcc1b34a3d96a39a3ad70e863e7e1e1a42ad" + return "8a39e1f88ba87651e7acb6b8c27fc6682f072eac" } // @@ -758,13 +758,21 @@ type Version struct { type RuntimeStatus struct { // overall status, true/false - HealthOK bool `json:"healthOK"` - StartTime time.Time `json:"startTime"` - Uptime uint64 `json:"uptime"` - Ver string `json:"ver"` - Branch string `json:"branch"` - CommitHash string `json:"commitHash"` - Runnables interface{} `json:"runnables"` + HealthOK bool `json:"healthOK"` + StartTime time.Time `json:"startTime"` + Uptime uint64 `json:"uptime"` + Ver string `json:"ver"` + Branch string `json:"branch"` + CommitHash string `json:"commitHash"` + Runnables interface{} `json:"runnables"` + Services []*ServiceStatus `json:"services"` +} + +type ServiceStatus struct { + Name string `json:"name"` + Healthy bool `json:"healthy"` + Error string `json:"error,omitempty"` + Latency string `json:"latency"` } // QuoteIntent accepts an intent request from the user/app and returns From 384a56a0558e0c8e1fcd13277ca45c2e33f3f6c3 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 6 Nov 2025 13:49:37 +0000 Subject: [PATCH 046/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index cc737e2c..bca556e1 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 8a39e1f88ba87651e7acb6b8c27fc6682f072eac +// trails-api v1.0.0 b7052858fd352cc9ed13923cfd40d354519988a5 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "8a39e1f88ba87651e7acb6b8c27fc6682f072eac" + return "b7052858fd352cc9ed13923cfd40d354519988a5" } // @@ -847,9 +847,10 @@ type GetIntentResponse struct { // SearchIntents searches past intents based on filters. // We do not return 'solved' status intents here, only committed/executed/failed/succeeded. type SearchIntentsRequest struct { - ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` - ByDepositTransactionHash prototyp.Hash `json:"byDepositTransactionHash"` - ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` + ByIntentID prototyp.Hash `json:"byIntentId"` + ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` + ByTransactionHash prototyp.Hash `json:"byTransactionHash"` + ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` } type SearchIntentsResponse struct { From a71c88b8578590ebc2ab1fbc8f821e2556e0b50e Mon Sep 17 00:00:00 2001 From: taylanpince <12650+taylanpince@users.noreply.github.com> Date: Thu, 6 Nov 2025 16:37:07 +0000 Subject: [PATCH 047/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index bca556e1..2595b80f 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 b7052858fd352cc9ed13923cfd40d354519988a5 +// trails-api v1.0.0 9595a664b9e921548f098c902f79fb5365501005 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "b7052858fd352cc9ed13923cfd40d354519988a5" + return "9595a664b9e921548f098c902f79fb5365501005" } // @@ -312,6 +312,8 @@ type QuoteIntentRequestOptions struct { type Intent struct { // id is an internal-only sequential primary key. ID uint64 `json:"-" db:"id,omitempty"` + // Trails/Sequence project id intent originated from + ProjectID uint64 `json:"-" db:"project_id"` // intentId is a deterministic public intent identifier // based on the hash of the origin and destination intent addresses. IntentID prototyp.Hash `json:"intentId" db:"intent_id"` @@ -409,6 +411,8 @@ type MetaTxn struct { type IntentReceipt struct { // id is an internal-only sequential primary key. ID uint64 `json:"-" db:"id,omitempty"` + // Trails/Sequence project id intent originated from + ProjectID uint64 `json:"-" db:"project_id"` // intent deterministic id IntentID prototyp.Hash `json:"intentId" db:"intent_id"` // intent execution status @@ -848,9 +852,10 @@ type GetIntentResponse struct { // We do not return 'solved' status intents here, only committed/executed/failed/succeeded. type SearchIntentsRequest struct { ByIntentID prototyp.Hash `json:"byIntentId"` - ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` + ByProjectID *uint64 `json:"byProjectId"` ByTransactionHash prototyp.Hash `json:"byTransactionHash"` ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` + ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` } type SearchIntentsResponse struct { @@ -862,6 +867,9 @@ type SearchIntentsResponse struct { type GetIntentTransactionHistoryRequest struct { // cursor paging parameters Page *Page `json:"page"` + // optional project id scope filter + ByProjectID *uint64 `json:"byProjectId"` + ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` } type GetIntentTransactionHistoryResponse struct { From c998b6966da36d27c39e5eb9083c87f5cfae6598 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:20:37 +0000 Subject: [PATCH 048/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 50 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 2595b80f..c942943a 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 9595a664b9e921548f098c902f79fb5365501005 +// trails-api v1.0.0 14a0ef58105c745d01c3dadffec0f5a4274977b9 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "9595a664b9e921548f098c902f79fb5365501005" + return "14a0ef58105c745d01c3dadffec0f5a4274977b9" } // @@ -122,22 +122,24 @@ type TransactionStatus uint8 const ( TransactionStatus_UNKNOWN TransactionStatus = 0 - // On hold, ie. waiting for bridge (off-chain burn attestation) + // on hold, ie. waiting for bridge (off-chain burn attestation) TransactionStatus_ON_HOLD TransactionStatus = 1 - // Ready to be dequeued & sent by the worker + // ready to be dequeued & sent by the worker TransactionStatus_PENDING TransactionStatus = 2 - // Worker: sending to Relayer + // worker: sending to Relayer TransactionStatus_RELAYING TransactionStatus = 3 - // Sent to the blockchain, whether direct, or via Relayer + // sent to the blockchain, whether direct, or via Relayer TransactionStatus_SENT TransactionStatus = 4 - // Worker: Waiting for receipt - TransactionStatus_MINING TransactionStatus = 5 - // Txn is mined onchain with success status - TransactionStatus_SUCCEEDED TransactionStatus = 6 - // Txn is mined onchain with failure status - TransactionStatus_FAILED TransactionStatus = 7 - // Flow aborted at one of the stages, and never completed onchain txn - TransactionStatus_ABORTED TransactionStatus = 8 + // encountered error during sending (will be retried) + TransactionStatus_ERRORED TransactionStatus = 5 + // worker: waiting for receipt + TransactionStatus_MINING TransactionStatus = 6 + // terminal state: txn is mined onchain with success status + TransactionStatus_SUCCEEDED TransactionStatus = 7 + // terminal state: txn is mined onchain with failure status + TransactionStatus_FAILED TransactionStatus = 8 + // terminal state: aborted at one of the stages, and never completed onchain txn + TransactionStatus_ABORTED TransactionStatus = 9 ) var TransactionStatus_name = map[uint8]string{ @@ -146,10 +148,11 @@ var TransactionStatus_name = map[uint8]string{ 2: "PENDING", 3: "RELAYING", 4: "SENT", - 5: "MINING", - 6: "SUCCEEDED", - 7: "FAILED", - 8: "ABORTED", + 5: "ERRORED", + 6: "MINING", + 7: "SUCCEEDED", + 8: "FAILED", + 9: "ABORTED", } var TransactionStatus_value = map[string]uint8{ @@ -158,10 +161,11 @@ var TransactionStatus_value = map[string]uint8{ "PENDING": 2, "RELAYING": 3, "SENT": 4, - "MINING": 5, - "SUCCEEDED": 6, - "FAILED": 7, - "ABORTED": 8, + "ERRORED": 5, + "MINING": 6, + "SUCCEEDED": 7, + "FAILED": 8, + "ABORTED": 9, } func (x TransactionStatus) String() string { @@ -479,7 +483,7 @@ type IntentTransaction struct { TxnMinedAt *time.Time `json:"txnMinedAt" db:"txn_mined_at,omitempty"` // Status of this specific transaction Status TransactionStatus `json:"status" db:"status"` - StatusReason *string `json:"statusReason" db:"status_reason,omitempty"` + StatusReason *string `json:"statusReason" db:"status_reason"` UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } From 57abf977abc5c450a6391368789157597f3cc69c Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:25:54 +0000 Subject: [PATCH 049/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index c942943a..17645cc8 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 14a0ef58105c745d01c3dadffec0f5a4274977b9 +// trails-api v1.0.0 3926f2d1e537951cf40a23f389d5e2fd67138d85 // -- // Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "14a0ef58105c745d01c3dadffec0f5a4274977b9" + return "3926f2d1e537951cf40a23f389d5e2fd67138d85" } // @@ -1681,6 +1681,7 @@ var ( ErrIntentStatus = WebRPCError{Code: 2004, Name: "IntentStatus", Message: "Invalid intent status", HTTPStatus: 422} ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} + ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} ) // From c1cb04c3e8a8172fb071b9bbc8f6c8076fd9332c Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:22:45 +0000 Subject: [PATCH 050/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 17645cc8..72fe820b 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ // trails-api v1.0.0 3926f2d1e537951cf40a23f389d5e2fd67138d85 // -- -// Code generated by webrpc-gen@v0.30.2 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.30.3 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=trails-api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -1690,7 +1690,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.30.2;gen-golang@v0.23.1;trails-api@v1.0.0" +const WebrpcHeaderValue = "webrpc@v0.30.3;gen-golang@v0.23.1;trails-api@v1.0.0" type WebrpcGenVersions struct { WebrpcGenVersion string From 867d9d9d6cb4fef4ebf904649446c1c97716abed Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:28:18 +0000 Subject: [PATCH 051/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 72fe820b..b8b66625 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1.0.0 3926f2d1e537951cf40a23f389d5e2fd67138d85 +// trails-api v1.0.0 fee069af4a29b91f817065c04fb874b290307d46 // -- // Code generated by webrpc-gen@v0.30.3 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "3926f2d1e537951cf40a23f389d5e2fd67138d85" + return "fee069af4a29b91f817065c04fb874b290307d46" } // @@ -833,10 +833,19 @@ type GetIntentReceiptResponse struct { // WaitIntentReceipt will block until the intent reaches a terminal status or timeout. type WaitIntentReceiptRequest struct { IntentID prototyp.Hash `json:"intentId"` + // lastReceiptStates is the previously returned status array from a prior + // WaitIntentReceipt call. This allows the server to only return + // updates since the last call, allowing for more efficient polling. + LastReceiptStates []TransactionStatus `json:"lastReceiptStates"` } type WaitIntentReceiptResponse struct { IntentReceipt *IntentReceipt `json:"intentReceipt"` + // receiptStates is an array of key statuses within the intentReceipt object + // for all sub intent transactions.this can be passed back to subsequent + // WaitIntentReceipt calls to as a form of a stateless cursor to only + // get updates since last call. + ReceiptStates []TransactionStatus `json:"receiptStates"` // done flag informs a client whether the wait completed successfully (true) or timed out (false). // as the clients will keep polling until done is true. NOTE: done does not indicate success, // it just indicates the execution is done, to check status see intentReceipt.status. From a2dce530fcd4da2ad90f0eeebe65270a4e2a81c0 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:59:39 +0000 Subject: [PATCH 052/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index b8b66625..c88dd07f 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ // trails-api v1.0.0 fee069af4a29b91f817065c04fb874b290307d46 // -- -// Code generated by webrpc-gen@v0.30.3 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.30.4 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=trails-api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -1699,7 +1699,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.30.3;gen-golang@v0.23.1;trails-api@v1.0.0" +const WebrpcHeaderValue = "webrpc@v0.30.4;gen-golang@v0.23.1;trails-api@v1.0.0" type WebrpcGenVersions struct { WebrpcGenVersion string From 059b59ceeabe073b68cad789a57ee6fde26a90bf Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:35:37 +0000 Subject: [PATCH 053/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index c88dd07f..910d03e0 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ -// trails-api v1.0.0 fee069af4a29b91f817065c04fb874b290307d46 +// trails-api v1-25.11.7-efaa43b 0a2ec431aa704fb3bb2b2b869fcd626960167c3a // -- -// Code generated by webrpc-gen@v0.30.4 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.31.0 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=trails-api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1.0.0" + return "v1-25.11.7-efaa43b" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "fee069af4a29b91f817065c04fb874b290307d46" + return "0a2ec431aa704fb3bb2b2b869fcd626960167c3a" } // @@ -1699,7 +1699,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.30.4;gen-golang@v0.23.1;trails-api@v1.0.0" +const WebrpcHeaderValue = "webrpc@v0.31.0;gen-golang@v0.23.1;trails-api@v1-25.11.7-efaa43b" type WebrpcGenVersions struct { WebrpcGenVersion string From 99b71f055357666ce59df060bde0d1ac34f288c0 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Sun, 9 Nov 2025 16:56:15 +0000 Subject: [PATCH 054/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 166 ++--------------------------------- 1 file changed, 6 insertions(+), 160 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 910d03e0..d80324ea 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ -// trails-api v1-25.11.7-efaa43b 0a2ec431aa704fb3bb2b2b869fcd626960167c3a +// trails-api v1-25.11.7+942fca0 2ec4d8f78c24fb9872fbd885e12a05c408fa9215 // -- -// Code generated by webrpc-gen@v0.31.0 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=trails-api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.7-efaa43b" + return "v1-25.11.7+942fca0" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "0a2ec431aa704fb3bb2b2b869fcd626960167c3a" + return "2ec4d8f78c24fb9872fbd885e12a05c408fa9215" } // @@ -912,101 +912,6 @@ type SortBy struct { Order SortOrder `json:"order"` } -var methods = map[string]method{ - "/rpc/Trails/Ping": { - name: "Ping", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/Version": { - name: "Version", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/RuntimeStatus": { - name: "RuntimeStatus", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/Clock": { - name: "Clock", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/QuoteIntent": { - name: "QuoteIntent", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/CommitIntent": { - name: "CommitIntent", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/ExecuteIntent": { - name: "ExecuteIntent", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/WaitIntentReceipt": { - name: "WaitIntentReceipt", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/GetIntentReceipt": { - name: "GetIntentReceipt", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/GetIntent": { - name: "GetIntent", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/SearchIntents": { - name: "SearchIntents", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/GetIntentTransactionHistory": { - name: "GetIntentTransactionHistory", - service: "Trails", - annotations: map[string]string{}, - }, - "/rpc/Trails/GetTokenPrices": { - name: "GetTokenPrices", - service: "Trails", - annotations: map[string]string{}, - }, -} - -func WebrpcMethods() map[string]method { - res := make(map[string]method, len(methods)) - for k, v := range methods { - res[k] = v - } - - return res -} - -var WebRPCServices = map[string][]string{ - "Trails": { - "Ping", - "Version", - "RuntimeStatus", - "Clock", - "QuoteIntent", - "CommitIntent", - "ExecuteIntent", - "WaitIntentReceipt", - "GetIntentReceipt", - "GetIntent", - "SearchIntents", - "GetIntentTransactionHistory", - "GetTokenPrices", - }, -} - // // Client // @@ -1378,29 +1283,6 @@ func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { // Webrpc helpers // -type method struct { - name string - service string - annotations map[string]string -} - -func (m method) Name() string { - return m.name -} - -func (m method) Service() string { - return m.service -} - -func (m method) Annotations() map[string]string { - res := make(map[string]string, len(m.annotations)) - for k, v := range m.annotations { - res[k] = v - } - - return res -} - type contextKey struct { name string } @@ -1410,41 +1292,9 @@ func (k *contextKey) String() string { } var ( - HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} // client - HTTPRequestCtxKey = &contextKey{"HTTPRequest"} // server - ServiceNameCtxKey = &contextKey{"ServiceName"} // server - MethodNameCtxKey = &contextKey{"MethodName"} // server + HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} ) -func ServiceNameFromContext(ctx context.Context) string { - service, _ := ctx.Value(ServiceNameCtxKey).(string) - return service -} - -func MethodNameFromContext(ctx context.Context) string { - method, _ := ctx.Value(MethodNameCtxKey).(string) - return method -} - -func RequestFromContext(ctx context.Context) *http.Request { - r, _ := ctx.Value(HTTPRequestCtxKey).(*http.Request) - return r -} - -func MethodCtx(ctx context.Context) (method, bool) { - req := RequestFromContext(ctx) - if req == nil { - return method{}, false - } - - m, ok := methods[req.URL.Path] - if !ok { - return method{}, false - } - - return m, true -} - // PtrTo is a useful helper when constructing values for optional fields. func PtrTo[T any](v T) *T { return &v } @@ -1693,13 +1543,9 @@ var ( ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} ) -// -// Webrpc -// - const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.0;gen-golang@v0.23.1;trails-api@v1-25.11.7-efaa43b" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.7+942fca0" type WebrpcGenVersions struct { WebrpcGenVersion string From 5f868caf874616ca0bf708cb6893d3fef5ee963f Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Sun, 9 Nov 2025 19:11:50 +0000 Subject: [PATCH 055/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index d80324ea..0dc9f6ff 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.7+942fca0 2ec4d8f78c24fb9872fbd885e12a05c408fa9215 +// trails-api v1-25.11.9+dc2c999 1f32374aeedc5c73f86a8ebd52823eec0e04f7e9 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.7+942fca0" + return "v1-25.11.9+dc2c999" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "2ec4d8f78c24fb9872fbd885e12a05c408fa9215" + return "1f32374aeedc5c73f86a8ebd52823eec0e04f7e9" } // @@ -1545,7 +1545,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.7+942fca0" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.9+dc2c999" type WebrpcGenVersions struct { WebrpcGenVersion string From 0a2f60e974386f90ba4c04b36993bfc3c9b53b45 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 10 Nov 2025 01:23:14 +0000 Subject: [PATCH 056/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 0dc9f6ff..e308c814 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.9+dc2c999 1f32374aeedc5c73f86a8ebd52823eec0e04f7e9 +// trails-api v1-25.11.10+b0f163f 42e7f689fc0917f3cdbf0908e03bdc04412ac0a0 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.9+dc2c999" + return "v1-25.11.10+b0f163f" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "1f32374aeedc5c73f86a8ebd52823eec0e04f7e9" + return "42e7f689fc0917f3cdbf0908e03bdc04412ac0a0" } // @@ -302,7 +302,8 @@ type QuoteIntentRequest struct { } type QuoteIntentRequestOptions struct { - QuoteProvider *QuoteProviderType `json:"quoteProvider,omitempty"` + // Temporary: using string until proper enum is specified. + QuoteProvider *string `json:"quoteProvider,omitempty"` SlippageTolerance *float64 `json:"slippageTolerance,omitempty"` TrailsAddressOverrides *TrailsAddressOverrides `json:"trailsAddressOverrides,omitempty"` } @@ -1545,7 +1546,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.9+dc2c999" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+b0f163f" type WebrpcGenVersions struct { WebrpcGenVersion string From fc56dc1da01de6c956d26ed53e4ce03435bcf4c0 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 10 Nov 2025 01:31:59 +0000 Subject: [PATCH 057/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index e308c814..d209a3d1 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.10+b0f163f 42e7f689fc0917f3cdbf0908e03bdc04412ac0a0 +// trails-api v1-25.11.10+4986c15b 62cc16eba4b94287678a2959a876da21baeca437 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.10+b0f163f" + return "v1-25.11.10+4986c15b" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "42e7f689fc0917f3cdbf0908e03bdc04412ac0a0" + return "62cc16eba4b94287678a2959a876da21baeca437" } // @@ -1546,7 +1546,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+b0f163f" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+4986c15b" type WebrpcGenVersions struct { WebrpcGenVersion string From 94f3155650bb0822dece0d17370bf60ad22f1967 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:23:09 +0000 Subject: [PATCH 058/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index d209a3d1..ddd6e173 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.10+4986c15b 62cc16eba4b94287678a2959a876da21baeca437 +// trails-api v1-25.11.10+4986c15 8407d99deb0d05ae72dbc61512273b5f233a2f2f // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.10+4986c15b" + return "v1-25.11.10+4986c15" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "62cc16eba4b94287678a2959a876da21baeca437" + return "8407d99deb0d05ae72dbc61512273b5f233a2f2f" } // @@ -866,7 +866,7 @@ type GetIntentResponse struct { // We do not return 'solved' status intents here, only committed/executed/failed/succeeded. type SearchIntentsRequest struct { ByIntentID prototyp.Hash `json:"byIntentId"` - ByProjectID *uint64 `json:"byProjectId"` + ByProjectID uint64 `json:"byProjectId"` ByTransactionHash prototyp.Hash `json:"byTransactionHash"` ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` @@ -882,7 +882,7 @@ type GetIntentTransactionHistoryRequest struct { // cursor paging parameters Page *Page `json:"page"` // optional project id scope filter - ByProjectID *uint64 `json:"byProjectId"` + ByProjectID uint64 `json:"byProjectId"` ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` } @@ -1546,7 +1546,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+4986c15b" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+4986c15" type WebrpcGenVersions struct { WebrpcGenVersion string From 91103e3a896a3e6ef763bf2d639e629d8576c0e7 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:48:22 +0000 Subject: [PATCH 059/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index ddd6e173..b2f81a6c 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.10+4986c15 8407d99deb0d05ae72dbc61512273b5f233a2f2f +// trails-api v1-25.11.10+50cc6ba e57425747f67b5ac795974a854b7968476d7a00d // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.10+4986c15" + return "v1-25.11.10+50cc6ba" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "8407d99deb0d05ae72dbc61512273b5f233a2f2f" + return "e57425747f67b5ac795974a854b7968476d7a00d" } // @@ -865,11 +865,12 @@ type GetIntentResponse struct { // SearchIntents searches past intents based on filters. // We do not return 'solved' status intents here, only committed/executed/failed/succeeded. type SearchIntentsRequest struct { - ByIntentID prototyp.Hash `json:"byIntentId"` - ByProjectID uint64 `json:"byProjectId"` - ByTransactionHash prototyp.Hash `json:"byTransactionHash"` - ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` - ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` + ByIntentID prototyp.Hash `json:"byIntentId"` + ByProjectID uint64 `json:"byProjectId"` + ByTransactionHash prototyp.Hash `json:"byTransactionHash"` + ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` + ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` + ByDestinationIntentAddress prototyp.Hash `json:"byDestinationIntentAddress"` } type SearchIntentsResponse struct { @@ -1546,7 +1547,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+4986c15" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+50cc6ba" type WebrpcGenVersions struct { WebrpcGenVersion string From b09dc0393b860fc270d37a456243031f49787f9a Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:51:25 +0000 Subject: [PATCH 060/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index b2f81a6c..03227ac7 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.10+50cc6ba e57425747f67b5ac795974a854b7968476d7a00d +// trails-api v1-25.11.11+3974438 5bcc23aa3d68ad164816b32b7b20548298c8d9b0 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.10+50cc6ba" + return "v1-25.11.11+3974438" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "e57425747f67b5ac795974a854b7968476d7a00d" + return "5bcc23aa3d68ad164816b32b7b20548298c8d9b0" } // @@ -297,6 +297,10 @@ type QuoteIntentRequest struct { // tradeType indicates whether the trade is an exact input or exact output trade. // EXACT_OUTPUT is the default if unspecified. TradeType *TradeType `json:"tradeType,omitempty"` + // onlyNativeGasFee indicates that only the native gas fee (ie. eth) + // option will be returned, even if the user has no balance. + // this option is useful for smart wallets which have their own gas abstraction. + OnlyNativeGasFee *bool `json:"onlyNativeGasFee,omitempty"` // options for additional auxiliary params Options *QuoteIntentRequestOptions `json:"options,omitempty"` } @@ -1547,7 +1551,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+50cc6ba" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+3974438" type WebrpcGenVersions struct { WebrpcGenVersion string From 00bfcff0e819347878799ccdb852cdf5b0876984 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:06:36 +0000 Subject: [PATCH 061/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 03227ac7..feb3d18b 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.11+3974438 5bcc23aa3d68ad164816b32b7b20548298c8d9b0 +// trails-api v1-25.11.11+c55fecd5 2bcff18361635c52a47c47c9917168cdcce65834 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.11+3974438" + return "v1-25.11.11+c55fecd5" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "5bcc23aa3d68ad164816b32b7b20548298c8d9b0" + return "2bcff18361635c52a47c47c9917168cdcce65834" } // @@ -300,7 +300,7 @@ type QuoteIntentRequest struct { // onlyNativeGasFee indicates that only the native gas fee (ie. eth) // option will be returned, even if the user has no balance. // this option is useful for smart wallets which have their own gas abstraction. - OnlyNativeGasFee *bool `json:"onlyNativeGasFee,omitempty"` + OnlyNativeGasFee bool `json:"onlyNativeGasFee,omitempty"` // options for additional auxiliary params Options *QuoteIntentRequestOptions `json:"options,omitempty"` } @@ -1551,7 +1551,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+3974438" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+c55fecd5" type WebrpcGenVersions struct { WebrpcGenVersion string From ea6cf4ba56c5aa98bafb51f1824763324702c406 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:40:55 +0000 Subject: [PATCH 062/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 53 ++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index feb3d18b..5bc23c01 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.11+c55fecd5 2bcff18361635c52a47c47c9917168cdcce65834 +// trails-api v1-25.11.10+0ef1bad 3fa9de480a3b42fe8129f714bab4fc452e9d4514 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.11+c55fecd5" + return "v1-25.11.10+0ef1bad" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "2bcff18361635c52a47c47c9917168cdcce65834" + return "3fa9de480a3b42fe8129f714bab4fc452e9d4514" } // @@ -285,11 +285,11 @@ type QuoteIntentRequest struct { OriginChainID uint64 `json:"originChainId"` OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` // destination chain, token, and execution details - DestinationChainID uint64 `json:"destinationChainId"` - DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` - DestinationToAddress prototyp.Hash `json:"destinationToAddress"` - DestinationCallData *string `json:"destinationCallData"` - DestinationCallValue *string `json:"destinationCallValue"` + DestinationChainID uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress"` + DestinationCallData *string `json:"destinationCallData"` + DestinationCallValue *prototyp.BigInt `json:"destinationCallValue"` // originTokenAmount is used with EXACT_INPUT txns OriginTokenAmount *prototyp.BigInt `json:"originTokenAmount"` // destinationTokenAmount is used with EXACT_OUTPUT txns @@ -331,20 +331,25 @@ type Intent struct { Status IntentStatus `json:"status" db:"status,omitempty"` QuoteRequest *QuoteIntentRequest `json:"quoteRequest" db:"quote_request"` // intent owner / main signer - OwnerAddress prototyp.Hash `json:"ownerAddress" db:"owner_address"` - OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"orig_intent_address"` - DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress" db:"dest_intent_address"` - DestinationSalt prototyp.BigInt `json:"destinationSalt" db:"destination_salt"` - DepositTransaction *DepositTransaction `json:"depositTransaction" db:"deposit_txn"` - Calls []*IntentCalls `json:"calls" db:"calls"` - Preconditions []*TransactionPrecondition `json:"preconditions" db:"preconditions"` - MetaTxns []*MetaTxn `json:"metaTxns" db:"meta_txns"` - Quote *IntentProviderQuote `json:"quote" db:"quote"` - Fees *IntentFees `json:"fees" db:"fees"` - TrailsVersion string `json:"trailsVersion" db:"trails_version"` - ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + OwnerAddress prototyp.Hash `json:"ownerAddress" db:"owner_address"` + OriginChainID uint64 `json:"originChainId" db:"orig_chain_id"` + DestinationChainID uint64 `json:"destinationChainId" db:"dest_chain_id"` + OriginIntentAddress prototyp.Hash `json:"originIntentAddress" db:"orig_intent_address"` + DestinationIntentAddress *prototyp.Hash `json:"destinationIntentAddress,omitempty" db:"dest_intent_address,omitempty"` + Salt prototyp.BigInt `json:"salt" db:"salt"` + DepositTransaction *DepositTransaction `json:"depositTransaction" db:"deposit_txn"` + OriginCalls *IntentCalls `json:"originCalls" db:"orig_calls"` + DestinationCalls *IntentCalls `json:"destinationCalls,omitempty" db:"dest_calls,omitempty"` + OriginPrecondition *TransactionPrecondition `json:"originPrecondition" db:"orig_precondition"` + DestinationPrecondition *TransactionPrecondition `json:"destinationPrecondition,omitempty" db:"dest_precondition,omitempty"` + OriginMetaTxn *MetaTxn `json:"originMetaTxn" db:"orig_meta_txn"` + DestinationMetaTxn *MetaTxn `json:"destinationMetaTxn,omitempty" db:"dest_meta_txn,omitempty"` + Quote *IntentProviderQuote `json:"quote" db:"quote"` + Fees *IntentFees `json:"fees" db:"fees"` + TrailsVersion string `json:"trailsVersion" db:"trails_version"` + ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // DepositTransaction represents a deposit transfer transaction of the token amount @@ -515,7 +520,7 @@ type IntentProviderQuote struct { type IntentFees struct { // gas fees on origin and destination chains OriginGas *IntentTransactionGasFee `json:"originGas"` - DestinationGas *IntentTransactionGasFee `json:"destinationGas"` + DestinationGas *IntentTransactionGasFee `json:"destinationGas,omitempty"` // provider fees (swap + bridge + trails) Provider *IntentProviderFees `json:"provider"` // total fees including provider fees + gas fees @@ -1551,7 +1556,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+c55fecd5" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+0ef1bad" type WebrpcGenVersions struct { WebrpcGenVersion string From c52b6d0ab9242fccdb05a9f1ebd4589fa52d5fd1 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 11 Nov 2025 14:26:29 +0000 Subject: [PATCH 063/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 5bc23c01..05695c21 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.10+0ef1bad 3fa9de480a3b42fe8129f714bab4fc452e9d4514 +// trails-api v1-25.11.11+1d06160 15a812f58abc2c95e2e189e0310dacd0596a7508 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.10+0ef1bad" + return "v1-25.11.11+1d06160" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "3fa9de480a3b42fe8129f714bab4fc452e9d4514" + return "15a812f58abc2c95e2e189e0310dacd0596a7508" } // @@ -1556,7 +1556,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.10+0ef1bad" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+1d06160" type WebrpcGenVersions struct { WebrpcGenVersion string From fe33d5d72b0d7371be21d4a7185e2089775dd1a5 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 11 Nov 2025 14:39:26 +0000 Subject: [PATCH 064/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 05695c21..081591fb 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.11+1d06160 15a812f58abc2c95e2e189e0310dacd0596a7508 +// trails-api v1-25.11.11+1d06160 ee5748afd93083a1de8eba307efcad35285cd8c6 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "15a812f58abc2c95e2e189e0310dacd0596a7508" + return "ee5748afd93083a1de8eba307efcad35285cd8c6" } // @@ -339,11 +339,11 @@ type Intent struct { Salt prototyp.BigInt `json:"salt" db:"salt"` DepositTransaction *DepositTransaction `json:"depositTransaction" db:"deposit_txn"` OriginCalls *IntentCalls `json:"originCalls" db:"orig_calls"` - DestinationCalls *IntentCalls `json:"destinationCalls,omitempty" db:"dest_calls,omitempty"` + DestinationCalls *IntentCalls `json:"destinationCalls" db:"dest_calls,omitempty"` OriginPrecondition *TransactionPrecondition `json:"originPrecondition" db:"orig_precondition"` - DestinationPrecondition *TransactionPrecondition `json:"destinationPrecondition,omitempty" db:"dest_precondition,omitempty"` + DestinationPrecondition *TransactionPrecondition `json:"destinationPrecondition" db:"dest_precondition,omitempty"` OriginMetaTxn *MetaTxn `json:"originMetaTxn" db:"orig_meta_txn"` - DestinationMetaTxn *MetaTxn `json:"destinationMetaTxn,omitempty" db:"dest_meta_txn,omitempty"` + DestinationMetaTxn *MetaTxn `json:"destinationMetaTxn" db:"dest_meta_txn,omitempty"` Quote *IntentProviderQuote `json:"quote" db:"quote"` Fees *IntentFees `json:"fees" db:"fees"` TrailsVersion string `json:"trailsVersion" db:"trails_version"` From 8b9b2a18e347e6fa666f16b9fa8b6d3901c027bc Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 11 Nov 2025 15:01:51 +0000 Subject: [PATCH 065/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 081591fb..f7c795b2 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.11+1d06160 ee5748afd93083a1de8eba307efcad35285cd8c6 +// trails-api v1-25.11.11+5874e69 33a6141c3a06d537a04fb28c7629368b534dfeba // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.11+1d06160" + return "v1-25.11.11+5874e69" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "ee5748afd93083a1de8eba307efcad35285cd8c6" + return "33a6141c3a06d537a04fb28c7629368b534dfeba" } // @@ -520,7 +520,7 @@ type IntentProviderQuote struct { type IntentFees struct { // gas fees on origin and destination chains OriginGas *IntentTransactionGasFee `json:"originGas"` - DestinationGas *IntentTransactionGasFee `json:"destinationGas,omitempty"` + DestinationGas *IntentTransactionGasFee `json:"destinationGas"` // provider fees (swap + bridge + trails) Provider *IntentProviderFees `json:"provider"` // total fees including provider fees + gas fees @@ -1556,7 +1556,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+1d06160" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+5874e69" type WebrpcGenVersions struct { WebrpcGenVersion string From b44421edae32365d93c5fbfbdcd53e5287eb8b01 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 12 Nov 2025 15:45:41 +0000 Subject: [PATCH 066/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index f7c795b2..fc43d632 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.11+5874e69 33a6141c3a06d537a04fb28c7629368b534dfeba +// trails-api v1-25.11.11+c8ddd1e ebd89d95e8dd3b22ad108ccc213058b6ac9813cb // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.11+5874e69" + return "v1-25.11.11+c8ddd1e" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "33a6141c3a06d537a04fb28c7629368b534dfeba" + return "ebd89d95e8dd3b22ad108ccc213058b6ac9813cb" } // @@ -1556,7 +1556,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+5874e69" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+c8ddd1e" type WebrpcGenVersions struct { WebrpcGenVersion string From 5e62ddc90a60a992e1783a96df4bed861dcc4c6b Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 12 Nov 2025 18:22:31 +0000 Subject: [PATCH 067/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index fc43d632..1b90c337 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.11+c8ddd1e ebd89d95e8dd3b22ad108ccc213058b6ac9813cb +// trails-api v1-25.11.12+c88b9c0 7869f7a0c44bf437072d8f1dfabd3a80677eed64 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.11+c8ddd1e" + return "v1-25.11.12+c88b9c0" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "ebd89d95e8dd3b22ad108ccc213058b6ac9813cb" + return "7869f7a0c44bf437072d8f1dfabd3a80677eed64" } // @@ -1556,7 +1556,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.11+c8ddd1e" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.12+c88b9c0" type WebrpcGenVersions struct { WebrpcGenVersion string From 593f68359ef9b0aace7a59d2174e9c5665e0f519 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 12 Nov 2025 19:44:24 +0000 Subject: [PATCH 068/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 1b90c337..982ef556 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.12+c88b9c0 7869f7a0c44bf437072d8f1dfabd3a80677eed64 +// trails-api v1-25.11.12+c88b9c0 77487fbe9b45851805b54a57305e7cc263d06e94 // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "7869f7a0c44bf437072d8f1dfabd3a80677eed64" + return "77487fbe9b45851805b54a57305e7cc263d06e94" } // @@ -675,6 +675,7 @@ type FeeOption struct { Amount prototyp.BigInt `json:"amount"` AmountUSD float64 `json:"amountUsd"` FeeCollectorAddress prototyp.Hash `json:"feeCollectorAddress"` + Is2612 bool `json:"is2612"` } // DepositSignature contains all gasless deposit signature parameters for ExecuteIntent From 00c00064111a6728851d959ea7b2d193549ce2ff Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 13 Nov 2025 12:06:42 +0000 Subject: [PATCH 069/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 982ef556..78574dc8 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.12+c88b9c0 77487fbe9b45851805b54a57305e7cc263d06e94 +// trails-api v1-25.11.12+a2db2be7 20fe3d1792b8766e384c5b93e4799b7c699cd8bd // -- // Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.12+c88b9c0" + return "v1-25.11.12+a2db2be7" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "77487fbe9b45851805b54a57305e7cc263d06e94" + return "20fe3d1792b8766e384c5b93e4799b7c699cd8bd" } // @@ -1557,7 +1557,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.12+c88b9c0" +const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.12+a2db2be7" type WebrpcGenVersions struct { WebrpcGenVersion string From 5118c4553eabe48658ead66d99065ad341d1d6c0 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 13 Nov 2025 14:30:51 +0000 Subject: [PATCH 070/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 78574dc8..4f7ac757 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,6 +1,6 @@ -// trails-api v1-25.11.12+a2db2be7 20fe3d1792b8766e384c5b93e4799b7c699cd8bd +// trails-api v1-25.11.12+a2db2be d024aae789605a58dbcd47182738ca7da6eda4f2 // -- -// Code generated by webrpc-gen@v0.31.1 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=trails-api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go package api @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.12+a2db2be7" + return "v1-25.11.12+a2db2be" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "20fe3d1792b8766e384c5b93e4799b7c699cd8bd" + return "d024aae789605a58dbcd47182738ca7da6eda4f2" } // @@ -1557,7 +1557,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.1;gen-golang@v0.23.3;trails-api@v1-25.11.12+a2db2be7" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.12+a2db2be" type WebrpcGenVersions struct { WebrpcGenVersion string From 249d237552f13329eb1e19e74c94a43b7c3c468a Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:14:55 +0000 Subject: [PATCH 071/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 4f7ac757..4315e595 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.12+a2db2be d024aae789605a58dbcd47182738ca7da6eda4f2 +// trails-api v1-25.11.14+2870fe3 dd49aae875015647f45fa67679fc346b0abbb43b // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.12+a2db2be" + return "v1-25.11.14+2870fe3" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "d024aae789605a58dbcd47182738ca7da6eda4f2" + return "dd49aae875015647f45fa67679fc346b0abbb43b" } // @@ -908,9 +908,9 @@ type Page struct { // Cursor: column to compare before/after to Column *string `json:"column,omitempty"` // Cursor: return column < before - include to get previous page - Before *interface{} `json:"before,omitempty"` + Before *uint64 `json:"before,omitempty"` // Cursor: return column > after - include to get next page - After *interface{} `json:"after,omitempty"` + After *uint64 `json:"after,omitempty"` // Sorting filter Sort []*SortBy `json:"sort,omitempty"` // Number of items per page @@ -1557,7 +1557,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.12+a2db2be" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.14+2870fe3" type WebrpcGenVersions struct { WebrpcGenVersion string From 5049e150615157f1518699cfa4ebcc4dd8c74b93 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 17 Nov 2025 12:38:22 +0000 Subject: [PATCH 072/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 65 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 4315e595..bbfdfd9c 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.14+2870fe3 dd49aae875015647f45fa67679fc346b0abbb43b +// trails-api v1-25.11.14+9db63bbe 907e9a4690aa7181864692baa21f0728a832801d // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.14+2870fe3" + return "v1-25.11.14+9db63bbe" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "dd49aae875015647f45fa67679fc346b0abbb43b" + return "907e9a4690aa7181864692baa21f0728a832801d" } // @@ -1525,39 +1525,40 @@ var ( // Schema errors var ( - ErrUnauthorized = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401} - ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} - ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} - ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} - ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} - ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} - ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} - ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} - ErrProjectNotFound = WebRPCError{Code: 1008, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} - ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} - ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} - ErrInvalidOrigin = WebRPCError{Code: 1103, Name: "InvalidOrigin", Message: "Invalid origin for Access Key", HTTPStatus: 403} - ErrInvalidService = WebRPCError{Code: 1104, Name: "InvalidService", Message: "Service not enabled for Access key", HTTPStatus: 403} - ErrUnauthorizedUser = WebRPCError{Code: 1105, Name: "UnauthorizedUser", Message: "Unauthorized user", HTTPStatus: 403} - ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota request exceeded", HTTPStatus: 429} - ErrQuotaRateLimit = WebRPCError{Code: 1201, Name: "QuotaRateLimit", Message: "Quota rate limit exceeded", HTTPStatus: 429} - ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} - ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} - ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} - ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} - ErrInvalidArgument = WebRPCError{Code: 2000, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} - ErrUnexpected = WebRPCError{Code: 2001, Name: "Unexpected", Message: "Unexpected server error", HTTPStatus: 500} - ErrUnavailable = WebRPCError{Code: 2002, Name: "Unavailable", Message: "Unavailable resource", HTTPStatus: 400} - ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} - ErrIntentStatus = WebRPCError{Code: 2004, Name: "IntentStatus", Message: "Invalid intent status", HTTPStatus: 422} - ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} - ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} - ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} + ErrUnauthorized = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401} + ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} + ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} + ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} + ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} + ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} + ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} + ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} + ErrProjectNotFound = WebRPCError{Code: 1008, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} + ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} + ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} + ErrInvalidOrigin = WebRPCError{Code: 1103, Name: "InvalidOrigin", Message: "Invalid origin for Access Key", HTTPStatus: 403} + ErrInvalidService = WebRPCError{Code: 1104, Name: "InvalidService", Message: "Service not enabled for Access key", HTTPStatus: 403} + ErrUnauthorizedUser = WebRPCError{Code: 1105, Name: "UnauthorizedUser", Message: "Unauthorized user", HTTPStatus: 403} + ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota request exceeded", HTTPStatus: 429} + ErrQuotaRateLimit = WebRPCError{Code: 1201, Name: "QuotaRateLimit", Message: "Quota rate limit exceeded", HTTPStatus: 429} + ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} + ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} + ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} + ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} + ErrInvalidArgument = WebRPCError{Code: 2000, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} + ErrUnexpected = WebRPCError{Code: 2001, Name: "Unexpected", Message: "Unexpected server error", HTTPStatus: 500} + ErrUnavailable = WebRPCError{Code: 2002, Name: "Unavailable", Message: "Unavailable resource", HTTPStatus: 400} + ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} + ErrIntentStatus = WebRPCError{Code: 2004, Name: "IntentStatus", Message: "Invalid intent status", HTTPStatus: 422} + ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} + ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} + ErrIntentsSameChainNative = WebRPCError{Code: 7000, Name: "IntentsSameChainNative", Message: "Intents skipped as client is attempting same-chain native transaction", HTTPStatus: 400} + ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} ) const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.14+2870fe3" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.14+9db63bbe" type WebrpcGenVersions struct { WebrpcGenVersion string From 0d63f7e359e59f3941bb509d37adad87899836b0 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 17 Nov 2025 14:25:59 +0000 Subject: [PATCH 073/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index bbfdfd9c..bbda370f 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.14+9db63bbe 907e9a4690aa7181864692baa21f0728a832801d +// trails-api v1-25.11.17+51cfdb6 cf968b928496f39525fd4980f5aa06a2561ef20b // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.14+9db63bbe" + return "v1-25.11.17+51cfdb6" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "907e9a4690aa7181864692baa21f0728a832801d" + return "cf968b928496f39525fd4980f5aa06a2561ef20b" } // @@ -1525,40 +1525,40 @@ var ( // Schema errors var ( - ErrUnauthorized = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401} - ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} - ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} - ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} - ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} - ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} - ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} - ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} - ErrProjectNotFound = WebRPCError{Code: 1008, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} - ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} - ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} - ErrInvalidOrigin = WebRPCError{Code: 1103, Name: "InvalidOrigin", Message: "Invalid origin for Access Key", HTTPStatus: 403} - ErrInvalidService = WebRPCError{Code: 1104, Name: "InvalidService", Message: "Service not enabled for Access key", HTTPStatus: 403} - ErrUnauthorizedUser = WebRPCError{Code: 1105, Name: "UnauthorizedUser", Message: "Unauthorized user", HTTPStatus: 403} - ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota request exceeded", HTTPStatus: 429} - ErrQuotaRateLimit = WebRPCError{Code: 1201, Name: "QuotaRateLimit", Message: "Quota rate limit exceeded", HTTPStatus: 429} - ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} - ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} - ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} - ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} - ErrInvalidArgument = WebRPCError{Code: 2000, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} - ErrUnexpected = WebRPCError{Code: 2001, Name: "Unexpected", Message: "Unexpected server error", HTTPStatus: 500} - ErrUnavailable = WebRPCError{Code: 2002, Name: "Unavailable", Message: "Unavailable resource", HTTPStatus: 400} - ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} - ErrIntentStatus = WebRPCError{Code: 2004, Name: "IntentStatus", Message: "Invalid intent status", HTTPStatus: 422} - ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} - ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} - ErrIntentsSameChainNative = WebRPCError{Code: 7000, Name: "IntentsSameChainNative", Message: "Intents skipped as client is attempting same-chain native transaction", HTTPStatus: 400} - ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} + ErrUnauthorized = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401} + ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} + ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} + ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} + ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} + ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} + ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} + ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} + ErrProjectNotFound = WebRPCError{Code: 1008, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} + ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} + ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} + ErrInvalidOrigin = WebRPCError{Code: 1103, Name: "InvalidOrigin", Message: "Invalid origin for Access Key", HTTPStatus: 403} + ErrInvalidService = WebRPCError{Code: 1104, Name: "InvalidService", Message: "Service not enabled for Access key", HTTPStatus: 403} + ErrUnauthorizedUser = WebRPCError{Code: 1105, Name: "UnauthorizedUser", Message: "Unauthorized user", HTTPStatus: 403} + ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota request exceeded", HTTPStatus: 429} + ErrQuotaRateLimit = WebRPCError{Code: 1201, Name: "QuotaRateLimit", Message: "Quota rate limit exceeded", HTTPStatus: 429} + ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} + ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} + ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} + ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} + ErrInvalidArgument = WebRPCError{Code: 2000, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} + ErrUnexpected = WebRPCError{Code: 2001, Name: "Unexpected", Message: "Unexpected server error", HTTPStatus: 500} + ErrUnavailable = WebRPCError{Code: 2002, Name: "Unavailable", Message: "Unavailable resource", HTTPStatus: 400} + ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} + ErrIntentStatus = WebRPCError{Code: 2004, Name: "IntentStatus", Message: "Invalid intent status", HTTPStatus: 422} + ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} + ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} + ErrIntentsSkipped = WebRPCError{Code: 7000, Name: "IntentsSkipped", Message: "Intents skipped as client is attempting a transaction that does not require intents", HTTPStatus: 400} + ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} ) const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.14+9db63bbe" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+51cfdb6" type WebrpcGenVersions struct { WebrpcGenVersion string From 2d795b632e050b360296585a7ef6b0adb636be34 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:06:53 +0000 Subject: [PATCH 074/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 214 +++++++++++++++++++++++++---------- 1 file changed, 157 insertions(+), 57 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index bbda370f..798646c4 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.17+51cfdb6 cf968b928496f39525fd4980f5aa06a2561ef20b +// trails-api v1-25.11.17+6c3ddd8 2c3a1c45813a5ccce3a074e7d7b8d99723b527d0 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.17+51cfdb6" + return "v1-25.11.17+6c3ddd8" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "cf968b928496f39525fd4980f5aa06a2561ef20b" + return "2c3a1c45813a5ccce3a074e7d7b8d99723b527d0" } // @@ -118,6 +118,155 @@ func (x *QuoteProviderType) Is(values ...QuoteProviderType) bool { return false } +type IntentStatus uint8 + +const ( + IntentStatus_QUOTED IntentStatus = 0 + IntentStatus_COMMITTED IntentStatus = 1 + IntentStatus_EXECUTING IntentStatus = 2 + IntentStatus_FAILED IntentStatus = 3 + IntentStatus_SUCCEEDED IntentStatus = 4 +) + +var IntentStatus_name = map[uint8]string{ + 0: "QUOTED", + 1: "COMMITTED", + 2: "EXECUTING", + 3: "FAILED", + 4: "SUCCEEDED", +} + +var IntentStatus_value = map[string]uint8{ + "QUOTED": 0, + "COMMITTED": 1, + "EXECUTING": 2, + "FAILED": 3, + "SUCCEEDED": 4, +} + +func (x IntentStatus) String() string { + return IntentStatus_name[uint8(x)] +} + +func (x IntentStatus) MarshalText() ([]byte, error) { + return []byte(IntentStatus_name[uint8(x)]), nil +} + +func (x *IntentStatus) UnmarshalText(b []byte) error { + *x = IntentStatus(IntentStatus_value[string(b)]) + return nil +} + +func (x *IntentStatus) Is(values ...IntentStatus) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type TransactionType uint8 + +const ( + TransactionType_UNKNOWN TransactionType = 0 + // Initial token transfer from owner to origin intent address on origin chain, funding the intent execution. + TransactionType_DEPOSIT TransactionType = 1 + // Origin chain transaction executing intent's origin calls (swaps, bridge preparation, token transfers). + TransactionType_ORIGIN TransactionType = 2 + // Destination chain transaction executing intent's destination calls (receiving bridged tokens, final swaps/transfers). + TransactionType_DESTINATION TransactionType = 3 + // Route provider transaction, see TransactionContext for more details. + TransactionType_ROUTE TransactionType = 4 +) + +var TransactionType_name = map[uint8]string{ + 0: "UNKNOWN", + 1: "DEPOSIT", + 2: "ORIGIN", + 3: "DESTINATION", + 4: "ROUTE", +} + +var TransactionType_value = map[string]uint8{ + "UNKNOWN": 0, + "DEPOSIT": 1, + "ORIGIN": 2, + "DESTINATION": 3, + "ROUTE": 4, +} + +func (x TransactionType) String() string { + return TransactionType_name[uint8(x)] +} + +func (x TransactionType) MarshalText() ([]byte, error) { + return []byte(TransactionType_name[uint8(x)]), nil +} + +func (x *TransactionType) UnmarshalText(b []byte) error { + *x = TransactionType(TransactionType_value[string(b)]) + return nil +} + +func (x *TransactionType) Is(values ...TransactionType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type TransactionContext uint8 + +const ( + TransactionContext_NONE TransactionContext = 0 + // Relays Circle's attested CCTP burn message to destination chain, verifying attestation and minting USDC. + TransactionContext_CCTPV2_MESSAGE TransactionContext = 1 +) + +var TransactionContext_name = map[uint8]string{ + 0: "NONE", + 1: "CCTPV2_MESSAGE", +} + +var TransactionContext_value = map[string]uint8{ + "NONE": 0, + "CCTPV2_MESSAGE": 1, +} + +func (x TransactionContext) String() string { + return TransactionContext_name[uint8(x)] +} + +func (x TransactionContext) MarshalText() ([]byte, error) { + return []byte(TransactionContext_name[uint8(x)]), nil +} + +func (x *TransactionContext) UnmarshalText(b []byte) error { + *x = TransactionContext(TransactionContext_value[string(b)]) + return nil +} + +func (x *TransactionContext) Is(values ...TransactionContext) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type TransactionStatus uint8 const ( @@ -193,57 +342,6 @@ func (x *TransactionStatus) Is(values ...TransactionStatus) bool { return false } -type IntentStatus uint8 - -const ( - IntentStatus_QUOTED IntentStatus = 0 - IntentStatus_COMMITTED IntentStatus = 1 - IntentStatus_EXECUTING IntentStatus = 2 - IntentStatus_FAILED IntentStatus = 3 - IntentStatus_SUCCEEDED IntentStatus = 4 -) - -var IntentStatus_name = map[uint8]string{ - 0: "QUOTED", - 1: "COMMITTED", - 2: "EXECUTING", - 3: "FAILED", - 4: "SUCCEEDED", -} - -var IntentStatus_value = map[string]uint8{ - "QUOTED": 0, - "COMMITTED": 1, - "EXECUTING": 2, - "FAILED": 3, - "SUCCEEDED": 4, -} - -func (x IntentStatus) String() string { - return IntentStatus_name[uint8(x)] -} - -func (x IntentStatus) MarshalText() ([]byte, error) { - return []byte(IntentStatus_name[uint8(x)]), nil -} - -func (x *IntentStatus) UnmarshalText(b []byte) error { - *x = IntentStatus(IntentStatus_value[string(b)]) - return nil -} - -func (x *IntentStatus) Is(values ...IntentStatus) bool { - if x == nil { - return false - } - for _, v := range values { - if *x == v { - return true - } - } - return false -} - type ChainGasUsageStatus string const ( @@ -472,8 +570,10 @@ type IntentTransaction struct { // Intent id this transaction is associated with IntentID prototyp.Hash `json:"intentId" db:"intent_id"` // Chain where this transaction executes - ChainID uint64 `json:"chainId" db:"chain_id"` - FromAddress prototyp.Hash `json:"fromAddress" db:"from_address"` + ChainID uint64 `json:"chainId" db:"chain_id"` + Type TransactionType `json:"type" db:"type"` + Context TransactionContext `json:"context" db:"context"` + FromAddress prototyp.Hash `json:"fromAddress" db:"from_address"` // ie. originIntentAddress, TrailsRouter, or TrailsIntentEntrypoint ToAddress prototyp.Hash `json:"toAddress" db:"to_address"` // Token being transferred in this transaction @@ -1558,7 +1658,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+51cfdb6" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+6c3ddd8" type WebrpcGenVersions struct { WebrpcGenVersion string From 970ec675539557d00d450bcbc28f48dce1a435ab Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:17:04 +0000 Subject: [PATCH 075/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 798646c4..2edc7c23 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.17+6c3ddd8 2c3a1c45813a5ccce3a074e7d7b8d99723b527d0 +// trails-api v1-25.11.17+822fb49 cb1f8c28a73c79a0ae2436bad0e1206f204bc835 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.17+6c3ddd8" + return "v1-25.11.17+822fb49" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "2c3a1c45813a5ccce3a074e7d7b8d99723b527d0" + return "cb1f8c28a73c79a0ae2436bad0e1206f204bc835" } // @@ -1658,7 +1658,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+6c3ddd8" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+822fb49" type WebrpcGenVersions struct { WebrpcGenVersion string From 71c4d54e13da0baf18e44bbc0a92a0b4f5cdc0ac Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 20 Nov 2025 23:12:45 +0000 Subject: [PATCH 076/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 251 ++++++++++++++++++++++++++++++++--- 1 file changed, 232 insertions(+), 19 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 2edc7c23..fc6539fc 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.17+822fb49 cb1f8c28a73c79a0ae2436bad0e1206f204bc835 +// trails-api v1-25.11.17+25340a94 6d939222fe9ec82e442ef3a769f80523fe7603bc // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.17+822fb49" + return "v1-25.11.17+25340a94" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "cb1f8c28a73c79a0ae2436bad0e1206f204bc835" + return "6d939222fe9ec82e442ef3a769f80523fe7603bc" } // @@ -54,7 +54,42 @@ type TrailsClient interface { GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) - GetTokenPrices(ctx context.Context, tokens []*Token) ([]*TokenPrice, error) + // GetChains will return the list of supported chains by Trails. + GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) + // GetExactOutputRoutes will return a list of tokens, when given a destination chain and token, + // that can be used to pay/send from an origin chain the exact output amount on the + // destination chain. + // + // The request will include the destination chain and token desired, along with the + // owner address of who will be sending the funds. This allows us to filter the list + // of possible origin tokens to only those the owner has a balance on. + // + // The response is going to be a list of origin tokens and their chains which can be used + // to fullfill the exact output request. + // + // aka, the 'pay' routes + GetExactOutputRoutes(ctx context.Context, getExactOutputRoutesRequest GetExactOutputRoutesRequest) (*GetExactOutputRoutesResponse, error) + // GetExactInputRoutes will return a list of tokens, when given an origin chain and token, + // that can be used to send/swap to a destination chain and token. + // + // The request will include the origin chain and token used for input. Optionally, the + // user can specify a destination chain and token to further filter the results, and + // see if any token routes are availabled / returned. + // + // The resposne is going to be a list of destination tokens and their chains which can be + // reached from the origin token and chain. + // + // aka, the 'swap' routes + GetExactInputRoutes(ctx context.Context, getExactInputRoutesRequest GetExactInputRoutesRequest) (*GetExactInputRoutesResponse, error) + // GetPopularTokens will return a list of popular tokens based on the provided filters. + // This is useful for populating token selection lists. + GetPopularTokens(ctx context.Context, getPopularTokensRequest GetPopularTokensRequest) (*GetPopularTokensResponse, error) + // SearchTokens will search token lists for the specific token. This is useful + // when a user wants to input a specific token name, symbol or address to find, + // outside of the visible list. + SearchTokens(ctx context.Context, searchTokensRequest SearchTokensRequest) (*SearchTokensResponse, error) + // GetTokenPrices will return the live prices for a list of tokens. + GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) } // @@ -371,11 +406,8 @@ func (x *ChainGasUsageStatus) Is(values ...ChainGasUsageStatus) bool { return false } -// User goal prior to solving/quoting, aka the intent request. -// -// NOTE: was previously named GetIntentCallsPayloadParams -// -// ............ +// QuoteIntentRequest represents a user's request to get a quote for a +// Trails same-chain or cross-chain intent. type QuoteIntentRequest struct { // intent owner, aka the user address processing the quote OwnerAddress prototyp.Hash `json:"ownerAddress"` @@ -775,7 +807,9 @@ type FeeOption struct { Amount prototyp.BigInt `json:"amount"` AmountUSD float64 `json:"amountUsd"` FeeCollectorAddress prototyp.Hash `json:"feeCollectorAddress"` - Is2612 bool `json:"is2612"` + // - isNative: bool + // - supportsPermit: bool + Is2612 bool `json:"is2612"` } // DepositSignature contains all gasless deposit signature parameters for ExecuteIntent @@ -826,6 +860,36 @@ type TrailsAddressOverrides struct { SequenceWalletUtilsAddress *string `json:"sequenceWalletUtilsAddress"` } +type ChainInfo struct { + // id is the chain id + ID uint64 `json:"id"` + // id is the chain full name + Name string `json:"name"` + // tokenName/Symbol/Decimals are the native currency details + TokenName string `json:"tokenName"` + TokenSymbol string `json:"tokenSymbol"` + TokenDecimals uint8 `json:"tokenDecimals"` + // is testnet flag informs whether the chain is a testnet + IsTestnet bool `json:"isTestnet"` + // supportsBridging indicates whether the chain supports bridging operations + SupportsBridging bool `json:"supportsBridging"` + // additional metadata + LogoURI string `json:"logoUri"` + BlockExplorerURL string `json:"blockExplorerUrl"` +} + +type TokenInfo struct { + ChainID uint64 `json:"chainId"` + Address prototyp.Hash `json:"address"` + Name string `json:"name"` + Symbol string `json:"symbol"` + Decimals uint8 `json:"decimals"` + // supportsBridging indicates whether the chain supports bridging operations + SupportsBridging bool `json:"supportsBridging"` + // additional metadata + LogoURI string `json:"logoUri"` +} + type SortOrder uint32 const ( @@ -1002,6 +1066,73 @@ type GetIntentTransactionHistoryResponse struct { NextPage *Page `json:"nextPage"` } +type GetTokenPricesRequest struct { + Tokens []*Token `json:"tokens"` +} + +type GetTokenPricesResponse struct { + TokenPrices []*TokenPrice `json:"tokenPrices"` +} + +type GetChainsRequest struct { + // TODO: use enum eventually.. + RouteProvider *string `json:"routeProvider"` +} + +type GetChainsResponse struct { + Chains []*ChainInfo `json:"chains"` +} + +type GetExactOutputRoutesRequest struct { + DestinationChainId uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + // owner address is used to filter tokens the owner has a balance on. + // + // if unspecified, then we filter origin tokens based on popular options + // as is useful for a qr code deposit flow. + OwnerAddress prototyp.Hash `json:"ownerAddress"` +} + +type GetExactOutputRoutesResponse struct { + Tokens []*TokenInfo `json:"tokens"` +} + +type GetExactInputRoutesRequest struct { + OriginChainId uint64 `json:"originChainId"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + // optionally passed to filter results + DestinationChainId *uint64 `json:"destinationChainId"` + DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` +} + +type GetExactInputRoutesResponse struct { + Tokens []*TokenInfo `json:"tokens"` +} + +type GetPopularTokensRequest struct { + // all of these are optional..... + // TODO: still thinking about filters + RouteProvider *string `json:"routeProvider"` + Limit *uint32 `json:"limit"` + ChainIds []uint64 `json:"chainIds"` +} + +type GetPopularTokensResponse struct { + Tokens []*TokenInfo `json:"tokens"` +} + +type SearchTokensRequest struct { + // name, symbol, address + Query string `json:"query"` + RouteProvider *string `json:"routeProvider"` + Limit *uint32 `json:"limit"` + ChainIds []uint64 `json:"chainIds"` +} + +type SearchTokensResponse struct { + Tokens []*TokenInfo `json:"tokens"` +} + // Page represents a results page. This can be used both to request a page and // to store the state of a page. type Page struct { @@ -1032,12 +1163,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [13]string + urls [18]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [13]string{ + urls := [18]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1050,6 +1181,11 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetIntent", prefix + "SearchIntents", prefix + "GetIntentTransactionHistory", + prefix + "GetChains", + prefix + "GetExactOutputRoutes", + prefix + "GetExactInputRoutes", + prefix + "GetPopularTokens", + prefix + "SearchTokens", prefix + "GetTokenPrices", } return &trailsClient{ @@ -1250,15 +1386,92 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten return out.Ret0, err } -func (c *trailsClient) GetTokenPrices(ctx context.Context, tokens []*Token) ([]*TokenPrice, error) { - in := struct { - Arg0 []*Token `json:"tokens"` - }{tokens} +func (c *trailsClient) GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) { + out := struct { + Ret0 *GetChainsResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getChainsRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetExactOutputRoutes(ctx context.Context, getExactOutputRoutesRequest GetExactOutputRoutesRequest) (*GetExactOutputRoutesResponse, error) { + out := struct { + Ret0 *GetExactOutputRoutesResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactOutputRoutesRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRoutesRequest GetExactInputRoutesRequest) (*GetExactInputRoutesResponse, error) { + out := struct { + Ret0 *GetExactInputRoutesResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactInputRoutesRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetPopularTokens(ctx context.Context, getPopularTokensRequest GetPopularTokensRequest) (*GetPopularTokensResponse, error) { + out := struct { + Ret0 *GetPopularTokensResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getPopularTokensRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) SearchTokens(ctx context.Context, searchTokensRequest SearchTokensRequest) (*SearchTokensResponse, error) { + out := struct { + Ret0 *SearchTokensResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], searchTokensRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) { out := struct { - Ret0 []*TokenPrice `json:"tokenPrices"` + Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], getTokenPricesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1658,7 +1871,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+822fb49" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+25340a94" type WebrpcGenVersions struct { WebrpcGenVersion string From 018a0628a4df37a27661451029a508296f2ad821 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 21 Nov 2025 14:47:01 +0000 Subject: [PATCH 077/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index fc6539fc..df75984e 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.17+25340a94 6d939222fe9ec82e442ef3a769f80523fe7603bc +// trails-api v1-25.11.20+c2a87fea 3a288cdd32693d6fa78e00f46de090086b9c30ec // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.17+25340a94" + return "v1-25.11.20+c2a87fea" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "6d939222fe9ec82e442ef3a769f80523fe7603bc" + return "3a288cdd32693d6fa78e00f46de090086b9c30ec" } // @@ -1084,7 +1084,7 @@ type GetChainsResponse struct { } type GetExactOutputRoutesRequest struct { - DestinationChainId uint64 `json:"destinationChainId"` + DestinationChainID uint64 `json:"destinationChainId"` DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` // owner address is used to filter tokens the owner has a balance on. // @@ -1098,10 +1098,10 @@ type GetExactOutputRoutesResponse struct { } type GetExactInputRoutesRequest struct { - OriginChainId uint64 `json:"originChainId"` + OriginChainID uint64 `json:"originChainId"` OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` // optionally passed to filter results - DestinationChainId *uint64 `json:"destinationChainId"` + DestinationChainID *uint64 `json:"destinationChainId"` DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` } @@ -1871,7 +1871,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.17+25340a94" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.20+c2a87fea" type WebrpcGenVersions struct { WebrpcGenVersion string From 973801a2757ae880b0feb0ade24ef4958b8ab13d Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:34:27 +0000 Subject: [PATCH 078/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index df75984e..021df00d 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.20+c2a87fea 3a288cdd32693d6fa78e00f46de090086b9c30ec +// trails-api v1-25.11.21+d52e889 cf16b3b677c4096dfcbf6ab8a409ac3d1aed7bee // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.20+c2a87fea" + return "v1-25.11.21+d52e889" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "3a288cdd32693d6fa78e00f46de090086b9c30ec" + return "cf16b3b677c4096dfcbf6ab8a409ac3d1aed7bee" } // @@ -1084,7 +1084,7 @@ type GetChainsResponse struct { } type GetExactOutputRoutesRequest struct { - DestinationChainID uint64 `json:"destinationChainId"` + DestinationChainId uint64 `json:"destinationChainId"` DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` // owner address is used to filter tokens the owner has a balance on. // @@ -1098,10 +1098,10 @@ type GetExactOutputRoutesResponse struct { } type GetExactInputRoutesRequest struct { - OriginChainID uint64 `json:"originChainId"` + OriginChainId uint64 `json:"originChainId"` OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` // optionally passed to filter results - DestinationChainID *uint64 `json:"destinationChainId"` + DestinationChainId *uint64 `json:"destinationChainId"` DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` } @@ -1871,7 +1871,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.20+c2a87fea" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.21+d52e889" type WebrpcGenVersions struct { WebrpcGenVersion string From 52ffc3d422e6197b54d65c000da447f573a478ef Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Sat, 22 Nov 2025 00:56:03 +0000 Subject: [PATCH 079/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 021df00d..a9055166 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.21+d52e889 cf16b3b677c4096dfcbf6ab8a409ac3d1aed7bee +// trails-api v1-25.11.21+6e5ef30 ddf30c2ffbc5d024003bda5bb08a1802eccd355b // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.21+d52e889" + return "v1-25.11.21+6e5ef30" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "cf16b3b677c4096dfcbf6ab8a409ac3d1aed7bee" + return "ddf30c2ffbc5d024003bda5bb08a1802eccd355b" } // @@ -56,28 +56,30 @@ type TrailsClient interface { GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) // GetChains will return the list of supported chains by Trails. GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) - // GetExactOutputRoutes will return a list of tokens, when given a destination chain and token, + // GetExactOutputRoutes will return a list of origin tokens, when given a destination chain and token, // that can be used to pay/send from an origin chain the exact output amount on the // destination chain. // - // The request will include the destination chain and token desired, along with the - // owner address of who will be sending the funds. This allows us to filter the list - // of possible origin tokens to only those the owner has a balance on. + // The request will include the destination chain and token desired. Optionally, the + // user can specify an origin chain and token to filter results to only that specific + // origin token. Additionally, an optional owner address can be provided to filter + // results to only tokens the owner has a balance on (requires indexer gateway to be + // configured). // - // The response is going to be a list of origin tokens and their chains which can be used - // to fullfill the exact output request. + // The response is a list of origin tokens and their chains which can be used to fulfill + // the exact output request. These are tokens the user can send FROM to achieve the desired + // destination token amount. // // aka, the 'pay' routes GetExactOutputRoutes(ctx context.Context, getExactOutputRoutesRequest GetExactOutputRoutesRequest) (*GetExactOutputRoutesResponse, error) - // GetExactInputRoutes will return a list of tokens, when given an origin chain and token, + // GetExactInputRoutes will return a list of destination tokens, when given an origin chain and token, // that can be used to send/swap to a destination chain and token. // // The request will include the origin chain and token used for input. Optionally, the - // user can specify a destination chain and token to further filter the results, and - // see if any token routes are availabled / returned. + // user can specify a destination chain and token to further filter the results. // - // The resposne is going to be a list of destination tokens and their chains which can be - // reached from the origin token and chain. + // The response is a list of destination tokens and their chains which can be reached from + // the origin token and chain. These are tokens the user can send TO from the given origin token. // // aka, the 'swap' routes GetExactInputRoutes(ctx context.Context, getExactInputRoutesRequest GetExactInputRoutesRequest) (*GetExactInputRoutesResponse, error) @@ -1086,6 +1088,10 @@ type GetChainsResponse struct { type GetExactOutputRoutesRequest struct { DestinationChainId uint64 `json:"destinationChainId"` DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` + // optionally passed to filter results to only tokens from this origin chain + OriginChainId *uint64 `json:"originChainId"` + // optionally passed to filter results to only this specific origin token + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` // owner address is used to filter tokens the owner has a balance on. // // if unspecified, then we filter origin tokens based on popular options @@ -1871,7 +1877,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.21+d52e889" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.21+6e5ef30" type WebrpcGenVersions struct { WebrpcGenVersion string From 077426f180a76b99d77ba78497178c81ca9c7209 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:46:18 +0000 Subject: [PATCH 080/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index a9055166..d7240fef 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.21+6e5ef30 ddf30c2ffbc5d024003bda5bb08a1802eccd355b +// trails-api v1-25.11.21+39c2645 955c5dfb7d2991c15654c6f7cd231d7d5d8dbf7c // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.21+6e5ef30" + return "v1-25.11.21+39c2645" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "ddf30c2ffbc5d024003bda5bb08a1802eccd355b" + return "955c5dfb7d2991c15654c6f7cd231d7d5d8dbf7c" } // @@ -945,6 +945,7 @@ type RuntimeStatus struct { // overall status, true/false HealthOK bool `json:"healthOK"` StartTime time.Time `json:"startTime"` + Hostname string `json:"hostname"` Uptime uint64 `json:"uptime"` Ver string `json:"ver"` Branch string `json:"branch"` @@ -1877,7 +1878,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.21+6e5ef30" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.21+39c2645" type WebrpcGenVersions struct { WebrpcGenVersion string From a2663706291030ab198f0d43fafd695dfa252af4 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:21:03 +0000 Subject: [PATCH 081/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 84 ++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 14 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index d7240fef..c366b248 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.21+39c2645 955c5dfb7d2991c15654c6f7cd231d7d5d8dbf7c +// trails-api v1-25.11.25+76b9d61 0adcae6e69af17dcd0a3ba3f31e77596ebdd9590 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.21+39c2645" + return "v1-25.11.25+76b9d61" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "955c5dfb7d2991c15654c6f7cd231d7d5d8dbf7c" + return "0adcae6e69af17dcd0a3ba3f31e77596ebdd9590" } // @@ -408,6 +408,60 @@ func (x *ChainGasUsageStatus) Is(values ...ChainGasUsageStatus) bool { return false } +type CCTPTransferStatus uint8 + +const ( + CCTPTransferStatus_PENDING CCTPTransferStatus = 0 + CCTPTransferStatus_COMPLETE CCTPTransferStatus = 1 + CCTPTransferStatus_FAILED CCTPTransferStatus = 2 + CCTPTransferStatus_UNKNOWN CCTPTransferStatus = 3 + CCTPTransferStatus_RELAYED CCTPTransferStatus = 4 + CCTPTransferStatus_FINALIZED CCTPTransferStatus = 5 +) + +var CCTPTransferStatus_name = map[uint8]string{ + 0: "PENDING", + 1: "COMPLETE", + 2: "FAILED", + 3: "UNKNOWN", + 4: "RELAYED", + 5: "FINALIZED", +} + +var CCTPTransferStatus_value = map[string]uint8{ + "PENDING": 0, + "COMPLETE": 1, + "FAILED": 2, + "UNKNOWN": 3, + "RELAYED": 4, + "FINALIZED": 5, +} + +func (x CCTPTransferStatus) String() string { + return CCTPTransferStatus_name[uint8(x)] +} + +func (x CCTPTransferStatus) MarshalText() ([]byte, error) { + return []byte(CCTPTransferStatus_name[uint8(x)]), nil +} + +func (x *CCTPTransferStatus) UnmarshalText(b []byte) error { + *x = CCTPTransferStatus(CCTPTransferStatus_value[string(b)]) + return nil +} + +func (x *CCTPTransferStatus) Is(values ...CCTPTransferStatus) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + // QuoteIntentRequest represents a user's request to get a quote for a // Trails same-chain or cross-chain intent. type QuoteIntentRequest struct { @@ -775,16 +829,18 @@ type TokenPrice struct { } type CCTPTransfer struct { - ID string `json:"id"` - SourceTxHash string `json:"sourceTxHash"` - SourceChainID uint64 `json:"sourceChainId"` - DestinationChainID uint64 `json:"destinationChainId"` - Message string `json:"message"` - Attestation string `json:"attestation"` - // TODO use an enum instead? - Status string `json:"status"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + ID uint64 `json:"id" db:"id,omitempty"` + SourceTxHash prototyp.Hash `json:"sourceTxHash" db:"source_tx_hash"` + SourceChainID uint64 `json:"sourceChainId" db:"source_chain_id"` + DestinationChainID uint64 `json:"destinationChainId" db:"destination_chain_id"` + Message string `json:"message" db:"message"` + Attestation string `json:"attestation" db:"attestation"` + Status CCTPTransferStatus `json:"status" db:"status"` + StatusReason *string `json:"statusReason" db:"status_reason,omitempty"` + ProcessedAt *time.Time `json:"processedAt" db:"processed_at"` + RetryCount int `json:"retryCount" db:"retry_count"` + CreatedAt time.Time `json:"createdAt" db:"created_at"` + UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` } type GasFeeOptions struct { @@ -1878,7 +1934,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.21+39c2645" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.25+76b9d61" type WebrpcGenVersions struct { WebrpcGenVersion string From 3a4ba304fbb2c26b9ffe1925324b40270eda762d Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 26 Nov 2025 21:26:01 +0000 Subject: [PATCH 082/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index c366b248..7d2ad529 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.25+76b9d61 0adcae6e69af17dcd0a3ba3f31e77596ebdd9590 +// trails-api v1-25.11.26+c8a74c1 cee4d270fb3d3c7ff459e32c4e1fb0bcde8013fa // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.25+76b9d61" + return "v1-25.11.26+c8a74c1" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "0adcae6e69af17dcd0a3ba3f31e77596ebdd9590" + return "cee4d270fb3d3c7ff459e32c4e1fb0bcde8013fa" } // @@ -83,9 +83,9 @@ type TrailsClient interface { // // aka, the 'swap' routes GetExactInputRoutes(ctx context.Context, getExactInputRoutesRequest GetExactInputRoutesRequest) (*GetExactInputRoutesResponse, error) - // GetPopularTokens will return a list of popular tokens based on the provided filters. + // GetFeaturedTokens will return a list of popular tokens based on the provided filters. // This is useful for populating token selection lists. - GetPopularTokens(ctx context.Context, getPopularTokensRequest GetPopularTokensRequest) (*GetPopularTokensResponse, error) + GetFeaturedTokens(ctx context.Context, getFeaturedTokensRequest GetFeaturedTokensRequest) (*GetFeaturedTokensResponse, error) // SearchTokens will search token lists for the specific token. This is useful // when a user wants to input a specific token name, symbol or address to find, // outside of the visible list. @@ -1172,7 +1172,7 @@ type GetExactInputRoutesResponse struct { Tokens []*TokenInfo `json:"tokens"` } -type GetPopularTokensRequest struct { +type GetFeaturedTokensRequest struct { // all of these are optional..... // TODO: still thinking about filters RouteProvider *string `json:"routeProvider"` @@ -1180,7 +1180,7 @@ type GetPopularTokensRequest struct { ChainIds []uint64 `json:"chainIds"` } -type GetPopularTokensResponse struct { +type GetFeaturedTokensResponse struct { Tokens []*TokenInfo `json:"tokens"` } @@ -1247,7 +1247,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetChains", prefix + "GetExactOutputRoutes", prefix + "GetExactInputRoutes", - prefix + "GetPopularTokens", + prefix + "GetFeaturedTokens", prefix + "SearchTokens", prefix + "GetTokenPrices", } @@ -1497,12 +1497,12 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou return out.Ret0, err } -func (c *trailsClient) GetPopularTokens(ctx context.Context, getPopularTokensRequest GetPopularTokensRequest) (*GetPopularTokensResponse, error) { +func (c *trailsClient) GetFeaturedTokens(ctx context.Context, getFeaturedTokensRequest GetFeaturedTokensRequest) (*GetFeaturedTokensResponse, error) { out := struct { - Ret0 *GetPopularTokensResponse + Ret0 *GetFeaturedTokensResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getPopularTokensRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getFeaturedTokensRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1934,7 +1934,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.25+76b9d61" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.26+c8a74c1" type WebrpcGenVersions struct { WebrpcGenVersion string From 566f73856706bb2a41d28b5515655536bbca06ac Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 27 Nov 2025 18:32:08 +0000 Subject: [PATCH 083/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 42 ++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 7d2ad529..97896340 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.26+c8a74c1 cee4d270fb3d3c7ff459e32c4e1fb0bcde8013fa +// trails-api v1-25.11.27+a1a7c1e 6fe7f33c211df436c7eea478f1065f46c7432656 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.26+c8a74c1" + return "v1-25.11.27+a1a7c1e" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "cee4d270fb3d3c7ff459e32c4e1fb0bcde8013fa" + return "6fe7f33c211df436c7eea478f1065f46c7432656" } // @@ -943,9 +943,12 @@ type TokenInfo struct { Symbol string `json:"symbol"` Decimals uint8 `json:"decimals"` // supportsBridging indicates whether the chain supports bridging operations - SupportsBridging bool `json:"supportsBridging"` + SupportsBridging bool `json:"supportsBridging,omitempty"` // additional metadata - LogoURI string `json:"logoUri"` + LogoURI string `json:"logoUri"` + Featured bool `json:"-"` + // internal only field + FeatureIndex int `json:"-"` } type SortOrder uint32 @@ -1143,10 +1146,10 @@ type GetChainsResponse struct { } type GetExactOutputRoutesRequest struct { - DestinationChainId uint64 `json:"destinationChainId"` + DestinationChainID uint64 `json:"destinationChainId"` DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` // optionally passed to filter results to only tokens from this origin chain - OriginChainId *uint64 `json:"originChainId"` + OriginChainID *uint64 `json:"originChainId"` // optionally passed to filter results to only this specific origin token OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` // owner address is used to filter tokens the owner has a balance on. @@ -1161,10 +1164,10 @@ type GetExactOutputRoutesResponse struct { } type GetExactInputRoutesRequest struct { - OriginChainId uint64 `json:"originChainId"` + OriginChainID uint64 `json:"originChainId"` OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` // optionally passed to filter results - DestinationChainId *uint64 `json:"destinationChainId"` + DestinationChainID *uint64 `json:"destinationChainId"` DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` } @@ -1173,11 +1176,13 @@ type GetExactInputRoutesResponse struct { } type GetFeaturedTokensRequest struct { - // all of these are optional..... - // TODO: still thinking about filters - RouteProvider *string `json:"routeProvider"` - Limit *uint32 `json:"limit"` - ChainIds []uint64 `json:"chainIds"` + // chainIds is required to specify which chains to get featured tokens for + ChainIDs []uint64 `json:"chainIds"` + // optional limit to return + Limit uint32 `json:"limit"` + // optional token address to filter results to a specific token, useful for checking + // if a token is featured or not. + TokenAddress prototyp.Hash `json:"tokenAddress"` } type GetFeaturedTokensResponse struct { @@ -1186,10 +1191,9 @@ type GetFeaturedTokensResponse struct { type SearchTokensRequest struct { // name, symbol, address - Query string `json:"query"` - RouteProvider *string `json:"routeProvider"` - Limit *uint32 `json:"limit"` - ChainIds []uint64 `json:"chainIds"` + Query string `json:"query"` + ChainIDs []uint64 `json:"chainIds"` + Limit uint32 `json:"limit"` } type SearchTokensResponse struct { @@ -1934,7 +1938,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.26+c8a74c1" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.27+a1a7c1e" type WebrpcGenVersions struct { WebrpcGenVersion string From 4e4e7be9c8b647004ed4c1c8bc9c510348ef2496 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 28 Nov 2025 02:03:25 +0000 Subject: [PATCH 084/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 44 ++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 97896340..e462129b 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.27+a1a7c1e 6fe7f33c211df436c7eea478f1065f46c7432656 +// trails-api v1-25.11.27+af8ce652 82bbf7dd6f0c1eb68bb0c86b5b69da5147eba4ef // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.27+a1a7c1e" + return "v1-25.11.27+af8ce652" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "6fe7f33c211df436c7eea478f1065f46c7432656" + return "82bbf7dd6f0c1eb68bb0c86b5b69da5147eba4ef" } // @@ -83,9 +83,9 @@ type TrailsClient interface { // // aka, the 'swap' routes GetExactInputRoutes(ctx context.Context, getExactInputRoutesRequest GetExactInputRoutesRequest) (*GetExactInputRoutesResponse, error) - // GetFeaturedTokens will return a list of popular tokens based on the provided filters. + // GetTokenList will return a list of tokens based on the provided filters. // This is useful for populating token selection lists. - GetFeaturedTokens(ctx context.Context, getFeaturedTokensRequest GetFeaturedTokensRequest) (*GetFeaturedTokensResponse, error) + GetTokenList(ctx context.Context, getTokenListRequest GetTokenListRequest) (*GetTokenListResponse, error) // SearchTokens will search token lists for the specific token. This is useful // when a user wants to input a specific token name, symbol or address to find, // outside of the visible list. @@ -945,10 +945,9 @@ type TokenInfo struct { // supportsBridging indicates whether the chain supports bridging operations SupportsBridging bool `json:"supportsBridging,omitempty"` // additional metadata - LogoURI string `json:"logoUri"` - Featured bool `json:"-"` - // internal only field - FeatureIndex int `json:"-"` + LogoURI string `json:"logoUri"` + Featured bool `json:"featured"` + FeatureIndex int `json:"-"` } type SortOrder uint32 @@ -1175,17 +1174,24 @@ type GetExactInputRoutesResponse struct { Tokens []*TokenInfo `json:"tokens"` } -type GetFeaturedTokensRequest struct { +type GetTokenListRequest struct { // chainIds is required to specify which chains to get featured tokens for ChainIDs []uint64 `json:"chainIds"` - // optional limit to return - Limit uint32 `json:"limit"` + // optional limit to return per chain, ie. like the top N number of tokens + // sorted by featured then alphabetically by name. + Limit int32 `json:"limit"` // optional token address to filter results to a specific token, useful for checking - // if a token is featured or not. + // if tokenAddress filter is used, the entire token list is searched for the token TokenAddress prototyp.Hash `json:"tokenAddress"` + // optional filter to include all tokens in response, not just featured + // by default, only featured tokens are returned. + IncludeAllListed bool `json:"includeAllListed"` + // optional filter to include external tokens in response, in addition to listed/featured + // by default, external tokens are not returned. + IncludeExternal bool `json:"includeExternal"` } -type GetFeaturedTokensResponse struct { +type GetTokenListResponse struct { Tokens []*TokenInfo `json:"tokens"` } @@ -1251,7 +1257,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetChains", prefix + "GetExactOutputRoutes", prefix + "GetExactInputRoutes", - prefix + "GetFeaturedTokens", + prefix + "GetTokenList", prefix + "SearchTokens", prefix + "GetTokenPrices", } @@ -1501,12 +1507,12 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou return out.Ret0, err } -func (c *trailsClient) GetFeaturedTokens(ctx context.Context, getFeaturedTokensRequest GetFeaturedTokensRequest) (*GetFeaturedTokensResponse, error) { +func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest GetTokenListRequest) (*GetTokenListResponse, error) { out := struct { - Ret0 *GetFeaturedTokensResponse + Ret0 *GetTokenListResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getFeaturedTokensRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenListRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1938,7 +1944,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.27+a1a7c1e" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.27+af8ce652" type WebrpcGenVersions struct { WebrpcGenVersion string From 429fe64c4cc26bdf7a7e27397e6dba03baa05a86 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Fri, 28 Nov 2025 09:57:31 +0000 Subject: [PATCH 085/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index e462129b..07e7bb35 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.27+af8ce652 82bbf7dd6f0c1eb68bb0c86b5b69da5147eba4ef +// trails-api v1-25.11.27+83efec2 789ed16b6c20b1e12c0462dd5d345782fc283286 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.27+af8ce652" + return "v1-25.11.27+83efec2" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "82bbf7dd6f0c1eb68bb0c86b5b69da5147eba4ef" + return "789ed16b6c20b1e12c0462dd5d345782fc283286" } // @@ -499,11 +499,6 @@ type QuoteIntentRequestOptions struct { } // Fully formed/quoted/solved, executable intent. -// -// NOTE: was previously named IntentCallsPayloads, and as well IntentConfig -// was pretty much the same thing too, so consolidated into a single type. -// -// db table: 'intents' type Intent struct { // id is an internal-only sequential primary key. ID uint64 `json:"-" db:"id,omitempty"` @@ -582,12 +577,6 @@ type TransactionPrecondition struct { } // MetaTxn is a meta-transaction to be submitted to Sequence Relayer. -// -// From: `0xsequence/relayer`: https://github.com/0xsequence/relayer/blob/2c695b820970c68c57bfe71810f469412cdec675/proto/relayer.ridl#L502 -// TODO: rename this to MetaTxnRaw (eventually), we can leave it for now to not break compat -// or name it, MetaTxnArgs ..? -// -// NOTE: this was previously named MetaTxn type MetaTxn struct { ID string `json:"id"` ChainID uint64 `json:"chainId"` @@ -604,10 +593,6 @@ type MetaTxn struct { // IntentReceipt represents an intent that went through trails, and fully executed // as a set of transactions, and is now complete. This method is used to fetch the // status of an intent, and also used by the GetIntentTransactionHistory endpoint. -// -// NOTE: this was previously named IntentTransaction -// -// db table: 'intent_receipts' type IntentReceipt struct { // id is an internal-only sequential primary key. ID uint64 `json:"-" db:"id,omitempty"` @@ -649,8 +634,6 @@ type IntentReceipt struct { } // IntentTransaction represents a single transaction within an intent's execution flow. -// -// db table: 'intent_transactions' type IntentTransaction struct { // Auto-incrementing id used for table pk ID uint64 `json:"-" db:"id,omitempty"` @@ -1944,7 +1927,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.27+af8ce652" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.27+83efec2" type WebrpcGenVersions struct { WebrpcGenVersion string From 4d4d4f8b46d4cc3a98df50f4ae1952d5bd9967d0 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 28 Nov 2025 14:57:13 +0000 Subject: [PATCH 086/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 70 +++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 07e7bb35..2a9c90fd 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.27+83efec2 789ed16b6c20b1e12c0462dd5d345782fc283286 +// trails-api v1-25.11.28+41e99de8 2e7ae9c76e039bd5f6aaa50ac090683c05860ffc // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.27+83efec2" + return "v1-25.11.28+41e99de8" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "789ed16b6c20b1e12c0462dd5d345782fc283286" + return "2e7ae9c76e039bd5f6aaa50ac090683c05860ffc" } // @@ -46,6 +46,9 @@ type TrailsClient interface { Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) + // GetTrailsContracts returns Trails contract addresses used by the API. + // SDKs should call this at initialization to fetch addresses instead of hardcoding them. + GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) QuoteIntent(ctx context.Context, quoteIntentRequest QuoteIntentRequest) (*QuoteIntentResponse, error) CommitIntent(ctx context.Context, commitIntentRequest CommitIntentRequest) (*CommitIntentResponse, error) ExecuteIntent(ctx context.Context, executeIntentRequest ExecuteIntentRequest) (*ExecuteIntentResponse, error) @@ -901,6 +904,12 @@ type TrailsAddressOverrides struct { SequenceWalletUtilsAddress *string `json:"sequenceWalletUtilsAddress"` } +type TrailsContracts struct { + TrailsIntentEntrypointAddress prototyp.Hash `json:"trailsIntentEntrypointAddress"` + TrailsRouterAddress prototyp.Hash `json:"trailsRouterAddress"` + TrailsRouterShimAddress prototyp.Hash `json:"trailsRouterShimAddress"` +} + type ChainInfo struct { // id is the chain id ID uint64 `json:"id"` @@ -1016,7 +1025,8 @@ type QuoteIntentResponse struct { // is called by clients to confirm they wish to commit to the intent and will execute it. // We return the intent ID for tracking. type CommitIntentRequest struct { - Intent *Intent `json:"intent"` + Intent *Intent `json:"intent"` + TrailsContracts *TrailsContracts `json:"trailsContracts"` } type CommitIntentResponse struct { @@ -1219,16 +1229,17 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [18]string + urls [19]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [18]string{ + urls := [19]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", prefix + "Clock", + prefix + "GetTrailsContracts", prefix + "QuoteIntent", prefix + "CommitIntent", prefix + "ExecuteIntent", @@ -1314,12 +1325,28 @@ func (c *trailsClient) Clock(ctx context.Context) (time.Time, error) { return out.Ret0, err } +func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) { + out := struct { + Ret0 *TrailsContracts `json:"TrailsContracts"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + func (c *trailsClient) QuoteIntent(ctx context.Context, quoteIntentRequest QuoteIntentRequest) (*QuoteIntentResponse, error) { out := struct { Ret0 *QuoteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[4], quoteIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], quoteIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1335,7 +1362,7 @@ func (c *trailsClient) CommitIntent(ctx context.Context, commitIntentRequest Com Ret0 *CommitIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[5], commitIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], commitIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1351,7 +1378,7 @@ func (c *trailsClient) ExecuteIntent(ctx context.Context, executeIntentRequest E Ret0 *ExecuteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[6], executeIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], executeIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1367,7 +1394,7 @@ func (c *trailsClient) WaitIntentReceipt(ctx context.Context, waitIntentReceiptR Ret0 *WaitIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[7], waitIntentReceiptRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], waitIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1383,7 +1410,7 @@ func (c *trailsClient) GetIntentReceipt(ctx context.Context, getIntentReceiptReq Ret0 *GetIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], getIntentReceiptRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], getIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1399,7 +1426,7 @@ func (c *trailsClient) GetIntent(ctx context.Context, getIntentRequest GetIntent Ret0 *GetIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], getIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], getIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1415,7 +1442,7 @@ func (c *trailsClient) SearchIntents(ctx context.Context, searchIntentsRequest S Ret0 *SearchIntentsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], searchIntentsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], searchIntentsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1431,7 +1458,7 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten Ret0 *GetIntentTransactionHistoryResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], getIntentTransactionHistoryRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getIntentTransactionHistoryRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1447,7 +1474,7 @@ func (c *trailsClient) GetChains(ctx context.Context, getChainsRequest GetChains Ret0 *GetChainsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getChainsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getChainsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1463,7 +1490,7 @@ func (c *trailsClient) GetExactOutputRoutes(ctx context.Context, getExactOutputR Ret0 *GetExactOutputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactOutputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactOutputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1479,7 +1506,7 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou Ret0 *GetExactInputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactInputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getExactInputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1495,7 +1522,7 @@ func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest Get Ret0 *GetTokenListResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenListRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenListRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1511,7 +1538,7 @@ func (c *trailsClient) SearchTokens(ctx context.Context, searchTokensRequest Sea Ret0 *SearchTokensResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], searchTokensRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], searchTokensRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1527,7 +1554,7 @@ func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], getTokenPricesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[18], getTokenPricesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1921,13 +1948,14 @@ var ( ErrIntentStatus = WebRPCError{Code: 2004, Name: "IntentStatus", Message: "Invalid intent status", HTTPStatus: 422} ErrNotFound = WebRPCError{Code: 8000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} + ErrClientOutdated = WebRPCError{Code: 8009, Name: "ClientOutdated", Message: "Client is outdated", HTTPStatus: 422} ErrIntentsSkipped = WebRPCError{Code: 7000, Name: "IntentsSkipped", Message: "Intents skipped as client is attempting a transaction that does not require intents", HTTPStatus: 400} ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} ) const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.27+83efec2" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+41e99de8" type WebrpcGenVersions struct { WebrpcGenVersion string From 33e9f47a3b92fd5abac18ff682816352cc742fa2 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 28 Nov 2025 14:58:25 +0000 Subject: [PATCH 087/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 75 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 2a9c90fd..48a540b6 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.28+41e99de8 2e7ae9c76e039bd5f6aaa50ac090683c05860ffc +// trails-api v1-25.11.28+a136985 e9a6984bd181e25b365c915af0c36d89f93061bb // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.28+41e99de8" + return "v1-25.11.28+a136985" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "2e7ae9c76e039bd5f6aaa50ac090683c05860ffc" + return "e9a6984bd181e25b365c915af0c36d89f93061bb" } // @@ -46,9 +46,6 @@ type TrailsClient interface { Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) - // GetTrailsContracts returns Trails contract addresses used by the API. - // SDKs should call this at initialization to fetch addresses instead of hardcoding them. - GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) QuoteIntent(ctx context.Context, quoteIntentRequest QuoteIntentRequest) (*QuoteIntentResponse, error) CommitIntent(ctx context.Context, commitIntentRequest CommitIntentRequest) (*CommitIntentResponse, error) ExecuteIntent(ctx context.Context, executeIntentRequest ExecuteIntentRequest) (*ExecuteIntentResponse, error) @@ -95,6 +92,8 @@ type TrailsClient interface { SearchTokens(ctx context.Context, searchTokensRequest SearchTokensRequest) (*SearchTokensResponse, error) // GetTokenPrices will return the live prices for a list of tokens. GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) + // GetTrailsContracts returns Trails contract addresses used by the Trails Intents stack. + GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) } // @@ -1239,7 +1238,6 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "Version", prefix + "RuntimeStatus", prefix + "Clock", - prefix + "GetTrailsContracts", prefix + "QuoteIntent", prefix + "CommitIntent", prefix + "ExecuteIntent", @@ -1254,6 +1252,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetTokenList", prefix + "SearchTokens", prefix + "GetTokenPrices", + prefix + "GetTrailsContracts", } return &trailsClient{ client: client, @@ -1325,28 +1324,12 @@ func (c *trailsClient) Clock(ctx context.Context) (time.Time, error) { return out.Ret0, err } -func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) { - out := struct { - Ret0 *TrailsContracts `json:"TrailsContracts"` - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[4], nil, &out) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - func (c *trailsClient) QuoteIntent(ctx context.Context, quoteIntentRequest QuoteIntentRequest) (*QuoteIntentResponse, error) { out := struct { Ret0 *QuoteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[5], quoteIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], quoteIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1362,7 +1345,7 @@ func (c *trailsClient) CommitIntent(ctx context.Context, commitIntentRequest Com Ret0 *CommitIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[6], commitIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], commitIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1378,7 +1361,7 @@ func (c *trailsClient) ExecuteIntent(ctx context.Context, executeIntentRequest E Ret0 *ExecuteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[7], executeIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], executeIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1394,7 +1377,7 @@ func (c *trailsClient) WaitIntentReceipt(ctx context.Context, waitIntentReceiptR Ret0 *WaitIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], waitIntentReceiptRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], waitIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1410,7 +1393,7 @@ func (c *trailsClient) GetIntentReceipt(ctx context.Context, getIntentReceiptReq Ret0 *GetIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], getIntentReceiptRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], getIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1426,7 +1409,7 @@ func (c *trailsClient) GetIntent(ctx context.Context, getIntentRequest GetIntent Ret0 *GetIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], getIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], getIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1442,7 +1425,7 @@ func (c *trailsClient) SearchIntents(ctx context.Context, searchIntentsRequest S Ret0 *SearchIntentsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], searchIntentsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], searchIntentsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1458,7 +1441,7 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten Ret0 *GetIntentTransactionHistoryResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getIntentTransactionHistoryRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], getIntentTransactionHistoryRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1474,7 +1457,7 @@ func (c *trailsClient) GetChains(ctx context.Context, getChainsRequest GetChains Ret0 *GetChainsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getChainsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getChainsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1490,7 +1473,7 @@ func (c *trailsClient) GetExactOutputRoutes(ctx context.Context, getExactOutputR Ret0 *GetExactOutputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactOutputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactOutputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1506,7 +1489,7 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou Ret0 *GetExactInputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getExactInputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactInputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1522,7 +1505,7 @@ func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest Get Ret0 *GetTokenListResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenListRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenListRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1538,7 +1521,7 @@ func (c *trailsClient) SearchTokens(ctx context.Context, searchTokensRequest Sea Ret0 *SearchTokensResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], searchTokensRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], searchTokensRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1554,7 +1537,23 @@ func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[18], getTokenPricesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], getTokenPricesRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) { + out := struct { + Ret0 *TrailsContracts `json:"TrailsContracts"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[18], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1955,7 +1954,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+41e99de8" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+a136985" type WebrpcGenVersions struct { WebrpcGenVersion string From 748fc3f90480cce66b6d5dee163c7ee7b003bb81 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 28 Nov 2025 15:00:47 +0000 Subject: [PATCH 088/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 53 ++++++++---------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 48a540b6..3eeaffa1 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.28+a136985 e9a6984bd181e25b365c915af0c36d89f93061bb +// trails-api v1-25.11.28+77554c7 7b5caafc738febc48d7568b3e4d4cc2597309245 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.28+a136985" + return "v1-25.11.28+77554c7" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "e9a6984bd181e25b365c915af0c36d89f93061bb" + return "7b5caafc738febc48d7568b3e4d4cc2597309245" } // @@ -84,12 +84,8 @@ type TrailsClient interface { // aka, the 'swap' routes GetExactInputRoutes(ctx context.Context, getExactInputRoutesRequest GetExactInputRoutesRequest) (*GetExactInputRoutesResponse, error) // GetTokenList will return a list of tokens based on the provided filters. - // This is useful for populating token selection lists. + // NOTE: there are many filters and options on GetTokenListRequest GetTokenList(ctx context.Context, getTokenListRequest GetTokenListRequest) (*GetTokenListResponse, error) - // SearchTokens will search token lists for the specific token. This is useful - // when a user wants to input a specific token name, symbol or address to find, - // outside of the visible list. - SearchTokens(ctx context.Context, searchTokensRequest SearchTokensRequest) (*SearchTokensResponse, error) // GetTokenPrices will return the live prices for a list of tokens. GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) // GetTrailsContracts returns Trails contract addresses used by the Trails Intents stack. @@ -1169,6 +1165,9 @@ type GetExactInputRoutesResponse struct { type GetTokenListRequest struct { // chainIds is required to specify which chains to get featured tokens for ChainIDs []uint64 `json:"chainIds"` + // optional search query string to search token name/symbol/address. + // when searching lists, all of the lists will be used in the search automatically. + SearchQuery string `json:"searchQuery"` // optional limit to return per chain, ie. like the top N number of tokens // sorted by featured then alphabetically by name. Limit int32 `json:"limit"` @@ -1187,17 +1186,6 @@ type GetTokenListResponse struct { Tokens []*TokenInfo `json:"tokens"` } -type SearchTokensRequest struct { - // name, symbol, address - Query string `json:"query"` - ChainIDs []uint64 `json:"chainIds"` - Limit uint32 `json:"limit"` -} - -type SearchTokensResponse struct { - Tokens []*TokenInfo `json:"tokens"` -} - // Page represents a results page. This can be used both to request a page and // to store the state of a page. type Page struct { @@ -1228,12 +1216,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [19]string + urls [18]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [19]string{ + urls := [18]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1250,7 +1238,6 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetExactOutputRoutes", prefix + "GetExactInputRoutes", prefix + "GetTokenList", - prefix + "SearchTokens", prefix + "GetTokenPrices", prefix + "GetTrailsContracts", } @@ -1516,28 +1503,12 @@ func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest Get return out.Ret0, err } -func (c *trailsClient) SearchTokens(ctx context.Context, searchTokensRequest SearchTokensRequest) (*SearchTokensResponse, error) { - out := struct { - Ret0 *SearchTokensResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], searchTokensRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) { out := struct { Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], getTokenPricesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenPricesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1553,7 +1524,7 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts Ret0 *TrailsContracts `json:"TrailsContracts"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[18], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1954,7 +1925,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+a136985" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+77554c7" type WebrpcGenVersions struct { WebrpcGenVersion string From fd98d2d4daacf0a3659935e9f772e5e04d7324a4 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 28 Nov 2025 20:20:02 +0000 Subject: [PATCH 089/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 3eeaffa1..c05a5444 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.28+77554c7 7b5caafc738febc48d7568b3e4d4cc2597309245 +// trails-api v1-25.11.28+1bf5484 0b56df9fcae5069ac02dafdb064fc2bead8923de // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.28+77554c7" + return "v1-25.11.28+1bf5484" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "7b5caafc738febc48d7568b3e4d4cc2597309245" + return "0b56df9fcae5069ac02dafdb064fc2bead8923de" } // @@ -773,6 +773,7 @@ type IntentSummary struct { DestinationTokenAddress prototyp.Hash `json:"destinationTokenAddress"` DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` DestinationTokenMetadata *TokenMetadata `json:"destinationTokenMetadata"` + DestinationToAddress prototyp.Hash `json:"destinationToAddress,omitempty"` // timestamp when the intent receipt was updated, usually from status change UpdatedAt *time.Time `json:"updatedAt,omitempty"` // timestamp of when the intent receipt was created @@ -1925,7 +1926,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+77554c7" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+1bf5484" type WebrpcGenVersions struct { WebrpcGenVersion string From 30d5c2e1abc317d07acf9f13d46bb0139ffac311 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Sat, 29 Nov 2025 09:11:51 +0000 Subject: [PATCH 090/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index c05a5444..22cf8f01 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.28+1bf5484 0b56df9fcae5069ac02dafdb064fc2bead8923de +// trails-api v1-25.11.28+97f8e97 fb30e83680e393c06498b50d10f19054309b9045 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.28+1bf5484" + return "v1-25.11.28+97f8e97" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "0b56df9fcae5069ac02dafdb064fc2bead8923de" + return "fb30e83680e393c06498b50d10f19054309b9045" } // @@ -1926,7 +1926,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+1bf5484" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+97f8e97" type WebrpcGenVersions struct { WebrpcGenVersion string From 7234e8528db0c237433e0b5ab25ba74ac133d93a Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Sun, 30 Nov 2025 20:14:32 +0000 Subject: [PATCH 091/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 63 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 22cf8f01..84c24614 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.28+97f8e97 fb30e83680e393c06498b50d10f19054309b9045 +// trails-api v1-25.11.28+23f3426 7d245adfa3283b1b6853bf0e304bf20b00d32362 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.28+97f8e97" + return "v1-25.11.28+23f3426" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "fb30e83680e393c06498b50d10f19054309b9045" + return "7d245adfa3283b1b6853bf0e304bf20b00d32362" } // @@ -409,30 +409,30 @@ func (x *ChainGasUsageStatus) Is(values ...ChainGasUsageStatus) bool { type CCTPTransferStatus uint8 const ( - CCTPTransferStatus_PENDING CCTPTransferStatus = 0 - CCTPTransferStatus_COMPLETE CCTPTransferStatus = 1 - CCTPTransferStatus_FAILED CCTPTransferStatus = 2 - CCTPTransferStatus_UNKNOWN CCTPTransferStatus = 3 - CCTPTransferStatus_RELAYED CCTPTransferStatus = 4 - CCTPTransferStatus_FINALIZED CCTPTransferStatus = 5 + CCTPTransferStatus_UNKNOWN CCTPTransferStatus = 0 + CCTPTransferStatus_ON_HOLD CCTPTransferStatus = 1 + CCTPTransferStatus_PENDING CCTPTransferStatus = 2 + CCTPTransferStatus_FETCHING CCTPTransferStatus = 3 + CCTPTransferStatus_COMPLETE CCTPTransferStatus = 4 + CCTPTransferStatus_FAILED CCTPTransferStatus = 5 ) var CCTPTransferStatus_name = map[uint8]string{ - 0: "PENDING", - 1: "COMPLETE", - 2: "FAILED", - 3: "UNKNOWN", - 4: "RELAYED", - 5: "FINALIZED", + 0: "UNKNOWN", + 1: "ON_HOLD", + 2: "PENDING", + 3: "FETCHING", + 4: "COMPLETE", + 5: "FAILED", } var CCTPTransferStatus_value = map[string]uint8{ - "PENDING": 0, - "COMPLETE": 1, - "FAILED": 2, - "UNKNOWN": 3, - "RELAYED": 4, - "FINALIZED": 5, + "UNKNOWN": 0, + "ON_HOLD": 1, + "PENDING": 2, + "FETCHING": 3, + "COMPLETE": 4, + "FAILED": 5, } func (x CCTPTransferStatus) String() string { @@ -812,17 +812,18 @@ type TokenPrice struct { type CCTPTransfer struct { ID uint64 `json:"id" db:"id,omitempty"` - SourceTxHash prototyp.Hash `json:"sourceTxHash" db:"source_tx_hash"` - SourceChainID uint64 `json:"sourceChainId" db:"source_chain_id"` - DestinationChainID uint64 `json:"destinationChainId" db:"destination_chain_id"` - Message string `json:"message" db:"message"` - Attestation string `json:"attestation" db:"attestation"` + IntentID prototyp.Hash `json:"intentId" db:"intent_id"` + OriginChainID uint64 `json:"originChainId" db:"orig_chain_id"` + DestinationChainID uint64 `json:"destinationChainId" db:"dest_chain_id"` + OriginTxnID uint64 `json:"originTxnId" db:"orig_txn_id"` + OriginTxnHash prototyp.Hash `json:"originTxnHash" db:"orig_txn_hash"` + DestinationTxnID uint64 `json:"destinationTxnId" db:"dest_txn_id"` + Message prototyp.Hash `json:"message" db:"message,omitempty"` + Attestation prototyp.Hash `json:"attestation" db:"attestation,omitempty"` Status CCTPTransferStatus `json:"status" db:"status"` StatusReason *string `json:"statusReason" db:"status_reason,omitempty"` - ProcessedAt *time.Time `json:"processedAt" db:"processed_at"` - RetryCount int `json:"retryCount" db:"retry_count"` - CreatedAt time.Time `json:"createdAt" db:"created_at"` - UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` + CreatedAt time.Time `json:"createdAt" db:"created_at,omitempty"` + UpdatedAt time.Time `json:"updatedAt" db:"updated_at,omitempty"` } type GasFeeOptions struct { @@ -1926,7 +1927,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+97f8e97" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+23f3426" type WebrpcGenVersions struct { WebrpcGenVersion string From 9132818031cc4dfd0ee4276a042b6dabfdd01e51 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 1 Dec 2025 21:48:01 +0000 Subject: [PATCH 092/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 80 ++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 84c24614..460a061b 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.28+23f3426 7d245adfa3283b1b6853bf0e304bf20b00d32362 +// trails-api v1-25.11.30+4720d55 a578059c4d50e055ca4fc9b9fb96b86214b31af1 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.28+23f3426" + return "v1-25.11.30+4720d55" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "7d245adfa3283b1b6853bf0e304bf20b00d32362" + return "a578059c4d50e055ca4fc9b9fb96b86214b31af1" } // @@ -124,24 +124,27 @@ func (x *TradeType) Is(values ...TradeType) bool { return false } -type QuoteProviderType string +type RouteProvider string const ( - QuoteProviderType_RELAY QuoteProviderType = "RELAY" - QuoteProviderType_CCTPV2 QuoteProviderType = "CCTPV2" - QuoteProviderType_LIFI QuoteProviderType = "LIFI" + RouteProvider_NONE RouteProvider = "NONE" + RouteProvider_CCTP RouteProvider = "CCTP" + RouteProvider_LIFI RouteProvider = "LIFI" + RouteProvider_RELAY RouteProvider = "RELAY" + RouteProvider_SUSHI RouteProvider = "SUSHI" + RouteProvider_ZEROX RouteProvider = "ZEROX" ) -func (x QuoteProviderType) MarshalText() ([]byte, error) { +func (x RouteProvider) MarshalText() ([]byte, error) { return []byte(x), nil } -func (x *QuoteProviderType) UnmarshalText(b []byte) error { - *x = QuoteProviderType(string(b)) +func (x *RouteProvider) UnmarshalText(b []byte) error { + *x = RouteProvider(string(b)) return nil } -func (x *QuoteProviderType) Is(values ...QuoteProviderType) bool { +func (x *RouteProvider) Is(values ...RouteProvider) bool { if x == nil { return false } @@ -490,8 +493,11 @@ type QuoteIntentRequest struct { } type QuoteIntentRequestOptions struct { - // Temporary: using string until proper enum is specified. - QuoteProvider *string `json:"quoteProvider,omitempty"` + SwapProvider RouteProvider `json:"swapProvider,omitempty"` + BridgeProvider RouteProvider `json:"bridgeProvider,omitempty"` + // slippageTolerance is a decimal amount, for example + // 0.001 is 0.1% slippage tolerance. If not specified, + // a default of 0.005 (0.5%) is used. SlippageTolerance *float64 `json:"slippageTolerance,omitempty"` TrailsAddressOverrides *TrailsAddressOverrides `json:"trailsAddressOverrides,omitempty"` } @@ -545,7 +551,6 @@ type DepositTransaction struct { Amount prototyp.BigInt `json:"amount"` } -// NOTE: was previously named IntentCallsPayload type IntentCalls struct { ChainID uint64 `json:"chainId"` Space prototyp.BigInt `json:"space"` @@ -578,14 +583,11 @@ type TransactionPrecondition struct { type MetaTxn struct { ID string `json:"id"` ChainID uint64 `json:"chainId"` - // TODO: rename this to 'from: string' ? ... name...?? walletAddress... from..? // fromAddress ...? WalletAddress string `json:"walletAddress"` - // TODO (later): rename this to `to: string` // TODO: name it.. toAddress ? Contract string `json:"contract"` - // TODO: rename to 'execdata' ? - Input string `json:"input"` + Input string `json:"input"` } // IntentReceipt represents an intent that went through trails, and fully executed @@ -671,21 +673,25 @@ type IntentTransaction struct { // the swap and/or bridge external providers. If we do both a swap and a bridge, then // the total amount is the sum of both providers. The 'quoteProvider' enum, will indiciate // multiple providers in that case. -// NOTE: previously named IntentQuote type IntentProviderQuote struct { - QuoteProvider string `json:"quoteProvider"` - QuoteProviderRequestID string `json:"quoteProviderRequestId"` - QuoteProviderFeeUSD float64 `json:"quoteProviderFeeUsd"` - FromAmount prototyp.BigInt `json:"fromAmount"` - FromAmountMin prototyp.BigInt `json:"fromAmountMin"` - ToAmount prototyp.BigInt `json:"toAmount"` - ToAmountMin prototyp.BigInt `json:"toAmountMin"` - MaxSlippage float64 `json:"maxSlippage"` - PriceImpact float64 `json:"priceImpact"` - PriceImpactUSD float64 `json:"priceImpactUsd"` -} - -// NOTE: previously named TrailsFee + RouteProviders []RouteProvider `json:"routeProviders"` + RouteProvidersRequestIDs []string `json:"routeProvidersRequestIds"` + RouteProvidersFeeUSD []float64 `json:"routeProvidersFeeUsd"` + // DEPRECATED: please use routeProviders instead. + QuoteProvider string `json:"quoteProvider"` + // DEPRECATED: please use routeProvidersRequestIds instead. + QuoteProviderRequestID string `json:"quoteProviderRequestId"` + // DEPRECATED: please use routeProvidersFeeUsd instead. + QuoteProviderFeeUSD float64 `json:"quoteProviderFeeUsd"` + FromAmount prototyp.BigInt `json:"fromAmount"` + FromAmountMin prototyp.BigInt `json:"fromAmountMin"` + ToAmount prototyp.BigInt `json:"toAmount"` + ToAmountMin prototyp.BigInt `json:"toAmountMin"` + MaxSlippage float64 `json:"maxSlippage"` + PriceImpact float64 `json:"priceImpact"` + PriceImpactUSD float64 `json:"priceImpactUsd"` +} + type IntentFees struct { // gas fees on origin and destination chains OriginGas *IntentTransactionGasFee `json:"originGas"` @@ -700,10 +706,8 @@ type IntentFees struct { } // ProviderFees is the swap+bridge provider fee, trails fee summary and totals -// NOTE: previously named the CrossChainFee type IntentProviderFees struct { // quote provider fee component (swap and/or bridge) - // TODO: what is the providerFee token denomination? is it always origin token..? I think no. QuoteProvider string `json:"quoteProvider"` QuoteProviderFee prototyp.BigInt `json:"quoteProviderFee"` QuoteProviderFeeUSD float64 `json:"quoteProviderFeeUsd"` @@ -711,13 +715,10 @@ type IntentProviderFees struct { TrailsFee prototyp.BigInt `json:"trailsFee"` TrailsFeeUSD float64 `json:"trailsFeeUsd"` // total provider fees, aka, swap + bridge + trails fees - // TODO: what is this denomination? is it always origin token..? ... - // TODO: rename to totalFees ? and totalFeesUsd ? .. TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` TotalFeeUSD float64 `json:"totalFeeUsd"` } -// NOTE: previously named ChainExecuteQuote type IntentTransactionGasFee struct { ChainID uint64 `json:"chainId"` TotalGasLimit prototyp.BigInt `json:"totalGasLimit"` @@ -737,8 +738,7 @@ type IntentTransactionGasFee struct { type MetaTxnFeeDetails struct { MetaTxnID string `json:"metaTxnId"` EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` - // TODO: whats up with this name? - FeeNative prototyp.BigInt `json:"feeNative"` + FeeNative prototyp.BigInt `json:"feeNative"` } // IntentSummary represents a summary view of an intent for listing purposes. @@ -1927,7 +1927,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.28+23f3426" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.30+4720d55" type WebrpcGenVersions struct { WebrpcGenVersion string From c958dd4efbf3af631e037d0398743b3506fb13b9 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:09:06 +0000 Subject: [PATCH 093/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 460a061b..5b84be18 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.11.30+4720d55 a578059c4d50e055ca4fc9b9fb96b86214b31af1 +// trails-api v1-25.12.1+22680dbf 4dfe524adea977b5e1b8130b119e3d13db0637b4 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.11.30+4720d55" + return "v1-25.12.1+22680dbf" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "a578059c4d50e055ca4fc9b9fb96b86214b31af1" + return "4dfe524adea977b5e1b8130b119e3d13db0637b4" } // @@ -127,7 +127,7 @@ func (x *TradeType) Is(values ...TradeType) bool { type RouteProvider string const ( - RouteProvider_NONE RouteProvider = "NONE" + RouteProvider_AUTO RouteProvider = "AUTO" RouteProvider_CCTP RouteProvider = "CCTP" RouteProvider_LIFI RouteProvider = "LIFI" RouteProvider_RELAY RouteProvider = "RELAY" @@ -1927,7 +1927,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.11.30+4720d55" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.1+22680dbf" type WebrpcGenVersions struct { WebrpcGenVersion string From b1e9536a3c655a61bc44576f4ce4d385e329fff2 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:09:46 +0000 Subject: [PATCH 094/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 5b84be18..5091ecb2 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.1+22680dbf 4dfe524adea977b5e1b8130b119e3d13db0637b4 +// trails-api v1-25.12.2+ce1f0a6 51460e58d5e599682ded70e29823fd15a8e882f9 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.1+22680dbf" + return "v1-25.12.2+ce1f0a6" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "4dfe524adea977b5e1b8130b119e3d13db0637b4" + return "51460e58d5e599682ded70e29823fd15a8e882f9" } // @@ -1182,6 +1182,8 @@ type GetTokenListRequest struct { // optional filter to include external tokens in response, in addition to listed/featured // by default, external tokens are not returned. IncludeExternal bool `json:"includeExternal"` + // optional filter to exlude specific token addresses from the response + ExcludeTokens []prototyp.Hash `json:"excludeTokens"` } type GetTokenListResponse struct { @@ -1927,7 +1929,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.1+22680dbf" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.2+ce1f0a6" type WebrpcGenVersions struct { WebrpcGenVersion string From fccc6ab62a911239acd209f4bf69641178921e51 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 3 Dec 2025 18:38:25 +0000 Subject: [PATCH 095/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 5091ecb2..99000539 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.2+ce1f0a6 51460e58d5e599682ded70e29823fd15a8e882f9 +// trails-api v1-25.12.3+8dcb1fd 234bfe732044d250beb6731912bd5582c446f7df // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.2+ce1f0a6" + return "v1-25.12.3+8dcb1fd" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "51460e58d5e599682ded70e29823fd15a8e882f9" + return "234bfe732044d250beb6731912bd5582c446f7df" } // @@ -671,25 +671,18 @@ type IntentTransaction struct { // IntentProviderQuote represents the quotes from the underlining providers for both // the swap and/or bridge external providers. If we do both a swap and a bridge, then -// the total amount is the sum of both providers. The 'quoteProvider' enum, will indiciate -// multiple providers in that case. +// the total amount is the sum of both providers. type IntentProviderQuote struct { RouteProviders []RouteProvider `json:"routeProviders"` RouteProvidersRequestIDs []string `json:"routeProvidersRequestIds"` RouteProvidersFeeUSD []float64 `json:"routeProvidersFeeUsd"` - // DEPRECATED: please use routeProviders instead. - QuoteProvider string `json:"quoteProvider"` - // DEPRECATED: please use routeProvidersRequestIds instead. - QuoteProviderRequestID string `json:"quoteProviderRequestId"` - // DEPRECATED: please use routeProvidersFeeUsd instead. - QuoteProviderFeeUSD float64 `json:"quoteProviderFeeUsd"` - FromAmount prototyp.BigInt `json:"fromAmount"` - FromAmountMin prototyp.BigInt `json:"fromAmountMin"` - ToAmount prototyp.BigInt `json:"toAmount"` - ToAmountMin prototyp.BigInt `json:"toAmountMin"` - MaxSlippage float64 `json:"maxSlippage"` - PriceImpact float64 `json:"priceImpact"` - PriceImpactUSD float64 `json:"priceImpactUsd"` + FromAmount prototyp.BigInt `json:"fromAmount"` + FromAmountMin prototyp.BigInt `json:"fromAmountMin"` + ToAmount prototyp.BigInt `json:"toAmount"` + ToAmountMin prototyp.BigInt `json:"toAmountMin"` + MaxSlippage float64 `json:"maxSlippage"` + PriceImpact float64 `json:"priceImpact"` + PriceImpactUSD float64 `json:"priceImpactUsd"` } type IntentFees struct { @@ -1924,12 +1917,13 @@ var ( ErrUnsupportedNetwork = WebRPCError{Code: 8008, Name: "UnsupportedNetwork", Message: "Unsupported network", HTTPStatus: 422} ErrClientOutdated = WebRPCError{Code: 8009, Name: "ClientOutdated", Message: "Client is outdated", HTTPStatus: 422} ErrIntentsSkipped = WebRPCError{Code: 7000, Name: "IntentsSkipped", Message: "Intents skipped as client is attempting a transaction that does not require intents", HTTPStatus: 400} + ErrQuoteExpired = WebRPCError{Code: 7001, Name: "QuoteExpired", Message: "Intent quote has expired. Please try again.", HTTPStatus: 400} ErrIntentsDisabled = WebRPCError{Code: 9000, Name: "IntentsDisabled", Message: "Intents service is currently unavailable", HTTPStatus: 400} ) const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.2+ce1f0a6" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.3+8dcb1fd" type WebrpcGenVersions struct { WebrpcGenVersion string From b6e4c7e161187a13eecfaf750285061983ec5b18 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 4 Dec 2025 12:51:29 +0000 Subject: [PATCH 096/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 99000539..091135bd 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.3+8dcb1fd 234bfe732044d250beb6731912bd5582c446f7df +// trails-api v1-25.12.3+fafa69c8 b6f38714592e4e4dbbb9527776d8823e132aa088 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.3+8dcb1fd" + return "v1-25.12.3+fafa69c8" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "234bfe732044d250beb6731912bd5582c446f7df" + return "b6f38714592e4e4dbbb9527776d8823e132aa088" } // @@ -532,6 +532,7 @@ type Intent struct { Quote *IntentProviderQuote `json:"quote" db:"quote"` Fees *IntentFees `json:"fees" db:"fees"` TrailsVersion string `json:"trailsVersion" db:"trails_version"` + TrailsContracts *TrailsContracts `json:"trailsContracts" db:"trails_contracts"` ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` @@ -1015,8 +1016,7 @@ type QuoteIntentResponse struct { // is called by clients to confirm they wish to commit to the intent and will execute it. // We return the intent ID for tracking. type CommitIntentRequest struct { - Intent *Intent `json:"intent"` - TrailsContracts *TrailsContracts `json:"trailsContracts"` + Intent *Intent `json:"intent"` } type CommitIntentResponse struct { @@ -1923,7 +1923,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.3+8dcb1fd" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.3+fafa69c8" type WebrpcGenVersions struct { WebrpcGenVersion string From 0ac4c2178ab6bab082dbbd6d179beb066d0592f2 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 4 Dec 2025 20:44:26 +0000 Subject: [PATCH 097/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 091135bd..5ea24b36 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.3+fafa69c8 b6f38714592e4e4dbbb9527776d8823e132aa088 +// trails-api v1-25.12.5+99a7cf6a 358059b42ed3b044f134c64c4187f99f53b8fe8c // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.3+fafa69c8" + return "v1-25.12.5+99a7cf6a" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "b6f38714592e4e4dbbb9527776d8823e132aa088" + return "358059b42ed3b044f134c64c4187f99f53b8fe8c" } // @@ -496,8 +496,8 @@ type QuoteIntentRequestOptions struct { SwapProvider RouteProvider `json:"swapProvider,omitempty"` BridgeProvider RouteProvider `json:"bridgeProvider,omitempty"` // slippageTolerance is a decimal amount, for example - // 0.001 is 0.1% slippage tolerance. If not specified, - // a default of 0.005 (0.5%) is used. + // 0.001 is 0.1% slippage tolerance. If not specified (null), + // AUTO mode is used where optimal slippage is calculated dynamically based on transaction USD value + routing provider. SlippageTolerance *float64 `json:"slippageTolerance,omitempty"` TrailsAddressOverrides *TrailsAddressOverrides `json:"trailsAddressOverrides,omitempty"` } @@ -1923,7 +1923,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.3+fafa69c8" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+99a7cf6a" type WebrpcGenVersions struct { WebrpcGenVersion string From 76bf0debe93d9f61ddd05cb3956d5530d061b4ef Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:05:41 +0000 Subject: [PATCH 098/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 53 ++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 5ea24b36..3c01dfcf 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.5+99a7cf6a 358059b42ed3b044f134c64c4187f99f53b8fe8c +// trails-api v1-25.12.5+5cd45de0 bae02d830b885452984d8a9d27273d06691354a4 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.5+99a7cf6a" + return "v1-25.12.5+5cd45de0" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "358059b42ed3b044f134c64c4187f99f53b8fe8c" + return "bae02d830b885452984d8a9d27273d06691354a4" } // @@ -54,6 +54,7 @@ type TrailsClient interface { GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) + RequeueIntent(ctx context.Context, requeueIntentRequest RequeueIntentRequest) (*RequeueIntentResponse, error) // GetChains will return the list of supported chains by Trails. GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) // GetExactOutputRoutes will return a list of origin tokens, when given a destination chain and token, @@ -1110,6 +1111,17 @@ type GetIntentTransactionHistoryResponse struct { NextPage *Page `json:"nextPage"` } +// RequeueIntent allows admins to requeue stuck/aborted intent transactions. +type RequeueIntentRequest struct { + IntentID prototyp.Hash `json:"intentId"` +} + +type RequeueIntentResponse struct { + IntentID prototyp.Hash `json:"intentId"` + RequeuedTransactions int `json:"requeuedTransactions"` + Status IntentStatus `json:"status"` +} + type GetTokenPricesRequest struct { Tokens []*Token `json:"tokens"` } @@ -1213,12 +1225,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [18]string + urls [19]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [18]string{ + urls := [19]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1231,6 +1243,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetIntent", prefix + "SearchIntents", prefix + "GetIntentTransactionHistory", + prefix + "RequeueIntent", prefix + "GetChains", prefix + "GetExactOutputRoutes", prefix + "GetExactInputRoutes", @@ -1436,12 +1449,28 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten return out.Ret0, err } +func (c *trailsClient) RequeueIntent(ctx context.Context, requeueIntentRequest RequeueIntentRequest) (*RequeueIntentResponse, error) { + out := struct { + Ret0 *RequeueIntentResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], requeueIntentRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + func (c *trailsClient) GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) { out := struct { Ret0 *GetChainsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getChainsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getChainsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1457,7 +1486,7 @@ func (c *trailsClient) GetExactOutputRoutes(ctx context.Context, getExactOutputR Ret0 *GetExactOutputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactOutputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactOutputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1473,7 +1502,7 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou Ret0 *GetExactInputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactInputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getExactInputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1489,7 +1518,7 @@ func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest Get Ret0 *GetTokenListResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenListRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenListRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1505,7 +1534,7 @@ func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenPricesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], getTokenPricesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1521,7 +1550,7 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts Ret0 *TrailsContracts `json:"TrailsContracts"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[18], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1923,7 +1952,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+99a7cf6a" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+5cd45de0" type WebrpcGenVersions struct { WebrpcGenVersion string From 801fc88272acc0b24a8ca7924e28948984cdfbd9 Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:06:11 +0000 Subject: [PATCH 099/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 53 ++++++++---------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 3c01dfcf..5ea24b36 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.5+5cd45de0 bae02d830b885452984d8a9d27273d06691354a4 +// trails-api v1-25.12.5+99a7cf6a 358059b42ed3b044f134c64c4187f99f53b8fe8c // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.5+5cd45de0" + return "v1-25.12.5+99a7cf6a" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "bae02d830b885452984d8a9d27273d06691354a4" + return "358059b42ed3b044f134c64c4187f99f53b8fe8c" } // @@ -54,7 +54,6 @@ type TrailsClient interface { GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) - RequeueIntent(ctx context.Context, requeueIntentRequest RequeueIntentRequest) (*RequeueIntentResponse, error) // GetChains will return the list of supported chains by Trails. GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) // GetExactOutputRoutes will return a list of origin tokens, when given a destination chain and token, @@ -1111,17 +1110,6 @@ type GetIntentTransactionHistoryResponse struct { NextPage *Page `json:"nextPage"` } -// RequeueIntent allows admins to requeue stuck/aborted intent transactions. -type RequeueIntentRequest struct { - IntentID prototyp.Hash `json:"intentId"` -} - -type RequeueIntentResponse struct { - IntentID prototyp.Hash `json:"intentId"` - RequeuedTransactions int `json:"requeuedTransactions"` - Status IntentStatus `json:"status"` -} - type GetTokenPricesRequest struct { Tokens []*Token `json:"tokens"` } @@ -1225,12 +1213,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [19]string + urls [18]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [19]string{ + urls := [18]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1243,7 +1231,6 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetIntent", prefix + "SearchIntents", prefix + "GetIntentTransactionHistory", - prefix + "RequeueIntent", prefix + "GetChains", prefix + "GetExactOutputRoutes", prefix + "GetExactInputRoutes", @@ -1449,28 +1436,12 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten return out.Ret0, err } -func (c *trailsClient) RequeueIntent(ctx context.Context, requeueIntentRequest RequeueIntentRequest) (*RequeueIntentResponse, error) { - out := struct { - Ret0 *RequeueIntentResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], requeueIntentRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - func (c *trailsClient) GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) { out := struct { Ret0 *GetChainsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getChainsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getChainsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1486,7 +1457,7 @@ func (c *trailsClient) GetExactOutputRoutes(ctx context.Context, getExactOutputR Ret0 *GetExactOutputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactOutputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactOutputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1502,7 +1473,7 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou Ret0 *GetExactInputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getExactInputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactInputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1518,7 +1489,7 @@ func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest Get Ret0 *GetTokenListResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenListRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenListRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1534,7 +1505,7 @@ func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], getTokenPricesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenPricesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1550,7 +1521,7 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts Ret0 *TrailsContracts `json:"TrailsContracts"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[18], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1952,7 +1923,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+5cd45de0" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+99a7cf6a" type WebrpcGenVersions struct { WebrpcGenVersion string From 39349ec63847a86afd14dcc05a6835ae80c3649c Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 5 Dec 2025 17:57:53 +0000 Subject: [PATCH 100/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 5ea24b36..da517652 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.5+99a7cf6a 358059b42ed3b044f134c64c4187f99f53b8fe8c +// trails-api v1-25.12.5+00512a0 6ff7b08b652b06818bd6e0f4c6a5988c4a2ab3e3 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.5+99a7cf6a" + return "v1-25.12.5+00512a0" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "358059b42ed3b044f134c64c4187f99f53b8fe8c" + return "6ff7b08b652b06818bd6e0f4c6a5988c4a2ab3e3" } // @@ -1089,6 +1089,7 @@ type SearchIntentsRequest struct { ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` ByOriginIntentAddress prototyp.Hash `json:"byOriginIntentAddress"` ByDestinationIntentAddress prototyp.Hash `json:"byDestinationIntentAddress"` + ByQueryString string `json:"byQueryString"` } type SearchIntentsResponse struct { @@ -1923,7 +1924,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+99a7cf6a" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+00512a0" type WebrpcGenVersions struct { WebrpcGenVersion string From 8596ee5e89a9c91d767901aa70f845c1479f1bca Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 5 Dec 2025 21:01:57 +0000 Subject: [PATCH 101/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index da517652..be19574d 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,9 +1,9 @@ -// trails-api v1-25.12.5+00512a0 6ff7b08b652b06818bd6e0f4c6a5988c4a2ab3e3 +// trails-api v1-25.12.5+27b66c1 eacf951b60403fd1bccecabaae8f10df24db5aff // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // -// webrpc-gen -schema=trails-api.ridl -target=golang -pkg=api -client -out=./clients/trails-api.gen.go -package api +// webrpc-gen -schema=trails-api.ridl -target=golang -pkg=trailsapi -client -service=Trails -out=./clients/trails-api.gen.go +package trailsapi import ( "bytes" @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.5+00512a0" + return "v1-25.12.5+27b66c1" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "6ff7b08b652b06818bd6e0f4c6a5988c4a2ab3e3" + return "eacf951b60403fd1bccecabaae8f10df24db5aff" } // @@ -1206,6 +1206,19 @@ type SortBy struct { Order SortOrder `json:"order"` } +type AdminRequeueIntentTransactionRequest struct { + IntentID prototyp.Hash `json:"intentId"` + Origin *bool `json:"origin"` + Destination *bool `json:"destination"` + OriginMinAmountOverride *prototyp.BigInt `json:"originMinAmountOverride"` + DestinationMinAmountOverride *prototyp.BigInt `json:"destinationMinAmountOverride"` +} + +type AdminRequeueIntentTransactionResponse struct { + Status bool `json:"status"` + Message string `json:"message"` +} + // // Client // @@ -1924,7 +1937,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+00512a0" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+27b66c1" type WebrpcGenVersions struct { WebrpcGenVersion string From 3fe53c2983019a372bffa1817cc36994c80946f2 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 8 Dec 2025 01:23:30 +0000 Subject: [PATCH 102/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index be19574d..cf59800e 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.5+27b66c1 eacf951b60403fd1bccecabaae8f10df24db5aff +// trails-api v1-25.12.7+57f806f8 9c057baa53b644b8c8494a33ae95db08701dbed8 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.5+27b66c1" + return "v1-25.12.7+57f806f8" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "eacf951b60403fd1bccecabaae8f10df24db5aff" + return "9c057baa53b644b8c8494a33ae95db08701dbed8" } // @@ -1219,6 +1219,17 @@ type AdminRequeueIntentTransactionResponse struct { Message string `json:"message"` } +type AdminDeployCCTPMessageWalletRequest struct { + ChainID uint64 `json:"chainId"` +} + +type AdminDeployCCTPMessageWalletResponse struct { + ChainID uint64 `json:"chainId"` + WalletAddress prototyp.Hash `json:"walletAddress"` + Deployed bool `json:"deployed"` + DeploymentTxHash *prototyp.Hash `json:"deploymentTxHash"` +} + // // Client // @@ -1937,7 +1948,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.5+27b66c1" +const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.7+57f806f8" type WebrpcGenVersions struct { WebrpcGenVersion string From bc54129261d4ebc13f1ed4410febfc4f6c2fefad Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 8 Dec 2025 02:24:26 +0000 Subject: [PATCH 103/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index cf59800e..895c85d4 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,8 +1,8 @@ -// trails-api v1-25.12.7+57f806f8 9c057baa53b644b8c8494a33ae95db08701dbed8 +// trails-api v1-25.12.8+54b16ca5 edd36f307b8b4b130f5eb039448d81ed02fdd851 // -- -// Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // -// webrpc-gen -schema=trails-api.ridl -target=golang -pkg=trailsapi -client -service=Trails -out=./clients/trails-api.gen.go +// webrpc-gen -schema=trails-api.ridl -target=golang -pkg=trailsapi -client -service=Trails -methodTreeShake -out=./clients/trails-api.gen.go package trailsapi import ( @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.7+57f806f8" + return "v1-25.12.8+54b16ca5" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "9c057baa53b644b8c8494a33ae95db08701dbed8" + return "edd36f307b8b4b130f5eb039448d81ed02fdd851" } // @@ -1206,30 +1206,6 @@ type SortBy struct { Order SortOrder `json:"order"` } -type AdminRequeueIntentTransactionRequest struct { - IntentID prototyp.Hash `json:"intentId"` - Origin *bool `json:"origin"` - Destination *bool `json:"destination"` - OriginMinAmountOverride *prototyp.BigInt `json:"originMinAmountOverride"` - DestinationMinAmountOverride *prototyp.BigInt `json:"destinationMinAmountOverride"` -} - -type AdminRequeueIntentTransactionResponse struct { - Status bool `json:"status"` - Message string `json:"message"` -} - -type AdminDeployCCTPMessageWalletRequest struct { - ChainID uint64 `json:"chainId"` -} - -type AdminDeployCCTPMessageWalletResponse struct { - ChainID uint64 `json:"chainId"` - WalletAddress prototyp.Hash `json:"walletAddress"` - Deployed bool `json:"deployed"` - DeploymentTxHash *prototyp.Hash `json:"deploymentTxHash"` -} - // // Client // @@ -1948,7 +1924,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;trails-api@v1-25.12.7+57f806f8" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+54b16ca5" type WebrpcGenVersions struct { WebrpcGenVersion string From 50709040673ca6d6700517e092e5a521d1d1d417 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 8 Dec 2025 17:09:12 +0000 Subject: [PATCH 104/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 388 ++++++++++++++++++++++++++++++++++- 1 file changed, 382 insertions(+), 6 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 895c85d4..727bc251 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.8+54b16ca5 edd36f307b8b4b130f5eb039448d81ed02fdd851 +// trails-api v1-25.12.5+1f4414b 546bf49a96a4d9387e7fae4b07337f5afc38c949 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.8+54b16ca5" + return "v1-25.12.5+1f4414b" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "edd36f307b8b4b130f5eb039448d81ed02fdd851" + return "546bf49a96a4d9387e7fae4b07337f5afc38c949" } // @@ -90,6 +90,26 @@ type TrailsClient interface { GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) // GetTrailsContracts returns Trails contract addresses used by the Trails Intents stack. GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) + // GetMeldCountryDefaults returns default currency and payment methods for a country. + GetMeldCountryDefaults(ctx context.Context, getMeldCountryDefaultsRequest GetMeldCountryDefaultsRequest) (*GetMeldCountryDefaultsResponse, error) + // GetMeldFiatCurrencies returns available fiat currencies for a country. + GetMeldFiatCurrencies(ctx context.Context, getMeldFiatCurrenciesRequest GetMeldFiatCurrenciesRequest) (*GetMeldFiatCurrenciesResponse, error) + // GetMeldPaymentMethods returns payment methods available for a fiat currency. + GetMeldPaymentMethods(ctx context.Context, getMeldPaymentMethodsRequest GetMeldPaymentMethodsRequest) (*GetMeldPaymentMethodsResponse, error) + // GetMeldCryptoCurrencies returns available cryptocurrencies for a country. + GetMeldCryptoCurrencies(ctx context.Context, getMeldCryptoCurrenciesRequest GetMeldCryptoCurrenciesRequest) (*GetMeldCryptoCurrenciesResponse, error) + // GetMeldPurchaseLimits returns purchase limits for all fiat currencies. + GetMeldPurchaseLimits(ctx context.Context, getMeldPurchaseLimitsRequest GetMeldPurchaseLimitsRequest) (*GetMeldPurchaseLimitsResponse, error) + // GetMeldQuote returns real-time quotes from multiple providers. + GetMeldQuote(ctx context.Context, getMeldQuoteRequest GetMeldQuoteRequest) (*GetMeldQuoteResponse, error) + // CreateMeldWidgetSession creates a widget session and returns the provider URL. + CreateMeldWidgetSession(ctx context.Context, createMeldWidgetSessionRequest CreateMeldWidgetSessionRequest) (*CreateMeldWidgetSessionResponse, error) + // GetMeldTransaction returns transaction details by transaction ID. + GetMeldTransaction(ctx context.Context, getMeldTransactionRequest GetMeldTransactionRequest) (*GetMeldTransactionResponse, error) + // SearchMeldTransactions returns transactions matching the search criteria. + SearchMeldTransactions(ctx context.Context, searchMeldTransactionsRequest SearchMeldTransactionsRequest) (*SearchMeldTransactionsResponse, error) + // CreateMeldBankLinkingConnection creates a bank linking connection for ACH transfers. + CreateMeldBankLinkingConnection(ctx context.Context, createMeldBankLinkingConnectionRequest CreateMeldBankLinkingConnectionRequest) (*CreateMeldBankLinkingConnectionResponse, error) } // @@ -1184,6 +1204,192 @@ type GetTokenListResponse struct { Tokens []*TokenInfo `json:"tokens"` } +type GetMeldCountryDefaultsRequest struct { + CountryCode string `json:"countryCode"` +} + +type GetMeldCountryDefaultsResponse struct { + Defaults json.RawMessage `json:"defaults"` +} + +type MeldCountryDefault struct { + CountryCode string `json:"countryCode"` + DefaultCurrencyCode string `json:"defaultCurrencyCode"` + DefaultPaymentMethods []string `json:"defaultPaymentMethods"` +} + +type GetMeldFiatCurrenciesRequest struct { + CountryCode string `json:"countryCode"` +} + +type GetMeldFiatCurrenciesResponse struct { + FiatCurrencies json.RawMessage `json:"fiatCurrencies"` +} + +type MeldFiatCurrency struct { + CurrencyCode string `json:"currencyCode"` + Name string `json:"name"` + SymbolImageUrl string `json:"symbolImageUrl"` +} + +type GetMeldPaymentMethodsRequest struct { + FiatCurrency string `json:"fiatCurrency"` +} + +type GetMeldPaymentMethodsResponse struct { + PaymentMethods json.RawMessage `json:"paymentMethods"` +} + +type MeldPaymentMethod struct { + PaymentMethod string `json:"paymentMethod"` + Name string `json:"name"` + PaymentType string `json:"paymentType"` + Logos *MeldPaymentLogos `json:"logos"` +} + +type MeldPaymentLogos struct { + Dark string `json:"dark"` + Light string `json:"light"` +} + +type GetMeldCryptoCurrenciesRequest struct { + CountryCode string `json:"countryCode"` +} + +type GetMeldCryptoCurrenciesResponse struct { + CryptoCurrencies json.RawMessage `json:"cryptoCurrencies"` +} + +type MeldCryptoCurrency struct { + CurrencyCode string `json:"currencyCode"` + Name string `json:"name"` + ChainCode string `json:"chainCode"` + ChainName string `json:"chainName"` + ChainId string `json:"chainId,omitempty"` + ContractAddress string `json:"contractAddress,omitempty"` + SymbolImageUrl string `json:"symbolImageUrl"` +} + +type GetMeldPurchaseLimitsRequest struct { +} + +type GetMeldPurchaseLimitsResponse struct { + Limits json.RawMessage `json:"limits"` +} + +type MeldCurrencyLimits struct { + DefaultAmount float64 `json:"defaultAmount,omitempty"` + MinimumAmount float64 `json:"minimumAmount"` + MaximumAmount float64 `json:"maximumAmount"` +} + +type GetMeldQuoteRequest struct { + SourceAmount string `json:"sourceAmount"` + SourceCurrencyCode string `json:"sourceCurrencyCode"` + DestinationCurrencyCode string `json:"destinationCurrencyCode"` + CountryCode string `json:"countryCode"` + WalletAddress prototyp.Hash `json:"walletAddress"` +} + +type GetMeldQuoteResponse struct { + QuoteResponse json.RawMessage `json:",inline"` +} + +type MeldQuote struct { + TransactionType string `json:"transactionType"` + SourceAmount float64 `json:"sourceAmount"` + SourceAmountWithoutFees float64 `json:"sourceAmountWithoutFees"` + FiatAmountWithoutFees float64 `json:"fiatAmountWithoutFees"` + DestinationAmountWithoutFees float64 `json:"destinationAmountWithoutFees,omitempty"` + SourceCurrencyCode string `json:"sourceCurrencyCode"` + CountryCode string `json:"countryCode"` + TotalFee float64 `json:"totalFee"` + NetworkFee float64 `json:"networkFee"` + TransactionFee float64 `json:"transactionFee"` + DestinationAmount float64 `json:"destinationAmount"` + DestinationCurrencyCode string `json:"destinationCurrencyCode"` + ExchangeRate float64 `json:"exchangeRate"` + PaymentMethodType string `json:"paymentMethodType"` + CustomerScore float64 `json:"customerScore"` + ServiceProvider string `json:"serviceProvider"` + InstitutionName string `json:"institutionName,omitempty"` + LowKyc bool `json:"lowKyc,omitempty"` + PartnerFee float64 `json:"partnerFee"` +} + +type CreateMeldWidgetSessionRequest struct { + SessionData *MeldSessionData `json:"sessionData"` + SessionType string `json:"sessionType"` + ExternalCustomerId string `json:"externalCustomerId"` + ExternalSessionId string `json:"externalSessionId"` +} + +type MeldSessionData struct { + WalletAddress prototyp.Hash `json:"walletAddress"` + CountryCode string `json:"countryCode"` + SourceCurrencyCode string `json:"sourceCurrencyCode"` + SourceAmount string `json:"sourceAmount"` + DestinationCurrencyCode string `json:"destinationCurrencyCode"` + ServiceProvider string `json:"serviceProvider"` + PaymentMethodType *string `json:"paymentMethodType"` + RedirectUrl *string `json:"redirectUrl"` +} + +type CreateMeldWidgetSessionResponse struct { + WidgetSession json.RawMessage `json:",inline"` +} + +type GetMeldTransactionRequest struct { + TransactionId string `json:"transactionId"` +} + +type GetMeldTransactionResponse struct { + Transaction json.RawMessage `json:"transaction"` +} + +type SearchMeldTransactionsRequest struct { + Statuses *string `json:"statuses"` + ExternalSessionIds *string `json:"externalSessionIds"` + ExternalCustomerIds *string `json:"externalCustomerIds"` + CustomerIds *string `json:"customerIds"` + SessionIds *string `json:"sessionIds"` + SessionId *string `json:"sessionId"` + From *string `json:"from"` + To *string `json:"to"` + Limit *uint32 `json:"limit"` +} + +type SearchMeldTransactionsResponse struct { + Transactions json.RawMessage `json:"transactions"` +} + +type MeldTransaction struct { + Id string `json:"id"` +} + +type MeldTransactions struct { + Transactions []*MeldTransaction `json:"transactions"` +} + +type CreateMeldBankLinkingConnectionRequest struct { + ExternalCustomerId string `json:"externalCustomerId"` + InstitutionId *string `json:"institutionId"` + InstitutionSearchString *string `json:"institutionSearchString"` + Products []string `json:"products"` + OptionalProducts []string `json:"optionalProducts"` + RedirectUrl *string `json:"redirectUrl"` + Regions []string `json:"regions"` + AccountPreferenceOverride *MeldAccountPreferenceOverride `json:"accountPreferenceOverride"` +} + +type MeldAccountPreferenceOverride struct { + AllowRedirect *bool `json:"allowRedirect"` +} + +type CreateMeldBankLinkingConnectionResponse struct { + ConnectionResponse json.RawMessage `json:",inline"` +} + // Page represents a results page. This can be used both to request a page and // to store the state of a page. type Page struct { @@ -1214,12 +1420,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [18]string + urls [28]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [18]string{ + urls := [28]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1238,6 +1444,16 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetTokenList", prefix + "GetTokenPrices", prefix + "GetTrailsContracts", + prefix + "GetMeldCountryDefaults", + prefix + "GetMeldFiatCurrencies", + prefix + "GetMeldPaymentMethods", + prefix + "GetMeldCryptoCurrencies", + prefix + "GetMeldPurchaseLimits", + prefix + "GetMeldQuote", + prefix + "CreateMeldWidgetSession", + prefix + "GetMeldTransaction", + prefix + "SearchMeldTransactions", + prefix + "CreateMeldBankLinkingConnection", } return &trailsClient{ client: client, @@ -1533,6 +1749,166 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts return out.Ret0, err } +func (c *trailsClient) GetMeldCountryDefaults(ctx context.Context, getMeldCountryDefaultsRequest GetMeldCountryDefaultsRequest) (*GetMeldCountryDefaultsResponse, error) { + out := struct { + Ret0 *GetMeldCountryDefaultsResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[18], getMeldCountryDefaultsRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetMeldFiatCurrencies(ctx context.Context, getMeldFiatCurrenciesRequest GetMeldFiatCurrenciesRequest) (*GetMeldFiatCurrenciesResponse, error) { + out := struct { + Ret0 *GetMeldFiatCurrenciesResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[19], getMeldFiatCurrenciesRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetMeldPaymentMethods(ctx context.Context, getMeldPaymentMethodsRequest GetMeldPaymentMethodsRequest) (*GetMeldPaymentMethodsResponse, error) { + out := struct { + Ret0 *GetMeldPaymentMethodsResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[20], getMeldPaymentMethodsRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetMeldCryptoCurrencies(ctx context.Context, getMeldCryptoCurrenciesRequest GetMeldCryptoCurrenciesRequest) (*GetMeldCryptoCurrenciesResponse, error) { + out := struct { + Ret0 *GetMeldCryptoCurrenciesResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[21], getMeldCryptoCurrenciesRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetMeldPurchaseLimits(ctx context.Context, getMeldPurchaseLimitsRequest GetMeldPurchaseLimitsRequest) (*GetMeldPurchaseLimitsResponse, error) { + out := struct { + Ret0 *GetMeldPurchaseLimitsResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[22], getMeldPurchaseLimitsRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetMeldQuote(ctx context.Context, getMeldQuoteRequest GetMeldQuoteRequest) (*GetMeldQuoteResponse, error) { + out := struct { + Ret0 *GetMeldQuoteResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[23], getMeldQuoteRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) CreateMeldWidgetSession(ctx context.Context, createMeldWidgetSessionRequest CreateMeldWidgetSessionRequest) (*CreateMeldWidgetSessionResponse, error) { + out := struct { + Ret0 *CreateMeldWidgetSessionResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[24], createMeldWidgetSessionRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) GetMeldTransaction(ctx context.Context, getMeldTransactionRequest GetMeldTransactionRequest) (*GetMeldTransactionResponse, error) { + out := struct { + Ret0 *GetMeldTransactionResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[25], getMeldTransactionRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) SearchMeldTransactions(ctx context.Context, searchMeldTransactionsRequest SearchMeldTransactionsRequest) (*SearchMeldTransactionsResponse, error) { + out := struct { + Ret0 *SearchMeldTransactionsResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[26], searchMeldTransactionsRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *trailsClient) CreateMeldBankLinkingConnection(ctx context.Context, createMeldBankLinkingConnectionRequest CreateMeldBankLinkingConnectionRequest) (*CreateMeldBankLinkingConnectionResponse, error) { + out := struct { + Ret0 *CreateMeldBankLinkingConnectionResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[27], createMeldBankLinkingConnectionRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + // // Client helpers // @@ -1924,7 +2300,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+54b16ca5" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.5+1f4414b" type WebrpcGenVersions struct { WebrpcGenVersion string From 8e95982e5135f1cae1d8fa1706e40af35924f3b3 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 8 Dec 2025 17:56:59 +0000 Subject: [PATCH 105/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 727bc251..43754a2d 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.5+1f4414b 546bf49a96a4d9387e7fae4b07337f5afc38c949 +// trails-api v1-25.12.8+e61353a7 5ea69f630985d2a31b9c42bf442ec522c75a00ae // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.5+1f4414b" + return "v1-25.12.8+e61353a7" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "546bf49a96a4d9387e7fae4b07337f5afc38c949" + return "5ea69f630985d2a31b9c42bf442ec522c75a00ae" } // @@ -2300,7 +2300,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.5+1f4414b" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+e61353a7" type WebrpcGenVersions struct { WebrpcGenVersion string From 908d837f465ba3f07b33b258a81edbbf44226bdd Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:18:26 +0000 Subject: [PATCH 106/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 366 +---------------------------------- 1 file changed, 6 insertions(+), 360 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 43754a2d..d80eccc2 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.8+e61353a7 5ea69f630985d2a31b9c42bf442ec522c75a00ae +// trails-api v1-25.12.9+59332b3 f3a3b6cc39b8c2e9ae4b50075f846b9d383d8bb0 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.8+e61353a7" + return "v1-25.12.9+59332b3" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "5ea69f630985d2a31b9c42bf442ec522c75a00ae" + return "f3a3b6cc39b8c2e9ae4b50075f846b9d383d8bb0" } // @@ -90,26 +90,6 @@ type TrailsClient interface { GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) // GetTrailsContracts returns Trails contract addresses used by the Trails Intents stack. GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) - // GetMeldCountryDefaults returns default currency and payment methods for a country. - GetMeldCountryDefaults(ctx context.Context, getMeldCountryDefaultsRequest GetMeldCountryDefaultsRequest) (*GetMeldCountryDefaultsResponse, error) - // GetMeldFiatCurrencies returns available fiat currencies for a country. - GetMeldFiatCurrencies(ctx context.Context, getMeldFiatCurrenciesRequest GetMeldFiatCurrenciesRequest) (*GetMeldFiatCurrenciesResponse, error) - // GetMeldPaymentMethods returns payment methods available for a fiat currency. - GetMeldPaymentMethods(ctx context.Context, getMeldPaymentMethodsRequest GetMeldPaymentMethodsRequest) (*GetMeldPaymentMethodsResponse, error) - // GetMeldCryptoCurrencies returns available cryptocurrencies for a country. - GetMeldCryptoCurrencies(ctx context.Context, getMeldCryptoCurrenciesRequest GetMeldCryptoCurrenciesRequest) (*GetMeldCryptoCurrenciesResponse, error) - // GetMeldPurchaseLimits returns purchase limits for all fiat currencies. - GetMeldPurchaseLimits(ctx context.Context, getMeldPurchaseLimitsRequest GetMeldPurchaseLimitsRequest) (*GetMeldPurchaseLimitsResponse, error) - // GetMeldQuote returns real-time quotes from multiple providers. - GetMeldQuote(ctx context.Context, getMeldQuoteRequest GetMeldQuoteRequest) (*GetMeldQuoteResponse, error) - // CreateMeldWidgetSession creates a widget session and returns the provider URL. - CreateMeldWidgetSession(ctx context.Context, createMeldWidgetSessionRequest CreateMeldWidgetSessionRequest) (*CreateMeldWidgetSessionResponse, error) - // GetMeldTransaction returns transaction details by transaction ID. - GetMeldTransaction(ctx context.Context, getMeldTransactionRequest GetMeldTransactionRequest) (*GetMeldTransactionResponse, error) - // SearchMeldTransactions returns transactions matching the search criteria. - SearchMeldTransactions(ctx context.Context, searchMeldTransactionsRequest SearchMeldTransactionsRequest) (*SearchMeldTransactionsResponse, error) - // CreateMeldBankLinkingConnection creates a bank linking connection for ACH transfers. - CreateMeldBankLinkingConnection(ctx context.Context, createMeldBankLinkingConnectionRequest CreateMeldBankLinkingConnectionRequest) (*CreateMeldBankLinkingConnectionResponse, error) } // @@ -1204,97 +1184,6 @@ type GetTokenListResponse struct { Tokens []*TokenInfo `json:"tokens"` } -type GetMeldCountryDefaultsRequest struct { - CountryCode string `json:"countryCode"` -} - -type GetMeldCountryDefaultsResponse struct { - Defaults json.RawMessage `json:"defaults"` -} - -type MeldCountryDefault struct { - CountryCode string `json:"countryCode"` - DefaultCurrencyCode string `json:"defaultCurrencyCode"` - DefaultPaymentMethods []string `json:"defaultPaymentMethods"` -} - -type GetMeldFiatCurrenciesRequest struct { - CountryCode string `json:"countryCode"` -} - -type GetMeldFiatCurrenciesResponse struct { - FiatCurrencies json.RawMessage `json:"fiatCurrencies"` -} - -type MeldFiatCurrency struct { - CurrencyCode string `json:"currencyCode"` - Name string `json:"name"` - SymbolImageUrl string `json:"symbolImageUrl"` -} - -type GetMeldPaymentMethodsRequest struct { - FiatCurrency string `json:"fiatCurrency"` -} - -type GetMeldPaymentMethodsResponse struct { - PaymentMethods json.RawMessage `json:"paymentMethods"` -} - -type MeldPaymentMethod struct { - PaymentMethod string `json:"paymentMethod"` - Name string `json:"name"` - PaymentType string `json:"paymentType"` - Logos *MeldPaymentLogos `json:"logos"` -} - -type MeldPaymentLogos struct { - Dark string `json:"dark"` - Light string `json:"light"` -} - -type GetMeldCryptoCurrenciesRequest struct { - CountryCode string `json:"countryCode"` -} - -type GetMeldCryptoCurrenciesResponse struct { - CryptoCurrencies json.RawMessage `json:"cryptoCurrencies"` -} - -type MeldCryptoCurrency struct { - CurrencyCode string `json:"currencyCode"` - Name string `json:"name"` - ChainCode string `json:"chainCode"` - ChainName string `json:"chainName"` - ChainId string `json:"chainId,omitempty"` - ContractAddress string `json:"contractAddress,omitempty"` - SymbolImageUrl string `json:"symbolImageUrl"` -} - -type GetMeldPurchaseLimitsRequest struct { -} - -type GetMeldPurchaseLimitsResponse struct { - Limits json.RawMessage `json:"limits"` -} - -type MeldCurrencyLimits struct { - DefaultAmount float64 `json:"defaultAmount,omitempty"` - MinimumAmount float64 `json:"minimumAmount"` - MaximumAmount float64 `json:"maximumAmount"` -} - -type GetMeldQuoteRequest struct { - SourceAmount string `json:"sourceAmount"` - SourceCurrencyCode string `json:"sourceCurrencyCode"` - DestinationCurrencyCode string `json:"destinationCurrencyCode"` - CountryCode string `json:"countryCode"` - WalletAddress prototyp.Hash `json:"walletAddress"` -} - -type GetMeldQuoteResponse struct { - QuoteResponse json.RawMessage `json:",inline"` -} - type MeldQuote struct { TransactionType string `json:"transactionType"` SourceAmount float64 `json:"sourceAmount"` @@ -1317,79 +1206,6 @@ type MeldQuote struct { PartnerFee float64 `json:"partnerFee"` } -type CreateMeldWidgetSessionRequest struct { - SessionData *MeldSessionData `json:"sessionData"` - SessionType string `json:"sessionType"` - ExternalCustomerId string `json:"externalCustomerId"` - ExternalSessionId string `json:"externalSessionId"` -} - -type MeldSessionData struct { - WalletAddress prototyp.Hash `json:"walletAddress"` - CountryCode string `json:"countryCode"` - SourceCurrencyCode string `json:"sourceCurrencyCode"` - SourceAmount string `json:"sourceAmount"` - DestinationCurrencyCode string `json:"destinationCurrencyCode"` - ServiceProvider string `json:"serviceProvider"` - PaymentMethodType *string `json:"paymentMethodType"` - RedirectUrl *string `json:"redirectUrl"` -} - -type CreateMeldWidgetSessionResponse struct { - WidgetSession json.RawMessage `json:",inline"` -} - -type GetMeldTransactionRequest struct { - TransactionId string `json:"transactionId"` -} - -type GetMeldTransactionResponse struct { - Transaction json.RawMessage `json:"transaction"` -} - -type SearchMeldTransactionsRequest struct { - Statuses *string `json:"statuses"` - ExternalSessionIds *string `json:"externalSessionIds"` - ExternalCustomerIds *string `json:"externalCustomerIds"` - CustomerIds *string `json:"customerIds"` - SessionIds *string `json:"sessionIds"` - SessionId *string `json:"sessionId"` - From *string `json:"from"` - To *string `json:"to"` - Limit *uint32 `json:"limit"` -} - -type SearchMeldTransactionsResponse struct { - Transactions json.RawMessage `json:"transactions"` -} - -type MeldTransaction struct { - Id string `json:"id"` -} - -type MeldTransactions struct { - Transactions []*MeldTransaction `json:"transactions"` -} - -type CreateMeldBankLinkingConnectionRequest struct { - ExternalCustomerId string `json:"externalCustomerId"` - InstitutionId *string `json:"institutionId"` - InstitutionSearchString *string `json:"institutionSearchString"` - Products []string `json:"products"` - OptionalProducts []string `json:"optionalProducts"` - RedirectUrl *string `json:"redirectUrl"` - Regions []string `json:"regions"` - AccountPreferenceOverride *MeldAccountPreferenceOverride `json:"accountPreferenceOverride"` -} - -type MeldAccountPreferenceOverride struct { - AllowRedirect *bool `json:"allowRedirect"` -} - -type CreateMeldBankLinkingConnectionResponse struct { - ConnectionResponse json.RawMessage `json:",inline"` -} - // Page represents a results page. This can be used both to request a page and // to store the state of a page. type Page struct { @@ -1420,12 +1236,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [28]string + urls [18]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [28]string{ + urls := [18]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -1444,16 +1260,6 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetTokenList", prefix + "GetTokenPrices", prefix + "GetTrailsContracts", - prefix + "GetMeldCountryDefaults", - prefix + "GetMeldFiatCurrencies", - prefix + "GetMeldPaymentMethods", - prefix + "GetMeldCryptoCurrencies", - prefix + "GetMeldPurchaseLimits", - prefix + "GetMeldQuote", - prefix + "CreateMeldWidgetSession", - prefix + "GetMeldTransaction", - prefix + "SearchMeldTransactions", - prefix + "CreateMeldBankLinkingConnection", } return &trailsClient{ client: client, @@ -1749,166 +1555,6 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts return out.Ret0, err } -func (c *trailsClient) GetMeldCountryDefaults(ctx context.Context, getMeldCountryDefaultsRequest GetMeldCountryDefaultsRequest) (*GetMeldCountryDefaultsResponse, error) { - out := struct { - Ret0 *GetMeldCountryDefaultsResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[18], getMeldCountryDefaultsRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) GetMeldFiatCurrencies(ctx context.Context, getMeldFiatCurrenciesRequest GetMeldFiatCurrenciesRequest) (*GetMeldFiatCurrenciesResponse, error) { - out := struct { - Ret0 *GetMeldFiatCurrenciesResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[19], getMeldFiatCurrenciesRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) GetMeldPaymentMethods(ctx context.Context, getMeldPaymentMethodsRequest GetMeldPaymentMethodsRequest) (*GetMeldPaymentMethodsResponse, error) { - out := struct { - Ret0 *GetMeldPaymentMethodsResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[20], getMeldPaymentMethodsRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) GetMeldCryptoCurrencies(ctx context.Context, getMeldCryptoCurrenciesRequest GetMeldCryptoCurrenciesRequest) (*GetMeldCryptoCurrenciesResponse, error) { - out := struct { - Ret0 *GetMeldCryptoCurrenciesResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[21], getMeldCryptoCurrenciesRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) GetMeldPurchaseLimits(ctx context.Context, getMeldPurchaseLimitsRequest GetMeldPurchaseLimitsRequest) (*GetMeldPurchaseLimitsResponse, error) { - out := struct { - Ret0 *GetMeldPurchaseLimitsResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[22], getMeldPurchaseLimitsRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) GetMeldQuote(ctx context.Context, getMeldQuoteRequest GetMeldQuoteRequest) (*GetMeldQuoteResponse, error) { - out := struct { - Ret0 *GetMeldQuoteResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[23], getMeldQuoteRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) CreateMeldWidgetSession(ctx context.Context, createMeldWidgetSessionRequest CreateMeldWidgetSessionRequest) (*CreateMeldWidgetSessionResponse, error) { - out := struct { - Ret0 *CreateMeldWidgetSessionResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[24], createMeldWidgetSessionRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) GetMeldTransaction(ctx context.Context, getMeldTransactionRequest GetMeldTransactionRequest) (*GetMeldTransactionResponse, error) { - out := struct { - Ret0 *GetMeldTransactionResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[25], getMeldTransactionRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) SearchMeldTransactions(ctx context.Context, searchMeldTransactionsRequest SearchMeldTransactionsRequest) (*SearchMeldTransactionsResponse, error) { - out := struct { - Ret0 *SearchMeldTransactionsResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[26], searchMeldTransactionsRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - -func (c *trailsClient) CreateMeldBankLinkingConnection(ctx context.Context, createMeldBankLinkingConnectionRequest CreateMeldBankLinkingConnectionRequest) (*CreateMeldBankLinkingConnectionResponse, error) { - out := struct { - Ret0 *CreateMeldBankLinkingConnectionResponse - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[27], createMeldBankLinkingConnectionRequest, &out.Ret0) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - // // Client helpers // @@ -2300,7 +1946,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+e61353a7" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.9+59332b3" type WebrpcGenVersions struct { WebrpcGenVersion string From 463132f4d08eed8be85d5c6bcb1b1e5c202a54f5 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:31:01 +0000 Subject: [PATCH 107/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index d80eccc2..ecedf73b 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,8 +1,8 @@ -// trails-api v1-25.12.9+59332b3 f3a3b6cc39b8c2e9ae4b50075f846b9d383d8bb0 +// trails-api v1-25.12.8+1406a1a 8bb8a8f2a22cd4d0c9292a477c1a2f29725190b7 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // -// webrpc-gen -schema=trails-api.ridl -target=golang -pkg=trailsapi -client -service=Trails -methodTreeShake -out=./clients/trails-api.gen.go +// webrpc-gen -schema=trails-api.ridl -target=golang -pkg=trailsapi -client -service=Trails -methodTreeShake -ignore=@onramp -out=./clients/trails-api.gen.go package trailsapi import ( @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.9+59332b3" + return "v1-25.12.8+1406a1a" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "f3a3b6cc39b8c2e9ae4b50075f846b9d383d8bb0" + return "8bb8a8f2a22cd4d0c9292a477c1a2f29725190b7" } // @@ -1184,28 +1184,6 @@ type GetTokenListResponse struct { Tokens []*TokenInfo `json:"tokens"` } -type MeldQuote struct { - TransactionType string `json:"transactionType"` - SourceAmount float64 `json:"sourceAmount"` - SourceAmountWithoutFees float64 `json:"sourceAmountWithoutFees"` - FiatAmountWithoutFees float64 `json:"fiatAmountWithoutFees"` - DestinationAmountWithoutFees float64 `json:"destinationAmountWithoutFees,omitempty"` - SourceCurrencyCode string `json:"sourceCurrencyCode"` - CountryCode string `json:"countryCode"` - TotalFee float64 `json:"totalFee"` - NetworkFee float64 `json:"networkFee"` - TransactionFee float64 `json:"transactionFee"` - DestinationAmount float64 `json:"destinationAmount"` - DestinationCurrencyCode string `json:"destinationCurrencyCode"` - ExchangeRate float64 `json:"exchangeRate"` - PaymentMethodType string `json:"paymentMethodType"` - CustomerScore float64 `json:"customerScore"` - ServiceProvider string `json:"serviceProvider"` - InstitutionName string `json:"institutionName,omitempty"` - LowKyc bool `json:"lowKyc,omitempty"` - PartnerFee float64 `json:"partnerFee"` -} - // Page represents a results page. This can be used both to request a page and // to store the state of a page. type Page struct { @@ -1228,6 +1206,28 @@ type SortBy struct { Order SortOrder `json:"order"` } +type MeldQuote struct { + TransactionType string `json:"transactionType"` + SourceAmount float64 `json:"sourceAmount"` + SourceAmountWithoutFees float64 `json:"sourceAmountWithoutFees"` + FiatAmountWithoutFees float64 `json:"fiatAmountWithoutFees"` + DestinationAmountWithoutFees float64 `json:"destinationAmountWithoutFees,omitempty"` + SourceCurrencyCode string `json:"sourceCurrencyCode"` + CountryCode string `json:"countryCode"` + TotalFee float64 `json:"totalFee"` + NetworkFee float64 `json:"networkFee"` + TransactionFee float64 `json:"transactionFee"` + DestinationAmount float64 `json:"destinationAmount"` + DestinationCurrencyCode string `json:"destinationCurrencyCode"` + ExchangeRate float64 `json:"exchangeRate"` + PaymentMethodType string `json:"paymentMethodType"` + CustomerScore float64 `json:"customerScore"` + ServiceProvider string `json:"serviceProvider"` + InstitutionName string `json:"institutionName,omitempty"` + LowKyc bool `json:"lowKyc,omitempty"` + PartnerFee float64 `json:"partnerFee"` +} + // // Client // @@ -1946,7 +1946,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.9+59332b3" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+1406a1a" type WebrpcGenVersions struct { WebrpcGenVersion string From c54ba474f7131f186c4c4ffc7f0286f41c02e968 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:33:45 +0000 Subject: [PATCH 108/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 52 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index ecedf73b..f259142e 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.8+1406a1a 8bb8a8f2a22cd4d0c9292a477c1a2f29725190b7 +// trails-api v1-25.12.8+af077ec 5f6853475edb5a7a4990a731d1cbfcc278c98a44 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.8+1406a1a" + return "v1-25.12.8+af077ec" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "8bb8a8f2a22cd4d0c9292a477c1a2f29725190b7" + return "5f6853475edb5a7a4990a731d1cbfcc278c98a44" } // @@ -933,6 +933,28 @@ type TokenInfo struct { FeatureIndex int `json:"-"` } +type MeldQuote struct { + TransactionType string `json:"transactionType"` + SourceAmount float64 `json:"sourceAmount"` + SourceAmountWithoutFees float64 `json:"sourceAmountWithoutFees"` + FiatAmountWithoutFees float64 `json:"fiatAmountWithoutFees"` + DestinationAmountWithoutFees float64 `json:"destinationAmountWithoutFees,omitempty"` + SourceCurrencyCode string `json:"sourceCurrencyCode"` + CountryCode string `json:"countryCode"` + TotalFee float64 `json:"totalFee"` + NetworkFee float64 `json:"networkFee"` + TransactionFee float64 `json:"transactionFee"` + DestinationAmount float64 `json:"destinationAmount"` + DestinationCurrencyCode string `json:"destinationCurrencyCode"` + ExchangeRate float64 `json:"exchangeRate"` + PaymentMethodType string `json:"paymentMethodType"` + CustomerScore float64 `json:"customerScore"` + ServiceProvider string `json:"serviceProvider"` + InstitutionName string `json:"institutionName,omitempty"` + LowKyc bool `json:"lowKyc,omitempty"` + PartnerFee float64 `json:"partnerFee"` +} + type SortOrder uint32 const ( @@ -1206,28 +1228,6 @@ type SortBy struct { Order SortOrder `json:"order"` } -type MeldQuote struct { - TransactionType string `json:"transactionType"` - SourceAmount float64 `json:"sourceAmount"` - SourceAmountWithoutFees float64 `json:"sourceAmountWithoutFees"` - FiatAmountWithoutFees float64 `json:"fiatAmountWithoutFees"` - DestinationAmountWithoutFees float64 `json:"destinationAmountWithoutFees,omitempty"` - SourceCurrencyCode string `json:"sourceCurrencyCode"` - CountryCode string `json:"countryCode"` - TotalFee float64 `json:"totalFee"` - NetworkFee float64 `json:"networkFee"` - TransactionFee float64 `json:"transactionFee"` - DestinationAmount float64 `json:"destinationAmount"` - DestinationCurrencyCode string `json:"destinationCurrencyCode"` - ExchangeRate float64 `json:"exchangeRate"` - PaymentMethodType string `json:"paymentMethodType"` - CustomerScore float64 `json:"customerScore"` - ServiceProvider string `json:"serviceProvider"` - InstitutionName string `json:"institutionName,omitempty"` - LowKyc bool `json:"lowKyc,omitempty"` - PartnerFee float64 `json:"partnerFee"` -} - // // Client // @@ -1946,7 +1946,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+1406a1a" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+af077ec" type WebrpcGenVersions struct { WebrpcGenVersion string From 9b7ae02ab4072513efa1e41308c059a6ccd972d5 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:07:00 +0000 Subject: [PATCH 109/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 83 +++++++++++++----------------------- 1 file changed, 29 insertions(+), 54 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index f259142e..745f293e 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.8+af077ec 5f6853475edb5a7a4990a731d1cbfcc278c98a44 +// trails-api v1-25.12.9+7479046b 31a12dd74b56457a79a8e8b57d1766f107db8d23 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.8+af077ec" + return "v1-25.12.9+7479046b" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "5f6853475edb5a7a4990a731d1cbfcc278c98a44" + return "31a12dd74b56457a79a8e8b57d1766f107db8d23" } // @@ -42,8 +42,7 @@ func WebRPCSchemaHash() string { // type TrailsClient interface { - Ping(ctx context.Context) (bool, error) - Version(ctx context.Context) (*Version, error) + Ping(ctx context.Context) (string, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) QuoteIntent(ctx context.Context, quoteIntentRequest QuoteIntentRequest) (*QuoteIntentResponse, error) @@ -997,22 +996,15 @@ func (x *SortOrder) Is(values ...SortOrder) bool { return false } -type Version struct { - WebrpcVersion string `json:"webrpcVersion"` - SchemaVersion string `json:"schemaVersion"` - SchemaHash string `json:"schemaHash"` - AppVersion string `json:"appVersion"` -} - type RuntimeStatus struct { // overall status, true/false HealthOK bool `json:"healthOK"` - StartTime time.Time `json:"startTime"` - Hostname string `json:"hostname"` - Uptime uint64 `json:"uptime"` - Ver string `json:"ver"` + Version string `json:"version"` Branch string `json:"branch"` CommitHash string `json:"commitHash"` + StartTime time.Time `json:"startTime"` + Uptime string `json:"uptime"` + Hostname string `json:"hostname"` Runnables interface{} `json:"runnables"` Services []*ServiceStatus `json:"services"` } @@ -1236,14 +1228,13 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [18]string + urls [17]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [18]string{ + urls := [17]string{ prefix + "Ping", - prefix + "Version", prefix + "RuntimeStatus", prefix + "Clock", prefix + "QuoteIntent", @@ -1267,9 +1258,9 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { } } -func (c *trailsClient) Ping(ctx context.Context) (bool, error) { +func (c *trailsClient) Ping(ctx context.Context) (string, error) { out := struct { - Ret0 bool `json:"status"` + Ret0 string `json:"version"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[0], nil, &out) @@ -1283,28 +1274,12 @@ func (c *trailsClient) Ping(ctx context.Context) (bool, error) { return out.Ret0, err } -func (c *trailsClient) Version(ctx context.Context) (*Version, error) { - out := struct { - Ret0 *Version `json:"version"` - }{} - - resp, err := doHTTPRequest(ctx, c.client, c.urls[1], nil, &out) - if resp != nil { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) - } - } - - return out.Ret0, err -} - func (c *trailsClient) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) { out := struct { Ret0 *RuntimeStatus `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[2], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[1], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1320,7 +1295,7 @@ func (c *trailsClient) Clock(ctx context.Context) (time.Time, error) { Ret0 time.Time `json:"serverTime"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[3], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[2], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1336,7 +1311,7 @@ func (c *trailsClient) QuoteIntent(ctx context.Context, quoteIntentRequest Quote Ret0 *QuoteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[4], quoteIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[3], quoteIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1352,7 +1327,7 @@ func (c *trailsClient) CommitIntent(ctx context.Context, commitIntentRequest Com Ret0 *CommitIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[5], commitIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[4], commitIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1368,7 +1343,7 @@ func (c *trailsClient) ExecuteIntent(ctx context.Context, executeIntentRequest E Ret0 *ExecuteIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[6], executeIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[5], executeIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1384,7 +1359,7 @@ func (c *trailsClient) WaitIntentReceipt(ctx context.Context, waitIntentReceiptR Ret0 *WaitIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[7], waitIntentReceiptRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[6], waitIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1400,7 +1375,7 @@ func (c *trailsClient) GetIntentReceipt(ctx context.Context, getIntentReceiptReq Ret0 *GetIntentReceiptResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], getIntentReceiptRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[7], getIntentReceiptRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1416,7 +1391,7 @@ func (c *trailsClient) GetIntent(ctx context.Context, getIntentRequest GetIntent Ret0 *GetIntentResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], getIntentRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], getIntentRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1432,7 +1407,7 @@ func (c *trailsClient) SearchIntents(ctx context.Context, searchIntentsRequest S Ret0 *SearchIntentsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], searchIntentsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], searchIntentsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1448,7 +1423,7 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten Ret0 *GetIntentTransactionHistoryResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], getIntentTransactionHistoryRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], getIntentTransactionHistoryRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1464,7 +1439,7 @@ func (c *trailsClient) GetChains(ctx context.Context, getChainsRequest GetChains Ret0 *GetChainsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getChainsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], getChainsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1480,7 +1455,7 @@ func (c *trailsClient) GetExactOutputRoutes(ctx context.Context, getExactOutputR Ret0 *GetExactOutputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactOutputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getExactOutputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1496,7 +1471,7 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou Ret0 *GetExactInputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactInputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactInputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1512,7 +1487,7 @@ func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest Get Ret0 *GetTokenListResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenListRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getTokenListRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1528,7 +1503,7 @@ func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenPricesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenPricesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1544,7 +1519,7 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts Ret0 *TrailsContracts `json:"TrailsContracts"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1946,7 +1921,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.8+af077ec" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.9+7479046b" type WebrpcGenVersions struct { WebrpcGenVersion string From e678fa9c47d008c4d27c95822c096186d15ff07e Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 11 Dec 2025 21:00:46 +0000 Subject: [PATCH 110/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 70 ++++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 745f293e..022a911a 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.9+7479046b 31a12dd74b56457a79a8e8b57d1766f107db8d23 +// trails-api v1-25.12.11-a36d5bb7 11b65deb56f7065d2af9e60794eec15a08b660d3 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.9+7479046b" + return "v1-25.12.11-a36d5bb7" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "31a12dd74b56457a79a8e8b57d1766f107db8d23" + return "11b65deb56f7065d2af9e60794eec15a08b660d3" } // @@ -53,6 +53,7 @@ type TrailsClient interface { GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) + AbortIntent(ctx context.Context, abortIntentRequest AbortIntentRequest) (*AbortIntentResponse, error) // GetChains will return the list of supported chains by Trails. GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) // GetExactOutputRoutes will return a list of origin tokens, when given a destination chain and token, @@ -158,11 +159,18 @@ func (x *RouteProvider) Is(values ...RouteProvider) bool { type IntentStatus uint8 const ( - IntentStatus_QUOTED IntentStatus = 0 + // intent has been quoted + IntentStatus_QUOTED IntentStatus = 0 + // intent has been committed by user IntentStatus_COMMITTED IntentStatus = 1 + // intent is in the process of being executed IntentStatus_EXECUTING IntentStatus = 2 - IntentStatus_FAILED IntentStatus = 3 + // done, intent execution failed + IntentStatus_FAILED IntentStatus = 3 + // done, intent execution succeeded IntentStatus_SUCCEEDED IntentStatus = 4 + // done, intent execution was aborted by user + IntentStatus_ABORTED IntentStatus = 5 ) var IntentStatus_name = map[uint8]string{ @@ -171,6 +179,7 @@ var IntentStatus_name = map[uint8]string{ 2: "EXECUTING", 3: "FAILED", 4: "SUCCEEDED", + 5: "ABORTED", } var IntentStatus_value = map[string]uint8{ @@ -179,6 +188,7 @@ var IntentStatus_value = map[string]uint8{ "EXECUTING": 2, "FAILED": 3, "SUCCEEDED": 4, + "ABORTED": 5, } func (x IntentStatus) String() string { @@ -1125,6 +1135,21 @@ type GetIntentTransactionHistoryResponse struct { NextPage *Page `json:"nextPage"` } +type AbortIntentRequest struct { + // intentId is the ID of the intent which has been aborted + IntentID prototyp.Hash `json:"intentId"` + // chainId is required to specify which chain the transaction was aborted + ChainID uint64 `json:"chainId"` + // abortTransactionHash is the transaction hash of the abort transaction + // submitted by the user which we validate before updating status + AbortTransactionHash prototyp.Hash `json:"abortTransactionHash"` +} + +type AbortIntentResponse struct { + IntentID prototyp.Hash `json:"intentId"` + Status IntentStatus `json:"status"` +} + type GetTokenPricesRequest struct { Tokens []*Token `json:"tokens"` } @@ -1228,12 +1253,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [17]string + urls [18]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [17]string{ + urls := [18]string{ prefix + "Ping", prefix + "RuntimeStatus", prefix + "Clock", @@ -1245,6 +1270,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetIntent", prefix + "SearchIntents", prefix + "GetIntentTransactionHistory", + prefix + "AbortIntent", prefix + "GetChains", prefix + "GetExactOutputRoutes", prefix + "GetExactInputRoutes", @@ -1434,12 +1460,28 @@ func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getInten return out.Ret0, err } +func (c *trailsClient) AbortIntent(ctx context.Context, abortIntentRequest AbortIntentRequest) (*AbortIntentResponse, error) { + out := struct { + Ret0 *AbortIntentResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], abortIntentRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + func (c *trailsClient) GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) { out := struct { Ret0 *GetChainsResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], getChainsRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getChainsRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1455,7 +1497,7 @@ func (c *trailsClient) GetExactOutputRoutes(ctx context.Context, getExactOutputR Ret0 *GetExactOutputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], getExactOutputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactOutputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1471,7 +1513,7 @@ func (c *trailsClient) GetExactInputRoutes(ctx context.Context, getExactInputRou Ret0 *GetExactInputRoutesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], getExactInputRoutesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getExactInputRoutesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1487,7 +1529,7 @@ func (c *trailsClient) GetTokenList(ctx context.Context, getTokenListRequest Get Ret0 *GetTokenListResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], getTokenListRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenListRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1503,7 +1545,7 @@ func (c *trailsClient) GetTokenPrices(ctx context.Context, getTokenPricesRequest Ret0 *GetTokenPricesResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], getTokenPricesRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], getTokenPricesRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1519,7 +1561,7 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts Ret0 *TrailsContracts `json:"TrailsContracts"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1921,7 +1963,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.9+7479046b" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.11-a36d5bb7" type WebrpcGenVersions struct { WebrpcGenVersion string From e957fcd3aa6be2250519be4bbdc4c1fe517e6ad1 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 12 Dec 2025 02:56:23 +0000 Subject: [PATCH 111/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 022a911a..fbb674de 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.11-a36d5bb7 11b65deb56f7065d2af9e60794eec15a08b660d3 +// trails-api v1-25.12.11-861c82bf e8dcbaf5d6e57aba2eb1eb042ea6e282538c268e // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.11-a36d5bb7" + return "v1-25.12.11-861c82bf" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "11b65deb56f7065d2af9e60794eec15a08b660d3" + return "e8dcbaf5d6e57aba2eb1eb042ea6e282538c268e" } // @@ -777,6 +777,7 @@ type IntentSummary struct { DestinationTokenAmount prototyp.BigInt `json:"destinationTokenAmount"` DestinationTokenMetadata *TokenMetadata `json:"destinationTokenMetadata"` DestinationToAddress prototyp.Hash `json:"destinationToAddress,omitempty"` + ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` // timestamp when the intent receipt was updated, usually from status change UpdatedAt *time.Time `json:"updatedAt,omitempty"` // timestamp of when the intent receipt was created @@ -1963,7 +1964,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.11-a36d5bb7" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.11-861c82bf" type WebrpcGenVersions struct { WebrpcGenVersion string From 15fd6d14cd7cb095a15812a07086aa9826872efd Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 12 Dec 2025 19:33:36 +0000 Subject: [PATCH 112/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index fbb674de..e79e3151 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.11-861c82bf e8dcbaf5d6e57aba2eb1eb042ea6e282538c268e +// trails-api v1-25.12.13-fc788f3e b1288915141440e4ee1408ee66d337a1c6c35088 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.11-861c82bf" + return "v1-25.12.13-fc788f3e" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "e8dcbaf5d6e57aba2eb1eb042ea6e282538c268e" + return "b1288915141440e4ee1408ee66d337a1c6c35088" } // @@ -688,8 +688,12 @@ type IntentProviderQuote struct { RouteProvidersFeeUSD []float64 `json:"routeProvidersFeeUsd"` FromAmount prototyp.BigInt `json:"fromAmount"` FromAmountMin prototyp.BigInt `json:"fromAmountMin"` + FromAmountUSD float64 `json:"fromAmountUsd"` + FromAmountMinUSD float64 `json:"fromAmountMinUsd"` ToAmount prototyp.BigInt `json:"toAmount"` ToAmountMin prototyp.BigInt `json:"toAmountMin"` + ToAmountUSD float64 `json:"toAmountUsd"` + ToAmountMinUSD float64 `json:"toAmountMinUsd"` MaxSlippage float64 `json:"maxSlippage"` PriceImpact float64 `json:"priceImpact"` PriceImpactUSD float64 `json:"priceImpactUsd"` @@ -1964,7 +1968,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.11-861c82bf" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.13-fc788f3e" type WebrpcGenVersions struct { WebrpcGenVersion string From f33f5c33283f65714e294569e84e2ea15c53e98e Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 17 Dec 2025 00:40:57 +0000 Subject: [PATCH 113/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 177 ++++++++++++++++++++++++++--------- 1 file changed, 133 insertions(+), 44 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index e79e3151..1adce456 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.13-fc788f3e b1288915141440e4ee1408ee66d337a1c6c35088 +// trails-api v1-25.12.16-bcea3853 c542124b419beb13415437c6f3d01cd78b952a5f // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.13-fc788f3e" + return "v1-25.12.16-bcea3853" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "b1288915141440e4ee1408ee66d337a1c6c35088" + return "c542124b419beb13415437c6f3d01cd78b952a5f" } // @@ -52,7 +52,7 @@ type TrailsClient interface { GetIntentReceipt(ctx context.Context, getIntentReceiptRequest GetIntentReceiptRequest) (*GetIntentReceiptResponse, error) GetIntent(ctx context.Context, getIntentRequest GetIntentRequest) (*GetIntentResponse, error) SearchIntents(ctx context.Context, searchIntentsRequest SearchIntentsRequest) (*SearchIntentsResponse, error) - GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) + GetIntentHistory(ctx context.Context, getIntentHistoryRequest GetIntentHistoryRequest) (*GetIntentHistoryResponse, error) AbortIntent(ctx context.Context, abortIntentRequest AbortIntentRequest) (*AbortIntentResponse, error) // GetChains will return the list of supported chains by Trails. GetChains(ctx context.Context, getChainsRequest GetChainsRequest) (*GetChainsResponse, error) @@ -90,6 +90,8 @@ type TrailsClient interface { GetTokenPrices(ctx context.Context, getTokenPricesRequest GetTokenPricesRequest) (*GetTokenPricesResponse, error) // GetTrailsContracts returns Trails contract addresses used by the Trails Intents stack. GetTrailsContracts(ctx context.Context) (*TrailsContracts, error) + // Deprecated: please use GetIntentHistory instead + GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) } // @@ -600,6 +602,58 @@ type MetaTxn struct { Input string `json:"input"` } +type IntentHistory struct { + // intent deterministic id + IntentID prototyp.Hash `json:"intentId"` + // intent status from the 'intents' table + Status IntentStatus `json:"status"` + // intent creation and expiration timestamps + ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + // intent receipt from the 'intent_receipts' table + // + // NOTE: we will always include a receipt, even if we don't have one + // in the db, so we can return the receipt.summary + Receipt *IntentReceipt `json:"receipt"` +} + +type IntentReceiptSummary struct { + IntentID prototyp.Hash `json:"intentId"` + Status IntentStatus `json:"status"` + OwnerAddress prototyp.Hash `json:"ownerAddress"` + OriginChainID uint64 `json:"originChainId"` + DestinationChainID uint64 `json:"destinationChainId"` + TradeType TradeType `json:"tradeType"` + RouteProviders []RouteProvider `json:"routeProviders"` + OriginIntentAddress prototyp.Hash `json:"originIntentAddress"` + OriginTokenAddress prototyp.Hash `json:"originTokenAddress"` + OriginTokenAmount prototyp.BigInt `json:"originTokenAmount"` + OriginTokenMetadata *TokenMetadata `json:"originTokenMetadata"` + // NOTE: we will always set this value, even if its to the origin intent address as the same value. + DestinationIntentAddress prototyp.Hash `json:"destinationIntentAddress"` + // NOTE: for destinationTokenAddress, destinationTokenAmount, destinationToAddress, and destinationTokenMetadata + // are assigned at execution time for EXACT_INPUT and also if destinationHasCallData is true, as we only + // know the values once the destination txn has been executed. + DestinationTokenAddress *prototyp.Hash `json:"destinationTokenAddress"` + DestinationTokenAmount *prototyp.BigInt `json:"destinationTokenAmount"` + DestinationToAddress *prototyp.Hash `json:"destinationToAddress"` + DestinationTokenMetadata *TokenMetadata `json:"destinationTokenMetadata"` + DestinationHasCallData bool `json:"destinationHasCallData"` + DestinationHasCallValue bool `json:"destinationHasCallValue"` + // memo is just any additional context / note we wanted to share + // when computing the summary. + Memo *string `json:"memo"` + // createdAt is the time the intent quote was created + CreatedAt time.Time `json:"createdAt"` + // expiresAt is the time the intent quote expires + ExpiresAt time.Time `json:"expiresAt"` + // startedAt is the time the intent execution started + StartedAt *time.Time `json:"startedAt"` + // finishedAt is the time the intent execution finished + FinishedAt *time.Time `json:"finishedAt"` +} + // IntentReceipt represents an intent that went through trails, and fully executed // as a set of transactions, and is now complete. This method is used to fetch the // status of an intent, and also used by the GetIntentTransactionHistory endpoint. @@ -635,8 +689,9 @@ type IntentReceipt struct { // destination intent transaction db reference and runtime type // note: this may be null if the intent did not require a destination txn, // ie. simple swap on origin chain only with no destination calldata. - DestinationTransactionID *uint64 `json:"-" db:"dest_txn_id,omitempty"` - DestinationTransaction *IntentTransaction `json:"destinationTransaction,omitempty" db:"-"` + DestinationTransactionID *uint64 `json:"-" db:"dest_txn_id,omitempty"` + DestinationTransaction *IntentTransaction `json:"destinationTransaction" db:"-"` + Summary *IntentReceiptSummary `json:"summary" db:"summary"` // timestamp when the intent receipt was updated, usually from status change UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` // timestamp of when the intent receipt was created @@ -650,6 +705,9 @@ type IntentTransaction struct { // we don't return it in the json, no need. its internal. // Intent id this transaction is associated with IntentID prototyp.Hash `json:"intentId" db:"intent_id"` + // Status of this specific transaction + Status TransactionStatus `json:"status" db:"status"` + StatusReason *string `json:"statusReason" db:"status_reason"` // Chain where this transaction executes ChainID uint64 `json:"chainId" db:"chain_id"` Type TransactionType `json:"type" db:"type"` @@ -672,11 +730,8 @@ type IntentTransaction struct { TxnHash prototyp.Hash `json:"txnHash,omitempty" db:"txn_hash,omitempty"` // On-chain block timestamp when txn was mined TxnMinedAt *time.Time `json:"txnMinedAt" db:"txn_mined_at,omitempty"` - // Status of this specific transaction - Status TransactionStatus `json:"status" db:"status"` - StatusReason *string `json:"statusReason" db:"status_reason"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // IntentProviderQuote represents the quotes from the underlining providers for both @@ -726,29 +781,9 @@ type IntentProviderFees struct { TotalFeeUSD float64 `json:"totalFeeUsd"` } -type IntentTransactionGasFee struct { - ChainID uint64 `json:"chainId"` - TotalGasLimit prototyp.BigInt `json:"totalGasLimit"` - GasPrice prototyp.BigInt `json:"gasPrice"` - NativeTokenSymbol string `json:"nativeTokenSymbol"` - NativeTokenPriceUSD *float64 `json:"nativeTokenPriceUsd"` - ChainGasUsageStatus ChainGasUsageStatus `json:"chainGasUsageStatus"` - TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` - TotalFeeUSD float64 `json:"totalFeeUsd"` - // sequence relayer gas fee quotes - // AKA, meta transaction gas fee quotes for pre-sponsored - MetaTxnFeeDetails *MetaTxnFeeDetails `json:"metaTxnFeeDetails"` - // metaTxnGasQuote is like a voucher for gas sponsorship from the relayer - MetaTxnGasQuote string `json:"metaTxnGasQuote"` -} - -type MetaTxnFeeDetails struct { - MetaTxnID string `json:"metaTxnId"` - EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` - FeeNative prototyp.BigInt `json:"feeNative"` -} - +// DEPRECATED: please use GetIntentHistory / IntentReceiptSummary instead // IntentSummary represents a summary view of an intent for listing purposes. +// NOTE: this type is deprecated, please use GetIntentHistory method instead type IntentSummary struct { ID uint64 `json:"-"` // intent deterministic id @@ -788,6 +823,28 @@ type IntentSummary struct { CreatedAt time.Time `json:"createdAt"` } +type IntentTransactionGasFee struct { + ChainID uint64 `json:"chainId"` + TotalGasLimit prototyp.BigInt `json:"totalGasLimit"` + GasPrice prototyp.BigInt `json:"gasPrice"` + NativeTokenSymbol string `json:"nativeTokenSymbol"` + NativeTokenPriceUSD *float64 `json:"nativeTokenPriceUsd"` + ChainGasUsageStatus ChainGasUsageStatus `json:"chainGasUsageStatus"` + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUsd"` + // sequence relayer gas fee quotes + // AKA, meta transaction gas fee quotes for pre-sponsored + MetaTxnFeeDetails *MetaTxnFeeDetails `json:"metaTxnFeeDetails"` + // metaTxnGasQuote is like a voucher for gas sponsorship from the relayer + MetaTxnGasQuote string `json:"metaTxnGasQuote"` +} + +type MetaTxnFeeDetails struct { + MetaTxnID string `json:"metaTxnId"` + EstimatedGasLimit prototyp.BigInt `json:"estimatedGasLimit"` + FeeNative prototyp.BigInt `json:"feeNative"` +} + type ChainMetadata struct { ChainID uint64 `json:"chainId"` Name string `json:"name"` @@ -1126,8 +1183,8 @@ type SearchIntentsResponse struct { Intents []*Intent `json:"intents"` } -// GetIntentTransactionHistory returns the discrete transactions related to an intent. -type GetIntentTransactionHistoryRequest struct { +// GetIntentHistory returns the intent history list, with receipt and summary info. +type GetIntentHistoryRequest struct { // cursor paging parameters Page *Page `json:"page"` // optional project id scope filter @@ -1135,8 +1192,8 @@ type GetIntentTransactionHistoryRequest struct { ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` } -type GetIntentTransactionHistoryResponse struct { - Intents []*IntentSummary `json:"intents"` +type GetIntentHistoryResponse struct { + Intents []*IntentHistory `json:"intents"` NextPage *Page `json:"nextPage"` } @@ -1250,6 +1307,21 @@ type SortBy struct { Order SortOrder `json:"order"` } +// DEPRECATED: please use GetIntentHistory instead +type GetIntentTransactionHistoryRequest struct { + // cursor paging parameters + Page *Page `json:"page"` + // optional project id scope filter + ByProjectID uint64 `json:"byProjectId"` + ByOwnerAddress prototyp.Hash `json:"byOwnerAddress"` +} + +// DEPRECATED: please use GetIntentHistory instead +type GetIntentTransactionHistoryResponse struct { + Intents []*IntentSummary `json:"intents"` + NextPage *Page `json:"nextPage"` +} + // // Client // @@ -1258,12 +1330,12 @@ const TrailsPathPrefix = "/rpc/Trails/" type trailsClient struct { client HTTPClient - urls [18]string + urls [19]string } func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix := urlBase(addr) + TrailsPathPrefix - urls := [18]string{ + urls := [19]string{ prefix + "Ping", prefix + "RuntimeStatus", prefix + "Clock", @@ -1274,7 +1346,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetIntentReceipt", prefix + "GetIntent", prefix + "SearchIntents", - prefix + "GetIntentTransactionHistory", + prefix + "GetIntentHistory", prefix + "AbortIntent", prefix + "GetChains", prefix + "GetExactOutputRoutes", @@ -1282,6 +1354,7 @@ func NewTrailsClient(addr string, client HTTPClient) TrailsClient { prefix + "GetTokenList", prefix + "GetTokenPrices", prefix + "GetTrailsContracts", + prefix + "GetIntentTransactionHistory", } return &trailsClient{ client: client, @@ -1449,12 +1522,12 @@ func (c *trailsClient) SearchIntents(ctx context.Context, searchIntentsRequest S return out.Ret0, err } -func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) { +func (c *trailsClient) GetIntentHistory(ctx context.Context, getIntentHistoryRequest GetIntentHistoryRequest) (*GetIntentHistoryResponse, error) { out := struct { - Ret0 *GetIntentTransactionHistoryResponse + Ret0 *GetIntentHistoryResponse }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], getIntentTransactionHistoryRequest, &out.Ret0) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], getIntentHistoryRequest, &out.Ret0) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1577,6 +1650,22 @@ func (c *trailsClient) GetTrailsContracts(ctx context.Context) (*TrailsContracts return out.Ret0, err } +func (c *trailsClient) GetIntentTransactionHistory(ctx context.Context, getIntentTransactionHistoryRequest GetIntentTransactionHistoryRequest) (*GetIntentTransactionHistoryResponse, error) { + out := struct { + Ret0 *GetIntentTransactionHistoryResponse + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[18], getIntentTransactionHistoryRequest, &out.Ret0) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + // // Client helpers // @@ -1968,7 +2057,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.13-fc788f3e" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.16-bcea3853" type WebrpcGenVersions struct { WebrpcGenVersion string From e4963fb9b11d435598bc96ccd2a56038c8f01f86 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Wed, 17 Dec 2025 00:56:41 +0000 Subject: [PATCH 114/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 1adce456..fbd4b1bb 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.16-bcea3853 c542124b419beb13415437c6f3d01cd78b952a5f +// trails-api v1-25.12.16-ee270e57 cd6fea50d2e26fb661de670279f19010f6a3f14a // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.16-bcea3853" + return "v1-25.12.16-ee270e57" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "c542124b419beb13415437c6f3d01cd78b952a5f" + return "cd6fea50d2e26fb661de670279f19010f6a3f14a" } // @@ -2057,7 +2057,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.16-bcea3853" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.16-ee270e57" type WebrpcGenVersions struct { WebrpcGenVersion string From 5f8e7cabe0bfe8d169adb459e1d19f4e4df3b785 Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Thu, 18 Dec 2025 13:38:09 +0000 Subject: [PATCH 115/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index fbd4b1bb..6b5c0626 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.16-ee270e57 cd6fea50d2e26fb661de670279f19010f6a3f14a +// trails-api v1-25.12.17-25e0c596 21dd5d0cdb5269f4cc67c3f0b9acd11c94484f14 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.16-ee270e57" + return "v1-25.12.17-25e0c596" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "cd6fea50d2e26fb661de670279f19010f6a3f14a" + return "21dd5d0cdb5269f4cc67c3f0b9acd11c94484f14" } // @@ -173,6 +173,8 @@ const ( IntentStatus_SUCCEEDED IntentStatus = 4 // done, intent execution was aborted by user IntentStatus_ABORTED IntentStatus = 5 + // done, intent execution was refunded + IntentStatus_REFUNDED IntentStatus = 6 ) var IntentStatus_name = map[uint8]string{ @@ -182,6 +184,7 @@ var IntentStatus_name = map[uint8]string{ 3: "FAILED", 4: "SUCCEEDED", 5: "ABORTED", + 6: "REFUNDED", } var IntentStatus_value = map[string]uint8{ @@ -191,6 +194,7 @@ var IntentStatus_value = map[string]uint8{ "FAILED": 3, "SUCCEEDED": 4, "ABORTED": 5, + "REFUNDED": 6, } func (x IntentStatus) String() string { @@ -338,19 +342,22 @@ const ( TransactionStatus_FAILED TransactionStatus = 8 // terminal state: aborted at one of the stages, and never completed onchain txn TransactionStatus_ABORTED TransactionStatus = 9 + // terminal state: txn mined but call reverted (refund triggered) + TransactionStatus_REVERTED TransactionStatus = 10 ) var TransactionStatus_name = map[uint8]string{ - 0: "UNKNOWN", - 1: "ON_HOLD", - 2: "PENDING", - 3: "RELAYING", - 4: "SENT", - 5: "ERRORED", - 6: "MINING", - 7: "SUCCEEDED", - 8: "FAILED", - 9: "ABORTED", + 0: "UNKNOWN", + 1: "ON_HOLD", + 2: "PENDING", + 3: "RELAYING", + 4: "SENT", + 5: "ERRORED", + 6: "MINING", + 7: "SUCCEEDED", + 8: "FAILED", + 9: "ABORTED", + 10: "REVERTED", } var TransactionStatus_value = map[string]uint8{ @@ -364,6 +371,7 @@ var TransactionStatus_value = map[string]uint8{ "SUCCEEDED": 7, "FAILED": 8, "ABORTED": 9, + "REVERTED": 10, } func (x TransactionStatus) String() string { @@ -2057,7 +2065,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.16-ee270e57" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.17-25e0c596" type WebrpcGenVersions struct { WebrpcGenVersion string From d88a401c4046edfb6b30e70a09c0fdd2cbc44568 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 18 Dec 2025 15:07:30 +0000 Subject: [PATCH 116/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 6b5c0626..fbd4b1bb 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.17-25e0c596 21dd5d0cdb5269f4cc67c3f0b9acd11c94484f14 +// trails-api v1-25.12.16-ee270e57 cd6fea50d2e26fb661de670279f19010f6a3f14a // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.17-25e0c596" + return "v1-25.12.16-ee270e57" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "21dd5d0cdb5269f4cc67c3f0b9acd11c94484f14" + return "cd6fea50d2e26fb661de670279f19010f6a3f14a" } // @@ -173,8 +173,6 @@ const ( IntentStatus_SUCCEEDED IntentStatus = 4 // done, intent execution was aborted by user IntentStatus_ABORTED IntentStatus = 5 - // done, intent execution was refunded - IntentStatus_REFUNDED IntentStatus = 6 ) var IntentStatus_name = map[uint8]string{ @@ -184,7 +182,6 @@ var IntentStatus_name = map[uint8]string{ 3: "FAILED", 4: "SUCCEEDED", 5: "ABORTED", - 6: "REFUNDED", } var IntentStatus_value = map[string]uint8{ @@ -194,7 +191,6 @@ var IntentStatus_value = map[string]uint8{ "FAILED": 3, "SUCCEEDED": 4, "ABORTED": 5, - "REFUNDED": 6, } func (x IntentStatus) String() string { @@ -342,22 +338,19 @@ const ( TransactionStatus_FAILED TransactionStatus = 8 // terminal state: aborted at one of the stages, and never completed onchain txn TransactionStatus_ABORTED TransactionStatus = 9 - // terminal state: txn mined but call reverted (refund triggered) - TransactionStatus_REVERTED TransactionStatus = 10 ) var TransactionStatus_name = map[uint8]string{ - 0: "UNKNOWN", - 1: "ON_HOLD", - 2: "PENDING", - 3: "RELAYING", - 4: "SENT", - 5: "ERRORED", - 6: "MINING", - 7: "SUCCEEDED", - 8: "FAILED", - 9: "ABORTED", - 10: "REVERTED", + 0: "UNKNOWN", + 1: "ON_HOLD", + 2: "PENDING", + 3: "RELAYING", + 4: "SENT", + 5: "ERRORED", + 6: "MINING", + 7: "SUCCEEDED", + 8: "FAILED", + 9: "ABORTED", } var TransactionStatus_value = map[string]uint8{ @@ -371,7 +364,6 @@ var TransactionStatus_value = map[string]uint8{ "SUCCEEDED": 7, "FAILED": 8, "ABORTED": 9, - "REVERTED": 10, } func (x TransactionStatus) String() string { @@ -2065,7 +2057,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.17-25e0c596" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.16-ee270e57" type WebrpcGenVersions struct { WebrpcGenVersion string From ffbb57864e81b3588fe5279b3caa56bedcfa7898 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Thu, 18 Dec 2025 15:08:13 +0000 Subject: [PATCH 117/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index fbd4b1bb..402e9705 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.16-ee270e57 cd6fea50d2e26fb661de670279f19010f6a3f14a +// trails-api v1-25.12.18-0c440420 09b3975a1dfcfc5531e352d55f6e474f73165f3a // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.16-ee270e57" + return "v1-25.12.18-0c440420" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "cd6fea50d2e26fb661de670279f19010f6a3f14a" + return "09b3975a1dfcfc5531e352d55f6e474f73165f3a" } // @@ -2057,7 +2057,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.16-ee270e57" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.18-0c440420" type WebrpcGenVersions struct { WebrpcGenVersion string From 2ae10a7fa92522aa71697c41857b11dbd19dc8ad Mon Sep 17 00:00:00 2001 From: shunkakinoki <39187513+shunkakinoki@users.noreply.github.com> Date: Fri, 19 Dec 2025 12:54:47 +0000 Subject: [PATCH 118/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 402e9705..058440fe 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.18-0c440420 09b3975a1dfcfc5531e352d55f6e474f73165f3a +// trails-api v1-25.12.19-f67e10a4 27400b66cc14347329aab166f2fc564093345548 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.18-0c440420" + return "v1-25.12.19-f67e10a4" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "09b3975a1dfcfc5531e352d55f6e474f73165f3a" + return "27400b66cc14347329aab166f2fc564093345548" } // @@ -760,11 +760,16 @@ type IntentFees struct { DestinationGas *IntentTransactionGasFee `json:"destinationGas"` // provider fees (swap + bridge + trails) Provider *IntentProviderFees `json:"provider"` - // total fees including provider fees + gas fees - FeeTokenAddress prototyp.Hash `json:"feeTokenAddress"` - FeeTokenTotal prototyp.BigInt `json:"feeTokenTotal"` - TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` - TotalFeeUSD float64 `json:"totalFeeUsd"` + // fee token details + FeeTokenAddress prototyp.Hash `json:"feeTokenAddress"` + // kept for backwards compatibility here + FeeTokenTotal prototyp.BigInt `json:"feeTokenTotal"` + // fee token usd = gas + trails fee (amount trails' fee collector gets transferred) + FeeTokenAmount prototyp.BigInt `json:"feeTokenAmount"` + FeeTokenUSD float64 `json:"feeTokenUsd"` + // display fees (gas + trails + provider) - what user sees + TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` + TotalFeeUSD float64 `json:"totalFeeUsd"` } // ProviderFees is the swap+bridge provider fee, trails fee summary and totals @@ -2057,7 +2062,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.18-0c440420" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.19-f67e10a4" type WebrpcGenVersions struct { WebrpcGenVersion string From 36897e3fb484eac8ae844f9a43c0ff1b74c71739 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Fri, 19 Dec 2025 14:36:19 +0000 Subject: [PATCH 119/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 058440fe..3da3bf11 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.19-f67e10a4 27400b66cc14347329aab166f2fc564093345548 +// trails-api v1-25.12.19-563ddc5d 48bc28e03c33634ebf5ebcbac5010e79548baf4e // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.19-f67e10a4" + return "v1-25.12.19-563ddc5d" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "27400b66cc14347329aab166f2fc564093345548" + return "48bc28e03c33634ebf5ebcbac5010e79548baf4e" } // @@ -2062,7 +2062,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.19-f67e10a4" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.19-563ddc5d" type WebrpcGenVersions struct { WebrpcGenVersion string From fa50c789e367197f5a91d3a436b61307fa4628e2 Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 23 Dec 2025 03:05:11 +0000 Subject: [PATCH 120/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index 3da3bf11..c2c25ef1 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.19-563ddc5d 48bc28e03c33634ebf5ebcbac5010e79548baf4e +// trails-api v1-25.12.23-edfaf51c d7fedb38b190526053177b3a1456dba96135a9b4 // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.19-563ddc5d" + return "v1-25.12.23-edfaf51c" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "48bc28e03c33634ebf5ebcbac5010e79548baf4e" + return "d7fedb38b190526053177b3a1456dba96135a9b4" } // @@ -173,6 +173,8 @@ const ( IntentStatus_SUCCEEDED IntentStatus = 4 // done, intent execution was aborted by user IntentStatus_ABORTED IntentStatus = 5 + // done, intent execution was refunded + IntentStatus_REFUNDED IntentStatus = 6 ) var IntentStatus_name = map[uint8]string{ @@ -182,6 +184,7 @@ var IntentStatus_name = map[uint8]string{ 3: "FAILED", 4: "SUCCEEDED", 5: "ABORTED", + 6: "REFUNDED", } var IntentStatus_value = map[string]uint8{ @@ -191,6 +194,7 @@ var IntentStatus_value = map[string]uint8{ "FAILED": 3, "SUCCEEDED": 4, "ABORTED": 5, + "REFUNDED": 6, } func (x IntentStatus) String() string { @@ -338,19 +342,22 @@ const ( TransactionStatus_FAILED TransactionStatus = 8 // terminal state: aborted at one of the stages, and never completed onchain txn TransactionStatus_ABORTED TransactionStatus = 9 + // terminal state: txn mined but call reverted (refund triggered) + TransactionStatus_REVERTED TransactionStatus = 10 ) var TransactionStatus_name = map[uint8]string{ - 0: "UNKNOWN", - 1: "ON_HOLD", - 2: "PENDING", - 3: "RELAYING", - 4: "SENT", - 5: "ERRORED", - 6: "MINING", - 7: "SUCCEEDED", - 8: "FAILED", - 9: "ABORTED", + 0: "UNKNOWN", + 1: "ON_HOLD", + 2: "PENDING", + 3: "RELAYING", + 4: "SENT", + 5: "ERRORED", + 6: "MINING", + 7: "SUCCEEDED", + 8: "FAILED", + 9: "ABORTED", + 10: "REVERTED", } var TransactionStatus_value = map[string]uint8{ @@ -364,6 +371,7 @@ var TransactionStatus_value = map[string]uint8{ "SUCCEEDED": 7, "FAILED": 8, "ABORTED": 9, + "REVERTED": 10, } func (x TransactionStatus) String() string { @@ -2062,7 +2070,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.19-563ddc5d" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.23-edfaf51c" type WebrpcGenVersions struct { WebrpcGenVersion string From 61a75bb58575186c7f41a60869a1c8f75dfc368a Mon Sep 17 00:00:00 2001 From: pkieltyka <18831+pkieltyka@users.noreply.github.com> Date: Tue, 23 Dec 2025 16:07:22 +0000 Subject: [PATCH 121/121] [AUTOMATED] Update: proto/clients/trails-api.gen.go --- trails-api/trails-api.gen.go | 60 ++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/trails-api/trails-api.gen.go b/trails-api/trails-api.gen.go index c2c25ef1..23c6e3fb 100644 --- a/trails-api/trails-api.gen.go +++ b/trails-api/trails-api.gen.go @@ -1,4 +1,4 @@ -// trails-api v1-25.12.23-edfaf51c d7fedb38b190526053177b3a1456dba96135a9b4 +// trails-api v1-25.12.24-babcedf7 ec3a111bf8949a383b62140bc50c9d8dc773ff6c // -- // Code generated by webrpc-gen@v0.31.3 with golang generator. DO NOT EDIT. // @@ -29,12 +29,12 @@ func WebRPCVersion() string { // Schema version of your RIDL schema func WebRPCSchemaVersion() string { - return "v1-25.12.23-edfaf51c" + return "v1-25.12.24-babcedf7" } // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "d7fedb38b190526053177b3a1456dba96135a9b4" + return "ec3a111bf8949a383b62140bc50c9d8dc773ff6c" } // @@ -742,6 +742,24 @@ type IntentTransaction struct { CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } +type PriceImpact struct { + PriceImpact float64 `json:"priceImpact"` + PriceImpactUSD float64 `json:"priceImpactUsd"` +} + +type PriceImpactDetails struct { + // Price impact that results from gas fees on origin and destination chains + ExecutionPriceImpact *PriceImpact `json:"executionPriceImpact"` + // Price impact that results from slippage and pure market movement + MarketPriceImpact *PriceImpact `json:"marketPriceImpact"` + // Price impact that results from provider fees, excluding trails (swap + bridge) + ProviderFeesPriceImpact *PriceImpact `json:"providerFeesPriceImpact"` + // Price impact that results from trails fees + TrailsFeesPriceImpact *PriceImpact `json:"trailsFeesPriceImpact"` + // Price impact that results from net result of all fees, currently used in the final price impact shown to user + NetPriceImpact *PriceImpact `json:"netPriceImpact"` +} + // IntentProviderQuote represents the quotes from the underlining providers for both // the swap and/or bridge external providers. If we do both a swap and a bridge, then // the total amount is the sum of both providers. @@ -758,8 +776,10 @@ type IntentProviderQuote struct { ToAmountUSD float64 `json:"toAmountUsd"` ToAmountMinUSD float64 `json:"toAmountMinUsd"` MaxSlippage float64 `json:"maxSlippage"` - PriceImpact float64 `json:"priceImpact"` - PriceImpactUSD float64 `json:"priceImpactUsd"` + // This is the net price impact (same value as priceImpactDetails.netPriceImpact) + PriceImpact float64 `json:"priceImpact"` + PriceImpactUSD float64 `json:"priceImpactUsd"` + PriceImpactDetails *PriceImpactDetails `json:"priceImpactDetails"` } type IntentFees struct { @@ -770,17 +790,33 @@ type IntentFees struct { Provider *IntentProviderFees `json:"provider"` // fee token details FeeTokenAddress prototyp.Hash `json:"feeTokenAddress"` - // kept for backwards compatibility here - FeeTokenTotal prototyp.BigInt `json:"feeTokenTotal"` - // fee token usd = gas + trails fee (amount trails' fee collector gets transferred) + // @deprecated: kept for backwards compatibility here, set to `collectorFeeTotal` FeeTokenAmount prototyp.BigInt `json:"feeTokenAmount"` - FeeTokenUSD float64 `json:"feeTokenUsd"` + // @deprecated: kept for backwards compatibility here, set to `collectorFeeUsd` + // fee token usd = gas + trails fee (amount trails' fee collector gets transferred) + FeeTokenUSD float64 `json:"feeTokenUsd"` + // @deprecated: kept for backwards compatibility here, set to 0 + // fee token amount = provider + trails + origin amount total + FeeTokenTotal prototyp.BigInt `json:"feeTokenTotal"` + // gas fee component (origin + destination gas or orchestraion fee) + GasFeeTotal prototyp.BigInt `json:"gasFeeTotal"` + GasFeeUSD float64 `json:"gasFeeUsd"` + // trails fee component + TrailsFeeTotal prototyp.BigInt `json:"trailsFeeTotal"` + TrailsFeeUSD float64 `json:"trailsFeeUsd"` + // gas + trails fee component (amount trails collects as a fee) + CollectorFeeTotal prototyp.BigInt `json:"collectorFeeTotal"` + CollectedFeeUSD float64 `json:"collectorFeeUsd"` + // provider fee component + ProviderFeeTotal prototyp.BigInt `json:"providerFeeTotal"` + ProviderFeeUSD float64 `json:"providerFeeUsd"` // display fees (gas + trails + provider) - what user sees TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` TotalFeeUSD float64 `json:"totalFeeUsd"` } // ProviderFees is the swap+bridge provider fee, trails fee summary and totals +// @deprecated: please use IntentFees instead type IntentProviderFees struct { // quote provider fee component (swap and/or bridge) QuoteProvider string `json:"quoteProvider"` @@ -789,7 +825,11 @@ type IntentProviderFees struct { // trails provider fee component, denominated in the origin token TrailsFee prototyp.BigInt `json:"trailsFee"` TrailsFeeUSD float64 `json:"trailsFeeUsd"` + // provider + trails (non-gas) fee totals + QuoteProviderWithTrailsFee prototyp.BigInt `json:"quoteProviderWithTrailsFee"` + ProviderWithTrailsFeeUSD float64 `json:"providerWithTrailsFeeUsd"` // total provider fees, aka, swap + bridge + trails fees + // @deprecated: kept for backwards compatibility here, sync w/ providerWithTrailsFee TotalFeeAmount prototyp.BigInt `json:"totalFeeAmount"` TotalFeeUSD float64 `json:"totalFeeUsd"` } @@ -2070,7 +2110,7 @@ var ( const WebrpcHeader = "Webrpc" -const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.23-edfaf51c" +const WebrpcHeaderValue = "webrpc@v0.31.3;gen-golang@v0.23.3;trails-api@v1-25.12.24-babcedf7" type WebrpcGenVersions struct { WebrpcGenVersion string