Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

assertIsNotExpired

func(deadline int64)

assertIsNotExpired ensures the transaction deadline has not passed.

Open
OID
0be141…5233:3
assertIsNotExpired details

Inspect func

assertIsValidSqrtPriceLimitX96

func(sqrtPriceLimitX96 string)
Open
OID
0be141…5233:5
assertIsValidSqrtPriceLimitX96 details

Inspect func

assertIsValidSingleSwapRouteArrPath

func(routePaths string, inputToken string, outputToken string)
Open
OID
0be141…5233:6
assertIsValidSingleSwapRouteArrPath details

Inspect func

assertIsValidRoutePaths

func(routePaths string, inputToken string, outputToken string)
Open
OID
0be141…5233:7
assertIsValidRoutePaths details

Inspect func

assertIsExistsPools

func(routePathArr string)
Open
OID
0be141…5233:8
assertIsExistsPools details

Inspect func

assertIsRouterImplementation

func(caller .uverse.address)
Open
OID
0be141…5233:9
assertIsRouterImplementation details

Inspect func

SINGLE_HOP_ROUTE

int

Value

1

POOL_SEPARATOR

untyped string

swap can be done by multiple pools to separate each pool, we use POOL\_SEPARATOR

Value

"*POOL*"

RouterOperation

type

Value

v1.RouterOperation

executeSwapOperation

func(int, rlm .uverse.realm, op v1.RouterOperation) (*v1.SwapResult, .uverse.error)

executeSwapOperation validates and processes a swap operation.

Open
OID
0be141…5233:10
executeSwapOperation details

Inspect func

BaseSwapParams

type

Value

v1.BaseSwapParams

baseSwapOperation

type

common swap operation

Value

v1.baseSwapOperation

SwapRouteParams

type

SwapRouteParams contains all parameters needed for swap route execution

Value

v1.SwapRouteParams

buildRouteEventAttrs

func(routeArr string) []string
Open
OID
0be141…5233:12
buildRouteEventAttrs details

Inspect func

createSwapOperation

func(r *v1.routerV1, params v1.SwapRouteParams) (v1.RouterOperation, .uverse.error)

createSwapOperation creates the appropriate swap operation based on swap type.

Open
OID
0be141…5233:13
createSwapOperation details

Inspect func

routerImplAddr

.uverse.address

Value

<gnolang.StringValue>

errSlippage

untyped string

Value

"[GNOSWAP-ROUTER-001] slippage check failed"

errInvalidRoutesAndQuotes

untyped string

Value

"[GNOSWAP-ROUTER-002] invalid routes and quotes"

errExpired

untyped string

Value

"[GNOSWAP-ROUTER-003] transaction expired"

errInvalidInput

untyped string

Value

"[GNOSWAP-ROUTER-004] invalid input data"

errInvalidPoolFeeTier

untyped string

Value

"[GNOSWAP-ROUTER-005] invalid pool fee tier"

errInvalidSwapFee

untyped string

Value

"[GNOSWAP-ROUTER-006] invalid swap fee"

errInvalidSwapType

untyped string

Value

"[GNOSWAP-ROUTER-007] invalid swap type"

errInvalidPoolPath

untyped string

Value

"[GNOSWAP-ROUTER-008] invalid pool path"

errUnAuthorizedCaller

untyped string

Value

"[GNOSWAP-ROUTER-009] unauthorized caller"

errHopsOutOfRange

untyped string

Value

"[GNOSWAP-ROUTER-010] number of hops must be 1~3"

errSameTokenSwap

untyped string

Value

"[GNOSWAP-ROUTER-011] cannot swap same token"

errInvalidRoutePath

untyped string

Value

"[GNOSWAP-ROUTER-013] invalid route path"

errInvalidRouteFirstToken

untyped string

Value

"[GNOSWAP-ROUTER-014] invalid route first token"

errInvalidRouteLastToken

untyped string

Value

"[GNOSWAP-ROUTER-015] invalid route last token"

errInvalidSwapAmount

untyped string

Value

"[GNOSWAP-ROUTER-016] invalid swap amount"

errRouteHopDisconnected

untyped string

Value

"[GNOSWAP-ROUTER-017] route hop disconnected"

