cloneStringInt64Map
func(src map[string]int64) map[string]int64cloneStringInt64Map returns a copy so callers cannot reach the stored map.
- OID
- 098f2d…29d5:3
cloneStringInt64Map details
ExactInSwapRoute
func(inputToken string, outputToken string, amountIn string, routeArr string, quoteArr string, amountOutMin string, deadline int64, referrer string) (string, string)ExactInSwapRoute executes a multi-hop swap for an exact input amount. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - inputToken: input token path - outputToken: output token path - amountIn: exact input amount - routeArr: encoded route - quoteArr: encoded quotes - amountOutMin: minimum output amount - deadline: transaction deadline - referrer: referral address Returns: - amountIn: input amount consumed - amountOut: net output amount delivered after the router fee Halt check: reverts while the Router halt scope is active.
- OID
- 098f2d…29d5:5
ExactInSwapRoute details
ExactInSingleSwapRoute
func(inputToken string, outputToken string, amountIn string, routeArr string, amountOutMin string, sqrtPriceLimitX96 string, deadline int64, referrer string) (string, string)ExactInSingleSwapRoute executes a single-hop swap for an exact input amount. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - inputToken: input token path - outputToken: output token path - amountIn: exact input amount - routeArr: encoded route - amountOutMin: minimum output amount - sqrtPriceLimitX96: Q64.96 price limit - deadline: transaction deadline - referrer: referral address Returns: - amountIn: input amount consumed (a nonzero price limit may stop early) - amountOut: net output amount delivered after the router fee Halt check: reverts while the Router halt scope is active.
- OID
- 098f2d…29d5:7
ExactInSingleSwapRoute details
ExactOutSwapRoute
func(inputToken string, outputToken string, amountOut string, routeArr string, quoteArr string, amountInMax string, deadline int64, referrer string) (string, string)ExactOutSwapRoute executes a multi-hop swap for a requested post-fee output target. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - inputToken: input token path - outputToken: output token path - amountOut: requested net output target - routeArr: encoded route - quoteArr: encoded quotes - amountInMax: maximum input amount - deadline: transaction deadline - referrer: referral address Returns: - amountIn: input amount consumed - amountOut: net output delivered after the router fee Halt check: reverts while the Router halt scope is active.
- OID
- 098f2d…29d5:8
ExactOutSwapRoute details
ExactOutSingleSwapRoute
func(inputToken string, outputToken string, amountOut string, routeArr string, amountInMax string, sqrtPriceLimitX96 string, deadline int64, referrer string) (string, string)ExactOutSingleSwapRoute executes a single-hop swap for a requested post-fee output target. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - inputToken: input token path - outputToken: output token path - amountOut: requested net output target - routeArr: encoded route - amountInMax: maximum input amount - sqrtPriceLimitX96: Q64.96 price limit - deadline: transaction deadline - referrer: referral address Returns: - amountIn: input amount consumed (a nonzero price limit may stop early) - amountOut: net output delivered after the router fee; it may be below the requested target when the limit is reached Halt check: reverts while the Router halt scope is active.
- OID
- 098f2d…29d5:9
ExactOutSingleSwapRoute details
DrySwapRoute
func(inputToken string, outputToken string, specifiedAmount string, swapTypeStr string, strRouteArr string, quoteArr string, tokenAmountLimit string) (string, string, .uverse.error)DrySwapRoute simulates a swap route without changing state. Parameters: - inputToken: input token path - outputToken: output token path - specifiedAmount: exact input or output amount - swapTypeStr: \`EXACT\_IN\` or \`EXACT\_OUT\` - strRouteArr: encoded route - quoteArr: encoded quotes - tokenAmountLimit: minimum output or maximum input amount Returns: - amountIn: estimated input amount - amountOut: estimated output amount - err: non-nil when route validation or simulation fails
- OID
- 098f2d…29d5:10
DrySwapRoute details
SwapCallback
func(token0Path string, token1Path string, amount0Delta int64, amount1Delta int64, payer .uverse.address) .uverse.errorSwapCallback transfers amounts owed by a pool during a swap. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - token0Path: token0 path - token1Path: token1 path - amount0Delta: token0 amount owed to or by the pool - amount1Delta: token1 amount owed to or by the pool - payer: address that supplies positive deltas Returns: - err: non-nil when payment validation or transfer fails Halt check: reverts while the Router halt scope is active.
- OID
- 098f2d…29d5:11
SwapCallback details
GetSwapFee
func() uint64GetSwapFee retrieves the current swap fee from persistent storage. Returns: - fee: configured router fee in basis points; panics if the key is missing or has the wrong type
- OID
- 098f2d…29d5:12
GetSwapFee details
SetSwapFee
func(fee uint64)SetSwapFee stores the router fee in persistent storage. Parameters: - \_: leading call discriminator; callers pass 0 - rlm: current realm context; must be the current crossing frame - fee: router fee rate in basis points Returns: - err: nil when storage succeeds; an error when rlm is not current or KVStore rejects the write
- OID
- 098f2d…29d5:13
SetSwapFee details
GetPendingProtocolFees
func() map[string]int64GetPendingProtocolFees retrieves the token-path keyed pending protocol-fees map. Returns: - fees: stored token-path to pending amount map; panics if storage is missing or has the wrong type
- OID
- 098f2d…29d5:14
GetPendingProtocolFees details
Render
func(path string) stringRender delegates web rendering to the active implementation.
- OID
- 098f2d…29d5:15
Render details
domainPath
untyped stringValue
"gno.land/r/gnoswap/router"
currentAddress
.uverse.addressValue
<gnolang.StringValue>
kvStore
*v1.kvStore- OID
- 098f2d…29d5:34
kvStore details
versionManager
*v1.versionManager- OID
- 098f2d…29d5:38
versionManager details
implementation
*v1.routerV1- OID
- 0be141…5233:69
implementation details
init.16
func()- OID
- 098f2d…29d5:21
init.16 details
initializeDomainStore
func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}- OID
- 098f2d…29d5:23
initializeDomainStore details
getImplementation
func() router.IRouter- OID
- 098f2d…29d5:24
getImplementation details
updateImplementation
func() .uverse.error- OID
- 098f2d…29d5:25
updateImplementation details
errSpoofedRealm
untyped stringValue
"rlm does not match the current crossing frame"
StoreKey
typeValue
router.StoreKey
StoreKeySwapFee
router.StoreKey// Swap fee in basis points
Value
<gnolang.StringValue>
StoreKeyPendingProtocolFees
router.StoreKey// tokenPath -> amount held locally for protocol\_fee
Value
<gnolang.StringValue>
routerStore
typeValue
router.routerStore
NewRouterStore
func(kvStore v1.KVStore) router.IRouterStoreNewRouterStore creates a router store backed by the provided KV store. Parameters: - kvStore: persistent key-value store used for router fee and pending-fee data Returns: - routerStore: router storage implementation using kvStore
- OID
- 098f2d…29d5:26
NewRouterStore details
IRouter
typeValue
router.IRouter
IRouterStore
typeValue
router.IRouterStore
RegisterInitializer
func(initializer func(...))RegisterInitializer registers a new router implementation version. Each implementation package calls it during initialization before it can be selected. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - initializer: callback that receives the propagated realm context and router store, then constructs the IRouter implementation
- OID
- 098f2d…29d5:28
RegisterInitializer details
UpgradeImpl
func(packagePath string)UpgradeImpl switches the active router implementation to a different registered version. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - packagePath: package path of the previously registered implementation to activate
- OID
- 098f2d…29d5:30
UpgradeImpl details
GetImplementationPackagePath
func() stringGetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation
- OID
- 098f2d…29d5:31