1package router23import (4 ufmt "gno.land/p/nt/ufmt/v0"5)67const (8 errSlippage = "[GNOSWAP-ROUTER-001] slippage check failed"9 errInvalidRoutesAndQuotes = "[GNOSWAP-ROUTER-002] invalid routes and quotes"10 errExpired = "[GNOSWAP-ROUTER-003] transaction expired"11 errInvalidInput = "[GNOSWAP-ROUTER-004] invalid input data"12 errInvalidPoolFeeTier = "[GNOSWAP-ROUTER-005] invalid pool fee tier"13 errInvalidSwapFee = "[GNOSWAP-ROUTER-006] invalid swap fee"14 errInvalidSwapType = "[GNOSWAP-ROUTER-007] invalid swap type"15 errInvalidPoolPath = "[GNOSWAP-ROUTER-008] invalid pool path"16 errUnAuthorizedCaller = "[GNOSWAP-ROUTER-009] unauthorized caller"17 errHopsOutOfRange = "[GNOSWAP-ROUTER-010] number of hops must be 1~3"18 errSameTokenSwap = "[GNOSWAP-ROUTER-011] cannot swap same token"19 errInvalidRoutePath = "[GNOSWAP-ROUTER-013] invalid route path"20 errInvalidRouteFirstToken = "[GNOSWAP-ROUTER-014] invalid route first token"21 errInvalidRouteLastToken = "[GNOSWAP-ROUTER-015] invalid route last token"22 errInvalidSwapAmount = "[GNOSWAP-ROUTER-016] invalid swap amount"23 errRouteHopDisconnected = "[GNOSWAP-ROUTER-017] route hop disconnected"24 errInsufficientBalance = "[GNOSWAP-ROUTER-018] insufficient balance for swap"25 errSpoofedRealm = "[GNOSWAP-ROUTER-019] rlm does not match the current crossing frame"26 errInsufficientLiquidity = "[GNOSWAP-ROUTER-020] insufficient liquidity for swap"27)2829// addDetailToError adds detail to an error message.30func addDetailToError(message string, detail string) string {31 finalErr := ufmt.Errorf("%s || %s", message, detail)32 return finalErr.Error()33}3435// makeErrorWithDetails creates an error with additional context.36func makeErrorWithDetails(message string, detail string) error {37 return ufmt.Errorf("%s || %s", message, detail)38}39BuildSingleHopRoutePath(tokenA string, tokenB string, fee uint32) string
NewExactInParams(baseParams struct{InputToken string; OutputToken string; RouteArr string; QuoteArr string; SqrtPriceLimitX96 *gno.land/p/gnoswap/uint256/v1.Uint; Deadline int64}, amountIn int64, amountOutMin int64) struct{BaseSwapParams gno.land/r/gnoswap/router/v2.BaseSwapParams; AmountIn int64; AmountOutMin int64}
NewExactInSwapOperation(r *gno.land/r/gnoswap/router/v2.routerV1, pp struct{BaseSwapParams gno.land/r/gnoswap/router/v2.BaseSwapParams; AmountIn int64; AmountOutMin int64}) *gno.land/r/gnoswap/router/v2.ExactInSwapOperation
NewExactOutParams(baseParams struct{InputToken string; OutputToken string; RouteArr string; QuoteArr string; SqrtPriceLimitX96 *gno.land/p/gnoswap/uint256/v1.Uint; Deadline int64}, amountOut int64, amountInMax int64) struct{BaseSwapParams gno.land/r/gnoswap/router/v2.BaseSwapParams; AmountOut int64; AmountInMax int64}
NewExactOutSwapOperation(r *gno.land/r/gnoswap/router/v2.routerV1, pp struct{BaseSwapParams gno.land/r/gnoswap/router/v2.BaseSwapParams; AmountOut int64; AmountInMax int64}) *gno.land/r/gnoswap/router/v2.ExactOutSwapOperation
NewRouteParser() *gno.land/r/gnoswap/router/v2.RouteParser
NewRouterV1(routerStore interface {GetPendingProtocolFee func(string) int64; GetPendingProtocolFees func() map[string]int64; GetSwapFee func() uint64; HasPendingProtocolFeesKey func() bool; HasSwapFeeKey func() bool; RemovePendingProtocolFee func(int, .uverse.realm, string) .uverse.error; SetPendingProtocolFee func(int, .uverse.realm, string, int64) .uverse.error; SetPendingProtocolFees func(int, .uverse.realm, map[string]int64) .uverse.error; SetSwapFee func(int, .uverse.realm, uint64) .uverse.error}) interface {DrySwapRoute func(string, string, string, string, string, string, string) (string, string, .uverse.error); ExactInSingleSwapRoute func(int, .uverse.realm, string, string, string, string, string, string, int64, string) (string, string); ExactInSwapRoute func(int, .uverse.realm, string, string, string, string, string, string, int64, string) (string, string); ExactOutSingleSwapRoute func(int, .uverse.realm, string, string, string, string, string, string, int64, string) (string, string); ExactOutSwapRoute func(int, .uverse.realm, string, string, string, string, string, string, int64, string) (string, string); GetPendingProtocolFees func() map[string]int64; GetSwapFee func() uint64; Render func(string) string; SetSwapFee func(int, .uverse.realm, uint64); SwapCallback func(int, .uverse.realm, string, string, int64, int64, .uverse.address) .uverse.error}
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.