errInsufficientBalance

untyped string

Value

"[GNOSWAP-ROUTER-018] insufficient balance for swap"

errSpoofedRealm

untyped string

Value

"[GNOSWAP-ROUTER-019] rlm does not match the current crossing frame"

addDetailToError

func(message string, detail string) string

addDetailToError adds detail to an error message.

Open
OID
0be141…5233:17
addDetailToError details

Inspect func

makeErrorWithDetails

func(message string, detail string) .uverse.error

makeErrorWithDetails creates an error with additional context.

Open
OID
0be141…5233:19
makeErrorWithDetails details

Inspect func

ExactInSwapOperation

type

Value

v1.ExactInSwapOperation

NewExactInSwapOperation

func(r *v1.routerV1, pp v1.ExactInParams) *v1.ExactInSwapOperation
Open
OID
0be141…5233:20
NewExactInSwapOperation details

Inspect func

ExactOutSwapOperation

type

ExactOutSwapOperation handles swaps where the output amount is specified.

Value

v1.ExactOutSwapOperation

NewExactOutSwapOperation

func(r *v1.routerV1, pp v1.ExactOutParams) *v1.ExactOutSwapOperation

NewExactOutSwapOperation creates a new exact-out swap operation.

Open
OID
0be141…5233:22
NewExactOutSwapOperation details

Inspect func

defaultSwapFeeBPS

uint64

// 0.15%

Value

15

initStoreData

func(int, rlm .uverse.realm, routerStore router.IRouterStore) .uverse.error
Open
OID
0be141…5233:27
initStoreData details

Inspect func

routerV1

type

Value

v1.routerV1

NewRouterV1

func(routerStore router.IRouterStore) router.IRouter
Open
OID
0be141…5233:28
NewRouterV1 details

Inspect func

calculateRouterFee

func(amount int64, swapFee uint64) int64
Open
OID
0be141…5233:30
calculateRouterFee details

Inspect func

calculateExactOutWithRouterFee

func(amount int64, swapFee uint64) int64

calculate amount to fetch from pool including router fee poolAmount = userAmount / (1 - feeRate) = userAmount \* 10000 / (10000 - swapFeeBPS)

Open
OID
0be141…5233:32
calculateExactOutWithRouterFee details

Inspect func

errExactOutAmountExceeded

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"received more than requested in requested=%d, actual=%d"

errInvalidRouteLength

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"route length(%d) must be 1~7"

errRoutesQuotesMismatch

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"mismatch between routes(%d) and quotes(%d) length"

errInvalidQuote

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"invalid quote(%s) at index(%d)"

errInvalidQuoteValue

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"quote(%s) at index(%d) must be positive value"

errQuoteExceedsMax

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"quote(%s) at index(%d) must be less than or equal to %d"

errQuoteSumExceedsMax

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"quote sum exceeds 100 at index(%d)"

errInvalidQuoteSum

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"quote sum(%d) must be 100"

errExactInTooFewReceived

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"ExactIn: too few received (min:%d, got:%d)"

errExactOutTooMuchSpent

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"ExactOut: too much spent (max:%d, used:%d)"

errEmptyRoutes

untyped string

ErrorMessages define all error message templates used throughout the router

Value

"routes cannot be empty"

SwapValidator

type

SwapValidator provides validation methods for swap operations

Value

v1.SwapValidator

RouteParser

type

RouteParser handles parsing and validation of routes and quotes

Value

v1.RouteParser

NewRouteParser

func() *v1.RouteParser

NewRouteParser creates a new route parser instance.

Open
OID
0be141…5233:33
NewRouteParser details

Inspect func

validateRoutesAndQuotes

func(routes string, quotes string) ([]string, []string, .uverse.error)

validateRoutesAndQuotes is a convenience function that parses and validates routes in one call.

Open
OID
0be141…5233:35
validateRoutesAndQuotes details

Inspect func

MaxQuotePercentage

untyped bigint

QuoteConstraints defines the valid range for swap quote percentages

Value

(100 <untyped> bigint)

MinQuotePercentage

untyped bigint

QuoteConstraints defines the valid range for swap quote percentages

Value

