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

cloneStringInt64Map

func(src map[string]int64) map[string]int64

cloneStringInt64Map returns a copy so callers cannot reach the stored map.

Open
OID
098f2d…29d5:3
cloneStringInt64Map details

Inspect func

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.

Open
OID
098f2d…29d5:5
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 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.

Open
OID
098f2d…29d5:7
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 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.

Open
OID
098f2d…29d5:8
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 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.

Open
OID
098f2d…29d5:9
ExactOutSingleSwapRoute details

Inspect func

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

Open
OID
098f2d…29d5:10
DrySwapRoute details

Inspect func

SwapCallback

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

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

Open
OID
098f2d…29d5:11
SwapCallback details

Inspect func

GetSwapFee

func() uint64

GetSwapFee 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

Open
OID
098f2d…29d5:12
GetSwapFee details

Inspect func

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

Open
OID
098f2d…29d5:13
SetSwapFee details

Inspect func

GetPendingProtocolFees

func() map[string]int64

GetPendingProtocolFees 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

Open
OID
098f2d…29d5:14
GetPendingProtocolFees details

Inspect func

Render

func(path string) string

Render delegates web rendering to the active implementation.

Open
OID
098f2d…29d5:15
Render details

Inspect func

domainPath

untyped string

Value

"gno.land/r/gnoswap/router"

currentAddress

.uverse.address

Value

<gnolang.StringValue>

initializeDomainStore

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

Inspect func

getImplementation

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

Inspect func

updateImplementation

func() .uverse.error
Open
OID
098f2d…29d5:25
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 v1.KVStore) router.IRouterStore

NewRouterStore 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

Open
OID
098f2d…29d5:26
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. 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

Open
OID
098f2d…29d5:28
RegisterInitializer details

Inspect func

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

Open
OID
098f2d…29d5:30
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation

Open
OID
098f2d…29d5:31
GetImplementationPackagePath details

Inspect func
cloneStringInt64Map : func(src map[string]int64) map[string]int64 Inspect
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, .uverse.error) 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
GetPendingProtocolFees : func() map[string]int64 Inspect
Render : func(path string) string Inspect
domainPath : untyped string ="gno.land/r/gnoswap/router"
currentAddress : .uverse.address =<gnolang.StringValue>
kvStore : *v1.kvStore Inspect
versionManager : *v1.versionManager Inspect
implementation : *v1.routerV1 Inspect
init.16 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore v1.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 v1.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