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/v1 package

Overview

package router handles token swaps through GnoSwap liquidity pools.

The router provides user-facing swap functions with slippage protection, multi-hop routing, and both exact-input and exact-output swap modes.

Live exact-input calls enforce a minimum output and deadline. Live exact-output calls enforce a maximum input and deadline. DrySwapRoute is read-only and has no deadline or transfer.

Function

NewRouterV1

func NewRouterV1( routerStore router.IRouterStore, ) router.IRouter

NewRouterV1 creates a router v1 implementation backed by routerStore.

Parameters:

  • routerStore: storage implementation used for swap-fee and pending protocol-fee state

Returns:

  • router: initialized IRouter implementation backed by routerStore

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/gnoswap/router/v1.NewRouterV1()"

Result