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 with exact input amount. Parameters: - inputToken: path of input token - outputToken: path of output token - amountIn: exact input amount - routeArr: encoded route array - quoteArr: encoded quote array - amountOutMin: minimum output amount - deadline: transaction deadline - referrer: referrer address for reward tracking Returns: - string: actual input amount - string: actual output amount
- OID
- 098f2d…29d5:3
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 with exact input amount. Parameters: - inputToken: path of input token - outputToken: path of output token - amountIn: exact input amount - routeArr: encoded route - amountOutMin: minimum output amount - sqrtPriceLimitX96: price limit for the swap - deadline: transaction deadline - referrer: referrer address for reward tracking Returns: - string: actual input amount - string: actual output amount
- OID
- 098f2d…29d5:5
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 with exact output amount. Parameters: - inputToken: path of input token - outputToken: path of output token - amountOut: exact output amount - routeArr: encoded route array - quoteArr: encoded quote array - amountInMax: maximum input amount - deadline: transaction deadline - referrer: referrer address for reward tracking Returns: - string: actual input amount - string: actual output amount
- OID
- 098f2d…29d5:6
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 with exact output amount. Parameters: - inputToken: path of input token - outputToken: path of output token - amountOut: exact output amount - routeArr: encoded route - amountInMax: maximum input amount - sqrtPriceLimitX96: price limit for the swap - deadline: transaction deadline - referrer: referrer address for reward tracking Returns: - string: actual input amount - string: actual output amount
- OID
- 098f2d…29d5:7
ExactOutSingleSwapRoute details
DrySwapRoute
func(inputToken string, outputToken string, specifiedAmount string, swapTypeStr string, strRouteArr string, quoteArr string, tokenAmountLimit string) (string, string, bool)DrySwapRoute simulates a swap route without executing it. Parameters: - inputToken: path of input token - outputToken: path of output token - specifiedAmount: specified amount for the swap - swapTypeStr: swap type string ("ExactIn" or "ExactOut") - strRouteArr: encoded route array - quoteArr: encoded quote array - tokenAmountLimit: token amount limit Returns: - string: estimated input amount - string: estimated output amount - bool: success status
- OID
- 098f2d…29d5:8
DrySwapRoute details
SwapCallback
func(token0Path string, token1Path string, amount0Delta int64, amount1Delta int64, payer .uverse.address) .uverse.errorSwapCallback is called by pools to transfer tokens during a swap.
- OID
- 098f2d…29d5:9
SwapCallback details
GetSwapFee
func() uint64GetSwapFee retrieves the current swap fee. If not set, returns the default swap fee.
- OID
- 098f2d…29d5:10
GetSwapFee details
SetSwapFee
func(fee uint64)SetSwapFee stores the swap fee.
- OID
- 098f2d…29d5:11
SetSwapFee details
domainPath
untyped stringValue
"gno.land/r/gnoswap/router"
currentAddress
.uverse.addressValue
<gnolang.StringValue>
kvStore
*store.kvStore- OID
- 098f2d…29d5:29
kvStore details
versionManager
*version_manager.versionManager- OID
- 098f2d…29d5:33
versionManager details
implementation
*v1.routerV1- OID
- 0be141…5233:75
implementation details
init.13
func()- OID
- 098f2d…29d5:16
init.13 details
initializeDomainStore
func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...}- OID
- 098f2d…29d5:18
initializeDomainStore details
getImplementation
func() router.IRouter- OID
- 098f2d…29d5:19
getImplementation details
updateImplementation
func() .uverse.error- OID
- 098f2d…29d5:20
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 store.KVStore) router.IRouterStoreNewRouterStore creates a new router store instance with the provided KV store. This function is used by the upgrade system to create storage instances for each implementation.
- OID
- 098f2d…29d5:21
NewRouterStore details
IRouter
typeValue
router.IRouter
IRouterStore
typeValue
router.IRouterStore
RegisterInitializer
func(initializer func(...))RegisterInitializer registers a new router implementation version. This function is called by each version (v1, v2, etc.) during initialization to register their implementation with the proxy system. The initializer function creates a new instance of the implementation using the provided routerStore interface. Security: Only contracts within the domain path can register initializers. Each package path can only register once to prevent duplicate registrations.
- OID
- 098f2d…29d5:23
RegisterInitializer details
UpgradeImpl
func(packagePath string)UpgradeImpl switches the active router implementation to a different version. This function allows seamless upgrades from one version to another without data migration or downtime. Security: Only admin or governance can perform upgrades. The new implementation must have been previously registered via RegisterInitializer.
- OID
- 098f2d…29d5:25
UpgradeImpl details
GetImplementationPackagePath
func() stringGetImplementationPackagePath returns the package path of the currently active implementation.
- OID
- 098f2d…29d5:26