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

router state

Back to all declarations

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

Open
OID
098f2d…29d5:3
ExactInSwapRoute details

Inspect func

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

Open
OID
098f2d…29d5:5
ExactInSingleSwapRoute details

Inspect func

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

Open
OID
098f2d…29d5:6
ExactOutSwapRoute details

Inspect func

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

Open
OID
098f2d…29d5:7
ExactOutSingleSwapRoute details

Inspect func

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

Open
OID
098f2d…29d5:8
DrySwapRoute details

Inspect func

SwapCallback

func(token0Path string, token1Path string, amount0Delta int64, amount1Delta int64, payer .uverse.address) .uverse.error

SwapCallback is called by pools to transfer tokens during a swap.

Open
OID
098f2d…29d5:9
SwapCallback details

Inspect func

GetSwapFee

func() uint64

GetSwapFee retrieves the current swap fee. If not set, returns the default swap fee.

Open
OID
098f2d…29d5:10
GetSwapFee details

Inspect func

SetSwapFee

func(fee uint64)

SetSwapFee stores the swap fee.

Open
OID
098f2d…29d5:11
SetSwapFee details

Inspect func

domainPath

untyped string

Value

"gno.land/r/gnoswap/router"

currentAddress

.uverse.address

Value

<gnolang.StringValue>

versionManager

*version_manager.versionManager
Open
OID
098f2d…29d5:33
versionManager details

Inspect pointer

initializeDomainStore

func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...}
Open
OID
098f2d…29d5:18
initializeDomainStore details

Inspect func

getImplementation

func() router.IRouter
Open
OID
098f2d…29d5:19
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
098f2d…29d5:20
updateImplementation details

Inspect func

errSpoofedRealm

untyped string

Value

"rlm does not match the current crossing frame"

StoreKey

type

Value

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

type

Value

router.routerStore

NewRouterStore

func(kvStore store.KVStore) router.IRouterStore

NewRouterStore 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.

Open
OID
098f2d…29d5:21
NewRouterStore details

Inspect func

IRouter

type

Value

router.IRouter

IRouterStore

type

Value

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.

Open
OID
098f2d…29d5:23
RegisterInitializer details

Inspect func

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.

Open
OID
098f2d…29d5:25
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation.

Open
OID
098f2d…29d5:26
GetImplementationPackagePath details

Inspect func
ExactInSwapRoute : func(inputToken string, outputToken string, amountIn string, routeArr string, quoteArr string, amountOutMin string, deadline int64, referrer string) (string, string) Inspect
ExactInSingleSwapRoute : func(inputToken string, outputToken string, amountIn string, routeArr string, amountOutMin string, sqrtPriceLimitX96 string, deadline int64, referrer string) (string, string) Inspect
ExactOutSwapRoute : func(inputToken string, outputToken string, amountOut string, routeArr string, quoteArr string, amountInMax string, deadline int64, referrer string) (string, string) Inspect
ExactOutSingleSwapRoute : func(inputToken string, outputToken string, amountOut string, routeArr string, amountInMax string, sqrtPriceLimitX96 string, deadline int64, referrer string) (string, string) Inspect
DrySwapRoute : func(inputToken string, outputToken string, specifiedAmount string, swapTypeStr string, strRouteArr string, quoteArr string, tokenAmountLimit string) (string, string, bool) Inspect
SwapCallback : func(token0Path string, token1Path string, amount0Delta int64, amount1Delta int64, payer .uverse.address) .uverse.error Inspect
GetSwapFee : func() uint64 Inspect
SetSwapFee : func(fee uint64) Inspect
domainPath : untyped string ="gno.land/r/gnoswap/router"
currentAddress : .uverse.address =<gnolang.StringValue>
kvStore : *store.kvStore Inspect
versionManager : *version_manager.versionManager Inspect
implementation : *v1.routerV1 Inspect
init.13 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...} Inspect
getImplementation : func() router.IRouter Inspect
updateImplementation : func() .uverse.error Inspect
errSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
StoreKey : type =router.StoreKey
StoreKeySwapFee : router.StoreKey =<gnolang.StringValue>
StoreKeyPendingProtocolFees : router.StoreKey =<gnolang.StringValue>
routerStore : type =router.routerStore
NewRouterStore : func(kvStore store.KVStore) router.IRouterStore Inspect
IRouter : type =router.IRouter
IRouterStore : type =router.IRouterStore
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(packagePath string) Inspect
GetImplementationPackagePath : func() string Inspect