(0 <untyped> bigint)

PERCENTAGE_DENOMINATOR

int64

QuoteConstraints defines the valid range for swap quote percentages

Value

100

ErrUnknownSwapType

untyped string

ErrorMessages for DrySwapRoute operations

Value

"unknown swapType(%s)"

ErrInvalidPositiveAmount

untyped string

ErrorMessages for DrySwapRoute operations

Value

"invalid amount(%s), must be positive"

ErrInvalidZeroAmountLimit

untyped string

ErrorMessages for DrySwapRoute operations

Value

"invalid amountLimit(%s), should not be zero"

ErrInvalidQuoteRange

untyped string

ErrorMessages for DrySwapRoute operations

Value

"quote(%d) must be %d~%d"

SwapProcessor

type

SwapProcessor handles the execution of swap operations

Value

v1.SwapProcessor

getPathIndex

func(swapType v1.SwapType, numHops int) int

getPathIndex returns the path index based on swap type and number of hops.

Open
OID
0be141…5233:36
getPathIndex details

Inspect func

MIN_SQRT_RATIO

string

// same as TickMathGetSqrtRatioAtTick(MIN\_TICK)

Value

"4295128739"

MAX_SQRT_RATIO

string

// same as TickMathGetSqrtRatioAtTick(MAX\_TICK)

Value

"1461446703485210103287273052203988822378723970342"

sqrtPriceLimitForward

map[uint32]*uint256.Uint

// zeroForOne=true: sqrtRatioAtTick(minTick+1) + 1

Open
OID
0be141…5233:39
sqrtPriceLimitForward details

Inspect map

sqrtPriceLimitBackward

map[uint32]*uint256.Uint

// zeroForOne=false: sqrtRatioAtTick(maxTick-1) - 1

Open
OID
0be141…5233:41
sqrtPriceLimitBackward details

Inspect map

RealSwapExecutor

type

RealSwapExecutor implements SwapExecutor for actual swaps.

Value

v1.RealSwapExecutor

DrySwapExecutor

type

DrySwapExecutor implements SwapExecutor for dry swaps.

Value

v1.DrySwapExecutor

calculateSqrtPriceLimitForSwap

func(zeroForOne bool, fee uint32, sqrtPriceLimitX96 *uint256.Uint) *uint256.Uint

calculateSqrtPriceLimitForSwap returns the price limit for a swap operation. If a non-zero limit is provided by the caller, it is returned as-is. Otherwise, returns the precomputed limit for the given fee tier and direction. The returned pointer is shared (read-only — callers must not mutate it).

Open
OID
0be141…5233:44
calculateSqrtPriceLimitForSwap details

Inspect func

mustGetSqrtPriceLimit

func(limits map[uint32]*uint256.Uint, fee uint32) *uint256.Uint
Open
OID
0be141…5233:45
mustGetSqrtPriceLimit details

Inspect func

getMinTick

func(fee uint32) int32

getMinTick returns the minimum tick value for a given fee tier. The implementation follows Uniswap V3's tick spacing rules where lower fee tiers allow for finer price granularity.

Open
OID
0be141…5233:46
getMinTick details

Inspect func

getMaxTick

func(fee uint32) int32

getMaxTick returns the maximum tick value for a given fee tier. The max tick values are the exact negatives of min tick values.

Open
OID
0be141…5233:47
getMaxTick details

Inspect func

SwapDirection

type

SwapDirection represents the direction of swap execution in multi-hop swaps. It determines whether swaps are processed in forward order (first to last pool) or backward order (last to first pool).

Value

v1.SwapDirection

Forward

v1.SwapDirection

Value

<zero>

Backward

v1.SwapDirection

Value

<zero>

MultiSwapExecutor

type

MultiSwapExecutor defines the interface for multi-hop swap operation execution.

Value

v1.MultiSwapExecutor

DryMultiSwapExecutor

type

DryMultiSwapExecutor implements MultiSwapExecutor for dry run simulations.

Value

v1.DryMultiSwapExecutor

RealMultiSwapExecutor

type

RealMultiSwapExecutor implements MultiSwapExecutor for actual swap operations.

Value

v1.RealMultiSwapExecutor

