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

position package

Function

Mint

func Mint( cur realm, token0 string, token1 string, fee uint32, tickLower int32, tickUpper int32, amount0Desired string, amount1Desired string, amount0Min string, amount1Min string, deadline int64, mintTo address, referrer string, ) (uint64, string, string, string)

Mint creates a new liquidity position NFT.

Parameters:

  • cur: current realm context; callers use cross(cur) when crossing into this realm
  • token0: path of the first token in the pool
  • token1: path of the second token in the pool
  • fee: pool fee tier used to identify the pool
  • tickLower: lower tick boundary of the position's price range
  • tickUpper: upper tick boundary of the position's price range
  • amount0Desired: desired amount of token0 to provide
  • amount1Desired: desired amount of token1 to provide
  • amount0Min: minimum acceptable amount of token0 after price/slippage calculation
  • amount1Min: minimum acceptable amount of token1 after price/slippage calculation
  • deadline: transaction expiration timestamp
  • mintTo: recipient address of the position NFT
  • referrer: referrer identifier used for reward tracking

Returns:

  • positionId: newly minted position NFT token ID
  • liquidity: liquidity minted into the position, represented as a decimal string
  • amount0: actual amount of token0 added to the position, represented as a decimal string
  • amount1: actual amount of token1 added to the position, represented as a decimal string

Halt check: reverts while the Position halt scope is active.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/position" -func "Mint" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "http://127.0.0.1:26657" ADDRESSgnokey query -remote "http://127.0.0.1:26657" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/position" -func "Mint" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "http://127.0.0.1:26657" call.tx