MultiSwapProcessor

type

MultiSwapProcessor handles the execution flow for multi-hop swaps.

Value

v1.MultiSwapProcessor

newRealMultiSwapProcessor

func(int, rlm .uverse.realm, r *v1.routerV1, direction v1.SwapDirection, payer .uverse.address) *v1.MultiSwapProcessor

newRealMultiSwapProcessor creates a processor that performs real swaps.

Open
OID
0be141…5233:48
newRealMultiSwapProcessor details

Inspect func

newDryMultiSwapProcessor

func(r *v1.routerV1, direction v1.SwapDirection, payer .uverse.address) *v1.MultiSwapProcessor

newDryMultiSwapProcessor creates a processor that performs dry-run simulations.

Open
OID
0be141…5233:50
newDryMultiSwapProcessor details

Inspect func

SwapExecutor

type

SwapExecutor defines the interface for executing swaps.

Value

v1.SwapExecutor

rawUnknown

untyped string

Value

"UNKNOWN"

rawExactIn

untyped string

Value

"EXACT_IN"

rawExactOut

untyped string

Value

"EXACT_OUT"

SwapType

type

Value

v1.SwapType

Unknown

v1.SwapType

Value

<gnolang.StringValue>

ExactIn

v1.SwapType

Value

<gnolang.StringValue>

ExactOut

v1.SwapType

Value

<gnolang.StringValue>

trySwapTypeFromStr

func(swapType string) (v1.SwapType, .uverse.error)

trySwapTypeFromStr attempts to convert a string into a SwapType. It validates and converts string representations of swap types into their corresponding enum values.

Open
OID
0be141…5233:51
trySwapTypeFromStr details

Inspect func

SingleSwapParams

type

SingleSwapParams contains parameters for executing a single pool swap. It represents the simplest form of swap that occurs within a single liquidity pool.

Value

v1.SingleSwapParams

SwapParams

type

SwapParams contains parameters for executing a multi-hop swap operation.

Value

v1.SwapParams

newSwapParams

func(tokenIn string, tokenOut string, fee uint32, recipient .uverse.address, amountSpecified int64) *v1.SwapParams

newSwapParams creates a new SwapParams instance with the provided parameters.

Open
OID
0be141…5233:53
newSwapParams details

Inspect func

SwapResult

type

SwapResult encapsulates the outcome of a swap operation.

Value

v1.SwapResult

SwapParamsI

type

SwapParamsI defines the common interface for swap parameters.

Value

v1.SwapParamsI

SwapCallbackData

type

SwapCallbackData contains the callback data required for swap execution. This type is used to pass necessary information during the swap callback process, ensuring proper token transfers and pool data updates.

Value

v1.SwapCallbackData

newSwapCallbackData

func(params v1.SwapParamsI, payer .uverse.address) v1.SwapCallbackData

newSwapCallbackData creates a new SwapCallbackData from a SwapParamsI.

Open
OID
0be141…5233:54
newSwapCallbackData details

Inspect func

ExactInParams

type

ExactInParams contains parameters for exact input swaps.

Value

v1.ExactInParams

NewExactInParams

func(baseParams v1.BaseSwapParams, amountIn int64, amountOutMin int64) v1.ExactInParams

NewExactInParams creates a new ExactInParams instance.

Open
OID
0be141…5233:55
NewExactInParams details

Inspect func

ExactOutParams

type

ExactOutParams contains parameters for exact output swaps.

Value

v1.ExactOutParams

NewExactOutParams

func(baseParams v1.BaseSwapParams, amountOut int64, amountInMax int64) v1.ExactOutParams

NewExactOutParams creates a new ExactOutParams instance.

Open
OID
0be141…5233:56
NewExactOutParams details

Inspect func

calculateSwapAmountByQuote

func(amountSpecified int64, quote string) (int64, .uverse.error)

calculateSwapAmountByQuote calculates swap amount based on quote percentage.

Open
OID
0be141…5233:57
calculateSwapAmountByQuote details

Inspect func

assertHopsInRange

func(hops int)

assertHopsInRange ensures the number of hops is within the valid range of 1-3.

Open
OID
0be141…5233:59
assertHopsInRange details

Inspect func

getDataForSinglePath

func(poolPath string) (token0 string, token1 string, fee uint32)

getDataForSinglePath extracts token addresses and fee from a single pool path. IMPORTANT: This function returns tokens in the order they appear in the route string, which represents the swap direction (tokenIn:tokenOut:fee), NOT the canonical pool ordering.

Open
OID
0be141…5233:60
getDataForSinglePath details

Inspect func

getDataForSinglePathWithError

func(poolPath string) (string, string, uint32, .uverse.error)

getDataForSinglePathWithError extracts token addresses and fee from a single pool path with error handling.

Open
OID
0be141…5233:61
getDataForSinglePathWithError details

Inspect func

getDataForMultiPath

func(possiblePath string, poolIdx int) (token0 string, token1 string, fee uint32)

getDataForMultiPath extracts token addresses and fee from a multi-hop path at specified index.

Open
OID
0be141…5233:62
getDataForMultiPath details

Inspect func

i256MinMax

func(x *int256.Int, y *int256.Int) (min *uint256.Uint, max *uint256.Uint)

i256MinMax returns the absolute values of x and y in min-max order.

Open
OID
0be141…5233:63
i256MinMax details

Inspect func

validateRoutePaths

func(routePathArrString string, inputToken string, outputToken string) .uverse.error

validateRoutePaths validates multiple route paths to ensure they all start with inputToken and end with outputToken. This function processes comma-separated route paths and validates each path individually. Validates: - Each route path starts with the specified inputToken - Each route path ends with the specified outputToken - Route path format consistency (prevents swap-direction vs alphabetical pool ordering confusion) Parameters: - routePathArrString: comma-separated route paths (e.g., "gno.land/r/demo/wugnot:gno.land/r/demo/usdc:500,gno.land/r/demo/wugnot:gno.land/r/demo/gns:3000\*POOL\*gno.land/r/demo/gns:gno.land/r/demo/usdc:500") - inputToken: expected first token in all route paths - outputToken: expected last token in all route paths Examples: - Single route: "tokenA:tokenB:500" with inputToken="tokenA", outputToken="tokenB" - Multi-route: "tokenA:tokenB:500,tokenA:tokenC:3000\*POOL\*tokenC:tokenB:500" with inputToken="tokenA", outputToken="tokenB" Returns error if any route path validation fails.

Open
OID
0be141…5233:64
validateRoutePaths details

Inspect func

validateRoutePath

func(routePath string, inputToken string, outputToken string) .uverse.error

validateRoutePath validates a single route path to ensure it starts with inputToken and ends with outputToken. This function handles both single-hop and multi-hop route paths. Validates: - Route path starts with the specified inputToken - Route path ends with the specified outputToken - Proper token ordering in swap direction (not alphabetical pool ordering) Route Path Formats: - single-hop: "tokenA:tokenB:fee" (direct swap between two tokens) - multi-hop: "tokenA:tokenB:fee1\*POOL\*tokenB:tokenC:fee2" (swap through intermediate tokens) Parameters: - routePath: single route path string (e.g., "gno.land/r/demo/wugnot:gno.land/r/demo/usdc:500") - inputToken: expected first token in the route path - outputToken: expected last token in the route path Examples: - single-hop: "tokenA:tokenB:500" with inputToken="tokenA", outputToken="tokenB" - multi-hop: "tokenA:tokenB:3000\*POOL\*tokenB:tokenC:500" with inputToken="tokenA", outputToken="tokenC" Returns error with specific details if validation fails.

Open
OID
0be141…5233:65
validateRoutePath details

Inspect func

validatePoolPathHopContinuity

func(routePoolPaths []string) .uverse.error
Open
OID
0be141…5233:66
validatePoolPathHopContinuity details

Inspect func

splitSingleChar

func(s string, sep uint8) []string

splitSingleChar splits a string by a single character separator. This function is optimized for splitting strings with a single-byte separator and is more memory efficient than strings.Split for this use case.

Open
OID
0be141…5233:67
splitSingleChar details

Inspect func

parsePoolPathsByRoutePathArr

func(routePathArr string) ([]string, .uverse.error)

parsePoolPathsByRoutePathArr parses route path array string and returns a slice of pool paths. This function converts route paths (which maintain swap direction) into canonical pool paths (which use alphabetical token ordering). The function processes comma-separated route paths and extracts individual pool information from each route, ensuring tokens are ordered alphabetically for consistent pool identification. Parameters: - routePathArr: comma-separated route paths string containing single or multi-hop routes Format examples: - Single route: "tokenA:tokenB:500" - Multiple routes: "tokenA:tokenB:500,tokenC:tokenD:3000" - Multi-hop routes: "tokenA:tokenB:500\*POOL\*tokenB:tokenC:3000" Returns: - \[]string: slice of canonical pool paths with alphabetically ordered tokens - error: parsing error if any route path is invalid Example: input: "gno.land/r/demo/wugnot:gno.land/r/demo/usdc:500,gno.land/r/demo/usdc:gno.land/r/demo/gns:3000" output: ["gno.land/r/demo/usdc:gno.land/r/demo/wugnot:500", "gno.land/r/demo/gns:gno.land/r/demo/usdc:3000"]

Open
OID
0be141…5233:68
parsePoolPathsByRoutePathArr details

Inspect func

BuildSingleHopRoutePath

func(tokenA string, tokenB string, fee uint32) string

BuildSingleHopPath creates a single-hop route path string. Format: "tokenA:tokenB:fee" Parameters: - tokenA: input token address - tokenB: output token address - fee: pool fee (e.g., 500, 3000, 10000) Returns: - string: formatted single-hop route path Example: - BuildSingleHopPath("gno.land/r/demo/wugnot", "gno.land/r/demo/usdc", 500) returns "gno.land/r/demo/wugnot:gno.land/r/demo/usdc:500"

Open
OID
0be141…5233:69
BuildSingleHopRoutePath details

Inspect func
assertIsNotExpired : func(deadline int64) Inspect
assertIsValidSqrtPriceLimitX96 : func(sqrtPriceLimitX96 string) Inspect
assertIsValidSingleSwapRouteArrPath : func(routePaths string, inputToken string, outputToken string) Inspect
assertIsValidRoutePaths : func(routePaths string, inputToken string, outputToken string) Inspect
assertIsExistsPools : func(routePathArr string) Inspect
assertIsRouterImplementation : func(caller .uverse.address) Inspect
SINGLE_HOP_ROUTE : int =1
POOL_SEPARATOR : untyped string ="*POOL*"
RouterOperation : type =v1.RouterOperation
executeSwapOperation : func(int, rlm .uverse.realm, op v1.RouterOperation) (*v1.SwapResult, .uverse.error) Inspect
BaseSwapParams : type =v1.BaseSwapParams
baseSwapOperation : type =v1.baseSwapOperation
SwapRouteParams : type =v1.SwapRouteParams
buildRouteEventAttrs : func(routeArr string) []string Inspect
createSwapOperation : func(r *v1.routerV1, params v1.SwapRouteParams) (v1.RouterOperation, .uverse.error) Inspect
routerImplAddr : .uverse.address =<gnolang.StringValue>
init.16 : func() Inspect
errSlippage : untyped string ="[GNOSWAP-ROUTER-001] slippage check failed"
errInvalidRoutesAndQuotes : untyped string ="[GNOSWAP-ROUTER-002] invalid routes and quotes"
errExpired : untyped string ="[GNOSWAP-ROUTER-003] transaction expired"
errInvalidInput : untyped string ="[GNOSWAP-ROUTER-004] invalid input data"
errInvalidPoolFeeTier : untyped string ="[GNOSWAP-ROUTER-005] invalid pool fee tier"
errInvalidSwapFee : untyped string ="[GNOSWAP-ROUTER-006] invalid swap fee"
errInvalidSwapType : untyped string ="[GNOSWAP-ROUTER-007] invalid swap type"
errInvalidPoolPath : untyped string ="[GNOSWAP-ROUTER-008] invalid pool path"
errUnAuthorizedCaller : untyped string ="[GNOSWAP-ROUTER-009] unauthorized caller"
errHopsOutOfRange : untyped string ="[GNOSWAP-ROUTER-010] number of hops must be 1~3"
errSameTokenSwap : untyped string ="[GNOSWAP-ROUTER-011] cannot swap same token"
errInvalidRoutePath : untyped string ="[GNOSWAP-ROUTER-013] invalid route path"
errInvalidRouteFirstToken : untyped string ="[GNOSWAP-ROUTER-014] invalid route first token"
errInvalidRouteLastToken : untyped string ="[GNOSWAP-ROUTER-015] invalid route last token"
errInvalidSwapAmount : untyped string ="[GNOSWAP-ROUTER-016] invalid swap amount"
errRouteHopDisconnected : untyped string ="[GNOSWAP-ROUTER-017] route hop disconnected"
errInsufficientBalance : untyped string ="[GNOSWAP-ROUTER-018] insufficient balance for swap"
errSpoofedRealm : untyped string ="[GNOSWAP-ROUTER-019] rlm does not match the current crossing frame"
addDetailToError : func(message string, detail string) string Inspect
makeErrorWithDetails : func(message string, detail string) .uverse.error Inspect
ExactInSwapOperation : type =v1.ExactInSwapOperation
NewExactInSwapOperation : func(r *v1.routerV1, pp v1.ExactInParams) *v1.ExactInSwapOperation Inspect
ExactOutSwapOperation : type =v1.ExactOutSwapOperation
NewExactOutSwapOperation : func(r *v1.routerV1, pp v1.ExactOutParams) *v1.ExactOutSwapOperation Inspect
defaultSwapFeeBPS : uint64 =15
init.42 : func() Inspect
registerRouterV1 : func() Inspect
initStoreData : func(int, rlm .uverse.realm, routerStore router.IRouterStore) .uverse.error Inspect
routerV1 : type =v1.routerV1
NewRouterV1 : func(routerStore router.IRouterStore) router.IRouter Inspect
calculateRouterFee : func(amount int64, swapFee uint64) int64 Inspect
calculateExactOutWithRouterFee : func(amount int64, swapFee uint64) int64 Inspect
errExactOutAmountExceeded : untyped string ="received more than requested in requested=%d, actual=%d"
errInvalidRouteLength : untyped string ="route length(%d) must be 1~7"
errRoutesQuotesMismatch : untyped string ="mismatch between routes(%d) and quotes(%d) length"
errInvalidQuote : untyped string ="invalid quote(%s) at index(%d)"
errInvalidQuoteValue : untyped string ="quote(%s) at index(%d) must be positive value"
errQuoteExceedsMax : untyped string ="quote(%s) at index(%d) must be less than or equal to %d"
errQuoteSumExceedsMax : untyped string ="quote sum exceeds 100 at index(%d)"
errInvalidQuoteSum : untyped string ="quote sum(%d) must be 100"
errExactInTooFewReceived : untyped string ="ExactIn: too few received (min:%d, got:%d)"
errExactOutTooMuchSpent : untyped string ="ExactOut: too much spent (max:%d, used:%d)"
errEmptyRoutes : untyped string ="routes cannot be empty"
SwapValidator : type =v1.SwapValidator
RouteParser : type =v1.RouteParser
NewRouteParser : func() *v1.RouteParser Inspect
validateRoutesAndQuotes : func(routes string, quotes string) ([]string, []string, .uverse.error) Inspect
MaxQuotePercentage : untyped bigint =(100 <untyped> bigint)
MinQuotePercentage : untyped bigint =(0 <untyped> bigint)
PERCENTAGE_DENOMINATOR : int64 =100
ErrUnknownSwapType : untyped string ="unknown swapType(%s)"
ErrInvalidPositiveAmount : untyped string ="invalid amount(%s), must be positive"
ErrInvalidZeroAmountLimit : untyped string ="invalid amountLimit(%s), should not be zero"
ErrInvalidQuoteRange : untyped string ="quote(%d) must be %d~%d"
SwapProcessor : type =v1.SwapProcessor
getPathIndex : func(swapType v1.SwapType, numHops int) int Inspect
MIN_SQRT_RATIO : string ="4295128739"
MAX_SQRT_RATIO : string ="1461446703485210103287273052203988822378723970342"
sqrtPriceLimitForward : map[uint32]*uint256.Uint Inspect
sqrtPriceLimitBackward : map[uint32]*uint256.Uint Inspect
init.77 : func() Inspect
RealSwapExecutor : type =v1.RealSwapExecutor
DrySwapExecutor : type =v1.DrySwapExecutor
calculateSqrtPriceLimitForSwap : func(zeroForOne bool, fee uint32, sqrtPriceLimitX96 *uint256.Uint) *uint256.Uint Inspect
mustGetSqrtPriceLimit : func(limits map[uint32]*uint256.Uint, fee uint32) *uint256.Uint Inspect
getMinTick : func(fee uint32) int32 Inspect
getMaxTick : func(fee uint32) int32 Inspect
SwapDirection : type =v1.SwapDirection
Forward : v1.SwapDirection =<zero>
Backward : v1.SwapDirection =<zero>
MultiSwapExecutor : type =v1.MultiSwapExecutor
DryMultiSwapExecutor : type =v1.DryMultiSwapExecutor
RealMultiSwapExecutor : type =v1.RealMultiSwapExecutor
MultiSwapProcessor : type =v1.MultiSwapProcessor
newRealMultiSwapProcessor : func(int, rlm .uverse.realm, r *v1.routerV1, direction v1.SwapDirection, payer .uverse.address) *v1.MultiSwapProcessor Inspect
newDryMultiSwapProcessor : func(r *v1.routerV1, direction v1.SwapDirection, payer .uverse.address) *v1.MultiSwapProcessor Inspect
SwapExecutor : type =v1.SwapExecutor
rawUnknown : untyped string ="UNKNOWN"
rawExactIn : untyped string ="EXACT_IN"
rawExactOut : untyped string ="EXACT_OUT"
SwapType : type =v1.SwapType
Unknown : v1.SwapType =<gnolang.StringValue>
ExactIn : v1.SwapType =<gnolang.StringValue>
ExactOut : v1.SwapType =<gnolang.StringValue>
trySwapTypeFromStr : func(swapType string) (v1.SwapType, .uverse.error) Inspect
SingleSwapParams : type =v1.SingleSwapParams
SwapParams : type =v1.SwapParams
newSwapParams : func(tokenIn string, tokenOut string, fee uint32, recipient .uverse.address, amountSpecified int64) *v1.SwapParams Inspect
SwapResult : type =v1.SwapResult
SwapParamsI : type =v1.SwapParamsI
SwapCallbackData : type =v1.SwapCallbackData
newSwapCallbackData : func(params v1.SwapParamsI, payer .uverse.address) v1.SwapCallbackData Inspect
ExactInParams : type =v1.ExactInParams
NewExactInParams : func(baseParams v1.BaseSwapParams, amountIn int64, amountOutMin int64) v1.ExactInParams Inspect
ExactOutParams : type =v1.ExactOutParams
NewExactOutParams : func(baseParams v1.BaseSwapParams, amountOut int64, amountInMax int64) v1.ExactOutParams Inspect
calculateSwapAmountByQuote : func(amountSpecified int64, quote string) (int64, .uverse.error) Inspect
assertHopsInRange : func(hops int) Inspect
getDataForSinglePath : func(poolPath string) (token0 string, token1 string, fee uint32) Inspect
getDataForSinglePathWithError : func(poolPath string) (string, string, uint32, .uverse.error) Inspect
getDataForMultiPath : func(possiblePath string, poolIdx int) (token0 string, token1 string, fee uint32) Inspect
i256MinMax : func(x *int256.Int, y *int256.Int) (min *uint256.Uint, max *uint256.Uint) Inspect
validateRoutePaths : func(routePathArrString string, inputToken string, outputToken string) .uverse.error Inspect
validateRoutePath : func(routePath string, inputToken string, outputToken string) .uverse.error Inspect
validatePoolPathHopContinuity : func(routePoolPaths []string) .uverse.error Inspect
splitSingleChar : func(s string, sep uint8) []string Inspect
parsePoolPathsByRoutePathArr : func(routePathArr string) ([]string, .uverse.error) Inspect
BuildSingleHopRoutePath : func(tokenA string, tokenB string, fee uint32) string Inspect